Browse Source

Merge branch 'master' of http://116.63.46.168:3000/ADPilot/modularization

liyupeng 1 year ago
parent
commit
fe05b9bae9
79 changed files with 7098 additions and 1741 deletions
  1. 91 8
      src/common/modulecomm/shm/procsm.cpp
  2. 2 0
      src/common/modulecomm/shm/procsm.h
  3. 6 4
      src/common/modulecomm/shm/procsm_if.cpp
  4. 4 2
      src/detection/detection_ndt_matching/detection_ndt_matching.pro
  5. 22 0
      src/detection/detection_ndt_matching/main.cpp
  6. 32 0
      src/detection/detection_ndt_matching/ndt_matching.cpp
  7. 30 0
      src/driver/driver_camera_ioctl/camtest.pro
  8. 286 0
      src/driver/driver_camera_ioctl/camtestmain.cpp
  9. 1 1
      src/driver/driver_group_grpc_server/main.cpp
  10. 825 581
      src/driver/driver_grpc_client/ivgrpc.pb.cc
  11. 491 1044
      src/driver/driver_grpc_client/ivgrpc.pb.h
  12. 31 0
      src/include/proto/fwadmin.proto
  13. 18 0
      src/include/proto/fwlogin.proto
  14. 12 0
      src/include/proto/pcdmap.proto
  15. 13 0
      src/include/proto/relocate.proto
  16. 50 0
      src/include/proto3/commonrpc.proto
  17. 54 0
      src/tool/Inspection_Shenlan_Miivill/Inspection_Shenlan_Miivill.pro
  18. 11 0
      src/tool/Inspection_Shenlan_Miivill/main.cpp
  19. 302 0
      src/tool/Inspection_Shenlan_Miivill/mainwindow.cpp
  20. 66 0
      src/tool/Inspection_Shenlan_Miivill/mainwindow.h
  21. 288 0
      src/tool/Inspection_Shenlan_Miivill/mainwindow.ui
  22. 41 0
      src/tool/Inspection_Shenlan_Orin/Inspection_Shenlan_Orin.pro
  23. 11 0
      src/tool/Inspection_Shenlan_Orin/main.cpp
  24. 23 0
      src/tool/Inspection_Shenlan_Orin/mainwindow.cpp
  25. 32 0
      src/tool/Inspection_Shenlan_Orin/mainwindow.h
  26. 172 0
      src/tool/Inspection_Shenlan_Orin/mainwindow.ui
  27. 2 1
      src/tool/adc_cantool/window/ChassisAnalysisWindow/ChassisAnalysisWindow.cpp
  28. 2 0
      src/tool/adcndtmultimapping/adcndtmultimapping.xml
  29. 3 0
      src/tool/adcndtmultimapping/main.cpp
  30. 40 1
      src/tool/adcndtmultimapping/mainwindow.cpp
  31. 1 1
      src/tool/adcndtmultimapping/mainwindow.h
  32. 29 0
      src/tool/adcndtmultimapping/ndt_mapping.cpp
  33. 2 0
      src/tool/adcndtmultimapping/ndt_mapping.h
  34. BIN
      src/tool/fwupdate_admin/display.png
  35. 69 0
      src/tool/fwupdate_admin/fwupdate_admin.pro
  36. 175 0
      src/tool/fwupdate_admin/grpcfwclient.cpp
  37. 69 0
      src/tool/fwupdate_admin/grpcfwclient.h
  38. 34 0
      src/tool/fwupdate_admin/main.cpp
  39. 14 0
      src/tool/fwupdate_admin/mainwindow.cpp
  40. 22 0
      src/tool/fwupdate_admin/mainwindow.h
  41. 24 0
      src/tool/fwupdate_admin/mainwindow.ui
  42. 209 0
      src/tool/fwupdate_admin/mainwindowadminuser.cpp
  43. 52 0
      src/tool/fwupdate_admin/mainwindowadminuser.h
  44. 166 0
      src/tool/fwupdate_admin/mainwindowadminuser.ui
  45. 185 0
      src/tool/fwupdate_admin/mainwindowlogin.cpp
  46. 49 0
      src/tool/fwupdate_admin/mainwindowlogin.h
  47. 99 0
      src/tool/fwupdate_admin/mainwindowlogin.ui
  48. BIN
      src/tool/fwupdate_admin/no_display.png
  49. 6 0
      src/tool/fwupdate_admin/res.qrc
  50. 1 0
      src/tool/map_collectfromveh/dialogconvert.cpp
  51. 16 16
      src/tool/map_collectfromveh/editwin.cpp
  52. 9 0
      src/tool/map_collectfromveh/main.cpp
  53. 13 13
      src/tool/map_collectfromveh/mainwindow.cpp
  54. 2 0
      src/tool/map_collectfromveh/map_collectfromveh.pro
  55. 589 0
      src/tool/map_collectfromveh/map_collectfromveh_language.ts
  56. 31 2
      src/tool/pointcloudviewer/main.cpp
  57. 12 0
      src/tool/pointcloudviewer/pointcloudviewer.xml
  58. 5 0
      src/tool/server_fwupdate/Readme.md
  59. 86 0
      src/tool/server_fwupdate/commonrpc.grpc.pb.cc
  60. 311 0
      src/tool/server_fwupdate/commonrpc.grpc.pb.h
  61. 133 0
      src/tool/server_fwupdate/fwadminproc.cpp
  62. 28 0
      src/tool/server_fwupdate/fwadminproc.h
  63. 301 0
      src/tool/server_fwupdate/fwdb.cpp
  64. 45 0
      src/tool/server_fwupdate/fwdb.h
  65. 91 0
      src/tool/server_fwupdate/main.cpp
  66. 5 8
      src/tool/server_fwupdate/mainwindow.cpp
  67. 4 0
      src/tool/server_fwupdate/mainwindow.h
  68. 28 3
      src/tool/server_fwupdate/server_fwupdate.pro
  69. 218 3
      src/tool/view_ndtmatching/mainwindow.cpp
  70. 42 1
      src/tool/view_ndtmatching/mainwindow.h
  71. 105 14
      src/tool/view_ndtmatching/mainwindow.ui
  72. 17 2
      src/tool/view_ndtmatching/view_ndtmatching.pro
  73. 10 2
      src/ui/ADCIntelligentShow_grpc/ivmapview.cpp
  74. 2 0
      src/ui/ADCIntelligentShow_grpc/ivmapview.h
  75. 49 20
      src/ui/ui_ads_hmi/ADCIntelligentVehicle.cpp
  76. 13 13
      src/ui/ui_ads_hmi/ADCIntelligentVehicle.ui
  77. 11 0
      src/ui/ui_ads_hmi/main.cpp
  78. 7 1
      src/ui/ui_ads_hmi/ui_ads_hmi.pro
  79. 748 0
      src/ui/ui_ads_hmi/ui_ads_hmi_language.ts

+ 91 - 8
src/common/modulecomm/shm/procsm.cpp

@@ -126,6 +126,7 @@ procsm::procsm(const char * strsmname,const unsigned int nBufSize,const unsigned
 
 //
 
+//    savefatalerror("procsm");
     char strasmname[300];
     snprintf(strasmname,255,"%s_%lld",strsmname,std::chrono::system_clock::now().time_since_epoch().count());
 
@@ -235,7 +236,10 @@ int procsm::CreateASMPTR(char * strasmname,const unsigned int nBufSize,const uns
         }
         else
         {
-            std::cout<<"Attach "<<mstrsmname<<" Attach Fail."<<std::endl;
+            char strout[256];
+            snprintf(strout,256,"Fatal Error. Create %s, attach fail. %s is exist,but attach fail.",mstrsmname,mstrsmname);
+            std::cout<<strout<<std::endl;
+            savefatalerror(strout);
             return -1;
         }
     }
@@ -243,7 +247,10 @@ int procsm::CreateASMPTR(char * strasmname,const unsigned int nBufSize,const uns
     ASM_PTR * pasm = (ASM_PTR *)mpASMPtr->data();
     if(pasm == NULL)
     {
-        std::cout<<"ASM_PTR is NULL."<<std::endl;
+        char strout[256];
+        snprintf(strout,256,"%s  pasm is NULL.",mstrsmname);
+        std::cout<<strout<<std::endl;
+        savefatalerror(strout);
         return -1;
     }
     if(bSMExit == false)
@@ -286,8 +293,10 @@ int procsm::CreateAndAttachASM(char * strasmname,const unsigned int nBufSize,con
             char * p = (char *)mpASM->data();
             if(p == NULL)
             {
-                strout = "Fatal Error: Create " + std::string(strsmname) + " Fail. data is NULL";
-                ivstdcolorout(strout,iv::STDCOLOR_BOLDRED);
+                char strout2[256];
+                snprintf(strout2,256,"Fatal Error: Exist, attach ok, but data is NULL",strsmname);
+                savefatalerror(strout2);
+                ivstdcolorout(strout2,iv::STDCOLOR_BOLDRED);
                 return -1;
             }
             mpinfo = (procsm_info *)p;
@@ -312,7 +321,10 @@ int procsm::CreateAndAttachASM(char * strasmname,const unsigned int nBufSize,con
                 char * p = (char *)mpASM->data();
                 if(p == NULL)
                 {
-                    strout = "Fatal Error: ReCreate " + std::string(strsmname) + " Fail. data is NULL";
+                    strout = "Fatal Error: ReCreate " + std::string(strsmname) + " OK. but data is NULL";
+                    char strout2[256];
+                    snprintf(strout2,256,"%s",strout.data());
+                    savefatalerror(strout2);
                     ivstdcolorout(strout,iv::STDCOLOR_BOLDRED);
                     return -2;
                 }
@@ -329,7 +341,10 @@ int procsm::CreateAndAttachASM(char * strasmname,const unsigned int nBufSize,con
             }
             else
             {
-                strout = "Fatal Error: ReCreate " + std::string(strsmname) + " Fail.";
+                strout = "Fatal Error: Exist,attach fail, so  ReCreate " + std::string(strsmname) + " ,but Fail.";
+                char strout2[256];
+                snprintf(strout2,256,"%s",strout.data());
+                savefatalerror(strout2);
                 ivstdcolorout(strout,iv::STDCOLOR_BOLDRED);
                 return -5;
             }
@@ -343,6 +358,9 @@ int procsm::CreateAndAttachASM(char * strasmname,const unsigned int nBufSize,con
         {
             strout = "Fatal Error.Create SharedMemory Fail. " + std::string(strsmname) + " not exist. successfully create it, but data is NULL";
             ivstdcolorout(strout,iv::STDCOLOR_BOLDRED);
+            char strout2[256];
+            snprintf(strout2,256,"%s",strout.data());
+            savefatalerror(strout2);
             return -3;
         }
         mpASM->lock();
@@ -389,6 +407,9 @@ int procsm::CreateAndAttachASM(char * strasmname,const unsigned int nBufSize,con
         mbAttach = false;
         strout = "Fatal Error.Create SharedMemory Fail. " + std::string(strsmname) + " Attach Fail.";
         ivstdcolorout(strout,iv::STDCOLOR_BOLDRED);
+        char strout2[256];
+        snprintf(strout2,256,"%s",strout.data());
+        savefatalerror(strout2);
         return -4;
     }
 
@@ -537,6 +558,7 @@ bool procsm::AttachMem()
                     char strerr[256];
                     snprintf(strerr,256,"AttachMem  CreateAndAttachASMFail. error code: %d",nrtn);
                     ivstdcolorout(strerr,iv::STDCOLOR_BOLDRED);
+                    savefatalerror(strerr);
                     return false;
                 }
                 else
@@ -560,8 +582,9 @@ bool procsm::AttachMem()
         if(mnMode == ModeWrite)
         {
             char strout[256];
-            snprintf(strout,256,"%s  Attach ASMPtr Fail.",mstrsmname);
+            snprintf(strout,256," when AttachMem, %s  Attach ASMPtr Fail.",mstrsmname);
             ivstdcolorout(" AttachMem: Attach Fail. ",iv::STDCOLOR_BOLDYELLOW);
+            savefatalerror(strout);
         }
         return false;
     }
@@ -663,13 +686,30 @@ int procsm::writemsg(const char *str, const unsigned int nSize)
         }
         else
         {
+            static bool bsave = false;
+            if(bsave == false)
+            {
+                char strout[256];
+                snprintf(strout,256,"%s procsm::writemsg message size is very big.msg size is %d ",mstrsmname,nSize);
+                savefatalerror(strout);
+                bsave = true;
+            }
+
         qDebug("procsm::writemsg message size is very big");
         return -1;
         }
     }
     if(mbAttach == false)
     {
-        std::cout<<mstrsmname<<"ShareMemory Attach fail."<<std::endl;
+        static bool bsave = false;
+        if(bsave == false)
+        {
+            char strout[256];
+            snprintf(strout,256,"%s writemsg, ShareMemory Attach fail. ",mstrsmname);
+            savefatalerror(strout);
+            bsave = true;
+        }
+        std::cout<<mstrsmname<<"  ShareMemory Attach fail."<<std::endl;
         return -1;
     }
     mpASM->lock();
@@ -862,7 +902,17 @@ int procsm::readmsg(unsigned int index, char *str, unsigned int nMaxSize,unsigne
           //         qDebug("read pos = %d",(phh+nPos)->mnPos);
                    nRtn = (phh+nPos)->mnLen;
   //                 pdt->setDate(QDate(2030,1,1));
+                   const int nms_msgkeep = 30000; //message must in 3 seconds read.
                    pdt->setMSecsSinceEpoch((phh+nPos)->sendtime/1000000);
+
+                   int64_t nms_now = std::chrono::system_clock::now().time_since_epoch().count()/1000000;
+                   int64_t nms_send = (phh+nPos)->sendtime/1000000;
+                   if(abs(nms_now - nms_send)> nms_msgkeep)
+                   {
+                       nRtn = 0;
+                       std::cout<<" message very old. skip it. diff is: "<<(nms_now - nms_send)<<std::endl;
+                   }
+
 //                   (phh+nPos)->GetDate(pdt);
            //        memcpy(pdt,&((phh+nPos)->mdt),sizeof(QDateTime));
                 }
@@ -874,3 +924,36 @@ int procsm::readmsg(unsigned int index, char *str, unsigned int nMaxSize,unsigne
     return nRtn;
 }
 
+
+void procsm::savefatalerror(char * strerr)
+{
+
+    char strdirname[256];
+    snprintf(strdirname,256,"%s/log",getenv("HOME"));
+    QDir xDir(strdirname);
+    if(!xDir.exists())
+    {
+        xDir.mkdir(strdirname);
+    }
+
+    QFile xFile;
+    int64_t nNow = std::chrono::system_clock::now().time_since_epoch().count();
+    char strfilename[256];
+    snprintf(strfilename,256,"%s/modulecomm_%ld.log",strdirname,nNow);
+
+
+    xFile.setFileName(strfilename);
+    if(xFile.open(QIODevice::ReadWrite))
+    {
+        xFile.write(strerr);
+        xFile.flush();
+    }
+    else
+    {
+        char strout[256];
+        snprintf(strout,256,"save error to file %s fail.",strfilename);
+        ivstdcolorout(strout,iv::STDCOLOR_BOLDRED);
+    }
+
+}
+

+ 2 - 0
src/common/modulecomm/shm/procsm.h

@@ -156,6 +156,8 @@ private:
     void setfailmark();
     bool checkfailmark(); //if have fail mark file,return true
 
+    void savefatalerror(char * strerr);
+
 
 
 };

+ 6 - 4
src/common/modulecomm/shm/procsm_if.cpp

