|
@@ -7,6 +7,8 @@
|
|
|
|
|
|
extern std::string gstrmemgps;
|
|
|
extern std::string gstrvin;
|
|
|
+extern std::string gstrLat;
|
|
|
+extern std::string gstrLon;
|
|
|
/**
|
|
|
常量 值 描述
|
|
|
QHostAddress::Null 0 空地址对象,相当于QHostAddress()。
|
|
@@ -187,6 +189,22 @@ void ListenV2xStReq(const char * strdata,const unsigned int nSize,const unsigned
|
|
|
}
|
|
|
}
|
|
|
|
|
|
+//vbu数据处理
|
|
|
+void ListenObu(const char * strdata,const unsigned int nSize,const unsigned int index,const QDateTime * dt,const char * strmemname)
|
|
|
+{
|
|
|
+// iv::v2x::v2xStReq xv2xStReqMsg;
|
|
|
+// if(!xv2xStReqMsg.ParseFromArray(strdata,nSize))
|
|
|
+// {
|
|
|
+// gIvlog->error("hmi", "iv::v2x::xv2xStReqMsg::ListenV2xStReq parse error");
|
|
|
+// return;
|
|
|
+// }
|
|
|
+// if(xv2xStReqMsg.v2xstreq())
|
|
|
+// {
|
|
|
+// gAV->UpdateV2xStEn(gAV->mv2xStEn);
|
|
|
+// gIvlog->info("hmi", "v2x enable request %d",gAV->mv2xStEn);
|
|
|
+// }
|
|
|
+}
|
|
|
+
|
|
|
/**
|
|
|
* @brief ADCIntelligentVehicle::ADCIntelligentVehicle
|
|
|
* @param parent
|
|
@@ -345,11 +363,11 @@ ADCIntelligentVehicle::ADCIntelligentVehicle(QWidget *parent)
|
|
|
ModuleFun fundecition =std::bind(&ADCIntelligentVehicle::UpdateDecition,this,std::placeholders::_1,std::placeholders::_2,std::placeholders::_3,std::placeholders::_4,std::placeholders::_5);
|
|
|
|
|
|
// mpaDecition = iv::modulecomm::RegisterRecvPlus("decition",fundecition);
|
|
|
- mpaDecition = iv::modulecomm::RegisterRecvPlus("deciton",fundecition);
|
|
|
-
|
|
|
+ mpaDecition = iv::modulecomm::RegisterRecvPlus("deciton",fundecition);
|
|
|
mpaLidar = iv::modulecomm::RegisterRecv("lidar_obs",ListenOBS);
|
|
|
-
|
|
|
+ mpaObu = iv::modulecomm::RegisterRecv("obu",ListenObu);
|
|
|
mpaHMI = iv::modulecomm::RegisterSend("hmi",10*sizeof(iv::hmi::HMIBasic),10);
|
|
|
+ mpadst = iv::modulecomm::RegisterSend("xodrreq",1000,1);//地图站点gps信息
|
|
|
|
|
|
iv::modulecomm::RegisterRecv("v2xStReq", ListenV2xStReq);
|
|
|
mp_v2xStSend = iv::modulecomm::RegisterSend("v2xStEn",1000,1);
|
|
@@ -430,6 +448,8 @@ ADCIntelligentVehicle::ADCIntelligentVehicle(QWidget *parent)
|
|
|
#endif
|
|
|
|
|
|
ui->lineEdit_vin->setText(QString::fromStdString(gstrvin));
|
|
|
+ mdLon = QString::fromStdString(gstrLon).toDouble();
|
|
|
+ mdLat = QString::fromStdString(gstrLat).toDouble();
|
|
|
}
|
|
|
|
|
|
/**
|
|
@@ -2068,15 +2088,27 @@ void ADCIntelligentVehicle::on_button_map_set_clicked()
|
|
|
tr("Text Files (*.xodr)"));
|
|
|
if (fileName.isEmpty())
|
|
|
{
|
|
|
- QMessageBox msgBox(QMessageBox::Warning, tr("警告"),
|
|
|
+ QMessageBox msgBox(QMessageBox::Warning, tr("警告"),
|
|
|
"No Map Selected", 0, this);
|
|
|
- msgBox.addButton(tr("OK"), QMessageBox::AcceptRole);
|
|
|
+ msgBox.addButton(tr("OK"), QMessageBox::AcceptRole);
|
|
|
// msgBox.addButton(tr("&Continue"), QMessageBox::RejectRole);
|
|
|
// if (msgBox.exec() == QMessageBox::AcceptRole)
|
|
|
// qDebug()<<"accept";
|
|
|
// else
|
|
|
// qDebug()<<"reject";
|
|
|
- }
|
|
|
+ }else{
|
|
|
+ //发送地图文件名到driver_map_xodrload
|
|
|
+ iv::hmi::hmimsg hmi;
|
|
|
+ hmi.set_mapname(fileName.toStdString());
|
|
|
+ ShareHMIMsgPro(hmi);
|
|
|
+
|
|
|
+ //发送站点gps信息
|
|
|
+ xodrobj xo;
|
|
|
+ xo.flon = mdLon;
|
|
|
+ xo.flat = mdLat;
|
|
|
+ xo.lane = 1;
|
|
|
+ iv::modulecomm::ModuleSendMsg(mpadst,(char *)&xo,sizeof(xodrobj));
|
|
|
+ }
|
|
|
}
|
|
|
|
|
|
void ADCIntelligentVehicle::on_button_vin_set_clicked()
|