Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Off state when motor power is off #8

Draft
wants to merge 2 commits into
base: master
Choose a base branch
from
Draft
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 9 additions & 2 deletions sardana_icepap/ctrl/IcePAPCtrl.py
Original file line number Diff line number Diff line change
Expand Up @@ -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'
Expand Down Expand Up @@ -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
Expand Down