@@ -163,10 +163,12 @@ void procsm_if_readthread::run()
                 if((nRtn == -2) ||(nRtn == -100)||(nRtn == -101))
                 {
                    index = mpPSM->getcurrentnext();
-                   if(nRtn == -100)  //Because New ShareMemory, read this.
-                   {
-                       if((index > 0)&&(bFirstRead == false) )index = index -1;
-                   }
+
+                   //comment next code, skip some message, when change asm.
+//                   if(nRtn == -100)  //Because New ShareMemory, read this.
+//                   {
+//                       if((index > 0)&&(bFirstRead == false) )index = index -1;
+//                   }
                 }
                 else
                 {

+ 4 - 2
src/detection/detection_ndt_matching/detection_ndt_matching.pro

@@ -30,7 +30,8 @@ SOURCES += main.cpp \
     ../../include/msgtype/gpsimu.pb.cc \
     ../../include/msgtype/gps.pb.cc \
     ../../include/msgtype/ndtgpspos.pb.cc \
-    globalrelocation.cpp
+    globalrelocation.cpp \
+    ../../include/msgtype/pcdmap.pb.cc
 
 HEADERS += \
     ndt_matching.h \
@@ -40,7 +41,8 @@ HEADERS += \
     ../../include/msgtype/gpsimu.pb.h \
     ../../include/msgtype/gps.pb.h \
     ../../include/msgtype/ndtgpspos.pb.h \
-    globalrelocation.h
+    globalrelocation.h \
+    ../../include/msgtype/pcdmap.pb.h
 
 INCLUDEPATH += /opt/ros/melodic/include
 INCLUDEPATH += /opt/ros/kinetic/include

+ 22 - 0
src/detection/detection_ndt_matching/main.cpp

@@ -15,6 +15,7 @@
 #include "ivlog.h"
 #include "ndt_matching.h"
 #include "gpsimu.pb.h"
+#include "pcdmap.pb.h"
 
 #include "ivexit.h"
 #include "ivbacktrace.h"
@@ -32,6 +33,11 @@ int gndttime;    //ndt calculate time
 
 void * gpa,* gpb ,* gpc, * gpd;   //Modulecomm pointer
 
+void * gparelocate;
+
+
+void * gpapcdmap;
+
 iv::Ivfault *gfault = nullptr;   //fault diag
 iv::Ivlog *givlog = nullptr;   //log
 
@@ -418,6 +424,12 @@ void ListenNDTRunstate(const char * strdata,const unsigned int nSize,const unsig
     gfault->SetFaultState(0, 0, "ok");
 }
 
+
+void ListenRelocate(const char * strdata,const unsigned int nSize,const unsigned int index,const QDateTime * dt,const char * strmemname)
+{
+    gbNeedReloc = true;
+}
+
 /**
  * @brief pausecomm
  */
@@ -427,6 +439,8 @@ void pausecomm()
     iv::modulecomm::PauseComm(gpb);
     iv::modulecomm::PauseComm(gpc);
     iv::modulecomm::PauseComm(gpd);
+    iv::modulecomm::PauseComm(gparelocate);
+    iv::modulecomm::PauseComm(gpapcdmap);
 }
 
 /**
@@ -438,6 +452,8 @@ void continuecomm()
     iv::modulecomm::ContintuComm(gpb);
     iv::modulecomm::ContintuComm(gpc);
     iv::modulecomm::ContintuComm(gpd);
+    iv::modulecomm::ContintuComm(gparelocate);
+    iv::modulecomm::ContintuComm(gpapcdmap);
 }
 
 /**
@@ -559,6 +575,8 @@ void exitfunc()
     iv::modulecomm::Unregister(gpb);
     iv::modulecomm::Unregister(gpc);
     iv::modulecomm::Unregister(gpd);
+    iv::modulecomm::Unregister(gparelocate);
+    iv::modulecomm::Unregister(gpapcdmap);
     if(gpFileLastPos != 0)gpFileLastPos->close();
     std::cout<<"Complete exitfunc."<<std::endl;
 }
@@ -587,6 +605,8 @@ int main(int argc, char *argv[])
 
    iv::xmlparam::Xmlparam xparam(strpath.toStdString());
 
+    gpapcdmap = iv::modulecomm::RegisterSend("pcdmap",1000,1);
+
    gstr_lidarmsgname = xparam.GetParam("lidarmsg","lidar_pc");
    gstr_gpsmsgname = xparam.GetParam("gpsmsg","hcp2_gpsimu");
    gstr_ndtposmsgname = xparam.GetParam("ndtposmsg","ndtpos");
@@ -650,6 +670,8 @@ int main(int argc, char *argv[])
     gpb = iv::modulecomm::RegisterRecv(gstr_gpsmsgname.data(),ListenRaw);
     gpc = iv::modulecomm::RegisterSend(gstr_ndtposmsgname.data(),10000,1);
     gpd = iv::modulecomm::RegisterSend(gstr_ndtgpsposmsgname.data(),10000,1);
+    gparelocate = iv::modulecomm::RegisterRecv("relocate",ListenRelocate);
+
     ndt_match_Init_nomap();
 
     iv::ivexit::RegIVExitCall(exitfunc);

+ 32 - 0
src/detection/detection_ndt_matching/ndt_matching.cpp

@@ -60,6 +60,7 @@
 //#include <ndt_gpu/NormalDistributionsTransform.h>
 #include "ndtpos.pb.h"
 #include "ndtgpspos.pb.h"
+#include "pcdmap.pb.h"
 
 //#include <pcl_ros/point_cloud.h>
 //#include <pcl_ros/transforms.h>
@@ -106,6 +107,8 @@
 extern iv::Ivfault *gfault ;
 extern iv::Ivlog *givlog;
 
+extern void * gpapcdmap;
+
 static int gindex = 0;
 iv::lidar_pose glidar_pose;
 
@@ -480,6 +483,8 @@ static void UseMap(int index)
     xmap = boost::shared_ptr<pcl::PointCloud<pcl::PointXYZ>>(new pcl::PointCloud<pcl::PointXYZ>);
 
 
+
+
     QTime xTime;
     xTime.start();
     if(0 == pcl::io::loadPCDFile(gvector_trace.at(index).mstrpcdpath.data(),*xmap))
@@ -559,6 +564,8 @@ void LocalMapUpdate(int n)
     while(gbLMRun)
     {
 
+        bool bsharemap = false;
+
         getmindistrace(index,ftracedis);
 
         if(g_hasmap == false)
@@ -571,6 +578,10 @@ void LocalMapUpdate(int n)
                     UseMap(index);
                     ncurindex = index;
                     g_hasmap = true;
+
+                    bsharemap = true;
+
+
                 }
             }
         }
@@ -585,6 +596,7 @@ void LocalMapUpdate(int n)
                    UseMap(index);
                    ncurindex = index;
                    g_hasmap = true;
+                   bsharemap = true;
                }
            }
         }
@@ -598,6 +610,26 @@ void LocalMapUpdate(int n)
 
 
         std::this_thread::sleep_for(std::chrono::milliseconds(100));
+
+        if(bsharemap)
+        {
+            std::this_thread::sleep_for(std::chrono::milliseconds(100));
+            iv::ndt::pcdmap xpcdmappath;
+            xpcdmappath.set_strpath(gvector_trace.at(index).mstrpcdpath);
+            int nbytesize = xpcdmappath.ByteSize();
+            std::shared_ptr<char> pstr_ptr = std::shared_ptr<char>(new char[nbytesize]);
+            if(xpcdmappath.SerializeToArray(pstr_ptr.get(),nbytesize))
+            {
+                std::cout<<" share pcd map info ."<<std::endl;
+                iv::modulecomm::ModuleSendMsg(gpapcdmap,pstr_ptr.get(),nbytesize);
+                std::this_thread::sleep_for(std::chrono::milliseconds(100));
+                iv::modulecomm::ModuleSendMsg(gpapcdmap,pstr_ptr.get(),nbytesize);
+            }
+            else
+            {
+                std::cout<<" pcdmap SerializeToArray faile. "<<std::endl;
+            }
+        }
     }
 }
 

+ 30 - 0
src/driver/driver_camera_ioctl/camtest.pro

@@ -0,0 +1,30 @@
+
+QT -= gui
+
+CONFIG += c++11 console
+CONFIG -= app_bundle
+
+# The following define makes your compiler emit warnings if you use
+# any feature of Qt which as been marked deprecated (the exact warnings
+# depend on your compiler). Please consult the documentation of the
+# deprecated API in order to know how to port your code away from it.
+DEFINES += QT_DEPRECATED_WARNINGS
+
+# You can also make your code fail to compile if you use deprecated APIs.
+# In order to do so, uncomment the following line.
+# You can also select to disable deprecated APIs only up to a certain version of Qt.
+#DEFINES += QT_DISABLE_DEPRECATED_BEFORE=0x060000    # disables all the APIs deprecated before Qt 6.0.0
+
+SOURCES += camtestmain.cpp \
+    usb_cam.cpp
+
+
+HEADERS += \
+    usb_cam.h
+
+QMAKE_LFLAGS += -no-pie
+
+
+LIBS +=-lpostproc -lswresample -lswscale -lavfilter -lavdevice -lavformat -lavcodec -lavutil -lm -ldl
+
+

+ 286 - 0
src/driver/driver_camera_ioctl/camtestmain.cpp

@@ -0,0 +1,286 @@
+#include <QCoreApplication>
+#include <thread>
+#include <QMutex>
+
+
+
+#include "usb_cam.h"
+
+
+#include <iostream>
+
+#include <stdio.h>
+#include <unistd.h>
+
+#include <sys/types.h>                      // 下面四个头文件是linux系统编程特有的
+#include <sys/stat.h>
+#include <sys/ioctl.h>
+#include <sys/mman.h>
+#include <fcntl.h>
+
+#include <linux/videodev2.h>                // 操作摄像头设备
+
+
+#include <signal.h>
+
+QCoreApplication * gApp;
+
+
+void * gpa;
+
+int gindex = 0;
+
+
+int gcamindex = 1;
+
+std::string gstrcamera = "";
+
+std::string gmsgname = "usbpic";
+
+std::string gstrdevname = "/dev/video5";
+
+
+std::string gvideo_device_name_, gio_method_name_, gpixel_format_name_, gcamera_name_, gcamera_info_url_;
+//std::string start_service_name_, start_service_name_;
+bool gstreaming_status_;
+int gimage_width_, gimage_height_, gframerate_, gexposure_, gbrightness_, gcontrast_, gsaturation_, gsharpness_, gfocus_,
+    gwhite_balance_, ggain_;
+bool gautofocus_, gautoexposure_, gauto_white_balance_;
+
+bool gbuserawmjpeg = true;
+
+bool gbcompress = true;
+
+
+void setdefaultcvalue()
+{
+    gbrightness_ = -1;// xp.GetParam("brightness",  -1); //0-255, -1 "leave alone"
+    gcontrast_ = -1;//xp.GetParam("contrast",  -1); //0-255, -1 "leave alone"
+    gsaturation_ =  -1;//xp.GetParam("saturation",  -1); //0-255, -1 "leave alone"
+    gsharpness_ = -1;//xp.GetParam("sharpness",  -1); //0-255, -1 "leave alone"
+    // possible values: mmap, read, userptr
+//    gio_method_name_ = xp.GetParam("io_method",  std::string("mmap"));
+//    gimage_width_ = xp.GetParam("image_width", 1920);
+//    gimage_height_ = xp.GetParam("image_height",  1080);
+//    gframerate_ =  xp.GetParam("framerate",  30);
+    // possible values: yuyv, uyvy, mjpeg, yuvmono10, rgb24
+//    gpixel_format_name_ = xp.GetParam("pixel_format",  std::string("mjpeg"));
+    // enable/disable autofocus
+    gautofocus_  = false;//xp.GetParam("autofocus", false);
+
+
+    gfocus_ = -1;//xp.GetParam("focus", -1); //0-255, -1 "leave alone"
+    // enable/disable autoexposure
+    gautoexposure_ = true;//xp.GetParam("autoexposure",  true);
+    gexposure_ = 100;//xp.GetParam("exposure",  100);
+    ggain_ = -1;//xp.GetParam("gain",  -1); //0-100?, -1 "leave alone"
+    // enable/disable auto white balance temperature
+    gauto_white_balance_ = true;//xp.GetParam("auto_white_balance", true);
+    gwhite_balance_ = 4000;//xp.GetParam("white_balance", 4000);
+
+    // load the camera info
+//     xp.GetParam("camera_frame_id", img_.header.frame_id, std::string("head_camera"));
+//    gcamera_name_ = "head_camera";// xp.GetParam("camera_name",  std::string("head_camera"));
+//    gcamera_info_url_ = "";//xp.GetParam("camera_info_url",  std::string(""));
+}
+
+using namespace  usb_cam;
+void threadcapture()
+{
+
+    usb_cam::UsbCam camx;
+
+    // set the IO method
+    UsbCam::io_method io_method = UsbCam::io_method_from_string("mmap");
+    if(io_method == UsbCam::IO_METHOD_UNKNOWN)
+    {
+      qDebug("Unknown IO method '%s'", gio_method_name_.c_str());
+      return;
+    }
+
+    // set the pixel format
+    UsbCam::pixel_format pixel_format = UsbCam::pixel_format_from_string("mjpeg");
+    if (pixel_format == UsbCam::PIXEL_FORMAT_UNKNOWN)
+    {
+      qDebug("Unknown pixel format '%s'", gpixel_format_name_.c_str());
+      return;
+    }
+
+    // start the camera
+    camx.start(gvideo_device_name_.c_str(), io_method, pixel_format, gimage_width_,
+             gimage_height_, gframerate_);
+
+    // set camera parameters
+    if (gbrightness_ >= 0)
+    {
+      camx.set_v4l_parameter("brightness", gbrightness_);
+    }
+
+    if (gcontrast_ >= 0)
+    {
+      camx.set_v4l_parameter("contrast", gcontrast_);
+    }
+
+    if (gsaturation_ >= 0)
+    {
+      camx.set_v4l_parameter("saturation", gsaturation_);
+    }
+
+    if (gsharpness_ >= 0)
+    {
+      camx.set_v4l_parameter("sharpness", gsharpness_);
+    }
+
+    if (ggain_ >= 0)
+    {
+      camx.set_v4l_parameter("gain", ggain_);
+    }
+
+    // check auto white balance
+    if (gauto_white_balance_)
+    {
+      camx.set_v4l_parameter("white_balance_temperature_auto", 1);
+    }
+    else
+    {
+      camx.set_v4l_parameter("white_balance_temperature_auto", 0);
+      camx.set_v4l_parameter("white_balance_temperature", gwhite_balance_);
+    }
+
+    // check auto exposure
+    if (!gautoexposure_)
+    {
+      // turn down exposure control (from max of 3)
+      camx.set_v4l_parameter("exposure_auto", 1);
+      // change the exposure level
+      camx.set_v4l_parameter("exposure_absolute", gexposure_);
+    }
+
+    // check auto focus
+    if (gautofocus_)
+    {
+      camx.set_auto_focus(1);
+      camx.set_v4l_parameter("focus_auto", 1);
+    }
+    else
+    {
+      camx.set_v4l_parameter("focus_auto", 0);
+      if (gfocus_ >= 0)
+      {
+        camx.set_v4l_parameter("focus_absolute", gfocus_);
+      }
+    }
+
+    camx.set_useRawMJPEG(gbuserawmjpeg);
+
+    int nserbufsize = 20000000;
+
+    char * strser = new char[nserbufsize];
+
+    char * strbuf = new char[10000000];
+
+
+    int64_t nLastrecv = 0;
+    int nvalid = 0;
+    int nfail = 0;
+    while(1)
+    {
+        int nLen;
+        camx.grab_image(strbuf,&nLen,10000000);
+        int64_t nnow = std::chrono::system_clock::now().time_since_epoch().count()/1000000;
+        if(abs(nnow - nLastrecv)<50)
+        {
+            nvalid++;
+            nfail = 0;
+        }
+        else
+        {
+            nvalid = 0;
+            nfail++;
+        }
+        if(nvalid > 10)
+        {
+            std::cout<<" camtest success."<<std::endl;
+            exit(0);
+        }
+        if(nfail > 5)
+        {
+            std::cout<<" cantest fail."<<std::endl;
+            exit(1);
+        }
+        nLastrecv = nnow;
+//        qDebug("time %ld len: %ld",QDateTime::currentMSecsSinceEpoch(),nLen);
+
+
+//        iv::modulecomm::ModuleSendMsg(gpa,strbuf,nLen);
+//        continue;
+
+    }
+
+}
+
+void ExitFunc()
+{
+    gApp->quit();
+    std::this_thread::sleep_for(std::chrono::milliseconds(100));
+}
+
+void signal_handler(int sig)
+{
+    if(sig == SIGINT)
+    {
+        ExitFunc();
+    }
+}
+
+int main(int argc, char *argv[])
+{
+    QCoreApplication a(argc, argv);
+    gApp = &a;
+
+
+
+    gimage_width_ = 1920;
+    gimage_height_ = 1080;
+    gframerate_ = 30;
+    gvideo_device_name_ = "/dev/video0";
+
+    if(argc>1)
+    {
+        gvideo_device_name_ = argv[1];
+    }
+
+    if(argc>2)
+    {
+        gimage_width_ = atoi(argv[2]);
+    }
+
+    if(argc>3)
+    {
+        gimage_height_ = atoi(argv[3]);
+    }
+
+    if(argc>4)
+    {
+        gframerate_ = atoi(argv[4]);
+    }
+
+
+
+    std::thread * mthread =  new  std::thread(threadcapture) ;//new std::thread(VideoThread,0);
+
+//    std::thread * conthread = new std::thread(threadConvert);
+
+//    std::thread * compressthread = new std::thread(threadCompress);
+
+    (void)mthread;
+//    (void)conthread;
+//    (void)compressthread;
+
+    signal(SIGINT,signal_handler);
+
+    int nrc = a.exec();
+
+
+    return nrc;
+}

+ 1 - 1
src/driver/driver_group_grpc_server/main.cpp

@@ -210,7 +210,7 @@ int main(int argc, char *argv[])
 
     iv::xmlparam::Xmlparam xp("./driver_group_grpc_server.xml");
 
-    gstrserver = xp.GetParam("server","0.0.0.0:31001");
+    gstrlsserver = xp.GetParam("server","0.0.0.0:31001");
     gbSaveToDB = xp.GetParam("savetodb",true);
     gstrdbpath = xp.GetParam("dbpath",getdefdbpath());
 

File diff suppressed because it is too large
+ 825 - 581
src/driver/driver_grpc_client/ivgrpc.pb.cc


File diff suppressed because it is too large
+ 491 - 1044
src/driver/driver_grpc_client/ivgrpc.pb.h


+ 31 - 0
src/include/proto/fwadmin.proto

@@ -0,0 +1,31 @@
+syntax = "proto2";
+
+package iv.fw;
+
+enum ADMINREQ_TYPE
+{
+	QUERYUSER = 0;
+	ADDUSER = 1;
+	RESETUSER = 2;
+	UPDATEUSER = 3;
+}
+
+message adminreq
+{
+	required ADMINREQ_TYPE admintype = 1;
+	required string username = 2;
+	optional string password = 3;
+	optional string strvalidtime = 4;
+	
+};
+
+
+message adminreply
+{
+	required int32 nresult = 1;  //0 fail    1 success
+	optional string errstr = 2; //
+	optional string strvalidtime = 3;  //valid time
+	required ADMINREQ_TYPE admintype = 4;
+}
+
+

+ 18 - 0
src/include/proto/fwlogin.proto

@@ -0,0 +1,18 @@
+syntax = "proto2";
+
+package iv.fw;
+
+message loginreq
+{
+	required string username = 1;
+	required string password = 2;
+};
+
+
+message loginreply
+{
+	required int32 nauth = 1;  //0 not auth    1 auth
+	optional string errstr = 2; //
+}
+
+

+ 12 - 0
src/include/proto/pcdmap.proto

@@ -0,0 +1,12 @@
+syntax = "proto2";
+
+package iv.ndt;
+
+message pcdmap
+{
+	required string strpath = 1;
+};
+
+
+
+

+ 13 - 0
src/include/proto/relocate.proto

@@ -0,0 +1,13 @@
+syntax = "proto2";
+
+package iv.ndt;
+
+message relocate
+{
+	optional bool bEnable = 1;
+
+};
+
+
+
+

+ 50 - 0
src/include/proto3/commonrpc.proto

@@ -0,0 +1,50 @@
+// Copyright 2015 gRPC authors.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+//     http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+syntax = "proto3";
+
+option java_multiple_files = true;
+option java_package = "io.grpc.adc.commonrpc";
+option java_outer_classname = "CommonRPCProto";
+option objc_class_prefix = "HLW";
+
+package iv;
+
+// The Upload service definition.
+service CommonRPC {
+  // Sends a Upload
+  rpc rpcquery (queryrpcReq) returns (queryrpcReply) {}
+  
+}
+
+enum CommonRPCType //枚举消息类型
+{
+	LOGIN = 0; 
+	USERADMIN = 1;
+}
+
+message queryrpcReq {
+  
+  CommonRPCType nType = 1;
+  int32 ndatasize = 2;
+  bytes data = 3; 
+}
+
+message queryrpcReply {
+    CommonRPCType nType = 1;
+    int32 ndatasize = 2;
+    bytes data = 3;
+}
+
+

+ 54 - 0
src/tool/Inspection_Shenlan_Miivill/Inspection_Shenlan_Miivill.pro

@@ -0,0 +1,54 @@
+#-------------------------------------------------
+#
+# Project created by QtCreator 2023-09-06T09:57:46
+#
+#-------------------------------------------------
+
+QT       += core gui
+
+greaterThan(QT_MAJOR_VERSION, 4): QT += widgets
+
+TARGET = Inspection_Shenlan_Miivill
+TEMPLATE = app
+
+# The following define makes your compiler emit warnings if you use
+# any feature of Qt which has been marked as deprecated (the exact warnings
+# depend on your compiler). Please consult the documentation of the
+# deprecated API in order to know how to port your code away from it.
+DEFINES += QT_DEPRECATED_WARNINGS
+
+# You can also make your code fail to compile if you use deprecated APIs.
+# In order to do so, uncomment the following line.
+# You can also select to disable deprecated APIs only up to a certain version of Qt.
+#DEFINES += QT_DISABLE_DEPRECATED_BEFORE=0x060000    # disables all the APIs deprecated before Qt 6.0.0
+
+
+SOURCES += \
+        main.cpp \
+        mainwindow.cpp \
+    ../../include/msgtype/canmsg.pb.cc \
+    ../../include/msgtype/canraw.pb.cc \
+    ../../include/msgtype/gps.pb.cc \
+    ../../include/msgtype/gpsimu.pb.cc
+
+HEADERS += \
+        mainwindow.h \
+    ../../include/msgtype/canmsg.pb.h \
+    ../../include/msgtype/canraw.pb.h \
+    ../../include/msgtype/gps.pb.h \
+    ../../include/msgtype/gpsimu.pb.h
+
+FORMS += \
+        mainwindow.ui
+
+
+!include(../../../include/common.pri ) {
+    error( "Couldn't find the common.pri file!" )
+}
+
+
+!include(../../../include/ivprotobuf.pri ) {
+    error( "Couldn't find the ivprotobuf.pri file!" )
+}
+
+

+ 11 - 0
src/tool/Inspection_Shenlan_Miivill/main.cpp

@@ -0,0 +1,11 @@
+#include "mainwindow.h"
+#include <QApplication>
+
+int main(int argc, char *argv[])
+{
+    QApplication a(argc, argv);
+    MainWindow w;
+    w.show();
+
+    return a.exec();
+}

+ 302 - 0
src/tool/Inspection_Shenlan_Miivill/mainwindow.cpp

@@ -0,0 +1,302 @@
+#include "mainwindow.h"
+#include "ui_mainwindow.h"
+
+#include "canmsg.pb.h"
+#include "gpsimu.pb.h"
+
+static int gnState = 0;
+
+MainWindow::MainWindow(QWidget *parent) :
+    QMainWindow(parent),
+    ui(new Ui::MainWindow)
+{
+    ui->setupUi(this);
+
+    mpLE[0] = ui->lineEdit_VehicleCAN;
+    mpLE[1] = ui->lineEdit_Radar;
+    mpLE[2] = ui->lineEdit_GPS;
+    mpLE[3] = ui->lineEdit_LidarCenter;
+    mpLE[4] = ui->lineEdit_LidarLeft;
+    mpLE[5] = ui->lineEdit_LidarRight;
+    mpLE[6] = ui->lineEdit_CamFront;
+    mpLE[7] = ui->lineEdit_LidarPeception;
+
+    ui->pushButton_OutReport->setEnabled(false);
+    ui->progressBar->setRange(0,mninsnum);
+    ui->progressBar->setValue(0);
+    gnState = 0;
+
+    QTimer * ptimer = new QTimer(this);
+    connect(ptimer,SIGNAL(timeout()),this,SLOT(onTimer()));
+    ptimer->start(100);
+
+    void * pa;
+
+    ModuleFun fun1 =std::bind(&MainWindow::UpdateMSG,this,std::placeholders::_1,std::placeholders::_2,std::placeholders::_3,std::placeholders::_4,std::placeholders::_5);
+    pa = iv::modulecomm::RegisterRecvPlus("canrecv0",fun1);
+    pa = iv::modulecomm::RegisterRecvPlus("canrecv1",fun1);
+    pa = iv::modulecomm::RegisterRecvPlus("hcp2_gpsimu",fun1);
+    pa = iv::modulecomm::RegisterRecvPlus("lidar_pc",fun1);
+    pa = iv::modulecomm::RegisterRecvPlus("lidarprc_left",fun1);
+    pa = iv::modulecomm::RegisterRecvPlus("lidarpc_right",fun1);
+    pa = iv::modulecomm::RegisterRecvPlus("image00",fun1);
+    pa = iv::modulecomm::RegisterRecvPlus("lidar_pointpillar",fun1);
+
+    setWindowTitle("Shenlan Miivii Inspection");
+}
+
+MainWindow::~MainWindow()
+{
+    delete ui;
+}
+
+void MainWindow::on_pushButton_Inspection_clicked()
+{
+    ui->pushButton_Inspection->setEnabled(false);
+
+    ui->progressBar->setValue(0);
+
+    int i;
+    for(i=0;i<mninsnum;i++)
+    {
+        QPalette palette;
+        palette.setColor(QPalette::Base,Qt::white);
+        palette.setColor(QPalette::Text,Qt::black);
+        mpLE[i]->setText("");
+        mpLE[i]->setPalette(palette);
+    }
+
+    gnState = 1;
+    mnCountMsg = 0;
+    mnCountTimer = 0;
+    mstrerr = "TimeOut";
+    mnRes = 0;
+}
+
+void MainWindow::on_pushButton_OutReport_clicked()
+{
+
+}
+
+void MainWindow::onTimer()
+{
+    if((gnState == 0)||(gnState> mninsnum ))
+    {
+        if(gnState > mninsnum)
+        {
+            ui->progressBar->setValue(mninsnum);
+            gnState = 0;
+            ui->pushButton_Inspection->setEnabled(true);
+        }
+        return;
+    }
+
+
+    mmutex.lock();
+    mnCountTimer++;
+    if(mnRes == 1 )
+    {
+        QPalette palette;
+        palette.setColor(QPalette::Base,Qt::green);
+        palette.setColor(QPalette::Text,Qt::black);
+       mpLE[gnState-1]->setPalette(palette);
+       mpLE[gnState-1]->setText("OK");
+
+       gnState++;
+       mnCountMsg = 0;
+       mnCountTimer = 0;
+       mstrerr = "TimeOut";
+       mnRes = 0;
+    }
+    if(mnCountTimer >= mnTimerMax)
+    {
+        QPalette palette;
+
+        palette.setColor(QPalette::Text,Qt::black);
+        if(mnCountMsg == 0)
+        {
+            mpLE[gnState-1]->setText("TimeOut");
+            palette.setColor(QPalette::Base,Qt::red);
+        }
+        else
+        {
+            mpLE[gnState-1]->setText("Have Msg.");
+            palette.setColor(QPalette::Base,Qt::yellow);
+        }
+
+        mpLE[gnState-1]->setPalette(palette);
+        gnState++;
+        mnCountMsg = 0;
+        mnCountTimer = 0;
+        mstrerr = "TimeOut";
+        mnRes = 0;
+
+
+
+    }
+
+    mmutex.unlock();
+    ui->progressBar->setValue(gnState-1);
+}
+
+void MainWindow::UpdateMSG(const char * strdata,const unsigned int nSize,const unsigned int index,const QDateTime * dt,const char * strmemname)
+{
+    if((gnState == 0)||(gnState> mninsnum ))
+    {
+        return;
+    }
+
+    mmutex.lock();
+    switch (gnState) {
+    case 1:
+        {
+            if(strncmp(strmemname,"canrecv0",256) == 0)
+            {
+                iv::can::canmsg xmsg;
+                if(false == xmsg.ParseFromArray(strdata,nSize))
+                {
+
+                }
+                else
+                {
+                    mnCountMsg++;
+                    mstrerr = "have msg.";
+                    int i;
+                    for(i=0;i<xmsg.rawmsg_size();i++)
+                    {
+                        const iv::can::canraw * praw = &(xmsg.rawmsg(i));
+                        if(praw->id() == 0x1CC)
+                        {
+                            mnRes = 1;
+                            break;
+                        }
+                    }
+                }
+            }
+        }
+        break;
+    case 2:
+        {
+            if(strncmp(strmemname,"canrecv1",256) == 0)
+            {
+
+                iv::can::canmsg xmsg;
+                if(false == xmsg.ParseFromArray(strdata,nSize))
+                {
+
+                }
+                else
+                {
+                    mnCountMsg++;
+                    mstrerr = "have msg.";
+                    int i;
+                    for(i=0;i<xmsg.rawmsg_size();i++)
+                    {
+                        const iv::can::canraw * praw = &(xmsg.rawmsg(i));
+                        if((praw->id() == 0x600)||(praw->id() == 0x700)||(praw->id() == 0x701)||(praw->id() == 0x702)||(praw->id() == 0x60A)||(praw->id() == 0x60B))
+                        {
+                            mnRes = 1;
+                            break;
+                        }
+                    }
+                }
+            }
+        }
+        break;
+    case 3:
+    {
+        if(strncmp(strmemname,"hcp2_gpsimu",256) == 0)
+        {
+            iv::gps::gpsimu xgpsimu;
+            if(false == xgpsimu.ParseFromArray(strdata,nSize))
+            {
+
+            }
+            else
+            {
+                mnCountMsg++;
+                mstrerr = "have msg.";
+                if(xgpsimu.rtk_state() == 6)
+                {
+                    mnRes = 1;
+                }
+            }
+        }
+    }
+        break;
+    case 4:
+    {
+        if(strncmp(strmemname,"lidar_pc",256) == 0)
+        {
+
+                mnCountMsg++;
+                mstrerr = "have msg.";
+                if(mnCountMsg>10)
+                {
+                    mnRes = 1;
+                }
+        }
+    }
+        break;
+    case 5:
+    {
+        if(strncmp(strmemname,"lidarpc_left",256) == 0)
+        {
+
+                mnCountMsg++;
+                mstrerr = "have msg.";
+                if(mnCountMsg>10)
+                {
+                    mnRes = 1;
+                }
+        }
+    }
+        break;
+    case 6:
+    {
+        if(strncmp(strmemname,"lidarpc_right",256) == 0)
+        {
+
+                mnCountMsg++;
+                mstrerr = "have msg.";
+                if(mnCountMsg>10)
+                {
+                    mnRes = 1;
+                }
+        }
+    }
+        break;
+    case 7:
+    {
+        if(strncmp(strmemname,"image00",256) == 0)
+        {
+
+                mnCountMsg++;
+                mstrerr = "have msg.";
+                if(mnCountMsg>10)
+                {
+                    mnRes = 1;
+                }
+        }
+    }
+        break;
+    case 8:
+    {
+        if(strncmp(strmemname,"lidar_pointpillar",256) == 0)
+        {
+
+                mnCountMsg++;
+                mstrerr = "have msg.";
+                if(mnCountMsg>3)
+                {
+                    mnRes = 1;
+                }
+        }
+    }
+        break;
+    default:
+        break;
+    }
+    mmutex.unlock();
+}
+

+ 66 - 0
src/tool/Inspection_Shenlan_Miivill/mainwindow.h

@@ -0,0 +1,66 @@
+#ifndef MAINWINDOW_H
+#define MAINWINDOW_H
+
+#include <QMainWindow>
+#include <QTimer>
+
+#include <QLineEdit>
+
+#include <vector>
+#include <string>
+#include <mutex>
+
+#include "modulecomm.h"
+
+#define mninsnum 8
+
+namespace Ui {
+class MainWindow;
+}
+
+class MainWindow : public QMainWindow
+{
+    Q_OBJECT
+
+public:
+    explicit MainWindow(QWidget *parent = 0);
+    ~MainWindow();
+
+
+private slots:
+    void on_pushButton_Inspection_clicked();
+
+    void on_pushButton_OutReport_clicked();
+
+    void onTimer();
+
+
+private:
+    void UpdateMSG(const char * strdata,const unsigned int nSize,const unsigned int index,const QDateTime * dt,const char * strmemname);
+
+private:
+    Ui::MainWindow *ui;
+
+
+
+
+    int mnCountMsg = 0;
+
+    int mnCountTimer = 0;
+    int mnTimerMax = 30;
+    std::string mstrerr;
+    int mnRes = 0;
+
+    std::vector<std::string> mvectorinsres;
+    std::vector<int> mvectornres;
+
+    QLineEdit * mpLE[mninsnum];
+
+    std::mutex mmutex;
+
+
+
+
+};
+
+#endif // MAINWINDOW_H

+ 288 - 0
src/tool/Inspection_Shenlan_Miivill/mainwindow.ui

@@ -0,0 +1,288 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<ui version="4.0">
+ <class>MainWindow</class>
+ <widget class="QMainWindow" name="MainWindow">
+  <property name="geometry">
+   <rect>
+    <x>0</x>
+    <y>0</y>
+    <width>750</width>
+    <height>464</height>
+   </rect>
+  </property>
+  <property name="windowTitle">
+   <string>MainWindow</string>
+  </property>
+  <widget class="QWidget" name="centralWidget">
+   <widget class="QLabel" name="label">
+    <property name="geometry">
+     <rect>
+      <x>30</x>
+      <y>80</y>
+      <width>151</width>
+      <height>31</height>
+     </rect>
+    </property>
+    <property name="text">
+     <string>Vechicle CAN</string>
+    </property>
+   </widget>
+   <widget class="QLabel" name="label_2">
+    <property name="geometry">
+     <rect>
+      <x>30</x>
+      <y>140</y>
+      <width>141</width>
+      <height>31</height>
+     </rect>
+    </property>
+    <property name="text">
+     <string>Radar</string>
+    </property>
+   </widget>
+   <widget class="QLabel" name="label_3">
+    <property name="geometry">
+     <rect>
+      <x>30</x>
+      <y>198</y>
+      <width>141</width>
+      <height>31</height>
+     </rect>
+    </property>
+    <property name="text">
+     <string>GPS</string>
+    </property>
+   </widget>
+   <widget class="QLabel" name="label_4">
+    <property name="geometry">
+     <rect>
+      <x>30</x>
+      <y>260</y>
+      <width>131</width>
+      <height>31</height>
+     </rect>
+    </property>
+    <property name="text">
+     <string>Center Lidar</string>
+    </property>
+   </widget>
+   <widget class="QLabel" name="label_5">
+    <property name="geometry">
+     <rect>
+      <x>370</x>
+      <y>80</y>
+      <width>141</width>
+      <height>31</height>
+     </rect>
+    </property>
+    <property name="text">
+     <string>Left Lidar</string>
+    </property>
+   </widget>
+   <widget class="QLabel" name="label_6">
+    <property name="geometry">
+     <rect>
+      <x>368</x>
+      <y>141</y>
+      <width>131</width>
+      <height>31</height>
+     </rect>
+    </property>
+    <property name="text">
+     <string>Right Lidar</string>
+    </property>
+   </widget>
+   <widget class="QLabel" name="label_7">
+    <property name="geometry">
+     <rect>
+      <x>368</x>
+      <y>203</y>
+      <width>141</width>
+      <height>31</height>
+     </rect>
+    </property>
+    <property name="text">
+     <string>Front Camera</string>
+    </property>
+   </widget>
+   <widget class="QLabel" name="label_8">
+    <property name="geometry">
+     <rect>
+      <x>365</x>
+      <y>263</y>
+      <width>141</width>
+      <height>31</height>
+     </rect>
+    </property>
+    <property name="text">
+     <string>Lidar Perception</string>
+    </property>
+   </widget>
+   <widget class="QPushButton" name="pushButton_Inspection">
+    <property name="geometry">
+     <rect>
+      <x>100</x>
+      <y>20</y>
+      <width>181</width>
+      <height>41</height>
+     </rect>
+    </property>
+    <property name="text">
+     <string>Inspection</string>
+    </property>
+   </widget>
+   <widget class="QLineEdit" name="lineEdit_VehicleCAN">
+    <property name="geometry">
+     <rect>
+      <x>170</x>
+      <y>75</y>
+      <width>171</width>
+      <height>41</height>
+     </rect>
+    </property>
+    <property name="readOnly">
+     <bool>true</bool>
+    </property>
+   </widget>
+   <widget class="QLineEdit" name="lineEdit_Radar">
+    <property name="geometry">
+     <rect>
+      <x>170</x>
+      <y>136</y>
+      <width>171</width>
+      <height>41</height>
+     </rect>
+    </property>
+    <property name="readOnly">
+     <bool>true</bool>
+    </property>
+   </widget>
+   <widget class="QLineEdit" name="lineEdit_GPS">
+    <property name="geometry">
+     <rect>
+      <x>170</x>
+      <y>197</y>
+      <width>171</width>
+      <height>41</height>
+     </rect>
+    </property>
+    <property name="readOnly">
+     <bool>true</bool>
+    </property>
+   </widget>
+   <widget class="QLineEdit" name="lineEdit_LidarCenter">
+    <property name="geometry">
+     <rect>
+      <x>170</x>
+      <y>260</y>
+      <width>171</width>
+      <height>41</height>
+     </rect>
+    </property>
+    <property name="readOnly">
+     <bool>true</bool>
+    </property>
+   </widget>
+   <widget class="QLineEdit" name="lineEdit_CamFront">
+    <property name="geometry">
+     <rect>
+      <x>520</x>
+      <y>201</y>
+      <width>171</width>
+      <height>41</height>
+     </rect>
+    </property>
+    <property name="readOnly">
+     <bool>true</bool>
+    </property>
+   </widget>
+   <widget class="QLineEdit" name="lineEdit_LidarLeft">
+    <property name="geometry">
+     <rect>
+      <x>520</x>
+      <y>79</y>
+      <width>171</width>
+      <height>41</height>
+     </rect>
+    </property>
+    <property name="readOnly">
+     <bool>true</bool>
+    </property>
+   </widget>
+   <widget class="QLineEdit" name="lineEdit_LidarPeception">
+    <property name="geometry">
+     <rect>
+      <x>520</x>
+      <y>264</y>
+      <width>171</width>
+      <height>41</height>
+     </rect>
+    </property>
+    <property name="readOnly">
+     <bool>true</bool>
+    </property>
+   </widget>
+   <widget class="QLineEdit" name="lineEdit_LidarRight">
+    <property name="geometry">
+     <rect>
+      <x>520</x>
+      <y>140</y>
+      <width>171</width>
+      <height>41</height>
+     </rect>
+    </property>
+    <property name="readOnly">
+     <bool>true</bool>
+    </property>
+   </widget>
+   <widget class="QProgressBar" name="progressBar">
+    <property name="geometry">
+     <rect>
+      <x>30</x>
+      <y>330</y>
+      <width>661</width>
+      <height>51</height>
+     </rect>
+    </property>
+    <property name="value">
+     <number>24</number>
+    </property>
+   </widget>
+   <widget class="QPushButton" name="pushButton_OutReport">
+    <property name="geometry">
+     <rect>
+      <x>420</x>
+      <y>20</y>
+      <width>181</width>
+      <height>41</height>
+     </rect>
+    </property>
+    <property name="text">
+     <string>Out Report</string>
+    </property>
+   </widget>
+  </widget>
+  <widget class="QMenuBar" name="menuBar">
+   <property name="geometry">
+    <rect>
+     <x>0</x>
+     <y>0</y>
+     <width>750</width>
+     <height>28</height>
+    </rect>
+   </property>
+  </widget>
+  <widget class="QToolBar" name="mainToolBar">
+   <attribute name="toolBarArea">
+    <enum>TopToolBarArea</enum>
+   </attribute>
+   <attribute name="toolBarBreak">
+    <bool>false</bool>
+   </attribute>
+  </widget>
+  <widget class="QStatusBar" name="statusBar"/>
+ </widget>
+ <layoutdefault spacing="6" margin="11"/>
+ <resources/>
+ <connections/>
+</ui>

+ 41 - 0
src/tool/Inspection_Shenlan_Orin/Inspection_Shenlan_Orin.pro

@@ -0,0 +1,41 @@
+#-------------------------------------------------
+#
+# Project created by QtCreator 2023-09-06T14:56:36
+#
+#-------------------------------------------------
+
+QT       += core gui
+
+greaterThan(QT_MAJOR_VERSION, 4): QT += widgets
+
+TARGET = Inspection_Shenlan_Orin
+TEMPLATE = app
+
+# The following define makes your compiler emit warnings if you use
+# any feature of Qt which has been marked as deprecated (the exact warnings
+# depend on your compiler). Please consult the documentation of the
+# deprecated API in order to know how to port your code away from it.
+DEFINES += QT_DEPRECATED_WARNINGS
+
+# You can also make your code fail to compile if you use deprecated APIs.
+# In order to do so, uncomment the following line.
+# You can also select to disable deprecated APIs only up to a certain version of Qt.
+#DEFINES += QT_DISABLE_DEPRECATED_BEFORE=0x060000    # disables all the APIs deprecated before Qt 6.0.0
+
+
+SOURCES += \
+        main.cpp \
+        mainwindow.cpp
+
+HEADERS += \
+        mainwindow.h
+
+FORMS += \
+        mainwindow.ui
+
+!include(../../../include/common.pri ) {
+    error( "Couldn't find the common.pri file!" )
+}
+
+
+LIBS += -lusb_cam_python

+ 11 - 0
src/tool/Inspection_Shenlan_Orin/main.cpp

@@ -0,0 +1,11 @@
+#include "mainwindow.h"
+#include <QApplication>
+
+int main(int argc, char *argv[])
+{
+    QApplication a(argc, argv);
+    MainWindow w;
+    w.show();
+
+    return a.exec();
+}

+ 23 - 0
src/tool/Inspection_Shenlan_Orin/mainwindow.cpp

@@ -0,0 +1,23 @@
+#include "mainwindow.h"
+#include "ui_mainwindow.h"
+
+MainWindow::MainWindow(QWidget *parent) :
+    QMainWindow(parent),
+    ui(new Ui::MainWindow)
+{
+    ui->setupUi(this);
+
+    ui->pushButton_OutReport->setEnabled(false);
+
+
+}
+
+MainWindow::~MainWindow()
+{
+    delete ui;
+}
+
+void MainWindow::on_pushButton_Inspection_clicked()
+{
+ //   StartCam("video0",1920,1080,30);
+}

+ 32 - 0
src/tool/Inspection_Shenlan_Orin/mainwindow.h

@@ -0,0 +1,32 @@
+#ifndef MAINWINDOW_H
+#define MAINWINDOW_H
+
+#include <QMainWindow>
+
+extern "C"
+{
+int StartCam(const char * strvideoname,int image_width,int image_height,int image_framerate);
+int GetJPEGDataWithWait(char * strvideoname, char * str,int * x,int nwaitms);
+int StopCam(char * strvideoname);
+}
+
+namespace Ui {
+class MainWindow;
+}
+
+class MainWindow : public QMainWindow
+{
+    Q_OBJECT
+
+public:
+    explicit MainWindow(QWidget *parent = 0);
+    ~MainWindow();
+
+private slots:
+    void on_pushButton_Inspection_clicked();
+
+private:
+    Ui::MainWindow *ui;
+};
+
+#endif // MAINWINDOW_H

+ 172 - 0
src/tool/Inspection_Shenlan_Orin/mainwindow.ui

@@ -0,0 +1,172 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<ui version="4.0">
+ <class>MainWindow</class>
+ <widget class="QMainWindow" name="MainWindow">
+  <property name="geometry">
+   <rect>
+    <x>0</x>
+    <y>0</y>
+    <width>519</width>
+    <height>501</height>
+   </rect>
+  </property>
+  <property name="windowTitle">
+   <string>MainWindow</string>
+  </property>
+  <widget class="QWidget" name="centralWidget">
+   <widget class="QPushButton" name="pushButton_Inspection">
+    <property name="geometry">
+     <rect>
+      <x>70</x>
+      <y>25</y>
+      <width>141</width>
+      <height>51</height>
+     </rect>
+    </property>
+    <property name="text">
+     <string>Inspection</string>
+    </property>
+   </widget>
+   <widget class="QPushButton" name="pushButton_OutReport">
+    <property name="geometry">
+     <rect>
+      <x>281</x>
+      <y>26</y>
+      <width>141</width>
+      <height>51</height>
+     </rect>
+    </property>
+    <property name="text">
+     <string>Out Report</string>
+    </property>
+   </widget>
+   <widget class="QLabel" name="label">
+    <property name="geometry">
+     <rect>
+      <x>70</x>
+      <y>110</y>
+      <width>101</width>
+      <height>41</height>
+     </rect>
+    </property>
+    <property name="text">
+     <string>Video0</string>
+    </property>
+   </widget>
+   <widget class="QLineEdit" name="lineEdit_video0">
+    <property name="geometry">
+     <rect>
+      <x>200</x>
+      <y>110</y>
+      <width>221</width>
+      <height>41</height>
+     </rect>
+    </property>
+   </widget>
+   <widget class="QLineEdit" name="lineEdit_video1">
+    <property name="geometry">
+     <rect>
+      <x>200</x>
+      <y>170</y>
+      <width>221</width>
+      <height>41</height>
+     </rect>
+    </property>
+   </widget>
+   <widget class="QLabel" name="label_2">
+    <property name="geometry">
+     <rect>
+      <x>70</x>
+      <y>170</y>
+      <width>101</width>
+      <height>41</height>
+     </rect>
+    </property>
+    <property name="text">
+     <string>Video1</string>
+    </property>
+   </widget>
+   <widget class="QLineEdit" name="lineEdit_video3">
+    <property name="geometry">
+     <rect>
+      <x>200</x>
+      <y>290</y>
+      <width>221</width>
+      <height>41</height>
+     </rect>
+    </property>
+   </widget>
+   <widget class="QLineEdit" name="lineEdit_video2">
+    <property name="geometry">
+     <rect>
+      <x>200</x>
+      <y>230</y>
+      <width>221</width>
+      <height>41</height>
+     </rect>
+    </property>
+   </widget>
+   <widget class="QLabel" name="label_3">
+    <property name="geometry">
+     <rect>
+      <x>70</x>
+      <y>290</y>
+      <width>101</width>
+      <height>41</height>
+     </rect>
+    </property>
+    <property name="text">
+     <string>Video3</string>
+    </property>
+   </widget>
+   <widget class="QLabel" name="label_4">
+    <property name="geometry">
+     <rect>
+      <x>70</x>
+      <y>230</y>
+      <width>101</width>
+      <height>41</height>
+     </rect>
+    </property>
+    <property name="text">
+     <string>Video2</string>
+    </property>
+   </widget>
+   <widget class="QProgressBar" name="progressBar">
+    <property name="geometry">
+     <rect>
+      <x>70</x>
+      <y>358</y>
+      <width>351</width>
+      <height>51</height>
+     </rect>
+    </property>
+    <property name="value">
+     <number>24</number>
+    </property>
+   </widget>
+  </widget>
+  <widget class="QMenuBar" name="menuBar">
+   <property name="geometry">
+    <rect>
+     <x>0</x>
+     <y>0</y>
+     <width>519</width>
+     <height>28</height>
+    </rect>
+   </property>
+  </widget>
+  <widget class="QToolBar" name="mainToolBar">
+   <attribute name="toolBarArea">
+    <enum>TopToolBarArea</enum>
+   </attribute>
+   <attribute name="toolBarBreak">
+    <bool>false</bool>
+   </attribute>
+  </widget>
+  <widget class="QStatusBar" name="statusBar"/>
+ </widget>
+ <layoutdefault spacing="6" margin="11"/>
+ <resources/>
+ <connections/>
+</ui>

+ 2 - 1
src/tool/adc_cantool/window/ChassisAnalysisWindow/ChassisAnalysisWindow.cpp

@@ -178,7 +178,8 @@ void ChassisAnalysisWindow::checkChassisSignal()
        setLED(ui->label_socresult, 1, 10);
     }
     //spd
-    if(fabs(ui->doubleSpinBox_Spd->value()- spd)<=0.0001)
+    if(fabs(ui->doubleSpinBox_Spd->value()- spd)<=0.06)
+    //if(fabs(ui->doubleSpinBox_Spd->value()- spd)<=0.0001)
     {
       setLED(ui->label_spdresult, 2, 10);
     }

+ 2 - 0
src/tool/adcndtmultimapping/adcndtmultimapping.xml

@@ -2,5 +2,7 @@
 	<node name="adcndtmultimapping">
 		<param name="msg" value="lidar_pc" />
 		<param name="oldlidar" value="false" />
+		<param name="gpsmsg" value="hcp2_gpsimu" />
+		<param name="UseRTKGauss" value="false" />
 	</node>
 </xml>

+ 3 - 0
src/tool/adcndtmultimapping/main.cpp

@@ -13,6 +13,8 @@ std::string gstrimumsg;
 
 bool gbOldLidar = false;
 
+bool gbUseRTKGauss = false;
+
 
 int main(int argc, char *argv[])
 {
@@ -37,6 +39,7 @@ int main(int argc, char *argv[])
    {
        gbOldLidar = true;
    }
+   gbUseRTKGauss = xp.GetParam("UseRTKGauss",false);
     MainWindow w;
     w.show();
 

+ 40 - 1
src/tool/adcndtmultimapping/mainwindow.cpp

@@ -19,6 +19,11 @@ extern iv::ndtorigin gndtorigin;
 
 extern bool gbManualSave;
 
+extern iv::ndttracepoint grtktracepoint;
+extern std::mutex gmutexrtk;
+extern iv::ndttracepoint grtklasttracepoint;
+extern bool gbHaveRTK;
+
 #include <Eigen/Geometry>
 
 #include <tf/tf.h>
@@ -278,6 +283,17 @@ void MainWindow::on_pushButton_Load_clicked()
     QString str = QFileDialog::getOpenFileName(this,tr("Open file"),"",tr("Record File(*.ivd)"));
     if(str.isEmpty())return;
 
+
+
+    grtktracepoint.x = 0;
+    grtktracepoint.y = 0;
+    grtktracepoint.z = 0;
+    grtktracepoint.yaw = 0;
+    grtktracepoint.pitch = 0;
+    grtktracepoint.roll = 0;
+    grtklasttracepoint = grtktracepoint;
+    gbHaveRTK = false;
+
     mvectorcalib.clear();
     mvectorgps.clear();
     mvectorrawgps.clear();
@@ -393,9 +409,19 @@ void MainWindow::onTimer()
         iv::ndttracepoint xtrrtk;
         while(mvectorrawgps.size()>0)
         {
+            int64_t timediff = mvectorrawgps[0].recvtime - xlidartime;
  //           std::cout<<" time diff: "<<(mvectorrawgps[0].recvtime - xlidartime)<<std::endl;
  //           std::cout<<" ldiar time: "<<xlidartime<<std::endl;
-            if((mvectorrawgps[0].recvtime<xlidartime) &&(mvectorrawgps[0].recvtime>=(xlidartime-30)))
+            if((mvectorrawgps[0].recvtime<xlidartime) &&(mvectorrawgps[0].recvtime>=(xlidartime-15)))
+            {
+                iv::ndttracepoint xtr;
+                xtr = mvectorrawgps[0].xtrace;
+                mvectorgps.push_back(xtr);
+                bHaveRTKPoint = true;
+                xtrrtk = xtr;
+                break;
+            }
+            if((timediff>=0) &&(timediff < 15))
             {
                 iv::ndttracepoint xtr;
                 xtr = mvectorrawgps[0].xtrace;
@@ -405,6 +431,7 @@ void MainWindow::onTimer()
                 break;
             }
             mvectorrawgps.erase(mvectorrawgps.begin());
+
         }
 
         if(mbFileDiffOpen)
@@ -501,6 +528,7 @@ void MainWindow::onTimer()
                                     {
                                         if(xgpsimu.rtk_state() == 6)
                                         {
+                                            gbHaveRTK = true;
                                             double fheading = xgpsimu.heading();
                                             fheading = fheading - 0;
                                             if(fheading < 0)fheading = fheading + 360;
@@ -523,6 +551,7 @@ void MainWindow::onTimer()
                                             trarm.yaw = 0;
                                             trarm.pitch = 0;
                                             trarm.roll = 0;
+                                            std::cout<<" arm x: "<<arm_x<<" arm y: "<<arm_y<<std::endl;
                                             gndtorigin = PoseToGPS(gndtorigin,trarm);
 
                                             mpLE_OriginLat->setText(QString::number(gndtorigin.lat,'f',7));
@@ -539,6 +568,16 @@ void MainWindow::onTimer()
                                     if(mbIVDSetOrigin)
                                     {
                                         iv::ndttracepoint  xtr = CalcPose(gndtorigin,xgpsimu);
+
+
+                                        gmutexrtk.lock();
+                                        grtktracepoint.x = xtr.x;
+                                        grtktracepoint.y = xtr.y;
+                                        grtktracepoint.z = xtr.z;
+                                        grtktracepoint.yaw = xtr.yaw;
+                                        gmutexrtk.unlock();
+
+
                                         double x,y;
                                         x = arm_x * cos(xtr.yaw) - arm_y * sin(xtr.yaw);
                                         y = arm_x * sin(xtr.yaw) + arm_y * cos(xtr.yaw);

+ 1 - 1
src/tool/adcndtmultimapping/mainwindow.h

@@ -234,7 +234,7 @@ private:
 
     bool mbFileDiffOpen = false;
 
-    double arm_x = 0.9;
+    double arm_x = 0.0;
     double arm_y = 0.0;
 
 

+ 29 - 0
src/tool/adcndtmultimapping/ndt_mapping.cpp

@@ -214,6 +214,12 @@ bool gbManualSave = false;
 
 extern bool gbOldLidar;
 
+iv::ndttracepoint grtktracepoint;
+std::mutex gmutexrtk;
+iv::ndttracepoint grtklasttracepoint;
+bool gbHaveRTK;
+extern  bool gbUseRTKGauss;
+
 void setmethod(int nmethod)
 {
 
@@ -841,6 +847,29 @@ void point_ndtmapping(pcl::PointCloud<pcl::PointXYZI>::Ptr raw_scan)
   Eigen::Matrix4f init_guess =
       (init_translation * init_rotation_z * init_rotation_y * init_rotation_x).matrix() * tf_btol;
 
+
+  iv::ndttracepoint xrtktrace;
+
+  gmutexrtk.lock();
+  xrtktrace = grtktracepoint;
+  gmutexrtk.unlock();
+
+  //根据预测的信息生成初始化的变换矩阵,即从初始状态变换到guess_pose_for_ndt状态的矩阵
+    Eigen::AngleAxisf rtk_rotation_x(xrtktrace.roll, Eigen::Vector3f::UnitX());
+    Eigen::AngleAxisf rtk_rotation_y(xrtktrace.pitch, Eigen::Vector3f::UnitY());
+    Eigen::AngleAxisf rtk_rotation_z(xrtktrace.yaw, Eigen::Vector3f::UnitZ());
+
+    Eigen::Translation3f rtk_translation(xrtktrace.x, xrtktrace.y, xrtktrace.z);
+
+    Eigen::Matrix4f rtk_guess =
+        (rtk_translation * rtk_rotation_z * rtk_rotation_y * rtk_rotation_x).matrix() * tf_btol;
+
+
+  if(gbUseRTKGauss && gbHaveRTK)
+  {
+    init_guess = rtk_guess;
+  }
+
 //  t3_end = ros::Time::now();
 //  d3 = t3_end - t3_start;
 

+ 2 - 0
src/tool/adcndtmultimapping/ndt_mapping.h

@@ -7,6 +7,8 @@
 
 #include "ivlog.h"
 
+#include <mutex>
+
 namespace iv {
 struct ndttracepoint
 {

BIN
src/tool/fwupdate_admin/display.png


+ 69 - 0
src/tool/fwupdate_admin/fwupdate_admin.pro

@@ -0,0 +1,69 @@
+#-------------------------------------------------
+#
+# Project created by QtCreator 2023-08-29T09:20:14
+#
+#-------------------------------------------------
+
+QT       += core gui
+
+greaterThan(QT_MAJOR_VERSION, 4): QT += widgets
+
+TARGET = fwupdate_admin
+TEMPLATE = app
+
+# The following define makes your compiler emit warnings if you use
+# any feature of Qt which has been marked as deprecated (the exact warnings
+# depend on your compiler). Please consult the documentation of the
+# deprecated API in order to know how to port your code away from it.
+DEFINES += QT_DEPRECATED_WARNINGS
+
+# You can also make your code fail to compile if you use deprecated APIs.
+# In order to do so, uncomment the following line.
+# You can also select to disable deprecated APIs only up to a certain version of Qt.
+#DEFINES += QT_DISABLE_DEPRECATED_BEFORE=0x060000    # disables all the APIs deprecated before Qt 6.0.0
+
+
+SOURCES += \
+        main.cpp \
+        mainwindow.cpp \
+    mainwindowlogin.cpp \
+    ../../include/msgtype/commonrpc.pb.cc \
+    ../../include/msgtype/fwlogin.pb.cc \
+    ../server_fwupdate/commonrpc.grpc.pb.cc \
+    grpcfwclient.cpp \
+    mainwindowadminuser.cpp \
+    ../../include/msgtype/fwadmin.pb.cc
+
+HEADERS += \
+        mainwindow.h \
+    mainwindowlogin.h \
+    ../../include/msgtype/commonrpc.pb.h \
+    ../../include/msgtype/fwlogin.pb.h \
+    ../server_fwupdate/commonrpc.grpc.pb.h \
+    grpcfwclient.h \
+    mainwindowadminuser.h \
+    ../../include/msgtype/fwadmin.pb.h
+
+FORMS += \
+        mainwindow.ui \
+    mainwindowlogin.ui \
+    mainwindowadminuser.ui
+
+RESOURCES += \
+    res.qrc
+
+
+INCLUDEPATH += $$PWD/../server_fwupdate
+
+
+!include(../../../include/common.pri ) {
+    error( "Couldn't find the common.pri file!" )
+}
+
+!include(../../../include/ivprotobuf.pri ) {
+    error( "Couldn't find the ivprotobuf.pri file!" )
+}
+
+!include(../../../include/ivgrpc.pri ) {
+    error( "Couldn't find the ivgrpc.pri file!" )
+}

+ 175 - 0
src/tool/fwupdate_admin/grpcfwclient.cpp

@@ -0,0 +1,175 @@
+#include "grpcfwclient.h"
+
+
+grpcfwclient::grpcfwclient(std::string strserverip ,std::string strserverport )
+{
+    mstrserverip = strserverip;
+    mstrserverport = strserverport;
+    mbRun = true;
+    mpthread = new std::thread(&grpcfwclient::threadrpc,this);
+}
+
+grpcfwclient::~grpcfwclient()
+{
+    mbRun = false;
+    if(mpthread != NULL)
+    {
+        mbRun = false;
+        mpthread->join();
+    }
+}
+
+void grpcfwclient::threadrpc()
+{
+    std::string target_str = mstrserverip+":";
+    target_str = target_str + mstrserverport ;//std::to_string()
+    auto cargs = grpc::ChannelArguments();
+    cargs.SetMaxReceiveMessageSize(1024 * 1024 * 1024); // 1 GB
+    cargs.SetMaxSendMessageSize(1024 * 1024 * 1024);
+
+    std::shared_ptr<Channel> channel = grpc::CreateCustomChannel(
+             target_str, grpc::InsecureChannelCredentials(),cargs);
+
+    std::unique_ptr<iv::CommonRPC::Stub> stub_ = iv::CommonRPC::NewStub(channel);
+
+    gpr_timespec timespec;
+      timespec.tv_sec = 30;//设置阻塞时间为5秒
+      timespec.tv_nsec = 0;
+      timespec.clock_type = GPR_TIMESPAN;
+
+    int nwaitms = 10;
+    while(mbRun)
+    {
+        std::unique_lock<std::mutex> lk(mmutexcv);
+        if(mcv.wait_for(lk, std::chrono::milliseconds(nwaitms)) == std::cv_status::timeout)
+        {
+            lk.unlock();
+        }
+        else
+        {
+            lk.unlock();
+        }
+
+        iv::queryrpcReq xreq;
+        iv::queryrpcReply xreply;
+        if(mbReqUpdate)
+        {
+            mmutexReq.lock();
+            xreq.CopyFrom(mReq);
+            mbReqUpdate = false;
+            mmutexReq.unlock();
+
+
+        }
+        else
+        {
+            continue;
+        }
+
+
+        ClientContext context ;
+        context.set_deadline(timespec);
+        std::cout<<" before. reply size: "<<xreply.ByteSize()<<std::endl;
+
+        Status status = stub_->rpcquery(&context, xreq, &xreply);
+        if (status.ok()) {
+            std::cout<<std::chrono::system_clock::now().time_since_epoch().count()/1000<<" reply size: "<<xreply.ByteSize()<<std::endl;
+            mmutexReply.lock();
+            mReply.CopyFrom(xreply);
+            mbReplyUpdate = true;
+            mmutexReply.unlock();
+        } else {
+          std::cout << status.error_code() << ": " << status.error_message()
+                    << std::endl;
+          std::cout<<"RPC failed"<<std::endl;
+          mnConnectFail = status.error_code();
+          if(status.error_code() == 4)
+          {
+              std::cout<<" RPC Exceed Time, Create New stub_"<<std::endl;
+              channel = grpc::CreateCustomChannel(
+                       target_str, grpc::InsecureChannelCredentials(),cargs);
+
+              stub_ = iv::CommonRPC::NewStub(channel);
+          }
+
+          if(status.error_code() == 14)
+          {
+              std::cout<<" Code 14, Create New stub_"<<std::endl;
+              channel = grpc::CreateCustomChannel(
+                       target_str, grpc::InsecureChannelCredentials(),cargs);
+
+              stub_ = iv::CommonRPC::NewStub(channel);
+          }
+
+          std::this_thread::sleep_for(std::chrono::milliseconds(900));
+
+        }
+        mmutexReq.lock();
+        mbProc = false;
+        mmutexReq.unlock();
+
+        mcvreply.notify_all();
+
+    }
+
+}
+
+int grpcfwclient::SetReq(iv::queryrpcReq & xreq)
+{
+    mmutexReq.lock();
+    if(mbProc)
+    {
+        mmutexReq.unlock();
+        std::cout<<" Have a reqest execting..."<<std::endl;
+        return 0;
+    }
+
+    mReq.CopyFrom(xreq);
+    mbReplyUpdate = false;
+    mbReqUpdate = true;
+    mnConnectFail = 0;
+    mbProc = true;
+    mmutexReq.unlock();
+    mcv.notify_all();
+
+    return 1;
+}
+
+int grpcfwclient::GetReply(iv::queryrpcReply & xReply,int nwaitms)
+{
+
+    std::unique_lock<std::mutex> lk(mmutexcvreply);
+    if(mcvreply.wait_for(lk, std::chrono::milliseconds(nwaitms)) == std::cv_status::timeout)
+    {
+        lk.unlock();
+    }
+    else
+    {
+        lk.unlock();
+    }
+
+    if(mbProc)return 0;
+    else
+    {
+        if(mbReplyUpdate)
+        {
+            mmutexReply.lock();
+            xReply.CopyFrom(mReply);
+            mbReplyUpdate = false;
+            mmutexReply.unlock();
+            return 1;
+        }
+        else
+        {
+            if(mnConnectFail>0)
+            {
+                return mnConnectFail * (-1);
+            }
+            else
+            {
+                return -1000;
+            }
+        }
+    }
+    return 0;
+}

+ 69 - 0
src/tool/fwupdate_admin/grpcfwclient.h

@@ -0,0 +1,69 @@
+#ifndef GRPCFWCLIENT_H
+#define GRPCFWCLIENT_H
+
+#include <mutex>
+#include <thread>
+#include <condition_variable>
+#include <iostream>
+
+#include <grpcpp/grpcpp.h>
+#include "commonrpc.grpc.pb.h"
+
+#include "commonrpc.pb.h"
+
+using grpc::Channel;
+using grpc::ClientContext;
+using grpc::Status;
+
+class grpcfwclient
+{
+public:
+    grpcfwclient(std::string strserverip = "127.0.0.1",std::string strserverport = "19111");
+    ~grpcfwclient();
+
+private:
+    void threadrpc();
+
+private:
+    std::thread * mpthread = NULL;
+    bool mbRun = true;
+
+    std::string mstrserverip = "127.0.0.1";
+    std::string mstrserverport = "19111";
+
+    std::condition_variable mcv;
+    std::mutex mmutexcv;
+
+    std::condition_variable mcvreply;
+    std::mutex mmutexcvreply;
+
+    std::mutex mmutexReq;
+    std::mutex mmutexReply;
+
+    iv::queryrpcReq mReq;
+    bool mbReqUpdate = false;
+
+    int mnConnectFail = 0; //4 14 fail;
+
+    iv::queryrpcReply mReply;
+    bool mbReplyUpdate = false;
+
+    bool mbProc = false;
+
+public:
+    /**
+     * @brief SetReq
+     * @param xreq
+     * @return 0 because sending, set request fail.   1 set request to sending.
+     */
+    int SetReq(iv::queryrpcReq & xreq);
+    /**
+     * @brief GetReply  Call this Function, need SetReq return 1. if SetReq return 0, not call this fuction
+     * @param xReply
+     * @return 0 sending, wait reply   <0 error, send faile.  1 get reply
+     */
+    int GetReply(iv::queryrpcReply & xReply,int nwaitms = 10);
+
+};
+
+#endif // GRPCFWCLIENT_H

