|
@@ -3,6 +3,8 @@
|
|
|
|
|
|
#include <QSound>
|
|
|
#include <QtMath>
|
|
|
+#include <QMessageBox>
|
|
|
+#include <QInputDialog>
|
|
|
|
|
|
|
|
|
#include "pos_def.h"
|
|
@@ -279,9 +281,11 @@ ADCIntelligentShow::ADCIntelligentShow(QWidget *parent) :
|
|
|
timerpainter->start(100);
|
|
|
|
|
|
ui->pushButton_go->setStyleSheet("background: green; color: white;");
|
|
|
- ui->pushButton_prestation->setStyleSheet("background: green; color: white;");
|
|
|
- ui->pushButton_nextstation->setStyleSheet("background: green; color: white;");
|
|
|
- ui->label_station->setStyleSheet("background: transparent; color: white;font: 15pt 'Arial';");
|
|
|
+ ui->pushButton_AddStation->setStyleSheet("background: green; color: white;");
|
|
|
+ ui->pushButton_DelStation->setStyleSheet("background: green; color: white;");
|
|
|
+ // ui->pushButton_prestation->setStyleSheet("background: green; color: white;");
|
|
|
+ // ui->pushButton_nextstation->setStyleSheet("background: green; color: white;border-image: url(:/new/pic/button_gray.png);");
|
|
|
+ ui->label_station->setStyleSheet("background: transparent; color: white;font: 50px 'Arial';");
|
|
|
ui->label_station->setText("");
|
|
|
|
|
|
|
|
@@ -307,8 +311,37 @@ ADCIntelligentShow::ADCIntelligentShow(QWidget *parent) :
|
|
|
|
|
|
#ifdef ANDROID
|
|
|
|
|
|
- ui->run->setStyleSheet("color: rgb(220, 220, 220);font: 10pt 'Arial';");
|
|
|
- ui->label_9->setStyleSheet("color: rgb(220, 220, 220);font: 10pt 'Arial';");
|
|
|
+
|
|
|
+ ui->run->setStyleSheet("color: rgb(220, 220, 220);font: 30px 'Arial';");
|
|
|
+ ui->map->setStyleSheet("color: rgb(220, 220, 220);font: 30px 'Arial';");
|
|
|
+ ui->can->setStyleSheet("color: rgb(220, 220, 220);font: 30px 'Arial';");
|
|
|
+ ui->local->setStyleSheet("color: rgb(220, 220, 220);font: 30px 'Arial';");
|
|
|
+
|
|
|
+ ui->label_9->setStyleSheet("color: rgb(220, 220, 220);font: 30px 'Arial';");
|
|
|
+ ui->label_11->setStyleSheet("color: rgb(220, 220, 220);font: 30px 'Arial';");
|
|
|
+ ui->label_12->setStyleSheet("color: rgb(220, 220, 220);font: 30px 'Arial';");
|
|
|
+ ui->label_13->setStyleSheet("color: rgb(220, 220, 220);font: 30px 'Arial';");
|
|
|
+ ui->label_14->setStyleSheet("color: rgb(220, 220, 220);font: 30px 'Arial';");
|
|
|
+ ui->label_15->setStyleSheet("color: rgb(220, 220, 220);font: 30px 'Arial';");
|
|
|
+ ui->label_16->setStyleSheet("color: rgb(220, 220, 220);font: 30px 'Arial';");
|
|
|
+ ui->label_17->setStyleSheet("color: rgb(220, 220, 220);font: 30px 'Arial';");
|
|
|
+
|
|
|
+ ui->label_6->setStyleSheet("font: 50px 'Arial';color: rgb(255, 255, 255);");
|
|
|
+ ui->label->setStyleSheet("font: 75 150px '微软雅黑';color: rgb(238, 238, 238);");
|
|
|
+
|
|
|
+ ui->radar->setStyleSheet("color: rgb(220, 220, 220);font: 30px 'Arial';");
|
|
|
+ ui->lidar->setStyleSheet("color: rgb(220, 220, 220);font: 30px 'Arial';");
|
|
|
+
|
|
|
+ ui->acc->setStyleSheet("color: rgb(255, 255, 255);background-color: transparent;border-radius:10px;font: 23px 'Arial';border:7px groove rgb(0,45,70);");
|
|
|
+ ui->swerve->setStyleSheet("color: rgb(255, 255, 255);background-color: transparent;border-radius:10px;font: 23px 'Arial';border:7px groove rgb(0,45,70);");
|
|
|
+ ui->lng->setStyleSheet("color: rgb(255, 255, 255);background-color: transparent;border-radius:10px;font: 23px 'Arial';border:7px groove rgb(0,45,70);");
|
|
|
+ ui->lat->setStyleSheet("color: rgb(255, 255, 255);background-color: transparent;border-radius:10px;font: 23px 'Arial';border:7px groove rgb(0,45,70);");
|
|
|
+ ui->radarob->setStyleSheet("color: rgb(255, 255, 255);background-color: transparent;border-radius:10px;font: 23px 'Arial';border:7px groove rgb(0,45,70);");
|
|
|
+ ui->lidarob->setStyleSheet("color: rgb(255, 255, 255);background-color: transparent;border-radius:10px;font: 23px 'Arial';border:7px groove rgb(0,45,70);");
|
|
|
+ ui->allob->setStyleSheet("color: rgb(255, 255, 255);background-color: transparent;border-radius:10px;font: 23px 'Arial';border:7px groove rgb(0,45,70);");
|
|
|
+ ui->break_1->setStyleSheet("color: rgb(255, 255, 255);background-color: transparent;border-radius:10px;font: 23px 'Arial';border:7px groove rgb(0,45,70);");
|
|
|
+
|
|
|
+
|
|
|
#endif
|
|
|
}
|
|
|
|
|
@@ -343,6 +376,8 @@ void ADCIntelligentShow::resizeEvent(QResizeEvent *event)
|
|
|
ui->label_station->setGeometry(160,30,200,50);
|
|
|
ui->pushButton_nextstation->setGeometry(380,30,100,50);
|
|
|
ui->pushButton_go->setGeometry(490,30,100,50);
|
|
|
+ ui->pushButton_AddStation->setGeometry(600,30,100,50);
|
|
|
+ ui->pushButton_DelStation->setGeometry(730,30,100,50);
|
|
|
#else
|
|
|
|
|
|
// ui->pushButton_prestation->setGeometry(30,30,150,100);
|
|
@@ -351,10 +386,12 @@ void ADCIntelligentShow::resizeEvent(QResizeEvent *event)
|
|
|
// ui->pushButton_go->setGeometry(630,30,150,100);
|
|
|
|
|
|
|
|
|
- ui->pushButton_prestation->setGeometry(50,30,200,100);
|
|
|
- ui->label_station->setGeometry(260,30,400,100);
|
|
|
- ui->pushButton_nextstation->setGeometry(680,30,200,100);
|
|
|
- ui->pushButton_go->setGeometry(990,30,200,100);
|
|
|
+ ui->pushButton_prestation->setGeometry(50,30,100,100);
|
|
|
+ ui->label_station->setGeometry(160,30,500,100);
|
|
|
+ ui->pushButton_nextstation->setGeometry(680,30,100,100);
|
|
|
+ ui->pushButton_go->setGeometry(830,30,150,100);
|
|
|
+ ui->pushButton_AddStation->setGeometry(1050,30,150,100);
|
|
|
+ ui->pushButton_DelStation->setGeometry(1230,30,150,100);
|
|
|
#endif
|
|
|
|
|
|
}
|
|
@@ -627,6 +664,10 @@ void ADCIntelligentShow::onconnTimer()
|
|
|
mnstylepark = 0;
|
|
|
|
|
|
}
|
|
|
+
|
|
|
+// ui->acc->setText("-0.11111111");
|
|
|
+// ui->lat->setText("39.00000001");
|
|
|
+// ui->label_station->setText("TEXT.");
|
|
|
recvFlag = 0;
|
|
|
}
|
|
|
|
|
@@ -1197,3 +1238,175 @@ void ADCIntelligentShow::on_pushButton_Setting_clicked()
|
|
|
{
|
|
|
mpDS->show();
|
|
|
}
|
|
|
+
|
|
|
+void ADCIntelligentShow::on_pushButton_AddStation_clicked()
|
|
|
+{
|
|
|
+ bool ok;
|
|
|
+ QString strpass = QInputDialog::getText(this,tr("Check PassWord"),tr("password:"),QLineEdit::Password,
|
|
|
+ tr(""), &ok);
|
|
|
+ if(ok == false)
|
|
|
+ {
|
|
|
+ return;
|
|
|
+ }
|
|
|
+
|
|
|
+ if(strpass != "adc")
|
|
|
+ {
|
|
|
+ QMessageBox::warning(this,tr("Warning"),tr("Password Error."),QMessageBox::YesAll);
|
|
|
+ return;
|
|
|
+ }
|
|
|
+
|
|
|
+ QString strstationname = QInputDialog::getText(this,tr("Add Station"),tr("Station Name:"),QLineEdit::Normal,
|
|
|
+ tr(""), &ok);
|
|
|
+ if(ok == false)
|
|
|
+ {
|
|
|
+ return;
|
|
|
+ }
|
|
|
+
|
|
|
+ unsigned int i;
|
|
|
+ for(i=0;i<gvectorpos.size();i++)
|
|
|
+ {
|
|
|
+ if(gvectorpos[i].mstrstationname == strstationname.toStdString())
|
|
|
+ {
|
|
|
+ QMessageBox::warning(this,tr("Warning"),tr("Have Same Name Station"),QMessageBox::YesAll);
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ iv::pos_def xpos;
|
|
|
+
|
|
|
+
|
|
|
+ if(mnTimeGPS == 0)
|
|
|
+ {
|
|
|
+ xpos.mflon = QInputDialog::getDouble(this,tr("Set Longitude"),tr("Longitude:"),119.0,0.0,180.0,7,&ok);
|
|
|
+ if(ok == false)
|
|
|
+ {
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ xpos.mflat = QInputDialog::getDouble(this,tr("Set Latitude"),tr("Latitude:"),39.0,0.0,90.0,7,&ok);
|
|
|
+ if(ok == false)
|
|
|
+ {
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ else
|
|
|
+ {
|
|
|
+ iv::gps::gpsimu xgpsimu;
|
|
|
+ mMutexGPSIMU.lock();
|
|
|
+ xgpsimu.CopyFrom(mgpsimu);
|
|
|
+ mMutexGPSIMU.unlock();
|
|
|
+ xpos.mflat = xgpsimu.lat();
|
|
|
+ xpos.mflon = xgpsimu.lon();
|
|
|
+ }
|
|
|
+ xpos.mstrstationname = strstationname.toStdString();
|
|
|
+
|
|
|
+ gvectorpos.push_back(xpos);
|
|
|
+
|
|
|
+ char strout[300];
|
|
|
+ snprintf(strout,300,"Add Station %s, Lon:%11.7f, Lat:%11.7f",xpos.mstrstationname.data(),xpos.mflon,xpos.mflat);
|
|
|
+
|
|
|
+ QMessageBox::information(this,tr("Info"),strout,QMessageBox::YesAll);
|
|
|
+
|
|
|
+ if(gvectorpos.size() == 1)
|
|
|
+ {
|
|
|
+ mnStationIndex = 0;
|
|
|
+ ui->label_station->setText(gvectorpos[0].mstrstationname.data());
|
|
|
+ }
|
|
|
+
|
|
|
+ WritePos();
|
|
|
+
|
|
|
+// QMessageBox::information(this,"info","info",QMessageBox::YesAll);
|
|
|
+}
|
|
|
+
|
|
|
+void ADCIntelligentShow::on_pushButton_DelStation_clicked()
|
|
|
+{
|
|
|
+ if(gvectorpos.size() == 0)
|
|
|
+ {
|
|
|
+ QMessageBox::warning(this,tr("Warning"),tr("No Station."),QMessageBox::YesAll);
|
|
|
+ return;
|
|
|
+ }
|
|
|
+
|
|
|
+ bool ok;
|
|
|
+ QString strpass = QInputDialog::getText(this,tr("Check PassWord"),tr("password:"),QLineEdit::Password,
|
|
|
+ tr(""), &ok);
|
|
|
+ if(ok == false)
|
|
|
+ {
|
|
|
+ return;
|
|
|
+ }
|
|
|
+
|
|
|
+ if(strpass != "adc")
|
|
|
+ {
|
|
|
+ QMessageBox::warning(this,tr("Warning"),tr("Password Error."),QMessageBox::YesAll);
|
|
|
+ return;
|
|
|
+ }
|
|
|
+
|
|
|
+ iv::pos_def xpos;
|
|
|
+
|
|
|
+ if(mnStationIndex >= static_cast<int>(gvectorpos.size()) )
|
|
|
+ {
|
|
|
+ return;
|
|
|
+ }
|
|
|
+
|
|
|
+ if(mnStationIndex<0)
|
|
|
+ {
|
|
|
+ return;
|
|
|
+ }
|
|
|
+
|
|
|
+ xpos = gvectorpos[static_cast<unsigned long >(mnStationIndex) ];
|
|
|
+
|
|
|
+ gvectorpos.erase(gvectorpos.begin()+mnStationIndex);
|
|
|
+ WritePos();
|
|
|
+
|
|
|
+ if(gvectorpos.size() == 0)
|
|
|
+ {
|
|
|
+ ui->label_station->setText("");
|
|
|
+ return;
|
|
|
+ }
|
|
|
+
|
|
|
+ if(mnStationIndex >= static_cast<int>(gvectorpos.size()) )
|
|
|
+ {
|
|
|
+ mnStationIndex = 0;
|
|
|
+ }
|
|
|
+ if(mnStationIndex<0)mnStationIndex = static_cast<int>(gvectorpos.size()-1) ;
|
|
|
+ ui->label_station->setText(gvectorpos[static_cast<unsigned long>(mnStationIndex)].mstrstationname.data());
|
|
|
+
|
|
|
+ char strout[300];
|
|
|
+ snprintf(strout,300,"Delete Station %s, Lon:%11.7f, Lat:%11.7f SuccessFully ",xpos.mstrstationname.data(),xpos.mflon,xpos.mflat);
|
|
|
+
|
|
|
+ QMessageBox::information(this,tr("Info"),strout,QMessageBox::YesAll);
|
|
|
+
|
|
|
+
|
|
|
+}
|
|
|
+
|
|
|
+bool ADCIntelligentShow::WritePos()
|
|
|
+{
|
|
|
+ QString strfilepath;
|
|
|
+
|
|
|
+ // strfilepath = "pos.txt";
|
|
|
+#ifndef Android
|
|
|
+ strfilepath = "pos.txt";
|
|
|
+#else
|
|
|
+ strfilepath = "/storage/emulated/0/pos.txt";
|
|
|
+#endif
|
|
|
+
|
|
|
+ QFile xFile;
|
|
|
+ xFile.setFileName(strfilepath);
|
|
|
+
|
|
|
+ if(!xFile.open(QIODevice::ReadWrite))
|
|
|
+ {
|
|
|
+ return false;
|
|
|
+ }
|
|
|
+
|
|
|
+ xFile.resize(0);
|
|
|
+
|
|
|
+ unsigned int i;
|
|
|
+ for(i=0;i<gvectorpos.size();i++)
|
|
|
+ {
|
|
|
+ char strline[1000];
|
|
|
+ snprintf(strline,1000,"%s\t%11.7f\t%11.7f\n",gvectorpos[i].mstrstationname.data(),gvectorpos[i].mflon,gvectorpos[i].mflat);
|
|
|
+ xFile.write(strline,static_cast<qint64>(strnlen(strline,1000)) );
|
|
|
+ }
|
|
|
+
|
|
|
+ xFile.close();
|
|
|
+
|
|
|
+ return true;
|
|
|
+}
|