Skip to content

Decouple attributes default values from memorized values

This MR decouples attribute default values from memorized values. Now, default values are those hardcoded in the plugin code and are restored during attribute initialization in case there is no memorized value.

This MR also refactors the way how memorized values are being applied. Before, we were relying on Tango to restore those values. Now we control the process of restoring memorized values, using Tango DB as a persistent store.

Some unit tests were developed and are pending to be added - depend on !1474 (merged).

During stress tests including 200 motors with 8 memorized attributes each (total of 1600 memorized attributes), surprisingly the Pool startup time was reduced using this MR:

  • develop branch: 5.5 s
  • feature_memorized_attributes branch: 3.2 s (next consecutive executions 2.7 s)

Fixes #1458 (closed)

Changelog

Added

  • get_memorized_values() method to SardanaDevice
  • initialize_attribute_values() method to SardanaDevice, PoolElementDevice, Controller and MeasurementGroup on the Tango level
  • init_attribute_values() method to PoolBaseElement, PoolElement, PoolController and PoolMeasurementGroup on the core level
  • camel_to_sname() util method

Changed

  • Apply memorized values in the sardana core (triggered from the device class dyn_attrs() method) instead of applying them by Tango.

Fixed

  • Decouple attribute default values from memorized values i.e. attribute default values changed in the controller code will take effect

List of attributes affected:

  • Controller

    • LogLevel
  • Motor

    • Acceleration
    • Deceleration
    • Base_rate
    • Velocity
    • Offset
    • DialPosition (customly applied)
    • Step_per_unit
    • Backlash
    • Sign
  • IORegister

    • Value (customly applied)
  • CTExpChannel

    • Timer
  • OneDExpChannel

    • Timer
  • TwoDExpChannel

    • Timer
  • ZeroDExpChannel

    • AccumulationType
  • MeasurementGroup

    • AcquisitionMode
    • Configuration
    • Moveable
    • SoftwareSynchronizerInitialDomain
Edited by Zbigniew Reszela

Merge request reports