Skip to content
Snippets Groups Projects
P-A Loizeau's avatar
Pierre-Alain Loizeau authored
- Bump mecs-implementation dep. to 0.1.5 which is the first public version
- Remove poetry setting file with read access token
- Remove ecs-core settings in project file as they are inherited from mecs-implementation
1f3cd916
History

Current state of official repository master branch

pipeline status coverage report

ECS GUI emulator

Emulator of CBM ECS with GUIs replacing FW/HW calls.

Description

  • The ECA and PCA agents have external GUIs controlling "standard" ECA and PCA agents through the command interface.
    => A single GUI with a main tab and new tabs for each PCA is the current develpment direction
  • The standard SCA agents are emulated by having an agent with an included GUI and hooks to this GUI in the transition request methods
  • The central SCA agents and their sub-SCAs are also emulated by an included GUI with hooks, probably with a main tab and new tabs for each sub-SCA assigned to a partition

Roadmap

Open questions

  • GUIs inside agents?
  • SCAs started independently and connecting to ECA?
  • (PCA + GUI) popped by ECA = same node and session?
  • (SCA + GUI) popped by central SCA = same node and session?
  • (standard SCA + GUI) standalone = any node and session?
  • GUI calls in transition methods + wait for human ACK = GUI not client but part of SCA?
  • Timeouts handling for commands: GUI = human = O(1-10 s) instead of O(10-100 ms) for Full-auto SCA?
  • Should Log level and Trace mode be set only at startup or potentialy modified on-the-fly (setter)?
  • How is the list of CRI/en obtained and given to the FLES partition-SCA?
  • How is the number of processes obtained and given to the Online partition-SCA?
  • Usage of tags for PCAs without matching name? (general usage with "general PCA config agent ID"?)
  • Name of output files when recording? set in GUI (RUN ID) or maybe auto, such as <YYYY_MM_DD_HH_MM_SS>_<PCA ID>_<PN hostname>_<Index>.suffix?
  • Either accessors+Events in EcaAgent or Watcher agent, to be used in GUI class or as base of it to
    => Needed to solve following dead-end: w/o would need overload of process_heartbeat in ECA, breaks generality of it
    • Update the Csca last contact info when receiving heartbeat/state update
    • Update list of unassigned agents if master change when receiving heartbeat
  • "Terminated" state sent as update while terminating to get "last" state update?
  • Reconnection to running CSCA agents?

TODOs

  • Need command ListTags for EcsConfigurationService to get known tags for agiven agent ID
  • Need command ListAllowedTransitions in EcsCoreAgent (to be done first in each GUI emulator agent)
  • Template for PCA tab in its own ui file with Widget base class + conversion to py
  • Disable all tabs on startup until the ECA agent is created by clicking "Start", then disable config line + ena tabs
  • Log display in GUI: maybe https://stackoverflow.com/questions/63936804/display-logfile-live-time-in-plaintextedit

Dependencies

OS side

  • qt6-base-dev
  • libxcb-cursor0
  • Optional, for development: qt6-tools-dev
  • Optional, for development: designer-qt6

For Debian 12:

sudo -k apt install qt6-base-dev
# Following needed for Pyside6, not sure why not part of dependencies of base QT6 package but may be due to Pyside
# coming from Pypi through poetry instead of being an OS package (no pyside6 package on Debian12)
sudo -k apt install libxcb-cursor0

# Only if you want to use the QT designer to change the GUI:
sudo -k apt install qt6-tools-dev designer-qt6
# Add chooser for qt6 even if officialy deprecated method in Debian 12
# => seems to be the only way if both QT5 and QT6 present in same system from packages
cat <<EOF | sudo -k tee /usr/lib/x86_64-linux-gnu/qtchooser/qt6.conf
/usr/lib/qt6/bin
/usr/lib/x86_64-linux-gnu
EOF
# Applications menu icon
sudo -k cp /usr/share/applications/designer-qt5.desktop /usr/share/applications/designer-qt6.desktop
sudo -k nano /usr/share/applications/designer-qt6.desktop
=> Replace all "5" with "6"

Python side

Re-generating the GUI python file(s)

poetry update
cd qt5-design
poetry run pyside6-uic eca_pca_control_gui.ui -o ../ecs_gui_emulator/EcaPcaControlGuiMainWindow.py
poetry run pyside6-uic sca_control_gui.ui -o ../ecs_gui_emulator/ScaControlGuiMainWindow.py
poetry run pyside6-uic PcaTabTemplateWidget.ui -o ../ecs_gui_emulator/PcaTabTemplateWidget.py
poetry run pyside6-uic ScaStatusTemplateWidget.ui -o ../ecs_gui_emulator/ScaStatusTemplateWidget.py
poetry run pyside6-uic CscaCtrlTabTemplateWidget.ui -o ../ecs_gui_emulator/CscaCtrlTabTemplateWidget.py

Testing

  1. (Re-)Install project with poetry install or poetry update
  2. Four consoles, run:
poetry run EcsCmdRouter --log 0 --trace 0 --clear 1
poetry run EcsStateHub --log 0 --trace 0 --clear 1
poetry run EcsConfServ --type file --source cfg/ecs_gui_demo.json --log -1 --trace 0 --clear 1 --testlog 1
poetry run EcaPcaCtrlGui

Ports usage

Reservation table:

                              | Production      | Testing         |
-------------------------------------------------------------------
ECS    | Web UI               | 8000 or 35630 ? | 8000 or 35780 ? |
       | Command Router       | [35500 - 35509] | [35650 - 35659] |
       | State Hub Publish    | [35510 - 35519] | [35660 - 35669] |
       | Configuration server | [35520 - 35529] | [35670 - 35679] |
       | Logger               | [35530 - 35635] | [35680 - 35685] |
       | Unused/unreserved    | [35536 - 35649] | [35656 - 35799] |
       ------------------------------------------------------------
       | Total                | [35500 - 35649] | [35650 - 35799] |
-------------------------------------------------------------------
DCA    |                      |                 |                 |
       ------------------------------------------------------------
       | Total                | [35900 - 35949] | [35950 - 35999] |
-------------------------------------------------------------------
Already reserved: [35500-35799; 35900 - 35999]

Current usage Table:

                                 Model | Production         | Testing            |
----------------------------------------------------------------------------------
ECS   | Web UI                         | N/A                | N/A                |
      | Command Router Req In          | 35500              | 35650              |
      | Command Router Req Out         | 35501              | 35651              |
      | Command Router Reply           | 35502              | 35652              |
      | State Hub Publish (Push-Pull)  | 35510              | 35660              |
      | State Hub Broadcast (Pub-Sub)  | 35511              | 35661              |
      | Configuration server (Req-Rep) | 35520              | 35670              |
      | Logger (Push, not used yet)    | 35530              | 35680              |
      ----------------------------------------------------------------------------
      | Total                          | See above (unique) | See above (unique) |
      | Reserved (see table)           | [35500 - 35649]    |  [35650 - 35799]   |
----------------------------------------------------------------------------------
DCA   |                                |                    |                    |
      ----------------------------------------------------------------------------
      | Total                          |                    |                    |
      | Reserved (see table)           |  [35900 - 35949]   |  [35950 - 35999]   |
----------------------------------------------------------------------------------