Commit fcfb2155 authored by bliss administrator's avatar bliss administrator Committed by Matias Guijarro
Browse files

micos: fix all calls to _send_no_ans and _send, controller class renamed

to Micos
parent ccc29d59
...@@ -173,7 +173,7 @@ from bliss.common.logtools import ( ...@@ -173,7 +173,7 @@ from bliss.common.logtools import (
# -------------- Micos motor controller class ------------------ # -------------- Micos motor controller class ------------------
class micos(Controller): class Micos(Controller):
# Actions that can be executed automatically at power up # Actions that can be executed automatically at power up
# used with "setnpowerup" command # used with "setnpowerup" command
...@@ -265,6 +265,7 @@ class micos(Controller): ...@@ -265,6 +265,7 @@ class micos(Controller):
Opens serial line. Opens serial line.
""" """
log_info(self, "initialize()") log_info(self, "initialize()")
self._micos_enc = {}
try: try:
self.serial = get_comm( self.serial = get_comm(
self.config.config_dict, SERIAL, timeout=5, baudrate=19200, eol="\r\n" self.config.config_dict, SERIAL, timeout=5, baudrate=19200, eol="\r\n"
...@@ -732,7 +733,7 @@ class micos(Controller): ...@@ -732,7 +733,7 @@ class micos(Controller):
log_info(self, "set_on()") log_info(self, "set_on()")
_cmd = "1 %d setaxis " % axis.number _cmd = "1 %d setaxis " % axis.number
self._send_no_ans(axis, _cmd) self._send_no_ans(_cmd)
# Check for general/system error # Check for general/system error
ret = self._get_generror(axis) ret = self._get_generror(axis)
if ret != 0: if ret != 0:
...@@ -751,7 +752,7 @@ class micos(Controller): ...@@ -751,7 +752,7 @@ class micos(Controller):
log_info(self, "set_off()") log_info(self, "set_off()")
_cmd = "0 %d setaxis " % axis.number _cmd = "0 %d setaxis " % axis.number
self._send_no_ans(axis, _cmd) self._send_no_ans(_cmd)
# Check for general/system error # Check for general/system error
ret = self._get_generror(axis) ret = self._get_generror(axis)
if ret != 0: if ret != 0:
...@@ -792,7 +793,7 @@ class micos(Controller): ...@@ -792,7 +793,7 @@ class micos(Controller):
# _cmd = "%d gnv " % axis.number # _cmd = "%d gnv " % axis.number
_cmd = "%d getnvel " % axis.number _cmd = "%d getnvel " % axis.number
_ans = self._send(axis, _cmd) _ans = self._send(_cmd)
log_debug(self, "read_velocity(): %s" % _ans) log_debug(self, "read_velocity(): %s" % _ans)
_vel = float(_ans) _vel = float(_ans)
log_debug(self, "read_velocity(): velocity = %f" % _vel) log_debug(self, "read_velocity(): velocity = %f" % _vel)
...@@ -809,7 +810,7 @@ class micos(Controller): ...@@ -809,7 +810,7 @@ class micos(Controller):
# _cmd = "%f %d snv " % (new_velocity, axis.number) # _cmd = "%f %d snv " % (new_velocity, axis.number)
_cmd = "%f %d setnvel " % (new_velocity, axis.number) _cmd = "%f %d setnvel " % (new_velocity, axis.number)
self._send_no_ans(axis, _cmd) self._send_no_ans(_cmd)
# ret = self._get_generror(axis) # ret = self._get_generror(axis)
# if ret != 0: # if ret != 0:
# raise RuntimeError(self.GENERAL_ERROR_DICT.get(ret)) # raise RuntimeError(self.GENERAL_ERROR_DICT.get(ret))
...@@ -827,7 +828,7 @@ class micos(Controller): ...@@ -827,7 +828,7 @@ class micos(Controller):
# _cmd = "%d gna " % axis.number # _cmd = "%d gna " % axis.number
_cmd = "%d getnaccel " % axis.number _cmd = "%d getnaccel " % axis.number
_ans = self._send(axis, _cmd) _ans = self._send(_cmd)
log_debug(self, "read_acceleration(): %s" % _ans) log_debug(self, "read_acceleration(): %s" % _ans)
_acc = float(_ans) _acc = float(_ans)
log_debug(self, "read_acceleration(): acceleration = %f" % _acc) log_debug(self, "read_acceleration(): acceleration = %f" % _acc)
...@@ -844,7 +845,7 @@ class micos(Controller): ...@@ -844,7 +845,7 @@ class micos(Controller):
# _cmd = "%f %d sna " % (new_acceleration, axis.number) # _cmd = "%f %d sna " % (new_acceleration, axis.number)
_cmd = "%f %d setnaccel " % (new_acceleration, axis.number) _cmd = "%f %d setnaccel " % (new_acceleration, axis.number)
self._send_no_ans(axis, _cmd) self._send_no_ans(_cmd)
# ret = self._get_generror(axis) # ret = self._get_generror(axis)
# if ret != 0: # if ret != 0:
# raise RuntimeError(self.GENERAL_ERROR_DICT.get(ret)) # raise RuntimeError(self.GENERAL_ERROR_DICT.get(ret))
...@@ -926,7 +927,7 @@ class micos(Controller): ...@@ -926,7 +927,7 @@ class micos(Controller):
# _cmd = "%d np " % axis.number # _cmd = "%d np " % axis.number
_cmd = "%d npos " % axis.number _cmd = "%d npos " % axis.number
_ans = self._send(axis, _cmd) _ans = self._send(_cmd)
log_debug(self, "read_position(): %s" % _ans) log_debug(self, "read_position(): %s" % _ans)
_pos = float(_ans) _pos = float(_ans)
log_debug(self, "position=%f" % _pos) log_debug(self, "position=%f" % _pos)
...@@ -953,7 +954,7 @@ class micos(Controller): ...@@ -953,7 +954,7 @@ class micos(Controller):
if new_position != None: if new_position != None:
_cmd = "%f %d setnpos " % (new_position, axis.number) _cmd = "%f %d setnpos " % (new_position, axis.number)
self._send_no_ans(axis, _cmd) self._send_no_ans(_cmd)
# Check for general/system error # Check for general/system error
ret = self._get_generror(axis) ret = self._get_generror(axis)
if ret != 0: if ret != 0:
...@@ -961,7 +962,7 @@ class micos(Controller): ...@@ -961,7 +962,7 @@ class micos(Controller):
axis.dial_position = new_position axis.dial_position = new_position
else: else:
_cmd = "%f %d setnpos " % (axis.dial_position, axis.number) _cmd = "%f %d setnpos " % (axis.dial_position, axis.number)
self._send_no_ans(axis, _cmd) self._send_no_ans(_cmd)
# Check for general/system error # Check for general/system error
ret = self._get_generror(axis) ret = self._get_generror(axis)
if ret != 0: if ret != 0:
...@@ -1002,7 +1003,7 @@ class micos(Controller): ...@@ -1002,7 +1003,7 @@ class micos(Controller):
# _cmd = "%f %d nm " % (motion.target_pos, motion.axis.number) # _cmd = "%f %d nm " % (motion.target_pos, motion.axis.number)
_cmd = "%f %d nmove " % (motion.target_pos, motion.axis.number) _cmd = "%f %d nmove " % (motion.target_pos, motion.axis.number)
self._send_no_ans(motion.axis, _cmd) self._send_no_ans(_cmd)
def stop(self, axis): def stop(self, axis):
""" """
...@@ -1020,7 +1021,7 @@ class micos(Controller): ...@@ -1020,7 +1021,7 @@ class micos(Controller):
log_info(self, "stop()") log_info(self, "stop()")
_cmd = "%d nabort " % axis.number _cmd = "%d nabort " % axis.number
self._send_no_ans(axis, _cmd) self._send_no_ans(_cmd)
# ---------------- Group motion ------------------ # ---------------- Group motion ------------------
...@@ -1161,11 +1162,11 @@ class micos(Controller): ...@@ -1161,11 +1162,11 @@ class micos(Controller):
log_info(self, "_get_id()") log_info(self, "_get_id()")
_cmd = "%d nidentify " % axis.number _cmd = "%d nidentify " % axis.number
reply1 = self._send(axis, _cmd) reply1 = self._send(_cmd)
log_debug(self, "_get_id(): Micos equipment id = %s" % reply1) log_debug(self, "_get_id(): Micos equipment id = %s" % reply1)
_cmd = "%d nversion " % axis.number _cmd = "%d nversion " % axis.number
reply2 = self._send(axis, _cmd) reply2 = self._send(_cmd)
log_debug(self, "_get_id(): Micos firmware version = %s" % reply2) log_debug(self, "_get_id(): Micos firmware version = %s" % reply2)
retstr = "Micos ID = %s; Firmware version = %s" % (reply1, reply2) retstr = "Micos ID = %s; Firmware version = %s" % (reply1, reply2)
...@@ -1220,8 +1221,6 @@ class micos(Controller): ...@@ -1220,8 +1221,6 @@ class micos(Controller):
print(_txt) print(_txt)
##return _txt
# ---------------- Direct communication methods ------------------ # ---------------- Direct communication methods ------------------
def raw_write(self, axis, cmd): def raw_write(self, axis, cmd):
...@@ -1383,7 +1382,7 @@ class micos(Controller): ...@@ -1383,7 +1382,7 @@ class micos(Controller):
- <id-info>: string with Micos ID and Firmware version - <id-info>: string with Micos ID and Firmware version
""" """
log_info(self, "get_id()") log_info(self, "get_id()")
self._get_id(axis) return self._get_id(axis)
# 'hardware' limits (= end-switches) related # 'hardware' limits (= end-switches) related
...@@ -1678,11 +1677,10 @@ class micos(Controller): ...@@ -1678,11 +1677,10 @@ class micos(Controller):
# ---------------- Micos communiction methods ------------------ # ---------------- Micos communiction methods ------------------
def _send(self, axis, cmd): def _send(self, cmd):
""" """
- Sends command <cmd> to the MICOS controller. - Sends command <cmd> to the MICOS controller.
- Axis number is defined in <cmd>. - Axis number is defined in <cmd>.
- <axis> is passed for debugging purposes.
- Returns answer from controller. - Returns answer from controller.
Args: Args:
...@@ -1727,11 +1725,10 @@ class micos(Controller): ...@@ -1727,11 +1725,10 @@ class micos(Controller):
# print(" Sending: %r Receiving: %r (duration : %g sec.)" % (_cmd, _ans, _duration)) # print(" Sending: %r Receiving: %r (duration : %g sec.)" % (_cmd, _ans, _duration))
return _ans return _ans
def _send_no_ans(self, axis, cmd): def _send_no_ans(self, cmd):
""" """
- Sends command <cmd> to the MICOS controller. - Sends command <cmd> to the MICOS controller.
- Axis number is defined in <cmd>. - Axis number is defined in <cmd>.
- <axis> is passed for debugging purposes.
- Used for answer-less commands, then returns nothing. - Used for answer-less commands, then returns nothing.
Args: Args:
- <axis> : passed for debugging purposes. - <axis> : passed for debugging purposes.
...@@ -1772,7 +1769,7 @@ class micos(Controller): ...@@ -1772,7 +1769,7 @@ class micos(Controller):
_cmd = "%d getnerror " % axis.number _cmd = "%d getnerror " % axis.number
# _cmd = "%d gne " % axis.number # _cmd = "%d gne " % axis.number
_ans = int(self._send(axis, _cmd)) _ans = int(self._send(_cmd))
if _ans == 0: if _ans == 0:
dbgmsg = "No general error --> OK" dbgmsg = "No general error --> OK"
...@@ -1814,7 +1811,7 @@ class micos(Controller): ...@@ -1814,7 +1811,7 @@ class micos(Controller):
_cmd = "%d getmerror " % axis.number _cmd = "%d getmerror " % axis.number
# _cmd = "%d gme " % axis.number # _cmd = "%d gme " % axis.number
_ans = int(self._send(axis, _cmd)) _ans = int(self._send(_cmd))
macherrlist.append(_ans) macherrlist.append(_ans)
# Thist function is called from state() when status # Thist function is called from state() when status
...@@ -1831,7 +1828,7 @@ class micos(Controller): ...@@ -1831,7 +1828,7 @@ class micos(Controller):
if status & self.HW_ERROR: if status & self.HW_ERROR:
_cmd = "%d getmerror " % axis.number _cmd = "%d getmerror " % axis.number
# _cmd = "%d gme " % axis.number # _cmd = "%d gme " % axis.number
_ans = int(self._send(axis, _cmd)) _ans = int(self._send(_cmd))
macherrlist.append(_ans) macherrlist.append(_ans)
dbgmsg = ( dbgmsg = (
"_get_macherror(): Machine erorr = %s " "_get_macherror(): Machine erorr = %s "
...@@ -1861,7 +1858,7 @@ class micos(Controller): ...@@ -1861,7 +1858,7 @@ class micos(Controller):
# _cmd = "%d nstatus " % axis.number # _cmd = "%d nstatus " % axis.number
_cmd = "%d nst " % axis.number _cmd = "%d nst " % axis.number
_ans = self._send(axis, _cmd) _ans = self._send(_cmd)
log_debug(self, "get_status(): raw_status byte = %s" % _ans) log_debug(self, "get_status(): raw_status byte = %s" % _ans)
return _ans return _ans
...@@ -1881,7 +1878,7 @@ class micos(Controller): ...@@ -1881,7 +1878,7 @@ class micos(Controller):
_cmd = "%d nsave " % axis.number _cmd = "%d nsave " % axis.number
# TODO: should test general error here ? # TODO: should test general error here ?
self._send_no_ans(axis, _cmd) self._send_no_ans(_cmd)
def _restore_axis_parameters(self, axis): def _restore_axis_parameters(self, axis):
""" """
...@@ -1895,7 +1892,7 @@ class micos(Controller): ...@@ -1895,7 +1892,7 @@ class micos(Controller):
_cmd = "%d nrestore " % axis.number _cmd = "%d nrestore " % axis.number
# TODO: should test general error here ? # TODO: should test general error here ?
self._send_no_ans(axis, _cmd) self._send_no_ans(_cmd)
def _reset_axis(self, axis): def _reset_axis(self, axis):
""" """
...@@ -1917,7 +1914,7 @@ class micos(Controller): ...@@ -1917,7 +1914,7 @@ class micos(Controller):
log_info(self, "_reset_axis()") log_info(self, "_reset_axis()")
_cmd = "%d nreset " % axis.number _cmd = "%d nreset " % axis.number
self._send_no_ans(axis, _cmd) self._send_no_ans(_cmd)
# TODO: should test general error here ? # TODO: should test general error here ?
axis.axis_on = True axis.axis_on = True
...@@ -1940,7 +1937,7 @@ class micos(Controller): ...@@ -1940,7 +1937,7 @@ class micos(Controller):
log_info(self, "_clear_axis()") log_info(self, "_clear_axis()")
_cmd = "%d nclear " % axis.number _cmd = "%d nclear " % axis.number
self._send_no_ans(axis, _cmd) self._send_no_ans(_cmd)
ret = self._get_generror(axis) ret = self._get_generror(axis)
if ret != 0: if ret != 0:
raise RuntimeError(self.GENERAL_ERROR_DICT.get(ret)) raise RuntimeError(self.GENERAL_ERROR_DICT.get(ret))
...@@ -1962,7 +1959,7 @@ class micos(Controller): ...@@ -1962,7 +1959,7 @@ class micos(Controller):
log_info(self, "_get_axis_on()") log_info(self, "_get_axis_on()")
_cmd = "%d getaxis " % axis.number _cmd = "%d getaxis " % axis.number
ret = self._send(axis, _cmd) ret = self._send(_cmd)
axis_on = True if int(ret) == 1 else False axis_on = True if int(ret) == 1 else False
log_debug(self, "_get_axis_on(): axis enabled = %s" % axis_on) log_debug(self, "_get_axis_on(): axis enabled = %s" % axis_on)
return axis_on return axis_on
...@@ -1985,7 +1982,7 @@ class micos(Controller): ...@@ -1985,7 +1982,7 @@ class micos(Controller):
""" """
log_info(self, "_get_endswitch_types()") log_info(self, "_get_endswitch_types()")
_cmd = "%d getsw " % axis.number _cmd = "%d getsw " % axis.number
ret = self._send(axis, _cmd) ret = self._send(_cmd)
# lohiesty = ret.split(" ") # lohiesty = ret.split(" ")
lohiesty = ret.split() lohiesty = ret.split()
loesty = int(lohiesty[0]) loesty = int(lohiesty[0])
...@@ -2011,12 +2008,12 @@ class micos(Controller): ...@@ -2011,12 +2008,12 @@ class micos(Controller):
# If parameters passed, use them. # If parameters passed, use them.
if not isinstance(loest, Null) and not isinstance(hiest, Null): if not isinstance(loest, Null) and not isinstance(hiest, Null):
_cmd = "%d 0 %d setsw " % (loest, axis.number) _cmd = "%d 0 %d setsw " % (loest, axis.number)
self._send_no_ans(axis, _cmd) self._send_no_ans(_cmd)
##ret = self._get_generror(axis) ##ret = self._get_generror(axis)
##if ret != 0: ##if ret != 0:
## raise RuntimeError(self.GENERAL_ERROR_DICT.get(ret)) ## raise RuntimeError(self.GENERAL_ERROR_DICT.get(ret))
_cmd = "%d 1 %d setsw " % (hiest, axis.number) _cmd = "%d 1 %d setsw " % (hiest, axis.number)
self._send_no_ans(axis, _cmd) self._send_no_ans(_cmd)
##ret = self._get_generror(axis) ##ret = self._get_generror(axis)
##if ret != 0: ##if ret != 0:
## raise RuntimeError(self.GENERAL_ERROR_DICT.get(ret)) ## raise RuntimeError(self.GENERAL_ERROR_DICT.get(ret))
...@@ -2024,9 +2021,9 @@ class micos(Controller): ...@@ -2024,9 +2021,9 @@ class micos(Controller):
axis.high_endswitch_type = hiest axis.high_endswitch_type = hiest
else: else:
_cmd = "%d 0 %d setsw " % (axis.low_endswitch_type, axis.number) _cmd = "%d 0 %d setsw " % (axis.low_endswitch_type, axis.number)
self._send_no_ans(axis, _cmd) self._send_no_ans(_cmd)
_cmd = "%d 1 %d setsw " % (axis.high_endswitch_type, axis.number) _cmd = "%d 1 %d setsw " % (axis.high_endswitch_type, axis.number)
self._send_no_ans(axis, _cmd) self._send_no_ans(_cmd)
##ret = self._get_generror(axis) ##ret = self._get_generror(axis)
##if ret != 0: ##if ret != 0:
## raise RuntimeError(self.GENERAL_ERROR_DICT.get(ret)) ## raise RuntimeError(self.GENERAL_ERROR_DICT.get(ret))
...@@ -2045,7 +2042,7 @@ class micos(Controller): ...@@ -2045,7 +2042,7 @@ class micos(Controller):
""" """
log_info(self, "_get_endswitch_status()") log_info(self, "_get_endswitch_status()")
_cmd = "%d getswst " % axis.number _cmd = "%d getswst " % axis.number
[loesststr, hiesststr] = self._send(axis, _cmd).split() [loesststr, hiesststr] = self._send(_cmd).split()
log_debug( log_debug(
self, "_get_endswitch_status(): Low endswitch status = %s" % loesststr self, "_get_endswitch_status(): Low endswitch status = %s" % loesststr
) )
...@@ -2079,7 +2076,7 @@ class micos(Controller): ...@@ -2079,7 +2076,7 @@ class micos(Controller):
_cmd = "%d getnlimit " % axis.number _cmd = "%d getnlimit " % axis.number
# The command returns string with low and high hardware limits # The command returns string with low and high hardware limits
# separated by space # separated by space
ret = self._send(axis, _cmd) ret = self._send(_cmd)
hw_lohi_lim = ret.split() hw_lohi_lim = ret.split()
hw_lolim = float(hw_lohi_lim[0]) hw_lolim = float(hw_lohi_lim[0])
hw_hilim = float(hw_lohi_lim[1]) hw_hilim = float(hw_lohi_lim[1])
...@@ -2108,7 +2105,7 @@ class micos(Controller): ...@@ -2108,7 +2105,7 @@ class micos(Controller):
# If parameters passed, use them. # If parameters passed, use them.
if not isinstance(hw_low_limit, Null) and not isinstance(hw_high_limit, Null): if not isinstance(hw_low_limit, Null) and not isinstance(hw_high_limit, Null):
_cmd = "%f %f %d setnlimit " % (hw_low_limit, hw_high_limit, axis.number) _cmd = "%f %f %d setnlimit " % (hw_low_limit, hw_high_limit, axis.number)
self._send_no_ans(axis, _cmd) self._send_no_ans(_cmd)
ret = self._get_generror(axis) ret = self._get_generror(axis)
if ret != 0: if ret != 0:
raise RuntimeError(self.GENERAL_ERROR_DICT.get(ret)) raise RuntimeError(self.GENERAL_ERROR_DICT.get(ret))
...@@ -2118,7 +2115,7 @@ class micos(Controller): ...@@ -2118,7 +2115,7 @@ class micos(Controller):
hw_lolim = axis.hw_low_limit hw_lolim = axis.hw_low_limit
hw_hilim = axis.hw_high_limit hw_hilim = axis.hw_high_limit
_cmd = "%f %f %d setnlimit " % (hw_lolim, hw_hilim, axis.number) _cmd = "%f %f %d setnlimit " % (hw_lolim, hw_hilim, axis.number)
self._send_no_ans(axis, _cmd) self._send_no_ans(_cmd)
ret = self._get_generror(axis) ret = self._get_generror(axis)
if ret != 0: if ret != 0:
raise RuntimeError(self.GENERAL_ERROR_DICT.get(ret)) raise RuntimeError(self.GENERAL_ERROR_DICT.get(ret))
...@@ -2141,7 +2138,7 @@ class micos(Controller): ...@@ -2141,7 +2138,7 @@ class micos(Controller):
log_info(self, "_get_tofrom_endsw_velocity()") log_info(self, "_get_tofrom_endsw_velocity()")
_cmd = "%d getncalvel " % axis.number _cmd = "%d getncalvel " % axis.number
cal_2velocities_str = self._send(axis, _cmd) cal_2velocities_str = self._send(_cmd)
cal_2velocities_list = cal_2velocities_str.split() cal_2velocities_list = cal_2velocities_str.split()
axis.tofrom_endsw_velocity = float(cal_2velocities_list[0]) axis.tofrom_endsw_velocity = float(cal_2velocities_list[0])
log_debug( log_debug(
...@@ -2176,28 +2173,28 @@ class micos(Controller): ...@@ -2176,28 +2173,28 @@ class micos(Controller):
# velocity for move to cal switch # velocity for move to cal switch
cmd = "%f 1 %d setncalvel " % (tofrom_endsw_velocity, axis.number) cmd = "%f 1 %d setncalvel " % (tofrom_endsw_velocity, axis.number)
self._send_no_ans(axis, cmd) self._send_no_ans(cmd)
ret = self._get_generror(axis) ret = self._get_generror(axis)
if ret != 0: if ret != 0:
raise RuntimeError(self.GENERAL_ERROR_DICT.get(ret)) raise RuntimeError(self.GENERAL_ERROR_DICT.get(ret))
# velocity for move away from cal switch # velocity for move away from cal switch
cmd = "%f 2 %d setncalvel " % (tofrom_endsw_velocity, axis.number) cmd = "%f 2 %d setncalvel " % (tofrom_endsw_velocity, axis.number)
self._send_no_ans(axis, cmd) self._send_no_ans(cmd)
ret = self._get_generror(axis) ret = self._get_generror(axis)
if ret != 0: if ret != 0:
raise RuntimeError(self.GENERAL_ERROR_DICT.get(ret)) raise RuntimeError(self.GENERAL_ERROR_DICT.get(ret))
# velocity for move to rm switch # velocity for move to rm switch
cmd = "%f 1 %d setnrmvel " % (tofrom_endsw_velocity, axis.number) cmd = "%f 1 %d setnrmvel " % (tofrom_endsw_velocity, axis.number)
self._send_no_ans(axis, cmd) self._send_no_ans(cmd)
ret = self._get_generror(axis) ret = self._get_generror(axis)
if ret != 0: if ret != 0:
raise RuntimeError(self.GENERAL_ERROR_DICT.get(ret)) raise RuntimeError(self.GENERAL_ERROR_DICT.get(ret))
# velocity for move away from rm switch # velocity for move away from rm switch
cmd = "%f 2 %d setnrmvel " % (tofrom_endsw_velocity, axis.number) cmd = "%f 2 %d setnrmvel " % (tofrom_endsw_velocity, axis.number)
self._send_no_ans(axis, cmd) self._send_no_ans(cmd)
ret = self._get_generror(axis) ret = self._get_generror(axis)
if ret != 0: if ret != 0:
raise RuntimeError(self.GENERAL_ERROR_DICT.get(ret)) raise RuntimeError(self.GENERAL_ERROR_DICT.get(ret))
...@@ -2226,7 +2223,7 @@ class micos(Controller): ...@@ -2226,7 +2223,7 @@ class micos(Controller):
# _cmd = "%d ncal " % axis.number # _cmd = "%d ncal " % axis.number
_cmd = "%d ncalibrate " % axis.number _cmd = "%d ncalibrate " % axis.number
self._send_no_ans(axis, _cmd) self._send_no_ans(_cmd)
log_debug( log_debug(
self, self,
...@@ -2256,7 +2253,7 @@ class micos(Controller): ...@@ -2256,7 +2253,7 @@ class micos(Controller):
# _cmd = "%d nrm " % axis.number # _cmd = "%d nrm " % axis.number
_cmd = "%d nrangemeasure " % axis.number _cmd = "%d nrangemeasure " % axis.number
self._send_no_ans(axis, _cmd) self._send_no_ans(_cmd)
log_debug( log_debug(
self, self,
...@@ -2281,7 +2278,7 @@ class micos(Controller): ...@@ -2281,7 +2278,7 @@ class micos(Controller):
log_info(self, "_get_action_at_powerup()") log_info(self, "_get_action_at_powerup()")
_cmd = "%d getnpowerup " % axis.number _cmd = "%d getnpowerup " % axis.number
ret = int(self._send(axis, _cmd)) ret = int(self._send(_cmd))
log_debug(self, "_get_action_at_powerup(): powerup action = %d" % ret) log_debug(self, "_get_action_at_powerup(): powerup action = %d" % ret)
log_debug( log_debug(
self, self,
...@@ -2316,7 +2313,7 @@ class micos(Controller): ...@@ -2316,7 +2313,7 @@ class micos(Controller):
raise ValueError(msg) raise ValueError(msg)
_cmd = "%d %d setnpowerup " % (powerup_action, axis.number) _cmd = "%d %d setnpowerup " % (powerup_action, axis.number)
self._send_no_ans(axis, _cmd) self._send_no_ans(_cmd)
##ret = self._get_generror(axis) ##ret = self._get_generror(axis)
##if ret != 0: ##if ret != 0:
...@@ -2346,7 +2343,7 @@ class micos(Controller): ...@@ -2346,7 +2343,7 @@ class micos(Controller):
log_info(self, "_get_cloop_on()") log_info(self, "_get_cloop_on()")
_cmd = "%d getcloop " % axis.number _cmd = "%d getcloop " % axis.number
ret = self._send(axis, _cmd) ret = self._send(_cmd)
cloop_on = True if int(ret) == 1 else False