|
@@ -5,8 +5,8 @@ MainWindow::MainWindow(QWidget *parent) :
|
|
|
QMainWindow(parent),
|
|
|
ui(new Ui::MainWindow)
|
|
|
{
|
|
|
- //m_tbox=new Tbox();
|
|
|
- //initTboxMemory();
|
|
|
+ m_tbox=new Tbox();
|
|
|
+ initTboxMemory();
|
|
|
m_radio=new Radio();
|
|
|
ui->setupUi(this);
|
|
|
initUi();
|
|
@@ -18,6 +18,10 @@ MainWindow::MainWindow(QWidget *parent) :
|
|
|
ModuleFun fungpsimu =std::bind(&MainWindow::UpdateGPSIMU,this,std::placeholders::_1, \
|
|
|
std::placeholders::_2,std::placeholders::_3,std::placeholders::_4,std::placeholders::_5);
|
|
|
mpMemGps = iv::modulecomm::RegisterRecvPlus("hcp2_gpsimu",fungpsimu);
|
|
|
+ //ShareMem: ui
|
|
|
+ ModuleFun funUI =std::bind(&MainWindow::UpdateUI,this,std::placeholders::_1, \
|
|
|
+ std::placeholders::_2,std::placeholders::_3,std::placeholders::_4,std::placeholders::_5);
|
|
|
+ mpMemUI = iv::modulecomm::RegisterRecvPlus("hcp2_gpsimu",funUI);
|
|
|
}
|
|
|
|
|
|
MainWindow::~MainWindow()
|
|
@@ -244,3 +248,53 @@ void MainWindow::UpdateGPSIMU(const char * strdata,const unsigned int nSize,cons
|
|
|
// mfspeed = sqrt(pow(data->vel_E,2)+pow(data->vel_N,2)) * 3.6; //double pow(double x, double y) 返回 x 的 y 次幂,即 xy。
|
|
|
//mistGPS = 0;
|
|
|
}
|
|
|
+//UI DATA
|
|
|
+void MainWindow::UpdateUI(const char * strdata,const unsigned int nSize,const unsigned int index,\
|
|
|
+ const QDateTime * dt,const char * strmemname)
|
|
|
+{
|
|
|
+ double accX,accY,lat,lon,heading,rtk,ins,vd,ve,vn;
|
|
|
+ iv::hmi::hmimsg xhmi;
|
|
|
+ if(!xhmi.ParseFromArray(strdata,nSize))
|
|
|
+ {
|
|
|
+ mivlog->warn("ADCIntelligentVehicle::UpdateGPSIMU parse error. nSize is %d",nSize);
|
|
|
+ return;
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+ if(xhmi.has_obuen()) {
|
|
|
+ bool enRadio=xhmi.obuen();
|
|
|
+ setEnRadio(enRadio);
|
|
|
+ }
|
|
|
+ if(xhmi.has_platformen()) {
|
|
|
+ bool enTbox=xhmi.platformen();
|
|
|
+ if(enTbox) {
|
|
|
+ enableTbox();
|
|
|
+ } else {
|
|
|
+ disableTbox();
|
|
|
+ }
|
|
|
+ }
|
|
|
+ if(xhmi.has_platformen()) {
|
|
|
+ bool enTbox=xhmi.platformen();
|
|
|
+ if(enTbox) {
|
|
|
+ enableTbox();
|
|
|
+ } else {
|
|
|
+ disableTbox();
|
|
|
+ }
|
|
|
+ }
|
|
|
+ if(xhmi.has_rodeinfoen()) {
|
|
|
+ bool enRadioBroadcast = xhmi.rodeinfoen();
|
|
|
+ m_radio->getTrafficBroadcast(enRadioBroadcast);
|
|
|
+ ui->checkBox_trafficBroadcast->setChecked(enRadioBroadcast);
|
|
|
+ }
|
|
|
+ if(xhmi.has_rodefcwen()) {
|
|
|
+ bool enRadioWarning = xhmi.rodefcwen();
|
|
|
+ m_radio->getCollisonWarning(enRadioWarning);
|
|
|
+ ui->checkBox_collisionWarning->setChecked(enRadioWarning);
|
|
|
+ }
|
|
|
+ if(xhmi.has_roadjamsen()) {
|
|
|
+
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+}
|