Explorar el Código

change driver_cloud_swap_client.

yuchuli hace 3 años
padre
commit
52ab08f646

+ 1 - 4
src/driver/driver_cloud_swap_client/grpcclient.cpp

@@ -147,6 +147,7 @@ void grpcclient::threadrecv(std::shared_ptr<::grpc::ClientReaderWriter<iv::Cloud
     iv::CloudSwapReplyStream reply;
     while (writer->Read(&reply)) {
 
+        std::cout<<" reply nres: "<<reply.xdata_size()<<std::endl;
 //        nfail = 0;
 //        std::cout << "接收到回复:" << reply.remsg()<<"--\n" << std::endl;
         if(reply.nres() > 0)
@@ -323,10 +324,6 @@ void grpcclient::dec_yaml(const char * stryamlpath)
 
     }
 
-    if(!config["ctrlMD5"])
-    {
-       return;
-    }
 
     if(config["downmessage"])
     {

+ 10 - 1
src/driver/driver_cloud_swap_server/swapunit.cpp

@@ -22,6 +22,7 @@ int swapunit::sendmsg(std::string strobjid, std::shared_ptr<char> pdata_ptr, int
     {
         return 0;
     }
+
     iv::swapmsg xmsg;
     xmsg.ndatasize = ndatasize;
     xmsg.nRecvTime = std::chrono::system_clock::now().time_since_epoch().count();
@@ -40,6 +41,8 @@ int swapunit::sendmsg(std::string strobjid, std::shared_ptr<char> pdata_ptr, int
     mvectorsendmsgbuf.push_back(xmsg);
     mmutex.unlock();
 
+ //   std::cout<<" notify send. "<<std::endl;
+
     mcv.notify_all(); //notify
     return 0;
 }
@@ -52,6 +55,7 @@ void swapunit::threadsend(::grpc::ServerReaderWriter<iv::CloudSwapReplyStream, i
     while(mbrun)
     {
         std::vector<iv::swapmsg> xvectorsendmsgbuf;
+        xvectorsendmsgbuf.clear();
         mmutex.lock();
         int nsize = mvectorsendmsgbuf.size();
         for(i=0;i<nsize;i++)
@@ -72,10 +76,11 @@ void swapunit::threadsend(::grpc::ServerReaderWriter<iv::CloudSwapReplyStream, i
             else
             {
                 lk.unlock();
+                continue;
             }
         }
         iv::CloudSwapReplyStream xreply;
-        xreply.set_nres(mvectorsendmsgbuf.size());
+        xreply.set_nres(xvectorsendmsgbuf.size());
         if(xvectorsendmsgbuf.size() == 0)
         {
             xreply.set_flatency_inserver(0.0);
@@ -90,12 +95,16 @@ void swapunit::threadsend(::grpc::ServerReaderWriter<iv::CloudSwapReplyStream, i
         }
         for(i=0;i<nsize;i++)
         {
+            std::cout<<" add reply data. "<<std::endl;
             xreply.add_xdata(xvectorsendmsgbuf[i].pdata_ptr.get(),xvectorsendmsgbuf[i].ndatasize);
         }
         xreply.set_flatency_innode(0);
         xreply.set_flatency_inobjnode(0);
         xreply.set_nmsgservertime(xNow);
+ //       xreply.set_nres(1);
+        std::cout<<mstrnodeid<<" reply data size : "<<xreply.xdata_size()<<std::endl;
         stream->Write(xreply);
+
         xLastSend = xNow;
 
     }

+ 1 - 0
src/tool/view_gps/main.cpp

@@ -20,6 +20,7 @@ int  GetOptLong(int argc, char *argv[]) {
     int nRtn = 0;
     int opt; // getopt_long() 的返回值
     int digit_optind = 0; // 设置短参数类型及是否需要参数
+    (void)digit_optind;
 
     // 如果option_index非空,它指向的变量将记录当前找到参数符合long_opts里的
     // 第几个元素的描述,即是long_opts的下标值

+ 13 - 1
src/tool/view_gps/mainwindow.cpp

@@ -33,6 +33,9 @@ MainWindow * gw;
 
 void ListenRaw(const char * strdata,const unsigned int nSize,const unsigned int index,const QDateTime * dt,const char * strmemname)
 {
+    (void)index;
+    (void)dt;
+    (void)strmemname;
     iv::gps::gpsimu xgpsimu;
     if(!xgpsimu.ParseFromArray(strdata,nSize))
     {
@@ -73,6 +76,9 @@ void ListenRaw(const char * strdata,const unsigned int nSize,const unsigned int
 
 void ListenFusion(const char * strdata,const unsigned int nSize,const unsigned int index,const QDateTime * dt,const char * strmemname)
 {
+    (void)index;
+    (void)dt;
+    (void)strmemname;
     iv::gps::gpsimu xgpsimu;
     if(!xgpsimu.ParseFromArray(strdata,nSize))
     {
@@ -123,7 +129,8 @@ MainWindow::MainWindow(QWidget *parent) :
     void * paraw = iv::modulecomm::RegisterRecv(gstr_memname,ListenRaw);
     void * pafusion = iv::modulecomm::RegisterRecv("fusion_gpsimu",ListenFusion);
 
-
+    (void)paraw;
+    (void)pafusion;
     QTimer * timer = new QTimer(this);
     connect(timer,SIGNAL(timeout()),this,SLOT(onTimer()));
     timer->start(5);
@@ -313,6 +320,7 @@ void MainWindow::CreateTab3View(QTabWidget * p)
 
 void MainWindow::resizeEvent(QResizeEvent *event)
 {
+    (void)event;
 //    qDebug("resize");
     QSize sizemain = ui->centralWidget->size();
 //    qDebug("size x = %d y=%d",sizemain.width(),sizemain.height());
@@ -341,6 +349,7 @@ inline void MainWindow::SetLEView(int nTab, const char *strName, double value, c
             {
                 std::string str = x;
                 const char * y = str.data();
+                (void)y;
                 if(strcmp(str.data(), strName) == 0)
                 {
 
@@ -357,6 +366,7 @@ inline void MainWindow::SetLEView(int nTab, const char *strName, double value, c
             {
                 std::string str = x;
                 const char * y = str.data();
+                (void)y;
                 if(strcmp(str.data(), strName) == 0)
                 {
 
@@ -390,6 +400,7 @@ inline void MainWindow::SetLEView(int nTab, const char *strName, double value, c
             {
                 std::string str = x;
                 const char * y = str.data();
+                (void)y;
                 if(strcmp(str.data(), strName) == 0)
                 {
 
@@ -514,6 +525,7 @@ void MainWindow::onTimer()
     static int nLastFusion = 0;
     bool bRawGet = false;
     bool bFusionGet = false;
+    (void)bFusionGet;
     iv::gps::gpsimu rawgpsimu,fusiongpsimu;
     if(nLastRaw < gcountRaw[0])
     {