Browse Source

add adciv_maketool, not complete.

yuchuli 1 year ago
parent
commit
abe5217a38

+ 0 - 165
deploy/LGPL/LGPL-3

@@ -1,165 +0,0 @@
-                   GNU LESSER GENERAL PUBLIC LICENSE
-                       Version 3, 29 June 2007
-
- Copyright (C) 2007 Free Software Foundation, Inc. <http://fsf.org/>
- Everyone is permitted to copy and distribute verbatim copies
- of this license document, but changing it is not allowed.
-
-
-  This version of the GNU Lesser General Public License incorporates
-the terms and conditions of version 3 of the GNU General Public
-License, supplemented by the additional permissions listed below.
-
-  0. Additional Definitions.
-
-  As used herein, "this License" refers to version 3 of the GNU Lesser
-General Public License, and the "GNU GPL" refers to version 3 of the GNU
-General Public License.
-
-  "The Library" refers to a covered work governed by this License,
-other than an Application or a Combined Work as defined below.
-
-  An "Application" is any work that makes use of an interface provided
-by the Library, but which is not otherwise based on the Library.
-Defining a subclass of a class defined by the Library is deemed a mode
-of using an interface provided by the Library.
-
-  A "Combined Work" is a work produced by combining or linking an
-Application with the Library.  The particular version of the Library
-with which the Combined Work was made is also called the "Linked
-Version".
-
-  The "Minimal Corresponding Source" for a Combined Work means the
-Corresponding Source for the Combined Work, excluding any source code
-for portions of the Combined Work that, considered in isolation, are
-based on the Application, and not on the Linked Version.
-
-  The "Corresponding Application Code" for a Combined Work means the
-object code and/or source code for the Application, including any data
-and utility programs needed for reproducing the Combined Work from the
-Application, but excluding the System Libraries of the Combined Work.
-
-  1. Exception to Section 3 of the GNU GPL.
-
-  You may convey a covered work under sections 3 and 4 of this License
-without being bound by section 3 of the GNU GPL.
-
-  2. Conveying Modified Versions.
-
-  If you modify a copy of the Library, and, in your modifications, a
-facility refers to a function or data to be supplied by an Application
-that uses the facility (other than as an argument passed when the
-facility is invoked), then you may convey a copy of the modified
-version:
-
-   a) under this License, provided that you make a good faith effort to
-   ensure that, in the event an Application does not supply the
-   function or data, the facility still operates, and performs
-   whatever part of its purpose remains meaningful, or
-
-   b) under the GNU GPL, with none of the additional permissions of
-   this License applicable to that copy.
-
-  3. Object Code Incorporating Material from Library Header Files.
-
-  The object code form of an Application may incorporate material from
-a header file that is part of the Library.  You may convey such object
-code under terms of your choice, provided that, if the incorporated
-material is not limited to numerical parameters, data structure
-layouts and accessors, or small macros, inline functions and templates
-(ten or fewer lines in length), you do both of the following:
-
-   a) Give prominent notice with each copy of the object code that the
-   Library is used in it and that the Library and its use are
-   covered by this License.
-
-   b) Accompany the object code with a copy of the GNU GPL and this license
-   document.
-
-  4. Combined Works.
-
-  You may convey a Combined Work under terms of your choice that,
-taken together, effectively do not restrict modification of the
-portions of the Library contained in the Combined Work and reverse
-engineering for debugging such modifications, if you also do each of
-the following:
-
-   a) Give prominent notice with each copy of the Combined Work that
-   the Library is used in it and that the Library and its use are
-   covered by this License.
-
-   b) Accompany the Combined Work with a copy of the GNU GPL and this license
-   document.
-
-   c) For a Combined Work that displays copyright notices during
-   execution, include the copyright notice for the Library among
-   these notices, as well as a reference directing the user to the
-   copies of the GNU GPL and this license document.
-
-   d) Do one of the following:
-
-       0) Convey the Minimal Corresponding Source under the terms of this
-       License, and the Corresponding Application Code in a form
-       suitable for, and under terms that permit, the user to
-       recombine or relink the Application with a modified version of
-       the Linked Version to produce a modified Combined Work, in the
-       manner specified by section 6 of the GNU GPL for conveying
-       Corresponding Source.
-
-       1) Use a suitable shared library mechanism for linking with the
-       Library.  A suitable mechanism is one that (a) uses at run time
-       a copy of the Library already present on the user's computer
-       system, and (b) will operate properly with a modified version
-       of the Library that is interface-compatible with the Linked
-       Version.
-
-   e) Provide Installation Information, but only if you would otherwise
-   be required to provide such information under section 6 of the
-   GNU GPL, and only to the extent that such information is
-   necessary to install and execute a modified version of the
-   Combined Work produced by recombining or relinking the
-   Application with a modified version of the Linked Version. (If
-   you use option 4d0, the Installation Information must accompany
-   the Minimal Corresponding Source and Corresponding Application
-   Code. If you use option 4d1, you must provide the Installation
-   Information in the manner specified by section 6 of the GNU GPL
-   for conveying Corresponding Source.)
-
-  5. Combined Libraries.
-
-  You may place library facilities that are a work based on the
-Library side by side in a single library together with other library
-facilities that are not Applications and are not covered by this
-License, and convey such a combined library under terms of your
-choice, if you do both of the following:
-
-   a) Accompany the combined library with a copy of the same work based
-   on the Library, uncombined with any other library facilities,
-   conveyed under the terms of this License.
-
-   b) Give prominent notice with the combined library that part of it
-   is a work based on the Library, and explaining where to find the
-   accompanying uncombined form of the same work.
-
-  6. Revised Versions of the GNU Lesser General Public License.
-
-  The Free Software Foundation may publish revised and/or new versions
-of the GNU Lesser General Public License from time to time. Such new
-versions will be similar in spirit to the present version, but may
-differ in detail to address new problems or concerns.
-
-  Each version is given a distinguishing version number. If the
-Library as you received it specifies that a certain numbered version
-of the GNU Lesser General Public License "or any later version"
-applies to it, you have the option of following the terms and
-conditions either of that published version or of any later version
-published by the Free Software Foundation. If the Library as you
-received it does not specify a version number of the GNU Lesser
-General Public License, you may choose any version of the GNU Lesser
-General Public License ever published by the Free Software Foundation.
-
-  If the Library as you received it specifies that a proxy can decide
-whether future versions of the GNU Lesser General Public License shall
-apply, that proxy's public statement of acceptance of any version is
-permanent authorization for you to choose that version for the
-Library.

+ 0 - 2
deploy/LGPL/Readme.txt

@@ -1,2 +0,0 @@
-1.本软件使用Qt开发,遵守LGPL v3协议。
-2.本软件用到了QtCore,QtNetWork,QtWidget等Qt库。

+ 4 - 0
src/common/common/xodr/xodrfunc/xodrfunc.cpp

@@ -12,7 +12,9 @@
 #include <QDebug>
 #include <QPointF>
 
+#ifndef XODRLOAD
 #include "geofit.h"
+#endif
 
 xodrfunc::xodrfunc()
 {
@@ -1473,6 +1475,7 @@ Lane * xodrfunc::GetLaneByID(LaneSection *pLS, int nlane)
     return 0;
 }
 
+#ifndef XODRLOAD
 int xodrfunc::optimizeroad(Road * pRoad,const double maxopvalue)
 {
     int ngeobsize = static_cast<int>(pRoad->GetGeometryBlockCount());
@@ -1734,3 +1737,4 @@ int xodrfunc::optimizeroad(Road * pRoad,const double maxopvalue)
     return 0;
 
 }
+#endif

+ 2 - 0
src/common/common/xodr/xodrfunc/xodrfunc.h

@@ -83,7 +83,9 @@ public:
     static int GetDrivingLane(Road * pRoad,const int nLS,const int nsuggestlane);
     static Lane * GetLaneByID(LaneSection * pLS,int nlane);
 
+#ifndef XODRLOAD
     static int optimizeroad(Road * pRoad,const double maxopvalue = 0.1);
+#endif
 };
 
 #endif // XODRFUNC_H

