瀏覽代碼

change ADCIntelligentShow_grpc.

yuchuli 2 年之前
父節點
當前提交
27e321c39b

+ 1 - 1
src/ui/ADCIntelligentShow_grpc/ADCIntelligentShow_grpc_android.pro

@@ -13,7 +13,7 @@ DEFINES += Android
 
 greaterThan(QT_MAJOR_VERSION, 4): QT += widgets network
 
-TARGET = ADCIntelligentShow_grpc
+TARGET = ADPILOT # ADCIntelligentShow_grpc
 TEMPLATE = app
 
 # The following define makes your compiler emit warnings if you use

二進制
src/ui/ADCIntelligentShow_grpc/Car-Control-icon/JinGuang-Guan.png


二進制
src/ui/ADCIntelligentShow_grpc/Car-Control-icon/JinGuang-Kai.png


二進制
src/ui/ADCIntelligentShow_grpc/Car-Control-icon/MenJin-Guan.png


二進制
src/ui/ADCIntelligentShow_grpc/Car-Control-icon/MenJin-Kai.png


二進制
src/ui/ADCIntelligentShow_grpc/Car-Control-icon/YuanGuang-Guan.png


二進制
src/ui/ADCIntelligentShow_grpc/Car-Control-icon/YuanGuang-Kai.png


+ 222 - 9
src/ui/ADCIntelligentShow_grpc/adcintelligentshow.cpp

@@ -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;
+}

+ 6 - 0
src/ui/ADCIntelligentShow_grpc/adcintelligentshow.h

@@ -180,6 +180,8 @@ private:
     void GaussProjCal(double longitude, double latitude, double *X, double *Y);
     void SplitString(const string& s, vector<string>& v, const string& c);
 
+    bool WritePos();
+
     QPainter  *mpainter_background = 0;
 
     void * mpapad;
@@ -211,6 +213,10 @@ private slots:
 
     void on_pushButton_Setting_clicked();
 
+    void on_pushButton_AddStation_clicked();
+
+    void on_pushButton_DelStation_clicked();
+
 public slots:
     void slotAlarm();
 

+ 10 - 0
src/ui/ADCIntelligentShow_grpc/adcintelligentshow.qrc

@@ -29,6 +29,10 @@
         <file>alarm.wav</file>
         <file>setting.png</file>
         <file>setting2.png</file>
+        <file>ndex.png</file>
+        <file>pre.png</file>
+        <file>next2.png</file>
+        <file>pre2.png</file>
     </qresource>
     <qresource prefix="/">
         <file>Car-Control-icon/JinGuang-Guan.svg</file>
@@ -37,5 +41,11 @@
         <file>Car-Control-icon/MenJin-Kai.svg</file>
         <file>Car-Control-icon/YuanGuang-Guan.svg</file>
         <file>Car-Control-icon/YuanGuang-Kai.svg</file>
+        <file>Car-Control-icon/MenJin-Kai.png</file>
+        <file>Car-Control-icon/JinGuang-Guan.png</file>
+        <file>Car-Control-icon/JinGuang-Kai.png</file>
+        <file>Car-Control-icon/MenJin-Guan.png</file>
+        <file>Car-Control-icon/YuanGuang-Guan.png</file>
+        <file>Car-Control-icon/YuanGuang-Kai.png</file>
     </qresource>
 </RCC>

+ 64 - 9
src/ui/ADCIntelligentShow_grpc/adcintelligentshow.ui

@@ -493,19 +493,22 @@ font: 15pt &quot;Arial&quot;;</string>
    <widget class="QWidget" name="widget_2" native="true">
     <property name="geometry">
      <rect>
-      <x>730</x>
-      <y>-80</y>
+      <x>690</x>
+      <y>-70</y>
       <width>1300</width>
       <height>1350</height>
      </rect>
     </property>
+    <property name="styleSheet">
+     <string notr="true"/>
+    </property>
     <widget class="QPushButton" name="pushButton_nextstation">
      <property name="geometry">
       <rect>
        <x>20</x>
-       <y>120</y>
+       <y>110</y>
        <width>121</width>
-       <height>41</height>
+       <height>61</height>
       </rect>
      </property>
      <property name="font">
@@ -513,8 +516,12 @@ font: 15pt &quot;Arial&quot;;</string>
        <pointsize>15</pointsize>
       </font>
      </property>
+     <property name="styleSheet">
+      <string notr="true">QPushButton{border-image: url(:/new/pic/ndex.png);}
+QPushButton:pressed{border-image: url(:/new/pic/next2.png);}</string>
+     </property>
      <property name="text">
-      <string>下一站</string>
+      <string/>
      </property>
     </widget>
     <widget class="QPushButton" name="pushButton_prestation">
@@ -531,8 +538,12 @@ font: 15pt &quot;Arial&quot;;</string>
        <pointsize>15</pointsize>
       </font>
      </property>
+     <property name="styleSheet">
+      <string notr="true">QPushButton{border-image: url(:/new/pic/pre.png);}
+QPushButton:pressed{border-image: url(:/new/pic/pre2.png);}</string>
+     </property>
      <property name="text">
-      <string>上一站</string>
+      <string/>
      </property>
     </widget>
     <widget class="QPushButton" name="pushButton_go">
@@ -557,20 +568,64 @@ font: 15pt &quot;Arial&quot;;</string>
      <property name="geometry">
       <rect>
        <x>159</x>
-       <y>127</y>
+       <y>110</y>
        <width>211</width>
-       <height>31</height>
+       <height>61</height>
       </rect>
      </property>
      <property name="font">
       <font>
-       <pointsize>9</pointsize>
+       <family>Ubuntu</family>
+       <pointsize>-1</pointsize>
+       <weight>50</weight>
+       <italic>false</italic>
+       <bold>false</bold>
       </font>
      </property>
+     <property name="styleSheet">
+      <string notr="true">color: rgb(255, 255, 255);
+font: 30px &quot;Ubuntu&quot;;</string>
+     </property>
      <property name="text">
       <string>TextLabel</string>
      </property>
     </widget>
+    <widget class="QPushButton" name="pushButton_AddStation">
+     <property name="geometry">
+      <rect>
+       <x>708</x>
+       <y>120</y>
+       <width>101</width>
+       <height>41</height>
+      </rect>
+     </property>
+     <property name="font">
+      <font>
+       <pointsize>15</pointsize>
+      </font>
+     </property>
+     <property name="text">
+      <string>加站</string>
+     </property>
+    </widget>
+    <widget class="QPushButton" name="pushButton_DelStation">
+     <property name="geometry">
+      <rect>
+       <x>830</x>
+       <y>120</y>
+       <width>89</width>
+       <height>41</height>
+      </rect>
+     </property>
+     <property name="font">
+      <font>
+       <pointsize>15</pointsize>
+      </font>
+     </property>
+     <property name="text">
+      <string>减站</string>
+     </property>
+    </widget>
    </widget>
    <widget class="QPushButton" name="park">
     <property name="geometry">

+ 132 - 7
src/ui/ADCIntelligentShow_grpc/dialogsetting.cpp

@@ -1,20 +1,47 @@
 #include "dialogsetting.h"
 #include "ui_dialogsetting.h"
 
+#include <QMessageBox>
+#include <QInputDialog>
+#include <QFile>
+
+extern std::string gstrserverip;
+extern void SaveServerIP();
+
 DialogSetting::DialogSetting(QWidget *parent) :
     QDialog(parent),
     ui(new Ui::DialogSetting)
 {
     ui->setupUi(this);
 
-    ui->pushButton_OpenDoor->setIcon(QIcon(":/Car-Control-icon/MenJin-Kai.svg"));
-    ui->pushButton_CloseDoor->setIcon(QIcon(":/Car-Control-icon/MenJin-Guan.svg"));
-    ui->pushButton_OpenJinguan->setIcon(QIcon(":/Car-Control-icon/JinGuang-Kai.svg"));
-    ui->pushButton_CloseJinguang->setIcon(QIcon(":/Car-Control-icon/JinGuang-Guan.svg"));
-    ui->pushButton_OpenYuanguang->setIcon(QIcon(":/Car-Control-icon/YuanGuang-Kai.svg"));
-    ui->pushButton_CloseYuanguang->setIcon(QIcon(":/Car-Control-icon/YuanGuang-Guan.svg"));
+//    ui->pushButton_OpenDoor->setIcon(QIcon(":/Car-Control-icon/MenJin-Kai.svg"));
+//    ui->pushButton_CloseDoor->setIcon(QIcon(":/Car-Control-icon/MenJin-Guan.svg"));
+//    ui->pushButton_OpenJinguan->setIcon(QIcon(":/Car-Control-icon/JinGuang-Kai.svg"));
+//    ui->pushButton_CloseJinguang->setIcon(QIcon(":/Car-Control-icon/JinGuang-Guan.svg"));
+//    ui->pushButton_OpenYuanguang->setIcon(QIcon(":/Car-Control-icon/YuanGuang-Kai.svg"));
+//    ui->pushButton_CloseYuanguang->setIcon(QIcon(":/Car-Control-icon/YuanGuang-Guan.svg"));
+
 
-    ui->radioButton_Normal->setChecked(true);
+    switch (mnMode)
+    {
+    case 0:
+        ui->pushButton_Mode->setText("Eco");
+        ui->pushButton_Mode->setStyleSheet("background: green; color: white;font: 50px;");
+        break;
+    case 1:
+        ui->pushButton_Mode->setText("Normal");
+        ui->pushButton_Mode->setStyleSheet("background: blue; color: white;font: 50px;");
+        break;
+    case 2:
+        ui->pushButton_Mode->setText("Sport");
+        ui->pushButton_Mode->setStyleSheet("background: red; color: white;font: 50px;");
+        break;
+    default:
+        break;
+    }
+
+    ui->pushButton_SetServerIP->setStyleSheet("background: green; color: white;font: 50px;");
+    ui->pushButton_Close->setStyleSheet("background: red; color: white;font: 50px;");
 
     setWindowTitle("Setting");
 }
@@ -73,3 +100,101 @@ void DialogSetting::on_pushButton_CloseYuanguang_clicked()
 {
     emit signalswith(5);
 }
