Skip to content

Commit df8e470

Browse files
committed
Add test case for mbb severity and fix error
1 parent 3b3c47b commit df8e470

File tree

4 files changed

+5
-4
lines changed

4 files changed

+5
-4
lines changed

docs/reference/api.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -273,8 +273,8 @@ All functions return a wrapped `ProcessDeviceSupportIn` or
273273

274274
status = mbbIn('STATUS',
275275
'OK',
276-
('FAILING', alarm.MINOR_ALARM),
277-
('FAILED', alarm.MAJOR_ALARM))
276+
('FAILING', "MINOR"),
277+
('FAILED', "MAJOR"))
278278

279279
Numerical values are assigned to options sequentially from 0 to 15 and
280280
cannot be overridden.

softioc/builder.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ def process_value(prefix, value, option, severity=None):
7272
if severity:
7373
fields[prefix + 'SV'] = severity
7474
for prefix, (value, option) in zip(_mbbPrefixes, enumerate(options)):
75-
if isinstance(value, tuple):
75+
if isinstance(option, tuple):
7676
# The option is tuple consisting of the option name and an optional
7777
# alarm severity.
7878
process_value(prefix, value, *option)

tests/expected_records.db

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -631,6 +631,7 @@ record(mbbi, "TS-DI-TEST-01:MBBI")
631631
field(PINI, "YES")
632632
field(SCAN, "I/O Intr")
633633
field(TWST, "Three")
634+
field(TWSV, "MINOR")
634635
field(TWVL, "2")
635636
field(ZRST, "One")
636637
field(ZRVL, "0")

tests/sim_records.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ def on_update_name(value, name):
2626
t_boolin = boolIn('BOOLIN', 'True', 'False', initial_value=False)
2727
t_longin = longIn('LONGIN', initial_value=33)
2828
t_stringin = stringIn('STRINGIN', initial_value="Testing string")
29-
t_mbbi = mbbIn('MBBI', 'One', 'Two', 'Three', initial_value=2)
29+
t_mbbi = mbbIn('MBBI', 'One', 'Two', ('Three', "MINOR"), initial_value=2)
3030

3131
t_ao = aOut('AO', initial_value=12.45, on_update_name=on_update_name)
3232
t_boolout = boolOut(

0 commit comments

Comments
 (0)