From eb3826ec35dd61ec76fc8ff699a7b34c4cea7bd4 Mon Sep 17 00:00:00 2001 From: smathis Date: Tue, 10 Jun 2025 11:15:40 +0200 Subject: [PATCH] Stop or reset now also resets the deferred movement flags --- src/detectorTowerAngleAxis.cpp | 8 ++++++++ src/detectorTowerLiftAxis.cpp | 33 ++------------------------------- 2 files changed, 10 insertions(+), 31 deletions(-) diff --git a/src/detectorTowerAngleAxis.cpp b/src/detectorTowerAngleAxis.cpp index 9ed8407..af8a48b 100644 --- a/src/detectorTowerAngleAxis.cpp +++ b/src/detectorTowerAngleAxis.cpp @@ -343,6 +343,10 @@ asynStatus detectorTowerAngleAxis::stop(double acceleration) { return asynError; } + // Reset the deferred movement flags + startingDeferredMovement_ = false; + deferredMovementWait_ = false; + return rwStatus; } @@ -526,6 +530,10 @@ asynStatus detectorTowerAngleAxis::doReset() { __PRETTY_FUNCTION__, __LINE__); } + // Reset the deferred movement flags + startingDeferredMovement_ = false; + deferredMovementWait_ = false; + /* Check which action should be performed: - If error_ == 10 or 11 (FTZ motor error): P352 = 3 (Recover FTZ) diff --git a/src/detectorTowerLiftAxis.cpp b/src/detectorTowerLiftAxis.cpp index f94e851..9e7e1c0 100644 --- a/src/detectorTowerLiftAxis.cpp +++ b/src/detectorTowerLiftAxis.cpp @@ -192,37 +192,8 @@ asynStatus detectorTowerLiftAxis::doMove(double position, int relative, asynStatus detectorTowerLiftAxis::reset() { return angleAxis()->reset(); }; asynStatus detectorTowerLiftAxis::stop(double acceleration) { - - // Status of read-write-operations of ASCII commands to the controller - asynStatus rwStatus = asynSuccess; - - // Status of parameter library operations - asynStatus plStatus = asynSuccess; - - char response[pC_->MAXBUF_] = {0}; - - // ========================================================================= - - rwStatus = pC_->writeRead(axisNo_, "P350=8", response, 0); - - if (rwStatus != asynSuccess) { - asynPrint(pC_->pasynUser(), ASYN_TRACE_ERROR, - "Controller \"%s\", axis %d => %s, line %d\nStopping " - "the movement " - "failed.\n", - pC_->portName, axisNo_, __PRETTY_FUNCTION__, __LINE__); - - plStatus = setIntegerParam(pC_->motorStatusProblem(), true); - if (plStatus != asynSuccess) { - return pC_->paramLibAccessFailed(plStatus, "motorStatusProblem_", - axisNo_, __PRETTY_FUNCTION__, - __LINE__); - } - return asynError; - } - - return rwStatus; -} + return angleAxis()->stop(acceleration); +}; asynStatus detectorTowerLiftAxis::readEncoderType() { return angleAxis()->readEncoderType();