瀏覽代碼

ui&brain&platform

HAPO-9# 3 年之前
父節點
當前提交
f3b6444cf2

+ 3 - 2
src/decition/common/common/car_status.h

@@ -217,7 +217,7 @@ namespace iv {
         int rsu_warnlimit_spd=200;  //200代表没有限速
         double rsu_gps_lat=0.0;
         double rsu_gps_lng=0.0;//中心点
-        int iTrafficeLightColor = 3;    //0x0: 红色
+        int iTrafficeLightColor = 4;    //0x0: 红色
         //0x1: 黄色
         //0x2: 绿色
         int vehicle_state_1x=0; //0正常行驶,1减速,2 停车
@@ -228,9 +228,10 @@ namespace iv {
         //0x1: 黄色
         //0x2: 绿色
 
-        int iTrafficeLightTime = 0;     //红绿灯剩余时间
+        int iTrafficeLightTime = 200;     //红绿灯剩余时间
         double iTrafficeLightLat = 0;
         double iTrafficeLightLon = 0;
+        QTime milightCheckTimer;
     };
     typedef boost::serialization::singleton<iv::CarStatus> CarStatusSingleton;//非线程安全,注意多线程加锁,单例模式
 }

+ 5 - 1
src/decition/decition_brain_sf_1x/decition/adc_adapter/hunter_adapter.cpp

@@ -117,7 +117,11 @@ iv::decition::Decition iv::decition::HunterAdapter::getAdapterDeciton(GPS_INS no
 //    }
 
     controlSpeed= dSpeed;
-    controlSpeed=max(controlSpeed,5.0f); //对车子进行限速,车子最大速度是5km/h
+//    controlSpeed=max(controlSpeed,5.0f); //对车子进行限速,车子最大速度是5km/h
+    if(controlSpeed>5.0)
+    {
+        controlSpeed=5.0;
+    }
 
     //0227 10m nei xianzhi shache
     //障碍物距离在3~10米之间,让速度慢慢降到1,当障碍物距离小于3了,直接停车

+ 1 - 0
src/decition/decition_brain_sf_1x/decition/brain.cpp

@@ -1676,6 +1676,7 @@ void iv::decition::BrainDecition::UpdateV2r(const char *pdata, const int ndatasi
     if(group_message.has_radiolightremain())
     {
         ServiceCarStatus.iTrafficeLightTime = group_message.radiolightremain();
+        ServiceCarStatus.milightCheckTimer.start();
     }
     if(group_message.has_radiobroadcastrange())
     {

+ 9 - 0
src/decition/decition_brain_sf_1x/decition/decide_gps_00.cpp

@@ -2076,6 +2076,15 @@ else
     //-----------------------------------------1+X采集车车路协同,end---------------------------------------------
     //-------------------------------traffic light----------------------------------------------------------------------------------------
 
+//ServiceCarStatus.milightCheckTimer.elapsed();
+if(ServiceCarStatus.milightCheckTimer.elapsed()>3)
+{
+   ServiceCarStatus.iTrafficeLightColor=1;//lvdeng
+   ServiceCarStatus.iTrafficeLightTime=200;
+
+}
+
+
     if(traffic_light_gps.gps_lat!=0 && traffic_light_gps.gps_lng!=0){
         traffic_light_pathpoint = Compute00().getNoAngleNearestPointIndex(traffic_light_gps, gpsMapLine);
         //    traffic_light_pathpoint=130;

+ 22 - 2
src/ui/ui_ads_hmi_1px/ADCIntelligentVehicle.cpp

@@ -836,12 +836,32 @@ void ADCIntelligentVehicle::onStateTimerTraffic()
         {
             if(miobuSt == 1)
             {
+                QString eventType;
+                switch(miBroadcastTrafficType){
+                case 1:
+                    eventType = "塌方";
+                    break;
+                case 2:
+                    eventType = "道路施工";
+                    break;
+                case 3:
+                    eventType = "道路结冰";
+                    break;
+                case 4:
+                    eventType = "前方限速";
+                    break;
+                default:
+                    eventType = "";
+                    break;
+                }
+
+
                 ui->button_trafficInfoLight_st->setStyleSheet("background-color: green");
                 ui->textBr_trafficInfo->append(QTime::currentTime().toString("hh:mm:ss.zzz") + \
                                                "\n\t事件范围[ 经度:" + QString::number(miBroadcastGpsLon,'g',6) +\
                                                " 纬度:" + QString::number(miBroadcastGpsLat,'g',6) + \
-                                               " ]\n\t辐射范围: " + QString::number(miBroadcastRange) + \
-                                               "\n\t事件类型: " + QString::number(miBroadcastTrafficType));
+                                               " ]\n\t辐射范围: " + QString::number(miBroadcastRange) + "米" + \
+                                               "\n\t事件类型: " + eventType);
                 switch(micarSt){
                 case 0:
                     ui->lineEd_trafficInfo->setText("正常行驶");

File diff suppressed because it is too large
+ 1360 - 178
src/ui/ui_ads_hmi_1px/ADCIntelligentVehicle.ui


+ 6 - 5
src/v2x/CommunicatePlatform/radio.cpp

@@ -19,7 +19,7 @@ Radio::Radio()
     //20211009,jiaolili
     mivlog = new iv::Ivlog("v2r");
     //shareMem:send
-    mpmem_radio_send_addr = iv::modulecomm::RegisterSend("v2r_send",100,1);
+    mpmem_radio_send_addr = iv::modulecomm::RegisterSend("v2r_send",1000,3);
     m_sVin="A1000000CATARCS02";
     //m_bEnReceive=false;
     m_iAppend=-1;
@@ -77,11 +77,12 @@ void Radio::sendProto(iv::v2r::v2r_send radio_protobuf_send)
     nbytesize = radio_protobuf_send.ByteSize();
     strser = new char[nbytesize];
     bser = radio_protobuf_send.SerializeToArray(strser,nbytesize);
-    if(bser)
+    if(bser) {
+        qDebug()<<"[Radio]:ready send protobuffer"<<endl;
         iv::modulecomm::ModuleSendMsg(mpmem_radio_send_addr,strser,nbytesize);
-    else
-    {
-        mivlog->error("sendData","[%s:] radio serialize error.",__func__);
+        qDebug()<<"[Radio]:has sended protobuffer"<<endl;
+    } else {
+        //mivlog->error("sendData","[%s:] radio serialize error.",__func__);
 //        gfault->SetFaultState(1, 0, "radio serialize err");
     }
     delete strser;

Some files were not shown because too many files changed in this diff