From 55ed2f9fac52b7b8724886d6694708abaa850e84 Mon Sep 17 00:00:00 2001 From: Tom Trafford Date: Fri, 6 Feb 2026 15:25:20 +0000 Subject: [PATCH] Set brick to calculate velocity profile and not to raise warning on Motion Program 4.0 --- malcolm/modules/pmac/blocks/pmac_trajectory_block.yaml | 6 ++++++ malcolm/modules/pmac/parts/pmactrajectorypart.py | 4 ++-- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/malcolm/modules/pmac/blocks/pmac_trajectory_block.yaml b/malcolm/modules/pmac/blocks/pmac_trajectory_block.yaml index 3bf41ba3b..3e1e2092b 100644 --- a/malcolm/modules/pmac/blocks/pmac_trajectory_block.yaml +++ b/malcolm/modules/pmac/blocks/pmac_trajectory_block.yaml @@ -218,3 +218,9 @@ description: the version number of the pmac's trajectory program rbv: $(pv_prefix):ProgramVersion_RBV config: False + +- ca.parts.CAChoicePart: + name: calculateVelocities + description: Does the brick need to calculate the velocity profile + pv: $(pv_prefix):ProfileCalcVel + config: False diff --git a/malcolm/modules/pmac/parts/pmactrajectorypart.py b/malcolm/modules/pmac/parts/pmactrajectorypart.py index acf5581f8..a01605931 100644 --- a/malcolm/modules/pmac/parts/pmactrajectorypart.py +++ b/malcolm/modules/pmac/parts/pmactrajectorypart.py @@ -110,9 +110,9 @@ def write_profile( z: ADemandTrajectory = None, ) -> None: child = context.block_view(self.mri) - + child.calculateVelocities.put_value("YES") # make sure a matching trajectory program is installed on the pmac - if child.trajectoryProgVersion.value != TRAJECTORY_PROGRAM_NUM: + if child.trajectoryProgVersion.value < TRAJECTORY_PROGRAM_NUM: if child.trajectoryProgVersion.value >= FALLBACK_TRAJ_PROGRAM_NUM: self.log.warning( f"pmac trajectory program is version {FALLBACK_TRAJ_PROGRAM_NUM}"