diff --git a/ComParseTool/ComParseTool.pro.user b/ComParseTool/ComParseTool.pro.user index 5113917..cc472da 100644 --- a/ComParseTool/ComParseTool.pro.user +++ b/ComParseTool/ComParseTool.pro.user @@ -1,6 +1,6 @@ - + EnvironmentId diff --git a/ComParseTool/mainwindow.cpp b/ComParseTool/mainwindow.cpp index 70f06cf..a693331 100644 --- a/ComParseTool/mainwindow.cpp +++ b/ComParseTool/mainwindow.cpp @@ -46,7 +46,7 @@ void MainWindow::OpenExplorerFile(bool isOriFileOpen) ui->tableWidget->setRowCount(0); if (isOriFileOpen) { - if (pQfile_ori->fileName() != filePath) + if (pQfile_ori && pQfile_ori->fileName() != filePath) { pQfile_ori->close(); } @@ -63,7 +63,7 @@ void MainWindow::OpenExplorerFile(bool isOriFileOpen) } else { - if (pQfile_key->fileName() != filePath) + if (pQfile_key && pQfile_key->fileName() != filePath) { pQfile_key->close(); } @@ -363,6 +363,8 @@ QString MainWindow::AppendParse(DATA_TYPEDEF data) ret += "单点灯启动停止"; ret += "-" + QString::number(data.buf[6] | data.buf[5] << 8 | data.buf[4] << 16 | data.buf[3] << 24, 10); + ret += "-回路" + QString::number(((data.buf[7] & 0xe0) >> 5) + 1, 10); + if (data.buf[7] & 0x01) { ret += "-标志灯"; @@ -529,6 +531,88 @@ QString MainWindow::AppendParse(DATA_TYPEDEF data) case 0x23: { ret += "应答灯具配置"; + if (data.buf[1] == 0x01) + { + ret += "-" + QString::number(data.buf[7] | data.buf[6] << 8 | data.buf[5] << 16 | data.buf[4] << 24, 10); + } + else if (data.buf[1] == 0x00) + { + ret += "-回路" + QString::number(data.buf[2], 10); + ret += "-" + GetLampType(data.buf[3]); + if (data.buf[3] == 0) + { + ret += "-ERROR"; + } + else if (data.buf[3] != 229) + { + ret += "-"; + if (data.buf[4] & 0x20) + { + ret += "r点亮"; + } + else + { + ret += "r熄灭"; + } + if (data.buf[4] & 0x10) + { + ret += "l点亮"; + } + else + { + ret += "l熄灭"; + } + if (data.buf[4] & 0x02) + { + ret += "r点亮"; + } + else + { + ret += "r熄灭"; + } + if (data.buf[4] & 0x01) + { + ret += "l点亮"; + } + else + { + ret += "l熄灭"; + } + + ret += "-"; + if (data.buf[5] & 0x80) + { + ret += "点亮"; + } + else + { + ret += "熄灭"; + } + } + else + { + ret += "-"; + if (data.buf[4] & 0x01) + { + ret += "非节能"; + } + else + { + ret += "节能"; + } + + ret += "-"; + ret += QString::number((data.buf[5] & 0xf0) >> 4, 10); + if (data.buf[5] & 0x01) + { + ret += "非节能"; + } + else + { + ret += "节能"; + } + } + } }break; case 0x24: { @@ -796,8 +880,6 @@ void MainWindow::PushButton_Clicked_Parse_clicked() } } - ui->tableWidget->resizeColumnsToContents(); - byteArr = pQfile_ori->readLine(); // 继续下一行的读取 context = codec->toUnicode(byteArr); disp = context; diff --git a/ComParseTool/mainwindow.ui b/ComParseTool/mainwindow.ui index 9863444..dd15dcf 100644 --- a/ComParseTool/mainwindow.ui +++ b/ComParseTool/mainwindow.ui @@ -6,10 +6,16 @@ 0 0 - 924 - 431 + 1000 + 622 + + + 1000 + 400 + + MainWindow @@ -214,8 +220,8 @@ background-color: rgb(91, 255, 88); 0 0 - 924 - 21 + 1000 + 23 diff --git a/release/ComParseTool.exe b/release/ComParseTool.exe index f80285c..b2a8d22 100644 Binary files a/release/ComParseTool.exe and b/release/ComParseTool.exe differ