Browse Source

按照金亮的需求,将UI上红绿灯和状态迁移到第二页上

fujiankuan 3 years ago
parent
commit
614918ee6e
2 changed files with 327 additions and 147 deletions
  1. 36 1
      src/ui/ui_ads_hmi/ADCIntelligentVehicle.cpp
  2. 291 146
      src/ui/ui_ads_hmi/ADCIntelligentVehicle.ui

+ 36 - 1
src/ui/ui_ads_hmi/ADCIntelligentVehicle.cpp

@@ -439,10 +439,17 @@ void ADCIntelligentVehicle::timeoutslot()
     ////////////////////////////////
     QString is_ok;
     ui->lineEdit->setText(QString::number(ServiceCarStatus.location->rtk_status));//rtk状态
+    ui->lineEdit_12->setText(QString::number(ServiceCarStatus.location->rtk_status));//rtk状态
     if(ServiceCarStatus.location->rtk_status==6)
+    {
         ui->pushButton_10->setStyleSheet("background-color: green");
+        ui->pushButton_23->setStyleSheet("background-color: green");
+    }
     else
+    {
         ui->pushButton_10->setStyleSheet("background-color: red");
+        ui->pushButton_23->setStyleSheet("background-color: red");
+    }
 
     ui->lineEdit_2->setText(QString::number(ServiceCarStatus.location->ins_status));//ins状态
     if(ServiceCarStatus.location->ins_status==4)
@@ -452,32 +459,52 @@ void ADCIntelligentVehicle::timeoutslot()
 
     is_ok = (ServiceCarStatus.mRadarS>0)?QStringLiteral("ok"):QStringLiteral("error");
     ui->lineEdit_3->setText(is_ok);//毫米波雷达状态
+    ui->lineEdit_15->setText(is_ok);//毫米波雷达状态
+
     if(ServiceCarStatus.mRadarS>0)
+    {
         ui->pushButton_12->setStyleSheet("background-color: green");
+        ui->pushButton_25->setStyleSheet("background-color: green");
+    }
     else
+    {
         ui->pushButton_12->setStyleSheet("background-color:red");
+        ui->pushButton_25->setStyleSheet("background-color:red");
+    }
 
     is_ok = (ServiceCarStatus.mLidarS>0)?QStringLiteral("ok"):QStringLiteral("error");
     ui->lineEdit_4->setText(is_ok);//激光雷达状态
+    ui->lineEdit_16->setText(is_ok);//激光雷达状态
     if(ServiceCarStatus.mLidarS>0)
+    {
         ui->pushButton_13->setStyleSheet("background-color: green");
+        ui->pushButton_26->setStyleSheet("background-color: green");
+    }
     else
+    {
         ui->pushButton_13->setStyleSheet("background-color:red");
+        ui->pushButton_26->setStyleSheet("background-color:red");
+    }
 
     ui->lineEdit_5->setText(QString::number(mdecition_period)+QStringLiteral("ms"));//决策周期
+    ui->lineEdit_17->setText(QString::number(mdecition_period)+QStringLiteral("ms"));//决策周期
     if(mdecition_period>0)
+    {
         ui->pushButton_14->setStyleSheet("background-color: green");
-
+        ui->pushButton_27->setStyleSheet("background-color: green");
+    }
 
     if((mTimeState.elapsed()-mnTimeUpdateGPS) > 1000)
     {
         ui->pushButton_10->setStyleSheet("background-color: red");
         ui->pushButton_11->setStyleSheet("background-color: red");
+        ui->pushButton_23->setStyleSheet("background-color: red");
     }
 
     if((mTimeState.elapsed() - mnTimeUpdateDecition)>1000)
     {
         ui->pushButton_14->setStyleSheet("background-color:red");
+        ui->pushButton_27->setStyleSheet("background-color:red");
         ui->label_decition->setText("No decition");
         mbBrainRunning = false;
     }
@@ -503,14 +530,22 @@ void ADCIntelligentVehicle::timeoutslot()
 #if 0
     ui->lineEdit->setText(QString::number(6));//rtk状态
     ui->pushButton_10->setStyleSheet("background-color: green");
