Browse Source

Add v2v data show

dongjunhong 2 months ago
parent
commit
a69b81ab17
4 changed files with 239 additions and 2 deletions
  1. 5 1
      src/v2x/v2xpro/mainwindow.cpp
  2. 223 1
      src/v2x/v2xpro/mainwindow.ui
  3. 9 0
      src/v2x/v2xpro/pc5.cpp
  4. 2 0
      src/v2x/v2xpro/pc5.h

+ 5 - 1
src/v2x/v2xpro/mainwindow.cpp

@@ -29,7 +29,6 @@ MainWindow::MainWindow(QWidget *parent) :
     timerV2V->start(100);
 
     sendProto_flag=false;
-
     initUI();
     initMemory();
     initproto();
@@ -1157,6 +1156,11 @@ void MainWindow::outV2VData(QMap<QString, OBUCarFormation> V2VMessage)
                                            " 宽:" + QString::number(y) + "m"+ \
                                            " 高:" + QString::number(z) + "m"+ \
                                             "]\n\t方向盘转角:"+QString::number(V2Vcar.steering_wheel_angle)+ "°");
+                QByteArray v2v_error=m_pc5->upV2Vdatashow();
+
+
+                ui->textBr_v2vdata_2->setText(QTime::currentTime().toString("hh:mm:ss.zzz")+":"+v2v_error);
+
 
             }
         }

+ 223 - 1
src/v2x/v2xpro/mainwindow.ui

@@ -2659,7 +2659,7 @@ p, li { white-space: pre-wrap; }
            <x>10</x>
            <y>10</y>
            <width>395</width>
-           <height>231</height>
+           <height>161</height>
           </rect>
          </property>
          <property name="sizePolicy">
@@ -3340,6 +3340,228 @@ p, li { white-space: pre-wrap; }
           <bool>true</bool>
          </property>
         </widget>