+
+void DialogSetting::on_pushButton_Door_clicked()
+{
+    if(mnDoorMode == 0)
+    {
+        mnDoorMode = 1;
+        emit signalswith(0);
+        ui->pushButton_Door->setStyleSheet("border-image: url(:/Car-Control-icon/MenJin-Kai.png);");
+    }
+    else
+    {
+        mnDoorMode = 0;
+        emit signalswith(1);
+        ui->pushButton_Door->setStyleSheet("border-image: url(:/Car-Control-icon/MenJin-Guan.png);");
+    }
+}
+
+void DialogSetting::on_pushButton_Jinguan_clicked()
+{
+    if(mnJingguangMode == 0)
+    {
+        mnJingguangMode = 1;
+        emit signalswith(2);
+        ui->pushButton_Jinguan->setStyleSheet("border-image: url(:/Car-Control-icon/JinGuang-Kai.png);");
+    }
+    else
+    {
+        mnJingguangMode = 0;
+        emit signalswith(3);
+        ui->pushButton_Jinguan->setStyleSheet("border-image: url(:/Car-Control-icon/JinGuang-Guan.png);");
+    }
+}
+
+void DialogSetting::on_pushButton_Yuanguang_clicked()
+{
+    if(mnYuanguangMode == 0)
+    {
+        mnYuanguangMode = 1;
+        emit signalswith(4);
+        ui->pushButton_Yuanguang->setStyleSheet("border-image: url(:/Car-Control-icon/YuanGuang-Kai.png);");
+    }
+    else
+    {
+        mnYuanguangMode = 0;
+        emit signalswith(5);
+        ui->pushButton_Yuanguang->setStyleSheet("border-image: url(:/Car-Control-icon/YuanGuang-Guan.png);");
+    }
+}
+
+void DialogSetting::on_pushButton_Mode_clicked()
+{
+    mnMode++;
+    if(mnMode == 3)mnMode = 0;
+    switch (mnMode)
+    {
+    case 0:
+        ui->pushButton_Mode->setText("Eco");
+        ui->pushButton_Mode->setStyleSheet("background: green; color: white;font: 50px;");
+        break;
+    case 1:
+        ui->pushButton_Mode->setText("Normal");
+        ui->pushButton_Mode->setStyleSheet("background: blue; color: white;font: 50px;");
+        break;
+    case 2:
+        ui->pushButton_Mode->setText("Sport");
+        ui->pushButton_Mode->setStyleSheet("background: red; color: white;font: 50px;");
+        break;
+    default:
+        break;
+    }
+}
+
+void DialogSetting::on_pushButton_SetServerIP_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("SetServerIP"),tr("Station Name:"),QLineEdit::Normal,
+                                                   gstrserverip.data(), &ok);
+    if(ok == false)
+    {
+        return;
+    }
+
+    gstrserverip = strstationname.toStdString();
+    SaveServerIP();
+}

+ 16 - 0
src/ui/ADCIntelligentShow_grpc/dialogsetting.h

@@ -36,12 +36,28 @@ private slots:
 
     void on_pushButton_CloseYuanguang_clicked();
 
+    void on_pushButton_Door_clicked();
+
+    void on_pushButton_Jinguan_clicked();
+
+    void on_pushButton_Yuanguang_clicked();
+
+    void on_pushButton_Mode_clicked();
+
+    void on_pushButton_SetServerIP_clicked();
+
 signals:
     void signalswith(int nswitch);
     void signalMode(int nMode);
 private:
     Ui::DialogSetting *ui;
 
+    int mnDoorMode = 0;
+    int mnJingguangMode = 0;
+    int mnYuanguangMode = 0;
+
+    int mnMode = 0;
+
 };
 
 #endif // DIALOGSETTING_H

+ 42 - 146
src/ui/ADCIntelligentShow_grpc/dialogsetting.ui

@@ -6,7 +6,7 @@
    <rect>
     <x>0</x>
     <y>0</y>
-    <width>629</width>
+    <width>877</width>
     <height>607</height>
    </rect>
   </property>
@@ -14,28 +14,28 @@
    <string>Dialog</string>
   </property>
   <property name="styleSheet">
-   <string notr="true">background-color: rgb(85, 86, 83);</string>
+   <string notr="true"/>
   </property>
   <widget class="QPushButton" name="pushButton_Close">
    <property name="geometry">
     <rect>
-     <x>220</x>
-     <y>530</y>
-     <width>161</width>
-     <height>71</height>
+     <x>290</x>
+     <y>390</y>
+     <width>201</width>
+     <height>100</height>
     </rect>
    </property>
    <property name="text">
     <string>Close</string>
    </property>
   </widget>
-  <widget class="QPushButton" name="pushButton_OpenDoor">
+  <widget class="QPushButton" name="pushButton_Door">
    <property name="geometry">
     <rect>
      <x>30</x>
-     <y>20</y>
-     <width>251</width>
-     <height>71</height>
+     <y>30</y>
+     <width>150</width>
+     <height>150</height>
     </rect>
    </property>
    <property name="font">
@@ -43,32 +43,11 @@
      <pointsize>30</pointsize>
     </font>
    </property>
-   <property name="text">
-    <string>开门</string>
-   </property>
-   <property name="iconSize">
-    <size>
-     <width>60</width>
-     <height>60</height>
-    </size>
-   </property>
-  </widget>
-  <widget class="QPushButton" name="pushButton_CloseDoor">
-   <property name="geometry">
-    <rect>
-     <x>320</x>
-     <y>20</y>
-     <width>251</width>
-     <height>71</height>
-    </rect>
-   </property>
-   <property name="font">
-    <font>
-     <pointsize>30</pointsize>
-    </font>
+   <property name="styleSheet">
+    <string notr="true">border-image: url(:/Car-Control-icon/MenJin-Guan.png);</string>
    </property>
    <property name="text">
-    <string>关门</string>
+    <string/>
    </property>
    <property name="iconSize">
     <size>
@@ -77,13 +56,13 @@
     </size>
    </property>
   </widget>
-  <widget class="QPushButton" name="pushButton_OpenJinguan">
+  <widget class="QPushButton" name="pushButton_Jinguan">
    <property name="geometry">
     <rect>
-     <x>30</x>
-     <y>120</y>
-     <width>251</width>
-     <height>71</height>
+     <x>230</x>
+     <y>30</y>
+     <width>150</width>
+     <height>150</height>
     </rect>
    </property>
    <property name="font">
@@ -91,8 +70,11 @@
      <pointsize>30</pointsize>
     </font>
    </property>
+   <property name="styleSheet">
+    <string notr="true">border-image: url(:/Car-Control-icon/JinGuang-Guan.png);</string>
+   </property>
    <property name="text">
-    <string>近光开</string>
+    <string/>
    </property>
    <property name="iconSize">
     <size>
@@ -101,13 +83,13 @@
     </size>
    </property>
   </widget>
-  <widget class="QPushButton" name="pushButton_CloseJinguang">
+  <widget class="QPushButton" name="pushButton_Yuanguang">
    <property name="geometry">
     <rect>
-     <x>320</x>
-     <y>120</y>
-     <width>251</width>
-     <height>71</height>
+     <x>430</x>
+     <y>30</y>
+     <width>150</width>
+     <height>150</height>
     </rect>
    </property>
    <property name="font">
@@ -115,8 +97,11 @@
      <pointsize>30</pointsize>
     </font>
    </property>
+   <property name="styleSheet">
+    <string notr="true">border-image: url(:/Car-Control-icon/YuanGuang-Guan.png);</string>
+   </property>
    <property name="text">
-    <string>近光关</string>
+    <string/>
    </property>
    <property name="iconSize">
     <size>
@@ -125,120 +110,31 @@
     </size>
    </property>
   </widget>
-  <widget class="QPushButton" name="pushButton_OpenYuanguang">
+  <widget class="QPushButton" name="pushButton_Mode">
    <property name="geometry">
     <rect>
-     <x>30</x>
-     <y>230</y>
-     <width>251</width>
-     <height>71</height>
+     <x>630</x>
+     <y>30</y>
+     <width>200</width>
+     <height>150</height>
     </rect>
    </property>
-   <property name="font">
-    <font>
-     <pointsize>30</pointsize>
-    </font>
-   </property>
    <property name="text">
-    <string>远光开</string>
-   </property>
-   <property name="iconSize">
-    <size>
-     <width>60</width>
-     <height>60</height>
-    </size>
+    <string>Eco</string>
    </property>
   </widget>
-  <widget class="QPushButton" name="pushButton_CloseYuanguang">
+  <widget class="QPushButton" name="pushButton_SetServerIP">
    <property name="geometry">
     <rect>
-     <x>320</x>
+     <x>180</x>
      <y>230</y>
-     <width>251</width>
-     <height>71</height>
+     <width>500</width>
+     <height>100</height>
     </rect>
    </property>
-   <property name="font">
-    <font>
-     <pointsize>30</pointsize>
-    </font>
-   </property>
    <property name="text">