+    ui->lineEdit_12->setText(QString::number(6));//rtk状态
+    ui->pushButton_23->setStyleSheet("background-color: green");
     ui->lineEdit_2->setText(QString::number(4));
     ui->pushButton_11->setStyleSheet("background-color: green");
     ui->lineEdit_3->setText("ok");
     ui->pushButton_12->setStyleSheet("background-color: green");
+    ui->lineEdit_15->setText("ok");
+    ui->pushButton_25->setStyleSheet("background-color: green");
     ui->lineEdit_4->setText("ok");
     ui->pushButton_13->setStyleSheet("background-color: green");
+    ui->lineEdit_16->setText("ok");
+    ui->pushButton_26->setStyleSheet("background-color: green");
     ui->lineEdit_5->setText(QString::number(20)+QStringLiteral("ms"));//决策周期
     ui->pushButton_14->setStyleSheet("background-color: green");
+    ui->lineEdit_17->setText(QString::number(20)+QStringLiteral("ms"));//决策周期
+    ui->pushButton_27->setStyleSheet("background-color: green");
 #endif
 
 

+ 291 - 146
src/ui/ui_ads_hmi/ADCIntelligentVehicle.ui

@@ -98,7 +98,7 @@
      </rect>
     </property>
     <property name="currentIndex">
-     <number>0</number>
+     <number>1</number>
     </property>
     <widget class="QWidget" name="page_0">
      <widget class="QGroupBox" name="groupBox_2">
@@ -398,13 +398,144 @@
        <string>Start A Journey Of Autopilot</string>
       </property>
      </widget>
+    </widget>
+    <widget class="QWidget" name="page_1">
+     <widget class="QLabel" name="lb_current_speed_big">
+      <property name="geometry">
+       <rect>
+        <x>355</x>
+        <y>10</y>
+        <width>181</width>
+        <height>61</height>
+       </rect>
+      </property>
+      <property name="font">
+       <font>
+        <family>Agency FB</family>
+        <pointsize>48</pointsize>
+        <weight>75</weight>
+        <bold>true</bold>
+       </font>
+      </property>
+      <property name="styleSheet">
+       <string notr="true">color: rgb(238, 238, 236);</string>
+      </property>
+      <property name="text">
+       <string>0</string>
+      </property>
+     </widget>
+     <widget class="QLabel" name="label_10">
+      <property name="geometry">
+       <rect>
+        <x>430</x>
+        <y>70</y>
+        <width>41</width>
+        <height>20</height>
+       </rect>
+      </property>
+      <property name="font">
+       <font>
+        <family>AR PL UKai CN</family>
+        <pointsize>15</pointsize>
+       </font>
+      </property>
+      <property name="layoutDirection">
+       <enum>Qt::LeftToRight</enum>
+      </property>
+      <property name="styleSheet">
+       <string notr="true">color: rgb(238, 238, 236);</string>
+      </property>
+      <property name="text">
+       <string>速度</string>
+      </property>
+     </widget>
+     <widget class="QLabel" name="label_13">
+      <property name="geometry">
+       <rect>
+        <x>-30</x>
+        <y>10</y>
+        <width>301</width>
+        <height>21</height>
+       </rect>
+      </property>
+      <property name="font">
+       <font>
+        <family>AR PL UKai CN</family>
+       </font>
+      </property>
+      <property name="styleSheet">
+       <string notr="true">color: rgb(255, 255, 255);</string>
+      </property>
+      <property name="text">
+       <string/>
+      </property>
+      <property name="alignment">
+       <set>Qt::AlignCenter</set>
+      </property>
+     </widget>
+     <widget class="QLabel" name="label_State">
+      <property name="geometry">
+       <rect>
+        <x>570</x>
+        <y>20</y>
+        <width>331</width>
+        <height>16</height>
+       </rect>
+      </property>
+      <property name="styleSheet">
+       <string notr="true">color: rgb(238, 238, 236);</string>
+      </property>
+      <property name="text">
+       <string/>
+      </property>
+     </widget>
+     <widget class="QLabel" name="label_decition">
+      <property name="geometry">
+       <rect>
+        <x>570</x>
+        <y>51</y>
+        <width>341</width>
+        <height>20</height>
+       </rect>
+      </property>
+      <property name="styleSheet">
+       <string notr="true">color: rgb(238, 238, 236);</string>
+      </property>
+      <property name="text">
+       <string/>
+      </property>
+     </widget>
+     <widget class="QLabel" name="label_26">
+      <property name="geometry">
+       <rect>
+        <x>-30</x>
+        <y>50</y>
+        <width>301</width>
+        <height>21</height>
+       </rect>
+      </property>
+      <property name="font">
+       <font>
+        <family>AR PL UKai CN</family>
+       </font>
+      </property>
+      <property name="styleSheet">
+       <string notr="true">color: rgb(255, 255, 255);</string>
+      </property>
+      <property name="text">
+       <string/>
+      </property>
+      <property name="alignment">
+       <set>Qt::AlignCenter</set>
+      </property>
+     </widget>
      <widget class="QGroupBox" name="groupBox_11">
       <property name="geometry">
        <rect>
