This commit is contained in:
2025-02-25 12:34:35 +01:00
parent 8f68bc021d
commit 261f93ed43
6 changed files with 671 additions and 139 deletions

View File

@@ -63,3 +63,13 @@ record(bi,"${P}SS1-${NAME}-RedVeloCmdAct"){
field(ZSV, "NO_ALARM")
field(OSV, "NO_ALARM")
}
record(stringin,"$(P)SS1-Grp${ID=0}-Nam") {
field(DESC, "Name of Grp ${ID=0}")
field(VAL, "${NAME}")
}
record(ai,"$(P)SS1-GrpCnt") {
field(DESC, "Group Count")
field(VAL, "$(COUNT=0)")
}

11
Db/ecmcSS1Main.template Normal file
View File

@@ -0,0 +1,11 @@
record(stringin,"$(P)SS1-PnlTyp") {
field(DESC, "Panel name")
field(VAL, "ecmc_plugin_safety_main.ui")
}
record(bi,"${P}SS1-Loaded"){
field(DESC, "Plugin loaded")
field(VAL, 1)
field(ONAM, "1")
field(ZNAM, "0")
}

View File

@@ -0,0 +1,222 @@
<?xml version="1.0" encoding="UTF-8"?>
<ui version="4.0">
<class>Form</class>
<widget class="QWidget" name="Form">
<property name="geometry">
<rect>
<x>0</x>
<y>0</y>
<width>311</width>
<height>227</height>
</rect>
</property>
<property name="windowTitle">
<string>Form</string>
</property>
<widget class="QGroupBox" name="groupBox">
<property name="geometry">
<rect>
<x>5</x>
<y>35</y>
<width>296</width>
<height>121</height>
</rect>
</property>
<property name="title">
<string>Diagnostics</string>
</property>
<widget class="caLabel" name="calabel_6">
<property name="geometry">
<rect>
<x>45</x>
<y>60</y>
<width>206</width>
<height>28</height>
</rect>
</property>
<property name="text">
<string>Reduced velo cmd active</string>
</property>
<property name="alignment">
<set>Qt::AlignLeading|Qt::AlignLeft|Qt::AlignVCenter</set>
</property>
</widget>
<widget class="caLed" name="caled_2">
<property name="geometry">
<rect>
<x>10</x>
<y>30</y>
<width>30</width>
<height>30</height>
</rect>
</property>
<property name="channel" stdset="0">
<string notr="true">$(IOC):SS1-$(SAFETY_GRP)-RmpDwnCmdAct</string>
</property>
<property name="falseColor">
<color>
<red>0</red>
<green>85</green>
<blue>0</blue>
</color>
</property>
<property name="trueColor">
<color>
<red>255</red>
<green>0</green>
<blue>0</blue>
</color>
</property>
</widget>
<widget class="caLed" name="caled_3">
<property name="geometry">
<rect>
<x>10</x>
<y>60</y>
<width>30</width>
<height>30</height>
</rect>
</property>
<property name="channel" stdset="0">
<string notr="true">$(IOC):SS1-$(SAFETY_GRP)-RedVeloCmdAct</string>
</property>
<property name="falseColor">
<color>
<red>0</red>
<green>85</green>
<blue>0</blue>
</color>
</property>
<property name="trueColor">
<color>
<red>255</red>
<green>0</green>
<blue>0</blue>
</color>
</property>
</widget>
<widget class="caLabel" name="calabel_5">
<property name="geometry">
<rect>
<x>45</x>
<y>30</y>
<width>246</width>
<height>28</height>
</rect>
</property>
<property name="text">
<string>Rampdown cmd active (E-STOP)</string>
</property>
<property name="alignment">
<set>Qt::AlignLeading|Qt::AlignLeft|Qt::AlignVCenter</set>
</property>
</widget>
<widget class="caLabel" name="calabel_4">
<property name="geometry">
<rect>
<x>45</x>
<y>90</y>
<width>251</width>
<height>26</height>
</rect>
</property>
<property name="text">
<string>Axis at rest</string>
</property>
<property name="alignment">
<set>Qt::AlignLeading|Qt::AlignLeft|Qt::AlignVCenter</set>
</property>
</widget>
<widget class="caLed" name="caled">
<property name="geometry">
<rect>
<x>10</x>
<y>88</y>
<width>30</width>
<height>30</height>
</rect>
</property>
<property name="channel" stdset="0">
<string notr="true">$(IOC):SS1-$(SAFETY_GRP)-AxsStndStllAct</string>
</property>
<property name="falseColor">
<color>
<red>255</red>
<green>0</green>
<blue>0</blue>
</color>
</property>
<property name="trueColor">
<color>
<red>0</red>
<green>85</green>
<blue>0</blue>
</color>
</property>
</widget>
</widget>
<widget class="caLabel" name="calabel">
<property name="geometry">
<rect>
<x>50</x>
<y>5</y>
<width>221</width>
<height>28</height>
</rect>
</property>
<property name="text">
<string>SS1 group: $(SAFETY_GRP=)</string>
</property>
<property name="alignment">
<set>Qt::AlignLeading|Qt::AlignLeft|Qt::AlignVCenter</set>
</property>
</widget>
<widget class="caMultiLineString" name="camultilinestring">
<property name="geometry">
<rect>
<x>10</x>
<y>160</y>
<width>291</width>
<height>61</height>
</rect>
</property>
<property name="font">
<font>
<family>Lucida Sans Typewriter</family>
<pointsize>8</pointsize>
</font>
</property>
<property name="sizeAdjustPolicy">
<enum>QAbstractScrollArea::AdjustToContents</enum>
</property>
<property name="plainText">
<string>NOTE:
ecmc_plugin_safety has NO safety rated
features. It only acts as an interface to a
dedicated safety system.</string>
</property>
<property name="fontScaleMode" stdset="0">
<enum>caMultiLineString::None</enum>
</property>
</widget>
</widget>
<customwidgets>
<customwidget>
<class>caLabel</class>
<extends>QLabel</extends>
<header>caLabel</header>
</customwidget>
<customwidget>
<class>caLed</class>
<extends>QWidget</extends>
<header>caLed</header>
</customwidget>
<customwidget>
<class>caMultiLineString</class>
<extends>QPlainTextEdit</extends>
<header>caMultiLineString</header>
</customwidget>
</customwidgets>
<resources/>
<connections/>
</ui>

