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()
|
void MainWindow::readCom()
|
||||||
{
|
{
|
||||||
try {
|
try {
|
||||||
QByteArray data = this->serial_->readAll(); // 读取数据
|
if (this->serial_->waitForReadyRead(5)) {
|
||||||
if(!data.isEmpty())
|
QByteArray data = this->serial_->readAll(); // 读取数据
|
||||||
{
|
if(!data.isEmpty())
|
||||||
this->queue_.push(QString(data));
|
{
|
||||||
emit getRfid_signals();
|
this->queue_.push(QString(data));
|
||||||
|
emit getRfid_signals();
|
||||||
|
}
|
||||||
|
this->serial_->clear();
|
||||||
|
data.clear();
|
||||||
}
|
}
|
||||||
this->serial_->clear();
|
|
||||||
data.clear();
|
|
||||||
} catch(...) {
|
} catch(...) {
|
||||||
this->logError("读取串口数据异常!");
|
this->logError("读取串口数据异常!");
|
||||||
}
|
}
|
||||||
|
|
@ -749,8 +751,7 @@ void MainWindow::getQueueDataThread()
|
||||||
{
|
{
|
||||||
bool isNoCarriage = false;
|
bool isNoCarriage = false;
|
||||||
int carT = strTrainInfo.mid(3, 2).simplified().toInt(&isNoCarriage);
|
int carT = strTrainInfo.mid(3, 2).simplified().toInt(&isNoCarriage);
|
||||||
isNoCarriage = carT >= 10;
|
if (isNoCarriage && carT >= 10) continue;
|
||||||
if (isNoCarriage) continue;
|
|
||||||
vecTrain.append(strTrainInfo);
|
vecTrain.append(strTrainInfo);
|
||||||
int train_order = vecTrain.size();
|
int train_order = vecTrain.size();
|
||||||
this->resultTableModel_->setItem(train_order - 1, 0, new QStandardItem(strTrainInfo));
|
this->resultTableModel_->setItem(train_order - 1, 0, new QStandardItem(strTrainInfo));
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue