diff --git a/sardana_icepap/ctrl/IcePAPCtrl.py b/sardana_icepap/ctrl/IcePAPCtrl.py index abe9365..cbbf97b 100644 --- a/sardana_icepap/ctrl/IcePAPCtrl.py +++ b/sardana_icepap/ctrl/IcePAPCtrl.py @@ -258,12 +258,14 @@ def StateOne(self, axis): moving_flags = [axis_state.is_moving(), axis_state.is_settling()] alarm_flags = [axis_state.is_limit_positive(), - axis_state.is_limit_negative(), - not axis_state.is_poweron()] + axis_state.is_limit_negative()] if any(moving_flags): state = State.Moving status_state = 'Moving' + elif not axis_state.is_poweron(): + state = State.Off + status_state = 'Off' elif any(alarm_flags): state = State.Alarm status_state = 'Alarm' @@ -361,6 +363,11 @@ def PreStartAll(self): """ If there is no connection, to the Icepap system, return False""" self.move_multiple_grouped = [] self.move_multiple_not_grouped = [] + + def PreStartOne(self, axis, pos): + """ If motor is off, return False""" + axis_state = self.attributes[axis]['status_value'] + return axis_state.is_poweron() def StartOne(self, axis, pos): """ Store all positions in a variable and then react on the StartAll