Browse Source

add mobileye status

lijinliang 3 years ago
parent
commit
c7d0948190

+ 32 - 2
src/ui/ui_ads_hmi/ADCIntelligentVehicle.cpp

@@ -186,6 +186,22 @@ void ListenV2xStReq(const char * strdata,const unsigned int nSize,const unsigned
     }
 }
 
+//v2x使能状态请求
+void ListenMobileye(const char * strdata,const unsigned int nSize,const unsigned int index,const QDateTime * dt,const char * strmemname)
+{
+//    gIvlog->info("hmi", "v2x enable request %d %d",nSize,sizeof(iv::v2x::v2xStReq));
+//    if(nSize < sizeof(iv::v2x::v2xStReq))
+//        return;
+
+    iv::mobileye::mobileye mobMsg;
+    if(!mobMsg.ParseFromArray(strdata,nSize))
+    {
+        gIvlog->error("hmi", "ListenMobileye parse error");
+        return;
+    }
+    gAV->mimobileyeState= 10;
+}
+
 /**
  * @brief ADCIntelligentVehicle::ADCIntelligentVehicle
  * @param parent
@@ -362,6 +378,8 @@ ADCIntelligentVehicle::ADCIntelligentVehicle(QWidget *parent)
     iv::modulecomm::RegisterRecv("v2xStReq", ListenV2xStReq);
     mp_v2xStSend = iv::modulecomm::RegisterSend("v2xStEn",1000,1);
 
+    iv::modulecomm::RegisterRecv("mobileye",ListenMobileye);
+
     mTimeState.start();
 
     mpManualCtrl = iv::modulecomm::RegisterSend("ivmanual",1000,1);
@@ -514,7 +532,7 @@ void ADCIntelligentVehicle::timeoutslot()
 
     is_ok = (ServiceCarStatus.mRadarS>0)?QStringLiteral("ok"):QStringLiteral("error");
     ui->lineEdit_3->setText(is_ok);//毫米波雷达状态
-    ui->lineEdit_15->setText(is_ok);//毫米波雷达状态
+    //ui->lineEdit_15->setText(is_ok);//毫米波雷达状态
 
     if(ServiceCarStatus.mRadarS>0)
     {
@@ -525,11 +543,12 @@ void ADCIntelligentVehicle::timeoutslot()
     {
         ui->pushButton_12->setStyleSheet("background-color:red");
         ui->pushButton_25->setStyleSheet("background-color:red");
+        ServiceCarStatus.mRadarS = -1;
     }
 
     is_ok = (ServiceCarStatus.mLidarS>0)?QStringLiteral("ok"):QStringLiteral("error");
     ui->lineEdit_4->setText(is_ok);//激光雷达状态
-    ui->lineEdit_16->setText(is_ok);//激光雷达状态
+   // ui->lineEdit_16->setText(is_ok);//激光雷达状态
     if(ServiceCarStatus.mLidarS>0)
     {
         ui->pushButton_13->setStyleSheet("background-color: green");
@@ -539,6 +558,16 @@ void ADCIntelligentVehicle::timeoutslot()
     {
         ui->pushButton_13->setStyleSheet("background-color:red");
         ui->pushButton_26->setStyleSheet("background-color:red");
+        ServiceCarStatus.mLidarS = -1;
+    }
+    if(mimobileyeState>0)
+    {
+        ui->Mobileye_st->setStyleSheet("background-color: green");
+    }
+    else
+    {
+        ui->Mobileye_st->setStyleSheet("background-color: red");
+        mimobileyeState = -1;
     }
 
     ui->lineEdit_5->setText(QString::number(mdecition_period)+QStringLiteral("ms"));//决策周期
@@ -769,6 +798,7 @@ void ADCIntelligentVehicle::onStateTimer()
 
     ServiceCarStatus.mLidarS--;  //如果从10减到0,表示没有接收到数据。
     ServiceCarStatus.mRadarS--;
+    mimobileyeState--;
 
     mDataToUI.mInfo.RTKstatus = ServiceCarStatus.mRTKStatus;
     ServiceCarStatus.mRTKStatus = 0;

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

@@ -65,6 +65,7 @@
 #include "brainstate.pb.h"
 #include "canstate.pb.h"
 #include "v2x.pb.h"
+#include "mobileye.pb.h"
 #include "ivlog.h"
 #include "mapreq.pb.h"
 #include "vbox.pb.h"
@@ -322,6 +323,8 @@ private:
 
 private:
     void * mpacanstate;
+public:
+    int mimobileyeState;
 public:
     void UpdateCANState(const char * pdata,const int ndatasize);
 

+ 30 - 38
src/ui/ui_ads_hmi/ADCIntelligentVehicle.ui

@@ -98,7 +98,7 @@
      </rect>
     </property>
     <property name="currentIndex">
-     <number>2</number>
+     <number>1</number>
     </property>
     <widget class="QWidget" name="page_0">
      <widget class="QGroupBox" name="groupBox_2">
@@ -747,7 +747,7 @@
        <rect>
         <x>930</x>
         <y>0</y>
-        <width>431</width>
+        <width>521</width>
         <height>81</height>
        </rect>
       </property>
@@ -775,37 +775,11 @@
         <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>
+         <x>100</x>
+         <y>60</y>
          <width>101</width>
          <height>21</height>
         </rect>
@@ -853,8 +827,8 @@
       <widget class="QPushButton" name="pushButton_26">
        <property name="geometry">
         <rect>
-         <x>10</x>
-         <y>50</y>
+         <x>220</x>
+         <y>60</y>
          <width>81</width>
          <height>21</height>
         </rect>
@@ -871,8 +845,8 @@
       <widget class="QPushButton" name="pushButton_27">
        <property name="geometry">
         <rect>
-         <x>221</x>
-         <y>50</y>
+         <x>10</x>
+         <y>60</y>
          <width>81</width>
          <height>21</height>
         </rect>
@@ -886,6 +860,24 @@
         <string>决策周期</string>
        </property>
       </widget>
+      <widget class="QPushButton" name="Mobileye_st">
+       <property name="geometry">
+        <rect>
+         <x>320</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>Mobileye</string>
+       </property>
+      </widget>
      </widget>
     </widget>
     <widget class="QWidget" name="page_2">
@@ -1974,7 +1966,7 @@ background-color: rgb(85, 87, 83);</string>
 &lt;html&gt;&lt;head&gt;&lt;meta name=&quot;qrichtext&quot; content=&quot;1&quot; /&gt;&lt;style type=&quot;text/css&quot;&gt;
 p, li { white-space: pre-wrap; }
 &lt;/style&gt;&lt;/head&gt;&lt;body style=&quot; font-family:'Ubuntu'; font-size:11pt; font-weight:400; font-style:normal;&quot;&gt;
-&lt;p style=&quot;-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; font-family:'Ubuntu';&quot;&gt;&lt;br /&gt;&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
+&lt;p style=&quot;-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;&lt;br /&gt;&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
        </property>
       </widget>
       <widget class="QLabel" name="label_12">
@@ -2095,7 +2087,7 @@ gridline-color: qlineargradient(spread:pad, x1:0, y1:0, x2:1, y2:0, stop:0 rgba(
 &lt;html&gt;&lt;head&gt;&lt;meta name=&quot;qrichtext&quot; content=&quot;1&quot; /&gt;&lt;style type=&quot;text/css&quot;&gt;
 p, li { white-space: pre-wrap; }
 &lt;/style&gt;&lt;/head&gt;&lt;body style=&quot; font-family:'Ubuntu'; font-size:11pt; font-weight:400; font-style:normal;&quot;&gt;
-&lt;p style=&quot;-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; font-family:'Ubuntu';&quot;&gt;&lt;br /&gt;&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
+&lt;p style=&quot;-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;&lt;br /&gt;&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
        </property>
       </widget>
       <widget class="QTextEdit" name="textEdit_aobzdis_tj">
@@ -2150,7 +2142,7 @@ p, li { white-space: pre-wrap; }
 &lt;html&gt;&lt;head&gt;&lt;meta name=&quot;qrichtext&quot; content=&quot;1&quot; /&gt;&lt;style type=&quot;text/css&quot;&gt;
 p, li { white-space: pre-wrap; }
 &lt;/style&gt;&lt;/head&gt;&lt;body style=&quot; font-family:'Ubuntu'; font-size:11pt; font-weight:400; font-style:normal;&quot;&gt;
-&lt;p style=&quot;-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; font-family:'Ubuntu';&quot;&gt;&lt;br /&gt;&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
+&lt;p style=&quot;-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;&lt;br /&gt;&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
        </property>
       </widget>
       <widget class="QTextEdit" name="textEdit_aocftime_tj">
@@ -2533,7 +2525,7 @@ background-color: rgb(85, 87, 83);</string>
      <x>0</x>
      <y>0</y>
      <width>1900</width>
-     <height>28</height>
+     <height>22</height>
     </rect>
    </property>
   </widget>

+ 1 - 0
src/ui/ui_ads_hmi/common/car_status.h

@@ -71,6 +71,7 @@ public:
 
     int mRadarS = -1;
     int mLidarS = -1;
+    int mMobileyeS = -1;
     int mRTKStatus = 0;
 
     double mLidarObs;

+ 8 - 0
src/ui/ui_ads_hmi/ui_ads_hmi.pro

@@ -53,6 +53,10 @@ SOURCES += \
     ../../include/msgtype/chassis.pb.cc \
     ../../include/msgtype/mapreq.pb.cc  \
     ../../include/msgtype/vbox.pb.cc \
+    ../../include/msgtype/mobileye.pb.cc \
+    ../../include/msgtype/mobileye_lane.pb.cc \
+    ../../include/msgtype/mobileye_obs.pb.cc \
+    ../../include/msgtype/mobileye_tsr.pb.cc \
     ../../include/msgtype/fusionobjectarray.pb.cc \
     ../../include/msgtype/fusionobject.pb.cc
 
@@ -69,6 +73,10 @@ HEADERS += \
     ../../include/msgtype/brainstate.pb.h \
     ../../include/msgtype/decition.pb.h \
     ../../include/msgtype/canstate.pb.h \
+    ../../include/msgtype/mobileye.pb.h \
+    ../../include/msgtype/mobileye_lane.pb.h \
+    ../../include/msgtype/mobileye_obs.pb.h \
+    ../../include/msgtype/mobileye_tsr.pb.h \
     ../../include/msgtype/gpsimu.pb.h \
     ../../include/msgtype/v2x.pb.h \
     ../../include/msgtype/chassis.pb.h \