Skip to content

Commit 02c4f72

Browse files
Merge pull request #157 from DiamondLightSource/error_msg_CS_scaleZero
Add error message to pmacCSAxis::move to notify scale_==0
2 parents bce3070 + 3572349 commit 02c4f72

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

pmacApp/src/pmacCSAxis.cpp

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -213,8 +213,12 @@ asynStatus pmacCSAxis::move(double position, int /*relative*/, double min_veloci
213213
}
214214
}
215215

216-
deviceUnits = position / (double) scale_;
217-
216+
if (scale_ == 0) {
217+
debug(DEBUG_ERROR, functionName, "Error getting CSAxis scale");
218+
debug(DEBUG_ERROR, functionName, " scale_", scale_);
219+
} else {
220+
deviceUnits = position / static_cast<double>(scale_);
221+
}
218222

219223
if (pC_->movesDeferred_ == 0) {
220224
sprintf(command, "&%d%s%sQ7%d=%.12f", pC_->getCSNumber(), vel_buff,

0 commit comments

Comments
 (0)