+ 34 - 0
src/tool/fwupdate_admin/main.cpp

@@ -0,0 +1,34 @@
+#include "mainwindow.h"
+#include <QApplication>
+
+#include "grpcfwclient.h"
+
+#include "mainwindowlogin.h"
+#include "mainwindowadminuser.h"
+
+MainWindow * gwmain;
+MainWindowLogin * gwlogin;
+MainWindowAdminUser * gwadminuser;
+
+grpcfwclient * gpgrpcfwclient;
+
+int main(int argc, char *argv[])
+{
+    QApplication a(argc, argv);
+
+    grpcfwclient fwclient;
+    gpgrpcfwclient = &fwclient;
+
+    MainWindowAdminUser wadminuser;
+
+    MainWindowLogin wlogin;
+    wlogin.show();
+
+    MainWindow w;
+//    w.show();
+    gwadminuser = &wadminuser;
+    gwlogin = &wlogin;
+    gwmain = &w;
+
+    return a.exec();
+}

+ 14 - 0
src/tool/fwupdate_admin/mainwindow.cpp

@@ -0,0 +1,14 @@
+#include "mainwindow.h"
+#include "ui_mainwindow.h"
+
+MainWindow::MainWindow(QWidget *parent) :
+    QMainWindow(parent),
+    ui(new Ui::MainWindow)
+{
+    ui->setupUi(this);
+}
+
+MainWindow::~MainWindow()
+{
+    delete ui;
+}

+ 22 - 0
src/tool/fwupdate_admin/mainwindow.h

@@ -0,0 +1,22 @@
+#ifndef MAINWINDOW_H
+#define MAINWINDOW_H
+
+#include <QMainWindow>
+
+namespace Ui {
+class MainWindow;
+}
+
+class MainWindow : public QMainWindow
+{
+    Q_OBJECT
+
+public:
+    explicit MainWindow(QWidget *parent = 0);
+    ~MainWindow();
+
+private:
+    Ui::MainWindow *ui;
+};
+
+#endif // MAINWINDOW_H

+ 24 - 0
src/tool/fwupdate_admin/mainwindow.ui

@@ -0,0 +1,24 @@
+<ui version="4.0">
+ <class>MainWindow</class>
+ <widget class="QMainWindow" name="MainWindow" >
+  <property name="geometry" >
+   <rect>
+    <x>0</x>
+    <y>0</y>
+    <width>400</width>
+    <height>300</height>
+   </rect>
+  </property>
+  <property name="windowTitle" >
+   <string>MainWindow</string>
+  </property>
+  <widget class="QMenuBar" name="menuBar" />
+  <widget class="QToolBar" name="mainToolBar" />
+  <widget class="QWidget" name="centralWidget" />
+  <widget class="QStatusBar" name="statusBar" />
+ </widget>
+ <layoutDefault spacing="6" margin="11" />
+ <pixmapfunction></pixmapfunction>
+ <resources/>
+ <connections/>
+</ui>

+ 209 - 0
src/tool/fwupdate_admin/mainwindowadminuser.cpp

@@ -0,0 +1,209 @@
+#include "mainwindowadminuser.h"
+#include "ui_mainwindowadminuser.h"
+
+#include <QMessageBox>
+
+
+#include "grpcfwclient.h"
+
+#include "mainwindow.h"
+#include "mainwindowlogin.h"
+#include "mainwindowadminuser.h"
+
+extern MainWindow * gwmain;
+extern MainWindowLogin * gwlogin;
+extern MainWindowAdminUser * gwadminuser;
+extern grpcfwclient * gpgrpcfwclient;
+
+MainWindowAdminUser::MainWindowAdminUser(QWidget *parent) :
+    QMainWindow(parent),
+    ui(new Ui::MainWindowAdminUser)
+{
+    ui->setupUi(this);
+
+    connect(this,SIGNAL(adminstate(int,const char*)),this,SLOT(onadminstate(int,const char *)));
+
+    setWindowTitle("Admin User");
+}
+
+MainWindowAdminUser::~MainWindowAdminUser()
+{
+    delete ui;
+}
+
+void MainWindowAdminUser::on_pushButton_clicked()
+{
+    std::string struser = ui->lineEdit_UserName->text().toStdString();
+    if(struser.length()<1)
+    {
+        QMessageBox::warning(this,tr("Warning"),tr("User Name is Empty."),QMessageBox::YesAll);
+        return;
+    }
+
+    iv::fw::adminreq xadminreq;
+    xadminreq.set_admintype(iv::fw::ADMINREQ_TYPE::ADDUSER);
+    xadminreq.set_username(struser);
+    xadminreq.set_password(struser);
+
+    iv::queryrpcReq xreq;
+    xreq.set_ntype(iv::CommonRPCType::USERADMIN);
+    int ndatasize = xadminreq.ByteSize();
+    xreq.set_ndatasize(ndatasize);
+    std::shared_ptr<char> pstr_ptr = std::shared_ptr<char>(new char[ndatasize]);
+    if(xadminreq.SerializeToArray(pstr_ptr.get(),ndatasize))
+    {
+        xreq.set_data(pstr_ptr.get(),ndatasize);
+
+        mAdminType = xadminreq.admintype();
+        mstrusername = xadminreq.username();
+        mpthread = new std::thread(&MainWindowAdminUser::threadadmin,this,xreq);
+        DisableAllButton();
+    }
+    else
+    {
+        QMessageBox::warning(this,tr("Warning"),tr("admin serialize fail."),QMessageBox::YesAll);
+        return;
+    }
+
+
+}
+
+void MainWindowAdminUser::threadadmin(iv::queryrpcReq  xreq)
+{
+    int i;
+
+    for(i=0;i<3;i++)
+    {
+        int nreq = gpgrpcfwclient->SetReq(xreq);
+        if(nreq == 0)
+        {
+            std::cout<<"MainWindowAdminUser::threadlogin setreq fail."<<std::endl;
+            std::this_thread::sleep_for(std::chrono::milliseconds(10));
+            continue;
+        }
+        iv::queryrpcReply xReply;
+        int nreply = gpgrpcfwclient->GetReply(xReply);
+        while(nreply == 0)
+        {
+            nreply = gpgrpcfwclient->GetReply(xReply);
+        }
+        if(nreply<0)
+        {
+            emit adminstate(0,"can't connect to server");
+        }
+        else
+        {
+            if(xReply.ntype() == iv::CommonRPCType::USERADMIN)
+            {
+                iv::fw::adminreply xAdminReply;
+                if(xAdminReply.ParseFromArray(xReply.data().data(),xReply.ndatasize()))
+                {
+                    if(xAdminReply.nresult() == 0)
+                    {
+                        std::cout<<"error code: "<<xAdminReply.errstr()<<std::endl;
+                        strncpy(mstrlasterr,xAdminReply.errstr().data(),256);
+                        emit adminstate(0,mstrlasterr);
+                    }
+                    else
+                    {
+                        if(xAdminReply.admintype() == iv::fw::ADMINREQ_TYPE::QUERYUSER)
+                        {
+                            mstrvalidtime = xAdminReply.strvalidtime();
+                        }
+                        emit adminstate(1,"Success.");
+                    }
+                }
+                else
+                {
+                    emit adminstate(0,"Parse Reply Fail.");
+                }
+            }
+            else
+            {
+                emit adminstate(0,"admin fail.");
+            }
+        }
+        break;
+    }
+
+}
+
+void MainWindowAdminUser::DisableAllButton()
+{
+    ui->pushButton->setEnabled(false);
+    ui->pushButton_Disable->setEnabled(false);
+    ui->pushButton_Enable->setEnabled(false);
+    ui->pushButton_Query->setEnabled(false);
+    ui->pushButton_ResetPass->setEnabled(false);
+}
+
+void MainWindowAdminUser::EnableAllButton()
+{
+    ui->pushButton->setEnabled(true);
+    ui->pushButton_Disable->setEnabled(true);
+    ui->pushButton_Enable->setEnabled(true);
+    ui->pushButton_Query->setEnabled(true);
+    ui->pushButton_ResetPass->setEnabled(true);
+}
+
+
+void MainWindowAdminUser::on_pushButton_Query_clicked()
+{
+    std::string struser = ui->lineEdit_queryname->text().toStdString();
+    if(ui->lineEdit_queryname->text().length() == 0)
+    {
+        QMessageBox::warning(this,tr("Warning"),tr("Query User Name is NULL."),QMessageBox::YesAll);
+        return;
+    }
+
+    iv::fw::adminreq xadminreq;
+    xadminreq.set_admintype(iv::fw::ADMINREQ_TYPE::QUERYUSER);
+    xadminreq.set_username(struser);
+
+    iv::queryrpcReq xreq;
+    xreq.set_ntype(iv::CommonRPCType::USERADMIN);
+    int ndatasize = xadminreq.ByteSize();
+    xreq.set_ndatasize(ndatasize);
+    std::shared_ptr<char> pstr_ptr = std::shared_ptr<char>(new char[ndatasize]);
+    if(xadminreq.SerializeToArray(pstr_ptr.get(),ndatasize))
+    {
+        xreq.set_data(pstr_ptr.get(),ndatasize);
+
+        mAdminType = xadminreq.admintype();
+        mstrusername = xadminreq.username();
+        mpthread = new std::thread(&MainWindowAdminUser::threadadmin,this,xreq);
+        DisableAllButton();
+    }
+    else
+    {
+        QMessageBox::warning(this,tr("Warning"),tr("admin serialize fail."),QMessageBox::YesAll);
+        return;
+    }
+
+}
+
+void MainWindowAdminUser::onadminstate(int nstate, const char *strerr)
+{
+    if(nstate == 1)
+    {
+        if(mAdminType == iv::fw::ADMINREQ_TYPE::QUERYUSER)
+        {
+            ui->lineEdit_UserName->setText(QString::fromStdString(mstrusername));
+            ui->dateTimeEdit_valid->setDateTime(QDateTime::fromString(QString::fromStdString(mstrvalidtime),"yyyy-MM-dd hh:mm:ss"));
+            QMessageBox::information(this,tr("Successs"),tr("Query User Success."),QMessageBox::YesAll);
+        }
+        if(mAdminType == iv::fw::ADMINREQ_TYPE::ADDUSER)
+        {
+            QMessageBox::information(this,tr("Successs"),tr("Add User Success."),QMessageBox::YesAll);
+        }
+    }
+    else
+    {
+        if(nstate == 0)
+        {
+            QMessageBox::warning(this,"Warning",strerr,QMessageBox::YesAll);
+        }
+    }
+
+    EnableAllButton();
+}

+ 52 - 0
src/tool/fwupdate_admin/mainwindowadminuser.h

@@ -0,0 +1,52 @@
+#ifndef MAINWINDOWADMINUSER_H
+#define MAINWINDOWADMINUSER_H
+
+#include <QMainWindow>
+
+#include <thread>
+
+#include "fwadmin.pb.h"
+#include "commonrpc.pb.h"
+
+namespace Ui {
+class MainWindowAdminUser;
+}
+
+class MainWindowAdminUser : public QMainWindow
+{
+    Q_OBJECT
+
+public:
+    explicit MainWindowAdminUser(QWidget *parent = 0);
+    ~MainWindowAdminUser();
+
+private slots:
+    void on_pushButton_clicked();
+
+    void on_pushButton_Query_clicked();
+
+    void onadminstate(int nstate, const char * strerr);
+
+signals:
+    void adminstate(int nstate,const char * strerr);
+
+private:
+    void threadadmin(iv::queryrpcReq xreq);
+
+    void DisableAllButton();
+    void EnableAllButton();
+
+private:
+    Ui::MainWindowAdminUser *ui;
+
+    std::thread * mpthread;
+
+    char mstrlasterr[256];
+
+    std::string mstrvalidtime;
+
+    iv::fw::ADMINREQ_TYPE mAdminType;
+    std::string mstrusername;
+};
+
+#endif // MAINWINDOWADMINUSER_H

+ 166 - 0
src/tool/fwupdate_admin/mainwindowadminuser.ui

@@ -0,0 +1,166 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<ui version="4.0">
+ <class>MainWindowAdminUser</class>
+ <widget class="QMainWindow" name="MainWindowAdminUser">
+  <property name="geometry">
+   <rect>
+    <x>0</x>
+    <y>0</y>
+    <width>559</width>
+    <height>420</height>
+   </rect>
+  </property>
+  <property name="windowTitle">
+   <string>MainWindow</string>
+  </property>
+  <widget class="QWidget" name="centralwidget">
+   <widget class="QPushButton" name="pushButton">
+    <property name="geometry">
+     <rect>
+      <x>50</x>
+      <y>300</y>
+      <width>101</width>
+      <height>41</height>
+     </rect>
+    </property>
+    <property name="text">
+     <string>Add User</string>
+    </property>
+   </widget>
+   <widget class="QPushButton" name="pushButton_Query">
+    <property name="geometry">
+     <rect>
+      <x>232</x>
+      <y>30</y>
+      <width>121</width>
+      <height>41</height>
+     </rect>
+    </property>
+    <property name="text">
+     <string>Query User</string>
+    </property>
+   </widget>
+   <widget class="QPushButton" name="pushButton_Disable">
+    <property name="geometry">
+     <rect>
+      <x>418</x>
+      <y>300</y>
+      <width>101</width>
+      <height>41</height>
+     </rect>
+    </property>
+    <property name="text">
+     <string>Disable User</string>
+    </property>
+   </widget>
+   <widget class="QPushButton" name="pushButton_ResetPass">
+    <property name="geometry">
+     <rect>
+      <x>224</x>
+      <y>300</y>
+      <width>131</width>
+      <height>41</height>
+     </rect>
+    </property>
+    <property name="text">
+     <string>Reset PassWord</string>
+    </property>
+   </widget>
+   <widget class="QPushButton" name="pushButton_Enable">
+    <property name="geometry">
+     <rect>
+      <x>420</x>
+      <y>30</y>
+      <width>101</width>
+      <height>41</height>
+     </rect>
+    </property>
+    <property name="text">
+     <string>Enable User</string>
+    </property>
+   </widget>
+   <widget class="QLabel" name="label">
+    <property name="geometry">
+     <rect>
+      <x>46</x>
+      <y>113</y>
+      <width>141</width>
+      <height>41</height>
+     </rect>
+    </property>
+    <property name="text">
+     <string>User Name:</string>
+    </property>
+   </widget>
+   <widget class="QLineEdit" name="lineEdit_UserName">
+    <property name="geometry">
+     <rect>
+      <x>240</x>
+      <y>110</y>
+      <width>281</width>
+      <height>41</height>
+     </rect>
+    </property>
+   </widget>
+   <widget class="QLabel" name="label_2">
+    <property name="geometry">
+     <rect>
+      <x>48</x>
+      <y>204</y>
+      <width>141</width>
+      <height>41</height>
+     </rect>
+    </property>
+    <property name="text">
+     <string>Valid Date:</string>
+    </property>
+   </widget>
+   <widget class="QDateTimeEdit" name="dateTimeEdit_valid">
+    <property name="geometry">
+     <rect>
+      <x>240</x>
+      <y>200</y>
+      <width>281</width>
+      <height>51</height>
+     </rect>
+    </property>
+    <property name="dateTime">
+     <datetime>
+      <hour>0</hour>
+      <minute>0</minute>
+      <second>0</second>
+      <year>2023</year>
+      <month>1</month>
+      <day>1</day>
+     </datetime>
+    </property>
+    <property name="displayFormat">
+     <string>yyyy/M/d hh:mm</string>
+    </property>
+   </widget>
+   <widget class="QLineEdit" name="lineEdit_queryname">
+    <property name="geometry">
+     <rect>
+      <x>40</x>
+      <y>30</y>
+      <width>131</width>
+      <height>41</height>
+     </rect>
+    </property>
+   </widget>
+  </widget>
+  <widget class="QMenuBar" name="menubar">
+   <property name="geometry">
+    <rect>
+     <x>0</x>
+     <y>0</y>
+     <width>559</width>
+     <height>28</height>
+    </rect>
+   </property>
+  </widget>
+  <widget class="QStatusBar" name="statusbar"/>
+ </widget>
+ <resources/>
+ <connections/>
+</ui>

