Procházet zdrojové kódy

controller module add turnlight logic not test and cantool change some logic not test

chenxiaowei před 1 rokem
rodič
revize
cab1ed6017

+ 26 - 23
src/controller/controller_changan_shenlan_v2/main.cpp

@@ -119,16 +119,19 @@ typedef struct
 
 typedef struct
 {
+    uint8_t CdcDoor;
+    uint8_t res1;
+    uint8_t res2;
     uint8_t ADS_UDLCTurnLightReq;
-} ECU_36E_t;
+} ECU_25E_t;  //zhuanxiangdeng IDgenghuan
 
 unsigned char byte_1C4[64];//byte_144[8];
 unsigned char byte_24E[64];
-unsigned char byte_36E[64];
+unsigned char byte_25E[32];
 
 ECU_1C4_t _m1C4 = {0,0,0,0};
 ECU_24E_t _m24E = {0,0,0,0,0,0,0,0,0,0,0};
-ECU_36E_t _m36E = {0};
+ECU_25E_t _m25E = {0,0,0,0};
 
 void ExecSend();
 
@@ -339,14 +342,14 @@ void executeDecition(const iv::brain::decition &decition)
     //byte_24E[13] = ((_m24E.ACC_AccTrqReq & (0x1FU)<<3))| ((_m24E.ACC_AccTrqReqActive & (0x01U)) << 2);
     byte_24E[13] = (((_m24E.ACC_AccTrqReq & (0x1FU))<<3))| ((_m24E.ACC_AccTrqReqActive & (0x01U)) << 2);
 
-//    if(decition.leftlamp() == true && decition.rightlamp() == false)
-//        _m36E.ADS_UDLCTurnLightReq = 3;
-//    else if(decition.leftlamp() == false && decition.rightlamp() == true)
-//        _m36E.ADS_UDLCTurnLightReq = 4;
-//    else
-//        _m36E.ADS_UDLCTurnLightReq = 0;
+    if(decition.leftlamp() == true && decition.rightlamp() == false)
+        _m25E.ADS_UDLCTurnLightReq = 3;
+    else if(decition.leftlamp() == false && decition.rightlamp() == true)
+        _m25E.ADS_UDLCTurnLightReq = 4;
+    else
+        _m25E.ADS_UDLCTurnLightReq = 0;
 
-//    byte_36E[0] = ((_m36E.ADS_UDLCTurnLightReq & (0x07U)) << 5);
+    byte_25E[3] = ((_m25E.ADS_UDLCTurnLightReq & (0x07U)));
 
 }
 
@@ -526,19 +529,19 @@ void ExecSend()
     xmsg.set_channel(0);
     xmsg.set_index(gnIndex);
 
-//    xraw.set_id(0x36E);
-//    xraw.set_data(byte_36E,8);
-//    xraw.set_bext(false);
-//    xraw.set_bremote(false);
-//    xraw.set_len(8);
-//    if(nCount == 10)
-//    {
-//        iv::can::canraw * pxraw36E = xmsg.add_rawmsg();
-//        pxraw36E->CopyFrom(xraw);
-//        nCount = 0;
-//    }
-//    xmsg.set_channel(0);
-//    xmsg.set_index(gnIndex);
+    xraw.set_id(0x25E);
+    xraw.set_data(byte_25E,32);
+    xraw.set_bext(false);
+    xraw.set_bremote(false);
+    xraw.set_len(32);
+    if(nCount == 10)
+    {
+        iv::can::canraw * pxraw25E = xmsg.add_rawmsg();
+        pxraw25E->CopyFrom(xraw);
+        nCount = 0;
+    }
+    xmsg.set_channel(0);
+    xmsg.set_index(gnIndex);
 
     gnIndex++;
     xmsg.set_mstime(QDateTime::currentMSecsSinceEpoch());

+ 5 - 3
src/tool/adc_cantool/window/ChassisAnalysisWindow/ChassisAnalysisWindow.cpp

@@ -49,7 +49,7 @@ ChassisAnalysisWindow::ChassisAnalysisWindow(QWidget *parent, Backend &backend)
 
     connect(ui->checkButton, SIGNAL(released()), this, SLOT(checkChassisSignal()));
 //    connect(&backend(), SIGNAL(beginMeasurement()), this, SLOT(msgAnalysis()));
-    connect( _backend.getTrace(), SIGNAL(beforeAppend(int)), this, SLOT(msgAnalysis()));
+    connect( _backend.getTrace(), SIGNAL(beforeAppend(int)), this, SLOT(msgAnalysis(int)));
     connect(ui->clearButton, SIGNAL(released()), this, SLOT(clearCheckResult()));
 }
 
@@ -88,13 +88,15 @@ void ChassisAnalysisWindow::clearCheckResult()
     setLED(ui->label_accresult, 0, 10);
     setLED(ui->label_angrtresult,0,10);
 }
-void ChassisAnalysisWindow::msgAnalysis()
+void ChassisAnalysisWindow::msgAnalysis(int num_messages)
 {
     CanTrace *trace = _backend.getTrace();
     int start_id = trace->size();
 //    uint8_t data=0;
 
-    for (int i=0; i<start_id; i++) {
+//    for (int i=0; i<start_id; i++)
+    for (int i=start_id; i<start_id + num_messages; i++)//20230607,zuihouyizhen shuju debug
+    {
         const CanMessage *msg = trace->getMessage(i);
         if(ShenLanCANFD)
             shenLanCANFDSignalAnalysis(msg);

+ 1 - 1
src/tool/adc_cantool/window/ChassisAnalysisWindow/ChassisAnalysisWindow.h

@@ -36,7 +36,7 @@ private slots:
 //    void refreshInterfaces();
 //    void sendRawMessage();
     void checkChassisSignal();
-    void msgAnalysis();
+    void msgAnalysis(int num_messages);
     void clearCheckResult();
 
 private: