Skip to content

[WIP] Reduce motion overheads

Zbigniew Reszela requested to merge github/fork/reszelaz/motion-overheads into develop

Core objects related to moveables are related by the publisher-subscriber pattern. For example:

  • dial position is a publisher and motor’s position is a subscriber
  • motor’s position is a publisher and motor is a subscriber
  • motor’s position is a publisher and pseudo motor’s position is a subscriber
  • pseudo motor’s position is a publisher and pseudo motor is a subscriber
  • motor is a publisher and pseudo motor is a subscriber

The attached sketch tries to demonstrate it (please forgive me its poor quality...)

motion-overheads

Since a pseudo motor is subscribed to motor’s events with the on_element_changed callback it processes all the dial position events propagated via the following chain: dial position -> position -> motor -> pseudo motor. After looking at the callback code, I think that this is not necessary, cause the only thing that it does is to recalculate the state and status. State and status information are already well calculated because at the beginning and at the end of the motion these are notified with the corresponding events. What is even worse is that the on_element_changed callback is called twice because there is an another event propagation route: dial position -> motor -> pseudo motor. I propose to filter out events different than state and status. A similar change is proposed for motor groups.

Merge request reports