Переглянути джерело

change src1/driver/driver_gps_hcp2. complete new version driver hcp2.

yuchuli 3 роки тому
батько
коміт
a26a637fc9

+ 2 - 1
src1/driver/driver_gps_hcp2/ivdriver_gps_hcp2.cpp

@@ -4,8 +4,9 @@
 
 namespace iv {
 
-ivdriver_gps_hcp2::ivdriver_gps_hcp2()
+ivdriver_gps_hcp2::ivdriver_gps_hcp2(std::string strxmlpath)
 {
+    loadxmlparam(strxmlpath);
     mTime.start();
 }
 

+ 1 - 1
src1/driver/driver_gps_hcp2/ivdriver_gps_hcp2.h

@@ -9,7 +9,7 @@ namespace iv {
 class ivdriver_gps_hcp2 : public ivdriver_gps
 {
 public:
-    ivdriver_gps_hcp2();
+    ivdriver_gps_hcp2(std::string strxmlpath);
     virtual int decode(iv::gps::gpsimu & xgpsimu);
 
 private:

+ 8 - 1
src1/driver/driver_gps_hcp2/main.cpp

@@ -7,7 +7,14 @@ int main(int argc, char *argv[])
 {
     QCoreApplication a(argc, argv);
 
-    iv::ivmodule * pivmodule = new iv::ivdriver_gps_hcp2();
+    QString strpath = QCoreApplication::applicationDirPath();
+    if(argc < 2)
+        strpath = strpath + "/hcp2.xml";
+    else
+        strpath = argv[1];
+    std::cout<<strpath.toStdString()<<std::endl;
+
+    iv::ivmodule * pivmodule = new iv::ivdriver_gps_hcp2(strpath.toStdString());
     pivmodule->start();
 
     return a.exec();

+ 3 - 1
src1/driver/interface/ivdriver_gps.cpp

@@ -8,6 +8,8 @@ namespace iv {
 
 ivdriver_gps::ivdriver_gps()
 {
+    mudpSocketGPSIMU = new QUdpSocket();
+
 
 }
 
@@ -108,7 +110,7 @@ void ivdriver_gps::modulerun()
     m_serialPort_GPS->setReadBufferSize(0);
 
 
-    mudpSocketGPSIMU = new QUdpSocket();
+
 
     mbrun = true;