Simplify JogCommand class structure, and remove unneeded event logic

This commit is contained in:
Julian Stirling 2026-02-13 16:53:03 +00:00
parent eb79905581
commit f4d11b3c83
2 changed files with 16 additions and 52 deletions

View file

@ -12,7 +12,7 @@ from labthings_fastapi.testing import create_thing_without_server
from openflexure_microscope_server.things.camera.simulation import SimulatedCamera
from openflexure_microscope_server.things.stage import (
BaseStage,
JogMoveCommand,
JogCommand,
RedefinedBaseMovementError,
)
from openflexure_microscope_server.things.stage.dummy import DummyStage
@ -307,10 +307,10 @@ def test_get_jog_from_queue_most_recent(dummy_stage):
"""Test that the jog queue gives the most recent Jog Command."""
# Try to stack 4 moves in the queue, only 1 should be queued.
for i in range(4):
dummy_stage._jog_queue.put(JogMoveCommand([i, i, i]))
dummy_stage._jog_queue.put(JogCommand([i, i, i]))
command = dummy_stage._get_from_jog_queue(0.001)
assert isinstance(command, JogMoveCommand)
assert isinstance(command, JogCommand)
# Should be the last one queued
assert command.displacement == [3, 3, 3]
# Nothing else is queued