Commit b0d35808 by 刘航

[chg]去掉了pkill,修改roi、参数、视频源后,不需要再调用pkill让VAServer重启了。当前VAServer支持监控文件变化,做出响应。

[chg]保存数据,适配了一些json不标准的情况,让程序不会报错。
1 parent fd81e3a9
...@@ -137,7 +137,7 @@ def edit_task_inf(task_index): ...@@ -137,7 +137,7 @@ def edit_task_inf(task_index):
''' '''
启动任务开始 启动任务开始
''' '''
os.system('pkill -9 VAServer') # os.system('pkill -9 VAServer')
result_data = {"ecode": "200", "enote": "OK"} result_data = {"ecode": "200", "enote": "OK"}
res = flask.make_response ( res = flask.make_response (
......
...@@ -48,7 +48,12 @@ class EventToLocalUtil(object): ...@@ -48,7 +48,12 @@ class EventToLocalUtil(object):
picPath = '' picPath = ''
if 'ofilename' in pic: if 'ofilename' in pic:
if index == 0: if index == 0:
infoPath = (pic['ofilename'].split('.'))[0] for s in (pic['ofilename'].split('.'))[0:-1]:
if len(infoPath) >0:
infoPath = infoPath+ '.' + s
else:
infoPath = s
# infoPath = (pic['ofilename'].split('.'))[0]
# infoPath = pic['ofilename'] # infoPath = pic['ofilename']
picPath = basePath + '/' + pic['ofilename'] picPath = basePath + '/' + pic['ofilename']
elif 'event_refid' in dataDict: elif 'event_refid' in dataDict:
...@@ -118,7 +123,8 @@ class EventToLocalUtil(object): ...@@ -118,7 +123,8 @@ class EventToLocalUtil(object):
#判断逻辑,生成路径均在此函数中实现 #判断逻辑,生成路径均在此函数中实现
def generatePath(self, dataDict): def generatePath(self, dataDict):
et = datetime.datetime.now() et = datetime.datetime.now()
if 'event_dt' in dataDict: if 'event_dt' in dataDict and len(dataDict['event_dt']) > 0:
try:
if 'T' in dataDict['event_dt']: if 'T' in dataDict['event_dt']:
et = datetime.datetime.strptime(dataDict['event_dt'], "%Y-%m-%dT%H:%M:%S.%f") et = datetime.datetime.strptime(dataDict['event_dt'], "%Y-%m-%dT%H:%M:%S.%f")
et = self.utc2local(et) et = self.utc2local(et)
...@@ -127,6 +133,10 @@ class EventToLocalUtil(object): ...@@ -127,6 +133,10 @@ class EventToLocalUtil(object):
et = datetime.datetime.strptime(dataDict['event_dt'], "%Y-%m-%d %H:%M:%S.%f") et = datetime.datetime.strptime(dataDict['event_dt'], "%Y-%m-%d %H:%M:%S.%f")
et = self.utc2local(et) et = self.utc2local(et)
pass pass
except ValueError as ve:
self.__loginfo('generatePath event_dt format error, use current time. ')
self.__loginfo(ve)
else: else:
self.__loginfo('generatePath cannot find event_dt, use current time') self.__loginfo('generatePath cannot find event_dt, use current time')
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!