View File

@@ -6,153 +6,424 @@
<rect>
<x>0</x>
<y>0</y>
<width>315</width>
<height>143</height>
<width>146</width>
<height>315</height>
</rect>
</property>
<property name="windowTitle">
<string>Form</string>
</property>
<widget class="caLed" name="caled">
<property name="geometry">
<rect>
<x>20</x>
<y>98</y>
<width>30</width>
<height>30</height>
</rect>
</property>
<property name="channel" stdset="0">
<string notr="true">$(IOC):SS1-$(SAFETY_GRP)-AxsStndStllAct</string>
</property>
<property name="falseColor">
<color>
<red>255</red>
<green>0</green>
<blue>0</blue>
</color>
</property>
<property name="trueColor">
<color>
<red>0</red>
<green>85</green>
<blue>0</blue>
</color>
</property>
</widget>
<widget class="caLabel" name="calabel_4">
<property name="geometry">
<rect>
<x>55</x>
<y>100</y>
<width>251</width>
<height>26</height>
</rect>
</property>
<property name="text">
<string>Axis at rest</string>
</property>
<property name="alignment">
<set>Qt::AlignLeading|Qt::AlignLeft|Qt::AlignVCenter</set>
</property>
</widget>
<widget class="caLabel" name="calabel_5">
<property name="geometry">
<rect>
<x>55</x>
<y>40</y>
<width>246</width>
<height>28</height>
</rect>
</property>
<property name="text">
<string>Rampdown cmd active (E-STOP)</string>
</property>
<property name="alignment">
<set>Qt::AlignLeading|Qt::AlignLeft|Qt::AlignVCenter</set>
</property>
</widget>
<widget class="caLed" name="caled_2">
<property name="geometry">
<rect>
<x>20</x>
<y>40</y>
<width>30</width>
<height>30</height>
</rect>
</property>
<property name="channel" stdset="0">
<string notr="true">$(IOC):SS1-$(SAFETY_GRP)-RmpDwnCmdAct</string>
</property>
<property name="falseColor">
<color>
<red>0</red>
<green>85</green>
<blue>0</blue>
</color>
</property>
<property name="trueColor">
<color>
<red>255</red>
<green>0</green>
<blue>0</blue>
</color>
</property>
</widget>
<widget class="caLabel" name="calabel_6">
<property name="geometry">
<rect>
<x>55</x>
<y>70</y>
<width>206</width>
<height>28</height>
</rect>
</property>
<property name="text">
<string>Reduced velo cmd active</string>
</property>
<property name="alignment">
<set>Qt::AlignLeading|Qt::AlignLeft|Qt::AlignVCenter</set>
</property>
</widget>
<widget class="caLed" name="caled_3">
<property name="geometry">
<rect>
<x>20</x>
<y>70</y>
<width>30</width>
<height>30</height>
</rect>
</property>
<property name="channel" stdset="0">
<string notr="true">$(IOC):SS1-$(SAFETY_GRP)-RedVeloCmdAct</string>
</property>
<property name="falseColor">
<color>
<red>0</red>
<green>85</green>
<blue>0</blue>
</color>
</property>
<property name="trueColor">
<color>
<red>255</red>
<green>0</green>
<blue>0</blue>
</color>
</property>
</widget>
<widget class="caLabel" name="calabel">
<property name="geometry">
<rect>
<x>50</x>
<y>10</y>
<width>221</width>
<height>28</height>
<x>5</x>
<y>0</y>
<width>136</width>
<height>36</height>
</rect>
</property>
<property name="text">
<string>SS1 group: $(SAFETY_GRP=)</string>
<string> Safety plugin</string>
</property>
<property name="alignment">
<set>Qt::AlignLeading|Qt::AlignLeft|Qt::AlignVCenter</set>
</property>
</widget>
<widget class="QGroupBox" name="groupBox_6">
<property name="geometry">
<rect>
<x>5</x>
<y>35</y>
<width>136</width>
<height>241</height>
</rect>
</property>
<property name="title">
<string>Group:</string>
</property>
<widget class="caFrame" name="caframe_11">
<property name="geometry">
<rect>
<x>5</x>
<y>30</y>
<width>120</width>
<height>30</height>
</rect>
</property>
<property name="macro">
<string notr="true">GRP_ID=01,IOC=$(IOC)</string>
</property>
<property name="visibility">
<enum>caFrame::Calc</enum>
</property>
<property name="visibilityCalc">
<string notr="true">A&gt;=1</string>
</property>
<property name="channel" stdset="0">
<string notr="true">$(IOC):SS1-GrpCnt</string>
</property>
<widget class="caShellCommand" name="cashellcommand">
<property name="geometry">
<rect>
<x>15</x>
<y>5</y>
<width>100</width>
<height>21</height>
</rect>
</property>
<property name="label">
<string notr="true">$(GRP_ID)</string>
</property>
<property name="labels">
<string>$(GRP_ID)</string>
</property>
<property name="files">
<string>bash /ioc/modules/qt/ecmcOpenObject.sh</string>
</property>
<property name="args">
<string>PLG_SAFETY_GRP $(IOC) $(GRP_ID);</string>
</property>
</widget>
</widget>
<widget class="caFrame" name="caframe_13">
<property name="geometry">
<rect>
<x>5</x>
<y>80</y>
<width>120</width>
<height>30</height>
</rect>
</property>
<property name="macro">
<string notr="true">GRP_ID=03,IOC=$(IOC)</string>
</property>
<property name="visibility">
<enum>caFrame::Calc</enum>
</property>
<property name="visibilityCalc">
<string notr="true">A&gt;=3</string>
</property>
<property name="channel" stdset="0">
<string notr="true">$(IOC):SS1-GrpCnt</string>
</property>
<widget class="caShellCommand" name="cashellcommand_4">
<property name="geometry">
<rect>
<x>15</x>
<y>5</y>
<width>100</width>
<height>21</height>
</rect>
</property>
<property name="label">
<string notr="true">$(GRP_ID)</string>
</property>
<property name="labels">
<string>$(GRP_ID)</string>
</property>
<property name="files">
<string>bash /ioc/modules/qt/ecmcOpenObject.sh</string>
</property>
<property name="args">
<string>PLG_SAFETY_GRP $(IOC) $(GRP_ID);</string>
</property>
</widget>
</widget>
<widget class="caFrame" name="caframe_14">
<property name="geometry">
<rect>
<x>5</x>
<y>105</y>
<width>120</width>
<height>30</height>
</rect>
</property>
<property name="macro">
<string notr="true">GRP_ID=04,IOC=$(IOC)</string>
</property>
<property name="visibility">
<enum>caFrame::Calc</enum>
</property>
<property name="visibilityCalc">
<string notr="true">A&gt;=4</string>
</property>
<property name="channel" stdset="0">
<string notr="true">$(IOC):SS1-GrpCnt</string>
</property>
<widget class="caShellCommand" name="cashellcommand_6">
<property name="geometry">
<rect>
<x>15</x>
<y>5</y>
<width>100</width>
<height>21</height>
</rect>
</property>
<property name="label">
<string notr="true">$(GRP_ID)</string>
</property>
<property name="labels">
<string>$(GRP_ID)</string>
</property>
<property name="files">
<string>bash /ioc/modules/qt/ecmcOpenObject.sh</string>
</property>
<property name="args">
<string>PLG_SAFETY_GRP $(IOC) $(GRP_ID);</string>
</property>
</widget>
</widget>
<widget class="caFrame" name="caframe_15">
<property name="geometry">
<rect>
<x>5</x>
<y>130</y>
<width>120</width>
<height>30</height>
</rect>
</property>
<property name="macro">
<string notr="true">GRP_ID=05,IOC=$(IOC)</string>
</property>
<property name="visibility">
<enum>caFrame::Calc</enum>
</property>
<property name="visibilityCalc">
<string notr="true">A&gt;=5</string>
</property>
<property name="channel" stdset="0">
<string notr="true">$(IOC):SS1-GrpCnt</string>
</property>
<widget class="caShellCommand" name="cashellcommand_7">
<property name="geometry">
<rect>
<x>15</x>
<y>5</y>
<width>100</width>
<height>21</height>
</rect>
</property>
<property name="label">
<string notr="true">$(GRP_ID)</string>
</property>
<property name="labels">
<string>$(GRP_ID)</string>
</property>
<property name="files">
<string>bash /ioc/modules/qt/ecmcOpenObject.sh</string>
</property>
<property name="args">
<string>PLG_SAFETY_GRP $(IOC) $(GRP_ID);</string>
</property>
</widget>
</widget>
<widget class="caFrame" name="caframe_16">
<property name="geometry">
<rect>
<x>5</x>
<y>155</y>
<width>120</width>
<height>30</height>
</rect>
</property>
<property name="macro">
<string notr="true">GRP_ID=06,IOC=$(IOC)</string>
</property>
<property name="visibility">
<enum>caFrame::Calc</enum>
</property>
<property name="visibilityCalc">
<string notr="true">A&gt;=6</string>
</property>
<property name="channel" stdset="0">
<string notr="true">$(IOC):SS1-GrpCnt</string>
</property>
<widget class="caShellCommand" name="cashellcommand_9">
<property name="geometry">
<rect>
<x>15</x>
<y>5</y>
<width>100</width>
<height>21</height>
</rect>
</property>
<property name="label">
<string notr="true">$(GRP_ID)</string>
</property>
<property name="labels">
<string>$(GRP_ID)</string>
</property>
<property name="files">
<string>bash /ioc/modules/qt/ecmcOpenObject.sh</string>
</property>
<property name="args">
<string>PLG_SAFETY_GRP $(IOC) $(GRP_ID);</string>
</property>
</widget>
</widget>
<widget class="caFrame" name="caframe_17">
<property name="geometry">
<rect>
<x>5</x>
<y>180</y>
<width>120</width>
<height>30</height>
</rect>
</property>
<property name="macro">
<string notr="true">GRP_ID=07,IOC=$(IOC)</string>
</property>
<property name="visibility">
<enum>caFrame::Calc</enum>
</property>
<property name="visibilityCalc">
<string notr="true">A&gt;=7</string>
</property>
<property name="channel" stdset="0">
<string notr="true">$(IOC):SS1-GrpCnt</string>
</property>
<widget class="caShellCommand" name="cashellcommand_12">
<property name="geometry">
<rect>
<x>15</x>
<y>5</y>
<width>100</width>
<height>21</height>
</rect>
</property>
<property name="label">
<string notr="true">$(GRP_ID)</string>
</property>
<property name="labels">
<string>$(GRP_ID)</string>
</property>
<property name="files">
<string>bash /ioc/modules/qt/ecmcOpenObject.sh</string>
</property>
<property name="args">
<string>PLG_SAFETY_GRP $(IOC) $(GRP_ID);</string>
</property>
</widget>
</widget>
<widget class="caFrame" name="caframe_18">
<property name="geometry">
<rect>
<x>5</x>
<y>205</y>
<width>120</width>
<height>30</height>
</rect>
</property>
<property name="macro">
<string notr="true">GRP_ID=08,IOC=$(IOC)</string>
</property>
<property name="visibility">
<enum>caFrame::Calc</enum>
</property>
<property name="visibilityCalc">
<string notr="true">A&gt;=8</string>
</property>
<property name="channel" stdset="0">
<string notr="true">$(IOC):SS1-GrpCnt</string>
</property>
<widget class="caShellCommand" name="cashellcommand_13">
<property name="geometry">
<rect>
<x>15</x>
<y>5</y>
<width>100</width>
<height>21</height>
</rect>
</property>
<property name="label">
<string notr="true">$(GRP_ID)</string>
</property>
<property name="labels">
<string>$(GRP_ID)</string>
</property>
<property name="files">
<string>bash /ioc/modules/qt/ecmcOpenObject.sh</string>
</property>
<property name="args">
<string>PLG_SAFETY_GRP $(IOC) $(GRP_ID);</string>
</property>
</widget>
</widget>
<widget class="caFrame" name="caframe_12">
<property name="geometry">
<rect>
<x>5</x>
<y>55</y>
<width>120</width>
<height>30</height>
</rect>
</property>
<property name="macro">
<string notr="true">GRP_ID=02,IOC=$(IOC)</string>
</property>
<property name="visibility">
<enum>caFrame::Calc</enum>
</property>
<property name="visibilityCalc">
<string notr="true">A&gt;=2</string>
</property>
<property name="channel" stdset="0">
<string notr="true">$(IOC):SS1-GrpCnt</string>
</property>
<widget class="caShellCommand" name="cashellcommand_3">
<property name="geometry">
<rect>
<x>15</x>
<y>5</y>
<width>100</width>
<height>21</height>
</rect>
</property>
<property name="label">
<string notr="true">$(GRP_ID)</string>
</property>
<property name="labels">
<string>$(GRP_ID)</string>
</property>
<property name="files">
<string>bash /ioc/modules/qt/ecmcOpenObject.sh</string>
</property>
<property name="args">
<string>PLG_SAFETY_GRP $(IOC) $(GRP_ID);</string>
</property>
</widget>
</widget>
</widget>
<widget class="caLineEdit" name="calineedit">
<property name="geometry">
<rect>
<x>95</x>
<y>285</y>
<width>41</width>
<height>20</height>
</rect>
</property>
<property name="text">
<string/>
</property>
<property name="alignment">
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
</property>
<property name="channel" stdset="0">
<string notr="true">$(IOC):SS1-GrpCnt</string>
</property>
</widget>
<widget class="caLabel" name="calabel_2">
<property name="geometry">
<rect>
<x>10</x>
<y>285</y>
<width>91</width>
<height>21</height>
</rect>
</property>
<property name="text">
<string>Group cnt:</string>
</property>
<property name="alignment">
<set>Qt::AlignLeading|Qt::AlignLeft|Qt::AlignVCenter</set>
@@ -160,15 +431,26 @@
</widget>
</widget>
<customwidgets>
<customwidget>
<class>caFrame</class>
<extends>QFrame</extends>
<header>caFrame</header>
<container>1</container>
</customwidget>
<customwidget>
<class>caLabel</class>
<extends>QLabel</extends>
<header>caLabel</header>
</customwidget>
<customwidget>
<class>caLed</class>
<class>caLineEdit</class>
<extends>QLineEdit</extends>
<header>caLineEdit</header>
</customwidget>
<customwidget>
<class>caShellCommand</class>
<extends>QWidget</extends>
<header>caLed</header>
<header>caShellCommand</header>
</customwidget>
</customwidgets>
<resources/>

