QByteArray HyperBusReciever::messageEvent(const QByteArray &msg) { int index = msg.indexOf(":"); if( index == -1 ) return QByteArray(); QByteArray msg_prv = msg.mid(index+1); HyperBusRecord msg_record( msg_prv ); if( msg_record.count() == 0 ) return QByteArray(); p->last_pid = msg_record.takeFirst().toULongLong(); QByteArray res = callMessage(msg_record.toQByteArray()); return msg.mid(0,index+1)+res; }
UtilitiesView::UtilitiesView(QWidget *parent) : QWidget(parent),ui(new Ui::UtilitiesView){ ui->setupUi(this); ui->timeTable->horizontalHeader()->setSectionResizeMode(QHeaderView::Stretch); ui->statisticsTable->horizontalHeader()->setSectionResizeMode(QHeaderView::Stretch); statsUpdate = new QTimer; statsUpdate->setInterval(3000); connect(statsUpdate, SIGNAL(timeout()), this, SLOT(updateStats())); lastTime = -1; lastTimeIndex = -1; currentLap = 0; getLap = getWay = false; connect(ui->outChannelCombo, SIGNAL(currentIndexChanged(int)), this, SLOT(loadOutChannelInfo(int))); connect(ui->channelList, SIGNAL(doubleClicked(QModelIndex)), this, SLOT(addToStatistics(QModelIndex))); connect(ui->statisticsTable, SIGNAL(doubleClicked(QModelIndex)), this, SLOT(removeFromStatistics(QModelIndex))); connect(MainWindow::gsm, SIGNAL(callStatusUpdate(int,int,int,QString)), this, SLOT(handleCall(int,int,int,QString))); connect(MainWindow::gsm, SIGNAL(callMessage(QString)), this, SLOT(handleCallMsg(QString))); }