]> jspc29.x-matter.uni-frankfurt.de Git - mvd_epics.git/commitdiff
CaRecPy: caplay.py: set LOLO, LOW, HIGH, HIHI etc.
authorPhilipp Klaus <philipp.klaus@gmail.com>
Sat, 23 Sep 2017 09:57:29 +0000 (17:57 +0800)
committerPhilipp Klaus <philipp.klaus@gmail.com>
Sat, 23 Sep 2017 09:57:29 +0000 (17:57 +0800)
python_suite/carecplay/caplay.py

index bf6fdb38513b1f0a68f590363ee9b6638abafb8f..8625ee5d8f5c515ae9a5bea96b2ee41251d394a2 100755 (executable)
@@ -88,6 +88,13 @@ def main():
         pv_type = type_map[vu['type']]
         pv_entry = {'type': pv_type, 'value': vu['value'], 'unit': vu['units'], 'prec': vu['precision']}
         enum_strs = vu['enum_strs']
+
+        limits_map = {'lower_ctrl_limit': 'lolim', 'upper_ctrl_limit': 'hilim', 'lower_warning_limit': 'low', 'upper_warning_limit': 'high', 'lower_alarm_limit': 'lolo', 'upper_alarm_limit': 'hihi'}
+        for limit in limits_map.keys():
+            # PCASpy expects the default values to be 0:
+            if vu[limit] is None: vu[limit] = 0.0
+            pv_entry[limits_map[limit]] = vu[limit]
+
         if pv_type == 'enum' and enum_strs is not None:
             enum_strs = list(enum_strs)
             for i in range(len(enum_strs)):