소스 검색

update by yao

yt 4 년 전
부모
커밋
8bd1a44426
1개의 변경된 파일3개의 추가작업 그리고 2개의 파일을 삭제
  1. 3 2
      CamDog/dogobject.cpp

+ 3 - 2
CamDog/dogobject.cpp

@@ -92,10 +92,10 @@ void DogObject::start()
 
 void DogObject::time_out()
 {
+    uint t = QDateTime::currentDateTime().toTime_t();
     if(isWorking)
         return;
     isWorking = true;
-    uint t = QDateTime::currentDateTime().toTime_t();
     if(db.isOpen()){
         devConfList.clear();
         QSqlQuery qry = db.exec("select device_code, comm_type, company_code from ytiot_v_video order by device_code");
@@ -108,6 +108,7 @@ void DogObject::time_out()
     }else
         db.open();
     for(int i=0;i<DEVICES_COUNT;i++){
+        t = QDateTime::currentDateTime().toTime_t();
         for(int j=0;j<devConfList.length();j++){
             if(strcmp(ytShm->eHomeDevice[i].deviceID,devConfList.at(j).DeviceId.toUtf8().data())==0)
             {
@@ -129,7 +130,7 @@ void DogObject::time_out()
             }
         }
     }
-
+    t = QDateTime::currentDateTime().toTime_t();
     if((t-ytShm->workingTime[0])>15){
         system("killall ytCamCore");
         system("rm -f /usr/local/nginx/html/hls/*");