Skip to content

Commit 94003d0

Browse files
committed
Updated registered-alarms to include maxshelveduration
1 parent 6d579f2 commit 94003d0

File tree

2 files changed

+18
-2
lines changed

2 files changed

+18
-2
lines changed

schemas/registered-alarms-value.avsc

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,15 @@
6363
]
6464
}
6565
},
66+
{
67+
"name": "maxshelveduration",
68+
"type": [
69+
"null",
70+
"int"
71+
],
72+
"doc": "Maximum amount of time an alarm is allowed to be shelved in seconds; zero means alarm cannot be shelved and null means no limit",
73+
"default": null
74+
},
6675
{
6776
"name": "latching",
6877
"type": "boolean",

scripts/registered-alarms/set-registered.py

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,12 @@
6363
"doc" : "The alarm category, useful for consumers to filter out alarms of interest"
6464
}
6565
},
66+
{
67+
"name" : "maxshelveduration",
68+
"type" : ["null", "int"],
69+
"doc" : "Maximum amount of time an alarm is allowed to be shelved in seconds; zero means alarm cannot be shelved and null means no limit",
70+
"default" : null
71+
},
6672
{
6773
"name" : "latching",
6874
"type" : "boolean",
@@ -124,12 +130,13 @@ def send() :
124130
@click.option('--producerjar', help="The name of the Java JAR file containing the stream rules powering this alarm, only needed if not using producerPv")
125131
@click.option('--location', type=click.Choice(['INJ', 'NL', 'SL', 'HA', 'HB', 'HC', 'HD']), help="The alarm location")
126132
@click.option('--category', type=click.Choice(['Magnet', 'Vacuum', 'RF', 'RADCON', 'Safety']), help="The alarm category")
133+
@click.option('--maxshelveduration', type=click.INT, help="Maximum amount of time an alarm is allowed to be shelved in seconds; zero means alarm cannot be shelved and null means no limit")
127134
@click.option('--latching', is_flag=True, help="Indicate that the alarm latches and requires acknowledgement to clear")
128135
@click.option('--docurl', help="Relative path to documentation from https://alarms.jlab.org/doc")
129136
@click.option('--edmpath', help="Relative path to OPS fiefdom EDM screen from /cs/mccops/edm")
130137
@click.argument('name')
131138

132-
def cli(unset, producerpv, producerjar, location, category, latching, docurl, edmpath, name):
139+
def cli(unset, producerpv, producerjar, location, category, maxshelveduration, latching, docurl, edmpath, name):
133140
global params
134141

135142
params = types.SimpleNamespace()
@@ -151,7 +158,7 @@ def cli(unset, producerpv, producerjar, location, category, latching, docurl, ed
151158
raise click.ClickException(
152159
"Must specify options --location, --category, --docurl, --edmpath")
153160

154-
params.value = {"producer": producer, "location": location, "category": category, "latching": latching, "docurl": docurl, "edmpath": edmpath}
161+
params.value = {"producer": producer, "location": location, "category": category, "maxshelveduration": maxshelveduration, "latching": latching, "docurl": docurl, "edmpath": edmpath}
155162

156163
send()
157164

0 commit comments

Comments
 (0)