Browse Source

Added a fix time period for last value.

Signed-off-by: chanhoonseng <chanhoonseng3101@gmail.com>
chanhoonseng 7 năm trước cách đây
mục cha
commit
cb6679cf2a
2 tập tin đã thay đổi với 5 bổ sung1 xóa
  1. 5 1
      core.py
  2. BIN
      static/WGTS_Status_Display.png

+ 5 - 1
core.py

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

BIN
static/WGTS_Status_Display.png