Current state of official repository master branch
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
- Build system/Poetry config
-
QT5 GUIs raw layout, refs:
- https://realpython.com/qt-designer-python/
- https://www.pythonguis.com/faq/pyqt5-vs-pyside2/
- https://www.pythonguis.com/pyside2/
- https://www.pythonguis.com/tutorials/pyside-qt-designer-gui-layout/
- https://www.pythonguis.com/tutorials/pyside-first-steps-qt-designer/
- https://www.pythonguis.com/tutorials/pyside-plotting-pyqtgraph/ (for example for pings stats)
- https://www.pythonguis.com/pyside2-tutorial/
- https://doc.qt.io/qtforpython-5/PySide2/QtWidgets/index.html
- QT5 dependencies + test inclusions
- ECA + PCA (+ Central SCA emulator?)
- SCA emulator by GUI + defaults
- Central SCA emulator + GUI
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 ofO(10-100 ms)
for Full-auto SCA? - Should
Log level
andTrace 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
-
ecs-core >= 0.2.3
, https://git.cbm.gsi.de/ecs/ecs-core/-/packages/ -
PySide6 >= 6.4.2
, https://doc.qt.io/qtforpython-6/index.html -
tailhead >= 1.0.2
, https://pypi.org/project/tailhead/
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
- (Re-)Install project with
poetry install
orpoetry update
- 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] |
----------------------------------------------------------------------------------