Skip to content
Snippets Groups Projects
Commit a71c1226 authored by Taya Snijder's avatar Taya Snijder
Browse files

restored startup.py

parent 7b3c04ad
No related branches found
No related tags found
1 merge request!24Resolve #2021 "04 16 branched from master ini file device"
...@@ -12,7 +12,7 @@ def startup(device: str, force_restart: bool): ...@@ -12,7 +12,7 @@ def startup(device: str, force_restart: bool):
if force_restart is True: if force_restart is True:
print("Forcing device {} restart.".format(device)) print("Forcing device {} restart.".format(device))
proxy.configure_for_off() proxy.off()
state = proxy.state() state = proxy.state()
if state is not tango._tango.DevState.OFF: if state is not tango._tango.DevState.OFF:
print("Device {} cannot perform off although restart has been enforced, state = {}. Please investigate.".format(device, state)) print("Device {} cannot perform off although restart has been enforced, state = {}. Please investigate.".format(device, state))
...@@ -21,17 +21,16 @@ def startup(device: str, force_restart: bool): ...@@ -21,17 +21,16 @@ def startup(device: str, force_restart: bool):
print("Device {} is not in OFF state, cannot start it. state = {}".format(device, state)) print("Device {} is not in OFF state, cannot start it. state = {}".format(device, state))
return proxy return proxy
print("Device {} is in OFF, performing initialisation.".format(device)) print("Device {} is in OFF, performing initialisation.".format(device))
proxy.configure_for_initialise() proxy.initialise()
state = proxy.state() state = proxy.state()
if state is not tango._tango.DevState.STANDBY: if state is not tango._tango.DevState.STANDBY:
print("Device {} cannot perform initialise, state = {}. Please investigate.".format(device, state)) print("Device {} cannot perform initialise, state = {}. Please investigate.".format(device, state))
return proxy return proxy
print("Device {} is in STANDBY, performing on.".format(device)) print("Device {} is in STANDBY, performing on.".format(device))
proxy.configure_for_on() proxy.on()
state = proxy.state() state = proxy.state()
if state is not tango._tango.DevState.ON: if state is not tango._tango.DevState.ON:
print("Device {} cannot perform on, state = {}. Please investigate.".format(device, state)) print("Device {} cannot perform on, state = {}. Please investigate.".format(device, state))
else: else:
print("Device {} has successfully reached ON state.".format(device)) print("Device {} has successfully reached ON state.".format(device))
return proxy return proxy
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment