Commit 2dff4ab0 authored by bliss administrator's avatar bliss administrator
Browse files

fscan.reset() : add mono velocity restore, events clearing, WP reset and a flush

parent adfb2fea
...@@ -1157,7 +1157,6 @@ class ID26FScanController: ...@@ -1157,7 +1157,6 @@ class ID26FScanController:
"_cleanup ..." "_cleanup ..."
) )
print("FSCAN ENDING") print("FSCAN ENDING")
if self.event_trajectory_started.is_set(): if self.event_trajectory_started.is_set():
...@@ -1341,11 +1340,19 @@ class ID26FScanController: ...@@ -1341,11 +1340,19 @@ class ID26FScanController:
) )
self.pm600.stop_trajectory() self.pm600.stop_trajectory()
self.pm600.flush()
self.pm600.io_command("WP22222221",self.mono.channel)
self.energy.sync_hard() self.energy.sync_hard()
self.mono.velocity = self.mono.config_velocity
self.event_trajectory_started.clear()
self.event_runtime_error.clear()
self._last_scan = {} self._last_scan = {}
self.mono.trajectory_prog.clear() self.mono.trajectory_prog.clear()
self._reset_id_sync() if self.fscan_par['id_linked']:
self._reset_id_sync()
if len(self.greenlet_id_set_vel) > 0 : if len(self.greenlet_id_set_vel) > 0 :
gevent.joinall(list(self.greenlet_id_set_vel.values())) gevent.joinall(list(self.greenlet_id_set_vel.values()))
...@@ -1369,17 +1376,19 @@ class ID26FScanController: ...@@ -1369,17 +1376,19 @@ class ID26FScanController:
print('MOVE BACK GREENLET KILLED: fscan motors have stopped') print('MOVE BACK GREENLET KILLED: fscan motors have stopped')
self.mono.velocity = self.mono.config_velocity self.mono.velocity = self.mono.config_velocity
print("- PM600 position:", self.mono.position)
print("- PM600 velocity:", self.mono.velocity)
print("- musst_enc_pm.energy() : ", self.enc_pm.energy())
print("- musst_enc_hdh.energy() : ", self.enc_hdh.energy())
print('- READY for next fscan')
log_debug( log_debug(
self, self,
"move back greenlet killed" "move back greenlet killed"
) )
print("- PM600 state :", self.mono.state)
print("- energy state:", self.energy.state)
print("- PM600 velocity:", self.mono.velocity)
print("- PM600 position :", self.mono.position)
print("- musst_enc_hdh.angle() : ", self.enc_hdh.angle())
print("- musst_enc_hdh.energy() : ", self.enc_hdh.energy())
print('- READY for next fscan')
log_debug( log_debug(
self, self,
"reset done." "reset done."
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment