Skip to content
Snippets Groups Projects
Commit d11e0916 authored by mwyman's avatar mwyman
Browse files

Created inset for quick controls of filter; fixed attenuation behavior at limit for filters.

parent db84ed74
No related branches found
No related tags found
No related merge requests found
Showing
with 1457 additions and 3667 deletions
......@@ -54,3 +54,4 @@
10/23/2024 - 13:26:45 - ravioli
10/23/2024 - 13:28:00 - ravioli
10/23/2024 - 15:30:54 - ravioli
11/06/2024 - 05:15:52 - ravioli
......@@ -50,7 +50,7 @@ record(bi, "$(P)$(FILTER_ID):filter$(M)_RBV"){
record(dfanout, "$(P)$(FILTER_ID):filter$(M)_RBV_dfanout"){
field(OMSL, "closed_loop")
field(DOL, "$(P)$(FILTER_ID):filter$(M)_RBV CP")
field(OUTA, "$(P)$(FILTER_ID):filter_RBV_encode.$(ENCODE)")
field(OUTA, "$(P)$(FILTER_ID):filter_RBV_encode.$(ENCODE) PP")
}
record(bo, "$(P)$(FILTER_ID):filter$(M)_Lock"){
......
......@@ -89,20 +89,6 @@ record(ai, "$(P)$(FILTER_ID):energy_RBV"){
}
#record(bo, "$(P)$(FILTER_ID):attenuation_twk_up"){
# field(DTYP, "pydev")
## field(HIGH, "0.25")
# field(OUT, "@$(OBJ).tweakUp()")
#}
#
#record(bo, "$(P)$(FILTER_ID):attenuation_twk_dn"){
# field(DTYP, "pydev")
## field(HIGH, "0.25")
# field(OUT, "@$(OBJ).tweakDn()")
#}
record(calcout, "$(P)$(FILTER_ID):attenuation_twk_up"){
field(INPA, "$(P)$(FILTER_ID):sortedIndex_RBV")
field(CALC, "MIN(A+1,2**$(NUM)-1)")
......@@ -207,11 +193,9 @@ record(sseq, "$(P)$(FILTER_ID):safeTransition"){
field(DO1, "1")
field(LNK1, "$(P)$(FILTER_ID):disableEncode PP")
field(DOL3, "$(P)$(FILTER_ID):safeTransState")
# field(LNK3, "$(P)$(FILTER_ID):rawConfig PP")
field(LNK3, "$(P)$(FILTER_ID):filter_decode.A PP")
field(DLY4, "1.0")
field(DOL4, "$(P)$(FILTER_ID):filterConfig")
# field(LNK4, "$(P)$(FILTER_ID):rawConfig PP")
field(LNK4, "$(P)$(FILTER_ID):filter_decode.A PP")
field(DO5, "0")
field(LNK5, "$(P)$(FILTER_ID):disableEncode PP")
......@@ -222,12 +206,8 @@ record(sseq, "$(P)$(FILTER_ID):safeTransition"){
field(LNK7, "$(P)$(FILTER_ID):filter_encode.PROC PP")
}
#record(longin, "$(P)$(FILTER_ID):rawConfig") {
#}
record(transform, "$(P)$(FILTER_ID):filter_decode"){
# field(INPA, "$(P)$(FILTER_ID):rawConfig CP")
field(CLCB, "A % 2")
field(CLCC, "(A >> 1) % 2")
field(CLCD, "(A >> 2) % 2")
......@@ -245,13 +225,21 @@ record(transform, "$(P)$(FILTER_ID):filter_decode"){
record(calcout, "$(P)$(FILTER_ID):filter_RBV_encode"){
field(OUT, "$(P)$(FILTER_ID):filterConfig_RBV PP")
field(CALC, "A+B*2+C*4+D*8+E*16+F*32+G*64+H*128+I*256+J*512+K*1024+L*2048")
# field(SDIS, "$(P)$(FILTER_ID):disableEncode")
# field(DISV, "1")
}
record(longin, "$(P)$(FILTER_ID):filterConfig_RBV") {
}
record(calcout, "$(P)$(FILTER_ID):filterConfig_RBV_update") {
field(INPA, "$(P)$(FILTER_ID):filterConfig_RBV CP")
field(INPB, "$(P)$(FILTER_ID):filterConfig_BW NPP")
field(CALC, "A==B?1:0")
field(OOPT, "When Zero")
field(DOPT, "Use OCAL")
field(OCAL, "A")
field(OUT, "$(P)$(FILTER_ID):filterConfig_BW PP")
}
record(bo, "$(P)$(FILTER_ID):disableEncode"){
field(ZNAM, "Enabled")
field(ONAM, "Disabled")
......@@ -260,9 +248,6 @@ record(bo, "$(P)$(FILTER_ID):disableEncode"){
record(calcout, "$(P)$(FILTER_ID):filter_encode"){
field(OUT, "$(P)$(FILTER_ID):filterConfig_BW PP")
field(CALC, "A+B*2+C*4+D*8+E*16+F*32+G*64+H*128+I*256+J*512+K*1024+L*2048")
# field(SDIS, "$(P)$(FILTER_ID):disableEncode")
# field(DISV, "1")
}
record(longout, "$(P)$(FILTER_ID):filterConfig_BW") {
......
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
<?xml version="1.0" encoding="UTF-8"?>
<ui version="4.0">
<class>MainWindow</class>
<widget class="QMainWindow" name="MainWindow">
<class>Form</class>
<widget class="QWidget" name="Form">
<property name="geometry">
<rect>
<x>0</x>
<y>0</y>
<width>669</width>
<height>705</height>
<width>673</width>
<height>793</height>
</rect>
</property>
<property name="windowTitle">
<string>MainWindow</string>
<string>Form</string>
</property>
<widget class="QWidget" name="centralwidget">
<widget class="caFrame" name="caframe_8">
<property name="geometry">
<rect>
<x>0</x>
<y>0</y>
<width>661</width>
<height>31</height>
</rect>
</property>
<property name="sizePolicy">
<sizepolicy hsizetype="Expanding" vsizetype="Preferred">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="maximumSize">
<size>
<width>941</width>
<height>16777215</height>
</size>
</property>
<property name="lineWidth">
<number>0</number>
</property>
<property name="background">
<color>
<red>0</red>
<green>53</green>
<blue>132</blue>
</color>
</property>
<property name="backgroundMode">
<enum>caFrame::Filled</enum>
</property>
<layout class="QHBoxLayout" name="horizontalLayout">
<property name="spacing">
<number>5</number>
</property>
<property name="leftMargin">
<number>10</number>
</property>
<property name="topMargin">
<number>2</number>
</property>
<property name="rightMargin">
<number>0</number>
</property>
<property name="bottomMargin">
<number>2</number>
</property>
<layout class="QVBoxLayout" name="verticalLayout_2">
<item>
<layout class="QVBoxLayout" name="verticalLayout" stretch="1,20">
<item>
<widget class="caLabel" name="calabel">
<property name="enabled">
<bool>true</bool>
</property>
<widget class="caFrame" name="caframe_8">
<property name="sizePolicy">
<sizepolicy hsizetype="Preferred" vsizetype="Preferred">
<sizepolicy hsizetype="Expanding" vsizetype="Preferred">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
......@@ -81,52 +30,98 @@
<height>16777215</height>
</size>
</property>
<property name="font">
<font>
<family>Verdana</family>
<pointsize>16</pointsize>
<weight>75</weight>
<bold>true</bold>
</font>
</property>
<property name="text">
<string>PyDev Filter Help</string>
<property name="lineWidth">
<number>0</number>
</property>
<property name="alignment">
<set>Qt::AlignLeading|Qt::AlignLeft|Qt::AlignVCenter</set>
</property>
<property name="fontScaleMode">
<enum>ESimpleLabel::Height</enum>
</property>
<property name="foreground">
<property name="background">
<color>
<red>228</red>
<green>228</green>
<blue>228</blue>
<red>0</red>
<green>53</green>
<blue>132</blue>
</color>
</property>
<property name="background">
<color alpha="0">
<red>160</red>
<green>160</green>
<blue>164</blue>
</color>
<property name="backgroundMode">
<enum>caFrame::Filled</enum>
</property>
<layout class="QHBoxLayout" name="horizontalLayout">
<property name="spacing">
<number>5</number>
</property>
<property name="leftMargin">
<number>10</number>
</property>
<property name="topMargin">
<number>2</number>
</property>
<property name="rightMargin">
<number>0</number>
</property>
<property name="bottomMargin">
<number>2</number>
</property>
<item>
<widget class="caLabel" name="calabel">
<property name="enabled">
<bool>true</bool>
</property>
<property name="sizePolicy">
<sizepolicy hsizetype="Preferred" vsizetype="Preferred">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="maximumSize">
<size>
<width>941</width>
<height>16777215</height>
</size>
</property>
<property name="font">
<font>
<family>Verdana</family>
<pointsize>19</pointsize>
<weight>75</weight>
<bold>true</bold>
</font>
</property>
<property name="text">
<string>PyDev Filter Help</string>
</property>
<property name="alignment">
<set>Qt::AlignLeading|Qt::AlignLeft|Qt::AlignVCenter</set>
</property>
<property name="fontScaleMode">
<enum>ESimpleLabel::Height</enum>
</property>
<property name="foreground">
<color>
<red>228</red>
<green>228</green>
<blue>228</blue>
</color>
</property>
<property name="background">
<color alpha="0">
<red>160</red>
<green>160</green>
<blue>164</blue>
</color>
</property>
</widget>
</item>
</layout>
</widget>
</item>
</layout>
</widget>
<widget class="QTextBrowser" name="textBrowser">
<property name="geometry">
<rect>
<x>10</x>
<y>40</y>
<width>639</width>
<height>651</height>
</rect>
</property>
<property name="html">
<string>&lt;!DOCTYPE HTML PUBLIC &quot;-//W3C//DTD HTML 4.0//EN&quot; &quot;http://www.w3.org/TR/REC-html40/strict.dtd&quot;&gt;
<item>
<widget class="QTextBrowser" name="textBrowser">
<property name="sizePolicy">
<sizepolicy hsizetype="Preferred" vsizetype="Preferred">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="html">
<string>&lt;!DOCTYPE HTML PUBLIC &quot;-//W3C//DTD HTML 4.0//EN&quot; &quot;http://www.w3.org/TR/REC-html40/strict.dtd&quot;&gt;
&lt;html&gt;&lt;head&gt;&lt;meta name=&quot;qrichtext&quot; content=&quot;1&quot; /&gt;&lt;style type=&quot;text/css&quot;&gt;
p, li { white-space: pre-wrap; }
&lt;/style&gt;&lt;/head&gt;&lt;body style=&quot; font-family:'Cantarell'; font-size:11pt; font-weight:400; font-style:normal;&quot;&gt;
......@@ -157,11 +152,16 @@ p, li { white-space: pre-wrap; }
&lt;p style=&quot; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt; Ind. Control: binary configuration based on filter controls&lt;/p&gt;
&lt;p style=&quot; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt; Readbacks: binary configuration based on filter readbacks&lt;/p&gt;
&lt;p style=&quot;-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;&lt;br /&gt;&lt;/p&gt;
&lt;p style=&quot; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;&lt;span style=&quot; font-weight:600;&quot;&gt;SYNC&lt;/span&gt;: when filters actuated externally (e.g. via LabJack controls), SYNC button can be used to update attenuation RBV&lt;/p&gt;
&lt;p style=&quot;-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;&lt;br /&gt;&lt;/p&gt;
&lt;p style=&quot; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;Notes:&lt;/p&gt;
&lt;p style=&quot; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;-If filters individually controlled and then attenuation control used, it may be necessary to set the attenuation an extra time for the filter configuration to update correctly&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
</property>
</widget>
</widget>
</property>
</widget>
</item>
</layout>
</item>
</layout>
</widget>
<customwidgets>
<customwidget>
......
<?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>313</width>
<height>40</height>
</rect>
</property>
<property name="windowTitle">
<string>Form</string>
</property>
<widget class="QWidget" name="layoutWidget">
<property name="geometry">
<rect>
<x>0</x>
<y>0</y>
<width>311</width>
<height>41</height>
</rect>
</property>
<layout class="QHBoxLayout" name="horizontalLayout_15" stretch="1,3,3">
<item>
<widget class="caLed" name="caled_12">
<property name="channel" stdset="0">
<string notr="true">$(P)$(F):filter$(M)_RBV</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>255</green>
<blue>0</blue>
</color>
</property>
</widget>
</item>
<item>
<widget class="caLabel" name="calabel_32">
<property name="text">
<string>Filter $(M)</string>
</property>
<property name="textFormat">
<enum>Qt::PlainText</enum>
</property>
<property name="alignment">
<set>Qt::AlignLeading|Qt::AlignLeft|Qt::AlignVCenter</set>
</property>
<property name="fontScaleMode">
<enum>ESimpleLabel::WidthAndHeight</enum>
</property>
</widget>
</item>
<item>
<widget class="caChoice" name="cachoice">
<property name="channel" stdset="0">
<string notr="true">$(P)$(F):filter$(M)</string>
</property>
<property name="stackingMode" stdset="0">
<enum>caChoice::Column</enum>
</property>
<property name="endBit">
<number>1</number>
</property>
</widget>
</item>
</layout>
</widget>
</widget>
<customwidgets>
<customwidget>
<class>caChoice</class>
<extends>QWidget</extends>
<header>caChoice</header>
</customwidget>
<customwidget>
<class>caLabel</class>
<extends>QLabel</extends>
<header>caLabel</header>
</customwidget>
<customwidget>
<class>caLed</class>
<extends>QWidget</extends>
<header>caLed</header>
</customwidget>
</customwidgets>
<resources/>
<connections/>
</ui>
This diff is collapsed.
This diff is collapsed.
No preview for this file type
......@@ -251,9 +251,11 @@ class filterBlock():
# Code to search lookup table for nearest attenuation to desired
if self.verbose: print(f'Searching for config closest to {self.attenuation}')
nearest_above_idx = find_nearest_above(self.culledTable, self.attenuation)
if self.verbose: print(f'Nearest above index: {nearest_above_idx}')
if nearest_above_idx == -1:
# Desired attenuation is larger than possible at current energy and filter set
self.culledIndex = np.argmax(self.culledTable)
if self.verbose: print(f'Desired attenuation greater than maximum possible; setting to {self.culledIndex}')
else:
self.culledIndex = nearest_above_idx
......@@ -352,7 +354,7 @@ class filterBlock():
culledTable_sortedIndices = np.argsort(self.culledTable)
sorted_position = np.where(culledTable_sortedIndices == self.culledIndex)[0][0]
if self.verbose: print(f'Sorted position is {sorted_position}')
self.next_up_atten = self.culledTable[culledTable_sortedIndices[min(sorted_position + 1,len(culledTable_sortedIndices))]]
self.next_up_atten = self.culledTable[culledTable_sortedIndices[min(sorted_position + 1,len(culledTable_sortedIndices)-1)]]
self.next_dn_atten = self.culledTable[culledTable_sortedIndices[max(0,sorted_position - 1)]]
if self.verbose: print(f'Next up: {self.next_up_atten} and next down: {self.next_dn_atten}')
......
This diff is collapsed.
02/07/2024 - 08:57:17 - ravioli
02/22/2024 - 10:20:38 - ravioli
03/18/2024 - 12:19:26 - ravioli
10/24/2024 - 14:01:41 - ravioli
......@@ -26,8 +26,8 @@ $procserv_info{"CONSOLE"} = { "PREFIX" => "ioc${IOC_NAME}-console",
sub my_ip
{
# Testing on ravioli required forcing IP address to office move/hostname confusion
# return "164.54.52.57"
return inet_ntoa(inet_aton(hostname));
return "164.54.52.57"
# return inet_ntoa(inet_aton(hostname));
}
sub parse
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment