|
@@ -408,7 +408,7 @@ void BlastOpePage::loadDataFromSource(int currentPage, int pageSize) {
|
|
QModelIndex statusIndex = model->index(row, propMap.key("blastStatus"));
|
|
QModelIndex statusIndex = model->index(row, propMap.key("blastStatus"));
|
|
if (statusIndex.isValid()) {
|
|
if (statusIndex.isValid()) {
|
|
QString blastStatus = model->data(statusIndex).toString();
|
|
QString blastStatus = model->data(statusIndex).toString();
|
|
- if (blastStatus == "起 爆 完 成") {
|
|
|
|
|
|
+ /*if (blastStatus == "起 爆 完 成") {
|
|
// 为按钮添加图标,这里假设图标文件名为 icon.png,你需要根据实际情况修改
|
|
// 为按钮添加图标,这里假设图标文件名为 icon.png,你需要根据实际情况修改
|
|
QIcon icon(":/icons/icons/svg/blast.svg");
|
|
QIcon icon(":/icons/icons/svg/blast.svg");
|
|
button->setIcon(icon);
|
|
button->setIcon(icon);
|
|
@@ -419,7 +419,8 @@ void BlastOpePage::loadDataFromSource(int currentPage, int pageSize) {
|
|
" border: none;"
|
|
" border: none;"
|
|
" background-color: transparent;"
|
|
" background-color: transparent;"
|
|
"}");
|
|
"}");
|
|
- } else if (blastStatus == "待起爆") {
|
|
|
|
|
|
+ } else*/
|
|
|
|
+ if (blastStatus == "待起爆") {
|
|
button->setText(startBlastButtonTxt);
|
|
button->setText(startBlastButtonTxt);
|
|
button->setEnabled(true);
|
|
button->setEnabled(true);
|
|
} else {
|
|
} else {
|
|
@@ -550,11 +551,6 @@ void BlastOpePage::onUpdateBlastStatus(int status, int row) {
|
|
customColor = QColor("#90d543");
|
|
customColor = QColor("#90d543");
|
|
model->setData(index, customColor, Qt::ForegroundRole);
|
|
model->setData(index, customColor, Qt::ForegroundRole);
|
|
break;
|
|
break;
|
|
- // case 0:
|
|
|
|
- // model->setData(index, "已 注 册");
|
|
|
|
- // customColor = QColor("#8e620");
|
|
|
|
- // model->setData(index, customColor, Qt::ForeroundRole);
|
|
|
|
- // break;
|
|
|
|
case 10:
|
|
case 10:
|
|
model->setData(index, "按 下 双 建 起 爆 ...");
|
|
model->setData(index, "按 下 双 建 起 爆 ...");
|
|
customColor = QColor("#8e620");
|
|
customColor = QColor("#8e620");
|
|
@@ -577,12 +573,12 @@ void BlastOpePage::handleRowOperateButtonClick(int row, QPushButton *button) {
|
|
}
|
|
}
|
|
|
|
|
|
if (button->text() == startBlastButtonTxt) {
|
|
if (button->text() == startBlastButtonTxt) {
|
|
- button->setMinimumWidth(100);
|
|
|
|
|
|
+ button->setMinimumWidth(80);
|
|
button->setText(stopBlastButtonTxt);
|
|
button->setText(stopBlastButtonTxt);
|
|
firingWidget *widget = new firingWidget(row, false, uuid);
|
|
firingWidget *widget = new firingWidget(row, false, uuid);
|
|
connect(widget, &firingWidget::progressChanged, this, &BlastOpePage::updateProgressBar);
|
|
connect(widget, &firingWidget::progressChanged, this, &BlastOpePage::updateProgressBar);
|
|
connect(widget, &firingWidget::updateBlastStatus, this, &BlastOpePage::onUpdateBlastStatus);
|
|
connect(widget, &firingWidget::updateBlastStatus, this, &BlastOpePage::onUpdateBlastStatus);
|
|
- connect(widget, &firingWidget::updateButton, this, &BlastOpePage::changeButByMqtt);
|
|
|
|
|
|
+ connect(widget, &firingWidget::updateButton, this, &BlastOpePage::updateOpBtn);
|
|
connect(widget, &firingWidget::countdown, this, &BlastOpePage::showCountDownWidget);
|
|
connect(widget, &firingWidget::countdown, this, &BlastOpePage::showCountDownWidget);
|
|
connect(widget, &firingWidget::updateProjectStatus, this, &BlastOpePage::updateProject);
|
|
connect(widget, &firingWidget::updateProjectStatus, this, &BlastOpePage::updateProject);
|
|
connect(widget, &firingWidget::closeFiring, this, &BlastOpePage::destroyFiringWidget);
|
|
connect(widget, &firingWidget::closeFiring, this, &BlastOpePage::destroyFiringWidget);
|
|
@@ -601,7 +597,7 @@ void BlastOpePage::handleRowOperateButtonClick(int row, QPushButton *button) {
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
-void BlastOpePage::changeButByMqtt(int status, int row) {
|
|
|
|
|
|
+void BlastOpePage::updateOpBtn(int status, int row) {
|
|
qDebug() << "statusButton:" << status;
|
|
qDebug() << "statusButton:" << status;
|
|
QModelIndex index = model->index(row, 8);
|
|
QModelIndex index = model->index(row, 8);
|
|
if (index.isValid()) {
|
|
if (index.isValid()) {
|
|
@@ -695,7 +691,7 @@ void BlastOpePage::on_btnSelect_clicked() {
|
|
connect(widgetSelect, &firingWidget::updateBlastStatus, this,
|
|
connect(widgetSelect, &firingWidget::updateBlastStatus, this,
|
|
&BlastOpePage::onUpdateBlastStatus);
|
|
&BlastOpePage::onUpdateBlastStatus);
|
|
connect(widgetSelect, &firingWidget::selectSignal, this, &BlastOpePage::handleSelect);
|
|
connect(widgetSelect, &firingWidget::selectSignal, this, &BlastOpePage::handleSelect);
|
|
- connect(widgetSelect, &firingWidget::updateButton, this, &BlastOpePage::changeButByMqtt);
|
|
|
|
|
|
+ connect(widgetSelect, &firingWidget::updateButton, this, &BlastOpePage::updateOpBtn);
|
|
connect(widgetSelect, &firingWidget::updateProjectStatus, this,
|
|
connect(widgetSelect, &firingWidget::updateProjectStatus, this,
|
|
&BlastOpePage::updateProject);
|
|
&BlastOpePage::updateProject);
|
|
connect(widgetSelect, &firingWidget::closeFiring, this,
|
|
connect(widgetSelect, &firingWidget::closeFiring, this,
|
|
@@ -703,6 +699,10 @@ void BlastOpePage::on_btnSelect_clicked() {
|
|
widgetSelect->show();
|
|
widgetSelect->show();
|
|
widgetSelect->setAttribute(Qt::WA_DeleteOnClose);
|
|
widgetSelect->setAttribute(Qt::WA_DeleteOnClose);
|
|
uuidWidgetSMap.insert(uuid, widgetSelect);
|
|
uuidWidgetSMap.insert(uuid, widgetSelect);
|
|
|
|
+
|
|
|
|
+ if (isShowTriggeringWidget) {
|
|
|
|
+ widgetSelect->show();
|
|
|
|
+ }
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
@@ -733,7 +733,6 @@ void BlastOpePage::handleSelect(QString uuid) {
|
|
},
|
|
},
|
|
Qt::SingleShotConnection);
|
|
Qt::SingleShotConnection);
|
|
|
|
|
|
- // TODO: receive blast record
|
|
|
|
} else {
|
|
} else {
|
|
qDebug() << "serialTool Not fond.";
|
|
qDebug() << "serialTool Not fond.";
|
|
QMessageBox::critical(nullptr, "错误", "trigger button devices not found");
|
|
QMessageBox::critical(nullptr, "错误", "trigger button devices not found");
|