Skip to content

Commit

Permalink
test/AxisMr: Handle motor 7.09
Browse files Browse the repository at this point in the history
Add a slight workaround for a floating point problem:
Even if `caget IOC:m1.VERS` gives 7.09,
the python code gets a value slightly above 7.09,
making the comparison " <= 7.09" fail.
Solution:
use 7.091 instead of 7.09
  • Loading branch information
tboegi committed Mar 8, 2024
1 parent 48ee6e6 commit fe44628
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion test/pytests36/AxisMr.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,8 @@ def __init__(self, axisCom, url_string=None):
# Dummy read to give the IOC time to start
try:
vers = float(self.axisCom.get(".VERS"))
if vers >= 6.94 and vers <= 7.09:
# 7.09 is rounded to 7.0900001xxx; use 7.091
if vers >= 6.94 and vers <= 7.091:
self.hasFieldSPAM = True
self.isMotorMasterAxis = False
else:
Expand Down

0 comments on commit fe44628

Please sign in to comment.