1、过滤车头逻辑bug处理
This commit is contained in:
parent
cb379ed189
commit
b60a1a9622
|
@ -679,14 +679,16 @@ void MainWindow::serialPort_error(QSerialPort::SerialPortError error)
|
|||
void MainWindow::readCom()
|
||||
{
|
||||
try {
|
||||
QByteArray data = this->serial_->readAll(); // 读取数据
|
||||
if(!data.isEmpty())
|
||||
{
|
||||
this->queue_.push(QString(data));
|
||||
emit getRfid_signals();
|
||||
if (this->serial_->waitForReadyRead(5)) {
|
||||
QByteArray data = this->serial_->readAll(); // 读取数据
|
||||
if(!data.isEmpty())
|
||||
{
|
||||
this->queue_.push(QString(data));
|
||||
emit getRfid_signals();
|
||||
}
|
||||
this->serial_->clear();
|
||||
data.clear();
|
||||
}
|
||||
this->serial_->clear();
|
||||
data.clear();
|
||||
} catch(...) {
|
||||
this->logError("读取串口数据异常!");
|
||||
}
|
||||
|
@ -749,8 +751,7 @@ void MainWindow::getQueueDataThread()
|
|||
{
|
||||
bool isNoCarriage = false;
|
||||
int carT = strTrainInfo.mid(3, 2).simplified().toInt(&isNoCarriage);
|
||||
isNoCarriage = carT >= 10;
|
||||
if (isNoCarriage) continue;
|
||||
if (isNoCarriage && carT >= 10) continue;
|
||||
vecTrain.append(strTrainInfo);
|
||||
int train_order = vecTrain.size();
|
||||
this->resultTableModel_->setItem(train_order - 1, 0, new QStandardItem(strTrainInfo));
|
||||
|
|
Loading…
Reference in New Issue