-    <string>远光关</string>
-   </property>
-   <property name="iconSize">
-    <size>
-     <width>60</width>
-     <height>60</height>
-    </size>
-   </property>
-  </widget>
-  <widget class="QGroupBox" name="groupBox">
-   <property name="geometry">
-    <rect>
-     <x>20</x>
-     <y>310</y>
-     <width>571</width>
-     <height>131</height>
-    </rect>
+    <string>设置服务器IP</string>
    </property>
-   <property name="title">
-    <string>模式设置</string>
-   </property>
-   <widget class="QRadioButton" name="radioButton_Eco">
-    <property name="geometry">
-     <rect>
-      <x>10</x>
-      <y>40</y>
-      <width>171</width>
-      <height>71</height>
-     </rect>
-    </property>
-    <property name="font">
-     <font>
-      <pointsize>30</pointsize>
-     </font>
-    </property>
-    <property name="text">
-     <string>经济</string>
-    </property>
-   </widget>
-   <widget class="QRadioButton" name="radioButton_Normal">
-    <property name="geometry">
-     <rect>
-      <x>191</x>
-      <y>40</y>
-      <width>171</width>
-      <height>71</height>
-     </rect>
-    </property>
-    <property name="font">
-     <font>
-      <pointsize>30</pointsize>
-     </font>
-    </property>
-    <property name="text">
-     <string>普通</string>
-    </property>
-   </widget>
-   <widget class="QRadioButton" name="radioButton_Sport">
-    <property name="geometry">
-     <rect>
-      <x>370</x>
-      <y>40</y>
-      <width>171</width>
-      <height>71</height>
-     </rect>
-    </property>
-    <property name="font">
-     <font>
-      <pointsize>30</pointsize>
-     </font>
-    </property>
-    <property name="text">
-     <string>运动</string>
-    </property>
-   </widget>
   </widget>
  </widget>
  <resources/>

+ 41 - 0
src/ui/ADCIntelligentShow_grpc/main.cpp

@@ -31,6 +31,45 @@ std::string gstrdefaultlane = "1";
 
 std::vector<iv::pos_def> gvectorpos;
 
+void LoadServerIP()
+{
+    QString strpath = "ADCIntelligentShow_grpc_android_server.txt";
+#ifdef Android
+    strpath = "/storage/emulated/0/ADCIntelligentShow_grpc_android_server.txt";
+#endif
+    QFile xFile;
+    xFile.setFileName(strpath);
+    if(!xFile.open(QIODevice::ReadOnly))
+    {
+        return;
+    }
+    std::string strip = xFile.readAll().toStdString();
+    xFile.close();
+    if(strip.length()<7)
+    {
+        return;
+    }
+    gstrserverip = strip;
+
+}
+
+void SaveServerIP()
+{
+    QString strpath = "ADCIntelligentShow_grpc_android_server.txt";
+#ifdef Android
+    strpath = "/storage/emulated/0/ADCIntelligentShow_grpc_android_server.txt";
+#endif
+    QFile xFile;
+    xFile.setFileName(strpath);
+    if(!xFile.open(QIODevice::ReadWrite))
+    {
+        return;
+    }
+    xFile.resize(0);
+    xFile.write(gstrserverip.data(),static_cast<qint64>(gstrserverip.length()) );
+    xFile.close();
+}
+
 void LoadPos(std::string strfilepath)
 {
     QFile xFile;
@@ -153,6 +192,8 @@ int main(int argc, char *argv[])
    ggt = &xrpcthread;
 #endif
 
+   LoadServerIP();
+
    if(strncmp(gstrmode.data(),"false",255) == 0)
    {
        xrpcthread.setserverip(gstrserverip);

二進制
src/ui/ADCIntelligentShow_grpc/ndex.png


二進制
src/ui/ADCIntelligentShow_grpc/next2.png


二進制
src/ui/ADCIntelligentShow_grpc/pre.png


二進制
src/ui/ADCIntelligentShow_grpc/pre2.png