+ 185 - 0
src/tool/fwupdate_admin/mainwindowlogin.cpp

@@ -0,0 +1,185 @@
+#include "mainwindowlogin.h"
+#include "ui_mainwindowlogin.h"
+
+#include <QMessageBox>
+
+
+
+#include "grpcfwclient.h"
+
+#include "mainwindow.h"
+#include "mainwindowlogin.h"
+#include "mainwindowadminuser.h"
+
+extern MainWindow * gwmain;
+extern MainWindowLogin * gwlogin;
+extern MainWindowAdminUser * gwadminuser;
+extern grpcfwclient * gpgrpcfwclient;
+
+
+MainWindowLogin::MainWindowLogin(QWidget *parent) :
+    QMainWindow(parent),
+    ui(new Ui::MainWindowLogin)
+{
+    ui->setupUi(this);
+
+    ui->lineEdit_password->setEchoMode(QLineEdit::Password);
+
+    ui->pushButton_Login->setDefault(true);  //When Click Enter, click
+
+    mpcheckdisplay = new QCheckBox(ui->lineEdit_password);
+    connect(mpcheckdisplay,SIGNAL(stateChanged(int)),this, SLOT(slot_checkbox_state_changed(int)));
+
+    // 设置样式表(图片为眼睛样式)
+    mpcheckdisplay->setStyleSheet("QCheckBox {spacing: 5px;border: none;background-color: transparent;}"
+    "QCheckBox::indicator {width: 20px;height: 20px;border: none;image: url(:/no_display.png);}"
+    "QCheckBox::indicator:checked {image: url(:/display.png);}");
+
+    mpcheckdisplay->setGeometry(ui->lineEdit_password->size().width() - 30, (ui->lineEdit_password->size().height() -20)/2,20,20);
+
+    connect(this,SIGNAL(loginstate(int,const char *)),this,SLOT(onloginstate(int,const char *)));
+
+    setWindowTitle("Login");
+}
+
+MainWindowLogin::~MainWindowLogin()
+{
+    delete ui;
+}
+
+void MainWindowLogin::on_pushButton_Login_clicked()
+{
+
+    if(ui->lineEdit_username->text().length()<1)
+    {
+        QMessageBox::warning(this,tr("Warning"),tr("username empty."),QMessageBox::YesAll);
+        return;
+    }
+
+    if(ui->lineEdit_password->text().length()<1)
+    {
+        QMessageBox::warning(this,tr("Waring"),tr("password empty."),QMessageBox::YesAll);
+        return;
+    }
+
+    iv::fw::loginreq xlogin;
+    xlogin.set_username(ui->lineEdit_username->text().toStdString());
+    xlogin.set_password(ui->lineEdit_password->text().toStdString());
+    mstrloginuser = xlogin.username();
+
+    iv::queryrpcReq xreq;
+    xreq.set_ntype(iv::CommonRPCType::LOGIN);
+    int ndatasize = xlogin.ByteSize();
+    xreq.set_ndatasize(ndatasize);
+    std::shared_ptr<char> pstr_ptr = std::shared_ptr<char>(new char[ndatasize]);
+    if(xlogin.SerializeToArray(pstr_ptr.get(),ndatasize))
+    {
+        xreq.set_data(pstr_ptr.get(),ndatasize);
+        ui->pushButton_Login->setText("Loging....");
+        ui->pushButton_Login->setEnabled(false);
+
+        mpthread = new std::thread(&MainWindowLogin::threadlogin,this,xreq);
+    }
+    else
+    {
+        QMessageBox::warning(this,tr("Warning"),tr("logingreq serialize fail."),QMessageBox::YesAll);
+        return;
+    }
+
+
+
+
+//    this->hide();
+//    gwmain->show();
+}
+
+void MainWindowLogin::slot_checkbox_state_changed(int state)
+{
+    if(state){
+       ui->lineEdit_password->setEchoMode(QLineEdit::Normal);
+    }else{
+       ui->lineEdit_password->setEchoMode(QLineEdit::Password);
+    }
+
+}
+
+void MainWindowLogin::onloginstate(int nstate,  const char * strerr)
+{
+    if(nstate == 1)
+    {
+        if(mstrloginuser == "admin")
+        {
+            this->hide();
+            gwadminuser->show();
+        }
+        else
+        {
+            this->hide();
+            gwmain->show();
+        }
+    }
+    else
+    {
+        if(nstate == 0)
+        {
+            QMessageBox::warning(this,"Warning",strerr,QMessageBox::YesAll);
+            ui->pushButton_Login->setText("Login");
+            ui->pushButton_Login->setEnabled(true);
+        }
+    }
+}
+
+void MainWindowLogin::threadlogin(iv::queryrpcReq  xreq)
+{
+    int i;
+    for(i=0;i<3;i++)
+    {
+        int nreq = gpgrpcfwclient->SetReq(xreq);
+        if(nreq == 0)
+        {
+            std::cout<<"MainWindowLogin::threadlogin setreq fail."<<std::endl;
+            std::this_thread::sleep_for(std::chrono::milliseconds(10));
+            continue;
+        }
+        iv::queryrpcReply xReply;
+        int nreply = gpgrpcfwclient->GetReply(xReply);
+        while(nreply == 0)
+        {
+            nreply = gpgrpcfwclient->GetReply(xReply);
+        }
+        if(nreply<0)
+        {
+            emit loginstate(0,"can't connect to server");
+        }
+        else
+        {
+            if(xReply.ntype() == iv::CommonRPCType::LOGIN)
+            {
+                iv::fw::loginreply xLoginReply;
+                if(xLoginReply.ParseFromArray(xReply.data().data(),xReply.ndatasize()))
+                {
+                    if(xLoginReply.nauth() == 0)
+                    {
+                        std::cout<<"error code: "<<xLoginReply.errstr()<<std::endl;
+                        strncpy(mstrlasterr,xLoginReply.errstr().data(),256);
+                        emit loginstate(0,mstrlasterr);
+                    }
+                    else
+                    {
+                        emit loginstate(1,"Login Success.");
+                    }
+                }
+                else
+                {
+                    emit loginstate(0,"Parse Reply Fail.");
+                }
+            }
+            else
+            {
+                emit loginstate(0,"login fail.");
+            }
+        }
+        break;
+    }
+
+}

+ 49 - 0
src/tool/fwupdate_admin/mainwindowlogin.h

@@ -0,0 +1,49 @@
+#ifndef MAINWINDOWLOGIN_H
+#define MAINWINDOWLOGIN_H
+
+#include <QMainWindow>
+#include <QCheckBox>
+#include <thread>
+
+
+#include "commonrpc.pb.h"
+#include "fwlogin.pb.h"
+
+namespace Ui {
+class MainWindowLogin;
+}
+
+class MainWindowLogin : public QMainWindow
+{
+    Q_OBJECT
+
+public:
+    explicit MainWindowLogin(QWidget *parent = 0);
+    ~MainWindowLogin();
+
+signals:
+    void loginstate(int nstate,const char * strerr);
+
+private slots:
+    void on_pushButton_Login_clicked();
+
+    void slot_checkbox_state_changed(int state);
+
+    void onloginstate(int nstate, const char * strerr);
+
+private:
+    void threadlogin(iv::queryrpcReq xreq);
+
+private:
+    Ui::MainWindowLogin *ui;
+
+    QCheckBox * mpcheckdisplay;
+
+    std::thread * mpthread;
+
+    char mstrlasterr[256];
+
+    std::string mstrloginuser;
+};
+
+#endif // MAINWINDOWLOGIN_H

+ 99 - 0
src/tool/fwupdate_admin/mainwindowlogin.ui

@@ -0,0 +1,99 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<ui version="4.0">
+ <class>MainWindowLogin</class>
+ <widget class="QMainWindow" name="MainWindowLogin">
+  <property name="geometry">
+   <rect>
+    <x>0</x>
+    <y>0</y>
+    <width>375</width>
+    <height>269</height>
+   </rect>
+  </property>
+  <property name="windowTitle">
+   <string>MainWindow</string>
+  </property>
+  <widget class="QWidget" name="centralwidget">
+   <widget class="QPushButton" name="pushButton_Login">
+    <property name="geometry">
+     <rect>
+      <x>110</x>
+      <y>150</y>
+      <width>121</width>
+      <height>41</height>
+     </rect>
+    </property>
+    <property name="text">
+     <string>Login</string>
+    </property>
+   </widget>
+   <widget class="QLabel" name="label">
+    <property name="geometry">
+     <rect>
+      <x>40</x>
+      <y>30</y>
+      <width>91</width>
+      <height>31</height>
+     </rect>
+    </property>
+    <property name="text">
+     <string>User:</string>
+    </property>
+   </widget>
+   <widget class="QLabel" name="label_2">
+    <property name="geometry">
+     <rect>
+      <x>40</x>
+      <y>84</y>
+      <width>81</width>
+      <height>31</height>
+     </rect>
+    </property>
+    <property name="text">
+     <string>PassWord:</string>
+    </property>
+   </widget>
+   <widget class="QLineEdit" name="lineEdit_username">
+    <property name="geometry">
+     <rect>
+      <x>160</x>
+      <y>25</y>
+      <width>191</width>
+      <height>41</height>
+     </rect>
+    </property>
+   </widget>
+   <widget class="QLineEdit" name="lineEdit_password">
+    <property name="geometry">
+     <rect>
+      <x>159</x>
+      <y>78</y>
+      <width>191</width>
+      <height>41</height>
+     </rect>
+    </property>
+    <property name="inputMethodHints">
+     <set>Qt::ImhNone</set>
+    </property>
+   </widget>
+  </widget>
+  <widget class="QMenuBar" name="menubar">
+   <property name="geometry">
+    <rect>
+     <x>0</x>
+     <y>0</y>
+     <width>375</width>
+     <height>28</height>
+    </rect>
+   </property>
+  </widget>
+  <widget class="QStatusBar" name="statusbar"/>
+ </widget>
+ <tabstops>
+  <tabstop>lineEdit_username</tabstop>
+  <tabstop>lineEdit_password</tabstop>
+  <tabstop>pushButton_Login</tabstop>
+ </tabstops>
+ <resources/>
+ <connections/>
+</ui>

BIN
src/tool/fwupdate_admin/no_display.png


+ 6 - 0
src/tool/fwupdate_admin/res.qrc

@@ -0,0 +1,6 @@
+<RCC>
+    <qresource prefix="/">
+        <file>display.png</file>
+        <file>no_display.png</file>
+    </qresource>
+</RCC>

+ 1 - 0
src/tool/map_collectfromveh/dialogconvert.cpp

@@ -6,6 +6,7 @@ DialogConvert::DialogConvert(QWidget *parent) :
     ui(new Ui::DialogConvert)
 {
     ui->setupUi(this);
+    setWindowTitle(tr("Convert"));
 }
 
 DialogConvert::~DialogConvert()

+ 16 - 16
src/tool/map_collectfromveh/editwin.cpp

@@ -36,7 +36,7 @@ EditWin::EditWin(QWidget *parent) :
     ui->actionSelectRoad->setChecked(false);
 
 
-    setWindowTitle("Edit Collect Data");
+    setWindowTitle(tr("Edit Collect Data"));
     std::cout<<"complete init."<<std::endl;
 
 }
@@ -378,7 +378,7 @@ void EditWin::on_actionMove_triggered()
     if(ok == false)return;
     if(text.isEmpty())
     {
-        QMessageBox::warning(this,"Waring",QString(tr("数值为空")),QMessageBox::YesAll);
+        QMessageBox::warning(this,tr("Warning"),QString(tr("数值为空")),QMessageBox::YesAll);
         return;
     }
 
