From: Philipp Klaus Date: Thu, 24 Aug 2017 12:17:39 +0000 (+0200) Subject: DASH: /api/history -> return unix time in ms for JS X-Git-Url: https://jspc29.x-matter.uni-frankfurt.de/git/?a=commitdiff_plain;h=1bc9b31a83fefd65452ecc310e6baa19c94a1d2f;p=mvd_epics.git DASH: /api/history -> return unix time in ms for JS --- diff --git a/python_suite/dashboard/dashboard.py b/python_suite/dashboard/dashboard.py index 0cf8930..fca0c8d 100755 --- a/python_suite/dashboard/dashboard.py +++ b/python_suite/dashboard/dashboard.py @@ -128,12 +128,14 @@ def api_values(): @route('/api/history/.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/')