+        <widget class="QTextBrowser" name="textBr_v2vdata_2">
+         <property name="geometry">
+          <rect>
+           <x>10</x>
+           <y>180</y>
+           <width>395</width>
+           <height>51</height>
+          </rect>
+         </property>
+         <property name="sizePolicy">
+          <sizepolicy hsizetype="Expanding" vsizetype="Expanding">
+           <horstretch>0</horstretch>
+           <verstretch>0</verstretch>
+          </sizepolicy>
+         </property>
+         <property name="palette">
+          <palette>
+           <active>
+            <colorrole role="WindowText">
+             <brush brushstyle="SolidPattern">
+              <color alpha="255">
+               <red>238</red>
+               <green>238</green>
+               <blue>236</blue>
+              </color>
+             </brush>
+            </colorrole>
+            <colorrole role="Button">
+             <brush brushstyle="SolidPattern">
+              <color alpha="255">
+               <red>60</red>
+               <green>60</green>
+               <blue>60</blue>
+              </color>
+             </brush>
+            </colorrole>
+            <colorrole role="Text">
+             <brush brushstyle="SolidPattern">
+              <color alpha="255">
+               <red>238</red>
+               <green>238</green>
+               <blue>236</blue>
+              </color>
+             </brush>
+            </colorrole>
+            <colorrole role="ButtonText">
+             <brush brushstyle="SolidPattern">
+              <color alpha="255">
+               <red>238</red>
+               <green>238</green>
+               <blue>236</blue>
+              </color>
+             </brush>
+            </colorrole>
+            <colorrole role="Base">
+             <brush brushstyle="SolidPattern">
+              <color alpha="255">
+               <red>60</red>
+               <green>60</green>
+               <blue>60</blue>
+              </color>
+             </brush>
+            </colorrole>
+            <colorrole role="Window">
+             <brush brushstyle="SolidPattern">
+              <color alpha="255">
+               <red>60</red>
+               <green>60</green>
+               <blue>60</blue>
+              </color>
+             </brush>
+            </colorrole>
+            <colorrole role="PlaceholderText">
+             <brush brushstyle="NoBrush">
+              <color alpha="128">
+               <red>238</red>
+               <green>238</green>
+               <blue>236</blue>
+              </color>
+             </brush>
+            </colorrole>
+           </active>
+           <inactive>
+            <colorrole role="WindowText">
+             <brush brushstyle="SolidPattern">
+              <color alpha="255">
+               <red>238</red>
+               <green>238</green>
+               <blue>236</blue>
+              </color>
+             </brush>
+            </colorrole>
+            <colorrole role="Button">
+             <brush brushstyle="SolidPattern">
+              <color alpha="255">
+               <red>60</red>
+               <green>60</green>
+               <blue>60</blue>
+              </color>
+             </brush>
+            </colorrole>
+            <colorrole role="Text">
+             <brush brushstyle="SolidPattern">
+              <color alpha="255">
+               <red>238</red>
+               <green>238</green>
+               <blue>236</blue>
+              </color>
+             </brush>
+            </colorrole>
+            <colorrole role="ButtonText">
+             <brush brushstyle="SolidPattern">
+              <color alpha="255">
+               <red>238</red>
+               <green>238</green>
+               <blue>236</blue>
+              </color>
+             </brush>
+            </colorrole>
+            <colorrole role="Base">
+             <brush brushstyle="SolidPattern">
+              <color alpha="255">
+               <red>60</red>
+               <green>60</green>
+               <blue>60</blue>
+              </color>
+             </brush>
+            </colorrole>
+            <colorrole role="Window">
+             <brush brushstyle="SolidPattern">
+              <color alpha="255">
+               <red>60</red>
+               <green>60</green>
+               <blue>60</blue>
+              </color>
+             </brush>
+            </colorrole>
+            <colorrole role="PlaceholderText">
+             <brush brushstyle="NoBrush">
+              <color alpha="128">
+               <red>238</red>
+               <green>238</green>
+               <blue>236</blue>
+              </color>
+             </brush>
+            </colorrole>
+           </inactive>
+           <disabled>
+            <colorrole role="WindowText">
+             <brush brushstyle="SolidPattern">
+              <color alpha="255">
+               <red>238</red>
+               <green>238</green>
+               <blue>236</blue>
+              </color>
+             </brush>
+            </colorrole>
+            <colorrole role="Button">
+             <brush brushstyle="SolidPattern">
+              <color alpha="255">
+               <red>60</red>
+               <green>60</green>
+               <blue>60</blue>
+              </color>
+             </brush>
+            </colorrole>
+            <colorrole role="Text">
+             <brush brushstyle="SolidPattern">
+              <color alpha="255">
+               <red>238</red>
+               <green>238</green>
+               <blue>236</blue>
+              </color>
+             </brush>
+            </colorrole>
+            <colorrole role="ButtonText">
+             <brush brushstyle="SolidPattern">
+              <color alpha="255">
+               <red>238</red>
+               <green>238</green>
+               <blue>236</blue>
+              </color>
+             </brush>
+            </colorrole>
+            <colorrole role="Base">
+             <brush brushstyle="SolidPattern">
+              <color alpha="255">
+               <red>60</red>
+               <green>60</green>
+               <blue>60</blue>
+              </color>
+             </brush>
+            </colorrole>
+            <colorrole role="Window">
+             <brush brushstyle="SolidPattern">
+              <color alpha="255">
+               <red>60</red>
+               <green>60</green>
+               <blue>60</blue>
+              </color>
+             </brush>
+            </colorrole>
+            <colorrole role="PlaceholderText">
+             <brush brushstyle="NoBrush">
+              <color alpha="128">
+               <red>238</red>
+               <green>238</green>
+               <blue>236</blue>
+              </color>
+             </brush>
+            </colorrole>
+           </disabled>
+          </palette>
+         </property>
+         <property name="html">
+          <string>&lt;!DOCTYPE HTML PUBLIC &quot;-//W3C//DTD HTML 4.0//EN&quot; &quot;http://www.w3.org/TR/REC-html40/strict.dtd&quot;&gt;
+&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;&quot;&gt;&lt;br /&gt;&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
+         </property>
+        </widget>
        </widget>
        <widget class="QWidget" name="tab_5">
         <attribute name="title">

+ 9 - 0
src/v2x/v2xpro/pc5.cpp

@@ -728,6 +728,14 @@ QByteArray PC5::upCustomshow()
     CustomshowData.clear();
     return returndata;
 }
+QByteArray PC5::upV2Vdatashow()
+{
+    QByteArray returndata;
+    returndata=V2VshowData;
+    V2VshowData.clear();
+    return returndata;
+}
+
 void PC5::replyMessage()
 {
     //queue_mutex.lock();
@@ -1005,6 +1013,7 @@ void PC5::replyMessage()
                 if (recvBuf[4]==V2V_OthercarInformation)
                 {
                     error_data=error_data+"recv v2v--";
+                    V2VshowData=data.toHex(' ');
                     //qDebug()<<"recv v2vcar ok";
                     OBUCarFormation recv_other_car;
                     QString othervin =QString(data.at(18));

+ 2 - 0
src/v2x/v2xpro/pc5.h

@@ -242,7 +242,9 @@ public:
     bool v2v_enable = false;
     void CustomDataSend(QString data);
     QByteArray CustomshowData;
+    QByteArray V2VshowData;
     QByteArray upCustomshow();
+    QByteArray upV2Vdatashow();
 private:
     QByteArray error_data;//程序状态
     QByteArray datahex;//接收数据显示