|
@@ -126,6 +126,20 @@ void ListenBrainState(const char * strdata,const unsigned int nSize,const unsign
|
|
|
gAShow->UpdateBrainState(xbrainstate);
|
|
|
}
|
|
|
|
|
|
+void ListenVehInfo(const char * strdata,const unsigned int nSize,const unsigned int index,const QDateTime * dt,const char * strmemname)
|
|
|
+{
|
|
|
+ (void)&index;
|
|
|
+ (void)dt;
|
|
|
+ (void)strmemname;
|
|
|
+ iv::veh::vehinfo xvehinfo;
|
|
|
+ if(!xvehinfo.ParseFromArray(strdata,nSize))
|
|
|
+ {
|
|
|
+ std::cout<<"ListenVehInfo Parse error."<<std::endl;
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ gAShow->UpdateOTAVehInfo(xvehinfo);
|
|
|
+}
|
|
|
+
|
|
|
void ListenTraceMap(const char * strdata,const unsigned int nSize,const unsigned int index,const QDateTime * dt,const char * strmemname)
|
|
|
{
|
|
|
(void)&index;
|
|
@@ -161,6 +175,10 @@ void ListenTraceMap(const char * strdata,const unsigned int nSize,const unsigned
|
|
|
{
|
|
|
ListenRadar(strdata,nDataLen,0,0,0);
|
|
|
}
|
|
|
+ if(strncmp(msgname,"otavehinfo",256) == 0)
|
|
|
+ {
|
|
|
+ ListenVehInfo(strdata,nDataLen,0,0,0);
|
|
|
+ }
|
|
|
}
|
|
|
#endif
|
|
|
|
|
@@ -257,6 +275,8 @@ ADCIntelligentShow::ADCIntelligentShow(QWidget *parent) :
|
|
|
pa = iv::modulecomm::RegisterRecv("radar",ListenRadar);
|
|
|
mparadar = pa;
|
|
|
|
|
|
+ pa = iv::modulecomm::RegisterRecv("otavehinfo",ListenVehInfo);
|
|
|
+
|
|
|
mpadst = iv::modulecomm::RegisterSend("xodrreq",1000,1);
|
|
|
|
|
|
|
|
@@ -288,6 +308,10 @@ ADCIntelligentShow::ADCIntelligentShow(QWidget *parent) :
|
|
|
ui->label_station->setStyleSheet("background: transparent; color: white;font: 50px 'Arial';");
|
|
|
ui->label_station->setText("");
|
|
|
|
|
|
+ ui->label_vehinfo->setStyleSheet("color: rgb(220, 220, 220);font: 15px 'Arial';");
|
|
|
+
|
|
|
+ ui->label_vehinfo->setText("No Vehicle Type & VIN Info");
|
|
|
+
|
|
|
|
|
|
|
|
|
if(gvectorpos.size()>0)
|
|
@@ -299,6 +323,7 @@ ADCIntelligentShow::ADCIntelligentShow(QWidget *parent) :
|
|
|
mpDS = new DialogSetting(this);
|
|
|
connect(mpDS,SIGNAL(signalswith(int)),this,SLOT(onSwitchClick(int)));
|
|
|
connect(mpDS,SIGNAL(signalMode(int)),this,SLOT(onModeClick(int)));
|
|
|
+ connect(this,SIGNAL(signalvehinfoupdate()),this,SLOT(onOTAVehInfoUpdate()));
|
|
|
// ui->pushButton_go->setStyleSheet("color: red");
|
|
|
|
|
|
///////////////////////////////////////////////////////////////////////
|
|
@@ -575,7 +600,7 @@ void ADCIntelligentShow::onconnTimer()
|
|
|
{
|
|
|
//ui->connect->setText(QStringLiteral("已连接"));
|
|
|
ui->connect->setStyleSheet("image: url(:/new/pic/connect.png);");
|
|
|
- if(((xTime - mnTimeGPS)>1000) &&(mnstylegps != 0))
|
|
|
+ if((abs(xTime - mnTimeGPS)>1000) &&(mnstylegps != 0))
|
|
|
{
|
|
|
ui->lng->setText(" ");
|
|
|
ui->lat->setText(" ");
|
|
@@ -584,29 +609,29 @@ void ADCIntelligentShow::onconnTimer()
|
|
|
mnstylegps = 0;
|
|
|
}
|
|
|
|
|
|
- if(((xTime - mnTimeLidar)>1000) &&(mnstylelidar != 1))
|
|
|
+ if((abs(xTime - mnTimeLidar)>1000) &&(mnstylelidar != 1))
|
|
|
{
|
|
|
ui->lidarimg->setStyleSheet("background-image: url(:/new/pic/red.png);");
|
|
|
mnstylelidar = 1;
|
|
|
}
|
|
|
- if(((xTime - mnTimeLidar)<1000) &&(mnstylelidar != 2))
|
|
|
+ if((abs(xTime - mnTimeLidar)<1000) &&(mnstylelidar != 2))
|
|
|
{
|
|
|
ui->lidarimg->setStyleSheet("background-image: url(:/new/pic/green.png);");
|
|
|
mnstylelidar = 2;
|
|
|
}
|
|
|
|
|
|
- if(((xTime - mnTimeRADAR)>1000) && (mnstyleradar != 1))
|
|
|
+ if((abs(xTime - mnTimeRADAR)>1000) && (mnstyleradar != 1))
|
|
|
{
|
|
|
ui->radarimg->setStyleSheet("background-image: url(:/new/pic/red.png);");
|
|
|
mnstyleradar = 1;
|
|
|
}
|
|
|
- if(((xTime - mnTimeRADAR)<1000) && (mnstyleradar != 2))
|
|
|
+ if(abs((xTime - mnTimeRADAR)<1000) && (mnstyleradar != 2))
|
|
|
{
|
|
|
ui->radarimg->setStyleSheet("background-image: url(:/new/pic/green.png);");
|
|
|
mnstyleradar = 2;
|
|
|
}
|
|
|
|
|
|
- if((xTime- mnTimeDection)>1000)
|
|
|
+ if(abs(xTime- mnTimeDection)>1000)
|
|
|
{
|
|
|
ui->acc->setText(" ");
|
|
|
ui->swerve->setText(" ");
|
|
@@ -621,6 +646,7 @@ void ADCIntelligentShow::onconnTimer()
|
|
|
}
|
|
|
}
|
|
|
|
|
|
+
|
|
|
if(navigation_data.size()>0)
|
|
|
{
|
|
|
ui->mapimg->setStyleSheet("background-image: url(:/new/pic/green.png);");
|
|
@@ -1125,6 +1151,16 @@ void ADCIntelligentShow::UpdateRADAR(iv::radar::radarobjectarray *pxobj)
|
|
|
mpivmapview->setradar(pxobj);
|
|
|
}
|
|
|
|
|
|
+void ADCIntelligentShow::UpdateOTAVehInfo(iv::veh::vehinfo &pvehinfo)
|
|
|
+{
|
|
|
+ mMutexVehInfo.lock();
|
|
|
+ mvehinfo.CopyFrom(pvehinfo);
|
|
|
+ mMutexVehInfo.unlock();
|
|
|
+ mnVehInfoTime = QDateTime::currentMSecsSinceEpoch();
|
|
|
+
|
|
|
+ emit signalvehinfoupdate();
|
|
|
+}
|
|
|
+
|
|
|
|
|
|
void ADCIntelligentShow::on_pushButton_nextstation_clicked()
|
|
|
{
|
|
@@ -1411,3 +1447,15 @@ bool ADCIntelligentShow::WritePos()
|
|
|
|
|
|
return true;
|
|
|
}
|
|
|
+
|
|
|
+void ADCIntelligentShow::onOTAVehInfoUpdate()
|
|
|
+{
|
|
|
+ iv::veh::vehinfo xvehinfo;
|
|
|
+ mMutexVehInfo.lock();
|
|
|
+ xvehinfo.CopyFrom(mvehinfo);
|
|
|
+ mMutexVehInfo.unlock();
|
|
|
+
|
|
|
+ char strout[1000];
|
|
|
+ snprintf(strout,1000,"Type:%s Version:%s VIN:%s",xvehinfo.type().data(),xvehinfo.version().data(),xvehinfo.vin().data());
|
|
|
+ ui->label_vehinfo->setText(strout);
|
|
|
+}
|