Selaa lähdekoodia

UI中添加对小巴车调试控件,需要更新代码,重新编译hmi.proto文件、ads_hmi_ui工程。

fujiankuan 4 vuotta sitten
vanhempi
commit
83acaf3f6a

+ 4 - 0
src/include/proto/hmi.proto

@@ -7,4 +7,8 @@ message hmimsg
  required bool mbPause = 1;
  required bool mbBocheMode = 2;
  required bool mbbusmode = 3;
+ optional bool mbchemen = 4;
+ optional bool mbjinguang = 5;
+ optional bool mbyuanguang = 6;
+
 };

+ 49 - 0
src/ui/ui_ads_hmi/ADCIntelligentVehicle.cpp

@@ -439,6 +439,12 @@ ADCIntelligentVehicle::ADCIntelligentVehicle(QWidget *parent)
     mTimerState1.start(100);   //定时100ms
     #endif
 
+    ui->pBtn_door_open->setIcon(QIcon(":/Car-Control-icon/MenJin-Kai.svg"));
+    ui->pBtn_door_close->setIcon(QIcon(":/Car-Control-icon/MenJin-Guan.svg"));
+    ui->pBtn_low_beam_open->setIcon(QIcon(":/Car-Control-icon/JinGuang-Kai.svg"));
+    ui->pBtn_low_beam_close->setIcon(QIcon(":/Car-Control-icon/JinGuang-Guan.svg"));
+    ui->pBtn_high_beam_open->setIcon(QIcon(":/Car-Control-icon/YuanGuang-Kai.svg"));
+    ui->pBtn_high_beam_close->setIcon(QIcon(":/Car-Control-icon/YuanGuang-Guan.svg"));
 }
 
 /**
@@ -2286,3 +2292,46 @@ void ADCIntelligentVehicle::onStateTimer1()
         break;
     }
 }
+
+
+void ADCIntelligentVehicle::on_pBtn_door_open_clicked()
+{
+    iv::hmi::HMIBasic hmi;
+    hmi.mbchemen = true;
+    ShareHMIMsg(hmi);
+}
+
+void ADCIntelligentVehicle::on_pBtn_door_close_clicked()
+{
+    iv::hmi::HMIBasic hmi;
+    hmi.mbchemen = false;
+    ShareHMIMsg(hmi);
+}
+
+void ADCIntelligentVehicle::on_pBtn_low_beam_open_clicked()
+{
+    iv::hmi::HMIBasic hmi;
+    hmi.mbjinguang = true;
+    ShareHMIMsg(hmi);
+}
+
+void ADCIntelligentVehicle::on_pBtn_low_beam_close_clicked()
+{
+    iv::hmi::HMIBasic hmi;
+    hmi.mbjinguang = false;
+    ShareHMIMsg(hmi);
+}
+
+void ADCIntelligentVehicle::on_pBtn_high_beam_open_clicked()
+{
+    iv::hmi::HMIBasic hmi;
+    hmi.mbyuanguang = true;
+    ShareHMIMsg(hmi);
+}
+
+void ADCIntelligentVehicle::on_pBtn_high_beam_close_clicked()
+{
+    iv::hmi::HMIBasic hmi;
+    hmi.mbyuanguang = false;
+    ShareHMIMsg(hmi);
+}

+ 11 - 0
src/ui/ui_ads_hmi/ADCIntelligentVehicle.h

@@ -206,6 +206,17 @@ private slots:
 
     void on_pb_v2xEn_clicked();
 
+    void on_pBtn_door_open_clicked();
+
+    void on_pBtn_door_close_clicked();
+
+    void on_pBtn_low_beam_open_clicked();
+
+    void on_pBtn_low_beam_close_clicked();
+
+    void on_pBtn_high_beam_open_clicked();
+
+    void on_pBtn_high_beam_close_clicked();
 
 private:
     Ui::ADCIntelligentVehicle *ui;

+ 6 - 0
src/ui/ui_ads_hmi/ADCIntelligentVehicle.qrc

@@ -25,5 +25,11 @@
         <file>light_image/diaotou-red.png</file>
         <file>light_image/diaotou-green.png</file>
         <file>light_image/diaotou-black.png</file>
+        <file>Car-Control-icon/JinGuang-Kai.svg</file>
+        <file>Car-Control-icon/JinGuang-Guan.svg</file>
+        <file>Car-Control-icon/MenJin-Guan.svg</file>
+        <file>Car-Control-icon/MenJin-Kai.svg</file>
+        <file>Car-Control-icon/YuanGuang-Guan.svg</file>
+        <file>Car-Control-icon/YuanGuang-Kai.svg</file>
     </qresource>
 </RCC>

+ 76 - 3
src/ui/ui_ads_hmi/ADCIntelligentVehicle.ui

@@ -98,7 +98,7 @@
      </rect>
     </property>
     <property name="currentIndex">
-     <number>1</number>
+     <number>2</number>
     </property>
     <widget class="QWidget" name="page_0">
      <widget class="QGroupBox" name="groupBox_2">
@@ -2332,6 +2332,80 @@ p, li { white-space: pre-wrap; }
       <zorder>label_21</zorder>
       <zorder>label_25</zorder>
      </widget>
+     <widget class="QGroupBox" name="groupBox_13">
+      <property name="enabled">
+       <bool>true</bool>
+      </property>
+      <property name="geometry">
+       <rect>
+        <x>10</x>
+        <y>650</y>
+        <width>211</width>
+        <height>151</height>
+       </rect>
+      </property>
+      <property name="styleSheet">
+       <string notr="true">color: rgb(238, 238, 236);
+background-color: rgb(85, 87, 83);</string>
+      </property>
+      <property name="title">
+       <string>小巴调试</string>
+      </property>
+      <widget class="QWidget" name="">
+       <property name="geometry">
+        <rect>
+         <x>21</x>
+         <y>26</y>
+         <width>168</width>
+         <height>107</height>
+        </rect>
+       </property>
+       <layout class="QGridLayout" name="gridLayout">
+        <item row="0" column="0">
+         <widget class="QPushButton" name="pBtn_door_open">
+          <property name="text">
+           <string>车门开</string>
+          </property>
+         </widget>
+        </item>
+        <item row="0" column="1">
+         <widget class="QPushButton" name="pBtn_door_close">
+          <property name="text">
+           <string>车门关</string>
+          </property>
+         </widget>
+        </item>
+        <item row="1" column="0">
+         <widget class="QPushButton" name="pBtn_low_beam_open">
+          <property name="text">
+           <string>近光灯开</string>
+          </property>
+         </widget>
+        </item>
+        <item row="1" column="1">
+         <widget class="QPushButton" name="pBtn_low_beam_close">
+          <property name="text">
+           <string>近光灯关</string>
+          </property>
+         </widget>
+        </item>
+        <item row="2" column="0">
+         <widget class="QPushButton" name="pBtn_high_beam_open">
+          <property name="text">
+           <string>远光灯开</string>
+          </property>
+         </widget>
+        </item>
+        <item row="2" column="1">
+         <widget class="QPushButton" name="pBtn_high_beam_close">
+          <property name="text">
+           <string>远光灯关</string>
+          </property>
+         </widget>
+        </item>
+       </layout>
+      </widget>
+     </widget>
     </widget>
    </widget>
    <widget class="QWidget" name="widget" native="true">
@@ -2459,7 +2533,7 @@ p, li { white-space: pre-wrap; }
      <x>0</x>
      <y>0</y>
      <width>1900</width>
-     <height>22</height>
+     <height>28</height>
     </rect>
    </property>
   </widget>
@@ -2477,7 +2551,6 @@ p, li { white-space: pre-wrap; }
  <resources>
   <include location="ADCIntelligentVehicle.qrc"/>
   <include location="ADCIntelligentVehicle.qrc"/>
-  <include location="ADCIntelligentVehicle.qrc"/>
  </resources>
  <connections>
   <connection>

+ 1 - 0
src/ui/ui_ads_hmi/Car-Control-icon/JinGuang-Guan.svg

@@ -0,0 +1 @@
+<?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg t="1623727712053" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="3848" xmlns:xlink="http://www.w3.org/1999/xlink" width="200" height="200"><defs><style type="text/css"></style></defs><path d="M473.349 320C451.078 384.54 440 448.756 440 512.83c0 63.946 11.033 127.603 33.204 191.17H680c106.039 0 192-85.961 192-192s-85.961-192-192-192H473.349z m-16.883-48H680c132.548 0 240 107.452 240 240S812.548 752 680 752H456.387a24 24 0 0 1-22.454-15.526C405.978 662.402 392 587.854 392 512.831c0-75.064 13.992-150.135 41.977-225.213A24 24 0 0 1 456.466 272z m-128.903 60.942c12.734-3.677 26.039 3.664 29.716 16.399 3.678 12.734-3.664 26.039-16.398 29.717l-207.751 60c-12.734 3.677-26.04-3.664-29.717-16.399-3.678-12.734 3.664-26.039 16.398-29.717l207.752-60z m0 144c12.734-3.677 26.039 3.664 29.716 16.399 3.678 12.734-3.664 26.039-16.398 29.717l-207.751 60c-12.734 3.677-26.04-3.664-29.717-16.399-3.678-12.734 3.664-26.039 16.398-29.717l207.752-60z m0 144c12.734-3.677 26.039 3.664 29.716 16.399 3.678 12.734-3.664 26.039-16.398 29.717l-207.751 60c-12.734 3.677-26.04-3.664-29.717-16.399-3.678-12.734 3.664-26.039 16.398-29.717l207.752-60z" p-id="3849" fill="#bfbfbf"></path></svg>

+ 1 - 0
src/ui/ui_ads_hmi/Car-Control-icon/JinGuang-Kai.svg

@@ -0,0 +1 @@
+<?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg t="1623727299416" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="1557" xmlns:xlink="http://www.w3.org/1999/xlink" width="200" height="200"><defs><style type="text/css"></style></defs><path d="M473.349 320C451.078 384.54 440 448.756 440 512.83c0 63.946 11.033 127.603 33.204 191.17H680c106.039 0 192-85.961 192-192s-85.961-192-192-192H473.349z m-16.883-48H680c132.548 0 240 107.452 240 240S812.548 752 680 752H456.387a24 24 0 0 1-22.454-15.526C405.978 662.402 392 587.854 392 512.831c0-75.064 13.992-150.135 41.977-225.213A24 24 0 0 1 456.466 272z m-128.903 60.942c12.734-3.677 26.039 3.664 29.716 16.399 3.678 12.734-3.664 26.039-16.398 29.717l-207.751 60c-12.734 3.677-26.04-3.664-29.717-16.399-3.678-12.734 3.664-26.039 16.398-29.717l207.752-60z m0 144c12.734-3.677 26.039 3.664 29.716 16.399 3.678 12.734-3.664 26.039-16.398 29.717l-207.751 60c-12.734 3.677-26.04-3.664-29.717-16.399-3.678-12.734 3.664-26.039 16.398-29.717l207.752-60z m0 144c12.734-3.677 26.039 3.664 29.716 16.399 3.678 12.734-3.664 26.039-16.398 29.717l-207.751 60c-12.734 3.677-26.04-3.664-29.717-16.399-3.678-12.734 3.664-26.039 16.398-29.717l207.752-60z" p-id="1558" fill="#c6c01f"></path></svg>

+ 1 - 0
src/ui/ui_ads_hmi/Car-Control-icon/MenJin-Guan.svg

@@ -0,0 +1 @@
+<?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg t="1623727498511" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="2985" xmlns:xlink="http://www.w3.org/1999/xlink" width="200" height="200"><defs><style type="text/css"></style></defs><path d="M870.4 133.12c11.264 0 20.48 9.216 20.48 20.48v716.8c0 11.264-9.216 20.48-20.48 20.48H153.6c-11.264 0-20.48-9.216-20.48-20.48V153.6c0-11.264 9.216-20.48 20.48-20.48h716.8m0-30.72H153.6c-28.672 0-51.2 22.528-51.2 51.2v716.8c0 28.672 22.528 51.2 51.2 51.2h716.8c28.672 0 51.2-22.528 51.2-51.2V153.6c0-28.672-22.528-51.2-51.2-51.2z" p-id="2986" fill="#d6204b"></path><path d="M404.48 450.56c-14.336 0-25.6 11.264-25.6 25.6v71.68c0 14.336 11.264 25.6 25.6 25.6s25.6-11.264 25.6-25.6v-71.68c0-14.336-11.264-25.6-25.6-25.6zM619.52 450.56c-14.336 0-25.6 11.264-25.6 25.6v71.68c0 14.336 11.264 25.6 25.6 25.6s25.6-11.264 25.6-25.6v-71.68c0-14.336-11.264-25.6-25.6-25.6zM532.48 102.4h-40.96v819.2h40.96z" p-id="2987" fill="#d6204b"></path></svg>

+ 1 - 0
src/ui/ui_ads_hmi/Car-Control-icon/MenJin-Kai.svg

@@ -0,0 +1 @@
+<?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg t="1623727531340" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="3243" xmlns:xlink="http://www.w3.org/1999/xlink" width="200" height="200"><defs><style type="text/css"></style></defs><path d="M870.4 133.12c11.264 0 20.48 9.216 20.48 20.48v716.8c0 11.264-9.216 20.48-20.48 20.48H153.6c-11.264 0-20.48-9.216-20.48-20.48V153.6c0-11.264 9.216-20.48 20.48-20.48h716.8m0-30.72H153.6c-28.672 0-51.2 22.528-51.2 51.2v716.8c0 28.672 22.528 51.2 51.2 51.2h716.8c28.672 0 51.2-22.528 51.2-51.2V153.6c0-28.672-22.528-51.2-51.2-51.2z" p-id="3244" fill="#d6204b"></path><path d="M147.456 134.144L440.32 294.912v434.176L147.456 889.856c-8.192-3.072-14.336-10.24-14.336-19.456V153.6c0-9.216 6.144-17.408 14.336-19.456M153.6 102.4c-28.672 0-51.2 22.528-51.2 51.2v716.8c0 28.672 22.528 51.2 51.2 51.2l307.2-167.936c6.144-4.096 10.24-10.24 10.24-18.432V288.768c0-7.168-4.096-14.336-10.24-18.432L153.6 102.4zM876.544 134.144c8.192 3.072 14.336 10.24 14.336 19.456v716.8c0 9.216-6.144 17.408-14.336 19.456L583.68 729.088V294.912l292.864-160.768M870.4 102.4L563.2 270.336c-6.144 4.096-10.24 10.24-10.24 18.432v446.464c0 7.168 4.096 14.336 10.24 18.432L870.4 921.6c28.672 0 51.2-22.528 51.2-51.2V153.6c0-28.672-22.528-51.2-51.2-51.2z" p-id="3245" fill="#d6204b"></path><path d="M363.52 450.56c-14.336 0-25.6 11.264-25.6 25.6v71.68c0 14.336 11.264 25.6 25.6 25.6s25.6-11.264 25.6-25.6v-71.68c0-14.336-11.264-25.6-25.6-25.6zM660.48 450.56c-14.336 0-25.6 11.264-25.6 25.6v71.68c0 14.336 11.264 25.6 25.6 25.6s25.6-11.264 25.6-25.6v-71.68c0-14.336-11.264-25.6-25.6-25.6z" p-id="3246" fill="#d6204b"></path></svg>

+ 1 - 0
src/ui/ui_ads_hmi/Car-Control-icon/YuanGuang-Guan.svg

@@ -0,0 +1 @@
+<?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg t="1623727745272" class="icon" viewBox="0 0 1365 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="4320" xmlns:xlink="http://www.w3.org/1999/xlink" width="266.6015625" height="200"><defs><style type="text/css"></style></defs><path d="M582.0416 139.946667C606.583467 64.034133 681.130667 13.994667 760.832 22.391467 1096.533333 57.924267 1352.704 261.632 1352.704 512c0 250.333867-256.2048 454.075733-591.9744 489.5744-82.261333 8.669867-158.993067-44.919467-180.906667-124.893867A1375.0272 1375.0272 0 0 1 530.773333 512c0-116.053333 14.472533-230.331733 42.769067-340.992l6.2464-23.6544 2.218667-7.441067z m96.5632 34.474666l-6.212267 23.483734A1273.070933 1273.070933 0 0 0 633.173333 512c0 115.131733 15.36 228.317867 45.397334 337.578667 8.772267 32.0512 39.5264 53.521067 71.406933 50.176 289.211733-30.583467 500.3264-198.4512 500.3264-387.754667 0-189.303467-211.080533-357.1712-500.3264-387.754667-31.880533-3.345067-62.634667 18.1248-71.406933 50.176zM475.101867 144.5888H31.402667a25.6 25.6 0 0 0 0 51.2h443.665066a25.6 25.6 0 1 0 0-51.2zM431.104 311.808H31.4368a25.6 25.6 0 1 0 0 51.2h399.701333a25.6 25.6 0 1 0 0-51.2zM422.673067 478.958933H31.402667a25.6 25.6 0 1 0 0 51.2h391.202133a25.6 25.6 0 1 0 0-51.2zM431.104 646.144H31.4368a25.6 25.6 0 1 0 0 51.2h399.701333a25.6 25.6 0 1 0 0-51.2zM475.101867 813.3632H31.402667a25.6 25.6 0 1 0 0 51.2h443.665066a25.6 25.6 0 1 0 0-51.2z" fill="#bfbfbf" p-id="4321"></path></svg>

+ 1 - 0
src/ui/ui_ads_hmi/Car-Control-icon/YuanGuang-Kai.svg

@@ -0,0 +1 @@
+<?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg t="1623727434071" class="icon" viewBox="0 0 1365 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="2048" xmlns:xlink="http://www.w3.org/1999/xlink" width="266.6015625" height="200"><defs><style type="text/css"></style></defs><path d="M582.0416 139.946667C606.583467 64.034133 681.130667 13.994667 760.832 22.391467 1096.533333 57.924267 1352.704 261.632 1352.704 512c0 250.333867-256.2048 454.075733-591.9744 489.5744-82.261333 8.669867-158.993067-44.919467-180.906667-124.893867A1375.0272 1375.0272 0 0 1 530.773333 512c0-116.053333 14.472533-230.331733 42.769067-340.992l6.2464-23.6544 2.218667-7.441067z m96.5632 34.474666l-6.212267 23.483734A1273.070933 1273.070933 0 0 0 633.173333 512c0 115.131733 15.36 228.317867 45.397334 337.578667 8.772267 32.0512 39.5264 53.521067 71.406933 50.176 289.211733-30.583467 500.3264-198.4512 500.3264-387.754667 0-189.303467-211.080533-357.1712-500.3264-387.754667-31.880533-3.345067-62.634667 18.1248-71.406933 50.176zM475.101867 144.5888H31.402667a25.6 25.6 0 0 0 0 51.2h443.665066a25.6 25.6 0 1 0 0-51.2zM431.104 311.808H31.4368a25.6 25.6 0 1 0 0 51.2h399.701333a25.6 25.6 0 1 0 0-51.2zM422.673067 478.958933H31.402667a25.6 25.6 0 1 0 0 51.2h391.202133a25.6 25.6 0 1 0 0-51.2zM431.104 646.144H31.4368a25.6 25.6 0 1 0 0 51.2h399.701333a25.6 25.6 0 1 0 0-51.2zM475.101867 813.3632H31.402667a25.6 25.6 0 1 0 0 51.2h443.665066a25.6 25.6 0 1 0 0-51.2z" fill="#c6c01f" p-id="2049"></path></svg>

+ 3 - 0
src/ui/ui_ads_hmi/common/hmi_type.h

@@ -8,6 +8,9 @@ struct HMIBasic {
     bool mbPause = false;
     bool mbBocheMode = false;
     bool mbbusmode = false;
+    bool mbchemen = false;
+    bool mbjinguang = false;
+    bool mbyuanguang = false;
 };
 typedef boost::shared_ptr<HMIBasic> Decition;	//决策
 }