From 2c1ca5c7d9d4a899abd2f0a71e09c2c8b539f17d Mon Sep 17 00:00:00 2001 From: Ryan Date: Tue, 26 Jan 2021 17:15:42 -0500 Subject: [PATCH] read list of locations and categories from schema instead of hard-coding it --- scripts/alarms/set-registered.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/scripts/alarms/set-registered.py b/scripts/alarms/set-registered.py index b948a59..b52c00e 100755 --- a/scripts/alarms/set-registered.py +++ b/scripts/alarms/set-registered.py @@ -58,8 +58,8 @@ def send() : @click.option('--unset', is_flag=True, help="Remove the alarm") @click.option('--producerpv', help="The name of the EPICS CA PV that directly powers this alarm, only needed if not using producerJar") @click.option('--producerjar', help="The name of the Java JAR file containing the stream rules powering this alarm, only needed if not using producerPv") -@click.option('--location', type=click.Choice(['1D','2D','3D','4D','5D','L1','L2','L3','L4','L5','L6','L7','L8','L9','LA','LB','A1','A2','A3','A4','A5','A6','A7','A8','A9','AA','BSY2','BSY4','BSY6','BSY8','BSYA','BSYD','INJ', 'NL', 'SL','EA','WA','BSY', 'HA', 'HB', 'HC', 'HD','ACC','CHL','MCC','LERF','UITF']), help="The alarm location") -@click.option('--category', type=click.Choice(['Aperture','BCM','Box','BPM','CAMAC','Crate','Dump','Gun','Harp','Helicity','IC','IOC','Laser','LCW','Misc','ODH','RADCON','RF','Vacuum']), help="The alarm category") +@click.option('--location', type=click.Choice(locations), help="The alarm location") +@click.option('--category', type=click.Choice(categories), help="The alarm category") @click.option('--maxshelvedduration', 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") @click.option('--latching', is_flag=True, help="Indicate that the alarm latches and requires acknowledgement to clear") @click.option('--docurl', help="Relative path to documentation from https://alarms.jlab.org/doc")