@@ -388,7 +388,7 @@ void EditWin::on_actionMove_triggered()
 
     if(fMove > 10.0)
     {
-        QString str = "移动值超过10米,移动值为: "+ QString::number(fMove) + QString(tr("米,是否进行平移?"));
+        QString str = QString(tr("移动值超过10米,移动值为: "))+ QString::number(fMove) + QString(tr("米,是否进行平移?"));
         QMessageBox::StandardButton button;
         button=QMessageBox::question(this,tr("平移"),str,QMessageBox::Yes|QMessageBox::No);
         if(button==QMessageBox::No)
@@ -471,7 +471,7 @@ void EditWin::on_actionRotate_triggered()
 {
     if(mpselpoint == NULL)
     {
-        QMessageBox::warning(this,"Waring",QString(tr("请先选择一个点")),QMessageBox::YesAll);
+        QMessageBox::warning(this,tr("Warning"),QString(tr("请先选择一个点")),QMessageBox::YesAll);
         return;
     }
 
@@ -510,7 +510,7 @@ void EditWin::on_actionMoveFront_triggered()
 {
     if(mpselpoint == NULL)
     {
-        QMessageBox::warning(this,"Waring",QString(tr("请先选择一个点")),QMessageBox::YesAll);
+        QMessageBox::warning(this,tr("Warning"),QString(tr("请先选择一个点")),QMessageBox::YesAll);
         return;
     }
 
@@ -522,7 +522,7 @@ void EditWin::on_actionMoveFront_triggered()
     if(ok == false)return;
     if(text.isEmpty())
     {
-        QMessageBox::warning(this,"Waring",QString(tr("数值为空")),QMessageBox::YesAll);
+        QMessageBox::warning(this,tr("Warning"),QString(tr("数值为空")),QMessageBox::YesAll);
         return;
     }
 
@@ -532,7 +532,7 @@ void EditWin::on_actionMoveFront_triggered()
 
     if(fMove > 10.0)
     {
-        QString str = "移动值超过10米,移动值为: "+ QString::number(fMove) + QString(tr("米,是否进行前移?"));
+        QString str = QString(tr("移动值超过10米,移动值为: "))+ QString::number(fMove) + QString(tr("米,是否进行前移?"));
         QMessageBox::StandardButton button;
         button=QMessageBox::question(this,tr("前移"),str,QMessageBox::Yes|QMessageBox::No);
         if(button==QMessageBox::No)
@@ -564,7 +564,7 @@ void EditWin::on_actionDelete_triggered()
 {
     if(mpselpoint == NULL)
     {
-        QMessageBox::warning(this,"Waring",QString(tr("请先选择一个点")),QMessageBox::YesAll);
+        QMessageBox::warning(this,tr("Waring"),QString(tr("请先选择一个点")),QMessageBox::YesAll);
         return;
     }
 
@@ -712,7 +712,7 @@ void EditWin::on_actionRoadMoveLeft_triggered()
 {
     if(mpselroad == NULL)
     {
-        QMessageBox::warning(this,"Waring",QString(tr("请先选择一条路")),QMessageBox::YesAll);
+        QMessageBox::warning(this,tr("Warning"),QString(tr("请先选择一条路")),QMessageBox::YesAll);
         return;
     }
 
@@ -724,7 +724,7 @@ void EditWin::on_actionRoadMoveLeft_triggered()
     if(ok == false)return;
     if(text.isEmpty())
     {
-        QMessageBox::warning(this,"Waring",QString(tr("数值为空")),QMessageBox::YesAll);
+        QMessageBox::warning(this,tr("Waring"),QString(tr("数值为空")),QMessageBox::YesAll);
         return;
     }
 
@@ -759,7 +759,7 @@ void EditWin::on_actionRoadMoveFront_triggered()
 {
     if(mpselroad == NULL)
     {
-        QMessageBox::warning(this,"Waring",QString(tr("请先选择一条路")),QMessageBox::YesAll);
+        QMessageBox::warning(this,tr("Warning"),QString(tr("请先选择一条路")),QMessageBox::YesAll);
         return;
     }
 
@@ -771,7 +771,7 @@ void EditWin::on_actionRoadMoveFront_triggered()
     if(ok == false)return;
     if(text.isEmpty())
     {
-        QMessageBox::warning(this,"Waring",QString(tr("数值为空")),QMessageBox::YesAll);
+        QMessageBox::warning(this,tr("Warning"),QString(tr("数值为空")),QMessageBox::YesAll);
         return;
     }
 
@@ -806,7 +806,7 @@ void EditWin::on_actionRoadRotate_triggered()
 {
     if(mpselroad == NULL)
     {
-        QMessageBox::warning(this,"Waring",QString(tr("请先选择一条路")),QMessageBox::YesAll);
+        QMessageBox::warning(this,tr("Warning"),QString(tr("请先选择一条路")),QMessageBox::YesAll);
         return;
     }
 
@@ -818,7 +818,7 @@ void EditWin::on_actionRoadRotate_triggered()
     if(ok == false)return;
     if(text.isEmpty())
     {
-        QMessageBox::warning(this,"Waring",QString(tr("数值为空")),QMessageBox::YesAll);
+        QMessageBox::warning(this,tr("Warning"),QString(tr("数值为空")),QMessageBox::YesAll);
         return;
     }
 
@@ -849,7 +849,7 @@ void EditWin::on_actionRoadDelete_triggered()
 {
     if(mpselroad == NULL)
     {
-        QMessageBox::warning(this,"Waring",QString(tr("请先选择一条路")),QMessageBox::YesAll);
+        QMessageBox::warning(this,tr("Warning"),QString(tr("请先选择一条路")),QMessageBox::YesAll);
         return;
     }
     QMessageBox::StandardButton button;
@@ -974,7 +974,7 @@ void EditWin::CreateConnect(int nMode, std::string strroad1, std::string strroad
     }
     if(bExist)
     {
-        QMessageBox::warning(this,"Waring",QString(tr("道路连接已存在")),QMessageBox::YesAll);
+        QMessageBox::warning(this,tr("Warning"),QString(tr("道路连接已存在")),QMessageBox::YesAll);
         return;
     }
 

+ 9 - 0
src/tool/map_collectfromveh/main.cpp

@@ -9,6 +9,8 @@ iv::Ivlog * givlog;
 #include <getopt.h>
 #include <iostream>
 
+#include <QTranslator>
+
 char gstr_memname[256];
 
 
@@ -85,6 +87,13 @@ int main(int argc, char *argv[])
     givlog = new iv::Ivlog("map_collectfromveh");
     QApplication a(argc, argv);
 
+    QTranslator ts;
+    if(ts.load("./map_collectfromveh_language.qm"))
+    {
+        a.installTranslator(&ts);
+    }
+
+
     snprintf(gstr_memname,255,"hcp2_gpsimu");
 
     int nRtn = GetOptLong(argc,argv);

+ 13 - 13
src/tool/map_collectfromveh/mainwindow.cpp

@@ -117,7 +117,7 @@ MainWindow::MainWindow(QWidget *parent)
     double lon,lat;
     GaussProjInvCal(x,y,&lon,&lat);
 
-    setWindowTitle("Collect Data From Vehicle");
+    setWindowTitle(tr("Collect Data From Vehicle"));
 
     gw = this;
 
@@ -161,7 +161,7 @@ void MainWindow::on_pushButton_NewRoad_clicked()
 {
     if(mpEditWin->IsShow())
     {
-        QMessageBox::warning(this,"Warning",QString(tr("编辑窗口打开状态,请先关闭编辑窗口")),QMessageBox::YesAll);
+        QMessageBox::warning(this,tr("Warning"),QString(tr("编辑窗口打开状态,请先关闭编辑窗口")),QMessageBox::YesAll);
         return;
     }
     bool ok;
@@ -177,7 +177,7 @@ void MainWindow::on_pushButton_NewRoad_clicked()
     {
         if(mcollectveh.mutable_mroads(i)->strroadname() == text.toStdString())
         {
-            QMessageBox::warning(this,"Warning","Road Is Exist",QMessageBox::YesAll);
+            QMessageBox::warning(this,tr("Warning"),tr("Road Is Exist"),QMessageBox::YesAll);
             return;
         }
     }
@@ -454,7 +454,7 @@ void MainWindow::on_actionReset_triggered()
 {
     if(mbStartCollect)
     {
-        QMessageBox::warning(this,"Warning",QString(tr("请先停止采集")),QMessageBox::YesAll);
+        QMessageBox::warning(this,tr("Warning"),QString(tr("请先停止采集")),QMessageBox::YesAll);
         return;
     }
     QMessageBox::StandardButton button;
@@ -502,7 +502,7 @@ void MainWindow::on_actionSave_triggered()
     xFile.setFileName(str);
     if(!xFile.open(QIODevice::ReadWrite))
     {
-        QMessageBox::warning(this,"Warning","Open Save File Fail.",QMessageBox::YesAll);
+        QMessageBox::warning(this,tr("Warning"),tr("Open Save File Fail."),QMessageBox::YesAll);
         return;
     }
     int nbytesize = mcollectveh.ByteSize();
@@ -514,7 +514,7 @@ void MainWindow::on_actionSave_triggered()
     }
     else
     {
-        QMessageBox::warning(this,"Waring","Serialize Collect Data Fail.",QMessageBox::YesAll);
+        QMessageBox::warning(this,tr("Waring"),tr("Serialize Collect Data Fail."),QMessageBox::YesAll);
     }
     xFile.close();
 }
@@ -523,7 +523,7 @@ void MainWindow::on_actionLoad_triggered()
 {
     if(mbStartCollect)
     {
-        QMessageBox::warning(this,"Warning",QString(tr("请先停止采集")),QMessageBox::YesAll);
+        QMessageBox::warning(this,tr("Warning"),QString(tr("请先停止采集")),QMessageBox::YesAll);
         return;
     }
     if(mcollectveh.mroads_size() > 0)
@@ -535,13 +535,13 @@ void MainWindow::on_actionLoad_triggered()
             return;
         }
     }
-    QString str = QFileDialog::getOpenFileName(this,"Load Collect",".","*.cov");
+    QString str = QFileDialog::getOpenFileName(this,tr("Load Collect"),".","*.cov");
     if(str.isEmpty())return;
     QFile xFile;
     xFile.setFileName(str);
     if(!xFile.open(QIODevice::ReadOnly))
     {
-        QMessageBox::warning(this,"Warning","Open File Fail.",QMessageBox::YesAll);
+        QMessageBox::warning(this,tr("Warning"),tr("Open File Fail."),QMessageBox::YesAll);
         return;
     }
     QByteArray ba = xFile.readAll();
@@ -550,7 +550,7 @@ void MainWindow::on_actionLoad_triggered()
     ResetPointView();
     if(!mcollectveh.ParseFromArray(ba.data(),ba.size()))
     {
-        QMessageBox::warning(this,"Warning","Parse File Data Fail.",QMessageBox::YesAll);
+        QMessageBox::warning(this,tr("Warning"),tr("Parse File Data Fail."),QMessageBox::YesAll);
         return;
     }
 
@@ -655,7 +655,7 @@ void MainWindow::on_actionEdit_Collect_triggered()
 {
     if(mbStartCollect == true)
     {
-        QMessageBox::warning(this,"Warning",QString(tr("采集数据在激活状态,请先完成采集")),QMessageBox::YesAll);
+        QMessageBox::warning(this,tr("Warning"),QString(tr("采集数据在激活状态,请先完成采集")),QMessageBox::YesAll);
         return;
     }
     mpEditWin->Setcollect(mcollectveh);
@@ -737,7 +737,7 @@ void MainWindow::on_actionConvert_triggered()
 {
     if(mcollectveh.mroads_size() == 0)
     {
-        QMessageBox::warning(this,"Warning","No Roads",QMessageBox::YesAll);
+        QMessageBox::warning(this,tr("Warning"),tr("No Roads"),QMessageBox::YesAll);
         return;
     }
     OpenDrive xxodr;
@@ -745,7 +745,7 @@ void MainWindow::on_actionConvert_triggered()
     pco->StartConvert();
     delete pco;
 
-    QString str = QFileDialog::getSaveFileName(this,"Save OpenDrive",".","*.xodr");
+    QString str = QFileDialog::getSaveFileName(this,tr("Save OpenDrive"),".","*.xodr");
     if(str.isEmpty())return;
     if(str.right(5) != ".xodr")str = str + ".xodr";
     OpenDriveXmlWriter x(&xxodr);

+ 2 - 0
src/tool/map_collectfromveh/map_collectfromveh.pro

@@ -95,3 +95,5 @@ DISTFILES += \
     ../map_lanetoxodr/TinyXML/TinyXML.pri
 
 DEFINES += NOTINPILOT
+
+TRANSLATIONS = map_collectfromveh_language.ts

+ 589 - 0
src/tool/map_collectfromveh/map_collectfromveh_language.ts

@@ -0,0 +1,589 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!DOCTYPE TS>
+<TS version="2.1" language="zh">
+<context>
+    <name>DialogConvert</name>
+    <message>
+        <location filename="dialogconvert.ui" line="14"/>
+        <source>Dialog</source>
+        <translation>Dialog</translation>
+    </message>
+    <message>
+        <location filename="dialogconvert.cpp" line="9"/>
+        <source>Convert</source>
+        <translation>Convert</translation>
+    </message>
+</context>
+<context>
+    <name>EditWin</name>
+    <message>
+        <location filename="editwin.ui" line="14"/>
+        <source>MainWindow</source>
+        <translation>MainWindow</translation>
+    </message>
+    <message>
+        <location filename="editwin.ui" line="32"/>
+        <source>Point</source>
+        <translation>Point</translation>
+    </message>
+    <message>
+        <location filename="editwin.ui" line="41"/>
+        <source>Road</source>
+        <translation>Road</translation>
+    </message>
+    <message>
+        <location filename="editwin.ui" line="51"/>
+        <source>View</source>
+        <translation>View</translation>
+    </message>
+    <message>
+        <location filename="editwin.ui" line="55"/>
+        <source>Select</source>
+        <translation>Select</translation>
+    </message>
+    <message>
+        <location filename="editwin.ui" line="65"/>
+        <source>Connect</source>
+        <translation>Connect</translation>
+    </message>
+    <message>
+        <location filename="editwin.ui" line="80"/>
+        <source>toolBar</source>
+        <translation>toolBar</translation>
+    </message>
+    <message>
+        <location filename="editwin.ui" line="114"/>
+        <location filename="editwin.ui" line="162"/>
+        <location filename="editwin.cpp" line="393"/>
+        <source>平移</source>
+        <translation>Move</translation>
+    </message>
+    <message>
+        <location filename="editwin.ui" line="117"/>
+        <source>左移一个点</source>
+        <translation>Move A Point To Left</translation>
+    </message>
+    <message>
+        <location filename="editwin.ui" line="126"/>
+        <location filename="editwin.ui" line="186"/>
+        <location filename="editwin.cpp" line="479"/>
+        <source>旋转</source>
+        <translation>Rotate</translation>
+    </message>
+    <message>
+        <location filename="editwin.ui" line="129"/>
+        <source>旋转一个点</source>
+        <translation>Rotate A Point</translation>
+    </message>
+    <message>
+        <location filename="editwin.ui" line="138"/>
+        <location filename="editwin.ui" line="198"/>
+        <location filename="editwin.cpp" line="572"/>
+        <location filename="editwin.cpp" line="856"/>
+        <source>删除</source>
+        <translation>Delete</translation>
+    </message>
+    <message>
+        <location filename="editwin.ui" line="141"/>
+        <source>删除一个点</source>
+        <translation>Delete A Point</translation>
+    </message>
+    <message>
+        <location filename="editwin.ui" line="150"/>
+        <location filename="editwin.ui" line="174"/>
+        <location filename="editwin.cpp" line="518"/>
+        <location filename="editwin.cpp" line="537"/>
+        <source>前移</source>
+        <translation>Move Front</translation>
+    </message>
+    <message>
+        <location filename="editwin.ui" line="153"/>
+        <source>前移一个点</source>
+        <translation>Move A Point To Front</translation>
+    </message>
+    <message>
+        <location filename="editwin.ui" line="165"/>
+        <source>所选道路的所有点向左平移</source>
+        <translation>Translate all points of the selected road to the left</translation>
+    </message>
+    <message>
+        <location filename="editwin.ui" line="177"/>
+        <source>所选道路的所有点向前平移</source>
+        <translation>Translate all points of the selected road forward</translation>
+    </message>
+    <message>
+        <location filename="editwin.ui" line="189"/>
+        <source>所选道路的所有点原地旋转</source>
+        <translation>All points of the selected road rotate in place</translation>
+    </message>
+    <message>
+        <location filename="editwin.ui" line="201"/>
+        <source>删除道路</source>
+        <translation>Delete Road</translation>
+    </message>
+    <message>
+        <location filename="editwin.ui" line="210"/>
+        <source>添加</source>
+        <translation>Add</translation>
+    </message>
+    <message>
+        <location filename="editwin.ui" line="213"/>
+        <source>添加道路</source>
+        <translation>Add Road</translation>
+    </message>
+    <message>
+        <location filename="editwin.ui" line="225"/>
+        <source>SelectNone</source>
+        <translation>Select None</translation>
+    </message>
+    <message>
+        <location filename="editwin.ui" line="228"/>
+        <source>不选择点或道路</source>
+        <translation>Do not select points or roads</translation>
+    </message>
+    <message>
+        <location filename="editwin.ui" line="240"/>
+        <source>SelectPoint</source>
+        <translation>SelectPoint</translation>
+    </message>
+    <message>
+        <location filename="editwin.ui" line="243"/>
+        <source>选择点</source>
+        <translation>SelectPoint</translation>
+    </message>
+    <message>
+        <location filename="editwin.ui" line="255"/>
+        <source>SelectRoad</source>
+        <translation>SelectRoad</translation>
+    </message>
+    <message>
+        <location filename="editwin.ui" line="258"/>
+        <source>选择道路</source>
+        <translation>SelectRoad</translation>
+    </message>
+    <message>
+        <location filename="editwin.ui" line="270"/>
+        <location filename="editwin.cpp" line="336"/>
+        <source>直连</source>
+        <translation>Straight</translation>
+    </message>
+    <message>
+        <location filename="editwin.ui" line="273"/>
+        <source>建立道路直接连接</source>
+        <translation>Create Straight</translation>
+    </message>
+    <message>
+        <location filename="editwin.ui" line="285"/>
+        <location filename="editwin.cpp" line="340"/>
+        <source>转弯</source>
+        <translation>Turn</translation>
+    </message>
+    <message>
+        <location filename="editwin.ui" line="288"/>
+        <source>建立转弯连接</source>
+        <translation>Create Turn</translation>
+    </message>
+    <message>
+        <location filename="editwin.ui" line="300"/>
+        <location filename="editwin.cpp" line="344"/>
+        <source>调头</source>
+        <translation>UTurn</translation>
+    </message>
+    <message>
+        <location filename="editwin.ui" line="303"/>
+        <source>建立掉头连接</source>
+        <translation>Create UTurn</translation>
+    </message>
+    <message>
+        <location filename="editwin.cpp" line="39"/>
+        <source>Edit Collect Data</source>
+        <translation>Edit Collect Data</translation>
+    </message>
+    <message>
+        <location filename="editwin.cpp" line="350"/>
+        <source>是否在道路(</source>
+        <translation>Is in Road(</translation>
+    </message>
+    <message>
+        <location filename="editwin.cpp" line="351"/>
+        <source>)和道路(</source>
+        <translation>)And Road(</translation>
+    </message>
+    <message>
+        <location filename="editwin.cpp" line="352"/>
+        <source>)建立</source>
+        <translation>)Create</translation>
+    </message>
+    <message>
+        <location filename="editwin.cpp" line="352"/>
+        <source>连接?</source>
+        <translation>Connect?</translation>
+    </message>
+    <message>
+        <location filename="editwin.cpp" line="354"/>
+        <source>建立连接</source>
+        <translation>Create Connect</translation>
+    </message>
+    <message>
+        <location filename="editwin.cpp" line="369"/>
+        <location filename="editwin.cpp" line="474"/>
+        <location filename="editwin.cpp" line="513"/>
+        <location filename="editwin.cpp" line="567"/>
+        <source>请先选择一个点</source>
+        <translation>Please Select A Point</translation>
+    </message>
+    <message>
+        <location filename="editwin.cpp" line="374"/>
+        <source>左移</source>
+        <translation>Move Left</translation>
+    </message>
+    <message>
+        <location filename="editwin.cpp" line="375"/>
+        <location filename="editwin.cpp" line="721"/>
+        <source>左移值:</source>
+        <translation>Move Left Value:</translation>
+    </message>
+    <message>
+        <location filename="editwin.cpp" line="376"/>
+        <location filename="editwin.cpp" line="481"/>
+        <location filename="editwin.cpp" line="520"/>
+        <location filename="editwin.cpp" line="722"/>
+        <location filename="editwin.cpp" line="769"/>
+        <location filename="editwin.cpp" line="816"/>
+        <source>0.0</source>
+        <translation>0.0</translation>
+    </message>
+    <message>
+        <location filename="editwin.cpp" line="381"/>
+        <location filename="editwin.cpp" line="474"/>
+        <location filename="editwin.cpp" line="513"/>
+        <location filename="editwin.cpp" line="525"/>
+        <location filename="editwin.cpp" line="715"/>
+        <location filename="editwin.cpp" line="762"/>
+        <location filename="editwin.cpp" line="774"/>
+        <location filename="editwin.cpp" line="809"/>
+        <location filename="editwin.cpp" line="821"/>
+        <location filename="editwin.cpp" line="852"/>
+        <location filename="editwin.cpp" line="977"/>
+        <source>Warning</source>
+        <translation>Warning</translation>
+    </message>
+    <message>
+        <location filename="editwin.cpp" line="381"/>
+        <location filename="editwin.cpp" line="486"/>
+        <location filename="editwin.cpp" line="525"/>
+        <location filename="editwin.cpp" line="727"/>
+        <location filename="editwin.cpp" line="774"/>
+        <location filename="editwin.cpp" line="821"/>
+        <source>数值为空</source>
+        <translation>Value is Null</translation>
+    </message>
+    <message>
+        <location filename="editwin.cpp" line="391"/>
+        <location filename="editwin.cpp" line="535"/>
+        <source>移动值超过10米,移动值为: </source>
+        <translation>Move Value Extend 10 meters, Value: </translation>
+    </message>
+    <message>
+        <location filename="editwin.cpp" line="391"/>
+        <source>米,是否进行平移?</source>
+        <translation> Meters, Move? </translation>
+    </message>
+    <message>
+        <location filename="editwin.cpp" line="480"/>
+        <source>旋转值=:</source>
+        <translation>Rotate Value:</translation>
+    </message>
+    <message>
+        <location filename="editwin.cpp" line="519"/>
+        <location filename="editwin.cpp" line="768"/>
+        <source>前移值:</source>
+        <translation>Move Front Value:</translation>
+    </message>
+    <message>
+        <location filename="editwin.cpp" line="535"/>
+        <source>米,是否进行前移?</source>
+        <translation>meters, Move Front? </translation>
+    </message>
+    <message>
+        <location filename="editwin.cpp" line="567"/>
+        <location filename="editwin.cpp" line="727"/>
+        <source>Waring</source>
+        <translation>Warning</translation>
+    </message>
+    <message>
+        <location filename="editwin.cpp" line="572"/>
+        <source>确认删除点?</source>
+        <translation>Confirm Delete Point?</translation>
+    </message>
+    <message>
+        <location filename="editwin.cpp" line="715"/>
+        <location filename="editwin.cpp" line="762"/>
+        <location filename="editwin.cpp" line="809"/>
+        <location filename="editwin.cpp" line="852"/>
+        <source>请先选择一条路</source>
+        <translation>Please Select Road</translation>
+    </message>
+    <message>
+        <location filename="editwin.cpp" line="720"/>
+        <source>左移道路</source>
+        <translation>Move A Road To Left</translation>
+    </message>
+    <message>
+        <location filename="editwin.cpp" line="767"/>
+        <source>前移道路</source>
+        <translation>Move A Road To Front</translation>
+    </message>
+    <message>
+        <location filename="editwin.cpp" line="814"/>
+        <source>旋转道路上每一个点</source>
+        <translation>Move All Points At Road</translation>
+    </message>
+    <message>
+        <location filename="editwin.cpp" line="815"/>
+        <source>旋转值:</source>
+        <translation>Rotate Value:</translation>
+    </message>
+    <message>
+        <location filename="editwin.cpp" line="856"/>
+        <source>确认删除道路?</source>
+        <translation>Confirm Delete Road?</translation>
+    </message>
+    <message>
+        <location filename="editwin.cpp" line="977"/>
+        <source>道路连接已存在</source>
+        <translation>Connect is Exists</translation>
+    </message>
+</context>
+<context>
+    <name>MainWindow</name>
+    <message>
+        <location filename="mainwindow.ui" line="14"/>
+        <source>MainWindow</source>
+        <translation>MainWindow</translation>
+    </message>
+    <message>
+        <location filename="mainwindow.ui" line="31"/>
+        <source>新道路</source>
+        <translation>New Road</translation>
+    </message>
+    <message>
+        <location filename="mainwindow.ui" line="44"/>
+        <source>完成</source>
+        <translation>Complete</translation>
+    </message>
+    <message>
+        <location filename="mainwindow.ui" line="57"/>
+        <source>采集模式</source>
+        <translation>Collection Mode</translation>
+    </message>
+    <message>
+        <location filename="mainwindow.ui" line="69"/>
+        <source>自动</source>
+        <translation>Auto</translation>
+    </message>
+    <message>
+        <location filename="mainwindow.ui" line="82"/>
+        <source>手动</source>
+        <translation>Manual</translation>
+    </message>
+    <message>
+        <location filename="mainwindow.ui" line="95"/>
+        <source>手动采集</source>
+        <translation>Manual Collection</translation>
+    </message>
+    <message>
+        <location filename="mainwindow.ui" line="109"/>
+        <source>左边线</source>
+        <translation>Left Lane</translation>
+    </message>
+    <message>
+        <location filename="mainwindow.ui" line="131"/>
+        <location filename="mainwindow.ui" line="249"/>
+        <source>距离</source>
+        <translation>Distance</translation>
+    </message>
+    <message>
+        <location filename="mainwindow.ui" line="144"/>
+        <location filename="mainwindow.ui" line="262"/>
+        <source>颜色</source>
+        <translation>Color</translation>
+    </message>
+    <message>
+        <location filename="mainwindow.ui" line="157"/>
+        <location filename="mainwindow.ui" line="275"/>
+        <source>类型</source>
+        <translation>Type</translation>
+    </message>
+    <message>
+        <location filename="mainwindow.ui" line="191"/>
+        <source>宽度</source>
+        <translation>Width</translation>
+    </message>
+    <message>
+        <location filename="mainwindow.ui" line="227"/>
+        <source>右边线</source>
+        <translation>RIght Lane</translation>
+    </message>
+    <message>
+        <location filename="mainwindow.ui" line="309"/>
+        <location filename="mainwindow.cpp" line="168"/>
+        <source>道路名称</source>
+        <translation>Road Name</translation>
+    </message>
+    <message>
+        <location filename="mainwindow.ui" line="334"/>
+        <source>File</source>
+        <translation>File</translation>
+    </message>
+    <message>
+        <location filename="mainwindow.ui" line="342"/>
+        <source>Edit</source>
+        <translation>Edit</translation>
+    </message>
+    <message>
+        <location filename="mainwindow.ui" line="348"/>
+        <source>Tool</source>
+        <translation>Tool</translation>
+    </message>
+    <message>
+        <location filename="mainwindow.ui" line="359"/>
+        <source>Load</source>
+        <translation>Load</translation>
+    </message>
+    <message>
+        <location filename="mainwindow.ui" line="364"/>
+        <source>Save</source>
+        <translation>Save</translation>
+    </message>
+    <message>
+        <location filename="mainwindow.ui" line="369"/>
+        <source>Reset</source>
+        <translation>Reset</translation>
+    </message>
+    <message>
+        <location filename="mainwindow.ui" line="374"/>
+        <source>Edit Collect</source>
+        <translation>Edit Collect</translation>
+    </message>
+    <message>
+        <location filename="mainwindow.ui" line="379"/>
+        <source>Convert</source>
+        <translation>Convert</translation>
+    </message>
+    <message>
+        <location filename="mainwindow.cpp" line="120"/>
+        <source>Collect Data From Vehicle</source>
+        <translation>Collect Data From Vehicle</translation>
+    </message>
+    <message>
+        <location filename="mainwindow.cpp" line="164"/>
+        <location filename="mainwindow.cpp" line="180"/>
+        <location filename="mainwindow.cpp" line="457"/>
+        <location filename="mainwindow.cpp" line="505"/>
+        <location filename="mainwindow.cpp" line="526"/>
+        <location filename="mainwindow.cpp" line="544"/>
+        <location filename="mainwindow.cpp" line="553"/>
+        <location filename="mainwindow.cpp" line="658"/>
+        <location filename="mainwindow.cpp" line="740"/>
+        <source>Warning</source>
+        <translation>Warning</translation>
+    </message>
+    <message>
+        <location filename="mainwindow.cpp" line="164"/>
+        <source>编辑窗口打开状态,请先关闭编辑窗口</source>
+        <translation>The editing window is open. Please close the editing window first</translation>
+    </message>
+    <message>
+        <location filename="mainwindow.cpp" line="169"/>
+        <source>道路名称:</source>
+        <translation>Road Name:</translation>
+    </message>
+    <message>
+        <location filename="mainwindow.cpp" line="170"/>
+        <source>道路1</source>
+        <translation>Road1</translation>
+    </message>
+    <message>
+        <location filename="mainwindow.cpp" line="180"/>
+        <source>Road Is Exist</source>
+        <translation>Road Is Exist</translation>
+    </message>
+    <message>
+        <location filename="mainwindow.cpp" line="457"/>
+        <location filename="mainwindow.cpp" line="526"/>
+        <source>请先停止采集</source>
+        <translation>Please stop collecting first</translation>
+    </message>
+    <message>
+        <location filename="mainwindow.cpp" line="461"/>
+        <source>重置采集</source>
+        <translation>Reset Collect</translation>
+    </message>
+    <message>
+        <location filename="mainwindow.cpp" line="461"/>
+        <source>是否重置采集</source>
+        <translation>if Reset Collect</translation>
+    </message>
+    <message>
+        <location filename="mainwindow.cpp" line="470"/>
+        <source>采集重置成功</source>
+        <translation>Reset Collect Successful</translation>
+    </message>
+    <message>
+        <location filename="mainwindow.cpp" line="505"/>
+        <source>Open Save File Fail.</source>
+        <translation>Open Save File Fail.</translation>
+    </message>
+    <message>
+        <location filename="mainwindow.cpp" line="517"/>
+        <source>Waring</source>
+        <translation>Warning</translation>
+    </message>
+    <message>
+        <location filename="mainwindow.cpp" line="517"/>
+        <source>Serialize Collect Data Fail.</source>
+        <translation>Serialize Collect Data Fail.</translation>
+    </message>
+    <message>
+        <location filename="mainwindow.cpp" line="532"/>
+        <source>加载数据</source>
+        <translation>Load Data</translation>
+    </message>
+    <message>
+        <location filename="mainwindow.cpp" line="532"/>
+        <source>当前已有采集,是否加载数据</source>
+        <translation>Currently collected, do you want to load data</translation>
+    </message>
+    <message>
+        <location filename="mainwindow.cpp" line="538"/>
+        <source>Load Collect</source>
+        <translation>Load Collect</translation>
+    </message>
+    <message>
+        <location filename="mainwindow.cpp" line="544"/>
+        <source>Open File Fail.</source>
+        <translation>Open File Fail.</translation>
+    </message>
+    <message>
+        <location filename="mainwindow.cpp" line="553"/>
+        <source>Parse File Data Fail.</source>
+        <translation>Parse File Data Fail.</translation>
+    </message>
+    <message>
+        <location filename="mainwindow.cpp" line="658"/>
+        <source>采集数据在激活状态,请先完成采集</source>
+        <translation>Data collection is active, please complete the collection first</translation>
+    </message>
+    <message>
+        <location filename="mainwindow.cpp" line="740"/>
+        <source>No Roads</source>
+        <translation>No Roads</translation>
+    </message>
+    <message>
+        <location filename="mainwindow.cpp" line="748"/>
+        <source>Save OpenDrive</source>
+        <translation>Save OpenDrive</translation>
+    </message>
+</context>
+</TS>

+ 31 - 2
src/tool/pointcloudviewer/main.cpp

@@ -10,12 +10,23 @@
 #include "modulecomm.h"
 #include "ivversion.h"
 
+#include "xmlparam.h"
+
 #include <getopt.h>
 
 char gstr_memname[256];
 char gstr_xmlpath[256];
 char gstr_logpath[256];
 
+double gflag_x = 0;
+double gflag_y = 10;
+double gflag_z = -1;
+double gflag_x_len = 1;
+double gflag_y_len = 1;
+double gflag_z_len = 1;
+bool gbflag_show = true;
+bool gbcar_show = true;
+
 void print_useage()
 {
     std::cout<<" -m --memname $mappath : share memory name. eq.  -m lidar_pc"<<std::endl;
@@ -182,9 +193,12 @@ void viewerOneOff (pcl::visualization::PCLVisualizer& viewer)
 //    pos.z = 1;
 //    viewer.addText3D("car",pos,0.1,1.0,0.0,0.0);
 
-    viewer.addCube(-0.9,0.9,9.5,10.5,-1.9,-0.4,0.0,1.0,0.0,"flag",0);
+    if(gbflag_show)
+        viewer.addCube(gflag_x -0.5* gflag_x_len,gflag_x + 0.5* gflag_x_len, gflag_y - 0.5* gflag_y_len, gflag_y + 0.5* gflag_y_len,
+                       gflag_z - 0.5* gflag_z_len,gflag_z + 0.5* gflag_z_len,0.0,1.0,0.0,"flag",0);
     //Draw Car
-    viewer.addCube(-0.9,0.9,-2.3,2.3,-1.9,-0.4,0.0,0.0,1.0,"car",0);
+    if(gbcar_show)
+        viewer.addCube(-0.9,0.9,-2.3,2.3,-1.9,-0.4,0.0,0.0,1.0,"car",0);
 
 
     viewer.addCoordinateSystem(1.0);
@@ -230,6 +244,19 @@ void viewerPsycho (pcl::visualization::PCLVisualizer& viewer)
 }
 
 
+void LoadParam(std::string strxmlpath)
+{
+    iv::xmlparam::Xmlparam xp(strxmlpath);
+    gflag_x = xp.GetParam("flag_x",0);
+    gflag_y = xp.GetParam("flag_y",10);
+    gflag_z = xp.GetParam("flag_z",-1.15);
+    gflag_x_len = xp.GetParam("flag_x_len",1.8);
+    gflag_y_len = xp.GetParam("flag_y_len",1.0);
+    gflag_z_len = xp.GetParam("flag_z_len",1.5);
+    gbflag_show = xp.GetParam("flag_show",true);
+    gbcar_show = xp.GetParam("car_show",true);
+}
+
 
 int main(int argc, char *argv[])
 {
@@ -247,6 +274,8 @@ int main(int argc, char *argv[])
         return 0;
     }
 
+    LoadParam("pointcloudviewer.xml");
+
 
 
 

+ 12 - 0
src/tool/pointcloudviewer/pointcloudviewer.xml

@@ -0,0 +1,12 @@
+<xml>	
+	<node name="pointcloudviewer">
+		<param name="flag_x" value="0" />
+		<param name="flag_y" value="10" />
+		<param name="flag_z" value="-1.15" />
+		<param name="flag_x_len" value="1.8" />
+		<param name="flag_y_len" value="1.0" />
+		<param name="flag_z_len" value="1.5" />
+		<param name="flag_show" value="true" />
+		<param name="car_show" value="true" />
+	</node>
+</xml>

+ 5 - 0
src/tool/server_fwupdate/Readme.md

@@ -0,0 +1,5 @@
+cd to proto3 folder:
+
+protoc -I . --plugin=protoc-gen-grpc=/home/yuchuli/git/grpc-framework/build2/grpc_cpp_plugin --grpc_out=. commonrpc.proto
+
+

+ 86 - 0
src/tool/server_fwupdate/commonrpc.grpc.pb.cc

@@ -0,0 +1,86 @@
+// Generated by the gRPC C++ plugin.
+// If you make any local change, they will be lost.
+// source: commonrpc.proto
+
+#include "commonrpc.pb.h"
+#include "commonrpc.grpc.pb.h"
+
+#include <functional>
+#include <grpcpp/impl/codegen/async_stream.h>
+#include <grpcpp/impl/codegen/async_unary_call.h>
+#include <grpcpp/impl/codegen/channel_interface.h>
+#include <grpcpp/impl/codegen/client_unary_call.h>
+#include <grpcpp/impl/codegen/client_callback.h>
+#include <grpcpp/impl/codegen/message_allocator.h>
+#include <grpcpp/impl/codegen/method_handler.h>
+#include <grpcpp/impl/codegen/rpc_service_method.h>
+#include <grpcpp/impl/codegen/server_callback.h>
+#include <grpcpp/impl/codegen/server_callback_handlers.h>
+#include <grpcpp/impl/codegen/server_context.h>
+#include <grpcpp/impl/codegen/service_type.h>
+#include <grpcpp/impl/codegen/sync_stream.h>
+namespace iv {
+
+static const char* CommonRPC_method_names[] = {
+  "/iv.CommonRPC/rpcquery",
+};
+
+std::unique_ptr< CommonRPC::Stub> CommonRPC::NewStub(const std::shared_ptr< ::grpc::ChannelInterface>& channel, const ::grpc::StubOptions& options) {
+  (void)options;
+  std::unique_ptr< CommonRPC::Stub> stub(new CommonRPC::Stub(channel));
+  return stub;
+}
+
+CommonRPC::Stub::Stub(const std::shared_ptr< ::grpc::ChannelInterface>& channel)
+  : channel_(channel), rpcmethod_rpcquery_(CommonRPC_method_names[0], ::grpc::internal::RpcMethod::NORMAL_RPC, channel)
+  {}
+
+::grpc::Status CommonRPC::Stub::rpcquery(::grpc::ClientContext* context, const ::iv::queryrpcReq& request, ::iv::queryrpcReply* response) {
+  return ::grpc::internal::BlockingUnaryCall< ::iv::queryrpcReq, ::iv::queryrpcReply, ::grpc::protobuf::MessageLite, ::grpc::protobuf::MessageLite>(channel_.get(), rpcmethod_rpcquery_, context, request, response);
+}
+
+void CommonRPC::Stub::experimental_async::rpcquery(::grpc::ClientContext* context, const ::iv::queryrpcReq* request, ::iv::queryrpcReply* response, std::function<void(::grpc::Status)> f) {
+  ::grpc::internal::CallbackUnaryCall< ::iv::queryrpcReq, ::iv::queryrpcReply, ::grpc::protobuf::MessageLite, ::grpc::protobuf::MessageLite>(stub_->channel_.get(), stub_->rpcmethod_rpcquery_, context, request, response, std::move(f));
+}
+
+void CommonRPC::Stub::experimental_async::rpcquery(::grpc::ClientContext* context, const ::iv::queryrpcReq* request, ::iv::queryrpcReply* response, ::grpc::experimental::ClientUnaryReactor* reactor) {
+  ::grpc::internal::ClientCallbackUnaryFactory::Create< ::grpc::protobuf::MessageLite, ::grpc::protobuf::MessageLite>(stub_->channel_.get(), stub_->rpcmethod_rpcquery_, context, request, response, reactor);
+}
+
+::grpc::ClientAsyncResponseReader< ::iv::queryrpcReply>* CommonRPC::Stub::PrepareAsyncrpcqueryRaw(::grpc::ClientContext* context, const ::iv::queryrpcReq& request, ::grpc::CompletionQueue* cq) {
+  return ::grpc::internal::ClientAsyncResponseReaderHelper::Create< ::iv::queryrpcReply, ::iv::queryrpcReq, ::grpc::protobuf::MessageLite, ::grpc::protobuf::MessageLite>(channel_.get(), cq, rpcmethod_rpcquery_, context, request);
+}
+
+::grpc::ClientAsyncResponseReader< ::iv::queryrpcReply>* CommonRPC::Stub::AsyncrpcqueryRaw(::grpc::ClientContext* context, const ::iv::queryrpcReq& request, ::grpc::CompletionQueue* cq) {
+  auto* result =
+    this->PrepareAsyncrpcqueryRaw(context, request, cq);
+  result->StartCall();
+  return result;
+}
+
+CommonRPC::Service::Service() {
+  AddMethod(new ::grpc::internal::RpcServiceMethod(
+      CommonRPC_method_names[0],
+      ::grpc::internal::RpcMethod::NORMAL_RPC,
+      new ::grpc::internal::RpcMethodHandler< CommonRPC::Service, ::iv::queryrpcReq, ::iv::queryrpcReply, ::grpc::protobuf::MessageLite, ::grpc::protobuf::MessageLite>(
+          [](CommonRPC::Service* service,
+             ::grpc::ServerContext* ctx,
+             const ::iv::queryrpcReq* req,
+             ::iv::queryrpcReply* resp) {
+               return service->rpcquery(ctx, req, resp);
+             }, this)));
+}
+
+CommonRPC::Service::~Service() {
+}
+
+::grpc::Status CommonRPC::Service::rpcquery(::grpc::ServerContext* context, const ::iv::queryrpcReq* request, ::iv::queryrpcReply* response) {
+  (void) context;
+  (void) request;
+  (void) response;
+  return ::grpc::Status(::grpc::StatusCode::UNIMPLEMENTED, "");
+}
+
+
+}  // namespace iv
+

+ 311 - 0
src/tool/server_fwupdate/commonrpc.grpc.pb.h

@@ -0,0 +1,311 @@
+// Generated by the gRPC C++ plugin.
+// If you make any local change, they will be lost.
+// source: commonrpc.proto
+// Original file comments:
+// Copyright 2015 gRPC authors.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+//     http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+//
+#ifndef GRPC_commonrpc_2eproto__INCLUDED
+#define GRPC_commonrpc_2eproto__INCLUDED
+
+#include "commonrpc.pb.h"
+
+#include <functional>
+#include <grpc/impl/codegen/port_platform.h>
+#include <grpcpp/impl/codegen/async_generic_service.h>
+#include <grpcpp/impl/codegen/async_stream.h>
+#include <grpcpp/impl/codegen/async_unary_call.h>
+#include <grpcpp/impl/codegen/client_callback.h>
+#include <grpcpp/impl/codegen/client_context.h>
+#include <grpcpp/impl/codegen/completion_queue.h>
+#include <grpcpp/impl/codegen/message_allocator.h>
+#include <grpcpp/impl/codegen/method_handler.h>
+#include <grpcpp/impl/codegen/proto_utils.h>
+#include <grpcpp/impl/codegen/rpc_method.h>
+#include <grpcpp/impl/codegen/server_callback.h>
+#include <grpcpp/impl/codegen/server_callback_handlers.h>
+#include <grpcpp/impl/codegen/server_context.h>
+#include <grpcpp/impl/codegen/service_type.h>
+#include <grpcpp/impl/codegen/status.h>
+#include <grpcpp/impl/codegen/stub_options.h>
+#include <grpcpp/impl/codegen/sync_stream.h>
+
+namespace iv {
+
+// The Upload service definition.
+class CommonRPC final {
+ public:
+  static constexpr char const* service_full_name() {
+    return "iv.CommonRPC";
+  }
+  class StubInterface {
+   public:
+    virtual ~StubInterface() {}
+    // Sends a Upload
+    virtual ::grpc::Status rpcquery(::grpc::ClientContext* context, const ::iv::queryrpcReq& request, ::iv::queryrpcReply* response) = 0;
+    std::unique_ptr< ::grpc::ClientAsyncResponseReaderInterface< ::iv::queryrpcReply>> Asyncrpcquery(::grpc::ClientContext* context, const ::iv::queryrpcReq& request, ::grpc::CompletionQueue* cq) {
+      return std::unique_ptr< ::grpc::ClientAsyncResponseReaderInterface< ::iv::queryrpcReply>>(AsyncrpcqueryRaw(context, request, cq));
+    }
+    std::unique_ptr< ::grpc::ClientAsyncResponseReaderInterface< ::iv::queryrpcReply>> PrepareAsyncrpcquery(::grpc::ClientContext* context, const ::iv::queryrpcReq& request, ::grpc::CompletionQueue* cq) {
+      return std::unique_ptr< ::grpc::ClientAsyncResponseReaderInterface< ::iv::queryrpcReply>>(PrepareAsyncrpcqueryRaw(context, request, cq));
+    }
+    class experimental_async_interface {
+     public:
+      virtual ~experimental_async_interface() {}
+      // Sends a Upload
+      virtual void rpcquery(::grpc::ClientContext* context, const ::iv::queryrpcReq* request, ::iv::queryrpcReply* response, std::function<void(::grpc::Status)>) = 0;
+      #ifdef GRPC_CALLBACK_API_NONEXPERIMENTAL
+      virtual void rpcquery(::grpc::ClientContext* context, const ::iv::queryrpcReq* request, ::iv::queryrpcReply* response, ::grpc::ClientUnaryReactor* reactor) = 0;
+      #else
+      virtual void rpcquery(::grpc::ClientContext* context, const ::iv::queryrpcReq* request, ::iv::queryrpcReply* response, ::grpc::experimental::ClientUnaryReactor* reactor) = 0;
+      #endif
+    };
+    #ifdef GRPC_CALLBACK_API_NONEXPERIMENTAL
+    typedef class experimental_async_interface async_interface;
+    #endif
+    #ifdef GRPC_CALLBACK_API_NONEXPERIMENTAL
+    async_interface* async() { return experimental_async(); }
+    #endif
+    virtual class experimental_async_interface* experimental_async() { return nullptr; }
+  private:
+    virtual ::grpc::ClientAsyncResponseReaderInterface< ::iv::queryrpcReply>* AsyncrpcqueryRaw(::grpc::ClientContext* context, const ::iv::queryrpcReq& request, ::grpc::CompletionQueue* cq) = 0;
+    virtual ::grpc::ClientAsyncResponseReaderInterface< ::iv::queryrpcReply>* PrepareAsyncrpcqueryRaw(::grpc::ClientContext* context, const ::iv::queryrpcReq& request, ::grpc::CompletionQueue* cq) = 0;
+  };
+  class Stub final : public StubInterface {
+   public:
+    Stub(const std::shared_ptr< ::grpc::ChannelInterface>& channel);
+    ::grpc::Status rpcquery(::grpc::ClientContext* context, const ::iv::queryrpcReq& request, ::iv::queryrpcReply* response) override;
+    std::unique_ptr< ::grpc::ClientAsyncResponseReader< ::iv::queryrpcReply>> Asyncrpcquery(::grpc::ClientContext* context, const ::iv::queryrpcReq& request, ::grpc::CompletionQueue* cq) {
+      return std::unique_ptr< ::grpc::ClientAsyncResponseReader< ::iv::queryrpcReply>>(AsyncrpcqueryRaw(context, request, cq));
+    }
+    std::unique_ptr< ::grpc::ClientAsyncResponseReader< ::iv::queryrpcReply>> PrepareAsyncrpcquery(::grpc::ClientContext* context, const ::iv::queryrpcReq& request, ::grpc::CompletionQueue* cq) {
+      return std::unique_ptr< ::grpc::ClientAsyncResponseReader< ::iv::queryrpcReply>>(PrepareAsyncrpcqueryRaw(context, request, cq));
+    }
+    class experimental_async final :
+      public StubInterface::experimental_async_interface {
+     public:
+      void rpcquery(::grpc::ClientContext* context, const ::iv::queryrpcReq* request, ::iv::queryrpcReply* response, std::function<void(::grpc::Status)>) override;
+      #ifdef GRPC_CALLBACK_API_NONEXPERIMENTAL
+      void rpcquery(::grpc::ClientContext* context, const ::iv::queryrpcReq* request, ::iv::queryrpcReply* response, ::grpc::ClientUnaryReactor* reactor) override;
+      #else
+      void rpcquery(::grpc::ClientContext* context, const ::iv::queryrpcReq* request, ::iv::queryrpcReply* response, ::grpc::experimental::ClientUnaryReactor* reactor) override;
+      #endif
+     private:
+      friend class Stub;
+      explicit experimental_async(Stub* stub): stub_(stub) { }
+      Stub* stub() { return stub_; }
+      Stub* stub_;
+    };
+    class experimental_async_interface* experimental_async() override { return &async_stub_; }
+
+   private:
+    std::shared_ptr< ::grpc::ChannelInterface> channel_;
+    class experimental_async async_stub_{this};
+    ::grpc::ClientAsyncResponseReader< ::iv::queryrpcReply>* AsyncrpcqueryRaw(::grpc::ClientContext* context, const ::iv::queryrpcReq& request, ::grpc::CompletionQueue* cq) override;
+    ::grpc::ClientAsyncResponseReader< ::iv::queryrpcReply>* PrepareAsyncrpcqueryRaw(::grpc::ClientContext* context, const ::iv::queryrpcReq& request, ::grpc::CompletionQueue* cq) override;
+    const ::grpc::internal::RpcMethod rpcmethod_rpcquery_;
+  };
+  static std::unique_ptr<Stub> NewStub(const std::shared_ptr< ::grpc::ChannelInterface>& channel, const ::grpc::StubOptions& options = ::grpc::StubOptions());
+
+  class Service : public ::grpc::Service {
+   public:
+    Service();
+    virtual ~Service();
+    // Sends a Upload
+    virtual ::grpc::Status rpcquery(::grpc::ServerContext* context, const ::iv::queryrpcReq* request, ::iv::queryrpcReply* response);
+  };
+  template <class BaseClass>
+  class WithAsyncMethod_rpcquery : public BaseClass {
+   private:
+    void BaseClassMustBeDerivedFromService(const Service* /*service*/) {}
+   public:
+    WithAsyncMethod_rpcquery() {
+      ::grpc::Service::MarkMethodAsync(0);
+    }
+    ~WithAsyncMethod_rpcquery() override {
+      BaseClassMustBeDerivedFromService(this);
+    }
+    // disable synchronous version of this method
+    ::grpc::Status rpcquery(::grpc::ServerContext* /*context*/, const ::iv::queryrpcReq* /*request*/, ::iv::queryrpcReply* /*response*/) override {
+      abort();
+      return ::grpc::Status(::grpc::StatusCode::UNIMPLEMENTED, "");
+    }
+    void Requestrpcquery(::grpc::ServerContext* context, ::iv::queryrpcReq* request, ::grpc::ServerAsyncResponseWriter< ::iv::queryrpcReply>* response, ::grpc::CompletionQueue* new_call_cq, ::grpc::ServerCompletionQueue* notification_cq, void *tag) {
+      ::grpc::Service::RequestAsyncUnary(0, context, request, response, new_call_cq, notification_cq, tag);
+    }
+  };
+  typedef WithAsyncMethod_rpcquery<Service > AsyncService;
+  template <class BaseClass>
+  class ExperimentalWithCallbackMethod_rpcquery : public BaseClass {
+   private:
+    void BaseClassMustBeDerivedFromService(const Service* /*service*/) {}
+   public:
+    ExperimentalWithCallbackMethod_rpcquery() {
+    #ifdef GRPC_CALLBACK_API_NONEXPERIMENTAL
+      ::grpc::Service::
+    #else
+      ::grpc::Service::experimental().
+    #endif
+        MarkMethodCallback(0,
+          new ::grpc::internal::CallbackUnaryHandler< ::iv::queryrpcReq, ::iv::queryrpcReply>(
+            [this](
+    #ifdef GRPC_CALLBACK_API_NONEXPERIMENTAL
+                   ::grpc::CallbackServerContext*
+    #else
+                   ::grpc::experimental::CallbackServerContext*
+    #endif
+                     context, const ::iv::queryrpcReq* request, ::iv::queryrpcReply* response) { return this->rpcquery(context, request, response); }));}
+    void SetMessageAllocatorFor_rpcquery(
+        ::grpc::experimental::MessageAllocator< ::iv::queryrpcReq, ::iv::queryrpcReply>* allocator) {
+    #ifdef GRPC_CALLBACK_API_NONEXPERIMENTAL
+      ::grpc::internal::MethodHandler* const handler = ::grpc::Service::GetHandler(0);
+    #else
+      ::grpc::internal::MethodHandler* const handler = ::grpc::Service::experimental().GetHandler(0);
+    #endif
+      static_cast<::grpc::internal::CallbackUnaryHandler< ::iv::queryrpcReq, ::iv::queryrpcReply>*>(handler)
+              ->SetMessageAllocator(allocator);
+    }
+    ~ExperimentalWithCallbackMethod_rpcquery() override {
+      BaseClassMustBeDerivedFromService(this);
+    }
+    // disable synchronous version of this method
+    ::grpc::Status rpcquery(::grpc::ServerContext* /*context*/, const ::iv::queryrpcReq* /*request*/, ::iv::queryrpcReply* /*response*/) override {
+      abort();
+      return ::grpc::Status(::grpc::StatusCode::UNIMPLEMENTED, "");
+    }
+    #ifdef GRPC_CALLBACK_API_NONEXPERIMENTAL
+    virtual ::grpc::ServerUnaryReactor* rpcquery(
+      ::grpc::CallbackServerContext* /*context*/, const ::iv::queryrpcReq* /*request*/, ::iv::queryrpcReply* /*response*/)
+    #else
+    virtual ::grpc::experimental::ServerUnaryReactor* rpcquery(
+      ::grpc::experimental::CallbackServerContext* /*context*/, const ::iv::queryrpcReq* /*request*/, ::iv::queryrpcReply* /*response*/)
+    #endif
+      { return nullptr; }
+  };
+  #ifdef GRPC_CALLBACK_API_NONEXPERIMENTAL
+  typedef ExperimentalWithCallbackMethod_rpcquery<Service > CallbackService;
+  #endif
+
+  typedef ExperimentalWithCallbackMethod_rpcquery<Service > ExperimentalCallbackService;
+  template <class BaseClass>
+  class WithGenericMethod_rpcquery : public BaseClass {
+   private:
+    void BaseClassMustBeDerivedFromService(const Service* /*service*/) {}
+   public:
+    WithGenericMethod_rpcquery() {
+      ::grpc::Service::MarkMethodGeneric(0);
+    }
+    ~WithGenericMethod_rpcquery() override {
+      BaseClassMustBeDerivedFromService(this);
+    }
+    // disable synchronous version of this method
+    ::grpc::Status rpcquery(::grpc::ServerContext* /*context*/, const ::iv::queryrpcReq* /*request*/, ::iv::queryrpcReply* /*response*/) override {
+      abort();
+      return ::grpc::Status(::grpc::StatusCode::UNIMPLEMENTED, "");
+    }
+  };
+  template <class BaseClass>
+  class WithRawMethod_rpcquery : public BaseClass {
+   private:
+    void BaseClassMustBeDerivedFromService(const Service* /*service*/) {}
+   public:
+    WithRawMethod_rpcquery() {
+      ::grpc::Service::MarkMethodRaw(0);
+    }
+    ~WithRawMethod_rpcquery() override {
+      BaseClassMustBeDerivedFromService(this);
+    }
+    // disable synchronous version of this method
+    ::grpc::Status rpcquery(::grpc::ServerContext* /*context*/, const ::iv::queryrpcReq* /*request*/, ::iv::queryrpcReply* /*response*/) override {
+      abort();
+      return ::grpc::Status(::grpc::StatusCode::UNIMPLEMENTED, "");
+    }
+    void Requestrpcquery(::grpc::ServerContext* context, ::grpc::ByteBuffer* request, ::grpc::ServerAsyncResponseWriter< ::grpc::ByteBuffer>* response, ::grpc::CompletionQueue* new_call_cq, ::grpc::ServerCompletionQueue* notification_cq, void *tag) {
+      ::grpc::Service::RequestAsyncUnary(0, context, request, response, new_call_cq, notification_cq, tag);
+    }
+  };
+  template <class BaseClass>
+  class ExperimentalWithRawCallbackMethod_rpcquery : public BaseClass {
+   private:
+    void BaseClassMustBeDerivedFromService(const Service* /*service*/) {}
+   public:
+    ExperimentalWithRawCallbackMethod_rpcquery() {
+    #ifdef GRPC_CALLBACK_API_NONEXPERIMENTAL
+      ::grpc::Service::
+    #else
+      ::grpc::Service::experimental().
+    #endif
+        MarkMethodRawCallback(0,
+          new ::grpc::internal::CallbackUnaryHandler< ::grpc::ByteBuffer, ::grpc::ByteBuffer>(
+            [this](
+    #ifdef GRPC_CALLBACK_API_NONEXPERIMENTAL
+                   ::grpc::CallbackServerContext*
+    #else
+                   ::grpc::experimental::CallbackServerContext*
+    #endif
+                     context, const ::grpc::ByteBuffer* request, ::grpc::ByteBuffer* response) { return this->rpcquery(context, request, response); }));
+    }
+    ~ExperimentalWithRawCallbackMethod_rpcquery() override {
+      BaseClassMustBeDerivedFromService(this);
+    }
+    // disable synchronous version of this method
+    ::grpc::Status rpcquery(::grpc::ServerContext* /*context*/, const ::iv::queryrpcReq* /*request*/, ::iv::queryrpcReply* /*response*/) override {
+      abort();
+      return ::grpc::Status(::grpc::StatusCode::UNIMPLEMENTED, "");
+    }
+    #ifdef GRPC_CALLBACK_API_NONEXPERIMENTAL
+    virtual ::grpc::ServerUnaryReactor* rpcquery(
+      ::grpc::CallbackServerContext* /*context*/, const ::grpc::ByteBuffer* /*request*/, ::grpc::ByteBuffer* /*response*/)
+    #else
+    virtual ::grpc::experimental::ServerUnaryReactor* rpcquery(
+      ::grpc::experimental::CallbackServerContext* /*context*/, const ::grpc::ByteBuffer* /*request*/, ::grpc::ByteBuffer* /*response*/)
+    #endif
+      { return nullptr; }
+  };
+  template <class BaseClass>
+  class WithStreamedUnaryMethod_rpcquery : public BaseClass {
+   private:
+    void BaseClassMustBeDerivedFromService(const Service* /*service*/) {}
+   public:
+    WithStreamedUnaryMethod_rpcquery() {
+      ::grpc::Service::MarkMethodStreamed(0,
+        new ::grpc::internal::StreamedUnaryHandler<
+          ::iv::queryrpcReq, ::iv::queryrpcReply>(
+            [this](::grpc::ServerContext* context,
+                   ::grpc::ServerUnaryStreamer<
+                     ::iv::queryrpcReq, ::iv::queryrpcReply>* streamer) {
+                       return this->Streamedrpcquery(context,
+                         streamer);
+                  }));
+    }
+    ~WithStreamedUnaryMethod_rpcquery() override {
+      BaseClassMustBeDerivedFromService(this);
+    }
+    // disable regular version of this method
+    ::grpc::Status rpcquery(::grpc::ServerContext* /*context*/, const ::iv::queryrpcReq* /*request*/, ::iv::queryrpcReply* /*response*/) override {
+      abort();
+      return ::grpc::Status(::grpc::StatusCode::UNIMPLEMENTED, "");
+    }
+    // replace default version of method with streamed unary
+    virtual ::grpc::Status Streamedrpcquery(::grpc::ServerContext* context, ::grpc::ServerUnaryStreamer< ::iv::queryrpcReq,::iv::queryrpcReply>* server_unary_streamer) = 0;
+  };
+  typedef WithStreamedUnaryMethod_rpcquery<Service > StreamedUnaryService;
+  typedef Service SplitStreamedService;
+  typedef WithStreamedUnaryMethod_rpcquery<Service > StreamedService;
+};
+
+}  // namespace iv
+
+
+#endif  // GRPC_commonrpc_2eproto__INCLUDED

+ 133 - 0
src/tool/server_fwupdate/fwadminproc.cpp

@@ -0,0 +1,133 @@
+#include "fwadminproc.h"
+
+#include <iostream>
+
+fwadminproc::fwadminproc()
+{
+    mpfwdb = new fwdb();
+}
+
+fwadminproc::~fwadminproc()
+{
+    delete mpfwdb;
+}
+
+iv::queryrpcReply fwadminproc::ProcReq(const iv::queryrpcReq * req)
+{
+    iv::queryrpcReply xreply;
+    switch (req->ntype()) {
+    case iv::CommonRPCType::LOGIN:
+        xreply = ProcLogin(req);
+        break;
+    case iv::CommonRPCType::USERADMIN:
+        xreply = ProcAdminUser(req);
+        break;
+    default:
+        break;
+    }
+    return xreply;
+}
+
+iv::queryrpcReply fwadminproc::ProcLogin(const iv::queryrpcReq *req)
+{
+    iv::queryrpcReply xreply;
+    iv::fw::loginreq xloginreq;
+    iv::fw::loginreply xloginreply;
+    if(xloginreq.ParseFromArray(req->data().data(),req->ndatasize()))
+    {
+        std::string strerrorcode = "username or password error.";
+        int nauth = mpfwdb->CheckAuth(xloginreq.username(),xloginreq.password(),strerrorcode);
+        xloginreply.set_nauth(nauth);
+        if(nauth == 0)
+        {
+            xloginreply.set_errstr(strerrorcode);
+        }
+    }
+    else
+    {
+        xloginreply.set_nauth(0);
+        xloginreply.set_errstr("Parse Request Fail.");
+
+    }
+    xreply.set_ntype(iv::CommonRPCType::LOGIN);
+    int ndatasize = xloginreply.ByteSize();
+    std::shared_ptr<char> pstr_ptr = std::shared_ptr<char>(new char[ndatasize]);
+    if(xloginreply.SerializeToArray(pstr_ptr.get(),ndatasize))
+    {
+        xreply.set_ndatasize(ndatasize);
+        xreply.set_data(pstr_ptr.get(),ndatasize);
+    }
+    else
+    {
+        std::cout<<"fwadminproc::ProcLogin "<<std::endl;
+    }
+
+    return xreply;
+}
+
+iv::queryrpcReply fwadminproc::ProcAdminUser(const iv::queryrpcReq *req)
+{
+    iv::queryrpcReply xreply;
+    iv::fw::adminreq xadminreq;
+    iv::fw::adminreply xadminreply;
+
+    if(xadminreq.ParseFromArray(req->data().data(),req->ndatasize()))
+    {
+        std::string strerrorcode = "username or password error.";
+
+        switch (xadminreq.admintype()) {
+        case iv::fw::ADMINREQ_TYPE::ADDUSER:
+            {
+            int nauth = mpfwdb->AddUser(xadminreq.username(),xadminreq.password(),strerrorcode);
+            xadminreply.set_nresult(nauth);
+            xadminreply.set_admintype(iv::fw::ADMINREQ_TYPE::ADDUSER);
+            if(nauth == 0)
+            {
+                xadminreply.set_errstr(strerrorcode);
+            }
+            }
+            break;
+        case iv::fw::ADMINREQ_TYPE::QUERYUSER:
+            {
+            std::string strvalidtime;
+            int nauth = mpfwdb->QueryUser(xadminreq.username(),strvalidtime,strerrorcode);
+            xadminreply.set_nresult(nauth);
+            xadminreply.set_admintype(iv::fw::ADMINREQ_TYPE::QUERYUSER);
+            if(nauth == 1)
+            {
+                xadminreply.set_strvalidtime(strvalidtime);
+            }
+            else
+            {
+                xadminreply.set_nresult(0);
+                xadminreply.set_errstr(strerrorcode);
+            }
+            }
+            break;
+        default:
+            break;
+        }
+
+
+    }
+    else
+    {
+        xadminreply.set_nresult(0);
+        xadminreply.set_errstr("Parse Request Fail.");
+
+    }
+    xreply.set_ntype(iv::CommonRPCType::USERADMIN);
+    int ndatasize = xadminreply.ByteSize();
+    std::shared_ptr<char> pstr_ptr = std::shared_ptr<char>(new char[ndatasize]);
+    if(xadminreply.SerializeToArray(pstr_ptr.get(),ndatasize))
+    {
+        xreply.set_ndatasize(ndatasize);
+        xreply.set_data(pstr_ptr.get(),ndatasize);
+    }
+    else
+    {
+        std::cout<<"fwadminproc::xadminreply Serialxze fail "<<std::endl;
+    }
+
+    return xreply;
+}

+ 28 - 0
src/tool/server_fwupdate/fwadminproc.h

@@ -0,0 +1,28 @@
+#ifndef FWADMINPROC_H
+#define FWADMINPROC_H
+
+#include "fwdb.h"
+
+#include "fwlogin.pb.h"
+#include "fwadmin.pb.h"
+#include "commonrpc.pb.h"
+
+class fwadminproc
+{
+public:
+    fwadminproc();
+    ~fwadminproc();
+
+public:
+
+    iv::queryrpcReply ProcReq(const iv::queryrpcReq * req);
+
+private:
+    iv::queryrpcReply ProcLogin(const iv::queryrpcReq * req);
+    iv::queryrpcReply ProcAdminUser(const iv::queryrpcReq *req);
+
+private:
+    fwdb * mpfwdb;
+};
+
+#endif // FWADMINPROC_H

+ 301 - 0
src/tool/server_fwupdate/fwdb.cpp

@@ -0,0 +1,301 @@
+#include "fwdb.h"
+
+#include <iostream>
+
+fwdb::fwdb()
+{
+    mpthread = new std::thread(&fwdb::threaddb,this);
+}
+
+fwdb::~fwdb()
+{
+    mbthreadrun = false;
+    mpthread->join();
+}
+
+void fwdb::OpenDataBase()
+{
+
+    mstrdbpath = "fw.db";
+
+    if(QSqlDatabase::contains("sqliteadc"))
+        mdatabase = QSqlDatabase::database("sqliteadc");
+    else
+        mdatabase = QSqlDatabase::addDatabase("QSQLITE","sqliteadc");
+
+
+    mdatabase.setDatabaseName(mstrdbpath.data());
+    if (!mdatabase.open())
+    {
+        qDebug("Error: Failed to connect database. error is %s ",mdatabase.lastError().text().toLatin1().data());
+        return;
+    }
+    else
+    {
+
+        qDebug("Succeed to connect database.");
+    }
+
+
+
+    QSqlQuery sql_query(mdatabase);
+
+    bool bHaveTable = true;
+
+    sql_query.exec("select count(*)  from sqlite_master where type='table' and name = 'accountdata'");
+    if(!sql_query.exec())
+    {
+        qDebug("%s",sql_query.lastError().text().toLatin1().data());
+        return;
+    }
+    else
+    {
+
+        if(sql_query.next())
+        {
+            int count = sql_query.value(0).toInt();
+//            qDebug("count %d ",count);
+            if(count < 1)bHaveTable = false;
+        }
+    }
+
+
+
+    if(bHaveTable == false)
+    {
+        if(!sql_query.exec("create table accountdata(id INTEGER primary key AUTOINCREMENT,username TEXT, password TEXT,"
+                           "phone TEXT, passneedchange BOOL, passerrorcount INTEGER,"
+                           "uservalidtime DATETIME, usercreatetime DATETIME,lastloginerrortime DATETIME)"))
+        {
+            qDebug() << "Error: Fail to create table."<< sql_query.lastError();
+            return;
+        }
+
+        char strsen[1000];
+        QDateTime now = QDateTime::currentDateTime();
+
+        QString strnow = now.toString("yyyy-MM-dd hh:mm:ss");
+        snprintf(strsen,1000,"INSERT INTO accountdata(username,password,passerrorcount,uservalidtime,usercreatetime,lastloginerrortime)"
+                 " VALUES(\"%s\",\"%s\",%d,\"%s\",\"%s\",\"%s\")",
+                                     "admin","adc",0,"2099-12-31 23:59:59",strnow.toLatin1().data(),"1970-1-1 1:00:00");
+        sql_query.exec(strsen);
+        qDebug("Create Table groupdata successfully.");
+    }
+}
+
+void fwdb::threaddb()
+{
+    OpenDataBase();
+}
+
+int fwdb::CheckAuth(std::string strusername, std::string strpassword ,std::string & strerrorcode)
+{
+    int nrtn = 0;
+    mmutexdb.lock();
+    QSqlQuery query(mdatabase);
+    char strsen[1000];
+
+
+    snprintf(strsen,1000,"select * from accountdata where((accountdata.username = \"%s\"))",
+             strusername.data());
+    query.exec(strsen);
+    if(!query.exec(strsen))
+    {
+        std::cout<<query.lastError().text().toLatin1().data()<<std::endl;
+        strerrorcode = "SQL Error.";
+        mmutexdb.unlock();
+        return 0;
+    }
+    else
+    {
+        if(query.next())
+        {
+            int nerrorcount = query.value("passerrorcount").toInt();
+            QString  strerrortime = query.value("lastloginerrortime").toString();
+
+            QDateTime dtlasterr =  QDateTime::fromString(strerrortime,"yyyy-MM-dd hh:mm:ss");
+
+            int64_t nseclasterr = dtlasterr.toSecsSinceEpoch();
+            int64_t nsecnow = QDateTime::currentSecsSinceEpoch();
+
+            int64_t ndiff = nsecnow - nseclasterr ;
+
+
+            if((nerrorcount >= 5) &&(ndiff < 1800))
+            {
+                strerrorcode = "PassWord Error 5 times, Please Wait 30 minutes.";
+                mmutexdb.unlock();
+                return 0;
+            }
+
+        }
+    }
+
+    snprintf(strsen,1000,"select * from accountdata where((accountdata.username = \"%s\") &(accountdata.password = \"%s\"))",
+             strusername.data(),strpassword.data());
+    query.exec(strsen);
+    if(!query.exec(strsen))
+    {
+        std::cout<<query.lastError().text().toLatin1().data()<<std::endl;
+        strerrorcode = "SQL Error.";
+        mmutexdb.unlock();
+        return 0;
+    }
+    else
+    {
+        if(query.next())
+        {
+            nrtn = 1;
+            std::cout<<" auth ok. "<<std::endl;
+
+            QString strvalidtime = query.value("uservalidtime").toString();
+            QDateTime dtvalid = QDateTime::fromString(strvalidtime,"yyyy-MM-dd hh:mm:ss");
+
+            int64_t nsecvalid = dtvalid.toSecsSinceEpoch();
+            int64_t nsecnow = QDateTime::currentSecsSinceEpoch();
+
+            int nerrorcount = query.value("passerrorcount").toInt();
+
+            int64_t ndiff = nsecvalid - nsecnow;
+
+            if(ndiff <0)
+            {
+                strerrorcode = "Account Expire.";
+                mmutexdb.unlock();
+                return 0;
+
+            }
+
+
+            if(nerrorcount != 0)
+            {
+                snprintf(strsen,1000,"update accountdata set passerrorcount = %d  where((accountdata.username = \"%s\") )",
+                         0, strusername.data());
+                query.exec(strsen);
+                if(!query.exec(strsen))
+                {
+                    std::cout<<query.lastError().text().toLatin1().data()<<std::endl;
+                }
+            }
+
+        }
+        else
+        {
+            snprintf(strsen,1000,"select * from accountdata where((accountdata.username = \"%s\") )",
+                     strusername.data());
+            query.exec(strsen);
+            if(!query.exec(strsen))
+            {
+                std::cout<<query.lastError().text().data()<<std::endl;
+            }
+            else
+            {
+                if(query.next())
+                {
+                    int nerrorcount = 0;
+                    nerrorcount = query.value(5).toInt();
+                    snprintf(strsen,1000,"update accountdata set lastloginerrortime = \"%s\",passerrorcount = %d  where(accountdata.username = \"%s\" )",
+                             QDateTime::currentDateTime().toString("yyyy-MM-dd hh:mm:ss").toLatin1().data(),
+                             nerrorcount+1, strusername.data());
+                    query.exec(strsen);
+                    if(!query.exec(strsen))
+                    {
+                        std::cout<<query.lastError().text().toLatin1().data()<<std::endl;
+                    }
+                }
+            }
+        }
+    }
+    mmutexdb.unlock();
+    return nrtn;
+}
+
+int fwdb::QueryUser(std::string strusername,std::string & strvalidtime, std::string &strerrorcode)
+{
+    mmutexdb.lock();
+    QSqlQuery query(mdatabase);
+    char strsen[1000];
+
+
+    snprintf(strsen,1000,"select * from accountdata where((accountdata.username = \"%s\"))",
+             strusername.data());
+    query.exec(strsen);
+    if(!query.exec(strsen))
+    {
+        std::cout<<query.lastError().text().toLatin1().data()<<std::endl;
+        strerrorcode = "SQL Error.";
+        mmutexdb.unlock();
+        return -1;
+    }
+    else
+    {
+        if(query.next())
+        {
+            strerrorcode = "User Exist.";
+            strvalidtime = query.value("uservalidtime").toString().toStdString();
+            mmutexdb.unlock();
+            return 1;
+
+        }
+        else
+        {
+            strerrorcode = "No this user.";
+            mmutexdb.unlock();
+            return -2;
+        }
+    }
+
+    mmutexdb.unlock();
+
+    strerrorcode = "No this user.";
+    return -2;
+}
+
+int fwdb::AddUser(std::string strusername, std::string strpassword, std::string &strerrorcode)
+{
+ //   int nrtn = 0;
+    mmutexdb.lock();
+    QSqlQuery query(mdatabase);
+    char strsen[1000];
+
+
+    snprintf(strsen,1000,"select * from accountdata where((accountdata.username = \"%s\"))",
+             strusername.data());
+    query.exec(strsen);
+    if(!query.exec(strsen))
+    {
+        std::cout<<query.lastError().text().toLatin1().data()<<std::endl;
+        strerrorcode = "SQL Error.";
+        mmutexdb.unlock();
+        return 0;
+    }
+    else
+    {
+        if(query.next())
+        {
+            strerrorcode = "User Exist.";
+            mmutexdb.unlock();
+            return 0;
+
+        }
+    }
+
+    QDateTime now = QDateTime::currentDateTime();
+
+    QString strnow = now.toString("yyyy-MM-dd hh:mm:ss");
+    snprintf(strsen,1000,"INSERT INTO accountdata(username,password,passerrorcount,uservalidtime,usercreatetime,lastloginerrortime)"
+             " VALUES(\"%s\",\"%s\",%d,\"%s\",\"%s\",\"%s\")",
+                                 strusername.data(),strpassword.data(),0,"2099-12-31 23:59:59",strnow.toLatin1().data(),"1970-1-1 1:00:00");
+    if(!query.exec(strsen))
+    {
+        std::cout<<query.lastError().text().toLatin1().data()<<std::endl;
+        strerrorcode = "SQL Error.";
+        mmutexdb.unlock();
+        return 0;
+    }
+
+    strerrorcode = "Success.";
+    mmutexdb.unlock();
+    return 1;
+
+}

+ 45 - 0
src/tool/server_fwupdate/fwdb.h

@@ -0,0 +1,45 @@
+#ifndef FWDB_H
+#define FWDB_H
+
+
+#include <QSqlDatabase>
+#include <QSqlError>
+#include <QSqlQuery>
+#include <QDebug>
+#include <QFile>
+#include <QThread>
+#include <QDateTime>
+
+#include <vector>
+#include <mutex>
+#include <thread>
+
+class fwdb
+{
+public:
+    fwdb();
+    ~fwdb();
+
+public:
+    int CheckAuth(std::string strusername,std::string strpassword,std::string & strerrorcode);
+
+    int AddUser(std::string strusername,std::string strpassword, std::string & strerrorcode);
+
+    int QueryUser(std::string strusername,std::string & strvalidtime,std::string & strerrorcode);
+
+private:
+    std::thread * mpthread;
+    bool mbthreadrun = true;
+    std::string mstrdbpath;
+    QSqlDatabase mdatabase;
+
+    std::mutex mmutexdb;
+
+private:
+    void threaddb();
+    void OpenDataBase();
+
+
+};
+
+#endif // FWDB_H

+ 91 - 0
src/tool/server_fwupdate/main.cpp

@@ -1,9 +1,100 @@
 #include "mainwindow.h"
 #include <QApplication>
 
+#include <iostream>
+#include <vector>
+
+#include <iostream>
+#include <memory>
+#include <string>
+#include <thread>
+
+#include <grpcpp/grpcpp.h>
+#include <grpcpp/health_check_service_interface.h>
+#include <grpcpp/ext/proto_server_reflection_plugin.h>
+
+#include "commonrpc.grpc.pb.h"
+
+#include "fwadminproc.h"
+
+using grpc::Server;
+using grpc::ServerBuilder;
+using grpc::ServerContext;
+using grpc::Status;
+
+static std::unique_ptr<Server> gserver_grpc;
+static std::string gstrserver;
+
+
+fwadminproc * gpfwadminproc;
+
+#include "xmlparam.h"
+
+// Logic and data behind the server's behavior.
+class CommonRPCServiceImpl final : public iv::CommonRPC::Service{
+  Status rpcquery(ServerContext* context, const iv::queryrpcReq * request,
+                  iv::queryrpcReply * reply) override {
+
+      std::cout<<" request size: "<<request->ByteSize()<<std::endl;
+  //    reply = new iv::queryrpcReply;
+    iv::queryrpcReply xreply = gpfwadminproc->ProcReq(request);
+
+
+    reply->CopyFrom(xreply);
+    std::cout<<std::chrono::system_clock::now().time_since_epoch().count()/1000<<" reply size: "<<reply->ByteSize()<<std::endl;
+    return Status::OK;
+  }
+
+};
+
+void RunServer() {
+  std::string server_address = gstrserver ;//("0.0.0.0:31001");
+  CommonRPCServiceImpl service;
+
+  grpc::EnableDefaultHealthCheckService(true);
+//  grpc::reflection::InitProtoReflectionServerBuilderPlugin();
+  ServerBuilder builder;
+  // Listen on the given address without any authentication mechanism.
+  builder.AddListeningPort(server_address, grpc::InsecureServerCredentials());
+
+  builder.SetMaxReceiveMessageSize(300000000);
+ // builder.SetMaxMessageSize(100000000);
+
+
+//  builder.SetMaxSendMessageSize(100000000);
+  // Register "service" as the instance through which we'll communicate with
+  // clients. In this case it corresponds to an *synchronous* service.
+  builder.RegisterService(&service);
+  // Finally assemble the server.
+ // std::unique_ptr<Server> server(builder.BuildAndStart());
+  gserver_grpc = builder.BuildAndStart();
+  std::cout << "Server listening on " << server_address << std::endl;
+
+  // Wait for the server to shutdown. Note that some other thread must be
+  // responsible for shutting down the server for this call to ever return.
+//  server->Wait();
+  gserver_grpc->Wait();
+}
+
+void threadrpc()
+{
+    RunServer();
+}
+
 int main(int argc, char *argv[])
 {
     QApplication a(argc, argv);
+
+    fwadminproc xfwadmin;
+    gpfwadminproc = &xfwadmin;
+
+    iv::xmlparam::Xmlparam xp("./server_fwupdate.xml");
+
+    gstrserver = xp.GetParam("server","0.0.0.0:19111");
+
+    std::thread * pthreadrpc = new std::thread(&threadrpc);
+    (void)pthreadrpc;
+
     MainWindow w;
     w.show();
 

+ 5 - 8
src/tool/server_fwupdate/mainwindow.cpp

@@ -12,6 +12,8 @@ MainWindow::MainWindow(QWidget *parent) :
     m_tcpserverFW->setMaxPendingConnections(2000);
     connect(m_tcpserverFW,SIGNAL(newConnection()), this,SLOT(newfwupdateConnect()));
 
+
+
     setWindowTitle("Shenlan Firmware update auth server.");
 }
 
@@ -34,13 +36,9 @@ void MainWindow::newfwupdateConnect()
         std::shared_ptr<fwupdateClient> p = std::shared_ptr<fwupdateClient>( new fwupdateClient);
         p->mnState = 0;
         p->mpSocket = pSocket;
-
-//        p->mLat = 0;
-//        p->mLon = 0;
         mMutex.lock();
         mvectorFC.push_back(p);
         mMutex.unlock();
-//        mnNCCount++;
     }
     else
     {
@@ -51,7 +49,7 @@ void MainWindow::readfwupdateMessage()
 {
     QTcpSocket * pSocket = static_cast<QTcpSocket *>(this->sender());
     QByteArray ba = pSocket->readAll();
-    int i;
+    unsigned int i;
     bool bNeedClose = false;
     mMutex.lock();
     for(i=0;i<mvectorFC.size();i++)
@@ -87,13 +85,12 @@ void MainWindow::errorfwupdate()
 {
     QTcpSocket * pSocket = static_cast<QTcpSocket *>(this->sender());
     mMutex.lock();
-    int i;
+    unsigned int i;
     for(i=0;i<mvectorFC.size();i++)
     {
         if(pSocket == mvectorFC.at(i)->mpSocket)
         {
             mvectorFC.erase(mvectorFC.begin()+i);
-  //            mnNCCount--;
         }
     }
     mMutex.unlock();
@@ -104,7 +101,7 @@ void MainWindow::disconnetfwupdate()
     qDebug("disconnect");
     QTcpSocket * pSocket = static_cast<QTcpSocket *>(this->sender());
     mMutex.lock();
-    int i;
+    unsigned int i;
     for(i=0;i<mvectorFC.size();i++)
     {
         if(pSocket == mvectorFC.at(i)->mpSocket)

+ 4 - 0
src/tool/server_fwupdate/mainwindow.h

@@ -9,6 +9,8 @@
 #include <mutex>
 #include <QTcpSocket>
 
+#include "fwdb.h"
+
 namespace Ui {
 class MainWindow;
 }
@@ -45,6 +47,8 @@ private:
 
     QTcpServer * m_tcpserverFW;
 
+
+
 };
 
 #endif // MAINWINDOW_H

+ 28 - 3
src/tool/server_fwupdate/server_fwupdate.pro

@@ -6,7 +6,7 @@
 
 QT       += core gui  network
 
-
+QT += sql
 
 greaterThan(QT_MAJOR_VERSION, 4): QT += widgets
 
@@ -27,10 +27,35 @@ DEFINES += QT_DEPRECATED_WARNINGS
 
 SOURCES += \
         main.cpp \
-        mainwindow.cpp
+        mainwindow.cpp \
+    fwdb.cpp \
+    commonrpc.grpc.pb.cc \
+    ../../include/msgtype/commonrpc.pb.cc \
+    fwadminproc.cpp \
+    ../../include/msgtype/fwlogin.pb.cc \
+    ../../include/msgtype/fwadmin.pb.cc
 
 HEADERS += \
-        mainwindow.h
+        mainwindow.h \
+    fwdb.h \
+    commonrpc.grpc.pb.h \
+    ../../include/msgtype/commonrpc.pb.h \
+    fwadminproc.h \
+    ../../include/msgtype/fwlogin.pb.h \
+    ../../include/msgtype/fwadmin.pb.h
 
 FORMS += \
         mainwindow.ui
+
+!include(../../../include/common.pri ) {
+    error( "Couldn't find the common.pri file!" )
+}
+
+!include(../../../include/ivprotobuf.pri ) {
+    error( "Couldn't find the ivprotobuf.pri file!" )
+}
+
+!include(../../../include/ivgrpc.pri ) {
+    error( "Couldn't find the ivgrpc.pri file!" )
+}
+

+ 218 - 3
src/tool/view_ndtmatching/mainwindow.cpp

@@ -4,9 +4,18 @@
 #include <pcl/io/ply_io.h>
 #include <pcl/io/obj_io.h>
 
+#include <QMessageBox>
 
 static pose gCurPose;
 
+static double gView_Z = 100.0;
+
+static bool gbAutoCam = true;
+
+static int gnViewMode = 0;
+
+static double gfViewAngle = 30.0;
+
 #include <cmath>
 
 struct Quaternion {
@@ -77,7 +86,7 @@ void viewerOneOff (pcl::visualization::PCLVisualizer& viewer)
 
 void viewerPsycho (pcl::visualization::PCLVisualizer& viewer)
 {
-    std::cout<<std::chrono::system_clock::now().time_since_epoch().count()/1000000<<" psycho."<<std::endl;
+//    std::cout<<std::chrono::system_clock::now().time_since_epoch().count()/1000000<<" psycho."<<std::endl;
 
     viewer.removeShape("car");
 
@@ -92,7 +101,21 @@ void viewerPsycho (pcl::visualization::PCLVisualizer& viewer)
 
     double yaw_calc = M_PI/2.0 - gCurPose.yaw;
 
-    viewer.setCameraPosition(gCurPose.x,gCurPose.y,100,gCurPose.x,gCurPose.y,gCurPose.z,sin(yaw_calc),cos(yaw_calc),0);
+    if(gbAutoCam)
+    {
+        if(gnViewMode == 0)
+            viewer.setCameraPosition(gCurPose.x,gCurPose.y,gView_Z,gCurPose.x,gCurPose.y,gCurPose.z,sin(yaw_calc),cos(yaw_calc),0);
+
+        if(gnViewMode == 1)
+        {
+            double gfZsin = gView_Z * sin(gfViewAngle * M_PI/180.0);
+            double gfZcos = gView_Z * cos(gfViewAngle * M_PI/180.0);
+
+            double fcam_x = gCurPose.x + gfZcos * cos(gCurPose.yaw+M_PI);
+            double fcam_y = gCurPose.y + gfZcos * sin(gCurPose.yaw+M_PI);
+            viewer.setCameraPosition(fcam_x,fcam_y,gfZsin,gCurPose.x,gCurPose.y,gCurPose.z,sin(yaw_calc),cos(yaw_calc),0);
+        }
+    }
 
     std::stringstream ss;
  //   viewer.setCameraPosition(mpos_x,0,30,mpos_x + 20,0,0,0,0,0);
@@ -110,19 +133,52 @@ MainWindow::MainWindow(QWidget *parent) :
 {
     ui->setupUi(this);
 
+    mpLabelStatus = new QLabel("No NDT Pos",ui->statusbar);
+    mpLabelStatus->setMinimumWidth(350);
+
+//    ui->pushButton_EnableRelocation->setEnabled(false);
+
+    ui->pushButton_Test->setVisible(false);
+
+    ui->horizontalSlider->setRange(5,300);
+    ui->horizontalSlider->setValue(100);
+
+    ui->comboBox->addItem("Look Down");
+    ui->comboBox->addItem("Tracking");
+
+    ui->checkBox->setChecked(true);
+
     mCurPose.x = 0; mCurPose.y = 0; mCurPose.z = 0;
     mCurPose.yaw = 0; mCurPose.pitch = 0; mCurPose.roll = 0;
 
     gCurPose = mCurPose;
+
+
 \
     mpthreadpcd = new std::thread(&MainWindow::threadpcdview,this);
 
+
+    ModuleFun fun1 =std::bind(&MainWindow::UpdateNDTPos,this,std::placeholders::_1,std::placeholders::_2,std::placeholders::_3,std::placeholders::_4,std::placeholders::_5);
+    mpandtpos = iv::modulecomm::RegisterRecvPlus("ndtpos",fun1);
+
+    ModuleFun fun2 =std::bind(&MainWindow::UpdatePCDMap,this,std::placeholders::_1,std::placeholders::_2,std::placeholders::_3,std::placeholders::_4,std::placeholders::_5);
+    mpapcdmap = iv::modulecomm::RegisterRecvPlus("pcdmap",fun2);
+
+    mparelocate = iv::modulecomm::RegisterSend("relocate",10000,1);
+
+    connect(this,SIGNAL(ndtposupdate()),this,SLOT(onndtposupdate()));
+
+    setWindowTitle("NDT Matching View & Relocation Enable");
+
 }
 
 MainWindow::~MainWindow()
 {
     mbRun = false;
     mpthreadpcd->join();
+    iv::modulecomm::Unregister(mpandtpos);
+    iv::modulecomm::Unregister(mparelocate);
+    iv::modulecomm::Unregister(mpapcdmap);
     delete ui;
 }
 
@@ -137,13 +193,18 @@ void MainWindow::threadpcdview()
      pcl::PointCloud<pcl::PointXYZI>::Ptr point_cloud2(
                  new pcl::PointCloud<pcl::PointXYZI>());
 
-     pcl::io::loadPCDFile<pcl::PointXYZI>("/home/yuchuli/map/map.pcd",*point_cloud);
+     char strpcpath[256];
+     snprintf(strpcpath,256,"%s/map/map.pcd",getenv("HOME"));
+
+     pcl::io::loadPCDFile<pcl::PointXYZI>(strpcpath,*point_cloud);
 
  //    pcl::io::loadOBJFile("/home/yuchuli/car.obj",*point_cloud);
 //     pcl::io::loadPLYFile("/home/yuchuli/car.ply",*point_cloud);
      mpviewer->showCloud(point_cloud);
 
 
+
+
      //This will only get called once
      mpviewer->runOnVisualizationThreadOnce (viewerOneOff);
 
@@ -154,6 +215,23 @@ void MainWindow::threadpcdview()
 
      while((!mpviewer->wasStopped()) && mbRun)
      {
+
+         if(mbpcdmapupdate)
+         {
+             std::string strpcdmap;
+             mmutexpcdmap.lock();
+             strpcdmap = mstrpcdmappath;
+             mbpcdmapupdate = false;
+             mmutexpcdmap.unlock();
+
+             pcl::PointCloud<pcl::PointXYZI>::Ptr point_cloud2(
+                         new pcl::PointCloud<pcl::PointXYZI>());
+
+              pcl::io::loadPCDFile<pcl::PointXYZI>(strpcdmap,*point_cloud2);
+              mpviewer->showCloud(point_cloud2);
+              std::cout<<" use new pcd map. path: "<<strpcdmap.data()<<std::endl;
+         }
+
          std::this_thread::sleep_for(std::chrono::milliseconds(10));
 
      }
@@ -180,3 +258,140 @@ void MainWindow::on_pushButton_Test_clicked()
 
     gCurPose = mCurPose;
 }
+
+void MainWindow::on_pushButton_EnableRelocation_clicked()
+{
+    static int64_t nLastSend = 0;
+
+    int64_t nnow = std::chrono::system_clock::now().time_since_epoch().count()/1000000;
+
+    if(abs(nnow - nLastSend) < 180000)
+    {
+        QMessageBox::warning(this,tr("Warning"),tr("EnableRelocation Must Interval 3 minutes. "),QMessageBox::YesAll);
+        return;
+    }
+
+    if(mfTransProb >= 2.0)
+    {
+
+        QMessageBox::StandardButton button;
+        button=QMessageBox::question(this,tr("Relocate"),QString(tr("TransProblity is more than 2.0,do you want relocation?")),QMessageBox::Yes|QMessageBox::No);
+        if(button==QMessageBox::No)
+        {
+            return;
+        }
+        else if(button==QMessageBox::Yes)
+        {
+        }
+
+    }
+
+    iv::ndt::relocate xreloc;
+    xreloc.set_benable(true);
+    int nbytesize = xreloc.ByteSize();
+    std::shared_ptr<char> pstr_ptr = std::shared_ptr<char>(new char[nbytesize]);
+    if(xreloc.SerializeToArray(pstr_ptr.get(),nbytesize))
+    {
+        iv::modulecomm::ModuleSendMsg(mparelocate,pstr_ptr.get(),nbytesize);
+    }
+    else
+    {
+        QMessageBox::warning(this,tr("Warning"),tr("Relocate Message Serialize Fail."),QMessageBox::YesAll);
+    }
+    nLastSend = nnow;
+}
+
+void MainWindow::on_horizontalSlider_valueChanged(int value)
+{
+    gView_Z = value;
+}
+
+void MainWindow::on_checkBox_clicked()
+{
+    if(ui->checkBox->isChecked())
+    {
+       gbAutoCam = true;
+    }
+    else
+    {
+        gbAutoCam = false;
+    }
+}
+
+void MainWindow::on_comboBox_currentIndexChanged(int index)
+{
+    gnViewMode = index;
+}
+
+void MainWindow::UpdateNDTPos(const char * strdata,const unsigned int nSize,const unsigned int index,const QDateTime * dt,const char * strmemname)
+{
+    (void)index;
+    (void)dt;
+    (void)strmemname;
+
+    iv::lidar::ndtpos xndtpos;
+    if(xndtpos.ParseFromArray(strdata,nSize))
+    {
+        mmutexndtpos.lock();
+        mndtpos.CopyFrom(xndtpos);
+        mbndtposupdate = true;
+        mmutexndtpos.unlock();
+        emit ndtposupdate();
+    }
+    else
+    {
+        std::cout<<"MainWindow::UpdateNDTPos Parse NDTPos Fail."<<std::endl;
+    }
+
+}
+
+void MainWindow::onndtposupdate()
+{
+    if(mbndtposupdate)
+    {
+        iv::lidar::ndtpos xndtpos;
+        mmutexndtpos.lock();
+        xndtpos.CopyFrom(mndtpos);
+        mbndtposupdate = false;
+        mmutexndtpos.unlock();
+        gCurPose.x = xndtpos.pose_x();
+        gCurPose.y = xndtpos.pose_y();
+        gCurPose.z = xndtpos.pose_z();
+        gCurPose.yaw = xndtpos.pose_yaw();
+        gCurPose.pitch = xndtpos.pose_pitch();
+        gCurPose.roll = xndtpos.pose_roll();
+        ui->lineEdit_prob->setText(QString::number(xndtpos.trans_probability(),'f',3));
+        ui->lineEdit_score->setText(QString::number(xndtpos.fitness_score(),'f',3));
+        ui->lineEdit_x->setText(QString::number(gCurPose.x,'f',3));
+        ui->lineEdit_y->setText(QString::number(gCurPose.y,'f',3));
+        ui->lineEdit_z->setText(QString::number(gCurPose.z,'f',3));
+        ui->lineEdit_yaw->setText(QString::number(gCurPose.yaw,'f',3));
+        ui->lineEdit_pitch->setText(QString::number(gCurPose.pitch,'f',3));
+        ui->lineEdit_roll->setText(QString::number(gCurPose.roll,'f',3));
+
+        mfTransProb = xndtpos.trans_probability();
+
+        mpLabelStatus->setText("NDT Update Time:" + QDateTime::currentDateTime().toString("yyyy-MM-dd hh:mm:ss:zzz"));
+    }
+}
+
+void MainWindow::UpdatePCDMap(const char *strdata, const unsigned int nSize, const unsigned int index, const QDateTime *dt, const char *strmemname)
+{
+    (void)index;
+    (void)dt;
+    (void)strmemname;
+    iv::ndt::pcdmap xpcdmap;
+    std::cout<<" update ndt map "<<std::endl;
+    if(xpcdmap.ParseFromArray(strdata,nSize))
+    {
+        mmutexpcdmap.lock();
+        mstrpcdmappath = xpcdmap.strpath();
+        mbpcdmapupdate = true;
+        mmutexpcdmap.unlock();
+
+    }
+    else
+    {
+        std::cout<<"UpdatePCDMap Fail."<<std::endl;
+    }
+}

+ 42 - 1
src/tool/view_ndtmatching/mainwindow.h

@@ -10,6 +10,14 @@
 #include <QCoreApplication>
 
 #include <thread>
+#include <mutex>
+
+#include "modulecomm.h"
+#include "ndtpos.pb.h"
+#include "relocate.pb.h"
+#include "pcdmap.pb.h"
+
+#include <QLabel>
 
 struct pose
 {
@@ -35,13 +43,28 @@ public:
     explicit MainWindow(QWidget *parent = 0);
     ~MainWindow();
 
-
+signals:
+    void ndtposupdate();
 private slots:
     void on_pushButton_Test_clicked();
 
+    void on_pushButton_EnableRelocation_clicked();
+
+    void on_horizontalSlider_valueChanged(int value);
+
+    void on_checkBox_clicked();
+
+    void on_comboBox_currentIndexChanged(int index);
+
+    void onndtposupdate();
+
 private:
     void threadpcdview();
 
+private:
+    void UpdateNDTPos(const char * strdata,const unsigned int nSize,const unsigned int index,const QDateTime * dt,const char * strmemname);
+    void UpdatePCDMap(const char * strdata,const unsigned int nSize,const unsigned int index,const QDateTime * dt,const char * strmemname);
+
 private:
     Ui::MainWindow *ui;
 
@@ -51,7 +74,25 @@ private:
 
     bool mbRun = true;
 
+    void * mpandtpos;
+    void * mparelocate;
+    void * mpapcdmap;
+
     pose mCurPose;
+
+    iv::lidar::ndtpos mndtpos;
+    std::mutex mmutexndtpos;
+    bool mbndtposupdate = false;
+
+    QLabel * mpLabelStatus;
+
+
+    double mfTransProb = 0.0;
+
+    std::string mstrpcdmappath;
+    std::mutex mmutexpcdmap;
+    bool mbpcdmapupdate =false;
+
 };
 
 #endif // MAINWINDOW_H

+ 105 - 14
src/tool/view_ndtmatching/mainwindow.ui

@@ -6,8 +6,8 @@
    <rect>
     <x>0</x>
     <y>0</y>
-    <width>771</width>
-    <height>478</height>
+    <width>686</width>
+    <height>499</height>
    </rect>
   </property>
   <property name="windowTitle">
@@ -17,9 +17,9 @@
    <widget class="QPushButton" name="pushButton_Test">
     <property name="geometry">
      <rect>
-      <x>480</x>
-      <y>320</y>
-      <width>201</width>
+      <x>610</x>
+      <y>300</y>
+      <width>71</width>
       <height>51</height>
      </rect>
     </property>
@@ -99,7 +99,7 @@
    <widget class="QLabel" name="label_4">
     <property name="geometry">
      <rect>
-      <x>310</x>
+      <x>395</x>
       <y>160</y>
       <width>61</width>
       <height>31</height>
@@ -112,7 +112,7 @@
    <widget class="QLineEdit" name="lineEdit_roll">
     <property name="geometry">
      <rect>
-      <x>380</x>
+      <x>465</x>
       <y>160</y>
       <width>121</width>
       <height>31</height>
@@ -122,7 +122,7 @@
    <widget class="QLabel" name="label_5">
     <property name="geometry">
      <rect>
-      <x>310</x>
+      <x>395</x>
       <y>40</y>
       <width>61</width>
       <height>31</height>
@@ -135,7 +135,7 @@
    <widget class="QLineEdit" name="lineEdit_pitch">
     <property name="geometry">
      <rect>
-      <x>380</x>
+      <x>465</x>
       <y>100</y>
       <width>121</width>
       <height>31</height>
@@ -145,7 +145,7 @@
    <widget class="QLabel" name="label_6">
     <property name="geometry">
      <rect>
-      <x>310</x>
+      <x>395</x>
       <y>100</y>
       <width>61</width>
       <height>31</height>
@@ -158,7 +158,7 @@
    <widget class="QLineEdit" name="lineEdit_yaw">
     <property name="geometry">
      <rect>
-      <x>380</x>
+      <x>465</x>
       <y>40</y>
       <width>121</width>
       <height>31</height>
@@ -168,20 +168,111 @@
    <widget class="QComboBox" name="comboBox">
     <property name="geometry">
      <rect>
-      <x>80</x>
-      <y>320</y>
+      <x>184</x>
+      <y>369</y>
       <width>181</width>
       <height>51</height>
      </rect>
     </property>
    </widget>
+   <widget class="QPushButton" name="pushButton_EnableRelocation">
+    <property name="geometry">
+     <rect>
+      <x>400</x>
+      <y>370</y>
+      <width>201</width>
+      <height>51</height>
+     </rect>
+    </property>
+    <property name="text">
+     <string>Enable Relocation</string>
+    </property>
+   </widget>
+   <widget class="QSlider" name="horizontalSlider">
+    <property name="geometry">
+     <rect>
+      <x>63</x>
+      <y>309</y>
+      <width>521</width>
+      <height>31</height>
+     </rect>
+    </property>
+    <property name="orientation">
+     <enum>Qt::Horizontal</enum>
+    </property>
+   </widget>
+   <widget class="QCheckBox" name="checkBox">
+    <property name="geometry">
+     <rect>
+      <x>60</x>
+      <y>369</y>
+      <width>111</width>
+      <height>51</height>
+     </rect>
+    </property>
+    <property name="text">
+     <string>Auto</string>
+    </property>
+   </widget>
+   <widget class="QLineEdit" name="lineEdit_score">
+    <property name="geometry">
+     <rect>
+      <x>465</x>
+      <y>220</y>
+      <width>121</width>
+      <height>31</height>
+     </rect>
+    </property>
+    <property name="readOnly">
+     <bool>true</bool>
+    </property>
+   </widget>
+   <widget class="QLineEdit" name="lineEdit_prob">
+    <property name="geometry">
+     <rect>
+      <x>130</x>
+      <y>220</y>
+      <width>121</width>
+      <height>31</height>
+     </rect>
+    </property>
+    <property name="readOnly">
+     <bool>true</bool>
+    </property>
+   </widget>
+   <widget class="QLabel" name="label_7">
+    <property name="geometry">
+     <rect>
+      <x>395</x>
+      <y>220</y>
+      <width>61</width>
+      <height>31</height>
+     </rect>
+    </property>
+    <property name="text">
+     <string>score</string>
+    </property>
+   </widget>
+   <widget class="QLabel" name="label_8">
+    <property name="geometry">
+     <rect>
+      <x>60</x>
+      <y>220</y>
+      <width>61</width>
+      <height>31</height>
+     </rect>
+    </property>
+    <property name="text">
+     <string>prob</string>
+    </property>
+   </widget>
   </widget>
   <widget class="QMenuBar" name="menubar">
    <property name="geometry">
     <rect>
      <x>0</x>
      <y>0</y>
-     <width>771</width>
+     <width>686</width>
      <height>28</height>
     </rect>
    </property>

+ 17 - 2
src/tool/view_ndtmatching/view_ndtmatching.pro

@@ -17,7 +17,10 @@ DEFINES += QT_DEPRECATED_WARNINGS
 #DEFINES += QT_DISABLE_DEPRECATED_BEFORE=0x060000    # disables all the APIs deprecated before Qt 6.0.0
 
 SOURCES += main.cpp \
-    mainwindow.cpp
+    mainwindow.cpp \
+    ../../include/msgtype/ndtpos.pb.cc \
+    ../../include/msgtype/relocate.pb.cc \
+    ../../include/msgtype/pcdmap.pb.cc
 
 QMAKE_LFLAGS += -no-pie
 
@@ -63,5 +66,17 @@ FORMS += \
     mainwindow.ui
 
 HEADERS += \
-    mainwindow.h
+    mainwindow.h \
+    ../../include/msgtype/ndtpos.pb.h \
+    ../../include/msgtype/relocate.pb.h \
+    ../../include/msgtype/pcdmap.pb.h
+
+!include(../../../include/common.pri ) {
+    error( "Couldn't find the common.pri file!" )
+}
+
+!include(../../../include/ivprotobuf.pri ) {
+    error( "Couldn't find the ivprotobuf.pri file!" )
+}
+
 

+ 10 - 2
src/ui/ADCIntelligentShow_grpc/ivmapview.cpp

@@ -14,7 +14,7 @@ double ghdg0 = 360;
 #include "pos_def.h"
 
 extern std::vector<iv::pos_def> gvectorpos;
-
+extern std::string gstrmode;
 
 #include <math.h>
 //高斯投影由经纬度(Unit:DD)反算大地坐标(含带号,Unit:Metres)
@@ -187,7 +187,15 @@ ivmapview::ivmapview()
 #ifdef Android
     LoadXODR("/storage/emulated/0//map.xodr",mxodr);
 #else
-    LoadXODR("./map.xodr",mxodr);
+    if(gstrmode == "false")
+        LoadXODR("./map.xodr",mxodr);
+    else
+    {
+        char * strhome = getenv("HOME");
+        char strmappath[256];
+        snprintf(strmappath,256,"%s/map/map.xodr",strhome);
+        LoadXODR(strmappath,mxodr);
+    }
 #endif
 
 

+ 2 - 0
src/ui/ADCIntelligentShow_grpc/ivmapview.h

@@ -3,6 +3,8 @@
 
 #include <QDateTime>
 
+#include <mutex>
+
 #include "ivview.h"
 
 #include "gpsimu.pb.h"

+ 49 - 20
src/ui/ui_ads_hmi/ADCIntelligentVehicle.cpp

@@ -3,11 +3,15 @@
 #include "chassis.pb.h"
 #include "xmlparam.h"
 
+
 #include <thread>
 
 #define qtcout qDebug() << "[ " << __FILE__ << ":" << __LINE__<< " ]";
 
 extern std::string gstrmemgps;
+
+extern std::string gstrvehtype;
+
 /**
      常量 	值 	描述
     QHostAddress::Null 	0 	空地址对象,相当于QHostAddress()。
@@ -279,10 +283,15 @@ ADCIntelligentVehicle::ADCIntelligentVehicle(QWidget *parent)
     //myview_small->centerOn(-200,-200);
 
     /********************************** 百度地图显示  ********************************/
-    mMapview = new QWebEngineView(ui->stackedWidget->widget(1));
-//    qDebug((QDir::currentPath()).toLatin1().data());
-    mMapview->load(QUrl(QString("file:///%1/%2").arg(QApplication::applicationDirPath()).arg("BaiDuMap.html")));
-    mMapview->setGeometry(1000,100,500,500);
+
+    if(gstrvehtype != "LuBan")
+    {
+
+        mMapview = new QWebEngineView(ui->stackedWidget->widget(1));
+        //    qDebug((QDir::currentPath()).toLatin1().data());
+        mMapview->load(QUrl(QString("file:///%1/%2").arg(QApplication::applicationDirPath()).arg("BaiDuMap.html")));
+        mMapview->setGeometry(1000,100,500,500);
+    }
     /********************************************************************************/
 
 
@@ -476,6 +485,23 @@ ADCIntelligentVehicle::ADCIntelligentVehicle(QWidget *parent)
     ui->pBtn_low_beam_close->setIcon(QIcon(":/Car-Control-icon/JinGuang-Guan.svg"));
     ui->pBtn_high_beam_open->setIcon(QIcon(":/Car-Control-icon/YuanGuang-Kai.svg"));
     ui->pBtn_high_beam_close->setIcon(QIcon(":/Car-Control-icon/YuanGuang-Guan.svg"));
+
+    if(gstrvehtype == "LuBan")
+    {
+        ui->groupBox->setVisible(false);
+        ui->groupBox_4->setVisible(false);
+        ui->groupBox_5->setVisible(false);
+        ui->groupBox_6->setVisible(false);
+        ui->groupBox_7->setVisible(false);
+        ui->groupBox_8->setVisible(false);
+        ui->groupBox_9->setVisible(false);
+        ui->groupBox_10->setVisible(false);
+        ui->groupBox_13->setVisible(false);
+        ui->pushButton_3->setVisible(false);
+        ui->pushButton_4->setVisible(false);
+        ui->groupBox_11->setVisible(false);
+    }
+
 }
 
 ADCIntelligentVehicle::~ADCIntelligentVehicle()
@@ -710,7 +736,7 @@ void ADCIntelligentVehicle::timeoutslot()
     }
     else
     {
-        ui->label_13->setText(QString("前方没有障碍物"));
+        ui->label_13->setText(QString(tr("前方没有障碍物")));
     }
 
     ui->label_26->setText("ttc is "+QString::number(ServiceCarStatus.mfttc,'f',1) + " brake is " + QString::number(ServiceCarStatus.mfBrake,'f',2));  //add 20200518
@@ -896,13 +922,16 @@ void ADCIntelligentVehicle::onStateTimerMap()
 {
     /*******************************更新百度地图******************************/
 
-    double flat = ServiceCarStatus.location->gps_lat;
-    double flon = ServiceCarStatus.location->gps_lng;
-    double fang = ServiceCarStatus.location->ins_heading_angle;
+    if(gstrvehtype != "LuBan")
+    {
+        double flat = ServiceCarStatus.location->gps_lat;
+        double flon = ServiceCarStatus.location->gps_lng;
+        double fang = ServiceCarStatus.location->ins_heading_angle;
 
-    char strscript[256];
-    snprintf(strscript,255,"theLocation(%11.7f,%11.7f,%11.7f);",flon,flat,fang);
-    mMapview->page()->runJavaScript(strscript);
+        char strscript[256];
+        snprintf(strscript,255,"theLocation(%11.7f,%11.7f,%11.7f);",flon,flat,fang);
+        mMapview->page()->runJavaScript(strscript);
+    }
     /************************************************************************/
 }
 
@@ -1189,7 +1218,7 @@ void ADCIntelligentVehicle::paintEvent(QPaintEvent *)
         //获取到实时 GPS信息,并做路径点的显示更新
         if (ServiceCarStatus.location->gps_x == 0)
         {
-            painter->drawText(rect(), Qt::AlignLeft, QString::fromLocal8Bit("等待车辆实时GPS位置信息"));
+            painter->drawText(rect(), Qt::AlignLeft, QString(tr("等待车辆实时GPS位置信息")));
 //            painter_small->drawText(rect(), Qt::AlignLeft, QString::fromLocal8Bit("等待车辆实时GPS位置信息"));
         }
         else
@@ -1438,7 +1467,7 @@ void ADCIntelligentVehicle::paintEvent(QPaintEvent *)
 void ADCIntelligentVehicle::on_pb_auto_drive_mode_clicked() {
     is_auto_drive_mode_enable_ = !is_auto_drive_mode_enable_;
     //    ServiceCanUtil.startsend(is_auto_drive_mode_enable_);
-    ui->pb_auto_drive_mode->setText(is_auto_drive_mode_enable_ ? QStringLiteral("决策控制使能:开") : QStringLiteral("决策控制使能:关"));
+    ui->pb_auto_drive_mode->setText(is_auto_drive_mode_enable_ ? QString(tr("决策控制使能:开")) : QString(tr("决策控制使能:关")));
 }
 
 /**
@@ -1447,7 +1476,7 @@ void ADCIntelligentVehicle::on_pb_auto_drive_mode_clicked() {
 void ADCIntelligentVehicle::on_pb_auto_braking_mode_clicked() {
     is_auto_braking_mode_enable_ = !is_auto_braking_mode_enable_;
     //    ServiceControlStatus.set_turnsignals_control(is_auto_braking_mode_enable_,0);
-    ui->pb_auto_braking_mode->setText(is_auto_braking_mode_enable_ ? QStringLiteral("左转向灯:开") : QStringLiteral("左转向灯:关"));
+    ui->pb_auto_braking_mode->setText(is_auto_braking_mode_enable_ ? QString(tr("左转向灯:开")) : QString(tr("左转向灯:关")));
 }
 
 /**
@@ -1457,7 +1486,7 @@ void ADCIntelligentVehicle::on_pb_auto_braking_mode_clicked() {
 void ADCIntelligentVehicle::on_pb_auto_accelerate_mode_clicked() {
     is_auto_accelerate_mode_enable_ = !is_auto_accelerate_mode_enable_;
     //    ServiceControlStatus.set_turnsignals_control(0,is_auto_accelerate_mode_enable_);
-    ui->pb_auto_accelerate_mode->setText(is_auto_accelerate_mode_enable_ ? QStringLiteral("右转向灯:开") : QStringLiteral("右转向灯:关"));
+    ui->pb_auto_accelerate_mode->setText(is_auto_accelerate_mode_enable_ ? QString(tr("右转向灯:开")) : QString(tr("右转向灯:关")));
 }
 
 /**
@@ -1466,7 +1495,7 @@ void ADCIntelligentVehicle::on_pb_auto_accelerate_mode_clicked() {
 void ADCIntelligentVehicle::on_pb_auto_wheel_mode_clicked() {
     is_auto_wheel_mode_enable_ = !is_auto_wheel_mode_enable_;
     //    ServiceControlStatus.set_speaker(is_auto_wheel_mode_enable_);
-    ui->pb_auto_wheel_mode->setText(is_auto_wheel_mode_enable_ ? QStringLiteral("喇叭") : QStringLiteral("喇叭"));
+    ui->pb_auto_wheel_mode->setText(is_auto_wheel_mode_enable_ ? QString(tr("喇叭")) : QString(tr("喇叭")));
 }
 
 /**
@@ -1475,7 +1504,7 @@ void ADCIntelligentVehicle::on_pb_auto_wheel_mode_clicked() {
 void ADCIntelligentVehicle::on_pushButton_clicked(){
     is_3 = !is_3;
     //    ServiceControlStatus.set_light(is_3);
-    ui->pushButton->setText(is_3 ? QStringLiteral("近光灯:开") : QStringLiteral("近光灯:关"));
+    ui->pushButton->setText(is_3 ? QString(tr("近光灯:开")) : QString(tr("近光灯:关")));
 }
 
 /**
@@ -1487,7 +1516,7 @@ void ADCIntelligentVehicle::on_pb_speed_control_mode_clicked() {
     //        ServiceControlStatus.set_engine(0x03);
     //    else
     //        ServiceControlStatus.set_engine(0x02);
-    ui->pb_speed_control_mode->setText(is_speed_control_mode_enable_ ? QStringLiteral("点火:开") : QStringLiteral("点火:关"));
+    ui->pb_speed_control_mode->setText(is_speed_control_mode_enable_ ? QString(tr("点火:开")) : QString(tr("点火:关")));
 }
 
 /**
@@ -2275,11 +2304,11 @@ void ADCIntelligentVehicle::on_pb_v2xEn_clicked()
 {
     qDebug()<<mv2xStEn;
     if(mv2xStEn){
-        ui->pb_v2xEn->setText("云平台控制:关");
+        ui->pb_v2xEn->setText(tr("云平台控制:关"));
         mv2xStEn = 0;
     }
     else{
-        ui->pb_v2xEn->setText("云平台控制:开");
+        ui->pb_v2xEn->setText(tr("云平台控制:开"));
         mv2xStEn = 1;
     }
     gIvlog->info("hmi","v2x enable:%d", mv2xStEn);

+ 13 - 13
src/ui/ui_ads_hmi/ADCIntelligentVehicle.ui

@@ -765,7 +765,7 @@
       <widget class="QLineEdit" name="lineEdit_12">
        <property name="geometry">
         <rect>
-         <x>99</x>
+         <x>143</x>
          <y>30</y>
          <width>101</width>
          <height>20</height>
@@ -778,7 +778,7 @@
       <widget class="QLineEdit" name="lineEdit_17">
        <property name="geometry">
         <rect>
-         <x>100</x>
+         <x>143</x>
          <y>60</y>
          <width>101</width>
          <height>21</height>
@@ -793,7 +793,7 @@
         <rect>
          <x>10</x>
          <y>30</y>
-         <width>81</width>
+         <width>121</width>
          <height>20</height>
         </rect>
        </property>
@@ -809,7 +809,7 @@
       <widget class="QPushButton" name="pushButton_25">
        <property name="geometry">
         <rect>
-         <x>221</x>
+         <x>306</x>
          <y>30</y>
          <width>81</width>
          <height>21</height>
@@ -827,7 +827,7 @@
       <widget class="QPushButton" name="pushButton_26">
        <property name="geometry">
         <rect>
-         <x>220</x>
+         <x>309</x>
          <y>60</y>
          <width>81</width>
          <height>21</height>
@@ -847,7 +847,7 @@
         <rect>
          <x>10</x>
          <y>60</y>
-         <width>81</width>
+         <width>121</width>
          <height>21</height>
         </rect>
        </property>
@@ -863,7 +863,7 @@
       <widget class="QPushButton" name="Mobileye_st">
        <property name="geometry">
         <rect>
-         <x>320</x>
+         <x>412</x>
          <y>30</y>
          <width>81</width>
          <height>21</height>
@@ -1966,7 +1966,7 @@ background-color: rgb(85, 87, 83);</string>
 &lt;html&gt;&lt;head&gt;&lt;meta name=&quot;qrichtext&quot; content=&quot;1&quot; /&gt;&lt;style type=&quot;text/css&quot;&gt;
 p, li { white-space: pre-wrap; }
 &lt;/style&gt;&lt;/head&gt;&lt;body style=&quot; font-family:'Ubuntu'; font-size:11pt; font-weight:400; font-style:normal;&quot;&gt;
-&lt;p style=&quot;-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; font-family:'Ubuntu';&quot;&gt;&lt;br /&gt;&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
+&lt;p style=&quot;-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;&lt;br /&gt;&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
        </property>
       </widget>
       <widget class="QLabel" name="label_12">
@@ -2087,7 +2087,7 @@ gridline-color: qlineargradient(spread:pad, x1:0, y1:0, x2:1, y2:0, stop:0 rgba(
 &lt;html&gt;&lt;head&gt;&lt;meta name=&quot;qrichtext&quot; content=&quot;1&quot; /&gt;&lt;style type=&quot;text/css&quot;&gt;
 p, li { white-space: pre-wrap; }
 &lt;/style&gt;&lt;/head&gt;&lt;body style=&quot; font-family:'Ubuntu'; font-size:11pt; font-weight:400; font-style:normal;&quot;&gt;
-&lt;p style=&quot;-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; font-family:'Ubuntu';&quot;&gt;&lt;br /&gt;&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
+&lt;p style=&quot;-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;&lt;br /&gt;&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
        </property>
       </widget>
       <widget class="QTextEdit" name="textEdit_aobzdis_tj">
@@ -2142,7 +2142,7 @@ p, li { white-space: pre-wrap; }
 &lt;html&gt;&lt;head&gt;&lt;meta name=&quot;qrichtext&quot; content=&quot;1&quot; /&gt;&lt;style type=&quot;text/css&quot;&gt;
 p, li { white-space: pre-wrap; }
 &lt;/style&gt;&lt;/head&gt;&lt;body style=&quot; font-family:'Ubuntu'; font-size:11pt; font-weight:400; font-style:normal;&quot;&gt;
-&lt;p style=&quot;-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; font-family:'Ubuntu';&quot;&gt;&lt;br /&gt;&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
+&lt;p style=&quot;-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;&lt;br /&gt;&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
        </property>
       </widget>
       <widget class="QTextEdit" name="textEdit_aocftime_tj">
@@ -2433,7 +2433,7 @@ background-color: rgb(85, 87, 83);</string>
       <rect>
        <x>740</x>
        <y>0</y>
-       <width>71</width>
+       <width>151</width>
        <height>31</height>
       </rect>
      </property>
@@ -2447,9 +2447,9 @@ background-color: rgb(85, 87, 83);</string>
     <widget class="QLabel" name="label_8">
      <property name="geometry">
       <rect>
-       <x>830</x>
+       <x>940</x>
        <y>0</y>
-       <width>71</width>
+       <width>181</width>
        <height>31</height>
       </rect>
      </property>

+ 11 - 0
src/ui/ui_ads_hmi/main.cpp

@@ -13,6 +13,8 @@ iv::Ivlog * gIvlog;
 #include "ivexit.h"
 #include <thread>
 
+#include <QTranslator>
+
 QApplication * gApp;
 
 std::string gstrmemgps;
@@ -20,6 +22,7 @@ std::string gstrmemradar;
 std::string gstrmemdecition;
 std::string gstrmembrainstate;
 std::string gstrmemchassis;
+std::string gstrvehtype;
 
 void ExitFunc()
 {
@@ -33,6 +36,13 @@ int main(int argc, char *argv[])
     showversion("ui_ads_hmi");
     QApplication a(argc, argv);
 
+    QTranslator ts;
+    if(ts.load("./ui_ads_hmi_language.qm"))
+    {
+        a.installTranslator(&ts);
+    }
+
+
     gApp = &a;
 
     QString strpath = QCoreApplication::applicationDirPath();
@@ -53,6 +63,7 @@ int main(int argc, char *argv[])
    gstrmemdecition = xp.GetParam("dection","deciton");
    gstrmembrainstate = xp.GetParam("brainstate","brainstate");
    gstrmemchassis = xp.GetParam("chassismsgname","chassis");
+   gstrvehtype = xp.GetParam("VehType","ShenLan");
 
 #if (QT_VERSION <= QT_VERSION_CHECK(5,0,0))    //apollo_fu 20200413 添加对QT4版本的中文字体支持
     //QT5版本以上默认就是采用UTF-8编码

+ 7 - 1
src/ui/ui_ads_hmi/ui_ads_hmi.pro

@@ -80,11 +80,14 @@ unix:!macx: DEPENDPATH += $$PWD/.
     error( "Couldn't find the ivboost.pri file!" )
 }
 
-
 if(contains(DEFINES,SYSTEM_AGX)){
 
 LIBS += -lQt5WebEngine -lQt5WebEngineWidgets
 }
+else
+{
+QT       +=  webenginewidgets
+}
 
 #win32: LIBS += D:/boost/stage/lib/libboost_thread-vc140-mt-gd-x64-1_68.lib D:/boost/stage/lib/libboost_system-vc140-mt-gd-x64-1_68.lib \
 #D:/boost/stage/lib/libboost_date_time-vc140-mt-gd-x64-1_68.lib D:/boost/stage/lib/libboost_chrono-vc140-mt-gd-x64-1_68.lib  \
@@ -108,3 +111,6 @@ DISTFILES += \
 #    -lrobosense_detection -lrobosense_module_manager -lrobosense_preprocessing -lrobosense_tracking
 
 LIBS += -livprotoif
+
+
+TRANSLATIONS = ui_ads_hmi_language.ts

+ 748 - 0
src/ui/ui_ads_hmi/ui_ads_hmi_language.ts

@@ -0,0 +1,748 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!DOCTYPE TS>
+<TS version="2.1" language="zh_CN">
+<context>
+    <name>ADCIntelligentVehicle</name>
+    <message>
+        <location filename="ADCIntelligentVehicle.ui" line="14"/>
+        <source>ADCIntelligentVehicle</source>
+        <translation>ADCIntelligentVehicle</translation>
+    </message>
+    <message>
+        <location filename="ADCIntelligentVehicle.ui" line="122"/>
+        <source>基本操作</source>
+        <translation>Base Operation</translation>
+    </message>
+    <message>
+        <location filename="ADCIntelligentVehicle.ui" line="133"/>
+        <source>启动自动驾驶</source>
+        <translation>Start Auto Drive</translation>
+    </message>
+    <message>
+        <location filename="ADCIntelligentVehicle.ui" line="148"/>
+        <source>暂停自动驾驶</source>
+        <translation>Pause Auto Drive</translation>
+    </message>
+    <message>
+        <location filename="ADCIntelligentVehicle.ui" line="160"/>
+        <source>退出自动驾驶</source>
+        <translation>Exit Auto Drive</translation>
+    </message>
+    <message>
+        <location filename="ADCIntelligentVehicle.ui" line="172"/>
+        <source>使能云平台控制</source>
+        <translation>Enable Cloud Ctrl</translation>
+    </message>
+    <message>
+        <location filename="ADCIntelligentVehicle.ui" line="196"/>
+        <location filename="ADCIntelligentVehicle.ui" line="763"/>
+        <source>实时状态</source>
+        <translation>State</translation>
+    </message>
+    <message>
+        <location filename="ADCIntelligentVehicle.ui" line="278"/>
+        <location filename="ADCIntelligentVehicle.ui" line="806"/>
+        <source>RTK</source>
+        <translation>RTK</translation>
+    </message>
+    <message>
+        <location filename="ADCIntelligentVehicle.ui" line="296"/>
+        <source>INS</source>
+        <translation>INST</translation>
+    </message>
+    <message>
+        <location filename="ADCIntelligentVehicle.ui" line="314"/>
+        <location filename="ADCIntelligentVehicle.ui" line="824"/>
+        <source>毫米波雷达</source>
+        <translation>RADAR</translation>
+    </message>
+    <message>
+        <location filename="ADCIntelligentVehicle.ui" line="332"/>
+        <location filename="ADCIntelligentVehicle.ui" line="842"/>
+        <source>激光雷达</source>
+        <translation>LIDAR</translation>
+    </message>
+    <message>
+        <location filename="ADCIntelligentVehicle.ui" line="350"/>
+        <location filename="ADCIntelligentVehicle.ui" line="860"/>
+        <source>决策周期</source>
+        <translation>Decision Period</translation>
+    </message>
+    <message>
+        <location filename="ADCIntelligentVehicle.ui" line="373"/>
+        <source>开启自动驾驶之旅</source>
+        <translation>Start Auto Drive Journey</translation>
+    </message>
+    <message>
+        <location filename="ADCIntelligentVehicle.ui" line="398"/>
+        <source>Start A Journey Of Autopilot</source>
+        <translation>Start A Journey Of Autopilot</translation>
+    </message>
+    <message>
+        <location filename="ADCIntelligentVehicle.ui" line="424"/>
+        <source>0</source>
+        <translation>0</translation>
+    </message>
+    <message>
+        <location filename="ADCIntelligentVehicle.ui" line="449"/>
+        <source>速度</source>
+        <translation>Speed</translation>
+    </message>
+    <message>
+        <location filename="ADCIntelligentVehicle.ui" line="550"/>
+        <source>V2X红绿灯</source>
+        <translation>V2X Traffic Light</translation>
+    </message>
+    <message>
+        <location filename="ADCIntelligentVehicle.ui" line="565"/>
+        <source>右转</source>
+        <translation>Right</translation>
+    </message>
+    <message>
+        <location filename="ADCIntelligentVehicle.ui" line="635"/>
+        <location filename="ADCIntelligentVehicle.ui" line="699"/>
+        <location filename="ADCIntelligentVehicle.ui" line="712"/>
+        <location filename="ADCIntelligentVehicle.ui" line="725"/>
+        <location filename="ADCIntelligentVehicle.ui" line="1169"/>
+        <location filename="ADCIntelligentVehicle.ui" line="1195"/>
+        <source>TextLabel</source>
+        <translation>TextLabel</translation>
+    </message>
+    <message>
+        <location filename="ADCIntelligentVehicle.ui" line="651"/>
+        <source>直行</source>
+        <translation>Straight</translation>
+    </message>
+    <message>
+        <location filename="ADCIntelligentVehicle.ui" line="686"/>
+        <source>掉头</source>
+        <translation>U Turn</translation>
+    </message>
+    <message>
+        <location filename="ADCIntelligentVehicle.ui" line="741"/>
+        <source>左转</source>
+        <translation>Left</translation>
+    </message>
+    <message>
+        <location filename="ADCIntelligentVehicle.ui" line="878"/>
+        <source>Mobileye</source>
+        <translation>Mobileye</translation>
+    </message>
+    <message>
+        <location filename="ADCIntelligentVehicle.ui" line="898"/>
+        <location filename="ADCIntelligentVehicle.ui" line="1710"/>
+        <source>速度控制</source>
+        <translation>Speed Ctrl</translation>
+    </message>
+    <message>
+        <location filename="ADCIntelligentVehicle.ui" line="910"/>
+        <source>常规速度</source>
+        <translation>Normal Speed</translation>
+    </message>
+    <message>
+        <location filename="ADCIntelligentVehicle.ui" line="923"/>
+        <source>转弯速度</source>
+        <translation>Turn Speed</translation>
+    </message>
+    <message>
+        <location filename="ADCIntelligentVehicle.ui" line="936"/>
+        <source>快速</source>
+        <translation>Fast</translation>
+    </message>
+    <message>
+        <location filename="ADCIntelligentVehicle.ui" line="949"/>
+        <source>中速</source>
+        <translation>Normal</translation>
+    </message>
+    <message>
+        <location filename="ADCIntelligentVehicle.ui" line="962"/>
+        <source>慢速</source>
+        <translation>Slow</translation>
+    </message>
+    <message>
+        <location filename="ADCIntelligentVehicle.ui" line="1033"/>
+        <source>模式选择</source>
+        <translation>Mode Slect</translation>
+    </message>
+    <message>
+        <location filename="ADCIntelligentVehicle.ui" line="1045"/>
+        <source>换道</source>
+        <translation>Lane Change</translation>
+    </message>
+    <message>
+        <location filename="ADCIntelligentVehicle.ui" line="1058"/>
+        <source>停障</source>
+        <translation>Stop Obs</translation>
+    </message>
+    <message>
+        <location filename="ADCIntelligentVehicle.ui" line="1071"/>
+        <source>避障</source>
+        <translation>Avoid Obs</translation>
+    </message>
+    <message>
+        <location filename="ADCIntelligentVehicle.ui" line="1084"/>
+        <source>特殊信号</source>
+        <translation>Special SIgnal</translation>
+    </message>
+    <message>
+        <location filename="ADCIntelligentVehicle.ui" line="1097"/>
+        <source>路边停车</source>
+        <translation>Side Stop</translation>
+    </message>
+    <message>
+        <location filename="ADCIntelligentVehicle.ui" line="1119"/>
+        <source>查看决策信息</source>
+        <translation>View Decison</translation>
+    </message>
+    <message>
+        <location filename="ADCIntelligentVehicle.ui" line="1140"/>
+        <source>mobileye信息</source>
+        <translation>Mobileye</translation>
+    </message>
+    <message>
+        <location filename="ADCIntelligentVehicle.ui" line="1157"/>
+        <source>交通灯调试</source>
+        <translation>Traffic Light Debug</translation>
+    </message>
+    <message>
+        <location filename="ADCIntelligentVehicle.ui" line="1211"/>
+        <source>编号</source>
+        <translation>Index</translation>
+    </message>
+    <message>
+        <location filename="ADCIntelligentVehicle.ui" line="1218"/>
+        <source>颜色</source>
+        <translation>Color</translation>
+    </message>
+    <message>
+        <location filename="ADCIntelligentVehicle.ui" line="1225"/>
+        <source>时长</source>
+        <translation>Duration</translation>
+    </message>
+    <message>
+        <location filename="ADCIntelligentVehicle.ui" line="1244"/>
+        <location filename="ADCIntelligentVehicle.ui" line="1492"/>
+        <source>设置纬度</source>
+        <translation>Set Latitude</translation>
+    </message>
+    <message>
+        <location filename="ADCIntelligentVehicle.ui" line="1266"/>
+        <location filename="ADCIntelligentVehicle.ui" line="1470"/>
+        <source>设置经度</source>
+        <translation>Set Loginitude</translation>
+    </message>
+    <message>
+        <location filename="ADCIntelligentVehicle.ui" line="1290"/>
+        <source>车辆信息</source>
+        <translation>Vehicle Info</translation>
+    </message>
+    <message>
+        <location filename="ADCIntelligentVehicle.ui" line="1340"/>
+        <source>车型</source>
+        <translation>Vehicle Type</translation>
+    </message>
+    <message>
+        <location filename="ADCIntelligentVehicle.ui" line="1353"/>
+        <source>剩余电量</source>
+        <translation>SOC</translation>
+    </message>
+    <message>
+        <location filename="ADCIntelligentVehicle.ui" line="1366"/>
+        <source>车长*车宽</source>
+        <translation>Length*Width</translation>
+    </message>
+    <message>
+        <location filename="ADCIntelligentVehicle.ui" line="1398"/>
+        <source>VIN</source>
+        <translation>VIN</translation>
+    </message>
+    <message>
+        <location filename="ADCIntelligentVehicle.ui" line="1429"/>
+        <source>泊车调试</source>
+        <translation>Park Debug</translation>
+    </message>
+    <message>
+        <location filename="ADCIntelligentVehicle.ui" line="1441"/>
+        <source>侧方停车</source>
+        <translation>Side Park</translation>
+    </message>
+    <message>
+        <location filename="ADCIntelligentVehicle.ui" line="1454"/>
+        <source>倒车入库</source>
+        <translation>Direct Park</translation>
+    </message>
+    <message>
+        <location filename="ADCIntelligentVehicle.ui" line="1514"/>
+        <source>设置航向角</source>
+        <translation>Set Heading</translation>
+    </message>
+    <message>
+        <location filename="ADCIntelligentVehicle.ui" line="1546"/>
+        <source>控制板调试</source>
+        <translation>Debug Board</translation>
+    </message>
+    <message>
+        <location filename="ADCIntelligentVehicle.ui" line="1566"/>
+        <location filename="ADCIntelligentVehicle.cpp" line="1470"/>
+        <source>决策控制使能:关</source>
+        <translation>Disable Dicision</translation>
+    </message>
+    <message>
+        <location filename="ADCIntelligentVehicle.ui" line="1584"/>
+        <location filename="ADCIntelligentVehicle.cpp" line="1479"/>
+        <source>左转向灯:关</source>
+        <translation>Stop Left Light</translation>
+    </message>
+    <message>
+        <location filename="ADCIntelligentVehicle.ui" line="1602"/>
+        <location filename="ADCIntelligentVehicle.cpp" line="1489"/>
+        <source>右转向灯:关</source>
+        <translation>Stop Right Light</translation>
+    </message>
+    <message>
+        <location filename="ADCIntelligentVehicle.ui" line="1620"/>
+        <location filename="ADCIntelligentVehicle.cpp" line="1498"/>
+        <source>喇叭</source>
+        <translation>Alarm</translation>
+    </message>
+    <message>
+        <location filename="ADCIntelligentVehicle.ui" line="1638"/>
+        <source>刹车</source>
+        <translation>Brake</translation>
+    </message>
+    <message>
+        <location filename="ADCIntelligentVehicle.ui" line="1656"/>
+        <source>油门</source>
+        <translation>Torque</translation>
+    </message>
+    <message>
+        <location filename="ADCIntelligentVehicle.ui" line="1674"/>
+        <source>转向</source>
+        <translation>Wheel</translation>
+    </message>
+    <message>
+        <location filename="ADCIntelligentVehicle.ui" line="1692"/>
+        <source>无法使用</source>
+        <translation>Can&apos;t Use</translation>
+    </message>
+    <message>
+        <location filename="ADCIntelligentVehicle.ui" line="1866"/>
+        <location filename="ADCIntelligentVehicle.cpp" line="1507"/>
+        <source>近光灯:关</source>
+        <translation>Dipped Light Close</translation>
+    </message>
+    <message>
+        <location filename="ADCIntelligentVehicle.ui" line="1884"/>
+        <location filename="ADCIntelligentVehicle.cpp" line="1519"/>
+        <source>点火:关</source>
+        <translation>Stop Ignition</translation>
+    </message>
+    <message>
+        <location filename="ADCIntelligentVehicle.ui" line="1905"/>
+        <source>驻车调试</source>
+        <translation>Park Debug</translation>
+    </message>
+    <message>
+        <location filename="ADCIntelligentVehicle.ui" line="1920"/>
+        <source>设置驻车时间</source>
+        <translation>Set Park Time</translation>
+    </message>
+    <message>
+        <location filename="ADCIntelligentVehicle.ui" line="1944"/>
+        <source>控制参数设置</source>
+        <translation>Set Ctrl Param</translation>
+    </message>
+    <message>
+        <location filename="ADCIntelligentVehicle.ui" line="1965"/>
+        <location filename="ADCIntelligentVehicle.ui" line="2086"/>
+        <location filename="ADCIntelligentVehicle.ui" line="2141"/>
+        <source>&lt;!DOCTYPE HTML PUBLIC &quot;-//W3C//DTD HTML 4.0//EN&quot; &quot;http://www.w3.org/TR/REC-html40/strict.dtd&quot;&gt;
+&lt;html&gt;&lt;head&gt;&lt;meta name=&quot;qrichtext&quot; content=&quot;1&quot; /&gt;&lt;style type=&quot;text/css&quot;&gt;
+p, li { white-space: pre-wrap; }
+&lt;/style&gt;&lt;/head&gt;&lt;body style=&quot; font-family:&apos;Ubuntu&apos;; font-size:11pt; font-weight:400; font-style:normal;&quot;&gt;
+&lt;p style=&quot;-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;&lt;br /&gt;&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</source>
+        <translation>&lt;!DOCTYPE HTML PUBLIC &quot;-//W3C//DTD HTML 4.0//EN&quot; &quot;http://www.w3.org/TR/REC-html40/strict.dtd&quot;&gt;
+&lt;html&gt;&lt;head&gt;&lt;meta name=&quot;qrichtext&quot; content=&quot;1&quot; /&gt;&lt;style type=&quot;text/css&quot;&gt;
+p, li { white-space: pre-wrap; }
+&lt;/style&gt;&lt;/head&gt;&lt;body style=&quot; font-family:&apos;Ubuntu&apos;; font-size:11pt; font-weight:400; font-style:normal;&quot;&gt;
+&lt;p style=&quot;-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;&lt;br /&gt;&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</translation>
+    </message>
+    <message>
+        <location filename="ADCIntelligentVehicle.ui" line="1982"/>
+        <source>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;&lt;span style=&quot; color:#eeeeec;&quot;&gt;停障触发距离&lt;/span&gt;&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</source>
+        <translation>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;&lt;span style=&quot; color:#eeeeec;&quot;&gt;Stop Trigger-Distance&lt;/span&gt;&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</translation>
+    </message>
+    <message>
+        <location filename="ADCIntelligentVehicle.ui" line="1995"/>
+        <source>保存</source>
+        <translation>Save</translation>
+    </message>
+    <message>
+        <location filename="ADCIntelligentVehicle.ui" line="2021"/>
+        <source>避障触发次数</source>
+        <translation>Avoid Trigger Times</translation>
+    </message>
+    <message>
+        <location filename="ADCIntelligentVehicle.ui" line="2034"/>
+        <source>避障触发距离</source>
+        <translation>Avoid Trigger Distance</translation>
+    </message>
+    <message>
+        <location filename="ADCIntelligentVehicle.ui" line="2047"/>
+        <source>避障保障距离</source>
+        <translation>Avoid Ensure Distance</translation>
+    </message>
+    <message>
+        <location filename="ADCIntelligentVehicle.ui" line="2190"/>
+        <source>激光雷达可应用于车辆对周围360度环境感知,内参标定对感知的准确性有重要作用。</source>
+        <translation>Lidar Used for 360 view.</translation>
+    </message>
+    <message>
+        <location filename="ADCIntelligentVehicle.ui" line="2206"/>
+        <source>激光雷达角度</source>
+        <translation>Lidar Angle</translation>
+    </message>
+    <message>
+        <location filename="ADCIntelligentVehicle.ui" line="2235"/>
+        <source>单位:m          范围:10~40</source>
+        <translation>Unit:m Range 10~40</translation>
+    </message>
+    <message>
+        <location filename="ADCIntelligentVehicle.ui" line="2248"/>
+        <source>单位:m          范围:15~40</source>
+        <translation>Unit:m       Range:15~40</translation>
+    </message>
+    <message>
+        <location filename="ADCIntelligentVehicle.ui" line="2261"/>
+        <source>单位:次         范围:1 ~ 40</source>
+        <translation>Unit:Times      Range:1~40</translation>
+    </message>
+    <message>
+        <location filename="ADCIntelligentVehicle.ui" line="2274"/>
+        <source>单位:m          范围:5 ~ 30</source>
+        <translation>Unit:m        Range:5~30</translation>
+    </message>
+    <message>
+        <location filename="ADCIntelligentVehicle.ui" line="2287"/>
+        <source>单位: °           范围:0~360</source>
+        <translation>Unit:         Range:0~360</translation>
+    </message>
+    <message>
+        <location filename="ADCIntelligentVehicle.ui" line="2300"/>
+        <source>恢复默认值</source>
+        <translation>Reset Default</translation>
+    </message>
+    <message>
+        <location filename="ADCIntelligentVehicle.ui" line="2344"/>
+        <source>小巴调试</source>
+        <translation>Debug Problue</translation>
+    </message>
+    <message>
+        <location filename="ADCIntelligentVehicle.ui" line="2359"/>
+        <source>车门开</source>
+        <translation>Open Door</translation>
+    </message>
+    <message>
+        <location filename="ADCIntelligentVehicle.ui" line="2366"/>
+        <source>车门关</source>
+        <translation>Close Door</translation>
+    </message>
+    <message>
+        <location filename="ADCIntelligentVehicle.ui" line="2373"/>
+        <source>近光灯开</source>
+        <translation>Open Headlight</translation>
+    </message>
+    <message>
+        <location filename="ADCIntelligentVehicle.ui" line="2380"/>
+        <source>近光灯关</source>
+        <translation>Close Headlight</translation>
+    </message>
+    <message>
+        <location filename="ADCIntelligentVehicle.ui" line="2387"/>
+        <source>远光灯开</source>
+        <translation>Open HighLight</translation>
+    </message>
+    <message>
+        <location filename="ADCIntelligentVehicle.ui" line="2394"/>
+        <source>远光灯关</source>
+        <translation>Close HighLight</translation>
+    </message>
+    <message>
+        <location filename="ADCIntelligentVehicle.ui" line="2428"/>
+        <source>中国汽车技术研究中心-数据资源中心</source>
+        <translation>Catarc-ADC</translation>
+    </message>
+    <message>
+        <location filename="ADCIntelligentVehicle.ui" line="2444"/>
+        <source>商务合作</source>
+        <translation>Cooperation</translation>
+    </message>
+    <message>
+        <location filename="ADCIntelligentVehicle.ui" line="2460"/>
+        <source>技术支持</source>
+        <translation>Technique Support</translation>
+    </message>
+    <message>
+        <location filename="ADCIntelligentVehicle.ui" line="2477"/>
+        <source>毫米波显示</source>
+        <translation>Radar</translation>
+    </message>
+    <message>
+        <location filename="ADCIntelligentVehicle.ui" line="2496"/>
+        <source>激光显示</source>
+        <translation>LIDAR</translation>
+    </message>
+    <message>
+        <location filename="ADCIntelligentVehicle.ui" line="2515"/>
+        <source>融合显示</source>
+        <translation>Fusion</translation>
+    </message>
+    <message>
+        <location filename="ADCIntelligentVehicle.cpp" line="739"/>
+        <source>前方没有障碍物</source>
+        <translation>No Obstacle</translation>
+    </message>
+    <message>
+        <location filename="ADCIntelligentVehicle.cpp" line="1047"/>
+        <source>退出程序</source>
+        <translation>Exit Program</translation>
+    </message>
+    <message>
+        <location filename="ADCIntelligentVehicle.cpp" line="1047"/>
+        <source>确认退出程序</source>
+        <translation>Confirm Exit Program</translation>
+    </message>
+    <message>
+        <location filename="ADCIntelligentVehicle.cpp" line="1221"/>
+        <source>等待车辆实时GPS位置信息</source>
+        <translation>Wait GPS</translation>
+    </message>
+    <message>
+        <location filename="ADCIntelligentVehicle.cpp" line="1470"/>
+        <source>决策控制使能:开</source>
+        <translation>Enable Decision</translation>
+    </message>
+    <message>
+        <location filename="ADCIntelligentVehicle.cpp" line="1479"/>
+        <source>左转向灯:开</source>
+        <translation>Open Left Light</translation>
+    </message>
+    <message>
+        <location filename="ADCIntelligentVehicle.cpp" line="1489"/>
+        <source>右转向灯:开</source>
+        <translation>Open Right Light</translation>
+    </message>
+    <message>
+        <location filename="ADCIntelligentVehicle.cpp" line="1507"/>
+        <source>近光灯:开</source>
+        <translation>Open HeadLight</translation>
+    </message>
+    <message>
+        <location filename="ADCIntelligentVehicle.cpp" line="1519"/>
+        <source>点火:开</source>
+        <translation>Open Ignition</translation>
+    </message>
+    <message>
+        <location filename="ADCIntelligentVehicle.cpp" line="2307"/>
+        <source>云平台控制:关</source>
+        <translation>Close Cloud</translation>
+    </message>
+    <message>
+        <location filename="ADCIntelligentVehicle.cpp" line="2311"/>
+        <source>云平台控制:开</source>
+        <translation>Open Cloud</translation>
+    </message>
+</context>
+<context>
+    <name>Look_decition</name>
+    <message>
+        <location filename="look.cpp" line="82"/>
+        <source>决策观察器</source>
+        <translation>Decison Look</translation>
+    </message>
+    <message>
+        <location filename="look.cpp" line="83"/>
+        <source>油门</source>
+        <translation>Torque</translation>
+    </message>
+    <message>
+        <location filename="look.cpp" line="84"/>
+        <source>刹车</source>
+        <translation>Brake</translation>
+    </message>
+    <message>
+        <location filename="look.cpp" line="85"/>
+        <source>转向</source>
+        <translation>Wheel</translation>
+    </message>
+    <message>
+        <location filename="look.cpp" line="86"/>
+        <source>速度</source>
+        <translation>Speed</translation>
+    </message>
+    <message>
+        <location filename="look.cpp" line="87"/>
+        <source>激光雷达距离</source>
+        <translation>Lidar Distance</translation>
+    </message>
+    <message>
+        <location filename="look.cpp" line="88"/>
+        <source>毫米波距离</source>
+        <translation>Radar Distance</translation>
+    </message>
+    <message>
+        <location filename="look.cpp" line="89"/>
+        <source>最终obs距离</source>
+        <translation>Final Obs Distance</translation>
+    </message>
+    <message>
+        <location filename="look.cpp" line="90"/>
+        <source>纬度</source>
+        <translation>Latitude</translation>
+    </message>
+    <message>
+        <location filename="look.cpp" line="91"/>
+        <source>精度</source>
+        <translation>Longitude</translation>
+    </message>
+    <message>
+        <location filename="look.cpp" line="92"/>
+        <location filename="look.cpp" line="93"/>
+        <source>保留</source>
+        <translation>Reserve</translation>
+    </message>
+</context>
+<context>
+    <name>Mobileye_info</name>
+    <message>
+        <location filename="mobileye_info.cpp" line="709"/>
+        <source>mobileye_info</source>
+        <translation>mobileye_info</translation>
+    </message>
+    <message>
+        <location filename="mobileye_info.cpp" line="710"/>
+        <source>dusk_time</source>
+        <translation>dusk_time</translation>
+    </message>
+    <message>
+        <location filename="mobileye_info.cpp" line="711"/>
+        <source>lane</source>
+        <translation>lane</translation>
+    </message>
+    <message>
+        <location filename="mobileye_info.cpp" line="712"/>
+        <source>curvature</source>
+        <translation>curvature</translation>
+    </message>
+    <message>
+        <location filename="mobileye_info.cpp" line="713"/>
+        <source>heading</source>
+        <translation>heading</translation>
+    </message>
+    <message>
+        <location filename="mobileye_info.cpp" line="714"/>
+        <source>yaw</source>
+        <translation>yaw</translation>
+    </message>
+    <message>
+        <location filename="mobileye_info.cpp" line="715"/>
+        <source>pitch</source>
+        <translation>pitch</translation>
+    </message>
+    <message>
+        <location filename="mobileye_info.cpp" line="716"/>
+        <source>dist_to_l</source>
+        <translation>dist_to_l</translation>
+    </message>
+    <message>
+        <location filename="mobileye_info.cpp" line="717"/>
+        <source>dist_to_r</source>
+        <translation>dist_to_r</translation>
+    </message>
+    <message>
+        <location filename="mobileye_info.cpp" line="718"/>
+        <source>left_type</source>
+        <translation>left_type</translation>
+    </message>
+    <message>
+        <location filename="mobileye_info.cpp" line="719"/>
+        <source>right_type</source>
+        <translation>right_type</translation>
+    </message>
+    <message>
+        <location filename="mobileye_info.cpp" line="720"/>
+        <source>num_obstacles</source>
+        <translation>num_obstacles</translation>
+    </message>
+    <message>
+        <location filename="mobileye_info.cpp" line="721"/>
+        <source>timestamp</source>
+        <translation>timestamp</translation>
+    </message>
+    <message>
+        <location filename="mobileye_info.cpp" line="722"/>
+        <source>ID</source>
+        <translation>ID</translation>
+    </message>
+    <message>
+        <location filename="mobileye_info.cpp" line="723"/>
+        <source>pos_x</source>
+        <translation>pos_x</translation>
+    </message>
+    <message>
+        <location filename="mobileye_info.cpp" line="724"/>
+        <source>pos_y</source>
+        <translation>pos_y</translation>
+    </message>
+    <message>
+        <location filename="mobileye_info.cpp" line="725"/>
+        <source>rel_vel_x</source>
+        <translation>rel_vel_x</translation>
+    </message>
+    <message>
+        <location filename="mobileye_info.cpp" line="726"/>
+        <source>status</source>
+        <translation>status</translation>
+    </message>
+    <message>
+        <location filename="mobileye_info.cpp" line="727"/>
+        <source>type</source>
+        <translation>type</translation>
+    </message>
+    <message>
+        <location filename="mobileye_info.cpp" line="728"/>
+        <source>brake_lights</source>
+        <translation>brake_lights</translation>
+    </message>
+    <message>
+        <location filename="mobileye_info.cpp" line="729"/>
+        <source>length</source>
+        <translation>length</translation>
+    </message>
+    <message>
+        <location filename="mobileye_info.cpp" line="730"/>
+        <source>width</source>
+        <translation>width</translation>
+    </message>
+    <message>
+        <location filename="mobileye_info.cpp" line="731"/>
+        <source>age</source>
+        <translation>age</translation>
+    </message>
+    <message>
+        <location filename="mobileye_info.cpp" line="732"/>
+        <source>angle_rate</source>
+        <translation>angle_rate</translation>
+    </message>
+    <message>
+        <location filename="mobileye_info.cpp" line="733"/>
+        <source>angle</source>
+        <translation>angle</translation>
+    </message>
+    <message>
+        <location filename="mobileye_info.cpp" line="734"/>
+        <source>accel_x</source>
+        <translation>accel_x</translation>
+    </message>
+</context>
+</TS>

Some files were not shown because too many files changed in this diff