Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add test case for mbb severity and fix error #15

Merged
merged 1 commit into from
Jul 5, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions docs/reference/api.rst
Original file line number Diff line number Diff line change
Expand Up @@ -273,8 +273,8 @@ All functions return a wrapped `ProcessDeviceSupportIn` or

status = mbbIn('STATUS',
'OK',
('FAILING', alarm.MINOR_ALARM),
('FAILED', alarm.MAJOR_ALARM))
thomascobb marked this conversation as resolved.
Show resolved Hide resolved
('FAILING', "MINOR"),
('FAILED', "MAJOR"))

Numerical values are assigned to options sequentially from 0 to 15 and
cannot be overridden.
Expand Down
2 changes: 1 addition & 1 deletion softioc/builder.py
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ def process_value(prefix, value, option, severity=None):
if severity:
fields[prefix + 'SV'] = severity
for prefix, (value, option) in zip(_mbbPrefixes, enumerate(options)):
if isinstance(value, tuple):
if isinstance(option, tuple):
thomascobb marked this conversation as resolved.
Show resolved Hide resolved
# The option is tuple consisting of the option name and an optional
# alarm severity.
process_value(prefix, value, *option)
Expand Down
1 change: 1 addition & 0 deletions tests/expected_records.db
Original file line number Diff line number Diff line change
Expand Up @@ -631,6 +631,7 @@ record(mbbi, "TS-DI-TEST-01:MBBI")
field(PINI, "YES")
field(SCAN, "I/O Intr")
field(TWST, "Three")
field(TWSV, "MINOR")
field(TWVL, "2")
field(ZRST, "One")
field(ZRVL, "0")
Expand Down
2 changes: 1 addition & 1 deletion tests/sim_records.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ def on_update_name(value, name):
t_boolin = boolIn('BOOLIN', 'True', 'False', initial_value=False)
t_longin = longIn('LONGIN', initial_value=33)
t_stringin = stringIn('STRINGIN', initial_value="Testing string")
t_mbbi = mbbIn('MBBI', 'One', 'Two', 'Three', initial_value=2)
t_mbbi = mbbIn('MBBI', 'One', 'Two', ('Three', "MINOR"), initial_value=2)

t_ao = aOut('AO', initial_value=12.45, on_update_name=on_update_name)
t_boolout = boolOut(
Expand Down