Files
hla_framework_bd/qt/A_BD_FeedBackOverview.ui
T
Benjamin LabrecqueandClaude Opus 5 cfd3ecad6c refactor: centralize deploy-time substitutions (steps 1-2)
Deploy-time placeholders were spread across four independent
implementations: sed in the Gitea deploy script, ansible.builtin.replace
in two playbooks, a hardcoded suffix in bin/sls_hla_launch_gui.sh, and
another in agebd/pv.py. Each defined its own values, so nothing kept them
in sync and a missed substitution failed silently.

Step 1 -- one source of truth:

  * config/environments.yml declares every deploy-time token, its value
    per environment, and where tokens are allowed to live. An environment
    that is missing a token, or defines an undeclared one, is a load-time
    error.
  * agebd.subs loads it and renders. Rendering is a strict regex over
    declared token names rather than a template engine: the rendered
    files are EPICS db/substitution files and Qt XML, and an unknown
    token must raise rather than survive into the output.
  * scripts/ci/check_subs.py enforces the contract in CI: tokens in a
    rendered path are declared, declared tokens only appear where they
    are rendered or generated, and no pre-migration delimiters survive.

Step 2 -- separate the two substitution stages by delimiter:

  * Creation-time (copier, once per new service) keeps {{ token }}.
    Deploy-time (every deploy, per environment) becomes @@token@@.
  * This drops the {{ '{{ token }}' }} escaping from templates/, which
    existed only because one Jinja pass had to emit syntax for a second.
  * Angle brackets were tried first and rejected: << >> is not
    well-formed XML, and cli parses qt/*.ui with ElementTree.
  * The existing sed and ansible consumers are repointed at the new
    delimiters so this stays behaviour-preserving. Routing them through
    agebd.subs is step 3.

Also fixes, as a side effect of having one implementation:

  * The sed pattern '{{ *agebd_env_suffix_upper* }}' quantified 'r'
    rather than the space, so it only matched one exact spacing.
  * agebd.subs.read_ioc_port compares service names case-insensitively;
    ansible/tasks/utils/get-ioc-port.yml still compares CamelCase
    registry names against a lowercase input and never matches.

qt/*.ui is declared as a render path but nothing renders it yet -- the
Qt deploy step is still a plain rsync. Wiring that up is step 4.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
2026-08-20 11:26:49 +02:00

413 lines
12 KiB
XML

<?xml version="1.0" encoding="UTF-8"?>
<ui version="4.0">
<class>MainWindow</class>
<widget class="QMainWindow" name="MainWindow">
<property name="geometry">
<rect>
<x>0</x>
<y>0</y>
<width>600</width>
<height>570</height>
</rect>
</property>
<property name="windowTitle">
<string>MainWindow</string>
</property>
<property name="styleSheet">
<string notr="true">/*################################################*/
/*# Settings for new templates/forms #*/
/*################################################*/
QMainWindow#MainWindow, QWidget#Form, QDialog#Dialog{
background: rgba(236, 236, 236, 255);
}
QMainWindow#MainWindow[transparent=true], QWidget#Form[transparent=true], QDialog#Dialog[transparent=true]{
background: rgba(0, 0, 0, 0);
}
/*-----------------------------------------------*/
/* Title */
/*-----------------------------------------------*/
/* Operation panels */
caLabel[statusTip=&quot;Operation&quot;]{
color: rgba(0, 0, 0, 255);
font: bold 18pt;
font-family: Sans Serif;
padding: 1px;
margin: 0px;
qproperty-alignment: AlignLeft;
qproperty-frameShape: StyledPanel;
/*qproperty-geometry: rect(-2 0 1600 33);*/
background: qlineargradient(spread:pad, x1:0, y1:0, x2:0, y2:1,
stop:0 rgba(218, 218, 218, 255),
stop:0.5 rgba(200, 200, 200, 255),
stop:1 rgba(218, 218, 218, 255));
}
QGroupBox {
background: rgba(225,225,225,255);
border: 2px solid black;
border-radius: 5px;
margin-top: 1ex; /* leave space at the top for the title */
}</string>
</property>
<widget class="QWidget" name="centralwidget">
<widget class="caLabel" name="calabel_54">
<property name="geometry">
<rect>
<x>0</x>
<y>0</y>
<width>697</width>
<height>27</height>
</rect>
</property>
<property name="statusTip">
<string>Operation</string>
</property>
<property name="text">
<string>Feedback / Feed Forward Overview</string>
</property>
<property name="alignment">
<set>Qt::AlignLeading</set>
</property>
<property name="colorMode">
<enum>caLabel::Default</enum>
</property>
</widget>
<widget class="QTabWidget" name="tabWidget">
<property name="geometry">
<rect>
<x>-2</x>
<y>36</y>
<width>605</width>
<height>511</height>
</rect>
</property>
<property name="tabPosition">
<enum>QTabWidget::South</enum>
</property>
<property name="tabShape">
<enum>QTabWidget::Rounded</enum>
</property>
<property name="currentIndex">
<number>0</number>
</property>
<widget class="QWidget" name="tab">
<attribute name="title">
<string>Maschine</string>
</attribute>
<widget class="caInclude" name="cainclude_3">
<property name="geometry">
<rect>
<x>0</x>
<y>26</y>
<width>600</width>
<height>68</height>
</rect>
</property>
<property name="macro">
<string>name=Orbit Feedback,alive=ARSGE-CECL-FOFB1:FOFB-OPERATE,panelcmd=A_DI_FOFB_CECL_USER.ui;name=Hor. Tune Feedback,onoff=AGEBD-ALH@@agebd_env_suffix_upper@@:TUNEFBX-ONOFF,alive=AGEBD-ALH@@agebd_env_suffix_upper@@:TUNEFBX-ALIVE,panelcmd=A_BD_TuneBump.ui;name=Ver. Tune Feedback,onoff=AGEBD-ALH@@agebd_env_suffix_upper@@:TUNEFBY-ONOFF,alive=AGEBD-ALH@@agebd_env_suffix_upper@@:TUNEFBY-ALIVE,panelcmd=A_BD_TuneBump.ui</string>
</property>
<property name="filename" stdset="0">
<string notr="true">A_BD_FeedBackOverview_inc.ui</string>
</property>
<property name="numberOfItems" stdset="0">
<number>3</number>
</property>
<property name="adjustSizeToContents" stdset="0">
<bool>true</bool>
</property>
<property name="verticalSpacing" stdset="0">
<number>4</number>
</property>
</widget>
<widget class="caLabel" name="calabel_53">
<property name="geometry">
<rect>
<x>494</x>
<y>0</y>
<width>100</width>
<height>23</height>
</rect>
</property>
<property name="font">
<font>
<pointsize>14</pointsize>
<weight>75</weight>
<bold>true</bold>
</font>
</property>
<property name="text">
<string>Panel</string>
</property>
<property name="alignment">
<set>Qt::AlignLeading|Qt::AlignLeft|Qt::AlignVCenter</set>
</property>
</widget>
<widget class="caLabel" name="calabel_52">
<property name="geometry">
<rect>
<x>310</x>
<y>0</y>
<width>229</width>
<height>23</height>
</rect>
</property>
<property name="font">
<font>
<pointsize>14</pointsize>
<weight>75</weight>
<bold>true</bold>
</font>
</property>
<property name="text">
<string>Status</string>
</property>
<property name="alignment">
<set>Qt::AlignLeading|Qt::AlignLeft|Qt::AlignVCenter</set>
</property>
</widget>
<widget class="Line" name="line_18">
<property name="geometry">
<rect>
<x>300</x>
<y>0</y>
<width>20</width>
<height>26</height>
</rect>
</property>
<property name="font">
<font>
<weight>75</weight>
<bold>true</bold>
</font>
</property>
<property name="orientation">
<enum>Qt::Vertical</enum>
</property>
</widget>
<widget class="Line" name="line_19">
<property name="geometry">
<rect>
<x>474</x>
<y>0</y>
<width>20</width>
<height>23</height>
</rect>
</property>
<property name="font">
<font>
<weight>75</weight>
<bold>true</bold>
</font>
</property>
<property name="orientation">
<enum>Qt::Vertical</enum>
</property>
</widget>
<widget class="caLabel" name="calabel_51">
<property name="geometry">
<rect>
<x>0</x>
<y>0</y>
<width>303</width>
<height>23</height>
</rect>
</property>
<property name="font">
<font>
<pointsize>14</pointsize>
<weight>75</weight>
<bold>true</bold>
</font>
</property>
<property name="text">
<string>Maschine Feedback </string>
</property>
<property name="alignment">
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
</property>
</widget>
<widget class="Line" name="line">
<property name="geometry">
<rect>
<x>2</x>
<y>16</y>
<width>800</width>
<height>16</height>
</rect>
</property>
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
</widget>
</widget>
<widget class="QWidget" name="tab_2">
<attribute name="title">
<string>Beamlines</string>
</attribute>
<widget class="caInclude" name="cainclude_2">
<property name="geometry">
<rect>
<x>0</x>
<y>26</y>
<width>600</width>
<height>212</height>
</rect>
</property>
<property name="macro">
<string>name=Orbit Feed Forward X02SA,onoff=X02SA-UIND:FF-ENABLE,alive=X02SA-CPCL-UIND:STATUS,panelcmd=X_ID_FF.ui,macro=DEVICE=X02SA-UIND;name=Orbit Feed Forward X04SA,onoff=X04SA-UIND:FF-ENABLE,alive=X04SA-CPCL-UIND:STATUS,panelcmd=X_ID_FF.ui,macro=DEVICE=X04SA-UIND;name=Orbit Feed Forward X06SA,onoff=X06SA-UIND:FF-ENABLE,alive=X06SA-CPCL-UIND:STATUS,panelcmd=X_ID_FF.ui,macro=DEVICE=X06SA-UIND;name=Orbit Feed Forward X07M,onoff=X07MA-UIND:FF-ENABLE,alive=X07MA-CPCL-UIND:STATUS,panelcmd=X_ID_FF.ui,macro=DEVICE=X07MA-UIND;name=Orbit Feed Forward X09LB,onoff=X09LB-UIND:FF-ENABLE,alive=X09LB-CPCL-UIND:STATUS,panelcmd=X_ID_FF.ui,macro=DEVICE=X09LB-UIND;name=Orbit Feed Forward X10SA,onoff=X10SA-UIND:FF-ENABLE,alive=X10SA-CPCL-UIND:STATUS,panelcmd=X_ID_FF.ui,macro=DEVICE=X10SA-UIND;name=Orbit Feed Forward X11MA-ID1,onoff=X11MA-UIND1:FF-ENABLE,alive=X11MA-CPCL-UIND:STATUS,panelcmd=X_ID_X11MA_FF.ui,macro=DEVICE=X11MA-UIND;name=Orbit Feed Forward X11MA-ID2,onoff=X11MA-UIND2:FF-ENABLE,alive=X11MA-CPCL-UIND:STATUS,panelcmd=X_ID_X11MA_FF.ui,macro=DEVICE=X11MA-UIND;name=Orbit Feed Forward X12SA,onoff=X12SA-UIND:FF-ENABLE,alive=X12SA-CPCL-UIND:STATUS,panelcmd=X_ID_FF.ui,macro=DEVICE=X12SA-UIND;</string>
</property>
<property name="filename" stdset="0">
<string notr="true">A_BD_FeedBackOverview_inc.ui</string>
</property>
<property name="numberOfItems" stdset="0">
<number>9</number>
</property>
<property name="adjustSizeToContents" stdset="0">
<bool>true</bool>
</property>
<property name="verticalSpacing" stdset="0">
<number>4</number>
</property>
</widget>
<widget class="Line" name="line_2">
<property name="geometry">
<rect>
<x>2</x>
<y>16</y>
<width>800</width>
<height>16</height>
</rect>
</property>
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
</widget>
<widget class="caLabel" name="calabel_55">
<property name="geometry">
<rect>
<x>310</x>
<y>0</y>
<width>229</width>
<height>23</height>
</rect>
</property>
<property name="font">
<font>
<pointsize>14</pointsize>
<weight>75</weight>
<bold>true</bold>
</font>
</property>
<property name="text">
<string>Status</string>
</property>
<property name="alignment">
<set>Qt::AlignLeading|Qt::AlignLeft|Qt::AlignVCenter</set>
</property>
</widget>
<widget class="Line" name="line_20">
<property name="geometry">
<rect>
<x>474</x>
<y>0</y>
<width>20</width>
<height>23</height>
</rect>
</property>
<property name="font">
<font>
<weight>75</weight>
<bold>true</bold>
</font>
</property>
<property name="orientation">
<enum>Qt::Vertical</enum>
</property>
</widget>
<widget class="Line" name="line_21">
<property name="geometry">
<rect>
<x>300</x>
<y>0</y>
<width>20</width>
<height>26</height>
</rect>
</property>
<property name="font">
<font>
<weight>75</weight>
<bold>true</bold>
</font>
</property>
<property name="orientation">
<enum>Qt::Vertical</enum>
</property>
</widget>
<widget class="caLabel" name="calabel_56">
<property name="geometry">
<rect>
<x>494</x>
<y>0</y>
<width>100</width>
<height>23</height>
</rect>
</property>
<property name="font">
<font>
<pointsize>14</pointsize>
<weight>75</weight>
<bold>true</bold>
</font>
</property>
<property name="text">
<string>Panel</string>
</property>
<property name="alignment">
<set>Qt::AlignLeading|Qt::AlignLeft|Qt::AlignVCenter</set>
</property>
</widget>
<widget class="caLabel" name="calabel_57">
<property name="geometry">
<rect>
<x>0</x>
<y>0</y>
<width>303</width>
<height>23</height>
</rect>
</property>
<property name="font">
<font>
<pointsize>14</pointsize>
<weight>75</weight>
<bold>true</bold>
</font>
</property>
<property name="text">
<string>Feed Forward</string>
</property>
<property name="alignment">
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
</property>
</widget>
</widget>
</widget>
</widget>
</widget>
<customwidgets>
<customwidget>
<class>caLabel</class>
<extends>QLabel</extends>
<header>caLabel</header>
</customwidget>
<customwidget>
<class>caInclude</class>
<extends>QWidget</extends>
<header>caInclude</header>
</customwidget>
</customwidgets>
<resources/>
<connections/>
</ui>