sardana-org / sardana

Moved to GitLab: https://gitlab.com/sardana-org/sardana
39 stars 52 forks source link

reconfig implementation #833

Open dschick opened 6 years ago

dschick commented 6 years ago

Very night we are switching off some of our controllers but not necessarily the spock and Sardana terminals. So currently I need to restart Sardana after I reconnected/restarted the hardware in the morning.

In SPEC there is a reconfigcommand which reconfigures all the hardware which would be equivalent to a restart of the PoolSever from within spock I guess.

reszelaz commented 6 years ago

Just to add some information gathered some time ago by @guifrecuni:

From spec documentation understanding errors:

reconfig not only will close/open connection to devices but it will also execute all the initialization sequences as it will in many ways constiuture the equivalent of a full reset

...and a guide what to do when motor does not move.

reszelaz commented 6 years ago

I think that this feature should reinitialize the controller and/or elements, basically call controller constructor, and call the DeleteDevice and AddDevice methods for the given axes. Furthermore it should restore values of some attributes, I propose the memorized ones. There should be two flavors of reconfig - the macro could be parametrized. The difference comes from the values to be restored. In some cases it would be enough to restore the last set values, let’s call this reconfig last. In other cases it would be better to restore values from a snapshot done at some point, let’s call this reconfig snap. For the second one we would need another macro, let’s call it saveconfig. This macro would save the set values of the given attributes to some kind of persistence medium, it could be a file in a configurable directory.

I already implemented the reconfig last option. It was very easy, it just calls the Tango Init command of the object to be reconfigured. In case we want to reconfigure a controller it also iterates over its elements and call the Init command for them as well. If someone is interested in this I can make a PR.

dschick commented 6 years ago

Please do the PR.

Many thanks

reszelaz notifications@github.com schrieb am Mi., 18. Juli 2018, 11:03:

I think that this feature should reinitialize the controller and/or elements, basically call controller constructor and call the DeleteDevice and AddDevice methods for the given axes. Furthermore it should restore values of some attributes, I propose the memorized ones. There should be two flavors of reconfig - the macro could be parametrized. The difference comes from the values to be restored. In some cases it would be enough to restore the last set values, let’s call this reconfig last. In other cases it would be better to restore values from a snapshot done at some point, let’s call this reconfig snap. For the second one we would need another macro, let’s call it saveconfig. This macro would save the set values of the given attributes to some kind of persistence medium, it could be a file in a configurable directory.

I already implemented the reconfig last option. It was very easy, it just calls the Tango Init command of the object to be reconfigured. In case we want to reconfigure a controller it also iterates over its elements and call the Init command for them as well. If someone is interested in this I can make a PR.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/sardana-org/sardana/issues/833#issuecomment-405862787, or mute the thread https://github.com/notifications/unsubscribe-auth/ANKILJnB6zkJukgV6Ha_Fk4XRe3Iv2D0ks5uHvnQgaJpZM4VJYpk .

reszelaz commented 6 years ago

873 adds this macro. Any feedback is more than welcome:)