Browse Source

controller output cycyle

chenxiaowei 2 years ago
parent
commit
c1f8f95a1a
1 changed files with 4 additions and 0 deletions
  1. 4 0
      src/controller/controller_Geely_xingyueL/main.cpp

+ 4 - 0
src/controller/controller_Geely_xingyueL/main.cpp

@@ -199,6 +199,7 @@ void ListenDeciton(const char * strdata,const unsigned int nSize,const unsigned
 void sendthread()
 {
     iv::brain::decition xdecition;
+    static QDateTime dt1 = QDateTime::currentDateTime();
 //    car_control_module.set_target_gear(GearPrkgAssistReq::kTargetGearD);
 //    car_control_module.sm_task_20ms();  // 线控状态机函数
 //QTime time;
@@ -321,7 +322,10 @@ void sendthread()
                        ofstream outfile;
                        outfile.open(filename, ostream::app);
                        QDateTime dt2=QDateTime::currentDateTime();
+                       qint64 msec = dt1.msecsTo(dt2);
+                       dt1=QDateTime::currentDateTime();
                        outfile <<dt2.time().hour()<<":"<<dt2.time().minute()<<":"<<dt2.time().second()<<":"<<dt2.time().msec()<<","
+                              <<"time_cycle"<<","<< msec <<","
                               <<"chasis_status"  << ","  <<(int)car_control_module.get_chassis_err_state()<< ","
                               <<"Decide_ACC"  << ","  <<lastspeedSetVal << ","
 //                              <<"Decide_gear"<< ","  <<lastgearSetVal << ","