]> jspc29.x-matter.uni-frankfurt.de Git - mvd_epics.git/commitdiff
DASH: Py:None,JS:null inst.of Py:float('nan'),JS:NaN
authorPhilipp Klaus <klaus@physik.uni-frankfurt.de>
Thu, 24 Aug 2017 13:30:46 +0000 (15:30 +0200)
committerPhilipp Klaus <klaus@physik.uni-frankfurt.de>
Thu, 24 Aug 2017 13:30:46 +0000 (15:30 +0200)
python_suite/dashboard/dashboard.py
python_suite/dashboard/static/js/sparkline.js

index 4b906f46d6098903377f59bba30df39097226b11..318e5ea9409ed0e31bf1ef1a62840b4f39c6790f 100755 (executable)
@@ -32,7 +32,7 @@ def register_pv_value_in_history(pv_name, ts, value):
     # If we are asked to put a float:NaN value into the history,
     # repeat the previous value just before our new NaN value
     # This is important to extend plot lines until the value gets invalid.
-    if len(HISTORY[pv_name]) > 0 and math.isnan(value):
+    if len(HISTORY[pv_name]) > 0 and value is None:
         HISTORY[pv_name].append( [ts-0.1, HISTORY[pv_name][1]] )
     HISTORY[pv_name].append( [ts, value] )
 
@@ -65,7 +65,7 @@ def cb_connection_change(**kwargs):
         pv['unit'] = ''
         pv['classes'] = 'disconnected'
         pv['precision'] = None
-        register_pv_value_in_history(kwargs['pvname'], time.time(), float('nan'))
+        register_pv_value_in_history(kwargs['pvname'], time.time(), None)
 
 
 def cb_value_update(**kwargs):
@@ -93,7 +93,7 @@ def cb_value_update(**kwargs):
             pv['value'] = kwargs['value']
         pv['num_value'] = kwargs['value']
         if kwargs['severity'] == epics.INVALID_ALARM:
-            pv['num_value'] = float('nan')
+            pv['num_value'] = None
         register_pv_value_in_history(kwargs['pvname'], kwargs['timestamp'], pv['num_value'])
         pv['precision'] = kwargs['precision']
         #if type(kwargs['precision']) == int and ('double' in kwargs['type'] or 'float' in kwargs['type']):
index 1b4bc62d75dd6c913d01260cd00b9f3af2db9497..61ca92b748a8c005af8dce81e49662dbe291ca3b 100644 (file)
@@ -128,7 +128,7 @@ function sparkline() {
 
       data.forEach(function (d) {
         d[0] = new Date(d[0]);
-        d[1] = +d[1];
+        d[1] = d[1];
       });
 
       // Scale the range of the data