]> jspc29.x-matter.uni-frankfurt.de Git - mvd_epics.git/commitdiff
DASH: /api/history -> return unix time in ms for JS
authorPhilipp Klaus <klaus@physik.uni-frankfurt.de>
Thu, 24 Aug 2017 12:17:39 +0000 (14:17 +0200)
committerPhilipp Klaus <klaus@physik.uni-frankfurt.de>
Thu, 24 Aug 2017 12:17:39 +0000 (14:17 +0200)
python_suite/dashboard/dashboard.py

index 0cf893000edecec20e05ed2f3f6d7fe10d0efb09..fca0c8d22540687362b5634a9d01cc6d4a6c842a 100755 (executable)
@@ -128,12 +128,14 @@ def api_values():
 @route('/api/history/<name>.json')
 def api_history(name):
     try:
-        history = copy.copy(HISTORY[name])
+        history = copy.deepcopy(HISTORY[name])
     except KeyError:
         abort(404, "PV not found")
     if len(history) != 0:
         # repeat latest value in history (to make plot lines end 'now')
         history.append([time.time(), history[-1][1]])
+    for row in history:
+        row[0] *= 1000.
     return {'history': history}
 
 @route('/static/<path:path>')