File tree Expand file tree Collapse file tree 2 files changed +11
-3
lines changed
src/ui/widgets/EmbeddedDisplay Expand file tree Collapse file tree 2 files changed +11
-3
lines changed Original file line number Diff line number Diff line change @@ -107,7 +107,6 @@ describe("opi widget parser", (): void => {
107107 <y>62</y>
108108 <width>140</width>
109109 <height>50</height>
110- <border_alarm_sensitive>false</border_alarm_sensitive>
111110 </widget>
112111 </display>` ;
113112 it ( "parses defaults" , ( ) : void => {
@@ -116,6 +115,7 @@ describe("opi widget parser", (): void => {
116115 expect ( widget . precisionFromPv ) . toEqual ( true ) ;
117116 expect ( widget . showUnits ) . toEqual ( true ) ;
118117 expect ( widget . wrapWords ) . toEqual ( true ) ;
118+ expect ( widget . alarmSensitive ) . toEqual ( true ) ;
119119 } ) ;
120120
121121 const readbackPrecisionUnits = `
Original file line number Diff line number Diff line change 88 opiParseRules ,
99 opiParsePvName ,
1010 opiParseColor ,
11- opiParseAlarmSensitive ,
1211 opiParseString ,
1312 opiParseMacros ,
1413 opiParseBoolean
@@ -151,6 +150,15 @@ function bobParseBorder(props: any): Border {
151150 }
152151}
153152
153+ export function bobParseAlarmSensitive ( props : any ) : boolean {
154+ // If property is missing the default is true
155+ let alarmSensitive = true ;
156+ if ( props . border_alarm_sensitive !== undefined ) {
157+ alarmSensitive = opiParseBoolean ( props . border_alarm_sensitive ) ;
158+ }
159+ return alarmSensitive ;
160+ }
161+
154162function bobParseItems ( jsonProp : ElementCompact ) : string [ ] {
155163 const items : string [ ] = [ ] ;
156164 jsonProp [ "item" ] . forEach ( ( item : any ) => {
@@ -329,7 +337,7 @@ const BOB_COMPLEX_PARSERS: ComplexParserDict = {
329337 type : bobParseType ,
330338 position : bobParsePosition ,
331339 border : bobParseBorder ,
332- alarmSensitive : opiParseAlarmSensitive ,
340+ alarmSensitive : bobParseAlarmSensitive ,
333341 file : bobParseFile
334342} ;
335343
You can’t perform that action at this time.
0 commit comments