加入Z轴运行控制,加快五轴运行速度

This commit is contained in:
2026-10-10 17:16:19 +08:00
parent cf86bd0702
commit 51accb9196
8 changed files with 58 additions and 49 deletions
+8 -2
View File
@@ -202,8 +202,14 @@ def test_accepting_the_prompt_starts_the_move(make_window, monkeypatch):
)
window._on_return_to_initial() # noqa: SLF001
assert window.mover.running, "accepting the prompt did not start the move"
assert [step.role for step in window.mover.state.plan.steps][0] == "z"
# The status line carries the plan, so the operator sees what is moving.
assert [step.role for step in window.mover.state.plan.steps] == [
"yaw",
"pitch",
"x",
"y",
"z",
]
assert window.mover.state.plan.together
assert "z" in window.finger_panel.move_label.text()
finally:
window.mover.cancel("test")
+15 -7
View File
@@ -31,7 +31,6 @@ from orisys_autocal.motion import (
from orisys_autocal.motion.models import AxisState, AxisStatusBits, BusStatus
from orisys_autocal.motion.pose_move import (
MOVE_ORDER,
RETURN_ORDER,
PoseMover,
SETTLE_DEG,
SETTLE_MM,
@@ -128,11 +127,12 @@ def test_the_plan_holds_back_what_it_is_not_given():
assert "z" in plan.describe()
def test_returning_to_zero_retracts_the_press_axis_first():
def test_returning_to_zero_moves_the_five_axes_together():
service = make_service()
plan = plan_return_to_initial(service)
assert [step.role for step in plan.steps] == list(RETURN_ORDER)
assert plan.steps[0].role == "z"
assert plan.together
assert [step.role for step in plan.steps] == ["yaw", "pitch", "x", "y", "z"]
assert plan.held == ()
assert all(step.target == 0.0 for step in plan.steps)
@@ -262,15 +262,23 @@ def test_an_execute_plan_moves_the_four_axes_together_and_leaves_z():
assert mover.state.finished
def test_return_to_zero_stays_one_axis_at_a_time():
def test_return_to_zero_is_one_command_for_the_five_axes():
service = make_service()
called: list[list[tuple[int, float]]] = []
def record(moves):
called.append(list(moves))
return MotionResult.success()
service.move_abs_many = record # type: ignore[method-assign]
poller = FakePoller(service)
mover = PoseMover(service, poller.submit)
plan = plan_return_to_initial(service)
assert not plan.together
assert mover.start(plan).ok
assert len(poller.commands) == 1
assert mover.state.step.role == "z"
poller.commands[0](service)
assert [axis for axis, _value in called[0]] == [3, 2, 0, 1, 4]
assert mover.progress_text().startswith("同时")
def test_the_mover_commands_one_axis_and_waits_for_it_to_arrive():