]> jspc29.x-matter.uni-frankfurt.de Git - mvd_epics.git/commitdiff
DASH: /pv/<PV_NAME> now shows properties in nicely readable form
authorPhilipp Klaus <philipp.klaus@gmail.com>
Mon, 25 Sep 2017 06:29:04 +0000 (14:29 +0800)
committerPhilipp Klaus <philipp.klaus@gmail.com>
Mon, 25 Sep 2017 06:29:04 +0000 (14:29 +0800)
python_suite/dashboard/dashboard.py
python_suite/dashboard/views/pv_details_bootstrap.jinja2

index 51cb8318970b9080adb8f708024aae65ceaae86d..4e8fba1670e27b3f08df657c8e7b65936c4fe032 100755 (executable)
@@ -187,7 +187,26 @@ def index():
 @app.route('/pv/<pv_name>')
 @view('pv_details_bootstrap.jinja2')
 def pv_details(pv_name):
-    return {'pv_name': pv_name, 'config': CONFIG}
+    property_name_mapping = {
+      'name': 'Process Variable Name',
+      'alias': 'Alias',
+      'descr': 'Description',
+      'value': 'Value',
+      'unit': 'Unit of Value',
+      'precision': 'Precision of Value',
+      'classes': 'Classes / Tags',
+      'num_value': 'Numerical Value',
+      'char_value': 'String Representation of Value',
+      'upper_ctrl_limit': 'Upper Control Range Limit',
+      'lower_ctrl_limit': 'Lower Control Range Limit',
+      'upper_disp_limit': 'Upper Operator Display Limit',
+      'lower_disp_limit': 'Lower Operator Display Limit',
+      'upper_alarm_limit': 'Upper Alarm Limit',
+      'lower_alarm_limit': 'Lower Alarm Limit',
+      'upper_warning_limit': 'Upper Warning Limit',
+      'lower_warning_limit': 'Lower Warning Limit',
+    }
+    return {'pv_name': pv_name, 'config': CONFIG, 'property_name_mapping': property_name_mapping}
 
 @app.route('/list_bs/<page>')
 @view('pv_overview_bootstrap.jinja2')
index 4735672c82f0b771d06446cf176b5d736a4d6995..d0950382b59ae8a46b7b43cbbca8e6eca2350221 100644 (file)
@@ -54,8 +54,8 @@
        <div class="details-list container">
                {% for key in PV %}
                <div class="details-set row">
-                       <div class="col details-set-key"  >{{ key }}</div>
-                       <div class="col details-set-value">{{ PV[key] }}</div>
+                       <div class="col col-md-6 details-set-key"  >{{ property_name_mapping[key] or key }}</div>
+                       <div class="col col-md-6 details-set-value">{{ PV[key]|string }}</div>
                </div>
                {% endfor %}
        </div>