-        <x>110</x>
-        <y>530</y>
-        <width>581</width>
-        <height>261</height>
+        <x>1030</x>
+        <y>660</y>
+        <width>471</width>
+        <height>201</height>
        </rect>
       </property>
       <property name="font">
@@ -421,8 +552,8 @@
       <widget class="QLabel" name="label_37">
        <property name="geometry">
         <rect>
-         <x>430</x>
-         <y>190</y>
+         <x>370</x>
+         <y>160</y>
          <width>54</width>
          <height>26</height>
         </rect>
@@ -437,8 +568,8 @@
       <widget class="QLCDNumber" name="lcdNumber_4">
        <property name="geometry">
         <rect>
-         <x>420</x>
-         <y>140</y>
+         <x>360</x>
+         <y>110</y>
          <width>64</width>
          <height>33</height>
         </rect>
@@ -456,8 +587,8 @@
       <widget class="QLCDNumber" name="lcdNumber_3">
        <property name="geometry">
         <rect>
-         <x>310</x>
-         <y>140</y>
+         <x>250</x>
+         <y>110</y>
          <width>64</width>
          <height>33</height>
         </rect>
@@ -475,8 +606,8 @@
       <widget class="QLCDNumber" name="lcdNumber">
        <property name="geometry">
         <rect>
-         <x>80</x>
-         <y>140</y>
+         <x>20</x>
+         <y>110</y>
          <width>64</width>
          <height>33</height>
         </rect>
@@ -494,8 +625,8 @@
       <widget class="QLabel" name="label_38">
        <property name="geometry">
         <rect>
-         <x>80</x>
-         <y>60</y>
+         <x>20</x>
+         <y>30</y>
          <width>66</width>
          <height>66</height>
         </rect>
@@ -507,8 +638,8 @@
       <widget class="QLabel" name="label_31">
        <property name="geometry">
         <rect>
-         <x>320</x>
-         <y>190</y>
+         <x>260</x>
+         <y>160</y>
          <width>54</width>
          <height>26</height>
         </rect>
@@ -523,8 +654,8 @@
       <widget class="QLCDNumber" name="lcdNumber_2">
        <property name="geometry">
         <rect>
-         <x>190</x>
-         <y>140</y>
+         <x>130</x>
+         <y>110</y>
          <width>64</width>
          <height>33</height>
         </rect>
@@ -542,8 +673,8 @@
       <widget class="QLabel" name="label_34">
        <property name="geometry">
         <rect>
-         <x>90</x>
-         <y>190</y>
+         <x>30</x>
+         <y>160</y>
          <width>54</width>
          <height>26</height>
         </rect>
@@ -558,8 +689,8 @@
       <widget class="QLabel" name="label_32">
        <property name="geometry">
         <rect>
-         <x>420</x>
-         <y>60</y>
+         <x>360</x>
+         <y>30</y>
          <width>66</width>
          <height>66</height>
         </rect>
@@ -571,8 +702,8 @@
       <widget class="QLabel" name="label_33">
        <property name="geometry">
         <rect>
-         <x>190</x>
-         <y>60</y>
+         <x>130</x>
+         <y>30</y>
          <width>66</width>
          <height>66</height>
         </rect>
@@ -584,8 +715,8 @@
       <widget class="QLabel" name="label_35">
        <property name="geometry">
         <rect>
-         <x>310</x>
-         <y>60</y>
+         <x>250</x>
+         <y>30</y>
          <width>66</width>
          <height>66</height>
         </rect>
@@ -597,8 +728,8 @@
       <widget class="QLabel" name="label_36">
        <property name="geometry">
         <rect>
-         <x>200</x>
-         <y>190</y>
+         <x>140</x>
+         <y>160</y>
          <width>54</width>
          <height>26</height>
         </rect>
@@ -611,64 +742,13 @@
        </property>
       </widget>
      </widget>
-    </widget>
-    <widget class="QWidget" name="page_1">
-     <widget class="QLabel" name="lb_current_speed_big">
-      <property name="geometry">
-       <rect>
-        <x>355</x>
-        <y>10</y>
-        <width>181</width>
-        <height>61</height>
-       </rect>
-      </property>
-      <property name="font">
-       <font>
-        <family>Agency FB</family>
-        <pointsize>48</pointsize>
-        <weight>75</weight>
-        <bold>true</bold>
-       </font>
-      </property>
-      <property name="styleSheet">
-       <string notr="true">color: rgb(238, 238, 236);</string>
-      </property>
-      <property name="text">
-       <string>0</string>
-      </property>
-     </widget>
-     <widget class="QLabel" name="label_10">
-      <property name="geometry">
-       <rect>
-        <x>430</x>
-        <y>70</y>
-        <width>41</width>
-        <height>20</height>
-       </rect>
-      </property>
-      <property name="font">
-       <font>
-        <family>AR PL UKai CN</family>
-        <pointsize>15</pointsize>
-       </font>
-      </property>
-      <property name="layoutDirection">
-       <enum>Qt::LeftToRight</enum>
-      </property>
-      <property name="styleSheet">
-       <string notr="true">color: rgb(238, 238, 236);</string>
-      </property>
-      <property name="text">
-       <string>速度</string>
-      </property>
-     </widget>
-     <widget class="QLabel" name="label_13">
+     <widget class="QGroupBox" name="groupBox_12">
       <property name="geometry">
        <rect>
-        <x>-30</x>
-        <y>10</y>
-        <width>301</width>
-        <height>21</height>
+        <x>930</x>
+        <y>0</y>
+        <width>431</width>
+        <height>81</height>
        </rect>
       </property>
       <property name="font">
@@ -676,71 +756,136 @@
         <family>AR PL UKai CN</family>
        </font>
       </property>
-      <property name="styleSheet">
-       <string notr="true">color: rgb(255, 255, 255);</string>
-      </property>
-      <property name="text">
-       <string/>
-      </property>
-      <property name="alignment">
-       <set>Qt::AlignCenter</set>
-      </property>
-     </widget>
-     <widget class="QLabel" name="label_State">
-      <property name="geometry">
-       <rect>
-        <x>570</x>
-        <y>20</y>
-        <width>331</width>
-        <height>16</height>
-       </rect>
-      </property>
       <property name="styleSheet">
        <string notr="true">color: rgb(238, 238, 236);</string>
       </property>
