|
@@ -0,0 +1,51 @@
|
|
|
+#include "mainwindow.h"
|
|
|
+#include "ui_mainwindow.h"
|
|
|
+
|
|
|
+#include <QFileDialog>
|
|
|
+
|
|
|
+MainWindow::MainWindow(QWidget *parent)
|
|
|
+ : QMainWindow(parent)
|
|
|
+ , ui(new Ui::MainWindow)
|
|
|
+{
|
|
|
+ ui->setupUi(this);
|
|
|
+
|
|
|
+ setWindowTitle("Convert xodr map to Apollo HDMAP");
|
|
|
+}
|
|
|
+
|
|
|
+MainWindow::~MainWindow()
|
|
|
+{
|
|
|
+ delete ui;
|
|
|
+}
|
|
|
+
|
|
|
+void MainWindow::on_pushButton_convert_clicked()
|
|
|
+{
|
|
|
+ QString strlastpath = QString(ServiceIni.Getlastpath().data());
|
|
|
+ QString strxodrpath = QFileDialog::getOpenFileName(this,"Select OpenDrive File",strlastpath,"*.xodr");
|
|
|
+
|
|
|
+ if(strxodrpath.isEmpty())return;
|
|
|
+
|
|
|
+ int indexsplash = strxodrpath.lastIndexOf('/');
|
|
|
+ QString lastPath = strxodrpath.left(indexsplash);
|
|
|
+
|
|
|
+ if(lastPath != strlastpath)
|
|
|
+ {
|
|
|
+ strlastpath = lastPath;
|
|
|
+ ServiceIni.Setlastpath(strlastpath.toStdString());
|
|
|
+ }
|
|
|
+
|
|
|
+ QString strhdmappath = QFileDialog::getSaveFileName(this,"Select HDMAP File",".","*.xml");
|
|
|
+
|
|
|
+ if(strhdmappath.isEmpty())return;
|
|
|
+
|
|
|
+ indexsplash = strxodrpath.lastIndexOf('/');
|
|
|
+ lastPath = strxodrpath.left(indexsplash);
|
|
|
+
|
|
|
+ if(lastPath != strlastpath)
|
|
|
+ {
|
|
|
+ strlastpath = lastPath;
|
|
|
+ ServiceIni.Setlastpath(strlastpath.toStdString());
|
|
|
+ }
|
|
|
+}
|
|
|
+
|
|
|
+
|
|
|
+
|