|
@@ -521,10 +521,15 @@ class AlarmPlan:
|
|
|
"start_dt": start_dt,
|
|
|
"end_dt": end_dt
|
|
|
}
|
|
|
+ userdata = {
|
|
|
+ "start_dt" : start_dt,
|
|
|
+ "end_dt" : end_dt
|
|
|
+ }
|
|
|
db_req_que.put(DBRequest(
|
|
|
sql=sqls.sql_query_events_by_datetime,
|
|
|
params=params,
|
|
|
- callback=self.cb_toileting_frequency))
|
|
|
+ callback=self.cb_toileting_frequency,
|
|
|
+ userdata=userdata))
|
|
|
|
|
|
except json.JSONDecodeError as e:
|
|
|
tb_info = traceback.extract_tb(e.__traceback__)
|
|
@@ -536,7 +541,37 @@ class AlarmPlan:
|
|
|
LOGERR(f"[{frame.filename}:{frame.lineno}] @{frame.name}(), error: {e}")
|
|
|
|
|
|
|
|
|
- def cb_toileting_frequency(self, result):
|
|
|
+
|
|
|
+ # 夜间如厕频次统计
|
|
|
+ def handle_night_toileting_frequency(self):
|
|
|
+ return
|
|
|
+
|
|
|
+
|
|
|
+ # 如厕频次异常
|
|
|
+ def handle_toileting_frequency_abnormal(self):
|
|
|
+ return
|
|
|
+
|
|
|
+
|
|
|
+ # 起夜异常
|
|
|
+ def handle_night_toileting_frequency_abnormal(self):
|
|
|
+ return
|
|
|
+
|
|
|
+
|
|
|
+ # 卫生间频次统计
|
|
|
+ def handle_bathroom_stay_frequency(self):
|
|
|
+ return
|
|
|
+
|
|
|
+
|
|
|
+ # 异常消失
|
|
|
+ def handle_target_absence(self):
|
|
|
+ return
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+ def cb_toileting_frequency(self, result, userdata):
|
|
|
try:
|
|
|
if result:
|
|
|
count = 0
|
|
@@ -557,10 +592,9 @@ class AlarmPlan:
|
|
|
event_list.append(info)
|
|
|
|
|
|
this_event_uuid = str(uuid.uuid4())
|
|
|
- new_param = helper.normalize_param_time(self.param_)
|
|
|
last_info = {
|
|
|
- "start_time" : new_param["start_time"],
|
|
|
- "end_time" : new_param["end_time"],
|
|
|
+ "start_time" : userdata["start_dt"],
|
|
|
+ "end_time" : userdata["end_dt"],
|
|
|
"count" : len(event_list),
|
|
|
"event_list" : event_list
|
|
|
}
|
|
@@ -596,33 +630,3 @@ class AlarmPlan:
|
|
|
for frame in tb_info:
|
|
|
LOGERR(f"[{frame.filename}:{frame.lineno}] @{frame.name}(), error: {e}")
|
|
|
return
|
|
|
-
|
|
|
-
|
|
|
- # 夜间如厕频次统计
|
|
|
- def handle_night_toileting_frequency(self):
|
|
|
- return
|
|
|
-
|
|
|
-
|
|
|
- # 如厕频次异常
|
|
|
- def handle_toileting_frequency_abnormal(self):
|
|
|
- return
|
|
|
-
|
|
|
-
|
|
|
- # 起夜异常
|
|
|
- def handle_night_toileting_frequency_abnormal(self):
|
|
|
- return
|
|
|
-
|
|
|
-
|
|
|
- # 卫生间频次统计
|
|
|
- def handle_bathroom_stay_frequency(self):
|
|
|
- return
|
|
|
-
|
|
|
-
|
|
|
- # 异常消失
|
|
|
- def handle_target_absence(self):
|
|
|
- return
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|