Browse Source

Added a fix time period for last value.

Signed-off-by: chanhoonseng <chanhoonseng3101@gmail.com>
chanhoonseng 7 years ago
parent
commit
cb6679cf2a
2 changed files with 5 additions and 1 deletions
  1. 5 1
      core.py
  2. BIN
      static/WGTS_Status_Display.png

+ 5 - 1
core.py

@@ -10,6 +10,7 @@ import re
 import datetime
 from shutil import copyfile
 from time import gmtime, strftime
+import time
 
 
 import tornado.escape
@@ -86,10 +87,13 @@ def fetchDataADEI():
         return
     
     cache_data = {}
+    print time.time()
+    curtime = int(time.time())
+    time_range = str((curtime-3600)) + "-" + str(curtime)
     for param in varname:
         print param
         dest = config['server'] + config['script']
-        url = dest + "?" + varname[param] + "&window=-1"
+        url = dest + "?" + varname[param] + "&window=" + time_range
         print url
         data = requests.get(url,
                             auth=(config['username'],

BIN
static/WGTS_Status_Display.png