Browse Source

Fix a bug in IVSysMan. When delete ProgMon. not unlock the lock.

yuchuli 3 years ago
parent
commit
ab13654c63

+ 8 - 3
src/driver/driver_cloud_grpc_pc_thread/grpcpc.cpp

@@ -166,12 +166,12 @@ void grpcpc::run()
                 QDateTime xTime;
                 xTime.fromMSecsSinceEpoch(1607905685318);  //1607914763641
 //                qDebug("time:%s",xTime.toString("yyyy-MM-dd:hh:mm:ss:zzz").toLatin1().data());
-                qDebug("nlasttime is %ld",nlasttime);//1607905685318
+//                qDebug("nlasttime is %ld",nlasttime);//1607905685318
                 nid++;
                 // The actual RPC.
                 Status status = stub_->queryctrl(&context, request, &xreply);
                 if (status.ok()) {
-                    std::cout<<nid<<" query successfully, res is "<<xreply.nres()<<std::endl;
+ //                   std::cout<<nid<<" query successfully, res is "<<xreply.nres()<<std::endl;
                     if(xreply.nres() == 1)
                     {
 
@@ -376,6 +376,11 @@ std::string grpcpc::GetVIN()
 }
 
 
+//int gnPicNum[NUM_CAM];
+//QMutex gMutexPic[NUM_CAM];
+//qint64 gnTimeSecond[NUM_CAM];
+
+
 void grpcpc::threadpicdownload(int nCamPos)
 {
     std::cout<<"thread cam "<<nCamPos<<"run"<<std::endl;
@@ -448,7 +453,7 @@ void grpcpc::threadpicdownload(int nCamPos)
 
             if(reply.nres() == 1)
             {
-                std::cout<<"pic time is "<<reply.npictime()<<std::endl;
+                std::cout<<nCamPos<<":pic time is "<<reply.npictime()<<std::endl;
                 mMutexPic.lock();
                 iv::modulecomm::ModuleSendMsg(mpaPic[nCamPos],reply.xdata().data(),reply.xdata().size());
                 mMutexPic.unlock();

+ 1 - 1
src/tool/IVSysMan/mainwindow.cpp

@@ -141,7 +141,7 @@ MainWindow::~MainWindow()
             char strexitcode[255];
             snprintf(strexitcode,255,"adcivexit-%d",mPM->mvectorprog[i].mpid);
             qDebug("pid is %d",mPM->mvectorprog[i].mpid);
- //           iv::ivexit::ExecIVExitCmd(mpivexit,strexitcode);
+            iv::ivexit::ExecIVExitCmd(mpivexit,strexitcode);
             QThread::msleep(5);
         }
     }

+ 1 - 0
src/tool/IVSysMan/progmon.cpp

@@ -648,6 +648,7 @@ void ProgMon::run()
             mvectorprog[i].UpdateResState();
             if(QThread::isInterruptionRequested())
             {
+                mMutex.unlock();
                 break;
             }
             mMutex.unlock();