diff --git a/CounterRealTime/CounterSettingForm.cpp b/CounterRealTime/CounterSettingForm.cpp index 2dedd0c..c1945d1 100644 --- a/CounterRealTime/CounterSettingForm.cpp +++ b/CounterRealTime/CounterSettingForm.cpp @@ -502,8 +502,9 @@ connect(clockListLeft.at(index), &QLineEditDblClick::doubleClicked, this, &CounterSettingForm::onClockNumDoubleClicked); } else { disconnect(clockListLeft.at(index), &QLineEditDblClick::doubleClicked, this, &CounterSettingForm::onClockNumDoubleClicked); - clockListLeft.at(index)->setText("-"); - delayListLeft.at(index)->setValue(0.0); + ui->selectClockNum->hide(); + // clockListLeft.at(index)->setText("-"); + // delayListLeft.at(index)->setValue(0.0); } } else if (index >= 8 && index < 16) { clockListRight.at(index - 8)->setReadOnly(!enable); @@ -512,8 +513,9 @@ connect(clockListRight.at(index - 8), &QLineEditDblClick::doubleClicked, this, &CounterSettingForm::onClockNumDoubleClicked); } else { disconnect(clockListRight.at(index - 8), &QLineEditDblClick::doubleClicked, this, &CounterSettingForm::onClockNumDoubleClicked); - clockListRight.at(index - 8)->setText("-"); - delayListRight.at(index - 8)->setValue(0.0); + ui->selectClockNum->hide(); + // clockListRight.at(index - 8)->setText("-"); + // delayListRight.at(index - 8)->setValue(0.0); } } } diff --git a/CounterRealTime/CounterSettingForm.cpp b/CounterRealTime/CounterSettingForm.cpp index 2dedd0c..c1945d1 100644 --- a/CounterRealTime/CounterSettingForm.cpp +++ b/CounterRealTime/CounterSettingForm.cpp @@ -502,8 +502,9 @@ connect(clockListLeft.at(index), &QLineEditDblClick::doubleClicked, this, &CounterSettingForm::onClockNumDoubleClicked); } else { disconnect(clockListLeft.at(index), &QLineEditDblClick::doubleClicked, this, &CounterSettingForm::onClockNumDoubleClicked); - clockListLeft.at(index)->setText("-"); - delayListLeft.at(index)->setValue(0.0); + ui->selectClockNum->hide(); + // clockListLeft.at(index)->setText("-"); + // delayListLeft.at(index)->setValue(0.0); } } else if (index >= 8 && index < 16) { clockListRight.at(index - 8)->setReadOnly(!enable); @@ -512,8 +513,9 @@ connect(clockListRight.at(index - 8), &QLineEditDblClick::doubleClicked, this, &CounterSettingForm::onClockNumDoubleClicked); } else { disconnect(clockListRight.at(index - 8), &QLineEditDblClick::doubleClicked, this, &CounterSettingForm::onClockNumDoubleClicked); - clockListRight.at(index - 8)->setText("-"); - delayListRight.at(index - 8)->setValue(0.0); + ui->selectClockNum->hide(); + // clockListRight.at(index - 8)->setText("-"); + // delayListRight.at(index - 8)->setValue(0.0); } } } diff --git a/CounterRealTime/CounterWindowRT.cpp b/CounterRealTime/CounterWindowRT.cpp index 24ebb24..fedb76a 100644 --- a/CounterRealTime/CounterWindowRT.cpp +++ b/CounterRealTime/CounterWindowRT.cpp @@ -246,6 +246,11 @@ QJsonObject response = httpReq->getChannelList(deviceId); if (response.value("code").toInt() == 200) { + // + for (int i = 0; i <= 16; i++) { + ConstCache::getInstance().channelMap.remove(QString("%1-%2").arg(deviceId).arg(i)); + } + // 将通道绘制在界面上 QJsonArray channelArray = response.value("data").toArray(); for (int i = 0; i < channelArray.size(); i++) @@ -483,7 +488,6 @@ int channelIdx = devIdx * 16 + i; // 没有测量值的通道清空 - channelNameList.at(channelIdx)->setText(QString("CH%1:%2").arg(channelNoStr).arg("-")); channelValueList.at(channelIdx)->setText(""); // 当通道启用时显示通道离线 不再判断后台传回来的状态 @@ -491,9 +495,13 @@ if (channel != nullptr && channel->isActive() == true) { channelNameList.at(channelIdx)->setStyleSheet(ConstCache::getInstance().qssConstMap.value("channelOffline")); channelValueList.at(channelIdx)->setStyleSheet(ConstCache::getInstance().qssConstMap.value("channelOffline")); + + channelNameList.at(channelIdx)->setText(QString("CH%1:%2").arg(channelNoStr).arg(channel->getChannelCode())); } else { channelNameList.at(channelIdx)->setStyleSheet(ConstCache::getInstance().qssConstMap.value(channelNameList.at(channelIdx)->property("labType").toString())); channelValueList.at(channelIdx)->setStyleSheet(ConstCache::getInstance().qssConstMap.value(channelValueList.at(channelIdx)->property("labType").toString())); + + channelNameList.at(channelIdx)->setText(QString("CH%1:%2").arg(channelNoStr).arg("-")); } } }