handle get history Q and H data

This commit is contained in:
xinzish
2024-04-12 18:12:58 +08:00
parent 44e487f85f
commit 330248041f
4 changed files with 34 additions and 12 deletions

View File

@@ -1,25 +1,30 @@
from tjnetwork import *
from get_realValue import *
from get_hist_data import *
import datetime
ids=['3489','3854','3853','2510','2514','4780','4854']
ids=['2498','3854','3853','2510','2514','4780','4854']
cur_data=None
def get_latest_cal_time()->datetime:
current_time=datetime.datetime.now()
return current_time
def get_current_data()->bool:
def get_current_data(str_datetime: str=None)->bool:
global cur_data
cur_data=get_realValue(ids)
if str_datetime==None:
cur_data=get_realValue(ids)
else:
cur_date=get_hist_data(ids,str_datetime)
if cur_data ==None:
return False
return True
def get_current_total_Q(str_dt:str='')->float:
q_ids=['3489','3854','3853']
q_ids=['2498','3854','3853']
q_dn900=cur_data[q_ids[0]]
q_dn500=cur_data[q_ids[1]]
q_dn1000=cur_data[q_ids[2]]
@@ -52,3 +57,4 @@ if __name__ == '__main__':
if get_current_data()==True:
tQ=get_current_total_Q()
print(f"the current tQ is {tQ}\n")
data=get_hist_data(ids,conver_beingtime_to_ucttime('2024-04-10 15:05:00'),conver_beingtime_to_ucttime('2024-04-10 15:10:00'))