Browse Source

UI工程添加对地图的自动请求功能

fujiankuan 4 years ago
parent
commit
74953dfa01

+ 25 - 0
src/ui/ui_ads_hmi/ADCIntelligentVehicle.cpp

@@ -334,6 +334,11 @@ ADCIntelligentVehicle::ADCIntelligentVehicle(QWidget *parent)
 //    timermanualctrl->start(10);
 
     //connect(ui->lineEdit_6, SIGNAL(textEdited(const QString &)), this, SLOT(savestabuyEditinfo(const QString &)));
+
+    mpamapreq = iv::modulecomm::RegisterSend("mapreq",1000,1);
+    shareMapReqMsg();
+
+
 }
 
 /**
@@ -1842,3 +1847,23 @@ void ADCIntelligentVehicle::on_pb_v2xEn_clicked()
     gIvlog->info("hmi","v2x enable:%d", mv2xStEn);
     UpdateV2xStEn(mv2xStEn);
 }
+
+
+void ADCIntelligentVehicle::shareMapReqMsg()
+{
+
+    iv::map::mapreq x;
+    x.set_maptype(1);
+    int nsize = x.ByteSize();
+    char * str = new char[nsize];
+    if(x.SerializeToArray(str,nsize))
+    {
+        iv::modulecomm::ModuleSendMsg(mpamapreq,str,nsize);
+    }
+    else
+    {
+        std::cout<<"iv::map::mapreq serialize error."<<std::endl;
+    }
+    std::cout<<"iv::map::mapreq serialize OK."<<std::endl;
+    delete str;
+}

+ 6 - 0
src/ui/ui_ads_hmi/ADCIntelligentVehicle.h

@@ -61,6 +61,8 @@
 #include "canstate.pb.h"
 #include "v2x.pb.h"
 #include "ivlog.h"
+#include "mapreq.pb.h"
+
 extern iv::Ivlog * gIvlog;
 
 #define USE_PAD_CTRL
@@ -330,6 +332,10 @@ private:
     iv::Ivlog * mpivlog;
 
     //     iv::platform::Client mplatform_client;
+
+public:
+    void * mpamapreq;   //请求地图
+    void shareMapReqMsg();
 };
 
 

+ 4 - 2
src/ui/ui_ads_hmi/ui_ads_hmi.pro

@@ -50,7 +50,8 @@ SOURCES += \
     ../../include/msgtype/gpsimu.pb.cc \
     ../../include/msgtype/canstate.pb.cc \
     ../../include/msgtype/v2x.pb.cc \
-    ../../include/msgtype/chassis.pb.cc
+    ../../include/msgtype/chassis.pb.cc \
+    ../../include/msgtype/mapreq.pb.cc
 
 HEADERS += \
         ADCIntelligentVehicle.h \
@@ -67,7 +68,8 @@ HEADERS += \
     ../../include/msgtype/canstate.pb.h \
     ../../include/msgtype/gpsimu.pb.h \
     ../../include/msgtype/v2x.pb.h \
-    ../../include/msgtype/chassis.pb.h
+    ../../include/msgtype/chassis.pb.h \
+    ../../include/msgtype/mapreq.pb.h
 
 
 FORMS += \