-      <property name="text">
-       <string/>
-      </property>
-     </widget>
-     <widget class="QLabel" name="label_decition">
-      <property name="geometry">
-       <rect>
-        <x>570</x>
-        <y>51</y>
-        <width>341</width>
-        <height>20</height>
-       </rect>
-      </property>
-      <property name="styleSheet">
-       <string notr="true">color: rgb(238, 238, 236);</string>
-      </property>
-      <property name="text">
-       <string/>
-      </property>
-     </widget>
-     <widget class="QLabel" name="label_26">
-      <property name="geometry">
-       <rect>
-        <x>-30</x>
-        <y>50</y>
-        <width>301</width>
-        <height>21</height>
-       </rect>
-      </property>
-      <property name="font">
-       <font>
-        <family>AR PL UKai CN</family>
-       </font>
-      </property>
-      <property name="styleSheet">
-       <string notr="true">color: rgb(255, 255, 255);</string>
-      </property>
-      <property name="text">
-       <string/>
-      </property>
-      <property name="alignment">
-       <set>Qt::AlignCenter</set>
+      <property name="title">
+       <string>实时状态</string>
       </property>
+      <widget class="QLineEdit" name="lineEdit_12">
+       <property name="geometry">
+        <rect>
+         <x>99</x>
+         <y>30</y>
+         <width>101</width>
+         <height>20</height>
+        </rect>
+       </property>
+       <property name="styleSheet">
+        <string notr="true">color: rgb(238, 238, 236);</string>
+       </property>
+      </widget>
+      <widget class="QLineEdit" name="lineEdit_15">
+       <property name="geometry">
+        <rect>
+         <x>310</x>
+         <y>30</y>
+         <width>101</width>
+         <height>20</height>
+        </rect>
+       </property>
+       <property name="styleSheet">
+        <string notr="true">color: rgb(238, 238, 236);</string>
+       </property>
+      </widget>
+      <widget class="QLineEdit" name="lineEdit_16">
+       <property name="geometry">
+        <rect>
+         <x>99</x>
+         <y>50</y>
+         <width>101</width>
+         <height>21</height>
+        </rect>
+       </property>
+       <property name="styleSheet">
+        <string notr="true">color: rgb(238, 238, 236);</string>
+       </property>
+      </widget>
+      <widget class="QLineEdit" name="lineEdit_17">
+       <property name="geometry">
+        <rect>
+         <x>310</x>
+         <y>50</y>
+         <width>101</width>
+         <height>21</height>
+        </rect>
+       </property>
+       <property name="styleSheet">
+        <string notr="true">color: rgb(238, 238, 236);</string>
+       </property>
+      </widget>
+      <widget class="QPushButton" name="pushButton_23">
+       <property name="geometry">
+        <rect>
+         <x>10</x>
+         <y>30</y>
+         <width>81</width>
+         <height>20</height>
+        </rect>
+       </property>
+       <property name="font">
+        <font>
+         <family>AR PL UKai CN</family>
+        </font>
+       </property>
+       <property name="text">
+        <string>RTK</string>
+       </property>
+      </widget>
+      <widget class="QPushButton" name="pushButton_25">
+       <property name="geometry">
+        <rect>
+         <x>221</x>
+         <y>30</y>
+         <width>81</width>
+         <height>21</height>
+        </rect>
+       </property>
+       <property name="font">
+        <font>
+         <family>AR PL UKai CN</family>
+        </font>
+       </property>
+       <property name="text">
+        <string>毫米波雷达</string>
+       </property>
+      </widget>
+      <widget class="QPushButton" name="pushButton_26">
+       <property name="geometry">
+        <rect>
+         <x>10</x>
+         <y>50</y>
+         <width>81</width>
+         <height>21</height>
+        </rect>
+       </property>
+       <property name="font">
+        <font>
+         <family>AR PL UKai CN</family>
+        </font>
+       </property>
+       <property name="text">
+        <string>激光雷达</string>
+       </property>
+      </widget>
+      <widget class="QPushButton" name="pushButton_27">
+       <property name="geometry">
+        <rect>
+         <x>221</x>
+         <y>50</y>
+         <width>81</width>
+         <height>21</height>
+        </rect>
+       </property>
+       <property name="font">
+        <font>
+         <family>AR PL UKai CN</family>
+        </font>
+       </property>
+       <property name="text">
+        <string>决策周期</string>
+       </property>
+      </widget>
      </widget>
     </widget>
     <widget class="QWidget" name="page_2">