From 50137cdda85aa8aceedb05b0170f6781ccd80be7 Mon Sep 17 00:00:00 2001 From: KaushikMalapati Date: Wed, 15 Jan 2025 00:33:05 -0800 Subject: [PATCH] running precommit --- .../POUs/Motion/PMPS/FB_MotionBPTM.TcPOU | 6 +- .../PMPS/FB_PositionStatePMPSND_Core.TcPOU | 12 +- .../Tests/FB_PositionStatePMPSND_Test.TcPOU | 118 +++++++++--------- 3 files changed, 68 insertions(+), 68 deletions(-) diff --git a/lcls-twincat-motion/Library/POUs/Motion/PMPS/FB_MotionBPTM.TcPOU b/lcls-twincat-motion/Library/POUs/Motion/PMPS/FB_MotionBPTM.TcPOU index 9905f85..53fba13 100644 --- a/lcls-twincat-motion/Library/POUs/Motion/PMPS/FB_MotionBPTM.TcPOU +++ b/lcls-twincat-motion/Library/POUs/Motion/PMPS/FB_MotionBPTM.TcPOU @@ -36,8 +36,8 @@ VAR_INPUT bMoveOnArbiterTimeout: BOOL := TRUE; // Set to TRUE when it is safe to reset the BPTM timeout fast fault, to reset it early. bResetBPTMTimeout: BOOL; - // Set to TRUE to make the BPTM retry - bRetry: BOOL; + // Set to TRUE to make the BPTM retry + bRetry: BOOL; END_VAR VAR_OUTPUT // This becomes TRUE when the motors are allowed to move to their destinations. @@ -120,7 +120,7 @@ bptm( i_stRequestedAssertion:=stGoalParams.stBeamParams, i_xDoneMoving:=bDoneMoving AND bAtState, stCurrentBeamParameters:=PMPS_GVL.stCurrentBeamParameters, - bRetry:=bRetry, + bRetry:=bRetry, q_xTransitionAuthorized=>bInternalAuth, bDone=>bDone, ); diff --git a/lcls-twincat-motion/Library/POUs/Motion/PMPS/FB_PositionStatePMPSND_Core.TcPOU b/lcls-twincat-motion/Library/POUs/Motion/PMPS/FB_PositionStatePMPSND_Core.TcPOU index 420ca1c..897a56a 100644 --- a/lcls-twincat-motion/Library/POUs/Motion/PMPS/FB_PositionStatePMPSND_Core.TcPOU +++ b/lcls-twincat-motion/Library/POUs/Motion/PMPS/FB_PositionStatePMPSND_Core.TcPOU @@ -58,11 +58,11 @@ VAR fbPerMotorFFO: FB_PerMotorFFOND; eStatePMPSStatus: E_StatePMPSStatus; - - bEnable: BOOL; - nGoalAtClear : UINT; - bAtStateAtClear : BOOL; - rtEnable: R_TRIG; + + bEnable: BOOL; + nGoalAtClear : UINT; + bAtStateAtClear : BOOL; + rtEnable: R_TRIG; END_VAR ]]> @@ -99,7 +99,7 @@ fbMotionBPTM( bEnable:=bEnable, bAtState:=stPlcToEpics.nGetValue = nCurrGoal AND nCurrGoal <> 0, sDeviceName:=sDeviceName, - bRetry:=rtEnable.Q AND nGoalAtClear = nCurrGoal AND bAtStateAtClear, + bRetry:=rtEnable.Q AND nGoalAtClear = nCurrGoal AND bAtStateAtClear, bTransitionAuthorized=>, bDone=>, bMotorCountError=>, diff --git a/lcls-twincat-motion/Library/Tests/FB_PositionStatePMPSND_Test.TcPOU b/lcls-twincat-motion/Library/Tests/FB_PositionStatePMPSND_Test.TcPOU index b6eb102..a587cb7 100644 --- a/lcls-twincat-motion/Library/Tests/FB_PositionStatePMPSND_Test.TcPOU +++ b/lcls-twincat-motion/Library/Tests/FB_PositionStatePMPSND_Test.TcPOU @@ -805,7 +805,7 @@ END_IF]]> @@ -824,71 +824,71 @@ eSetPos := 2; CASE nState OF 0: - fb_Move1D( - stMotionStage:=stMotionStage1, - astPositionState:=astPositionState1, - eEnumSet:= eSetPos, - eEnumGet:=eGetPos, - fbFFHWO:=fbFFHWO, - fbArbiter:=fbArbiter1D, - bEnableMotion:=TRUE, - bEnableBeamParams:=TRUE, - bEnablePositionLimits:=TRUE, - bReadDBNow:=TRUE, - sDeviceName:='test', - sTransitionKey:='trans', - ); + fb_Move1D( + stMotionStage:=stMotionStage1, + astPositionState:=astPositionState1, + eEnumSet:= eSetPos, + eEnumGet:=eGetPos, + fbFFHWO:=fbFFHWO, + fbArbiter:=fbArbiter1D, + bEnableMotion:=TRUE, + bEnableBeamParams:=TRUE, + bEnablePositionLimits:=TRUE, + bReadDBNow:=TRUE, + sDeviceName:='test', + sTransitionKey:='trans', + ); IF fb_Move1D.stPlcToEpics.bDone THEN - AssertTrue( - fbArbiter1D.CheckRequestInPool(astBeam[E_TestStates.TARGET1].nRequestAssertionID), - 'Destination bp should have been in the arbiter', - ); + AssertTrue( + fbArbiter1D.CheckRequestInPool(astBeam[E_TestStates.TARGET1].nRequestAssertionID), + 'Destination bp should have been in the arbiter', + ); nState := 1; END_IF - 1: - fb_Move1D.stPMPSEpicsToPlc.bArbiterEnabled := FALSE; - fb_Move1D( - stMotionStage:=stMotionStage1, - astPositionState:=astPositionState1, - eEnumSet:= eSetPos, - eEnumGet:=eGetPos, - fbFFHWO:=fbFFHWO, - fbArbiter:=fbArbiter1D, - bEnableMotion:=TRUE, - bEnableBeamParams:=TRUE, - bEnablePositionLimits:=TRUE, - bReadDBNow:=FALSE, - sDeviceName:='test', - sTransitionKey:='trans', - ); + 1: + fb_Move1D.stPMPSEpicsToPlc.bArbiterEnabled := FALSE; + fb_Move1D( + stMotionStage:=stMotionStage1, + astPositionState:=astPositionState1, + eEnumSet:= eSetPos, + eEnumGet:=eGetPos, + fbFFHWO:=fbFFHWO, + fbArbiter:=fbArbiter1D, + bEnableMotion:=TRUE, + bEnableBeamParams:=TRUE, + bEnablePositionLimits:=TRUE, + bReadDBNow:=FALSE, + sDeviceName:='test', + sTransitionKey:='trans', + ); IF fb_Move1D.stPlcToEpics.bDone THEN - AssertFalse( - fbArbiter1D.CheckRequestInPool(astBeam[E_TestStates.TARGET1].nRequestAssertionID), - 'Destination bp should have been in the arbiter', - ); + AssertFalse( + fbArbiter1D.CheckRequestInPool(astBeam[E_TestStates.TARGET1].nRequestAssertionID), + 'Destination bp should have been in the arbiter', + ); nState := 2; END_IF - 2: - fb_Move1D.stPMPSEpicsToPlc.bArbiterEnabled := TRUE; - fb_Move1D( - stMotionStage:=stMotionStage1, - astPositionState:=astPositionState1, - eEnumSet:= eSetPos, - eEnumGet:=eGetPos, - fbFFHWO:=fbFFHWO, - fbArbiter:=fbArbiter1D, - bEnableMotion:=TRUE, - bEnableBeamParams:=TRUE, - bEnablePositionLimits:=TRUE, - bReadDBNow:=FALSE, - sDeviceName:='test', - sTransitionKey:='trans', - ); + 2: + fb_Move1D.stPMPSEpicsToPlc.bArbiterEnabled := TRUE; + fb_Move1D( + stMotionStage:=stMotionStage1, + astPositionState:=astPositionState1, + eEnumSet:= eSetPos, + eEnumGet:=eGetPos, + fbFFHWO:=fbFFHWO, + fbArbiter:=fbArbiter1D, + bEnableMotion:=TRUE, + bEnableBeamParams:=TRUE, + bEnablePositionLimits:=TRUE, + bReadDBNow:=FALSE, + sDeviceName:='test', + sTransitionKey:='trans', + ); IF fb_Move1D.stPlcToEpics.bDone THEN - AssertTrue( - fbArbiter1D.CheckRequestInPool(astBeam[E_TestStates.TARGET1].nRequestAssertionID), - 'Destination bp should have been in the arbiter', - ); + AssertTrue( + fbArbiter1D.CheckRequestInPool(astBeam[E_TestStates.TARGET1].nRequestAssertionID), + 'Destination bp should have been in the arbiter', + ); nState := 3; END_IF 3: