diff --git a/CounterRealTime/CounterDevice.cpp b/CounterRealTime/CounterDevice.cpp index 10ecc0d..d2d67db 100644 --- a/CounterRealTime/CounterDevice.cpp +++ b/CounterRealTime/CounterDevice.cpp @@ -69,6 +69,15 @@ this->isUse = isUse; } +QString CounterDevice::getRefChannelCode() +{ + return this->refChannelCode; +} +void CounterDevice::setRefChannelCode(QString refChannelCode) +{ + this->refChannelCode = refChannelCode; +} + bool CounterDevice::isSerialOpen() { return this->serialUtil.isOpen(); diff --git a/CounterRealTime/CounterDevice.cpp b/CounterRealTime/CounterDevice.cpp index 10ecc0d..d2d67db 100644 --- a/CounterRealTime/CounterDevice.cpp +++ b/CounterRealTime/CounterDevice.cpp @@ -69,6 +69,15 @@ this->isUse = isUse; } +QString CounterDevice::getRefChannelCode() +{ + return this->refChannelCode; +} +void CounterDevice::setRefChannelCode(QString refChannelCode) +{ + this->refChannelCode = refChannelCode; +} + bool CounterDevice::isSerialOpen() { return this->serialUtil.isOpen(); diff --git a/CounterRealTime/CounterDevice.h b/CounterRealTime/CounterDevice.h index 107177d..c4d003d 100644 --- a/CounterRealTime/CounterDevice.h +++ b/CounterRealTime/CounterDevice.h @@ -37,6 +37,9 @@ int getIsUse(); void setIsUse(int isUse); + QString getRefChannelCode(); + void setRefChannelCode(QString refChannelCode); + bool isSerialOpen(); private: @@ -47,6 +50,7 @@ int baudRate; // 波特率 int isUse; int refChannelNo; + QString refChannelCode; // 计数器所在的列索引 int formColIndex; diff --git a/CounterRealTime/CounterDevice.cpp b/CounterRealTime/CounterDevice.cpp index 10ecc0d..d2d67db 100644 --- a/CounterRealTime/CounterDevice.cpp +++ b/CounterRealTime/CounterDevice.cpp @@ -69,6 +69,15 @@ this->isUse = isUse; } +QString CounterDevice::getRefChannelCode() +{ + return this->refChannelCode; +} +void CounterDevice::setRefChannelCode(QString refChannelCode) +{ + this->refChannelCode = refChannelCode; +} + bool CounterDevice::isSerialOpen() { return this->serialUtil.isOpen(); diff --git a/CounterRealTime/CounterDevice.h b/CounterRealTime/CounterDevice.h index 107177d..c4d003d 100644 --- a/CounterRealTime/CounterDevice.h +++ b/CounterRealTime/CounterDevice.h @@ -37,6 +37,9 @@ int getIsUse(); void setIsUse(int isUse); + QString getRefChannelCode(); + void setRefChannelCode(QString refChannelCode); + bool isSerialOpen(); private: @@ -47,6 +50,7 @@ int baudRate; // 波特率 int isUse; int refChannelNo; + QString refChannelCode; // 计数器所在的列索引 int formColIndex; diff --git a/CounterRealTime/CounterWindowRT.cpp b/CounterRealTime/CounterWindowRT.cpp index 409009b..7b4b063 100644 --- a/CounterRealTime/CounterWindowRT.cpp +++ b/CounterRealTime/CounterWindowRT.cpp @@ -602,11 +602,13 @@ { CounterDevice * device = ConstCache::getInstance().deviceMap.value(deviceId); QString deviceName = device != nullptr ? device->getDeviceName() : ""; + QString channelCode = channel->getChannelCode(); + QString refChannCode = device != nullptr ? device->getRefChannelCode() : ""; ChannelChartForm * chartFrame = new ChannelChartForm(); chartFrame->setWindowModality(Qt::ApplicationModal); chartFrame->initDataChart(channel->getHisData()); - chartFrame->setTitleText((QString("%1 通道%2 历史数据").arg(deviceName).arg(channelNo))); + chartFrame->setTitleText((QString("钟%1-钟%2(%3 通道%4) 历史数据").arg(channelCode).arg(refChannCode).arg(deviceName).arg(channelNo))); chartFrame->show(); } } @@ -646,6 +648,9 @@ { if (devIdx < devRefList.size()) { devRefList.at(devIdx)->setText(QString("REF:%1").arg(refChann->getChannelCode())); + if (refChann->getChannelCode() != devicePtr->getRefChannelCode()) { + devicePtr->setRefChannelCode(refChann->getChannelCode()); + } } }