Ver código fonte

change map_lanetoxodr. change some code for compile in qt6.

yuchuli 1 mês atrás
pai
commit
f2df0ad57f

+ 74 - 0
src/controller/controller_chery_sterra_es/.gitignore

@@ -0,0 +1,74 @@
+# This file is used to ignore files which are generated
+# ----------------------------------------------------------------------------
+
+*~
+*.autosave
+*.a
+*.core
+*.moc
+*.o
+*.obj
+*.orig
+*.rej
+*.so
+*.so.*
+*_pch.h.cpp
+*_resource.rc
+*.qm
+.#*
+*.*#
+core
+!core/
+tags
+.DS_Store
+.directory
+*.debug
+Makefile*
+*.prl
+*.app
+moc_*.cpp
+ui_*.h
+qrc_*.cpp
+Thumbs.db
+*.res
+*.rc
+/.qmake.cache
+/.qmake.stash
+
+# qtcreator generated files
+*.pro.user*
+CMakeLists.txt.user*
+
+# xemacs temporary files
+*.flc
+
+# Vim temporary files
+.*.swp
+
+# Visual Studio generated files
+*.ib_pdb_index
+*.idb
+*.ilk
+*.pdb
+*.sln
+*.suo
+*.vcproj
+*vcproj.*.*.user
+*.ncb
+*.sdf
+*.opensdf
+*.vcxproj
+*vcxproj.*
+
+# MinGW generated files
+*.Debug
+*.Release
+
+# Python byte code
+*.pyc
+
+# Binaries
+# --------
+*.dll
+*.exe
+

+ 15 - 0
src/controller/controller_chery_sterra_es/controller_chery_sterra_es.pro

@@ -0,0 +1,15 @@
+QT = core
+
+CONFIG += c++17 cmdline
+
+# You can make your code fail to compile if it uses deprecated APIs.
+# In order to do so, uncomment the following line.
+#DEFINES += QT_DISABLE_DEPRECATED_BEFORE=0x060000    # disables all the APIs deprecated before Qt 6.0.0
+
+SOURCES += \
+        main.cpp
+
+# Default rules for deployment.
+qnx: target.path = /tmp/$${TARGET}/bin
+else: unix:!android: target.path = /opt/$${TARGET}/bin
+!isEmpty(target.path): INSTALLS += target

+ 8 - 0
src/controller/controller_chery_sterra_es/main.cpp

@@ -0,0 +1,8 @@
+#include <QCoreApplication>
+
+int main(int argc, char *argv[])
+{
+    QCoreApplication a(argc, argv);
+
+    return a.exec();
+}

+ 9 - 0
src/tool/map_lanetoxodr/function/filebackup.cpp

@@ -12,12 +12,21 @@ FileBackup::FileBackup()
 FileBackup::~FileBackup()
 {
     this->requestInterruption();
+#ifdef ADCQT6
+    int64_t nstart = std::chrono::system_clock::now().time_since_epoch().count();
+    int64_t nnow =  std::chrono::system_clock::now().time_since_epoch().count();
+    while((abs((nnow - nstart)/1e6)<200)&&(mbComplete == false))
+    {
+        nnow =  std::chrono::system_clock::now().time_since_epoch().count();
+    }
+#else
     QTime xTime;
     xTime.start();
     while((xTime.elapsed()<200)&&(mbComplete == false))
     {
 
     }
+#endif
 }
 
 void FileBackup::SetOpenDrive(OpenDrive &xxodr)

+ 13 - 0
src/tool/map_lanetoxodr/function/ndsdataproc.cpp

@@ -4,6 +4,10 @@
 #include "gnss_coordinate_convert.h"
 #include <QDateTime>
 
+#ifdef ADCQT6
+#include <QRegularExpression>
+#endif
+
 #include <QPointF>
 
 #include "geofit.h"
@@ -67,7 +71,12 @@ int NDSDataProc::ProcNDSData(std::string strlinepath,std::string strvehiclepath,
         QString x(baline[i]);
         x = x.trimmed();
         //         QList<QByteArray> badata = baline[i].split('\t');
+#ifdef  ADCQT6
+        QStringList badata = x.split(QRegularExpression("[,]"));
+#else
         QStringList badata = x.split(QRegExp("[,]"));
+#endif
+
 
         if(badata.size()>=36)
         {
@@ -116,7 +125,11 @@ int NDSDataProc::ProcNDSData(std::string strlinepath,std::string strvehiclepath,
         QString x(baline[i]);
         x = x.trimmed();
         //         QList<QByteArray> badata = baline[i].split('\t');
+#ifdef  ADCQT6
+        QStringList badata = x.split(QRegularExpression("[,]"));
+#else
         QStringList badata = x.split(QRegExp("[,]"));
+#endif
 
         if(badata.size()>=15)
         {

+ 12 - 3
src/tool/map_lanetoxodr/mainwindow.cpp

@@ -119,12 +119,13 @@ void MainWindow::AdjustWPos(QSize sizemain)
 
 void MainWindow::ExecPainter()
 {
-    QTime x;
-    x.start();
+ //   QTime x;
+
+//    x.start();
     //    qDebug("painter.");
 
    painter->begin(image);
-        qDebug("time is %d",x.elapsed());
+ //       qDebug("time is %d",x.elapsed());
         image->fill(QColor(255, 255, 255));//对画布进行填充
 
     //    std::vector<iv::GPSData> navigation_data = brain->navigation_data;
@@ -1559,14 +1560,22 @@ void MainWindow::onClickLoadLane()
         QByteArray ba;
         ba = xFile.read(xFile.size());
         QString strdata = ba;
+#ifdef ADCQT6
+        QStringList strlinedata=  strdata.split("\n",Qt::SplitBehaviorFlags::SkipEmptyParts);
+#else
         QStringList strlinedata=  strdata.split("\n",QString::SkipEmptyParts);
+#endif
         int i;
         int nsize = strlinedata.size();
 //        qDebug("line is %d",nsize);
         for(i=0;i<nsize;i++)
         {
             QString strline = strlinedata.at(i);
+#ifdef ADCQT6
+            QStringList strvaluedata = strline.split(" ",Qt::SplitBehaviorFlags::SkipEmptyParts);
+#else
             QStringList strvaluedata = strline.split(" ",QString::SkipEmptyParts);
+#endif
 //            qDebug("%d value size is %d ",i,strvaluedata.size());
             iv::lanepoint lpleft,lpright;
             if(strvaluedata.size() == 12)

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

@@ -8,6 +8,8 @@ QT       += core gui
 
 greaterThan(QT_MAJOR_VERSION, 4): QT += widgets
 
+greaterThan(QT_MAJOR_VERSION, 5): DEFINES += ADCQT6
+
 TARGET = map_lanetoxodr
 TEMPLATE = app
 

+ 1 - 1
src/tool/map_lanetoxodr/ui/roadeditdialog.ui

@@ -381,7 +381,7 @@
     <rect>
      <x>726</x>
      <y>261</y>
-     <width>221</width>
+     <width>211</width>
      <height>41</height>
     </rect>
    </property>