|
@@ -186,18 +186,17 @@ void firingWidget::handleProjectFiringMqttMessage(const QByteArray &message,
|
|
ui->pushButton_2->setEnabled(false);
|
|
ui->pushButton_2->setEnabled(false);
|
|
emit progressChanged(3, m_row);
|
|
emit progressChanged(3, m_row);
|
|
emit updateBlastStatus(3, m_row);
|
|
emit updateBlastStatus(3, m_row);
|
|
- ui->pushButton_2->setText("充电");
|
|
|
|
|
|
+ ui->pushButton_2->setText("待确认");
|
|
navProgress->setState(3);
|
|
navProgress->setState(3);
|
|
break;
|
|
break;
|
|
case 4:
|
|
case 4:
|
|
- ui->pushButton_2->setEnabled(true);
|
|
|
|
- emit progressChanged(4, m_row);
|
|
|
|
- emit updateBlastStatus(4, m_row);
|
|
|
|
- ui->pushButton_2->setText("起爆");
|
|
|
|
|
|
+ ui->pushButton_2->setEnabled(false);
|
|
|
|
+ ui->pushButton_2->setText("待确认");
|
|
navProgress->setState(4);
|
|
navProgress->setState(4);
|
|
|
|
+ emit updateBlastStatus(4, m_row);
|
|
break;
|
|
break;
|
|
case 5:
|
|
case 5:
|
|
- ui->pushButton_2->setEnabled(false);
|
|
|
|
|
|
+ ui->pushButton_2->setEnabled(true);
|
|
emit progressChanged(5, m_row);
|
|
emit progressChanged(5, m_row);
|
|
emit updateBlastStatus(5, m_row);
|
|
emit updateBlastStatus(5, m_row);
|
|
emit updateButton(5, m_row);
|
|
emit updateButton(5, m_row);
|
|
@@ -256,6 +255,17 @@ void firingWidget::onButtonPressedReceived(const QString &topic, const QString &
|
|
qDebug() << "Data sent successfully";
|
|
qDebug() << "Data sent successfully";
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+void firingWidget::onSafeChecked(const QString projectUuid) {
|
|
|
|
+ if (projectUuid == m_uuid) {
|
|
|
|
+ lastStage = 3; // 设置为待安全确认状态
|
|
|
|
+ emit projSafeChckSuccess(m_uuid);
|
|
|
|
+ emit lastStageChanged(lastStage);
|
|
|
|
+ qDebug() << ANSI_COLOR_GREEN << "安全确认成功,进入待起爆状态" << ANSI_COLOR_RESET;
|
|
|
|
+ } else {
|
|
|
|
+ qDebug() << "Project UUID mismatch, expected: " << m_uuid << ", got: " << projectUuid;
|
|
|
|
+ }
|
|
|
|
+}
|
|
|
|
+
|
|
// 状态改变
|
|
// 状态改变
|
|
void firingWidget::onLastStageChanged(int newStage) {
|
|
void firingWidget::onLastStageChanged(int newStage) {
|
|
QString topic = "hxgc/" + m_uuid + "/P";
|
|
QString topic = "hxgc/" + m_uuid + "/P";
|
|
@@ -304,7 +314,7 @@ void firingWidget::onLastStageChanged(int newStage) {
|
|
Logger::getInstance().info(
|
|
Logger::getInstance().info(
|
|
QString("Stage changed to: %1, sending message: %2").arg(newStage).arg(message));
|
|
QString("Stage changed to: %1, sending message: %2").arg(newStage).arg(message));
|
|
if (!message.isEmpty()) {
|
|
if (!message.isEmpty()) {
|
|
- if (lastStage == 4 && !m_select) {
|
|
|
|
|
|
+ if (lastStage == 3 && !m_select) {
|
|
bool success2;
|
|
bool success2;
|
|
serialTool = SerialTool::getInstance(nullptr, &success2);
|
|
serialTool = SerialTool::getInstance(nullptr, &success2);
|
|
if (serialTool) {
|
|
if (serialTool) {
|