+ 2 - 0
src/driver/driver_map_xodrload/driver_map_xodrload.pro

@@ -95,6 +95,8 @@ LIBS += /home/nvidia/Downloads/proj-8.2.1/build/lib/libproj.so.22
 }
 
 
+DEFINES += XODRLOAD
+
 #DEFINES += TESTSPEEDPLAN
 
 #LIBS += -lproj

+ 74 - 0
src/tool/adciv_maketool/.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
+

+ 29 - 0
src/tool/adciv_maketool/adciv_maketool.pro

@@ -0,0 +1,29 @@
+QT       += core gui
+
+greaterThan(QT_MAJOR_VERSION, 4): QT += widgets
+
+CONFIG += c++17
+
+# 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 \
+    mainwindow.cpp \
+    threadfindqmake.cpp
+
+HEADERS += \
+    mainwindow.h \
+    threadfindqmake.h
+
+FORMS += \
+    mainwindow.ui
+
+# Default rules for deployment.
+qnx: target.path = /tmp/$${TARGET}/bin
+else: unix:!android: target.path = /opt/$${TARGET}/bin
+!isEmpty(target.path): INSTALLS += target
+
+RESOURCES += \
+    maketool.qrc

+ 29 - 0
src/tool/adciv_maketool/findqmake.sh

@@ -0,0 +1,29 @@
+qtmake=" "
+
+if [ ${#qtmake} -lt 5 ]; then
+  echo "now need find qmake "
+  optfiles=`find /opt -name 'qmake'` 
+  for entry in $optfiles
+  do
+     x=${entry:0-17:17}
+     if [ "$x" == "/gcc_64/bin/qmake" ];  then
+        qtmake="$entry"
+	echo "  -----find qmake"
+	echo "$qtmake"
+     fi
+  done
+fi
+
+if [ ${#qtmake} -lt 5 ]; then
+  echo "maybe agx,find qmake in usr folder "
+  optfiles=`find /usr -name 'qmake'` 
+  for entry in $optfiles
+  do
+     x=${entry:0-14:14}
+     if [ "$x" == "/qt5/bin/qmake" ];  then
+        qtmake="$entry"
+	echo "  -----find qmake"
+	echo "$qtmake"
+     fi
+  done
+fi

+ 11 - 0
src/tool/adciv_maketool/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();
+}

+ 26 - 0
src/tool/adciv_maketool/mainwindow.cpp

@@ -0,0 +1,26 @@
+#include "mainwindow.h"
+#include "ui_mainwindow.h"
+
+
+MainWindow::MainWindow(QWidget *parent)
+    : QMainWindow(parent)
+    , ui(new Ui::MainWindow)
+{
+    ui->setupUi(this);
+
+    setWindowTitle("IV Make Tool");
+
+    ThreadFindQMake * px = new ThreadFindQMake();
+}
+
+MainWindow::~MainWindow()
+{
+    delete ui;
+}
+
+
+void MainWindow::on_pushButton_findqmake_clicked()
+{
+    ui->pushButton_findqmake->setEnabled(false);
+}
+

+ 26 - 0
src/tool/adciv_maketool/mainwindow.h

@@ -0,0 +1,26 @@
+#ifndef MAINWINDOW_H
+#define MAINWINDOW_H
+
+#include <QMainWindow>
+
+#include "threadfindqmake.h"
+
+QT_BEGIN_NAMESPACE
+namespace Ui { class MainWindow; }
+QT_END_NAMESPACE
+
+class MainWindow : public QMainWindow
+{
+    Q_OBJECT
+
+public:
+    MainWindow(QWidget *parent = nullptr);
+    ~MainWindow();
+
+private slots:
+    void on_pushButton_findqmake_clicked();
+
+private:
+    Ui::MainWindow *ui;
+};
+#endif // MAINWINDOW_H

+ 68 - 0
src/tool/adciv_maketool/mainwindow.ui

@@ -0,0 +1,68 @@
+<?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>800</width>
+    <height>600</height>
+   </rect>
+  </property>
+  <property name="windowTitle">
+   <string>MainWindow</string>
+  </property>
+  <widget class="QWidget" name="centralwidget">
+   <widget class="QPushButton" name="pushButton_findqmake">
+    <property name="geometry">
+     <rect>
+      <x>530</x>
+      <y>40</y>
+      <width>221</width>
+      <height>41</height>
+     </rect>
+    </property>
+    <property name="text">
+     <string>Auto Find qmake</string>
+    </property>
+   </widget>
+   <widget class="QLineEdit" name="lineEdit_qmakepath">
+    <property name="geometry">
+     <rect>
+      <x>170</x>
+      <y>40</y>
+      <width>331</width>
+      <height>41</height>
+     </rect>
+    </property>
+   </widget>
+   <widget class="QLabel" name="label">
+    <property name="geometry">
+     <rect>
+      <x>20</x>
+      <y>50</y>
+      <width>131</width>
+      <height>31</height>
+     </rect>
+    </property>
+    <property name="text">
+     <string>qmake  path:</string>
+    </property>
+   </widget>
+  </widget>
+  <widget class="QMenuBar" name="menubar">
+   <property name="geometry">
+    <rect>
+     <x>0</x>
+     <y>0</y>
+     <width>800</width>
+     <height>27</height>
+    </rect>
+   </property>
+  </widget>
+  <widget class="QStatusBar" name="statusbar"/>
+ </widget>
+ <resources/>
+ <connections/>
+</ui>

+ 5 - 0
src/tool/adciv_maketool/maketool.qrc

@@ -0,0 +1,5 @@
+<RCC>
+    <qresource prefix="/">
+        <file>findqmake.sh</file>
+    </qresource>
+</RCC>

+ 49 - 0
src/tool/adciv_maketool/threadfindqmake.cpp

@@ -0,0 +1,49 @@
+#include "threadfindqmake.h"
+
+#include <QFile>
+#include <QProcess>
+#include <iostream>
+
+ThreadFindQMake::ThreadFindQMake()
+{
+    mpthread = new std::thread(&ThreadFindQMake::threadqmake,this);
+}
+
+void ThreadFindQMake::threadqmake()
+{
+    QFile xFile;
+    xFile.setFileName(":/findqmake.sh");
+    if(xFile.open(QIODevice::ReadOnly))
+    {
+        std::cout<<" open file success."<<std::endl;
+        QByteArray ba = xFile.readAll();
+        QProcess * pProcess = new QProcess();
+        QStringList arg;
+        arg.append("/home/yuchuli/test.sh");
+     //   arg.append(":/findqmake.sh");
+
+        connect(pProcess,SIGNAL(readyReadStandardOutput()),this,SLOT(onReadStandardOutput()));
+        connect(pProcess,SIGNAL(readyReadStandardError()),this,SLOT(onReadStandardError()));
+        pProcess->start("/bin/sh",arg);
+
+
+
+        std::this_thread::sleep_for(std::chrono::milliseconds(10000));
+        pProcess->close();
+
+    }
+}
+
+void ThreadFindQMake::onReadStandardOutput()
+{
+    QProcess * proc = (QProcess *)sender();
+    QByteArray ba = proc->readAllStandardOutput();
+    qDebug("%s",ba.toStdString().data());
+}
+
+void ThreadFindQMake::onReadStandardError()
+{
+    QProcess * proc = (QProcess *)sender();
+    QByteArray ba = proc->readAllStandardOutput();
+    qDebug("error: %s",ba.toStdString().data());
+}

+ 26 - 0
src/tool/adciv_maketool/threadfindqmake.h

@@ -0,0 +1,26 @@
+#ifndef THREADFINDQMAKE_H
+#define THREADFINDQMAKE_H
+
+#include <QProcess>
+#include <QObject>
+#include <thread>
+
+class ThreadFindQMake : public QObject
+{
+    Q_OBJECT
+public:
+    ThreadFindQMake();
+
+private slots:
+    void onReadStandardOutput();
+    void onReadStandardError();
+
+private:
+    std::thread * mpthread;
+
+    void threadqmake();
+
+
+};
+
+#endif // THREADFINDQMAKE_H