View File

@@ -30,7 +30,11 @@
#- <ec_red_velo_cmd> : Ethercat entry input for activation of maximum velo limitation (set to "empty" to disable)
#- <time_delay_ms> : Time delay of STO [ms]
ecmcAddSS1SafetyGroup("${NAME}","${EC_RAMP_DOWN_CMD}","${EC_AXES_AT_REST_STAT}","${EC_AXES_LIM_VELO_CMD=empty}",${DELAY_MS=0})
ecmcEpicsEnvSetCalc(ECMC_PLG_SAFETY_GRP_CNT, "${ECMC_PLG_SAFETY_GRP_CNT=0}+1", "%02d")
#- Load SS1 group records
dbLoadRecords("ss1.template","P=${ECMC_PREFIX},NAME=${NAME}")
dbLoadRecords("ecmcSS1Group.template","P=${ECMC_PREFIX},NAME=${NAME},ID=${ECMC_PLG_SAFETY_GRP_CNT},COUNT=${ECMC_PLG_SAFETY_GRP_CNT}")

View File

@@ -24,3 +24,6 @@
epicsEnvSet(ECMC_PLUGIN_FILNAME,"$(ecmc_plugin_safety_DIR)/lib/${EPICS_HOST_ARCH=linux-x86_64}/libecmc_plugin_safety.so")
epicsEnvSet(ECMC_PLUGIN_CONFIG,"DBG_PRINT=1;")
ecmcConfigOrDie "Cfg.LoadSafetyPlugin(${ECMC_PLUGIN_FILNAME},${ECMC_PLUGIN_CONFIG=""})"
#- Load SS1 group records
dbLoadRecords("ecmcSS1Main.template","P=${ECMC_PREFIX}")