Code indexing in gitaly is broken and leads to code not being visible to the user. We work on the issue with highest priority.

Skip to content

refactor: monitor.py config hierarchy

wyzula_j requested to merge refactor-monitor into master

Description

BECMonitor is now accessing data directly from bec.queue.scan_storage by scanID. This should ensure that the data will be complete and in correct order.

The config structure is changed and different sources could be specified:

  • 'scan_segment' → live acquisition
  • 'redis' → getting data directly from defined redis stream
  • 'history' (in future) → loading older scan from REDIS (however this is limited ATM, because scans have limited lifetime in REDIS)
  • 'dap' (in future) → plotting dap process (LMFit etc.)

Related Issues

Type of Change

  • BECMonitor → data sources tag in config
  • BECMonitor → on_scan_segment logic (data directly from scan_storage)
  • MonitorConfigValidator → validation of new config structure
  • ConfigDialog compatible with the new config system
  • ModularApp compatible with the new config system

Potential side effects

  • ConfigDialog will not work
  • BECPlotter will be broken due to new config hierarchy
  • Crosshair doesn't work if there are multiple sources with different x axis (for instance 'redis' source has different x axis than live acquisition) → #68 (closed)

Screenshots / GIFs (if applicable)

...

Additional Comments

Old vs new config structure:

CONFIG_OLD = {
    "plot_settings": {
        "background_color": "black",
        "num_columns": 2,
        "colormap": "plasma",
        "scan_types": False,
    },
    "plot_data": [
        {
            "plot_name": "BPM4i plots vs samy",
            "x": {
                "label": "Motor Y",
                "signals": [{"name": "samy"}],
            },
            "y": {
                "label": "bpm4i", 
                "signals": [{"name": "bpm4i", "entry": "bpm4i"}]},
        },
        {
            "plot_name": "Gauss plots vs samx",
            "x": {
                "label": "Motor X", 
                "signals": [{"name": "samx", "entry": "samx"}]},
            "y": {
                "label": "Gauss",
                "signals": [{"name": "gauss_bpm"}, {"name": "gauss_adc1"}],
            },
        },
    ],
}

CONFIG_NEW =  {
    "plot_settings": {
        "background_color": "black",
        "num_columns": 2,
        "colormap": "plasma",
        "scan_types": False,
    },
    "plot_data": [
        {
            "plot_name": "BPM4i plots vs samy",
            "x_label": "Motor Y",
            "y_label": "bpm4i",
            "sources": [
                {
                    "type": "scan_segment",
                    "signals": {
                        "x": [{"name": "samy"}],
                        "y": [{"name": "bpm4i", "entry": "bpm4i"}],
                    },
                },
                {
                    "type": "history",
                    "scanID": "<scanID>",
                    "signals": {
                        "x": [{"name": "samy"}],
                        "y": [{"name": "bpm4i", "entry": "bpm4i"}],
                    },
                },

            ],
        },
        {
            "plot_name": "Gauss plots vs samx",
            "x_label": "Motor X",
            "y_label": "Gauss",
            "sources": [
                {
                    "type": "scan_segment",
                    "signals": {
                        "x": [{"name": "samx", "entry": "samx"}],
                        "y": [{"name": "gauss_bpm"}, {"name": "gauss_adc1"}],
                    },
                }
            ],
        },
    ],
}

Definition of Done

  • Documentation is up-to-date.
  • Fix BECPlotter
  • Fix ConfigDialog
  • Logic for plotting data send from BECPlotter with redis source flag
Edited by wyzula_j

Merge request reports

Loading