diff --git a/DeviceHub/DeviceHubWindow.cpp b/DeviceHub/DeviceHubWindow.cpp index e02df0f..d2786ce 100644 --- a/DeviceHub/DeviceHubWindow.cpp +++ b/DeviceHub/DeviceHubWindow.cpp @@ -1,4 +1,4 @@ -#include "DeviceHubWindow.h" +#include "DeviceHubWindow.h" #include "ui_DeviceHubWindow.h" #include @@ -42,11 +42,11 @@ ui->stackedWidget->addWidget(freqSwitForm); // kafka consumer - kafkaConsumer = new QKafkaConsumer(this); - kafkaConsumer->setBrokers(SettingConfig::getInstance().KAFKA_BROKERS); - kafkaConsumer->setTopic(SettingConfig::getInstance().KAFKA_CMD_TOPIC); - kafkaConsumer->createConsumer(); - kafkaConsumer->start(); +// kafkaConsumer = new QKafkaConsumer(this); +// kafkaConsumer->setBrokers(SettingConfig::getInstance().KAFKA_BROKERS); +// kafkaConsumer->setTopic(SettingConfig::getInstance().KAFKA_CMD_TOPIC); +// kafkaConsumer->createConsumer(); +// kafkaConsumer->start(); // init device type and device list httpReq = new HttpRequestController(this); diff --git a/DeviceHub/DeviceHubWindow.cpp b/DeviceHub/DeviceHubWindow.cpp index e02df0f..d2786ce 100644 --- a/DeviceHub/DeviceHubWindow.cpp +++ b/DeviceHub/DeviceHubWindow.cpp @@ -1,4 +1,4 @@ -#include "DeviceHubWindow.h" +#include "DeviceHubWindow.h" #include "ui_DeviceHubWindow.h" #include @@ -42,11 +42,11 @@ ui->stackedWidget->addWidget(freqSwitForm); // kafka consumer - kafkaConsumer = new QKafkaConsumer(this); - kafkaConsumer->setBrokers(SettingConfig::getInstance().KAFKA_BROKERS); - kafkaConsumer->setTopic(SettingConfig::getInstance().KAFKA_CMD_TOPIC); - kafkaConsumer->createConsumer(); - kafkaConsumer->start(); +// kafkaConsumer = new QKafkaConsumer(this); +// kafkaConsumer->setBrokers(SettingConfig::getInstance().KAFKA_BROKERS); +// kafkaConsumer->setTopic(SettingConfig::getInstance().KAFKA_CMD_TOPIC); +// kafkaConsumer->createConsumer(); +// kafkaConsumer->start(); // init device type and device list httpReq = new HttpRequestController(this); diff --git a/DeviceHub/DeviceHubWindow.h b/DeviceHub/DeviceHubWindow.h index 94bf742..ad91f95 100644 --- a/DeviceHub/DeviceHubWindow.h +++ b/DeviceHub/DeviceHubWindow.h @@ -1,11 +1,11 @@ -#ifndef DEVICEHUBWINDOW_H +#ifndef DEVICEHUBWINDOW_H #define DEVICEHUBWINDOW_H #include #include #include "common/HttpRequestController.h" -#include "common/utils/QKafkaConsumer.h" +//#include "common/utils/QKafkaConsumer.h" #include "device/DeviceBase.h" #include "FrequencyTuningForm.h" #include "SignalGeneratorForm.h" @@ -28,7 +28,7 @@ int currentDevIndex; QMap> allTypeDevList; - QKafkaConsumer * kafkaConsumer; +// QKafkaConsumer * kafkaConsumer; QComboBox * getDevTypeSelect(); QComboBox * getDevSelect(); diff --git a/DeviceHub/DeviceHubWindow.cpp b/DeviceHub/DeviceHubWindow.cpp index e02df0f..d2786ce 100644 --- a/DeviceHub/DeviceHubWindow.cpp +++ b/DeviceHub/DeviceHubWindow.cpp @@ -1,4 +1,4 @@ -#include "DeviceHubWindow.h" +#include "DeviceHubWindow.h" #include "ui_DeviceHubWindow.h" #include @@ -42,11 +42,11 @@ ui->stackedWidget->addWidget(freqSwitForm); // kafka consumer - kafkaConsumer = new QKafkaConsumer(this); - kafkaConsumer->setBrokers(SettingConfig::getInstance().KAFKA_BROKERS); - kafkaConsumer->setTopic(SettingConfig::getInstance().KAFKA_CMD_TOPIC); - kafkaConsumer->createConsumer(); - kafkaConsumer->start(); +// kafkaConsumer = new QKafkaConsumer(this); +// kafkaConsumer->setBrokers(SettingConfig::getInstance().KAFKA_BROKERS); +// kafkaConsumer->setTopic(SettingConfig::getInstance().KAFKA_CMD_TOPIC); +// kafkaConsumer->createConsumer(); +// kafkaConsumer->start(); // init device type and device list httpReq = new HttpRequestController(this); diff --git a/DeviceHub/DeviceHubWindow.h b/DeviceHub/DeviceHubWindow.h index 94bf742..ad91f95 100644 --- a/DeviceHub/DeviceHubWindow.h +++ b/DeviceHub/DeviceHubWindow.h @@ -1,11 +1,11 @@ -#ifndef DEVICEHUBWINDOW_H +#ifndef DEVICEHUBWINDOW_H #define DEVICEHUBWINDOW_H #include #include #include "common/HttpRequestController.h" -#include "common/utils/QKafkaConsumer.h" +//#include "common/utils/QKafkaConsumer.h" #include "device/DeviceBase.h" #include "FrequencyTuningForm.h" #include "SignalGeneratorForm.h" @@ -28,7 +28,7 @@ int currentDevIndex; QMap> allTypeDevList; - QKafkaConsumer * kafkaConsumer; +// QKafkaConsumer * kafkaConsumer; QComboBox * getDevTypeSelect(); QComboBox * getDevSelect(); diff --git a/DeviceHub/TimeSwitcherForm.cpp b/DeviceHub/TimeSwitcherForm.cpp index a7d4b2f..82fe96d 100644 --- a/DeviceHub/TimeSwitcherForm.cpp +++ b/DeviceHub/TimeSwitcherForm.cpp @@ -1,4 +1,4 @@ -#include "TimeSwitcherForm.h" +#include "TimeSwitcherForm.h" #include "ui_TimeSwitcherForm.h" #include "DeviceHubWindow.h" @@ -28,11 +28,38 @@ if (frameData->frameType == "0501") { TimeSwitcherStatusDto * statusFrameDto = (TimeSwitcherStatusDto *) frameData; + ui->tsDevStatus->setText(statusFrameDto->devStatus == "1" ? "正常" : "异常"); + ui->tsRefSelectType->setText(statusFrameDto->refSelectType == "1" ? "手动" : "自动"); + ui->tsRefTmSrc->setText(QString("时间源%1").arg(statusFrameDto->refTmSrc)); + ui->tsOppsPhaseAccOut->setText(QString("%1 ps").arg(statusFrameDto->oppsPhaseAccOut)); + ui->tsBacRatio->setText(QString("%1").arg(statusFrameDto->bacRatio)); + ui->tsBacRange->setText(QString("%1 V").arg(statusFrameDto->bacRange)); + + QJsonObject dataObj = statusFrameDto->toJSON().find("data")->toObject(); + QJsonDocument doc; + + doc.setArray(dataObj.find("tmSrcStatusStrArray")->toArray()); + ui->tsTmSrcStatus->setText(QString::fromUtf8(doc.toJson(QJsonDocument::Compact).constData())); + + doc.setArray(dataObj.find("bacOutStatusArray")->toArray()); + ui->tsBacOutStatus->setText(QString::fromUtf8(doc.toJson(QJsonDocument::Compact).constData())); + + doc.setArray(dataObj.find("bdcOutStatusArray")->toArray()); + ui->tsBdcOutStatus->setText(QString::fromUtf8(doc.toJson(QJsonDocument::Compact).constData())); + + doc.setArray(dataObj.find("delayCompensArray")->toArray()); + ui->tsDelayComp->setText(QString::fromUtf8(doc.toJson(QJsonDocument::Compact).constData())); + + doc.setArray(dataObj.find("oppsOutStatusArray")->toArray()); + ui->tsOppsOutStatus->setText(QString::fromUtf8(doc.toJson(QJsonDocument::Compact).constData())); + + doc.setArray(dataObj.find("localTmDiffArray")->toArray()); + ui->tsLocalTmDiff->setText(QString::fromUtf8(doc.toJson(QJsonDocument::Compact).constData())); } else if (frameData->frameType == "0502") { TimeSwitcherInterfaceDto * interFrameDto = (TimeSwitcherInterfaceDto *) frameData; - + ui->tsCtrlStatus->setText(interFrameDto->ctrlStatus == "1" ? "程控" : "本控"); } } @@ -58,24 +85,31 @@ QString commandType = command.value("command").toString(); if (commandType == "GLF,01") { - + ui->tsRefSelectTypeSet->setText(command.value("params").toString()); + ui->tsRefSelectTypeSetRaw->setText(command.value("rawCommand").toString()); } else if (commandType == "GLF,02") { - + ui->tsBacRatioSet->setText(command.value("params").toString()); + ui->tsBacRatioSetRaw->setText(command.value("rawCommand").toString()); } else if (commandType == "GLF,03") { - + ui->tsBacRangeSet->setText(command.value("params").toString()); + ui->tsBacRangeSetRaw->setText(command.value("rawCommand").toString()); } else if (commandType == "GLF,04") { - + ui->tsTmSrcSet->setText(command.value("params").toString()); + ui->tsTmSrcSetRaw->setText(command.value("rawCommand").toString()); } else if (commandType == "GLF,05") { - + ui->tsOppsPhaseSet->setText(command.value("params").toString()); + ui->tsOppsPhaseSetRaw->setText(command.value("rawCommand").toString()); } else if (commandType == "GLF,06") { - + ui->tsDelayCompSet->setText(command.value("params").toString()); + ui->tsDelayCompSetRaw->setText(command.value("rawCommand").toString()); } else if (commandType == "GLC,01") { - + ui->tsControlSet->setText(command.value("params").toString()); + ui->tsControlSetRaw->setText(command.value("rawCommand").toString()); } } diff --git a/DeviceHub/DeviceHubWindow.cpp b/DeviceHub/DeviceHubWindow.cpp index e02df0f..d2786ce 100644 --- a/DeviceHub/DeviceHubWindow.cpp +++ b/DeviceHub/DeviceHubWindow.cpp @@ -1,4 +1,4 @@ -#include "DeviceHubWindow.h" +#include "DeviceHubWindow.h" #include "ui_DeviceHubWindow.h" #include @@ -42,11 +42,11 @@ ui->stackedWidget->addWidget(freqSwitForm); // kafka consumer - kafkaConsumer = new QKafkaConsumer(this); - kafkaConsumer->setBrokers(SettingConfig::getInstance().KAFKA_BROKERS); - kafkaConsumer->setTopic(SettingConfig::getInstance().KAFKA_CMD_TOPIC); - kafkaConsumer->createConsumer(); - kafkaConsumer->start(); +// kafkaConsumer = new QKafkaConsumer(this); +// kafkaConsumer->setBrokers(SettingConfig::getInstance().KAFKA_BROKERS); +// kafkaConsumer->setTopic(SettingConfig::getInstance().KAFKA_CMD_TOPIC); +// kafkaConsumer->createConsumer(); +// kafkaConsumer->start(); // init device type and device list httpReq = new HttpRequestController(this); diff --git a/DeviceHub/DeviceHubWindow.h b/DeviceHub/DeviceHubWindow.h index 94bf742..ad91f95 100644 --- a/DeviceHub/DeviceHubWindow.h +++ b/DeviceHub/DeviceHubWindow.h @@ -1,11 +1,11 @@ -#ifndef DEVICEHUBWINDOW_H +#ifndef DEVICEHUBWINDOW_H #define DEVICEHUBWINDOW_H #include #include #include "common/HttpRequestController.h" -#include "common/utils/QKafkaConsumer.h" +//#include "common/utils/QKafkaConsumer.h" #include "device/DeviceBase.h" #include "FrequencyTuningForm.h" #include "SignalGeneratorForm.h" @@ -28,7 +28,7 @@ int currentDevIndex; QMap> allTypeDevList; - QKafkaConsumer * kafkaConsumer; +// QKafkaConsumer * kafkaConsumer; QComboBox * getDevTypeSelect(); QComboBox * getDevSelect(); diff --git a/DeviceHub/TimeSwitcherForm.cpp b/DeviceHub/TimeSwitcherForm.cpp index a7d4b2f..82fe96d 100644 --- a/DeviceHub/TimeSwitcherForm.cpp +++ b/DeviceHub/TimeSwitcherForm.cpp @@ -1,4 +1,4 @@ -#include "TimeSwitcherForm.h" +#include "TimeSwitcherForm.h" #include "ui_TimeSwitcherForm.h" #include "DeviceHubWindow.h" @@ -28,11 +28,38 @@ if (frameData->frameType == "0501") { TimeSwitcherStatusDto * statusFrameDto = (TimeSwitcherStatusDto *) frameData; + ui->tsDevStatus->setText(statusFrameDto->devStatus == "1" ? "正常" : "异常"); + ui->tsRefSelectType->setText(statusFrameDto->refSelectType == "1" ? "手动" : "自动"); + ui->tsRefTmSrc->setText(QString("时间源%1").arg(statusFrameDto->refTmSrc)); + ui->tsOppsPhaseAccOut->setText(QString("%1 ps").arg(statusFrameDto->oppsPhaseAccOut)); + ui->tsBacRatio->setText(QString("%1").arg(statusFrameDto->bacRatio)); + ui->tsBacRange->setText(QString("%1 V").arg(statusFrameDto->bacRange)); + + QJsonObject dataObj = statusFrameDto->toJSON().find("data")->toObject(); + QJsonDocument doc; + + doc.setArray(dataObj.find("tmSrcStatusStrArray")->toArray()); + ui->tsTmSrcStatus->setText(QString::fromUtf8(doc.toJson(QJsonDocument::Compact).constData())); + + doc.setArray(dataObj.find("bacOutStatusArray")->toArray()); + ui->tsBacOutStatus->setText(QString::fromUtf8(doc.toJson(QJsonDocument::Compact).constData())); + + doc.setArray(dataObj.find("bdcOutStatusArray")->toArray()); + ui->tsBdcOutStatus->setText(QString::fromUtf8(doc.toJson(QJsonDocument::Compact).constData())); + + doc.setArray(dataObj.find("delayCompensArray")->toArray()); + ui->tsDelayComp->setText(QString::fromUtf8(doc.toJson(QJsonDocument::Compact).constData())); + + doc.setArray(dataObj.find("oppsOutStatusArray")->toArray()); + ui->tsOppsOutStatus->setText(QString::fromUtf8(doc.toJson(QJsonDocument::Compact).constData())); + + doc.setArray(dataObj.find("localTmDiffArray")->toArray()); + ui->tsLocalTmDiff->setText(QString::fromUtf8(doc.toJson(QJsonDocument::Compact).constData())); } else if (frameData->frameType == "0502") { TimeSwitcherInterfaceDto * interFrameDto = (TimeSwitcherInterfaceDto *) frameData; - + ui->tsCtrlStatus->setText(interFrameDto->ctrlStatus == "1" ? "程控" : "本控"); } } @@ -58,24 +85,31 @@ QString commandType = command.value("command").toString(); if (commandType == "GLF,01") { - + ui->tsRefSelectTypeSet->setText(command.value("params").toString()); + ui->tsRefSelectTypeSetRaw->setText(command.value("rawCommand").toString()); } else if (commandType == "GLF,02") { - + ui->tsBacRatioSet->setText(command.value("params").toString()); + ui->tsBacRatioSetRaw->setText(command.value("rawCommand").toString()); } else if (commandType == "GLF,03") { - + ui->tsBacRangeSet->setText(command.value("params").toString()); + ui->tsBacRangeSetRaw->setText(command.value("rawCommand").toString()); } else if (commandType == "GLF,04") { - + ui->tsTmSrcSet->setText(command.value("params").toString()); + ui->tsTmSrcSetRaw->setText(command.value("rawCommand").toString()); } else if (commandType == "GLF,05") { - + ui->tsOppsPhaseSet->setText(command.value("params").toString()); + ui->tsOppsPhaseSetRaw->setText(command.value("rawCommand").toString()); } else if (commandType == "GLF,06") { - + ui->tsDelayCompSet->setText(command.value("params").toString()); + ui->tsDelayCompSetRaw->setText(command.value("rawCommand").toString()); } else if (commandType == "GLC,01") { - + ui->tsControlSet->setText(command.value("params").toString()); + ui->tsControlSetRaw->setText(command.value("rawCommand").toString()); } } diff --git a/DeviceHub/TimeSwitcherForm.ui b/DeviceHub/TimeSwitcherForm.ui index 2a428fc..71477c4 100644 --- a/DeviceHub/TimeSwitcherForm.ui +++ b/DeviceHub/TimeSwitcherForm.ui @@ -6,7 +6,7 @@ 0 0 - 1200 + 1300 600 @@ -49,7 +49,7 @@ 20 - 230 + 290 100 30 @@ -93,10 +93,10 @@ - + - 380 + 410 120 50 30 @@ -108,6 +108,228 @@ 170 120 + 100 + 30 + + + + + 微软雅黑 + 10 + + + + 选择参考源模式 + + + + + + 270 + 120 + 50 + 30 + + + + + + + 340 + 120 + 70 + 30 + + + + + 微软雅黑 + 10 + + + + 当前时间源 + + + + + + 480 + 120 + 70 + 30 + + + + + 微软雅黑 + 10 + + + + 时间源状态 + + + + + + 550 + 120 + 300 + 30 + + + + + + + 20 + 170 + 70 + 30 + + + + + 微软雅黑 + 10 + + + + 时间源秒差 + + + + + + 90 + 170 + 300 + 30 + + + + + + + 870 + 120 + 100 + 30 + + + + + 微软雅黑 + 10 + + + + 相位调节累计值 + + + + + + 970 + 120 + 50 + 30 + + + + + + + 420 + 170 + 90 + 30 + + + + + 微软雅黑 + 10 + + + + B-AC码调制比 + + + + + + 510 + 170 + 50 + 30 + + + + + + + 580 + 170 + 80 + 30 + + + + + 微软雅黑 + 10 + + + + B-AC码幅度 + + + + + + 660 + 170 + 50 + 30 + + + + + + + 740 + 170 + 70 + 30 + + + + + 微软雅黑 + 10 + + + + 输入补偿值 + + + + + + 810 + 170 + 300 + 30 + + + + + + + 1050 + 120 60 30 @@ -119,24 +341,156 @@ - 闰秒标志 + 控制状态 - + - 230 + 1110 120 50 30 - + - 300 - 120 + 20 + 230 + 90 + 30 + + + + + 微软雅黑 + 10 + + + + 1PPS输出状态 + + + + + + 110 + 230 + 200 + 30 + + + + + + + 330 + 230 + 90 + 30 + + + + + 微软雅黑 + 10 + + + + B-DC输出状态 + + + + + + 420 + 230 + 200 + 30 + + + + + + + 730 + 230 + 200 + 30 + + + + + + + + + + 640 + 230 + 90 + 30 + + + + + 微软雅黑 + 10 + + + + B-AC输出状态 + + + + + + 100 + 500 + 100 + 30 + + + + + + + 820 + 430 + 200 + 30 + + + + true + + + + + + 20 + 500 + 60 + 30 + + + + + 微软雅黑 + 10 + + + + 控制状态 + + + + + + 610 + 380 80 30 @@ -148,7 +502,373 @@ - 频率信号状态 + 相位调节 + + + + + + 460 + 500 + 80 + 30 + + + + + 微软雅黑 + 10 + + + + send + + + + + + 460 + 380 + 80 + 30 + + + + + 微软雅黑 + 10 + + + + send + + + + + + 20 + 330 + 80 + 30 + + + + + 微软雅黑 + 10 + + + + 参考源选择 + + + + + + 1050 + 330 + 80 + 30 + + + + + 微软雅黑 + 10 + + + + send + + + + + + 230 + 330 + 200 + 30 + + + + true + + + + + + 1050 + 380 + 80 + 30 + + + + + 微软雅黑 + 10 + + + + send + + + + + + 460 + 430 + 80 + 30 + + + + + 微软雅黑 + 10 + + + + send + + + + + + 230 + 430 + 200 + 30 + + + + true + + + + + + 690 + 380 + 100 + 30 + + + + + + + 610 + 330 + 60 + 30 + + + + + 微软雅黑 + 10 + + + + 时间源 + + + + + + 1050 + 430 + 80 + 30 + + + + + 微软雅黑 + 10 + + + + send + + + + + + 690 + 430 + 100 + 30 + + + + + + + 820 + 380 + 200 + 30 + + + + true + + + + + + 100 + 430 + 100 + 30 + + + + + + + 230 + 500 + 200 + 30 + + + + true + + + + + + 20 + 430 + 60 + 30 + + + + + 微软雅黑 + 10 + + + + AC码幅度 + + + + + + 100 + 380 + 100 + 30 + + + + + + + 100 + 330 + 100 + 30 + + + + + + + 820 + 330 + 200 + 30 + + + + true + + + + + + 610 + 430 + 80 + 30 + + + + + 微软雅黑 + 10 + + + + 输入延迟补偿 + + + + + + 690 + 330 + 100 + 30 + + + + + + + 20 + 380 + 80 + 30 + + + + + 微软雅黑 + 10 + + + + AC码调制比 + + + + + + 460 + 330 + 80 + 30 + + + + + 微软雅黑 + 10 + + + + send + + + + + + 230 + 380 + 200 + 30 + + + + true diff --git a/DeviceHub/DeviceHubWindow.cpp b/DeviceHub/DeviceHubWindow.cpp index e02df0f..d2786ce 100644 --- a/DeviceHub/DeviceHubWindow.cpp +++ b/DeviceHub/DeviceHubWindow.cpp @@ -1,4 +1,4 @@ -#include "DeviceHubWindow.h" +#include "DeviceHubWindow.h" #include "ui_DeviceHubWindow.h" #include @@ -42,11 +42,11 @@ ui->stackedWidget->addWidget(freqSwitForm); // kafka consumer - kafkaConsumer = new QKafkaConsumer(this); - kafkaConsumer->setBrokers(SettingConfig::getInstance().KAFKA_BROKERS); - kafkaConsumer->setTopic(SettingConfig::getInstance().KAFKA_CMD_TOPIC); - kafkaConsumer->createConsumer(); - kafkaConsumer->start(); +// kafkaConsumer = new QKafkaConsumer(this); +// kafkaConsumer->setBrokers(SettingConfig::getInstance().KAFKA_BROKERS); +// kafkaConsumer->setTopic(SettingConfig::getInstance().KAFKA_CMD_TOPIC); +// kafkaConsumer->createConsumer(); +// kafkaConsumer->start(); // init device type and device list httpReq = new HttpRequestController(this); diff --git a/DeviceHub/DeviceHubWindow.h b/DeviceHub/DeviceHubWindow.h index 94bf742..ad91f95 100644 --- a/DeviceHub/DeviceHubWindow.h +++ b/DeviceHub/DeviceHubWindow.h @@ -1,11 +1,11 @@ -#ifndef DEVICEHUBWINDOW_H +#ifndef DEVICEHUBWINDOW_H #define DEVICEHUBWINDOW_H #include #include #include "common/HttpRequestController.h" -#include "common/utils/QKafkaConsumer.h" +//#include "common/utils/QKafkaConsumer.h" #include "device/DeviceBase.h" #include "FrequencyTuningForm.h" #include "SignalGeneratorForm.h" @@ -28,7 +28,7 @@ int currentDevIndex; QMap> allTypeDevList; - QKafkaConsumer * kafkaConsumer; +// QKafkaConsumer * kafkaConsumer; QComboBox * getDevTypeSelect(); QComboBox * getDevSelect(); diff --git a/DeviceHub/TimeSwitcherForm.cpp b/DeviceHub/TimeSwitcherForm.cpp index a7d4b2f..82fe96d 100644 --- a/DeviceHub/TimeSwitcherForm.cpp +++ b/DeviceHub/TimeSwitcherForm.cpp @@ -1,4 +1,4 @@ -#include "TimeSwitcherForm.h" +#include "TimeSwitcherForm.h" #include "ui_TimeSwitcherForm.h" #include "DeviceHubWindow.h" @@ -28,11 +28,38 @@ if (frameData->frameType == "0501") { TimeSwitcherStatusDto * statusFrameDto = (TimeSwitcherStatusDto *) frameData; + ui->tsDevStatus->setText(statusFrameDto->devStatus == "1" ? "正常" : "异常"); + ui->tsRefSelectType->setText(statusFrameDto->refSelectType == "1" ? "手动" : "自动"); + ui->tsRefTmSrc->setText(QString("时间源%1").arg(statusFrameDto->refTmSrc)); + ui->tsOppsPhaseAccOut->setText(QString("%1 ps").arg(statusFrameDto->oppsPhaseAccOut)); + ui->tsBacRatio->setText(QString("%1").arg(statusFrameDto->bacRatio)); + ui->tsBacRange->setText(QString("%1 V").arg(statusFrameDto->bacRange)); + + QJsonObject dataObj = statusFrameDto->toJSON().find("data")->toObject(); + QJsonDocument doc; + + doc.setArray(dataObj.find("tmSrcStatusStrArray")->toArray()); + ui->tsTmSrcStatus->setText(QString::fromUtf8(doc.toJson(QJsonDocument::Compact).constData())); + + doc.setArray(dataObj.find("bacOutStatusArray")->toArray()); + ui->tsBacOutStatus->setText(QString::fromUtf8(doc.toJson(QJsonDocument::Compact).constData())); + + doc.setArray(dataObj.find("bdcOutStatusArray")->toArray()); + ui->tsBdcOutStatus->setText(QString::fromUtf8(doc.toJson(QJsonDocument::Compact).constData())); + + doc.setArray(dataObj.find("delayCompensArray")->toArray()); + ui->tsDelayComp->setText(QString::fromUtf8(doc.toJson(QJsonDocument::Compact).constData())); + + doc.setArray(dataObj.find("oppsOutStatusArray")->toArray()); + ui->tsOppsOutStatus->setText(QString::fromUtf8(doc.toJson(QJsonDocument::Compact).constData())); + + doc.setArray(dataObj.find("localTmDiffArray")->toArray()); + ui->tsLocalTmDiff->setText(QString::fromUtf8(doc.toJson(QJsonDocument::Compact).constData())); } else if (frameData->frameType == "0502") { TimeSwitcherInterfaceDto * interFrameDto = (TimeSwitcherInterfaceDto *) frameData; - + ui->tsCtrlStatus->setText(interFrameDto->ctrlStatus == "1" ? "程控" : "本控"); } } @@ -58,24 +85,31 @@ QString commandType = command.value("command").toString(); if (commandType == "GLF,01") { - + ui->tsRefSelectTypeSet->setText(command.value("params").toString()); + ui->tsRefSelectTypeSetRaw->setText(command.value("rawCommand").toString()); } else if (commandType == "GLF,02") { - + ui->tsBacRatioSet->setText(command.value("params").toString()); + ui->tsBacRatioSetRaw->setText(command.value("rawCommand").toString()); } else if (commandType == "GLF,03") { - + ui->tsBacRangeSet->setText(command.value("params").toString()); + ui->tsBacRangeSetRaw->setText(command.value("rawCommand").toString()); } else if (commandType == "GLF,04") { - + ui->tsTmSrcSet->setText(command.value("params").toString()); + ui->tsTmSrcSetRaw->setText(command.value("rawCommand").toString()); } else if (commandType == "GLF,05") { - + ui->tsOppsPhaseSet->setText(command.value("params").toString()); + ui->tsOppsPhaseSetRaw->setText(command.value("rawCommand").toString()); } else if (commandType == "GLF,06") { - + ui->tsDelayCompSet->setText(command.value("params").toString()); + ui->tsDelayCompSetRaw->setText(command.value("rawCommand").toString()); } else if (commandType == "GLC,01") { - + ui->tsControlSet->setText(command.value("params").toString()); + ui->tsControlSetRaw->setText(command.value("rawCommand").toString()); } } diff --git a/DeviceHub/TimeSwitcherForm.ui b/DeviceHub/TimeSwitcherForm.ui index 2a428fc..71477c4 100644 --- a/DeviceHub/TimeSwitcherForm.ui +++ b/DeviceHub/TimeSwitcherForm.ui @@ -6,7 +6,7 @@ 0 0 - 1200 + 1300 600 @@ -49,7 +49,7 @@ 20 - 230 + 290 100 30 @@ -93,10 +93,10 @@ - + - 380 + 410 120 50 30 @@ -108,6 +108,228 @@ 170 120 + 100 + 30 + + + + + 微软雅黑 + 10 + + + + 选择参考源模式 + + + + + + 270 + 120 + 50 + 30 + + + + + + + 340 + 120 + 70 + 30 + + + + + 微软雅黑 + 10 + + + + 当前时间源 + + + + + + 480 + 120 + 70 + 30 + + + + + 微软雅黑 + 10 + + + + 时间源状态 + + + + + + 550 + 120 + 300 + 30 + + + + + + + 20 + 170 + 70 + 30 + + + + + 微软雅黑 + 10 + + + + 时间源秒差 + + + + + + 90 + 170 + 300 + 30 + + + + + + + 870 + 120 + 100 + 30 + + + + + 微软雅黑 + 10 + + + + 相位调节累计值 + + + + + + 970 + 120 + 50 + 30 + + + + + + + 420 + 170 + 90 + 30 + + + + + 微软雅黑 + 10 + + + + B-AC码调制比 + + + + + + 510 + 170 + 50 + 30 + + + + + + + 580 + 170 + 80 + 30 + + + + + 微软雅黑 + 10 + + + + B-AC码幅度 + + + + + + 660 + 170 + 50 + 30 + + + + + + + 740 + 170 + 70 + 30 + + + + + 微软雅黑 + 10 + + + + 输入补偿值 + + + + + + 810 + 170 + 300 + 30 + + + + + + + 1050 + 120 60 30 @@ -119,24 +341,156 @@ - 闰秒标志 + 控制状态 - + - 230 + 1110 120 50 30 - + - 300 - 120 + 20 + 230 + 90 + 30 + + + + + 微软雅黑 + 10 + + + + 1PPS输出状态 + + + + + + 110 + 230 + 200 + 30 + + + + + + + 330 + 230 + 90 + 30 + + + + + 微软雅黑 + 10 + + + + B-DC输出状态 + + + + + + 420 + 230 + 200 + 30 + + + + + + + 730 + 230 + 200 + 30 + + + + + + + + + + 640 + 230 + 90 + 30 + + + + + 微软雅黑 + 10 + + + + B-AC输出状态 + + + + + + 100 + 500 + 100 + 30 + + + + + + + 820 + 430 + 200 + 30 + + + + true + + + + + + 20 + 500 + 60 + 30 + + + + + 微软雅黑 + 10 + + + + 控制状态 + + + + + + 610 + 380 80 30 @@ -148,7 +502,373 @@ - 频率信号状态 + 相位调节 + + + + + + 460 + 500 + 80 + 30 + + + + + 微软雅黑 + 10 + + + + send + + + + + + 460 + 380 + 80 + 30 + + + + + 微软雅黑 + 10 + + + + send + + + + + + 20 + 330 + 80 + 30 + + + + + 微软雅黑 + 10 + + + + 参考源选择 + + + + + + 1050 + 330 + 80 + 30 + + + + + 微软雅黑 + 10 + + + + send + + + + + + 230 + 330 + 200 + 30 + + + + true + + + + + + 1050 + 380 + 80 + 30 + + + + + 微软雅黑 + 10 + + + + send + + + + + + 460 + 430 + 80 + 30 + + + + + 微软雅黑 + 10 + + + + send + + + + + + 230 + 430 + 200 + 30 + + + + true + + + + + + 690 + 380 + 100 + 30 + + + + + + + 610 + 330 + 60 + 30 + + + + + 微软雅黑 + 10 + + + + 时间源 + + + + + + 1050 + 430 + 80 + 30 + + + + + 微软雅黑 + 10 + + + + send + + + + + + 690 + 430 + 100 + 30 + + + + + + + 820 + 380 + 200 + 30 + + + + true + + + + + + 100 + 430 + 100 + 30 + + + + + + + 230 + 500 + 200 + 30 + + + + true + + + + + + 20 + 430 + 60 + 30 + + + + + 微软雅黑 + 10 + + + + AC码幅度 + + + + + + 100 + 380 + 100 + 30 + + + + + + + 100 + 330 + 100 + 30 + + + + + + + 820 + 330 + 200 + 30 + + + + true + + + + + + 610 + 430 + 80 + 30 + + + + + 微软雅黑 + 10 + + + + 输入延迟补偿 + + + + + + 690 + 330 + 100 + 30 + + + + + + + 20 + 380 + 80 + 30 + + + + + 微软雅黑 + 10 + + + + AC码调制比 + + + + + + 460 + 330 + 80 + 30 + + + + + 微软雅黑 + 10 + + + + send + + + + + + 230 + 380 + 200 + 30 + + + + true diff --git a/DeviceHub/common/common.pri b/DeviceHub/common/common.pri index 6ac9b59..feeba36 100644 --- a/DeviceHub/common/common.pri +++ b/DeviceHub/common/common.pri @@ -1,22 +1,20 @@ -SOURCES += $$PWD/utils/SettingConfig.cpp \ - $$PWD/utils/QKafkaProducer.cpp +SOURCES += $$PWD/utils/SettingConfig.cpp SOURCES += $$PWD/utils/QByteUtil.cpp SOURCES += $$PWD/utils/QSerialPortUtil.cpp SOURCES += $$PWD/utils/QLogUtil.cpp -SOURCES += -SOURCES += $$PWD/utils/QKafkaConsumer.cpp +#SOURCES += $$PWD/utils/QKafkaConsumer.cpp +#SOURCES += $$PWD/utils/QKafkaProducer.cpp SOURCES += $$PWD/utils/HttpRequestUtil.cpp SOURCES += $$PWD/utils/MD5.cpp SOURCES += $$PWD/HttpRequestController.cpp -HEADERS += $$PWD/utils/SettingConfig.h \ - $$PWD/utils/QKafkaProducer.h +HEADERS += $$PWD/utils/SettingConfig.h HEADERS += $$PWD/utils/QByteUtil.h HEADERS += $$PWD/utils/QSerialPortUtil.h HEADERS += $$PWD/utils/QLogUtil.h -HEADERS += -HEADERS += $$PWD/utils/QKafkaConsumer.h +#HEADERS += $$PWD/utils/QKafkaConsumer.h +#HEADERS += $$PWD/utils/QKafkaProducer.h HEADERS += $$PWD/utils/HttpRequestUtil.h HEADERS += $$PWD/utils/DefHead.h HEADERS += $$PWD/utils/MD5.h diff --git a/DeviceHub/DeviceHubWindow.cpp b/DeviceHub/DeviceHubWindow.cpp index e02df0f..d2786ce 100644 --- a/DeviceHub/DeviceHubWindow.cpp +++ b/DeviceHub/DeviceHubWindow.cpp @@ -1,4 +1,4 @@ -#include "DeviceHubWindow.h" +#include "DeviceHubWindow.h" #include "ui_DeviceHubWindow.h" #include @@ -42,11 +42,11 @@ ui->stackedWidget->addWidget(freqSwitForm); // kafka consumer - kafkaConsumer = new QKafkaConsumer(this); - kafkaConsumer->setBrokers(SettingConfig::getInstance().KAFKA_BROKERS); - kafkaConsumer->setTopic(SettingConfig::getInstance().KAFKA_CMD_TOPIC); - kafkaConsumer->createConsumer(); - kafkaConsumer->start(); +// kafkaConsumer = new QKafkaConsumer(this); +// kafkaConsumer->setBrokers(SettingConfig::getInstance().KAFKA_BROKERS); +// kafkaConsumer->setTopic(SettingConfig::getInstance().KAFKA_CMD_TOPIC); +// kafkaConsumer->createConsumer(); +// kafkaConsumer->start(); // init device type and device list httpReq = new HttpRequestController(this); diff --git a/DeviceHub/DeviceHubWindow.h b/DeviceHub/DeviceHubWindow.h index 94bf742..ad91f95 100644 --- a/DeviceHub/DeviceHubWindow.h +++ b/DeviceHub/DeviceHubWindow.h @@ -1,11 +1,11 @@ -#ifndef DEVICEHUBWINDOW_H +#ifndef DEVICEHUBWINDOW_H #define DEVICEHUBWINDOW_H #include #include #include "common/HttpRequestController.h" -#include "common/utils/QKafkaConsumer.h" +//#include "common/utils/QKafkaConsumer.h" #include "device/DeviceBase.h" #include "FrequencyTuningForm.h" #include "SignalGeneratorForm.h" @@ -28,7 +28,7 @@ int currentDevIndex; QMap> allTypeDevList; - QKafkaConsumer * kafkaConsumer; +// QKafkaConsumer * kafkaConsumer; QComboBox * getDevTypeSelect(); QComboBox * getDevSelect(); diff --git a/DeviceHub/TimeSwitcherForm.cpp b/DeviceHub/TimeSwitcherForm.cpp index a7d4b2f..82fe96d 100644 --- a/DeviceHub/TimeSwitcherForm.cpp +++ b/DeviceHub/TimeSwitcherForm.cpp @@ -1,4 +1,4 @@ -#include "TimeSwitcherForm.h" +#include "TimeSwitcherForm.h" #include "ui_TimeSwitcherForm.h" #include "DeviceHubWindow.h" @@ -28,11 +28,38 @@ if (frameData->frameType == "0501") { TimeSwitcherStatusDto * statusFrameDto = (TimeSwitcherStatusDto *) frameData; + ui->tsDevStatus->setText(statusFrameDto->devStatus == "1" ? "正常" : "异常"); + ui->tsRefSelectType->setText(statusFrameDto->refSelectType == "1" ? "手动" : "自动"); + ui->tsRefTmSrc->setText(QString("时间源%1").arg(statusFrameDto->refTmSrc)); + ui->tsOppsPhaseAccOut->setText(QString("%1 ps").arg(statusFrameDto->oppsPhaseAccOut)); + ui->tsBacRatio->setText(QString("%1").arg(statusFrameDto->bacRatio)); + ui->tsBacRange->setText(QString("%1 V").arg(statusFrameDto->bacRange)); + + QJsonObject dataObj = statusFrameDto->toJSON().find("data")->toObject(); + QJsonDocument doc; + + doc.setArray(dataObj.find("tmSrcStatusStrArray")->toArray()); + ui->tsTmSrcStatus->setText(QString::fromUtf8(doc.toJson(QJsonDocument::Compact).constData())); + + doc.setArray(dataObj.find("bacOutStatusArray")->toArray()); + ui->tsBacOutStatus->setText(QString::fromUtf8(doc.toJson(QJsonDocument::Compact).constData())); + + doc.setArray(dataObj.find("bdcOutStatusArray")->toArray()); + ui->tsBdcOutStatus->setText(QString::fromUtf8(doc.toJson(QJsonDocument::Compact).constData())); + + doc.setArray(dataObj.find("delayCompensArray")->toArray()); + ui->tsDelayComp->setText(QString::fromUtf8(doc.toJson(QJsonDocument::Compact).constData())); + + doc.setArray(dataObj.find("oppsOutStatusArray")->toArray()); + ui->tsOppsOutStatus->setText(QString::fromUtf8(doc.toJson(QJsonDocument::Compact).constData())); + + doc.setArray(dataObj.find("localTmDiffArray")->toArray()); + ui->tsLocalTmDiff->setText(QString::fromUtf8(doc.toJson(QJsonDocument::Compact).constData())); } else if (frameData->frameType == "0502") { TimeSwitcherInterfaceDto * interFrameDto = (TimeSwitcherInterfaceDto *) frameData; - + ui->tsCtrlStatus->setText(interFrameDto->ctrlStatus == "1" ? "程控" : "本控"); } } @@ -58,24 +85,31 @@ QString commandType = command.value("command").toString(); if (commandType == "GLF,01") { - + ui->tsRefSelectTypeSet->setText(command.value("params").toString()); + ui->tsRefSelectTypeSetRaw->setText(command.value("rawCommand").toString()); } else if (commandType == "GLF,02") { - + ui->tsBacRatioSet->setText(command.value("params").toString()); + ui->tsBacRatioSetRaw->setText(command.value("rawCommand").toString()); } else if (commandType == "GLF,03") { - + ui->tsBacRangeSet->setText(command.value("params").toString()); + ui->tsBacRangeSetRaw->setText(command.value("rawCommand").toString()); } else if (commandType == "GLF,04") { - + ui->tsTmSrcSet->setText(command.value("params").toString()); + ui->tsTmSrcSetRaw->setText(command.value("rawCommand").toString()); } else if (commandType == "GLF,05") { - + ui->tsOppsPhaseSet->setText(command.value("params").toString()); + ui->tsOppsPhaseSetRaw->setText(command.value("rawCommand").toString()); } else if (commandType == "GLF,06") { - + ui->tsDelayCompSet->setText(command.value("params").toString()); + ui->tsDelayCompSetRaw->setText(command.value("rawCommand").toString()); } else if (commandType == "GLC,01") { - + ui->tsControlSet->setText(command.value("params").toString()); + ui->tsControlSetRaw->setText(command.value("rawCommand").toString()); } } diff --git a/DeviceHub/TimeSwitcherForm.ui b/DeviceHub/TimeSwitcherForm.ui index 2a428fc..71477c4 100644 --- a/DeviceHub/TimeSwitcherForm.ui +++ b/DeviceHub/TimeSwitcherForm.ui @@ -6,7 +6,7 @@ 0 0 - 1200 + 1300 600 @@ -49,7 +49,7 @@ 20 - 230 + 290 100 30 @@ -93,10 +93,10 @@ - + - 380 + 410 120 50 30 @@ -108,6 +108,228 @@ 170 120 + 100 + 30 + + + + + 微软雅黑 + 10 + + + + 选择参考源模式 + + + + + + 270 + 120 + 50 + 30 + + + + + + + 340 + 120 + 70 + 30 + + + + + 微软雅黑 + 10 + + + + 当前时间源 + + + + + + 480 + 120 + 70 + 30 + + + + + 微软雅黑 + 10 + + + + 时间源状态 + + + + + + 550 + 120 + 300 + 30 + + + + + + + 20 + 170 + 70 + 30 + + + + + 微软雅黑 + 10 + + + + 时间源秒差 + + + + + + 90 + 170 + 300 + 30 + + + + + + + 870 + 120 + 100 + 30 + + + + + 微软雅黑 + 10 + + + + 相位调节累计值 + + + + + + 970 + 120 + 50 + 30 + + + + + + + 420 + 170 + 90 + 30 + + + + + 微软雅黑 + 10 + + + + B-AC码调制比 + + + + + + 510 + 170 + 50 + 30 + + + + + + + 580 + 170 + 80 + 30 + + + + + 微软雅黑 + 10 + + + + B-AC码幅度 + + + + + + 660 + 170 + 50 + 30 + + + + + + + 740 + 170 + 70 + 30 + + + + + 微软雅黑 + 10 + + + + 输入补偿值 + + + + + + 810 + 170 + 300 + 30 + + + + + + + 1050 + 120 60 30 @@ -119,24 +341,156 @@ - 闰秒标志 + 控制状态 - + - 230 + 1110 120 50 30 - + - 300 - 120 + 20 + 230 + 90 + 30 + + + + + 微软雅黑 + 10 + + + + 1PPS输出状态 + + + + + + 110 + 230 + 200 + 30 + + + + + + + 330 + 230 + 90 + 30 + + + + + 微软雅黑 + 10 + + + + B-DC输出状态 + + + + + + 420 + 230 + 200 + 30 + + + + + + + 730 + 230 + 200 + 30 + + + + + + + + + + 640 + 230 + 90 + 30 + + + + + 微软雅黑 + 10 + + + + B-AC输出状态 + + + + + + 100 + 500 + 100 + 30 + + + + + + + 820 + 430 + 200 + 30 + + + + true + + + + + + 20 + 500 + 60 + 30 + + + + + 微软雅黑 + 10 + + + + 控制状态 + + + + + + 610 + 380 80 30 @@ -148,7 +502,373 @@ - 频率信号状态 + 相位调节 + + + + + + 460 + 500 + 80 + 30 + + + + + 微软雅黑 + 10 + + + + send + + + + + + 460 + 380 + 80 + 30 + + + + + 微软雅黑 + 10 + + + + send + + + + + + 20 + 330 + 80 + 30 + + + + + 微软雅黑 + 10 + + + + 参考源选择 + + + + + + 1050 + 330 + 80 + 30 + + + + + 微软雅黑 + 10 + + + + send + + + + + + 230 + 330 + 200 + 30 + + + + true + + + + + + 1050 + 380 + 80 + 30 + + + + + 微软雅黑 + 10 + + + + send + + + + + + 460 + 430 + 80 + 30 + + + + + 微软雅黑 + 10 + + + + send + + + + + + 230 + 430 + 200 + 30 + + + + true + + + + + + 690 + 380 + 100 + 30 + + + + + + + 610 + 330 + 60 + 30 + + + + + 微软雅黑 + 10 + + + + 时间源 + + + + + + 1050 + 430 + 80 + 30 + + + + + 微软雅黑 + 10 + + + + send + + + + + + 690 + 430 + 100 + 30 + + + + + + + 820 + 380 + 200 + 30 + + + + true + + + + + + 100 + 430 + 100 + 30 + + + + + + + 230 + 500 + 200 + 30 + + + + true + + + + + + 20 + 430 + 60 + 30 + + + + + 微软雅黑 + 10 + + + + AC码幅度 + + + + + + 100 + 380 + 100 + 30 + + + + + + + 100 + 330 + 100 + 30 + + + + + + + 820 + 330 + 200 + 30 + + + + true + + + + + + 610 + 430 + 80 + 30 + + + + + 微软雅黑 + 10 + + + + 输入延迟补偿 + + + + + + 690 + 330 + 100 + 30 + + + + + + + 20 + 380 + 80 + 30 + + + + + 微软雅黑 + 10 + + + + AC码调制比 + + + + + + 460 + 330 + 80 + 30 + + + + + 微软雅黑 + 10 + + + + send + + + + + + 230 + 380 + 200 + 30 + + + + true diff --git a/DeviceHub/common/common.pri b/DeviceHub/common/common.pri index 6ac9b59..feeba36 100644 --- a/DeviceHub/common/common.pri +++ b/DeviceHub/common/common.pri @@ -1,22 +1,20 @@ -SOURCES += $$PWD/utils/SettingConfig.cpp \ - $$PWD/utils/QKafkaProducer.cpp +SOURCES += $$PWD/utils/SettingConfig.cpp SOURCES += $$PWD/utils/QByteUtil.cpp SOURCES += $$PWD/utils/QSerialPortUtil.cpp SOURCES += $$PWD/utils/QLogUtil.cpp -SOURCES += -SOURCES += $$PWD/utils/QKafkaConsumer.cpp +#SOURCES += $$PWD/utils/QKafkaConsumer.cpp +#SOURCES += $$PWD/utils/QKafkaProducer.cpp SOURCES += $$PWD/utils/HttpRequestUtil.cpp SOURCES += $$PWD/utils/MD5.cpp SOURCES += $$PWD/HttpRequestController.cpp -HEADERS += $$PWD/utils/SettingConfig.h \ - $$PWD/utils/QKafkaProducer.h +HEADERS += $$PWD/utils/SettingConfig.h HEADERS += $$PWD/utils/QByteUtil.h HEADERS += $$PWD/utils/QSerialPortUtil.h HEADERS += $$PWD/utils/QLogUtil.h -HEADERS += -HEADERS += $$PWD/utils/QKafkaConsumer.h +#HEADERS += $$PWD/utils/QKafkaConsumer.h +#HEADERS += $$PWD/utils/QKafkaProducer.h HEADERS += $$PWD/utils/HttpRequestUtil.h HEADERS += $$PWD/utils/DefHead.h HEADERS += $$PWD/utils/MD5.h diff --git a/DeviceHub/common/utils/QKafkaConsumer.h b/DeviceHub/common/utils/QKafkaConsumer.h index 5d40f37..49c9f01 100644 --- a/DeviceHub/common/utils/QKafkaConsumer.h +++ b/DeviceHub/common/utils/QKafkaConsumer.h @@ -1,10 +1,10 @@ -#ifndef QKAFKACONSUMER_H +#ifndef QKAFKACONSUMER_H #define QKAFKACONSUMER_H #include #include -#include "include/librdkafka/rdkafkacpp.h" +//#include "include/librdkafka/rdkafkacpp.h" class QKafkaConsumer : public QThread { diff --git a/DeviceHub/DeviceHubWindow.cpp b/DeviceHub/DeviceHubWindow.cpp index e02df0f..d2786ce 100644 --- a/DeviceHub/DeviceHubWindow.cpp +++ b/DeviceHub/DeviceHubWindow.cpp @@ -1,4 +1,4 @@ -#include "DeviceHubWindow.h" +#include "DeviceHubWindow.h" #include "ui_DeviceHubWindow.h" #include @@ -42,11 +42,11 @@ ui->stackedWidget->addWidget(freqSwitForm); // kafka consumer - kafkaConsumer = new QKafkaConsumer(this); - kafkaConsumer->setBrokers(SettingConfig::getInstance().KAFKA_BROKERS); - kafkaConsumer->setTopic(SettingConfig::getInstance().KAFKA_CMD_TOPIC); - kafkaConsumer->createConsumer(); - kafkaConsumer->start(); +// kafkaConsumer = new QKafkaConsumer(this); +// kafkaConsumer->setBrokers(SettingConfig::getInstance().KAFKA_BROKERS); +// kafkaConsumer->setTopic(SettingConfig::getInstance().KAFKA_CMD_TOPIC); +// kafkaConsumer->createConsumer(); +// kafkaConsumer->start(); // init device type and device list httpReq = new HttpRequestController(this); diff --git a/DeviceHub/DeviceHubWindow.h b/DeviceHub/DeviceHubWindow.h index 94bf742..ad91f95 100644 --- a/DeviceHub/DeviceHubWindow.h +++ b/DeviceHub/DeviceHubWindow.h @@ -1,11 +1,11 @@ -#ifndef DEVICEHUBWINDOW_H +#ifndef DEVICEHUBWINDOW_H #define DEVICEHUBWINDOW_H #include #include #include "common/HttpRequestController.h" -#include "common/utils/QKafkaConsumer.h" +//#include "common/utils/QKafkaConsumer.h" #include "device/DeviceBase.h" #include "FrequencyTuningForm.h" #include "SignalGeneratorForm.h" @@ -28,7 +28,7 @@ int currentDevIndex; QMap> allTypeDevList; - QKafkaConsumer * kafkaConsumer; +// QKafkaConsumer * kafkaConsumer; QComboBox * getDevTypeSelect(); QComboBox * getDevSelect(); diff --git a/DeviceHub/TimeSwitcherForm.cpp b/DeviceHub/TimeSwitcherForm.cpp index a7d4b2f..82fe96d 100644 --- a/DeviceHub/TimeSwitcherForm.cpp +++ b/DeviceHub/TimeSwitcherForm.cpp @@ -1,4 +1,4 @@ -#include "TimeSwitcherForm.h" +#include "TimeSwitcherForm.h" #include "ui_TimeSwitcherForm.h" #include "DeviceHubWindow.h" @@ -28,11 +28,38 @@ if (frameData->frameType == "0501") { TimeSwitcherStatusDto * statusFrameDto = (TimeSwitcherStatusDto *) frameData; + ui->tsDevStatus->setText(statusFrameDto->devStatus == "1" ? "正常" : "异常"); + ui->tsRefSelectType->setText(statusFrameDto->refSelectType == "1" ? "手动" : "自动"); + ui->tsRefTmSrc->setText(QString("时间源%1").arg(statusFrameDto->refTmSrc)); + ui->tsOppsPhaseAccOut->setText(QString("%1 ps").arg(statusFrameDto->oppsPhaseAccOut)); + ui->tsBacRatio->setText(QString("%1").arg(statusFrameDto->bacRatio)); + ui->tsBacRange->setText(QString("%1 V").arg(statusFrameDto->bacRange)); + + QJsonObject dataObj = statusFrameDto->toJSON().find("data")->toObject(); + QJsonDocument doc; + + doc.setArray(dataObj.find("tmSrcStatusStrArray")->toArray()); + ui->tsTmSrcStatus->setText(QString::fromUtf8(doc.toJson(QJsonDocument::Compact).constData())); + + doc.setArray(dataObj.find("bacOutStatusArray")->toArray()); + ui->tsBacOutStatus->setText(QString::fromUtf8(doc.toJson(QJsonDocument::Compact).constData())); + + doc.setArray(dataObj.find("bdcOutStatusArray")->toArray()); + ui->tsBdcOutStatus->setText(QString::fromUtf8(doc.toJson(QJsonDocument::Compact).constData())); + + doc.setArray(dataObj.find("delayCompensArray")->toArray()); + ui->tsDelayComp->setText(QString::fromUtf8(doc.toJson(QJsonDocument::Compact).constData())); + + doc.setArray(dataObj.find("oppsOutStatusArray")->toArray()); + ui->tsOppsOutStatus->setText(QString::fromUtf8(doc.toJson(QJsonDocument::Compact).constData())); + + doc.setArray(dataObj.find("localTmDiffArray")->toArray()); + ui->tsLocalTmDiff->setText(QString::fromUtf8(doc.toJson(QJsonDocument::Compact).constData())); } else if (frameData->frameType == "0502") { TimeSwitcherInterfaceDto * interFrameDto = (TimeSwitcherInterfaceDto *) frameData; - + ui->tsCtrlStatus->setText(interFrameDto->ctrlStatus == "1" ? "程控" : "本控"); } } @@ -58,24 +85,31 @@ QString commandType = command.value("command").toString(); if (commandType == "GLF,01") { - + ui->tsRefSelectTypeSet->setText(command.value("params").toString()); + ui->tsRefSelectTypeSetRaw->setText(command.value("rawCommand").toString()); } else if (commandType == "GLF,02") { - + ui->tsBacRatioSet->setText(command.value("params").toString()); + ui->tsBacRatioSetRaw->setText(command.value("rawCommand").toString()); } else if (commandType == "GLF,03") { - + ui->tsBacRangeSet->setText(command.value("params").toString()); + ui->tsBacRangeSetRaw->setText(command.value("rawCommand").toString()); } else if (commandType == "GLF,04") { - + ui->tsTmSrcSet->setText(command.value("params").toString()); + ui->tsTmSrcSetRaw->setText(command.value("rawCommand").toString()); } else if (commandType == "GLF,05") { - + ui->tsOppsPhaseSet->setText(command.value("params").toString()); + ui->tsOppsPhaseSetRaw->setText(command.value("rawCommand").toString()); } else if (commandType == "GLF,06") { - + ui->tsDelayCompSet->setText(command.value("params").toString()); + ui->tsDelayCompSetRaw->setText(command.value("rawCommand").toString()); } else if (commandType == "GLC,01") { - + ui->tsControlSet->setText(command.value("params").toString()); + ui->tsControlSetRaw->setText(command.value("rawCommand").toString()); } } diff --git a/DeviceHub/TimeSwitcherForm.ui b/DeviceHub/TimeSwitcherForm.ui index 2a428fc..71477c4 100644 --- a/DeviceHub/TimeSwitcherForm.ui +++ b/DeviceHub/TimeSwitcherForm.ui @@ -6,7 +6,7 @@ 0 0 - 1200 + 1300 600 @@ -49,7 +49,7 @@ 20 - 230 + 290 100 30 @@ -93,10 +93,10 @@ - + - 380 + 410 120 50 30 @@ -108,6 +108,228 @@ 170 120 + 100 + 30 + + + + + 微软雅黑 + 10 + + + + 选择参考源模式 + + + + + + 270 + 120 + 50 + 30 + + + + + + + 340 + 120 + 70 + 30 + + + + + 微软雅黑 + 10 + + + + 当前时间源 + + + + + + 480 + 120 + 70 + 30 + + + + + 微软雅黑 + 10 + + + + 时间源状态 + + + + + + 550 + 120 + 300 + 30 + + + + + + + 20 + 170 + 70 + 30 + + + + + 微软雅黑 + 10 + + + + 时间源秒差 + + + + + + 90 + 170 + 300 + 30 + + + + + + + 870 + 120 + 100 + 30 + + + + + 微软雅黑 + 10 + + + + 相位调节累计值 + + + + + + 970 + 120 + 50 + 30 + + + + + + + 420 + 170 + 90 + 30 + + + + + 微软雅黑 + 10 + + + + B-AC码调制比 + + + + + + 510 + 170 + 50 + 30 + + + + + + + 580 + 170 + 80 + 30 + + + + + 微软雅黑 + 10 + + + + B-AC码幅度 + + + + + + 660 + 170 + 50 + 30 + + + + + + + 740 + 170 + 70 + 30 + + + + + 微软雅黑 + 10 + + + + 输入补偿值 + + + + + + 810 + 170 + 300 + 30 + + + + + + + 1050 + 120 60 30 @@ -119,24 +341,156 @@ - 闰秒标志 + 控制状态 - + - 230 + 1110 120 50 30 - + - 300 - 120 + 20 + 230 + 90 + 30 + + + + + 微软雅黑 + 10 + + + + 1PPS输出状态 + + + + + + 110 + 230 + 200 + 30 + + + + + + + 330 + 230 + 90 + 30 + + + + + 微软雅黑 + 10 + + + + B-DC输出状态 + + + + + + 420 + 230 + 200 + 30 + + + + + + + 730 + 230 + 200 + 30 + + + + + + + + + + 640 + 230 + 90 + 30 + + + + + 微软雅黑 + 10 + + + + B-AC输出状态 + + + + + + 100 + 500 + 100 + 30 + + + + + + + 820 + 430 + 200 + 30 + + + + true + + + + + + 20 + 500 + 60 + 30 + + + + + 微软雅黑 + 10 + + + + 控制状态 + + + + + + 610 + 380 80 30 @@ -148,7 +502,373 @@ - 频率信号状态 + 相位调节 + + + + + + 460 + 500 + 80 + 30 + + + + + 微软雅黑 + 10 + + + + send + + + + + + 460 + 380 + 80 + 30 + + + + + 微软雅黑 + 10 + + + + send + + + + + + 20 + 330 + 80 + 30 + + + + + 微软雅黑 + 10 + + + + 参考源选择 + + + + + + 1050 + 330 + 80 + 30 + + + + + 微软雅黑 + 10 + + + + send + + + + + + 230 + 330 + 200 + 30 + + + + true + + + + + + 1050 + 380 + 80 + 30 + + + + + 微软雅黑 + 10 + + + + send + + + + + + 460 + 430 + 80 + 30 + + + + + 微软雅黑 + 10 + + + + send + + + + + + 230 + 430 + 200 + 30 + + + + true + + + + + + 690 + 380 + 100 + 30 + + + + + + + 610 + 330 + 60 + 30 + + + + + 微软雅黑 + 10 + + + + 时间源 + + + + + + 1050 + 430 + 80 + 30 + + + + + 微软雅黑 + 10 + + + + send + + + + + + 690 + 430 + 100 + 30 + + + + + + + 820 + 380 + 200 + 30 + + + + true + + + + + + 100 + 430 + 100 + 30 + + + + + + + 230 + 500 + 200 + 30 + + + + true + + + + + + 20 + 430 + 60 + 30 + + + + + 微软雅黑 + 10 + + + + AC码幅度 + + + + + + 100 + 380 + 100 + 30 + + + + + + + 100 + 330 + 100 + 30 + + + + + + + 820 + 330 + 200 + 30 + + + + true + + + + + + 610 + 430 + 80 + 30 + + + + + 微软雅黑 + 10 + + + + 输入延迟补偿 + + + + + + 690 + 330 + 100 + 30 + + + + + + + 20 + 380 + 80 + 30 + + + + + 微软雅黑 + 10 + + + + AC码调制比 + + + + + + 460 + 330 + 80 + 30 + + + + + 微软雅黑 + 10 + + + + send + + + + + + 230 + 380 + 200 + 30 + + + + true diff --git a/DeviceHub/common/common.pri b/DeviceHub/common/common.pri index 6ac9b59..feeba36 100644 --- a/DeviceHub/common/common.pri +++ b/DeviceHub/common/common.pri @@ -1,22 +1,20 @@ -SOURCES += $$PWD/utils/SettingConfig.cpp \ - $$PWD/utils/QKafkaProducer.cpp +SOURCES += $$PWD/utils/SettingConfig.cpp SOURCES += $$PWD/utils/QByteUtil.cpp SOURCES += $$PWD/utils/QSerialPortUtil.cpp SOURCES += $$PWD/utils/QLogUtil.cpp -SOURCES += -SOURCES += $$PWD/utils/QKafkaConsumer.cpp +#SOURCES += $$PWD/utils/QKafkaConsumer.cpp +#SOURCES += $$PWD/utils/QKafkaProducer.cpp SOURCES += $$PWD/utils/HttpRequestUtil.cpp SOURCES += $$PWD/utils/MD5.cpp SOURCES += $$PWD/HttpRequestController.cpp -HEADERS += $$PWD/utils/SettingConfig.h \ - $$PWD/utils/QKafkaProducer.h +HEADERS += $$PWD/utils/SettingConfig.h HEADERS += $$PWD/utils/QByteUtil.h HEADERS += $$PWD/utils/QSerialPortUtil.h HEADERS += $$PWD/utils/QLogUtil.h -HEADERS += -HEADERS += $$PWD/utils/QKafkaConsumer.h +#HEADERS += $$PWD/utils/QKafkaConsumer.h +#HEADERS += $$PWD/utils/QKafkaProducer.h HEADERS += $$PWD/utils/HttpRequestUtil.h HEADERS += $$PWD/utils/DefHead.h HEADERS += $$PWD/utils/MD5.h diff --git a/DeviceHub/common/utils/QKafkaConsumer.h b/DeviceHub/common/utils/QKafkaConsumer.h index 5d40f37..49c9f01 100644 --- a/DeviceHub/common/utils/QKafkaConsumer.h +++ b/DeviceHub/common/utils/QKafkaConsumer.h @@ -1,10 +1,10 @@ -#ifndef QKAFKACONSUMER_H +#ifndef QKAFKACONSUMER_H #define QKAFKACONSUMER_H #include #include -#include "include/librdkafka/rdkafkacpp.h" +//#include "include/librdkafka/rdkafkacpp.h" class QKafkaConsumer : public QThread { diff --git a/DeviceHub/common/utils/QKafkaProducer.h b/DeviceHub/common/utils/QKafkaProducer.h index bd0cc15..d560bb1 100644 --- a/DeviceHub/common/utils/QKafkaProducer.h +++ b/DeviceHub/common/utils/QKafkaProducer.h @@ -3,7 +3,7 @@ #include -#include "include/librdkafka/rdkafkacpp.h" +//#include "include/librdkafka/rdkafkacpp.h" class QKafkaProducer : public QObject { diff --git a/DeviceHub/DeviceHubWindow.cpp b/DeviceHub/DeviceHubWindow.cpp index e02df0f..d2786ce 100644 --- a/DeviceHub/DeviceHubWindow.cpp +++ b/DeviceHub/DeviceHubWindow.cpp @@ -1,4 +1,4 @@ -#include "DeviceHubWindow.h" +#include "DeviceHubWindow.h" #include "ui_DeviceHubWindow.h" #include @@ -42,11 +42,11 @@ ui->stackedWidget->addWidget(freqSwitForm); // kafka consumer - kafkaConsumer = new QKafkaConsumer(this); - kafkaConsumer->setBrokers(SettingConfig::getInstance().KAFKA_BROKERS); - kafkaConsumer->setTopic(SettingConfig::getInstance().KAFKA_CMD_TOPIC); - kafkaConsumer->createConsumer(); - kafkaConsumer->start(); +// kafkaConsumer = new QKafkaConsumer(this); +// kafkaConsumer->setBrokers(SettingConfig::getInstance().KAFKA_BROKERS); +// kafkaConsumer->setTopic(SettingConfig::getInstance().KAFKA_CMD_TOPIC); +// kafkaConsumer->createConsumer(); +// kafkaConsumer->start(); // init device type and device list httpReq = new HttpRequestController(this); diff --git a/DeviceHub/DeviceHubWindow.h b/DeviceHub/DeviceHubWindow.h index 94bf742..ad91f95 100644 --- a/DeviceHub/DeviceHubWindow.h +++ b/DeviceHub/DeviceHubWindow.h @@ -1,11 +1,11 @@ -#ifndef DEVICEHUBWINDOW_H +#ifndef DEVICEHUBWINDOW_H #define DEVICEHUBWINDOW_H #include #include #include "common/HttpRequestController.h" -#include "common/utils/QKafkaConsumer.h" +//#include "common/utils/QKafkaConsumer.h" #include "device/DeviceBase.h" #include "FrequencyTuningForm.h" #include "SignalGeneratorForm.h" @@ -28,7 +28,7 @@ int currentDevIndex; QMap> allTypeDevList; - QKafkaConsumer * kafkaConsumer; +// QKafkaConsumer * kafkaConsumer; QComboBox * getDevTypeSelect(); QComboBox * getDevSelect(); diff --git a/DeviceHub/TimeSwitcherForm.cpp b/DeviceHub/TimeSwitcherForm.cpp index a7d4b2f..82fe96d 100644 --- a/DeviceHub/TimeSwitcherForm.cpp +++ b/DeviceHub/TimeSwitcherForm.cpp @@ -1,4 +1,4 @@ -#include "TimeSwitcherForm.h" +#include "TimeSwitcherForm.h" #include "ui_TimeSwitcherForm.h" #include "DeviceHubWindow.h" @@ -28,11 +28,38 @@ if (frameData->frameType == "0501") { TimeSwitcherStatusDto * statusFrameDto = (TimeSwitcherStatusDto *) frameData; + ui->tsDevStatus->setText(statusFrameDto->devStatus == "1" ? "正常" : "异常"); + ui->tsRefSelectType->setText(statusFrameDto->refSelectType == "1" ? "手动" : "自动"); + ui->tsRefTmSrc->setText(QString("时间源%1").arg(statusFrameDto->refTmSrc)); + ui->tsOppsPhaseAccOut->setText(QString("%1 ps").arg(statusFrameDto->oppsPhaseAccOut)); + ui->tsBacRatio->setText(QString("%1").arg(statusFrameDto->bacRatio)); + ui->tsBacRange->setText(QString("%1 V").arg(statusFrameDto->bacRange)); + + QJsonObject dataObj = statusFrameDto->toJSON().find("data")->toObject(); + QJsonDocument doc; + + doc.setArray(dataObj.find("tmSrcStatusStrArray")->toArray()); + ui->tsTmSrcStatus->setText(QString::fromUtf8(doc.toJson(QJsonDocument::Compact).constData())); + + doc.setArray(dataObj.find("bacOutStatusArray")->toArray()); + ui->tsBacOutStatus->setText(QString::fromUtf8(doc.toJson(QJsonDocument::Compact).constData())); + + doc.setArray(dataObj.find("bdcOutStatusArray")->toArray()); + ui->tsBdcOutStatus->setText(QString::fromUtf8(doc.toJson(QJsonDocument::Compact).constData())); + + doc.setArray(dataObj.find("delayCompensArray")->toArray()); + ui->tsDelayComp->setText(QString::fromUtf8(doc.toJson(QJsonDocument::Compact).constData())); + + doc.setArray(dataObj.find("oppsOutStatusArray")->toArray()); + ui->tsOppsOutStatus->setText(QString::fromUtf8(doc.toJson(QJsonDocument::Compact).constData())); + + doc.setArray(dataObj.find("localTmDiffArray")->toArray()); + ui->tsLocalTmDiff->setText(QString::fromUtf8(doc.toJson(QJsonDocument::Compact).constData())); } else if (frameData->frameType == "0502") { TimeSwitcherInterfaceDto * interFrameDto = (TimeSwitcherInterfaceDto *) frameData; - + ui->tsCtrlStatus->setText(interFrameDto->ctrlStatus == "1" ? "程控" : "本控"); } } @@ -58,24 +85,31 @@ QString commandType = command.value("command").toString(); if (commandType == "GLF,01") { - + ui->tsRefSelectTypeSet->setText(command.value("params").toString()); + ui->tsRefSelectTypeSetRaw->setText(command.value("rawCommand").toString()); } else if (commandType == "GLF,02") { - + ui->tsBacRatioSet->setText(command.value("params").toString()); + ui->tsBacRatioSetRaw->setText(command.value("rawCommand").toString()); } else if (commandType == "GLF,03") { - + ui->tsBacRangeSet->setText(command.value("params").toString()); + ui->tsBacRangeSetRaw->setText(command.value("rawCommand").toString()); } else if (commandType == "GLF,04") { - + ui->tsTmSrcSet->setText(command.value("params").toString()); + ui->tsTmSrcSetRaw->setText(command.value("rawCommand").toString()); } else if (commandType == "GLF,05") { - + ui->tsOppsPhaseSet->setText(command.value("params").toString()); + ui->tsOppsPhaseSetRaw->setText(command.value("rawCommand").toString()); } else if (commandType == "GLF,06") { - + ui->tsDelayCompSet->setText(command.value("params").toString()); + ui->tsDelayCompSetRaw->setText(command.value("rawCommand").toString()); } else if (commandType == "GLC,01") { - + ui->tsControlSet->setText(command.value("params").toString()); + ui->tsControlSetRaw->setText(command.value("rawCommand").toString()); } } diff --git a/DeviceHub/TimeSwitcherForm.ui b/DeviceHub/TimeSwitcherForm.ui index 2a428fc..71477c4 100644 --- a/DeviceHub/TimeSwitcherForm.ui +++ b/DeviceHub/TimeSwitcherForm.ui @@ -6,7 +6,7 @@ 0 0 - 1200 + 1300 600 @@ -49,7 +49,7 @@ 20 - 230 + 290 100 30 @@ -93,10 +93,10 @@ - + - 380 + 410 120 50 30 @@ -108,6 +108,228 @@ 170 120 + 100 + 30 + + + + + 微软雅黑 + 10 + + + + 选择参考源模式 + + + + + + 270 + 120 + 50 + 30 + + + + + + + 340 + 120 + 70 + 30 + + + + + 微软雅黑 + 10 + + + + 当前时间源 + + + + + + 480 + 120 + 70 + 30 + + + + + 微软雅黑 + 10 + + + + 时间源状态 + + + + + + 550 + 120 + 300 + 30 + + + + + + + 20 + 170 + 70 + 30 + + + + + 微软雅黑 + 10 + + + + 时间源秒差 + + + + + + 90 + 170 + 300 + 30 + + + + + + + 870 + 120 + 100 + 30 + + + + + 微软雅黑 + 10 + + + + 相位调节累计值 + + + + + + 970 + 120 + 50 + 30 + + + + + + + 420 + 170 + 90 + 30 + + + + + 微软雅黑 + 10 + + + + B-AC码调制比 + + + + + + 510 + 170 + 50 + 30 + + + + + + + 580 + 170 + 80 + 30 + + + + + 微软雅黑 + 10 + + + + B-AC码幅度 + + + + + + 660 + 170 + 50 + 30 + + + + + + + 740 + 170 + 70 + 30 + + + + + 微软雅黑 + 10 + + + + 输入补偿值 + + + + + + 810 + 170 + 300 + 30 + + + + + + + 1050 + 120 60 30 @@ -119,24 +341,156 @@ - 闰秒标志 + 控制状态 - + - 230 + 1110 120 50 30 - + - 300 - 120 + 20 + 230 + 90 + 30 + + + + + 微软雅黑 + 10 + + + + 1PPS输出状态 + + + + + + 110 + 230 + 200 + 30 + + + + + + + 330 + 230 + 90 + 30 + + + + + 微软雅黑 + 10 + + + + B-DC输出状态 + + + + + + 420 + 230 + 200 + 30 + + + + + + + 730 + 230 + 200 + 30 + + + + + + + + + + 640 + 230 + 90 + 30 + + + + + 微软雅黑 + 10 + + + + B-AC输出状态 + + + + + + 100 + 500 + 100 + 30 + + + + + + + 820 + 430 + 200 + 30 + + + + true + + + + + + 20 + 500 + 60 + 30 + + + + + 微软雅黑 + 10 + + + + 控制状态 + + + + + + 610 + 380 80 30 @@ -148,7 +502,373 @@ - 频率信号状态 + 相位调节 + + + + + + 460 + 500 + 80 + 30 + + + + + 微软雅黑 + 10 + + + + send + + + + + + 460 + 380 + 80 + 30 + + + + + 微软雅黑 + 10 + + + + send + + + + + + 20 + 330 + 80 + 30 + + + + + 微软雅黑 + 10 + + + + 参考源选择 + + + + + + 1050 + 330 + 80 + 30 + + + + + 微软雅黑 + 10 + + + + send + + + + + + 230 + 330 + 200 + 30 + + + + true + + + + + + 1050 + 380 + 80 + 30 + + + + + 微软雅黑 + 10 + + + + send + + + + + + 460 + 430 + 80 + 30 + + + + + 微软雅黑 + 10 + + + + send + + + + + + 230 + 430 + 200 + 30 + + + + true + + + + + + 690 + 380 + 100 + 30 + + + + + + + 610 + 330 + 60 + 30 + + + + + 微软雅黑 + 10 + + + + 时间源 + + + + + + 1050 + 430 + 80 + 30 + + + + + 微软雅黑 + 10 + + + + send + + + + + + 690 + 430 + 100 + 30 + + + + + + + 820 + 380 + 200 + 30 + + + + true + + + + + + 100 + 430 + 100 + 30 + + + + + + + 230 + 500 + 200 + 30 + + + + true + + + + + + 20 + 430 + 60 + 30 + + + + + 微软雅黑 + 10 + + + + AC码幅度 + + + + + + 100 + 380 + 100 + 30 + + + + + + + 100 + 330 + 100 + 30 + + + + + + + 820 + 330 + 200 + 30 + + + + true + + + + + + 610 + 430 + 80 + 30 + + + + + 微软雅黑 + 10 + + + + 输入延迟补偿 + + + + + + 690 + 330 + 100 + 30 + + + + + + + 20 + 380 + 80 + 30 + + + + + 微软雅黑 + 10 + + + + AC码调制比 + + + + + + 460 + 330 + 80 + 30 + + + + + 微软雅黑 + 10 + + + + send + + + + + + 230 + 380 + 200 + 30 + + + + true diff --git a/DeviceHub/common/common.pri b/DeviceHub/common/common.pri index 6ac9b59..feeba36 100644 --- a/DeviceHub/common/common.pri +++ b/DeviceHub/common/common.pri @@ -1,22 +1,20 @@ -SOURCES += $$PWD/utils/SettingConfig.cpp \ - $$PWD/utils/QKafkaProducer.cpp +SOURCES += $$PWD/utils/SettingConfig.cpp SOURCES += $$PWD/utils/QByteUtil.cpp SOURCES += $$PWD/utils/QSerialPortUtil.cpp SOURCES += $$PWD/utils/QLogUtil.cpp -SOURCES += -SOURCES += $$PWD/utils/QKafkaConsumer.cpp +#SOURCES += $$PWD/utils/QKafkaConsumer.cpp +#SOURCES += $$PWD/utils/QKafkaProducer.cpp SOURCES += $$PWD/utils/HttpRequestUtil.cpp SOURCES += $$PWD/utils/MD5.cpp SOURCES += $$PWD/HttpRequestController.cpp -HEADERS += $$PWD/utils/SettingConfig.h \ - $$PWD/utils/QKafkaProducer.h +HEADERS += $$PWD/utils/SettingConfig.h HEADERS += $$PWD/utils/QByteUtil.h HEADERS += $$PWD/utils/QSerialPortUtil.h HEADERS += $$PWD/utils/QLogUtil.h -HEADERS += -HEADERS += $$PWD/utils/QKafkaConsumer.h +#HEADERS += $$PWD/utils/QKafkaConsumer.h +#HEADERS += $$PWD/utils/QKafkaProducer.h HEADERS += $$PWD/utils/HttpRequestUtil.h HEADERS += $$PWD/utils/DefHead.h HEADERS += $$PWD/utils/MD5.h diff --git a/DeviceHub/common/utils/QKafkaConsumer.h b/DeviceHub/common/utils/QKafkaConsumer.h index 5d40f37..49c9f01 100644 --- a/DeviceHub/common/utils/QKafkaConsumer.h +++ b/DeviceHub/common/utils/QKafkaConsumer.h @@ -1,10 +1,10 @@ -#ifndef QKAFKACONSUMER_H +#ifndef QKAFKACONSUMER_H #define QKAFKACONSUMER_H #include #include -#include "include/librdkafka/rdkafkacpp.h" +//#include "include/librdkafka/rdkafkacpp.h" class QKafkaConsumer : public QThread { diff --git a/DeviceHub/common/utils/QKafkaProducer.h b/DeviceHub/common/utils/QKafkaProducer.h index bd0cc15..d560bb1 100644 --- a/DeviceHub/common/utils/QKafkaProducer.h +++ b/DeviceHub/common/utils/QKafkaProducer.h @@ -3,7 +3,7 @@ #include -#include "include/librdkafka/rdkafkacpp.h" +//#include "include/librdkafka/rdkafkacpp.h" class QKafkaProducer : public QObject { diff --git a/DeviceHub/device/DeviceBase.h b/DeviceHub/device/DeviceBase.h index 8a3b271..e06bee3 100644 --- a/DeviceHub/device/DeviceBase.h +++ b/DeviceHub/device/DeviceBase.h @@ -3,7 +3,7 @@ #include #include "common/utils/QSerialPortUtil.h" -#include "common/utils/QKafkaProducer.h" +//#include "common/utils/QKafkaProducer.h" #include "common/utils/QByteUtil.h" #include "common/utils/QLogUtil.h" #include "common/utils/SettingConfig.h" @@ -43,7 +43,7 @@ QString devType; QSerialPortUtil serialUtil; - QKafkaProducer kafkaProducer; +// QKafkaProducer kafkaProducer; QByteArray dataBuff; }; diff --git a/DeviceHub/DeviceHubWindow.cpp b/DeviceHub/DeviceHubWindow.cpp index e02df0f..d2786ce 100644 --- a/DeviceHub/DeviceHubWindow.cpp +++ b/DeviceHub/DeviceHubWindow.cpp @@ -1,4 +1,4 @@ -#include "DeviceHubWindow.h" +#include "DeviceHubWindow.h" #include "ui_DeviceHubWindow.h" #include @@ -42,11 +42,11 @@ ui->stackedWidget->addWidget(freqSwitForm); // kafka consumer - kafkaConsumer = new QKafkaConsumer(this); - kafkaConsumer->setBrokers(SettingConfig::getInstance().KAFKA_BROKERS); - kafkaConsumer->setTopic(SettingConfig::getInstance().KAFKA_CMD_TOPIC); - kafkaConsumer->createConsumer(); - kafkaConsumer->start(); +// kafkaConsumer = new QKafkaConsumer(this); +// kafkaConsumer->setBrokers(SettingConfig::getInstance().KAFKA_BROKERS); +// kafkaConsumer->setTopic(SettingConfig::getInstance().KAFKA_CMD_TOPIC); +// kafkaConsumer->createConsumer(); +// kafkaConsumer->start(); // init device type and device list httpReq = new HttpRequestController(this); diff --git a/DeviceHub/DeviceHubWindow.h b/DeviceHub/DeviceHubWindow.h index 94bf742..ad91f95 100644 --- a/DeviceHub/DeviceHubWindow.h +++ b/DeviceHub/DeviceHubWindow.h @@ -1,11 +1,11 @@ -#ifndef DEVICEHUBWINDOW_H +#ifndef DEVICEHUBWINDOW_H #define DEVICEHUBWINDOW_H #include #include #include "common/HttpRequestController.h" -#include "common/utils/QKafkaConsumer.h" +//#include "common/utils/QKafkaConsumer.h" #include "device/DeviceBase.h" #include "FrequencyTuningForm.h" #include "SignalGeneratorForm.h" @@ -28,7 +28,7 @@ int currentDevIndex; QMap> allTypeDevList; - QKafkaConsumer * kafkaConsumer; +// QKafkaConsumer * kafkaConsumer; QComboBox * getDevTypeSelect(); QComboBox * getDevSelect(); diff --git a/DeviceHub/TimeSwitcherForm.cpp b/DeviceHub/TimeSwitcherForm.cpp index a7d4b2f..82fe96d 100644 --- a/DeviceHub/TimeSwitcherForm.cpp +++ b/DeviceHub/TimeSwitcherForm.cpp @@ -1,4 +1,4 @@ -#include "TimeSwitcherForm.h" +#include "TimeSwitcherForm.h" #include "ui_TimeSwitcherForm.h" #include "DeviceHubWindow.h" @@ -28,11 +28,38 @@ if (frameData->frameType == "0501") { TimeSwitcherStatusDto * statusFrameDto = (TimeSwitcherStatusDto *) frameData; + ui->tsDevStatus->setText(statusFrameDto->devStatus == "1" ? "正常" : "异常"); + ui->tsRefSelectType->setText(statusFrameDto->refSelectType == "1" ? "手动" : "自动"); + ui->tsRefTmSrc->setText(QString("时间源%1").arg(statusFrameDto->refTmSrc)); + ui->tsOppsPhaseAccOut->setText(QString("%1 ps").arg(statusFrameDto->oppsPhaseAccOut)); + ui->tsBacRatio->setText(QString("%1").arg(statusFrameDto->bacRatio)); + ui->tsBacRange->setText(QString("%1 V").arg(statusFrameDto->bacRange)); + + QJsonObject dataObj = statusFrameDto->toJSON().find("data")->toObject(); + QJsonDocument doc; + + doc.setArray(dataObj.find("tmSrcStatusStrArray")->toArray()); + ui->tsTmSrcStatus->setText(QString::fromUtf8(doc.toJson(QJsonDocument::Compact).constData())); + + doc.setArray(dataObj.find("bacOutStatusArray")->toArray()); + ui->tsBacOutStatus->setText(QString::fromUtf8(doc.toJson(QJsonDocument::Compact).constData())); + + doc.setArray(dataObj.find("bdcOutStatusArray")->toArray()); + ui->tsBdcOutStatus->setText(QString::fromUtf8(doc.toJson(QJsonDocument::Compact).constData())); + + doc.setArray(dataObj.find("delayCompensArray")->toArray()); + ui->tsDelayComp->setText(QString::fromUtf8(doc.toJson(QJsonDocument::Compact).constData())); + + doc.setArray(dataObj.find("oppsOutStatusArray")->toArray()); + ui->tsOppsOutStatus->setText(QString::fromUtf8(doc.toJson(QJsonDocument::Compact).constData())); + + doc.setArray(dataObj.find("localTmDiffArray")->toArray()); + ui->tsLocalTmDiff->setText(QString::fromUtf8(doc.toJson(QJsonDocument::Compact).constData())); } else if (frameData->frameType == "0502") { TimeSwitcherInterfaceDto * interFrameDto = (TimeSwitcherInterfaceDto *) frameData; - + ui->tsCtrlStatus->setText(interFrameDto->ctrlStatus == "1" ? "程控" : "本控"); } } @@ -58,24 +85,31 @@ QString commandType = command.value("command").toString(); if (commandType == "GLF,01") { - + ui->tsRefSelectTypeSet->setText(command.value("params").toString()); + ui->tsRefSelectTypeSetRaw->setText(command.value("rawCommand").toString()); } else if (commandType == "GLF,02") { - + ui->tsBacRatioSet->setText(command.value("params").toString()); + ui->tsBacRatioSetRaw->setText(command.value("rawCommand").toString()); } else if (commandType == "GLF,03") { - + ui->tsBacRangeSet->setText(command.value("params").toString()); + ui->tsBacRangeSetRaw->setText(command.value("rawCommand").toString()); } else if (commandType == "GLF,04") { - + ui->tsTmSrcSet->setText(command.value("params").toString()); + ui->tsTmSrcSetRaw->setText(command.value("rawCommand").toString()); } else if (commandType == "GLF,05") { - + ui->tsOppsPhaseSet->setText(command.value("params").toString()); + ui->tsOppsPhaseSetRaw->setText(command.value("rawCommand").toString()); } else if (commandType == "GLF,06") { - + ui->tsDelayCompSet->setText(command.value("params").toString()); + ui->tsDelayCompSetRaw->setText(command.value("rawCommand").toString()); } else if (commandType == "GLC,01") { - + ui->tsControlSet->setText(command.value("params").toString()); + ui->tsControlSetRaw->setText(command.value("rawCommand").toString()); } } diff --git a/DeviceHub/TimeSwitcherForm.ui b/DeviceHub/TimeSwitcherForm.ui index 2a428fc..71477c4 100644 --- a/DeviceHub/TimeSwitcherForm.ui +++ b/DeviceHub/TimeSwitcherForm.ui @@ -6,7 +6,7 @@ 0 0 - 1200 + 1300 600 @@ -49,7 +49,7 @@ 20 - 230 + 290 100 30 @@ -93,10 +93,10 @@ - + - 380 + 410 120 50 30 @@ -108,6 +108,228 @@ 170 120 + 100 + 30 + + + + + 微软雅黑 + 10 + + + + 选择参考源模式 + + + + + + 270 + 120 + 50 + 30 + + + + + + + 340 + 120 + 70 + 30 + + + + + 微软雅黑 + 10 + + + + 当前时间源 + + + + + + 480 + 120 + 70 + 30 + + + + + 微软雅黑 + 10 + + + + 时间源状态 + + + + + + 550 + 120 + 300 + 30 + + + + + + + 20 + 170 + 70 + 30 + + + + + 微软雅黑 + 10 + + + + 时间源秒差 + + + + + + 90 + 170 + 300 + 30 + + + + + + + 870 + 120 + 100 + 30 + + + + + 微软雅黑 + 10 + + + + 相位调节累计值 + + + + + + 970 + 120 + 50 + 30 + + + + + + + 420 + 170 + 90 + 30 + + + + + 微软雅黑 + 10 + + + + B-AC码调制比 + + + + + + 510 + 170 + 50 + 30 + + + + + + + 580 + 170 + 80 + 30 + + + + + 微软雅黑 + 10 + + + + B-AC码幅度 + + + + + + 660 + 170 + 50 + 30 + + + + + + + 740 + 170 + 70 + 30 + + + + + 微软雅黑 + 10 + + + + 输入补偿值 + + + + + + 810 + 170 + 300 + 30 + + + + + + + 1050 + 120 60 30 @@ -119,24 +341,156 @@ - 闰秒标志 + 控制状态 - + - 230 + 1110 120 50 30 - + - 300 - 120 + 20 + 230 + 90 + 30 + + + + + 微软雅黑 + 10 + + + + 1PPS输出状态 + + + + + + 110 + 230 + 200 + 30 + + + + + + + 330 + 230 + 90 + 30 + + + + + 微软雅黑 + 10 + + + + B-DC输出状态 + + + + + + 420 + 230 + 200 + 30 + + + + + + + 730 + 230 + 200 + 30 + + + + + + + + + + 640 + 230 + 90 + 30 + + + + + 微软雅黑 + 10 + + + + B-AC输出状态 + + + + + + 100 + 500 + 100 + 30 + + + + + + + 820 + 430 + 200 + 30 + + + + true + + + + + + 20 + 500 + 60 + 30 + + + + + 微软雅黑 + 10 + + + + 控制状态 + + + + + + 610 + 380 80 30 @@ -148,7 +502,373 @@ - 频率信号状态 + 相位调节 + + + + + + 460 + 500 + 80 + 30 + + + + + 微软雅黑 + 10 + + + + send + + + + + + 460 + 380 + 80 + 30 + + + + + 微软雅黑 + 10 + + + + send + + + + + + 20 + 330 + 80 + 30 + + + + + 微软雅黑 + 10 + + + + 参考源选择 + + + + + + 1050 + 330 + 80 + 30 + + + + + 微软雅黑 + 10 + + + + send + + + + + + 230 + 330 + 200 + 30 + + + + true + + + + + + 1050 + 380 + 80 + 30 + + + + + 微软雅黑 + 10 + + + + send + + + + + + 460 + 430 + 80 + 30 + + + + + 微软雅黑 + 10 + + + + send + + + + + + 230 + 430 + 200 + 30 + + + + true + + + + + + 690 + 380 + 100 + 30 + + + + + + + 610 + 330 + 60 + 30 + + + + + 微软雅黑 + 10 + + + + 时间源 + + + + + + 1050 + 430 + 80 + 30 + + + + + 微软雅黑 + 10 + + + + send + + + + + + 690 + 430 + 100 + 30 + + + + + + + 820 + 380 + 200 + 30 + + + + true + + + + + + 100 + 430 + 100 + 30 + + + + + + + 230 + 500 + 200 + 30 + + + + true + + + + + + 20 + 430 + 60 + 30 + + + + + 微软雅黑 + 10 + + + + AC码幅度 + + + + + + 100 + 380 + 100 + 30 + + + + + + + 100 + 330 + 100 + 30 + + + + + + + 820 + 330 + 200 + 30 + + + + true + + + + + + 610 + 430 + 80 + 30 + + + + + 微软雅黑 + 10 + + + + 输入延迟补偿 + + + + + + 690 + 330 + 100 + 30 + + + + + + + 20 + 380 + 80 + 30 + + + + + 微软雅黑 + 10 + + + + AC码调制比 + + + + + + 460 + 330 + 80 + 30 + + + + + 微软雅黑 + 10 + + + + send + + + + + + 230 + 380 + 200 + 30 + + + + true diff --git a/DeviceHub/common/common.pri b/DeviceHub/common/common.pri index 6ac9b59..feeba36 100644 --- a/DeviceHub/common/common.pri +++ b/DeviceHub/common/common.pri @@ -1,22 +1,20 @@ -SOURCES += $$PWD/utils/SettingConfig.cpp \ - $$PWD/utils/QKafkaProducer.cpp +SOURCES += $$PWD/utils/SettingConfig.cpp SOURCES += $$PWD/utils/QByteUtil.cpp SOURCES += $$PWD/utils/QSerialPortUtil.cpp SOURCES += $$PWD/utils/QLogUtil.cpp -SOURCES += -SOURCES += $$PWD/utils/QKafkaConsumer.cpp +#SOURCES += $$PWD/utils/QKafkaConsumer.cpp +#SOURCES += $$PWD/utils/QKafkaProducer.cpp SOURCES += $$PWD/utils/HttpRequestUtil.cpp SOURCES += $$PWD/utils/MD5.cpp SOURCES += $$PWD/HttpRequestController.cpp -HEADERS += $$PWD/utils/SettingConfig.h \ - $$PWD/utils/QKafkaProducer.h +HEADERS += $$PWD/utils/SettingConfig.h HEADERS += $$PWD/utils/QByteUtil.h HEADERS += $$PWD/utils/QSerialPortUtil.h HEADERS += $$PWD/utils/QLogUtil.h -HEADERS += -HEADERS += $$PWD/utils/QKafkaConsumer.h +#HEADERS += $$PWD/utils/QKafkaConsumer.h +#HEADERS += $$PWD/utils/QKafkaProducer.h HEADERS += $$PWD/utils/HttpRequestUtil.h HEADERS += $$PWD/utils/DefHead.h HEADERS += $$PWD/utils/MD5.h diff --git a/DeviceHub/common/utils/QKafkaConsumer.h b/DeviceHub/common/utils/QKafkaConsumer.h index 5d40f37..49c9f01 100644 --- a/DeviceHub/common/utils/QKafkaConsumer.h +++ b/DeviceHub/common/utils/QKafkaConsumer.h @@ -1,10 +1,10 @@ -#ifndef QKAFKACONSUMER_H +#ifndef QKAFKACONSUMER_H #define QKAFKACONSUMER_H #include #include -#include "include/librdkafka/rdkafkacpp.h" +//#include "include/librdkafka/rdkafkacpp.h" class QKafkaConsumer : public QThread { diff --git a/DeviceHub/common/utils/QKafkaProducer.h b/DeviceHub/common/utils/QKafkaProducer.h index bd0cc15..d560bb1 100644 --- a/DeviceHub/common/utils/QKafkaProducer.h +++ b/DeviceHub/common/utils/QKafkaProducer.h @@ -3,7 +3,7 @@ #include -#include "include/librdkafka/rdkafkacpp.h" +//#include "include/librdkafka/rdkafkacpp.h" class QKafkaProducer : public QObject { diff --git a/DeviceHub/device/DeviceBase.h b/DeviceHub/device/DeviceBase.h index 8a3b271..e06bee3 100644 --- a/DeviceHub/device/DeviceBase.h +++ b/DeviceHub/device/DeviceBase.h @@ -3,7 +3,7 @@ #include #include "common/utils/QSerialPortUtil.h" -#include "common/utils/QKafkaProducer.h" +//#include "common/utils/QKafkaProducer.h" #include "common/utils/QByteUtil.h" #include "common/utils/QLogUtil.h" #include "common/utils/SettingConfig.h" @@ -43,7 +43,7 @@ QString devType; QSerialPortUtil serialUtil; - QKafkaProducer kafkaProducer; +// QKafkaProducer kafkaProducer; QByteArray dataBuff; }; diff --git a/DeviceHub/device/FreqSwitcher.cpp b/DeviceHub/device/FreqSwitcher.cpp index 96ce66a..5851f26 100644 --- a/DeviceHub/device/FreqSwitcher.cpp +++ b/DeviceHub/device/FreqSwitcher.cpp @@ -14,12 +14,12 @@ connect(this, &FreqSwitcher::sendCommandToDisplay, ((DeviceHubWindow *)this->parent())->freqSwitForm, &FreqSwitcherForm::displayDeviceCommandOnForm); - connect(((DeviceHubWindow *)this->parent())->kafkaConsumer, &QKafkaConsumer::messageRecieved, - this, &FreqSwitcher::commandReceivedHandler); +// connect(((DeviceHubWindow *)this->parent())->kafkaConsumer, &QKafkaConsumer::messageRecieved, +// this, &FreqSwitcher::commandReceivedHandler); - kafkaProducer.setBrokers(SettingConfig::getInstance().KAFKA_BROKERS); - kafkaProducer.setTopic(SettingConfig::getInstance().KAFKA_DATA_TOPIC); - kafkaProducer.createProducer(); +// kafkaProducer.setBrokers(SettingConfig::getInstance().KAFKA_BROKERS); +// kafkaProducer.setTopic(SettingConfig::getInstance().KAFKA_DATA_TOPIC); +// kafkaProducer.createProducer(); this->protocol = DeviceProtocolBase::deviceProtocolFactory(devType); } @@ -112,7 +112,7 @@ QJsonObject jsonObj = frameDto->toJSON(); jsonObj.insert("clientId", SettingConfig::getInstance().CLIENT_ID); jsonObj.insert("deviceId", deviceId); - kafkaProducer.produceMessage(QString(QJsonDocument(jsonObj).toJson(QJsonDocument::Compact))); +// kafkaProducer.produceMessage(QString(QJsonDocument(jsonObj).toJson(QJsonDocument::Compact))); } // 4. 在界面上简单显示相差数据结果 @@ -167,7 +167,7 @@ cmdcb.insert("commandId", command.value("commandId").toString()); cmdcb.insert("rawCommand", QString::fromUtf8(commandBytes)); cmdcb.insert("status", "1"); - this->kafkaProducer.produceMessage(SettingConfig::getInstance().KAFKA_CMDCB_TOPIC, QString(QJsonDocument(cmdcb).toJson(QJsonDocument::Compact))); +// this->kafkaProducer.produceMessage(SettingConfig::getInstance().KAFKA_CMDCB_TOPIC, QString(QJsonDocument(cmdcb).toJson(QJsonDocument::Compact))); // display on page emit sendCommandToDisplay(command); diff --git a/DeviceHub/DeviceHubWindow.cpp b/DeviceHub/DeviceHubWindow.cpp index e02df0f..d2786ce 100644 --- a/DeviceHub/DeviceHubWindow.cpp +++ b/DeviceHub/DeviceHubWindow.cpp @@ -1,4 +1,4 @@ -#include "DeviceHubWindow.h" +#include "DeviceHubWindow.h" #include "ui_DeviceHubWindow.h" #include @@ -42,11 +42,11 @@ ui->stackedWidget->addWidget(freqSwitForm); // kafka consumer - kafkaConsumer = new QKafkaConsumer(this); - kafkaConsumer->setBrokers(SettingConfig::getInstance().KAFKA_BROKERS); - kafkaConsumer->setTopic(SettingConfig::getInstance().KAFKA_CMD_TOPIC); - kafkaConsumer->createConsumer(); - kafkaConsumer->start(); +// kafkaConsumer = new QKafkaConsumer(this); +// kafkaConsumer->setBrokers(SettingConfig::getInstance().KAFKA_BROKERS); +// kafkaConsumer->setTopic(SettingConfig::getInstance().KAFKA_CMD_TOPIC); +// kafkaConsumer->createConsumer(); +// kafkaConsumer->start(); // init device type and device list httpReq = new HttpRequestController(this); diff --git a/DeviceHub/DeviceHubWindow.h b/DeviceHub/DeviceHubWindow.h index 94bf742..ad91f95 100644 --- a/DeviceHub/DeviceHubWindow.h +++ b/DeviceHub/DeviceHubWindow.h @@ -1,11 +1,11 @@ -#ifndef DEVICEHUBWINDOW_H +#ifndef DEVICEHUBWINDOW_H #define DEVICEHUBWINDOW_H #include #include #include "common/HttpRequestController.h" -#include "common/utils/QKafkaConsumer.h" +//#include "common/utils/QKafkaConsumer.h" #include "device/DeviceBase.h" #include "FrequencyTuningForm.h" #include "SignalGeneratorForm.h" @@ -28,7 +28,7 @@ int currentDevIndex; QMap> allTypeDevList; - QKafkaConsumer * kafkaConsumer; +// QKafkaConsumer * kafkaConsumer; QComboBox * getDevTypeSelect(); QComboBox * getDevSelect(); diff --git a/DeviceHub/TimeSwitcherForm.cpp b/DeviceHub/TimeSwitcherForm.cpp index a7d4b2f..82fe96d 100644 --- a/DeviceHub/TimeSwitcherForm.cpp +++ b/DeviceHub/TimeSwitcherForm.cpp @@ -1,4 +1,4 @@ -#include "TimeSwitcherForm.h" +#include "TimeSwitcherForm.h" #include "ui_TimeSwitcherForm.h" #include "DeviceHubWindow.h" @@ -28,11 +28,38 @@ if (frameData->frameType == "0501") { TimeSwitcherStatusDto * statusFrameDto = (TimeSwitcherStatusDto *) frameData; + ui->tsDevStatus->setText(statusFrameDto->devStatus == "1" ? "正常" : "异常"); + ui->tsRefSelectType->setText(statusFrameDto->refSelectType == "1" ? "手动" : "自动"); + ui->tsRefTmSrc->setText(QString("时间源%1").arg(statusFrameDto->refTmSrc)); + ui->tsOppsPhaseAccOut->setText(QString("%1 ps").arg(statusFrameDto->oppsPhaseAccOut)); + ui->tsBacRatio->setText(QString("%1").arg(statusFrameDto->bacRatio)); + ui->tsBacRange->setText(QString("%1 V").arg(statusFrameDto->bacRange)); + + QJsonObject dataObj = statusFrameDto->toJSON().find("data")->toObject(); + QJsonDocument doc; + + doc.setArray(dataObj.find("tmSrcStatusStrArray")->toArray()); + ui->tsTmSrcStatus->setText(QString::fromUtf8(doc.toJson(QJsonDocument::Compact).constData())); + + doc.setArray(dataObj.find("bacOutStatusArray")->toArray()); + ui->tsBacOutStatus->setText(QString::fromUtf8(doc.toJson(QJsonDocument::Compact).constData())); + + doc.setArray(dataObj.find("bdcOutStatusArray")->toArray()); + ui->tsBdcOutStatus->setText(QString::fromUtf8(doc.toJson(QJsonDocument::Compact).constData())); + + doc.setArray(dataObj.find("delayCompensArray")->toArray()); + ui->tsDelayComp->setText(QString::fromUtf8(doc.toJson(QJsonDocument::Compact).constData())); + + doc.setArray(dataObj.find("oppsOutStatusArray")->toArray()); + ui->tsOppsOutStatus->setText(QString::fromUtf8(doc.toJson(QJsonDocument::Compact).constData())); + + doc.setArray(dataObj.find("localTmDiffArray")->toArray()); + ui->tsLocalTmDiff->setText(QString::fromUtf8(doc.toJson(QJsonDocument::Compact).constData())); } else if (frameData->frameType == "0502") { TimeSwitcherInterfaceDto * interFrameDto = (TimeSwitcherInterfaceDto *) frameData; - + ui->tsCtrlStatus->setText(interFrameDto->ctrlStatus == "1" ? "程控" : "本控"); } } @@ -58,24 +85,31 @@ QString commandType = command.value("command").toString(); if (commandType == "GLF,01") { - + ui->tsRefSelectTypeSet->setText(command.value("params").toString()); + ui->tsRefSelectTypeSetRaw->setText(command.value("rawCommand").toString()); } else if (commandType == "GLF,02") { - + ui->tsBacRatioSet->setText(command.value("params").toString()); + ui->tsBacRatioSetRaw->setText(command.value("rawCommand").toString()); } else if (commandType == "GLF,03") { - + ui->tsBacRangeSet->setText(command.value("params").toString()); + ui->tsBacRangeSetRaw->setText(command.value("rawCommand").toString()); } else if (commandType == "GLF,04") { - + ui->tsTmSrcSet->setText(command.value("params").toString()); + ui->tsTmSrcSetRaw->setText(command.value("rawCommand").toString()); } else if (commandType == "GLF,05") { - + ui->tsOppsPhaseSet->setText(command.value("params").toString()); + ui->tsOppsPhaseSetRaw->setText(command.value("rawCommand").toString()); } else if (commandType == "GLF,06") { - + ui->tsDelayCompSet->setText(command.value("params").toString()); + ui->tsDelayCompSetRaw->setText(command.value("rawCommand").toString()); } else if (commandType == "GLC,01") { - + ui->tsControlSet->setText(command.value("params").toString()); + ui->tsControlSetRaw->setText(command.value("rawCommand").toString()); } } diff --git a/DeviceHub/TimeSwitcherForm.ui b/DeviceHub/TimeSwitcherForm.ui index 2a428fc..71477c4 100644 --- a/DeviceHub/TimeSwitcherForm.ui +++ b/DeviceHub/TimeSwitcherForm.ui @@ -6,7 +6,7 @@ 0 0 - 1200 + 1300 600 @@ -49,7 +49,7 @@ 20 - 230 + 290 100 30 @@ -93,10 +93,10 @@ - + - 380 + 410 120 50 30 @@ -108,6 +108,228 @@ 170 120 + 100 + 30 + + + + + 微软雅黑 + 10 + + + + 选择参考源模式 + + + + + + 270 + 120 + 50 + 30 + + + + + + + 340 + 120 + 70 + 30 + + + + + 微软雅黑 + 10 + + + + 当前时间源 + + + + + + 480 + 120 + 70 + 30 + + + + + 微软雅黑 + 10 + + + + 时间源状态 + + + + + + 550 + 120 + 300 + 30 + + + + + + + 20 + 170 + 70 + 30 + + + + + 微软雅黑 + 10 + + + + 时间源秒差 + + + + + + 90 + 170 + 300 + 30 + + + + + + + 870 + 120 + 100 + 30 + + + + + 微软雅黑 + 10 + + + + 相位调节累计值 + + + + + + 970 + 120 + 50 + 30 + + + + + + + 420 + 170 + 90 + 30 + + + + + 微软雅黑 + 10 + + + + B-AC码调制比 + + + + + + 510 + 170 + 50 + 30 + + + + + + + 580 + 170 + 80 + 30 + + + + + 微软雅黑 + 10 + + + + B-AC码幅度 + + + + + + 660 + 170 + 50 + 30 + + + + + + + 740 + 170 + 70 + 30 + + + + + 微软雅黑 + 10 + + + + 输入补偿值 + + + + + + 810 + 170 + 300 + 30 + + + + + + + 1050 + 120 60 30 @@ -119,24 +341,156 @@ - 闰秒标志 + 控制状态 - + - 230 + 1110 120 50 30 - + - 300 - 120 + 20 + 230 + 90 + 30 + + + + + 微软雅黑 + 10 + + + + 1PPS输出状态 + + + + + + 110 + 230 + 200 + 30 + + + + + + + 330 + 230 + 90 + 30 + + + + + 微软雅黑 + 10 + + + + B-DC输出状态 + + + + + + 420 + 230 + 200 + 30 + + + + + + + 730 + 230 + 200 + 30 + + + + + + + + + + 640 + 230 + 90 + 30 + + + + + 微软雅黑 + 10 + + + + B-AC输出状态 + + + + + + 100 + 500 + 100 + 30 + + + + + + + 820 + 430 + 200 + 30 + + + + true + + + + + + 20 + 500 + 60 + 30 + + + + + 微软雅黑 + 10 + + + + 控制状态 + + + + + + 610 + 380 80 30 @@ -148,7 +502,373 @@ - 频率信号状态 + 相位调节 + + + + + + 460 + 500 + 80 + 30 + + + + + 微软雅黑 + 10 + + + + send + + + + + + 460 + 380 + 80 + 30 + + + + + 微软雅黑 + 10 + + + + send + + + + + + 20 + 330 + 80 + 30 + + + + + 微软雅黑 + 10 + + + + 参考源选择 + + + + + + 1050 + 330 + 80 + 30 + + + + + 微软雅黑 + 10 + + + + send + + + + + + 230 + 330 + 200 + 30 + + + + true + + + + + + 1050 + 380 + 80 + 30 + + + + + 微软雅黑 + 10 + + + + send + + + + + + 460 + 430 + 80 + 30 + + + + + 微软雅黑 + 10 + + + + send + + + + + + 230 + 430 + 200 + 30 + + + + true + + + + + + 690 + 380 + 100 + 30 + + + + + + + 610 + 330 + 60 + 30 + + + + + 微软雅黑 + 10 + + + + 时间源 + + + + + + 1050 + 430 + 80 + 30 + + + + + 微软雅黑 + 10 + + + + send + + + + + + 690 + 430 + 100 + 30 + + + + + + + 820 + 380 + 200 + 30 + + + + true + + + + + + 100 + 430 + 100 + 30 + + + + + + + 230 + 500 + 200 + 30 + + + + true + + + + + + 20 + 430 + 60 + 30 + + + + + 微软雅黑 + 10 + + + + AC码幅度 + + + + + + 100 + 380 + 100 + 30 + + + + + + + 100 + 330 + 100 + 30 + + + + + + + 820 + 330 + 200 + 30 + + + + true + + + + + + 610 + 430 + 80 + 30 + + + + + 微软雅黑 + 10 + + + + 输入延迟补偿 + + + + + + 690 + 330 + 100 + 30 + + + + + + + 20 + 380 + 80 + 30 + + + + + 微软雅黑 + 10 + + + + AC码调制比 + + + + + + 460 + 330 + 80 + 30 + + + + + 微软雅黑 + 10 + + + + send + + + + + + 230 + 380 + 200 + 30 + + + + true diff --git a/DeviceHub/common/common.pri b/DeviceHub/common/common.pri index 6ac9b59..feeba36 100644 --- a/DeviceHub/common/common.pri +++ b/DeviceHub/common/common.pri @@ -1,22 +1,20 @@ -SOURCES += $$PWD/utils/SettingConfig.cpp \ - $$PWD/utils/QKafkaProducer.cpp +SOURCES += $$PWD/utils/SettingConfig.cpp SOURCES += $$PWD/utils/QByteUtil.cpp SOURCES += $$PWD/utils/QSerialPortUtil.cpp SOURCES += $$PWD/utils/QLogUtil.cpp -SOURCES += -SOURCES += $$PWD/utils/QKafkaConsumer.cpp +#SOURCES += $$PWD/utils/QKafkaConsumer.cpp +#SOURCES += $$PWD/utils/QKafkaProducer.cpp SOURCES += $$PWD/utils/HttpRequestUtil.cpp SOURCES += $$PWD/utils/MD5.cpp SOURCES += $$PWD/HttpRequestController.cpp -HEADERS += $$PWD/utils/SettingConfig.h \ - $$PWD/utils/QKafkaProducer.h +HEADERS += $$PWD/utils/SettingConfig.h HEADERS += $$PWD/utils/QByteUtil.h HEADERS += $$PWD/utils/QSerialPortUtil.h HEADERS += $$PWD/utils/QLogUtil.h -HEADERS += -HEADERS += $$PWD/utils/QKafkaConsumer.h +#HEADERS += $$PWD/utils/QKafkaConsumer.h +#HEADERS += $$PWD/utils/QKafkaProducer.h HEADERS += $$PWD/utils/HttpRequestUtil.h HEADERS += $$PWD/utils/DefHead.h HEADERS += $$PWD/utils/MD5.h diff --git a/DeviceHub/common/utils/QKafkaConsumer.h b/DeviceHub/common/utils/QKafkaConsumer.h index 5d40f37..49c9f01 100644 --- a/DeviceHub/common/utils/QKafkaConsumer.h +++ b/DeviceHub/common/utils/QKafkaConsumer.h @@ -1,10 +1,10 @@ -#ifndef QKAFKACONSUMER_H +#ifndef QKAFKACONSUMER_H #define QKAFKACONSUMER_H #include #include -#include "include/librdkafka/rdkafkacpp.h" +//#include "include/librdkafka/rdkafkacpp.h" class QKafkaConsumer : public QThread { diff --git a/DeviceHub/common/utils/QKafkaProducer.h b/DeviceHub/common/utils/QKafkaProducer.h index bd0cc15..d560bb1 100644 --- a/DeviceHub/common/utils/QKafkaProducer.h +++ b/DeviceHub/common/utils/QKafkaProducer.h @@ -3,7 +3,7 @@ #include -#include "include/librdkafka/rdkafkacpp.h" +//#include "include/librdkafka/rdkafkacpp.h" class QKafkaProducer : public QObject { diff --git a/DeviceHub/device/DeviceBase.h b/DeviceHub/device/DeviceBase.h index 8a3b271..e06bee3 100644 --- a/DeviceHub/device/DeviceBase.h +++ b/DeviceHub/device/DeviceBase.h @@ -3,7 +3,7 @@ #include #include "common/utils/QSerialPortUtil.h" -#include "common/utils/QKafkaProducer.h" +//#include "common/utils/QKafkaProducer.h" #include "common/utils/QByteUtil.h" #include "common/utils/QLogUtil.h" #include "common/utils/SettingConfig.h" @@ -43,7 +43,7 @@ QString devType; QSerialPortUtil serialUtil; - QKafkaProducer kafkaProducer; +// QKafkaProducer kafkaProducer; QByteArray dataBuff; }; diff --git a/DeviceHub/device/FreqSwitcher.cpp b/DeviceHub/device/FreqSwitcher.cpp index 96ce66a..5851f26 100644 --- a/DeviceHub/device/FreqSwitcher.cpp +++ b/DeviceHub/device/FreqSwitcher.cpp @@ -14,12 +14,12 @@ connect(this, &FreqSwitcher::sendCommandToDisplay, ((DeviceHubWindow *)this->parent())->freqSwitForm, &FreqSwitcherForm::displayDeviceCommandOnForm); - connect(((DeviceHubWindow *)this->parent())->kafkaConsumer, &QKafkaConsumer::messageRecieved, - this, &FreqSwitcher::commandReceivedHandler); +// connect(((DeviceHubWindow *)this->parent())->kafkaConsumer, &QKafkaConsumer::messageRecieved, +// this, &FreqSwitcher::commandReceivedHandler); - kafkaProducer.setBrokers(SettingConfig::getInstance().KAFKA_BROKERS); - kafkaProducer.setTopic(SettingConfig::getInstance().KAFKA_DATA_TOPIC); - kafkaProducer.createProducer(); +// kafkaProducer.setBrokers(SettingConfig::getInstance().KAFKA_BROKERS); +// kafkaProducer.setTopic(SettingConfig::getInstance().KAFKA_DATA_TOPIC); +// kafkaProducer.createProducer(); this->protocol = DeviceProtocolBase::deviceProtocolFactory(devType); } @@ -112,7 +112,7 @@ QJsonObject jsonObj = frameDto->toJSON(); jsonObj.insert("clientId", SettingConfig::getInstance().CLIENT_ID); jsonObj.insert("deviceId", deviceId); - kafkaProducer.produceMessage(QString(QJsonDocument(jsonObj).toJson(QJsonDocument::Compact))); +// kafkaProducer.produceMessage(QString(QJsonDocument(jsonObj).toJson(QJsonDocument::Compact))); } // 4. 在界面上简单显示相差数据结果 @@ -167,7 +167,7 @@ cmdcb.insert("commandId", command.value("commandId").toString()); cmdcb.insert("rawCommand", QString::fromUtf8(commandBytes)); cmdcb.insert("status", "1"); - this->kafkaProducer.produceMessage(SettingConfig::getInstance().KAFKA_CMDCB_TOPIC, QString(QJsonDocument(cmdcb).toJson(QJsonDocument::Compact))); +// this->kafkaProducer.produceMessage(SettingConfig::getInstance().KAFKA_CMDCB_TOPIC, QString(QJsonDocument(cmdcb).toJson(QJsonDocument::Compact))); // display on page emit sendCommandToDisplay(command); diff --git a/DeviceHub/device/FrequencyTuning.cpp b/DeviceHub/device/FrequencyTuning.cpp index e2038c2..07780d9 100644 --- a/DeviceHub/device/FrequencyTuning.cpp +++ b/DeviceHub/device/FrequencyTuning.cpp @@ -14,12 +14,12 @@ connect(this, &FrequencyTuning::sendCommandToDisplay, ((DeviceHubWindow *)this->parent())->freqTunForm, &FrequencyTuningForm::displayDeviceCommandOnForm); - connect(((DeviceHubWindow *)this->parent())->kafkaConsumer, &QKafkaConsumer::messageRecieved, - this, &FrequencyTuning::commandReceivedHandler); +// connect(((DeviceHubWindow *)this->parent())->kafkaConsumer, &QKafkaConsumer::messageRecieved, +// this, &FrequencyTuning::commandReceivedHandler); - kafkaProducer.setBrokers(SettingConfig::getInstance().KAFKA_BROKERS); - kafkaProducer.setTopic(SettingConfig::getInstance().KAFKA_DATA_TOPIC); - kafkaProducer.createProducer(); +// kafkaProducer.setBrokers(SettingConfig::getInstance().KAFKA_BROKERS); +// kafkaProducer.setTopic(SettingConfig::getInstance().KAFKA_DATA_TOPIC); +// kafkaProducer.createProducer(); this->protocol = DeviceProtocolBase::deviceProtocolFactory(devType); } @@ -111,7 +111,7 @@ QJsonObject jsonObj = frameDto->toJSON(); jsonObj.insert("clientId", SettingConfig::getInstance().CLIENT_ID); jsonObj.insert("deviceId", deviceId); - kafkaProducer.produceMessage(QString(QJsonDocument(jsonObj).toJson(QJsonDocument::Compact))); +// kafkaProducer.produceMessage(QString(QJsonDocument(jsonObj).toJson(QJsonDocument::Compact))); } // 4. 在界面上简单显示相差数据结果 @@ -166,7 +166,7 @@ cmdcb.insert("commandId", command.value("commandId").toString()); cmdcb.insert("rawCommand", QString::fromUtf8(commandBytes)); cmdcb.insert("status", "1"); - this->kafkaProducer.produceMessage(SettingConfig::getInstance().KAFKA_CMDCB_TOPIC, QString(QJsonDocument(cmdcb).toJson(QJsonDocument::Compact))); +// this->kafkaProducer.produceMessage(SettingConfig::getInstance().KAFKA_CMDCB_TOPIC, QString(QJsonDocument(cmdcb).toJson(QJsonDocument::Compact))); // display on page emit sendCommandToDisplay(command); diff --git a/DeviceHub/DeviceHubWindow.cpp b/DeviceHub/DeviceHubWindow.cpp index e02df0f..d2786ce 100644 --- a/DeviceHub/DeviceHubWindow.cpp +++ b/DeviceHub/DeviceHubWindow.cpp @@ -1,4 +1,4 @@ -#include "DeviceHubWindow.h" +#include "DeviceHubWindow.h" #include "ui_DeviceHubWindow.h" #include @@ -42,11 +42,11 @@ ui->stackedWidget->addWidget(freqSwitForm); // kafka consumer - kafkaConsumer = new QKafkaConsumer(this); - kafkaConsumer->setBrokers(SettingConfig::getInstance().KAFKA_BROKERS); - kafkaConsumer->setTopic(SettingConfig::getInstance().KAFKA_CMD_TOPIC); - kafkaConsumer->createConsumer(); - kafkaConsumer->start(); +// kafkaConsumer = new QKafkaConsumer(this); +// kafkaConsumer->setBrokers(SettingConfig::getInstance().KAFKA_BROKERS); +// kafkaConsumer->setTopic(SettingConfig::getInstance().KAFKA_CMD_TOPIC); +// kafkaConsumer->createConsumer(); +// kafkaConsumer->start(); // init device type and device list httpReq = new HttpRequestController(this); diff --git a/DeviceHub/DeviceHubWindow.h b/DeviceHub/DeviceHubWindow.h index 94bf742..ad91f95 100644 --- a/DeviceHub/DeviceHubWindow.h +++ b/DeviceHub/DeviceHubWindow.h @@ -1,11 +1,11 @@ -#ifndef DEVICEHUBWINDOW_H +#ifndef DEVICEHUBWINDOW_H #define DEVICEHUBWINDOW_H #include #include #include "common/HttpRequestController.h" -#include "common/utils/QKafkaConsumer.h" +//#include "common/utils/QKafkaConsumer.h" #include "device/DeviceBase.h" #include "FrequencyTuningForm.h" #include "SignalGeneratorForm.h" @@ -28,7 +28,7 @@ int currentDevIndex; QMap> allTypeDevList; - QKafkaConsumer * kafkaConsumer; +// QKafkaConsumer * kafkaConsumer; QComboBox * getDevTypeSelect(); QComboBox * getDevSelect(); diff --git a/DeviceHub/TimeSwitcherForm.cpp b/DeviceHub/TimeSwitcherForm.cpp index a7d4b2f..82fe96d 100644 --- a/DeviceHub/TimeSwitcherForm.cpp +++ b/DeviceHub/TimeSwitcherForm.cpp @@ -1,4 +1,4 @@ -#include "TimeSwitcherForm.h" +#include "TimeSwitcherForm.h" #include "ui_TimeSwitcherForm.h" #include "DeviceHubWindow.h" @@ -28,11 +28,38 @@ if (frameData->frameType == "0501") { TimeSwitcherStatusDto * statusFrameDto = (TimeSwitcherStatusDto *) frameData; + ui->tsDevStatus->setText(statusFrameDto->devStatus == "1" ? "正常" : "异常"); + ui->tsRefSelectType->setText(statusFrameDto->refSelectType == "1" ? "手动" : "自动"); + ui->tsRefTmSrc->setText(QString("时间源%1").arg(statusFrameDto->refTmSrc)); + ui->tsOppsPhaseAccOut->setText(QString("%1 ps").arg(statusFrameDto->oppsPhaseAccOut)); + ui->tsBacRatio->setText(QString("%1").arg(statusFrameDto->bacRatio)); + ui->tsBacRange->setText(QString("%1 V").arg(statusFrameDto->bacRange)); + + QJsonObject dataObj = statusFrameDto->toJSON().find("data")->toObject(); + QJsonDocument doc; + + doc.setArray(dataObj.find("tmSrcStatusStrArray")->toArray()); + ui->tsTmSrcStatus->setText(QString::fromUtf8(doc.toJson(QJsonDocument::Compact).constData())); + + doc.setArray(dataObj.find("bacOutStatusArray")->toArray()); + ui->tsBacOutStatus->setText(QString::fromUtf8(doc.toJson(QJsonDocument::Compact).constData())); + + doc.setArray(dataObj.find("bdcOutStatusArray")->toArray()); + ui->tsBdcOutStatus->setText(QString::fromUtf8(doc.toJson(QJsonDocument::Compact).constData())); + + doc.setArray(dataObj.find("delayCompensArray")->toArray()); + ui->tsDelayComp->setText(QString::fromUtf8(doc.toJson(QJsonDocument::Compact).constData())); + + doc.setArray(dataObj.find("oppsOutStatusArray")->toArray()); + ui->tsOppsOutStatus->setText(QString::fromUtf8(doc.toJson(QJsonDocument::Compact).constData())); + + doc.setArray(dataObj.find("localTmDiffArray")->toArray()); + ui->tsLocalTmDiff->setText(QString::fromUtf8(doc.toJson(QJsonDocument::Compact).constData())); } else if (frameData->frameType == "0502") { TimeSwitcherInterfaceDto * interFrameDto = (TimeSwitcherInterfaceDto *) frameData; - + ui->tsCtrlStatus->setText(interFrameDto->ctrlStatus == "1" ? "程控" : "本控"); } } @@ -58,24 +85,31 @@ QString commandType = command.value("command").toString(); if (commandType == "GLF,01") { - + ui->tsRefSelectTypeSet->setText(command.value("params").toString()); + ui->tsRefSelectTypeSetRaw->setText(command.value("rawCommand").toString()); } else if (commandType == "GLF,02") { - + ui->tsBacRatioSet->setText(command.value("params").toString()); + ui->tsBacRatioSetRaw->setText(command.value("rawCommand").toString()); } else if (commandType == "GLF,03") { - + ui->tsBacRangeSet->setText(command.value("params").toString()); + ui->tsBacRangeSetRaw->setText(command.value("rawCommand").toString()); } else if (commandType == "GLF,04") { - + ui->tsTmSrcSet->setText(command.value("params").toString()); + ui->tsTmSrcSetRaw->setText(command.value("rawCommand").toString()); } else if (commandType == "GLF,05") { - + ui->tsOppsPhaseSet->setText(command.value("params").toString()); + ui->tsOppsPhaseSetRaw->setText(command.value("rawCommand").toString()); } else if (commandType == "GLF,06") { - + ui->tsDelayCompSet->setText(command.value("params").toString()); + ui->tsDelayCompSetRaw->setText(command.value("rawCommand").toString()); } else if (commandType == "GLC,01") { - + ui->tsControlSet->setText(command.value("params").toString()); + ui->tsControlSetRaw->setText(command.value("rawCommand").toString()); } } diff --git a/DeviceHub/TimeSwitcherForm.ui b/DeviceHub/TimeSwitcherForm.ui index 2a428fc..71477c4 100644 --- a/DeviceHub/TimeSwitcherForm.ui +++ b/DeviceHub/TimeSwitcherForm.ui @@ -6,7 +6,7 @@ 0 0 - 1200 + 1300 600 @@ -49,7 +49,7 @@ 20 - 230 + 290 100 30 @@ -93,10 +93,10 @@ - + - 380 + 410 120 50 30 @@ -108,6 +108,228 @@ 170 120 + 100 + 30 + + + + + 微软雅黑 + 10 + + + + 选择参考源模式 + + + + + + 270 + 120 + 50 + 30 + + + + + + + 340 + 120 + 70 + 30 + + + + + 微软雅黑 + 10 + + + + 当前时间源 + + + + + + 480 + 120 + 70 + 30 + + + + + 微软雅黑 + 10 + + + + 时间源状态 + + + + + + 550 + 120 + 300 + 30 + + + + + + + 20 + 170 + 70 + 30 + + + + + 微软雅黑 + 10 + + + + 时间源秒差 + + + + + + 90 + 170 + 300 + 30 + + + + + + + 870 + 120 + 100 + 30 + + + + + 微软雅黑 + 10 + + + + 相位调节累计值 + + + + + + 970 + 120 + 50 + 30 + + + + + + + 420 + 170 + 90 + 30 + + + + + 微软雅黑 + 10 + + + + B-AC码调制比 + + + + + + 510 + 170 + 50 + 30 + + + + + + + 580 + 170 + 80 + 30 + + + + + 微软雅黑 + 10 + + + + B-AC码幅度 + + + + + + 660 + 170 + 50 + 30 + + + + + + + 740 + 170 + 70 + 30 + + + + + 微软雅黑 + 10 + + + + 输入补偿值 + + + + + + 810 + 170 + 300 + 30 + + + + + + + 1050 + 120 60 30 @@ -119,24 +341,156 @@ - 闰秒标志 + 控制状态 - + - 230 + 1110 120 50 30 - + - 300 - 120 + 20 + 230 + 90 + 30 + + + + + 微软雅黑 + 10 + + + + 1PPS输出状态 + + + + + + 110 + 230 + 200 + 30 + + + + + + + 330 + 230 + 90 + 30 + + + + + 微软雅黑 + 10 + + + + B-DC输出状态 + + + + + + 420 + 230 + 200 + 30 + + + + + + + 730 + 230 + 200 + 30 + + + + + + + + + + 640 + 230 + 90 + 30 + + + + + 微软雅黑 + 10 + + + + B-AC输出状态 + + + + + + 100 + 500 + 100 + 30 + + + + + + + 820 + 430 + 200 + 30 + + + + true + + + + + + 20 + 500 + 60 + 30 + + + + + 微软雅黑 + 10 + + + + 控制状态 + + + + + + 610 + 380 80 30 @@ -148,7 +502,373 @@ - 频率信号状态 + 相位调节 + + + + + + 460 + 500 + 80 + 30 + + + + + 微软雅黑 + 10 + + + + send + + + + + + 460 + 380 + 80 + 30 + + + + + 微软雅黑 + 10 + + + + send + + + + + + 20 + 330 + 80 + 30 + + + + + 微软雅黑 + 10 + + + + 参考源选择 + + + + + + 1050 + 330 + 80 + 30 + + + + + 微软雅黑 + 10 + + + + send + + + + + + 230 + 330 + 200 + 30 + + + + true + + + + + + 1050 + 380 + 80 + 30 + + + + + 微软雅黑 + 10 + + + + send + + + + + + 460 + 430 + 80 + 30 + + + + + 微软雅黑 + 10 + + + + send + + + + + + 230 + 430 + 200 + 30 + + + + true + + + + + + 690 + 380 + 100 + 30 + + + + + + + 610 + 330 + 60 + 30 + + + + + 微软雅黑 + 10 + + + + 时间源 + + + + + + 1050 + 430 + 80 + 30 + + + + + 微软雅黑 + 10 + + + + send + + + + + + 690 + 430 + 100 + 30 + + + + + + + 820 + 380 + 200 + 30 + + + + true + + + + + + 100 + 430 + 100 + 30 + + + + + + + 230 + 500 + 200 + 30 + + + + true + + + + + + 20 + 430 + 60 + 30 + + + + + 微软雅黑 + 10 + + + + AC码幅度 + + + + + + 100 + 380 + 100 + 30 + + + + + + + 100 + 330 + 100 + 30 + + + + + + + 820 + 330 + 200 + 30 + + + + true + + + + + + 610 + 430 + 80 + 30 + + + + + 微软雅黑 + 10 + + + + 输入延迟补偿 + + + + + + 690 + 330 + 100 + 30 + + + + + + + 20 + 380 + 80 + 30 + + + + + 微软雅黑 + 10 + + + + AC码调制比 + + + + + + 460 + 330 + 80 + 30 + + + + + 微软雅黑 + 10 + + + + send + + + + + + 230 + 380 + 200 + 30 + + + + true diff --git a/DeviceHub/common/common.pri b/DeviceHub/common/common.pri index 6ac9b59..feeba36 100644 --- a/DeviceHub/common/common.pri +++ b/DeviceHub/common/common.pri @@ -1,22 +1,20 @@ -SOURCES += $$PWD/utils/SettingConfig.cpp \ - $$PWD/utils/QKafkaProducer.cpp +SOURCES += $$PWD/utils/SettingConfig.cpp SOURCES += $$PWD/utils/QByteUtil.cpp SOURCES += $$PWD/utils/QSerialPortUtil.cpp SOURCES += $$PWD/utils/QLogUtil.cpp -SOURCES += -SOURCES += $$PWD/utils/QKafkaConsumer.cpp +#SOURCES += $$PWD/utils/QKafkaConsumer.cpp +#SOURCES += $$PWD/utils/QKafkaProducer.cpp SOURCES += $$PWD/utils/HttpRequestUtil.cpp SOURCES += $$PWD/utils/MD5.cpp SOURCES += $$PWD/HttpRequestController.cpp -HEADERS += $$PWD/utils/SettingConfig.h \ - $$PWD/utils/QKafkaProducer.h +HEADERS += $$PWD/utils/SettingConfig.h HEADERS += $$PWD/utils/QByteUtil.h HEADERS += $$PWD/utils/QSerialPortUtil.h HEADERS += $$PWD/utils/QLogUtil.h -HEADERS += -HEADERS += $$PWD/utils/QKafkaConsumer.h +#HEADERS += $$PWD/utils/QKafkaConsumer.h +#HEADERS += $$PWD/utils/QKafkaProducer.h HEADERS += $$PWD/utils/HttpRequestUtil.h HEADERS += $$PWD/utils/DefHead.h HEADERS += $$PWD/utils/MD5.h diff --git a/DeviceHub/common/utils/QKafkaConsumer.h b/DeviceHub/common/utils/QKafkaConsumer.h index 5d40f37..49c9f01 100644 --- a/DeviceHub/common/utils/QKafkaConsumer.h +++ b/DeviceHub/common/utils/QKafkaConsumer.h @@ -1,10 +1,10 @@ -#ifndef QKAFKACONSUMER_H +#ifndef QKAFKACONSUMER_H #define QKAFKACONSUMER_H #include #include -#include "include/librdkafka/rdkafkacpp.h" +//#include "include/librdkafka/rdkafkacpp.h" class QKafkaConsumer : public QThread { diff --git a/DeviceHub/common/utils/QKafkaProducer.h b/DeviceHub/common/utils/QKafkaProducer.h index bd0cc15..d560bb1 100644 --- a/DeviceHub/common/utils/QKafkaProducer.h +++ b/DeviceHub/common/utils/QKafkaProducer.h @@ -3,7 +3,7 @@ #include -#include "include/librdkafka/rdkafkacpp.h" +//#include "include/librdkafka/rdkafkacpp.h" class QKafkaProducer : public QObject { diff --git a/DeviceHub/device/DeviceBase.h b/DeviceHub/device/DeviceBase.h index 8a3b271..e06bee3 100644 --- a/DeviceHub/device/DeviceBase.h +++ b/DeviceHub/device/DeviceBase.h @@ -3,7 +3,7 @@ #include #include "common/utils/QSerialPortUtil.h" -#include "common/utils/QKafkaProducer.h" +//#include "common/utils/QKafkaProducer.h" #include "common/utils/QByteUtil.h" #include "common/utils/QLogUtil.h" #include "common/utils/SettingConfig.h" @@ -43,7 +43,7 @@ QString devType; QSerialPortUtil serialUtil; - QKafkaProducer kafkaProducer; +// QKafkaProducer kafkaProducer; QByteArray dataBuff; }; diff --git a/DeviceHub/device/FreqSwitcher.cpp b/DeviceHub/device/FreqSwitcher.cpp index 96ce66a..5851f26 100644 --- a/DeviceHub/device/FreqSwitcher.cpp +++ b/DeviceHub/device/FreqSwitcher.cpp @@ -14,12 +14,12 @@ connect(this, &FreqSwitcher::sendCommandToDisplay, ((DeviceHubWindow *)this->parent())->freqSwitForm, &FreqSwitcherForm::displayDeviceCommandOnForm); - connect(((DeviceHubWindow *)this->parent())->kafkaConsumer, &QKafkaConsumer::messageRecieved, - this, &FreqSwitcher::commandReceivedHandler); +// connect(((DeviceHubWindow *)this->parent())->kafkaConsumer, &QKafkaConsumer::messageRecieved, +// this, &FreqSwitcher::commandReceivedHandler); - kafkaProducer.setBrokers(SettingConfig::getInstance().KAFKA_BROKERS); - kafkaProducer.setTopic(SettingConfig::getInstance().KAFKA_DATA_TOPIC); - kafkaProducer.createProducer(); +// kafkaProducer.setBrokers(SettingConfig::getInstance().KAFKA_BROKERS); +// kafkaProducer.setTopic(SettingConfig::getInstance().KAFKA_DATA_TOPIC); +// kafkaProducer.createProducer(); this->protocol = DeviceProtocolBase::deviceProtocolFactory(devType); } @@ -112,7 +112,7 @@ QJsonObject jsonObj = frameDto->toJSON(); jsonObj.insert("clientId", SettingConfig::getInstance().CLIENT_ID); jsonObj.insert("deviceId", deviceId); - kafkaProducer.produceMessage(QString(QJsonDocument(jsonObj).toJson(QJsonDocument::Compact))); +// kafkaProducer.produceMessage(QString(QJsonDocument(jsonObj).toJson(QJsonDocument::Compact))); } // 4. 在界面上简单显示相差数据结果 @@ -167,7 +167,7 @@ cmdcb.insert("commandId", command.value("commandId").toString()); cmdcb.insert("rawCommand", QString::fromUtf8(commandBytes)); cmdcb.insert("status", "1"); - this->kafkaProducer.produceMessage(SettingConfig::getInstance().KAFKA_CMDCB_TOPIC, QString(QJsonDocument(cmdcb).toJson(QJsonDocument::Compact))); +// this->kafkaProducer.produceMessage(SettingConfig::getInstance().KAFKA_CMDCB_TOPIC, QString(QJsonDocument(cmdcb).toJson(QJsonDocument::Compact))); // display on page emit sendCommandToDisplay(command); diff --git a/DeviceHub/device/FrequencyTuning.cpp b/DeviceHub/device/FrequencyTuning.cpp index e2038c2..07780d9 100644 --- a/DeviceHub/device/FrequencyTuning.cpp +++ b/DeviceHub/device/FrequencyTuning.cpp @@ -14,12 +14,12 @@ connect(this, &FrequencyTuning::sendCommandToDisplay, ((DeviceHubWindow *)this->parent())->freqTunForm, &FrequencyTuningForm::displayDeviceCommandOnForm); - connect(((DeviceHubWindow *)this->parent())->kafkaConsumer, &QKafkaConsumer::messageRecieved, - this, &FrequencyTuning::commandReceivedHandler); +// connect(((DeviceHubWindow *)this->parent())->kafkaConsumer, &QKafkaConsumer::messageRecieved, +// this, &FrequencyTuning::commandReceivedHandler); - kafkaProducer.setBrokers(SettingConfig::getInstance().KAFKA_BROKERS); - kafkaProducer.setTopic(SettingConfig::getInstance().KAFKA_DATA_TOPIC); - kafkaProducer.createProducer(); +// kafkaProducer.setBrokers(SettingConfig::getInstance().KAFKA_BROKERS); +// kafkaProducer.setTopic(SettingConfig::getInstance().KAFKA_DATA_TOPIC); +// kafkaProducer.createProducer(); this->protocol = DeviceProtocolBase::deviceProtocolFactory(devType); } @@ -111,7 +111,7 @@ QJsonObject jsonObj = frameDto->toJSON(); jsonObj.insert("clientId", SettingConfig::getInstance().CLIENT_ID); jsonObj.insert("deviceId", deviceId); - kafkaProducer.produceMessage(QString(QJsonDocument(jsonObj).toJson(QJsonDocument::Compact))); +// kafkaProducer.produceMessage(QString(QJsonDocument(jsonObj).toJson(QJsonDocument::Compact))); } // 4. 在界面上简单显示相差数据结果 @@ -166,7 +166,7 @@ cmdcb.insert("commandId", command.value("commandId").toString()); cmdcb.insert("rawCommand", QString::fromUtf8(commandBytes)); cmdcb.insert("status", "1"); - this->kafkaProducer.produceMessage(SettingConfig::getInstance().KAFKA_CMDCB_TOPIC, QString(QJsonDocument(cmdcb).toJson(QJsonDocument::Compact))); +// this->kafkaProducer.produceMessage(SettingConfig::getInstance().KAFKA_CMDCB_TOPIC, QString(QJsonDocument(cmdcb).toJson(QJsonDocument::Compact))); // display on page emit sendCommandToDisplay(command); diff --git a/DeviceHub/device/SignalGenerator.cpp b/DeviceHub/device/SignalGenerator.cpp index e99ddc1..e2e5733 100644 --- a/DeviceHub/device/SignalGenerator.cpp +++ b/DeviceHub/device/SignalGenerator.cpp @@ -14,12 +14,12 @@ connect(this, &SignalGenerator::sendCommandToDisplay, ((DeviceHubWindow *)this->parent())->signGenForm, &SignalGeneratorForm::displayDeviceCommandOnForm); - connect(((DeviceHubWindow *)this->parent())->kafkaConsumer, &QKafkaConsumer::messageRecieved, - this, &SignalGenerator::commandReceivedHandler); +// connect(((DeviceHubWindow *)this->parent())->kafkaConsumer, &QKafkaConsumer::messageRecieved, +// this, &SignalGenerator::commandReceivedHandler); - kafkaProducer.setBrokers(SettingConfig::getInstance().KAFKA_BROKERS); - kafkaProducer.setTopic(SettingConfig::getInstance().KAFKA_DATA_TOPIC); - kafkaProducer.createProducer(); +// kafkaProducer.setBrokers(SettingConfig::getInstance().KAFKA_BROKERS); +// kafkaProducer.setTopic(SettingConfig::getInstance().KAFKA_DATA_TOPIC); +// kafkaProducer.createProducer(); this->protocol = DeviceProtocolBase::deviceProtocolFactory(devType); } @@ -114,7 +114,7 @@ QJsonObject jsonObj = frameDto->toJSON(); jsonObj.insert("clientId", SettingConfig::getInstance().CLIENT_ID); jsonObj.insert("deviceId", deviceId); - kafkaProducer.produceMessage(QString(QJsonDocument(jsonObj).toJson(QJsonDocument::Compact))); +// kafkaProducer.produceMessage(QString(QJsonDocument(jsonObj).toJson(QJsonDocument::Compact))); } // 4. 在界面上简单显示相差数据结果 @@ -169,7 +169,7 @@ cmdcb.insert("commandId", command.value("commandId").toString()); cmdcb.insert("rawCommand", QString::fromUtf8(commandBytes)); cmdcb.insert("status", "1"); - this->kafkaProducer.produceMessage(SettingConfig::getInstance().KAFKA_CMDCB_TOPIC, QString(QJsonDocument(cmdcb).toJson(QJsonDocument::Compact))); +// this->kafkaProducer.produceMessage(SettingConfig::getInstance().KAFKA_CMDCB_TOPIC, QString(QJsonDocument(cmdcb).toJson(QJsonDocument::Compact))); // display on page emit sendCommandToDisplay(command); diff --git a/DeviceHub/DeviceHubWindow.cpp b/DeviceHub/DeviceHubWindow.cpp index e02df0f..d2786ce 100644 --- a/DeviceHub/DeviceHubWindow.cpp +++ b/DeviceHub/DeviceHubWindow.cpp @@ -1,4 +1,4 @@ -#include "DeviceHubWindow.h" +#include "DeviceHubWindow.h" #include "ui_DeviceHubWindow.h" #include @@ -42,11 +42,11 @@ ui->stackedWidget->addWidget(freqSwitForm); // kafka consumer - kafkaConsumer = new QKafkaConsumer(this); - kafkaConsumer->setBrokers(SettingConfig::getInstance().KAFKA_BROKERS); - kafkaConsumer->setTopic(SettingConfig::getInstance().KAFKA_CMD_TOPIC); - kafkaConsumer->createConsumer(); - kafkaConsumer->start(); +// kafkaConsumer = new QKafkaConsumer(this); +// kafkaConsumer->setBrokers(SettingConfig::getInstance().KAFKA_BROKERS); +// kafkaConsumer->setTopic(SettingConfig::getInstance().KAFKA_CMD_TOPIC); +// kafkaConsumer->createConsumer(); +// kafkaConsumer->start(); // init device type and device list httpReq = new HttpRequestController(this); diff --git a/DeviceHub/DeviceHubWindow.h b/DeviceHub/DeviceHubWindow.h index 94bf742..ad91f95 100644 --- a/DeviceHub/DeviceHubWindow.h +++ b/DeviceHub/DeviceHubWindow.h @@ -1,11 +1,11 @@ -#ifndef DEVICEHUBWINDOW_H +#ifndef DEVICEHUBWINDOW_H #define DEVICEHUBWINDOW_H #include #include #include "common/HttpRequestController.h" -#include "common/utils/QKafkaConsumer.h" +//#include "common/utils/QKafkaConsumer.h" #include "device/DeviceBase.h" #include "FrequencyTuningForm.h" #include "SignalGeneratorForm.h" @@ -28,7 +28,7 @@ int currentDevIndex; QMap> allTypeDevList; - QKafkaConsumer * kafkaConsumer; +// QKafkaConsumer * kafkaConsumer; QComboBox * getDevTypeSelect(); QComboBox * getDevSelect(); diff --git a/DeviceHub/TimeSwitcherForm.cpp b/DeviceHub/TimeSwitcherForm.cpp index a7d4b2f..82fe96d 100644 --- a/DeviceHub/TimeSwitcherForm.cpp +++ b/DeviceHub/TimeSwitcherForm.cpp @@ -1,4 +1,4 @@ -#include "TimeSwitcherForm.h" +#include "TimeSwitcherForm.h" #include "ui_TimeSwitcherForm.h" #include "DeviceHubWindow.h" @@ -28,11 +28,38 @@ if (frameData->frameType == "0501") { TimeSwitcherStatusDto * statusFrameDto = (TimeSwitcherStatusDto *) frameData; + ui->tsDevStatus->setText(statusFrameDto->devStatus == "1" ? "正常" : "异常"); + ui->tsRefSelectType->setText(statusFrameDto->refSelectType == "1" ? "手动" : "自动"); + ui->tsRefTmSrc->setText(QString("时间源%1").arg(statusFrameDto->refTmSrc)); + ui->tsOppsPhaseAccOut->setText(QString("%1 ps").arg(statusFrameDto->oppsPhaseAccOut)); + ui->tsBacRatio->setText(QString("%1").arg(statusFrameDto->bacRatio)); + ui->tsBacRange->setText(QString("%1 V").arg(statusFrameDto->bacRange)); + + QJsonObject dataObj = statusFrameDto->toJSON().find("data")->toObject(); + QJsonDocument doc; + + doc.setArray(dataObj.find("tmSrcStatusStrArray")->toArray()); + ui->tsTmSrcStatus->setText(QString::fromUtf8(doc.toJson(QJsonDocument::Compact).constData())); + + doc.setArray(dataObj.find("bacOutStatusArray")->toArray()); + ui->tsBacOutStatus->setText(QString::fromUtf8(doc.toJson(QJsonDocument::Compact).constData())); + + doc.setArray(dataObj.find("bdcOutStatusArray")->toArray()); + ui->tsBdcOutStatus->setText(QString::fromUtf8(doc.toJson(QJsonDocument::Compact).constData())); + + doc.setArray(dataObj.find("delayCompensArray")->toArray()); + ui->tsDelayComp->setText(QString::fromUtf8(doc.toJson(QJsonDocument::Compact).constData())); + + doc.setArray(dataObj.find("oppsOutStatusArray")->toArray()); + ui->tsOppsOutStatus->setText(QString::fromUtf8(doc.toJson(QJsonDocument::Compact).constData())); + + doc.setArray(dataObj.find("localTmDiffArray")->toArray()); + ui->tsLocalTmDiff->setText(QString::fromUtf8(doc.toJson(QJsonDocument::Compact).constData())); } else if (frameData->frameType == "0502") { TimeSwitcherInterfaceDto * interFrameDto = (TimeSwitcherInterfaceDto *) frameData; - + ui->tsCtrlStatus->setText(interFrameDto->ctrlStatus == "1" ? "程控" : "本控"); } } @@ -58,24 +85,31 @@ QString commandType = command.value("command").toString(); if (commandType == "GLF,01") { - + ui->tsRefSelectTypeSet->setText(command.value("params").toString()); + ui->tsRefSelectTypeSetRaw->setText(command.value("rawCommand").toString()); } else if (commandType == "GLF,02") { - + ui->tsBacRatioSet->setText(command.value("params").toString()); + ui->tsBacRatioSetRaw->setText(command.value("rawCommand").toString()); } else if (commandType == "GLF,03") { - + ui->tsBacRangeSet->setText(command.value("params").toString()); + ui->tsBacRangeSetRaw->setText(command.value("rawCommand").toString()); } else if (commandType == "GLF,04") { - + ui->tsTmSrcSet->setText(command.value("params").toString()); + ui->tsTmSrcSetRaw->setText(command.value("rawCommand").toString()); } else if (commandType == "GLF,05") { - + ui->tsOppsPhaseSet->setText(command.value("params").toString()); + ui->tsOppsPhaseSetRaw->setText(command.value("rawCommand").toString()); } else if (commandType == "GLF,06") { - + ui->tsDelayCompSet->setText(command.value("params").toString()); + ui->tsDelayCompSetRaw->setText(command.value("rawCommand").toString()); } else if (commandType == "GLC,01") { - + ui->tsControlSet->setText(command.value("params").toString()); + ui->tsControlSetRaw->setText(command.value("rawCommand").toString()); } } diff --git a/DeviceHub/TimeSwitcherForm.ui b/DeviceHub/TimeSwitcherForm.ui index 2a428fc..71477c4 100644 --- a/DeviceHub/TimeSwitcherForm.ui +++ b/DeviceHub/TimeSwitcherForm.ui @@ -6,7 +6,7 @@ 0 0 - 1200 + 1300 600 @@ -49,7 +49,7 @@ 20 - 230 + 290 100 30 @@ -93,10 +93,10 @@ - + - 380 + 410 120 50 30 @@ -108,6 +108,228 @@ 170 120 + 100 + 30 + + + + + 微软雅黑 + 10 + + + + 选择参考源模式 + + + + + + 270 + 120 + 50 + 30 + + + + + + + 340 + 120 + 70 + 30 + + + + + 微软雅黑 + 10 + + + + 当前时间源 + + + + + + 480 + 120 + 70 + 30 + + + + + 微软雅黑 + 10 + + + + 时间源状态 + + + + + + 550 + 120 + 300 + 30 + + + + + + + 20 + 170 + 70 + 30 + + + + + 微软雅黑 + 10 + + + + 时间源秒差 + + + + + + 90 + 170 + 300 + 30 + + + + + + + 870 + 120 + 100 + 30 + + + + + 微软雅黑 + 10 + + + + 相位调节累计值 + + + + + + 970 + 120 + 50 + 30 + + + + + + + 420 + 170 + 90 + 30 + + + + + 微软雅黑 + 10 + + + + B-AC码调制比 + + + + + + 510 + 170 + 50 + 30 + + + + + + + 580 + 170 + 80 + 30 + + + + + 微软雅黑 + 10 + + + + B-AC码幅度 + + + + + + 660 + 170 + 50 + 30 + + + + + + + 740 + 170 + 70 + 30 + + + + + 微软雅黑 + 10 + + + + 输入补偿值 + + + + + + 810 + 170 + 300 + 30 + + + + + + + 1050 + 120 60 30 @@ -119,24 +341,156 @@ - 闰秒标志 + 控制状态 - + - 230 + 1110 120 50 30 - + - 300 - 120 + 20 + 230 + 90 + 30 + + + + + 微软雅黑 + 10 + + + + 1PPS输出状态 + + + + + + 110 + 230 + 200 + 30 + + + + + + + 330 + 230 + 90 + 30 + + + + + 微软雅黑 + 10 + + + + B-DC输出状态 + + + + + + 420 + 230 + 200 + 30 + + + + + + + 730 + 230 + 200 + 30 + + + + + + + + + + 640 + 230 + 90 + 30 + + + + + 微软雅黑 + 10 + + + + B-AC输出状态 + + + + + + 100 + 500 + 100 + 30 + + + + + + + 820 + 430 + 200 + 30 + + + + true + + + + + + 20 + 500 + 60 + 30 + + + + + 微软雅黑 + 10 + + + + 控制状态 + + + + + + 610 + 380 80 30 @@ -148,7 +502,373 @@ - 频率信号状态 + 相位调节 + + + + + + 460 + 500 + 80 + 30 + + + + + 微软雅黑 + 10 + + + + send + + + + + + 460 + 380 + 80 + 30 + + + + + 微软雅黑 + 10 + + + + send + + + + + + 20 + 330 + 80 + 30 + + + + + 微软雅黑 + 10 + + + + 参考源选择 + + + + + + 1050 + 330 + 80 + 30 + + + + + 微软雅黑 + 10 + + + + send + + + + + + 230 + 330 + 200 + 30 + + + + true + + + + + + 1050 + 380 + 80 + 30 + + + + + 微软雅黑 + 10 + + + + send + + + + + + 460 + 430 + 80 + 30 + + + + + 微软雅黑 + 10 + + + + send + + + + + + 230 + 430 + 200 + 30 + + + + true + + + + + + 690 + 380 + 100 + 30 + + + + + + + 610 + 330 + 60 + 30 + + + + + 微软雅黑 + 10 + + + + 时间源 + + + + + + 1050 + 430 + 80 + 30 + + + + + 微软雅黑 + 10 + + + + send + + + + + + 690 + 430 + 100 + 30 + + + + + + + 820 + 380 + 200 + 30 + + + + true + + + + + + 100 + 430 + 100 + 30 + + + + + + + 230 + 500 + 200 + 30 + + + + true + + + + + + 20 + 430 + 60 + 30 + + + + + 微软雅黑 + 10 + + + + AC码幅度 + + + + + + 100 + 380 + 100 + 30 + + + + + + + 100 + 330 + 100 + 30 + + + + + + + 820 + 330 + 200 + 30 + + + + true + + + + + + 610 + 430 + 80 + 30 + + + + + 微软雅黑 + 10 + + + + 输入延迟补偿 + + + + + + 690 + 330 + 100 + 30 + + + + + + + 20 + 380 + 80 + 30 + + + + + 微软雅黑 + 10 + + + + AC码调制比 + + + + + + 460 + 330 + 80 + 30 + + + + + 微软雅黑 + 10 + + + + send + + + + + + 230 + 380 + 200 + 30 + + + + true diff --git a/DeviceHub/common/common.pri b/DeviceHub/common/common.pri index 6ac9b59..feeba36 100644 --- a/DeviceHub/common/common.pri +++ b/DeviceHub/common/common.pri @@ -1,22 +1,20 @@ -SOURCES += $$PWD/utils/SettingConfig.cpp \ - $$PWD/utils/QKafkaProducer.cpp +SOURCES += $$PWD/utils/SettingConfig.cpp SOURCES += $$PWD/utils/QByteUtil.cpp SOURCES += $$PWD/utils/QSerialPortUtil.cpp SOURCES += $$PWD/utils/QLogUtil.cpp -SOURCES += -SOURCES += $$PWD/utils/QKafkaConsumer.cpp +#SOURCES += $$PWD/utils/QKafkaConsumer.cpp +#SOURCES += $$PWD/utils/QKafkaProducer.cpp SOURCES += $$PWD/utils/HttpRequestUtil.cpp SOURCES += $$PWD/utils/MD5.cpp SOURCES += $$PWD/HttpRequestController.cpp -HEADERS += $$PWD/utils/SettingConfig.h \ - $$PWD/utils/QKafkaProducer.h +HEADERS += $$PWD/utils/SettingConfig.h HEADERS += $$PWD/utils/QByteUtil.h HEADERS += $$PWD/utils/QSerialPortUtil.h HEADERS += $$PWD/utils/QLogUtil.h -HEADERS += -HEADERS += $$PWD/utils/QKafkaConsumer.h +#HEADERS += $$PWD/utils/QKafkaConsumer.h +#HEADERS += $$PWD/utils/QKafkaProducer.h HEADERS += $$PWD/utils/HttpRequestUtil.h HEADERS += $$PWD/utils/DefHead.h HEADERS += $$PWD/utils/MD5.h diff --git a/DeviceHub/common/utils/QKafkaConsumer.h b/DeviceHub/common/utils/QKafkaConsumer.h index 5d40f37..49c9f01 100644 --- a/DeviceHub/common/utils/QKafkaConsumer.h +++ b/DeviceHub/common/utils/QKafkaConsumer.h @@ -1,10 +1,10 @@ -#ifndef QKAFKACONSUMER_H +#ifndef QKAFKACONSUMER_H #define QKAFKACONSUMER_H #include #include -#include "include/librdkafka/rdkafkacpp.h" +//#include "include/librdkafka/rdkafkacpp.h" class QKafkaConsumer : public QThread { diff --git a/DeviceHub/common/utils/QKafkaProducer.h b/DeviceHub/common/utils/QKafkaProducer.h index bd0cc15..d560bb1 100644 --- a/DeviceHub/common/utils/QKafkaProducer.h +++ b/DeviceHub/common/utils/QKafkaProducer.h @@ -3,7 +3,7 @@ #include -#include "include/librdkafka/rdkafkacpp.h" +//#include "include/librdkafka/rdkafkacpp.h" class QKafkaProducer : public QObject { diff --git a/DeviceHub/device/DeviceBase.h b/DeviceHub/device/DeviceBase.h index 8a3b271..e06bee3 100644 --- a/DeviceHub/device/DeviceBase.h +++ b/DeviceHub/device/DeviceBase.h @@ -3,7 +3,7 @@ #include #include "common/utils/QSerialPortUtil.h" -#include "common/utils/QKafkaProducer.h" +//#include "common/utils/QKafkaProducer.h" #include "common/utils/QByteUtil.h" #include "common/utils/QLogUtil.h" #include "common/utils/SettingConfig.h" @@ -43,7 +43,7 @@ QString devType; QSerialPortUtil serialUtil; - QKafkaProducer kafkaProducer; +// QKafkaProducer kafkaProducer; QByteArray dataBuff; }; diff --git a/DeviceHub/device/FreqSwitcher.cpp b/DeviceHub/device/FreqSwitcher.cpp index 96ce66a..5851f26 100644 --- a/DeviceHub/device/FreqSwitcher.cpp +++ b/DeviceHub/device/FreqSwitcher.cpp @@ -14,12 +14,12 @@ connect(this, &FreqSwitcher::sendCommandToDisplay, ((DeviceHubWindow *)this->parent())->freqSwitForm, &FreqSwitcherForm::displayDeviceCommandOnForm); - connect(((DeviceHubWindow *)this->parent())->kafkaConsumer, &QKafkaConsumer::messageRecieved, - this, &FreqSwitcher::commandReceivedHandler); +// connect(((DeviceHubWindow *)this->parent())->kafkaConsumer, &QKafkaConsumer::messageRecieved, +// this, &FreqSwitcher::commandReceivedHandler); - kafkaProducer.setBrokers(SettingConfig::getInstance().KAFKA_BROKERS); - kafkaProducer.setTopic(SettingConfig::getInstance().KAFKA_DATA_TOPIC); - kafkaProducer.createProducer(); +// kafkaProducer.setBrokers(SettingConfig::getInstance().KAFKA_BROKERS); +// kafkaProducer.setTopic(SettingConfig::getInstance().KAFKA_DATA_TOPIC); +// kafkaProducer.createProducer(); this->protocol = DeviceProtocolBase::deviceProtocolFactory(devType); } @@ -112,7 +112,7 @@ QJsonObject jsonObj = frameDto->toJSON(); jsonObj.insert("clientId", SettingConfig::getInstance().CLIENT_ID); jsonObj.insert("deviceId", deviceId); - kafkaProducer.produceMessage(QString(QJsonDocument(jsonObj).toJson(QJsonDocument::Compact))); +// kafkaProducer.produceMessage(QString(QJsonDocument(jsonObj).toJson(QJsonDocument::Compact))); } // 4. 在界面上简单显示相差数据结果 @@ -167,7 +167,7 @@ cmdcb.insert("commandId", command.value("commandId").toString()); cmdcb.insert("rawCommand", QString::fromUtf8(commandBytes)); cmdcb.insert("status", "1"); - this->kafkaProducer.produceMessage(SettingConfig::getInstance().KAFKA_CMDCB_TOPIC, QString(QJsonDocument(cmdcb).toJson(QJsonDocument::Compact))); +// this->kafkaProducer.produceMessage(SettingConfig::getInstance().KAFKA_CMDCB_TOPIC, QString(QJsonDocument(cmdcb).toJson(QJsonDocument::Compact))); // display on page emit sendCommandToDisplay(command); diff --git a/DeviceHub/device/FrequencyTuning.cpp b/DeviceHub/device/FrequencyTuning.cpp index e2038c2..07780d9 100644 --- a/DeviceHub/device/FrequencyTuning.cpp +++ b/DeviceHub/device/FrequencyTuning.cpp @@ -14,12 +14,12 @@ connect(this, &FrequencyTuning::sendCommandToDisplay, ((DeviceHubWindow *)this->parent())->freqTunForm, &FrequencyTuningForm::displayDeviceCommandOnForm); - connect(((DeviceHubWindow *)this->parent())->kafkaConsumer, &QKafkaConsumer::messageRecieved, - this, &FrequencyTuning::commandReceivedHandler); +// connect(((DeviceHubWindow *)this->parent())->kafkaConsumer, &QKafkaConsumer::messageRecieved, +// this, &FrequencyTuning::commandReceivedHandler); - kafkaProducer.setBrokers(SettingConfig::getInstance().KAFKA_BROKERS); - kafkaProducer.setTopic(SettingConfig::getInstance().KAFKA_DATA_TOPIC); - kafkaProducer.createProducer(); +// kafkaProducer.setBrokers(SettingConfig::getInstance().KAFKA_BROKERS); +// kafkaProducer.setTopic(SettingConfig::getInstance().KAFKA_DATA_TOPIC); +// kafkaProducer.createProducer(); this->protocol = DeviceProtocolBase::deviceProtocolFactory(devType); } @@ -111,7 +111,7 @@ QJsonObject jsonObj = frameDto->toJSON(); jsonObj.insert("clientId", SettingConfig::getInstance().CLIENT_ID); jsonObj.insert("deviceId", deviceId); - kafkaProducer.produceMessage(QString(QJsonDocument(jsonObj).toJson(QJsonDocument::Compact))); +// kafkaProducer.produceMessage(QString(QJsonDocument(jsonObj).toJson(QJsonDocument::Compact))); } // 4. 在界面上简单显示相差数据结果 @@ -166,7 +166,7 @@ cmdcb.insert("commandId", command.value("commandId").toString()); cmdcb.insert("rawCommand", QString::fromUtf8(commandBytes)); cmdcb.insert("status", "1"); - this->kafkaProducer.produceMessage(SettingConfig::getInstance().KAFKA_CMDCB_TOPIC, QString(QJsonDocument(cmdcb).toJson(QJsonDocument::Compact))); +// this->kafkaProducer.produceMessage(SettingConfig::getInstance().KAFKA_CMDCB_TOPIC, QString(QJsonDocument(cmdcb).toJson(QJsonDocument::Compact))); // display on page emit sendCommandToDisplay(command); diff --git a/DeviceHub/device/SignalGenerator.cpp b/DeviceHub/device/SignalGenerator.cpp index e99ddc1..e2e5733 100644 --- a/DeviceHub/device/SignalGenerator.cpp +++ b/DeviceHub/device/SignalGenerator.cpp @@ -14,12 +14,12 @@ connect(this, &SignalGenerator::sendCommandToDisplay, ((DeviceHubWindow *)this->parent())->signGenForm, &SignalGeneratorForm::displayDeviceCommandOnForm); - connect(((DeviceHubWindow *)this->parent())->kafkaConsumer, &QKafkaConsumer::messageRecieved, - this, &SignalGenerator::commandReceivedHandler); +// connect(((DeviceHubWindow *)this->parent())->kafkaConsumer, &QKafkaConsumer::messageRecieved, +// this, &SignalGenerator::commandReceivedHandler); - kafkaProducer.setBrokers(SettingConfig::getInstance().KAFKA_BROKERS); - kafkaProducer.setTopic(SettingConfig::getInstance().KAFKA_DATA_TOPIC); - kafkaProducer.createProducer(); +// kafkaProducer.setBrokers(SettingConfig::getInstance().KAFKA_BROKERS); +// kafkaProducer.setTopic(SettingConfig::getInstance().KAFKA_DATA_TOPIC); +// kafkaProducer.createProducer(); this->protocol = DeviceProtocolBase::deviceProtocolFactory(devType); } @@ -114,7 +114,7 @@ QJsonObject jsonObj = frameDto->toJSON(); jsonObj.insert("clientId", SettingConfig::getInstance().CLIENT_ID); jsonObj.insert("deviceId", deviceId); - kafkaProducer.produceMessage(QString(QJsonDocument(jsonObj).toJson(QJsonDocument::Compact))); +// kafkaProducer.produceMessage(QString(QJsonDocument(jsonObj).toJson(QJsonDocument::Compact))); } // 4. 在界面上简单显示相差数据结果 @@ -169,7 +169,7 @@ cmdcb.insert("commandId", command.value("commandId").toString()); cmdcb.insert("rawCommand", QString::fromUtf8(commandBytes)); cmdcb.insert("status", "1"); - this->kafkaProducer.produceMessage(SettingConfig::getInstance().KAFKA_CMDCB_TOPIC, QString(QJsonDocument(cmdcb).toJson(QJsonDocument::Compact))); +// this->kafkaProducer.produceMessage(SettingConfig::getInstance().KAFKA_CMDCB_TOPIC, QString(QJsonDocument(cmdcb).toJson(QJsonDocument::Compact))); // display on page emit sendCommandToDisplay(command); diff --git a/DeviceHub/device/TimeSwitcher.cpp b/DeviceHub/device/TimeSwitcher.cpp index f4c772e..83f8f38 100644 --- a/DeviceHub/device/TimeSwitcher.cpp +++ b/DeviceHub/device/TimeSwitcher.cpp @@ -14,14 +14,14 @@ connect(this, &TimeSwitcher::sendCommandToDisplay, ((DeviceHubWindow *)this->parent())->tmSwitForm, &TimeSwitcherForm::displayDeviceCommandOnForm); - connect(((DeviceHubWindow *)this->parent())->kafkaConsumer, &QKafkaConsumer::messageRecieved, - this, &TimeSwitcher::commandReceivedHandler); +// connect(((DeviceHubWindow *)this->parent())->kafkaConsumer, &QKafkaConsumer::messageRecieved, +// this, &TimeSwitcher::commandReceivedHandler); - kafkaProducer.setBrokers(SettingConfig::getInstance().KAFKA_BROKERS); - kafkaProducer.setTopic(SettingConfig::getInstance().KAFKA_DATA_TOPIC); - kafkaProducer.createProducer(); +// kafkaProducer.setBrokers(SettingConfig::getInstance().KAFKA_BROKERS); +// kafkaProducer.setTopic(SettingConfig::getInstance().KAFKA_DATA_TOPIC); +// kafkaProducer.createProducer(); - this->protocol = DeviceProtocolBase::deviceProtocolFactory(typeid (this).name()); + this->protocol = DeviceProtocolBase::deviceProtocolFactory(devType); } TimeSwitcher::~TimeSwitcher() @@ -112,7 +112,7 @@ QJsonObject jsonObj = frameDto->toJSON(); jsonObj.insert("clientId", SettingConfig::getInstance().CLIENT_ID); jsonObj.insert("deviceId", deviceId); - kafkaProducer.produceMessage(QString(QJsonDocument(jsonObj).toJson(QJsonDocument::Compact))); +// kafkaProducer.produceMessage(QString(QJsonDocument(jsonObj).toJson(QJsonDocument::Compact))); } // 4. 在界面上简单显示相差数据结果 @@ -167,7 +167,7 @@ cmdcb.insert("commandId", command.value("commandId").toString()); cmdcb.insert("rawCommand", QString::fromUtf8(commandBytes)); cmdcb.insert("status", "1"); - this->kafkaProducer.produceMessage(SettingConfig::getInstance().KAFKA_CMDCB_TOPIC, QString(QJsonDocument(cmdcb).toJson(QJsonDocument::Compact))); +// this->kafkaProducer.produceMessage(SettingConfig::getInstance().KAFKA_CMDCB_TOPIC, QString(QJsonDocument(cmdcb).toJson(QJsonDocument::Compact))); // display on page emit sendCommandToDisplay(command); diff --git a/DeviceHub/DeviceHubWindow.cpp b/DeviceHub/DeviceHubWindow.cpp index e02df0f..d2786ce 100644 --- a/DeviceHub/DeviceHubWindow.cpp +++ b/DeviceHub/DeviceHubWindow.cpp @@ -1,4 +1,4 @@ -#include "DeviceHubWindow.h" +#include "DeviceHubWindow.h" #include "ui_DeviceHubWindow.h" #include @@ -42,11 +42,11 @@ ui->stackedWidget->addWidget(freqSwitForm); // kafka consumer - kafkaConsumer = new QKafkaConsumer(this); - kafkaConsumer->setBrokers(SettingConfig::getInstance().KAFKA_BROKERS); - kafkaConsumer->setTopic(SettingConfig::getInstance().KAFKA_CMD_TOPIC); - kafkaConsumer->createConsumer(); - kafkaConsumer->start(); +// kafkaConsumer = new QKafkaConsumer(this); +// kafkaConsumer->setBrokers(SettingConfig::getInstance().KAFKA_BROKERS); +// kafkaConsumer->setTopic(SettingConfig::getInstance().KAFKA_CMD_TOPIC); +// kafkaConsumer->createConsumer(); +// kafkaConsumer->start(); // init device type and device list httpReq = new HttpRequestController(this); diff --git a/DeviceHub/DeviceHubWindow.h b/DeviceHub/DeviceHubWindow.h index 94bf742..ad91f95 100644 --- a/DeviceHub/DeviceHubWindow.h +++ b/DeviceHub/DeviceHubWindow.h @@ -1,11 +1,11 @@ -#ifndef DEVICEHUBWINDOW_H +#ifndef DEVICEHUBWINDOW_H #define DEVICEHUBWINDOW_H #include #include #include "common/HttpRequestController.h" -#include "common/utils/QKafkaConsumer.h" +//#include "common/utils/QKafkaConsumer.h" #include "device/DeviceBase.h" #include "FrequencyTuningForm.h" #include "SignalGeneratorForm.h" @@ -28,7 +28,7 @@ int currentDevIndex; QMap> allTypeDevList; - QKafkaConsumer * kafkaConsumer; +// QKafkaConsumer * kafkaConsumer; QComboBox * getDevTypeSelect(); QComboBox * getDevSelect(); diff --git a/DeviceHub/TimeSwitcherForm.cpp b/DeviceHub/TimeSwitcherForm.cpp index a7d4b2f..82fe96d 100644 --- a/DeviceHub/TimeSwitcherForm.cpp +++ b/DeviceHub/TimeSwitcherForm.cpp @@ -1,4 +1,4 @@ -#include "TimeSwitcherForm.h" +#include "TimeSwitcherForm.h" #include "ui_TimeSwitcherForm.h" #include "DeviceHubWindow.h" @@ -28,11 +28,38 @@ if (frameData->frameType == "0501") { TimeSwitcherStatusDto * statusFrameDto = (TimeSwitcherStatusDto *) frameData; + ui->tsDevStatus->setText(statusFrameDto->devStatus == "1" ? "正常" : "异常"); + ui->tsRefSelectType->setText(statusFrameDto->refSelectType == "1" ? "手动" : "自动"); + ui->tsRefTmSrc->setText(QString("时间源%1").arg(statusFrameDto->refTmSrc)); + ui->tsOppsPhaseAccOut->setText(QString("%1 ps").arg(statusFrameDto->oppsPhaseAccOut)); + ui->tsBacRatio->setText(QString("%1").arg(statusFrameDto->bacRatio)); + ui->tsBacRange->setText(QString("%1 V").arg(statusFrameDto->bacRange)); + + QJsonObject dataObj = statusFrameDto->toJSON().find("data")->toObject(); + QJsonDocument doc; + + doc.setArray(dataObj.find("tmSrcStatusStrArray")->toArray()); + ui->tsTmSrcStatus->setText(QString::fromUtf8(doc.toJson(QJsonDocument::Compact).constData())); + + doc.setArray(dataObj.find("bacOutStatusArray")->toArray()); + ui->tsBacOutStatus->setText(QString::fromUtf8(doc.toJson(QJsonDocument::Compact).constData())); + + doc.setArray(dataObj.find("bdcOutStatusArray")->toArray()); + ui->tsBdcOutStatus->setText(QString::fromUtf8(doc.toJson(QJsonDocument::Compact).constData())); + + doc.setArray(dataObj.find("delayCompensArray")->toArray()); + ui->tsDelayComp->setText(QString::fromUtf8(doc.toJson(QJsonDocument::Compact).constData())); + + doc.setArray(dataObj.find("oppsOutStatusArray")->toArray()); + ui->tsOppsOutStatus->setText(QString::fromUtf8(doc.toJson(QJsonDocument::Compact).constData())); + + doc.setArray(dataObj.find("localTmDiffArray")->toArray()); + ui->tsLocalTmDiff->setText(QString::fromUtf8(doc.toJson(QJsonDocument::Compact).constData())); } else if (frameData->frameType == "0502") { TimeSwitcherInterfaceDto * interFrameDto = (TimeSwitcherInterfaceDto *) frameData; - + ui->tsCtrlStatus->setText(interFrameDto->ctrlStatus == "1" ? "程控" : "本控"); } } @@ -58,24 +85,31 @@ QString commandType = command.value("command").toString(); if (commandType == "GLF,01") { - + ui->tsRefSelectTypeSet->setText(command.value("params").toString()); + ui->tsRefSelectTypeSetRaw->setText(command.value("rawCommand").toString()); } else if (commandType == "GLF,02") { - + ui->tsBacRatioSet->setText(command.value("params").toString()); + ui->tsBacRatioSetRaw->setText(command.value("rawCommand").toString()); } else if (commandType == "GLF,03") { - + ui->tsBacRangeSet->setText(command.value("params").toString()); + ui->tsBacRangeSetRaw->setText(command.value("rawCommand").toString()); } else if (commandType == "GLF,04") { - + ui->tsTmSrcSet->setText(command.value("params").toString()); + ui->tsTmSrcSetRaw->setText(command.value("rawCommand").toString()); } else if (commandType == "GLF,05") { - + ui->tsOppsPhaseSet->setText(command.value("params").toString()); + ui->tsOppsPhaseSetRaw->setText(command.value("rawCommand").toString()); } else if (commandType == "GLF,06") { - + ui->tsDelayCompSet->setText(command.value("params").toString()); + ui->tsDelayCompSetRaw->setText(command.value("rawCommand").toString()); } else if (commandType == "GLC,01") { - + ui->tsControlSet->setText(command.value("params").toString()); + ui->tsControlSetRaw->setText(command.value("rawCommand").toString()); } } diff --git a/DeviceHub/TimeSwitcherForm.ui b/DeviceHub/TimeSwitcherForm.ui index 2a428fc..71477c4 100644 --- a/DeviceHub/TimeSwitcherForm.ui +++ b/DeviceHub/TimeSwitcherForm.ui @@ -6,7 +6,7 @@ 0 0 - 1200 + 1300 600 @@ -49,7 +49,7 @@ 20 - 230 + 290 100 30 @@ -93,10 +93,10 @@ - + - 380 + 410 120 50 30 @@ -108,6 +108,228 @@ 170 120 + 100 + 30 + + + + + 微软雅黑 + 10 + + + + 选择参考源模式 + + + + + + 270 + 120 + 50 + 30 + + + + + + + 340 + 120 + 70 + 30 + + + + + 微软雅黑 + 10 + + + + 当前时间源 + + + + + + 480 + 120 + 70 + 30 + + + + + 微软雅黑 + 10 + + + + 时间源状态 + + + + + + 550 + 120 + 300 + 30 + + + + + + + 20 + 170 + 70 + 30 + + + + + 微软雅黑 + 10 + + + + 时间源秒差 + + + + + + 90 + 170 + 300 + 30 + + + + + + + 870 + 120 + 100 + 30 + + + + + 微软雅黑 + 10 + + + + 相位调节累计值 + + + + + + 970 + 120 + 50 + 30 + + + + + + + 420 + 170 + 90 + 30 + + + + + 微软雅黑 + 10 + + + + B-AC码调制比 + + + + + + 510 + 170 + 50 + 30 + + + + + + + 580 + 170 + 80 + 30 + + + + + 微软雅黑 + 10 + + + + B-AC码幅度 + + + + + + 660 + 170 + 50 + 30 + + + + + + + 740 + 170 + 70 + 30 + + + + + 微软雅黑 + 10 + + + + 输入补偿值 + + + + + + 810 + 170 + 300 + 30 + + + + + + + 1050 + 120 60 30 @@ -119,24 +341,156 @@ - 闰秒标志 + 控制状态 - + - 230 + 1110 120 50 30 - + - 300 - 120 + 20 + 230 + 90 + 30 + + + + + 微软雅黑 + 10 + + + + 1PPS输出状态 + + + + + + 110 + 230 + 200 + 30 + + + + + + + 330 + 230 + 90 + 30 + + + + + 微软雅黑 + 10 + + + + B-DC输出状态 + + + + + + 420 + 230 + 200 + 30 + + + + + + + 730 + 230 + 200 + 30 + + + + + + + + + + 640 + 230 + 90 + 30 + + + + + 微软雅黑 + 10 + + + + B-AC输出状态 + + + + + + 100 + 500 + 100 + 30 + + + + + + + 820 + 430 + 200 + 30 + + + + true + + + + + + 20 + 500 + 60 + 30 + + + + + 微软雅黑 + 10 + + + + 控制状态 + + + + + + 610 + 380 80 30 @@ -148,7 +502,373 @@ - 频率信号状态 + 相位调节 + + + + + + 460 + 500 + 80 + 30 + + + + + 微软雅黑 + 10 + + + + send + + + + + + 460 + 380 + 80 + 30 + + + + + 微软雅黑 + 10 + + + + send + + + + + + 20 + 330 + 80 + 30 + + + + + 微软雅黑 + 10 + + + + 参考源选择 + + + + + + 1050 + 330 + 80 + 30 + + + + + 微软雅黑 + 10 + + + + send + + + + + + 230 + 330 + 200 + 30 + + + + true + + + + + + 1050 + 380 + 80 + 30 + + + + + 微软雅黑 + 10 + + + + send + + + + + + 460 + 430 + 80 + 30 + + + + + 微软雅黑 + 10 + + + + send + + + + + + 230 + 430 + 200 + 30 + + + + true + + + + + + 690 + 380 + 100 + 30 + + + + + + + 610 + 330 + 60 + 30 + + + + + 微软雅黑 + 10 + + + + 时间源 + + + + + + 1050 + 430 + 80 + 30 + + + + + 微软雅黑 + 10 + + + + send + + + + + + 690 + 430 + 100 + 30 + + + + + + + 820 + 380 + 200 + 30 + + + + true + + + + + + 100 + 430 + 100 + 30 + + + + + + + 230 + 500 + 200 + 30 + + + + true + + + + + + 20 + 430 + 60 + 30 + + + + + 微软雅黑 + 10 + + + + AC码幅度 + + + + + + 100 + 380 + 100 + 30 + + + + + + + 100 + 330 + 100 + 30 + + + + + + + 820 + 330 + 200 + 30 + + + + true + + + + + + 610 + 430 + 80 + 30 + + + + + 微软雅黑 + 10 + + + + 输入延迟补偿 + + + + + + 690 + 330 + 100 + 30 + + + + + + + 20 + 380 + 80 + 30 + + + + + 微软雅黑 + 10 + + + + AC码调制比 + + + + + + 460 + 330 + 80 + 30 + + + + + 微软雅黑 + 10 + + + + send + + + + + + 230 + 380 + 200 + 30 + + + + true diff --git a/DeviceHub/common/common.pri b/DeviceHub/common/common.pri index 6ac9b59..feeba36 100644 --- a/DeviceHub/common/common.pri +++ b/DeviceHub/common/common.pri @@ -1,22 +1,20 @@ -SOURCES += $$PWD/utils/SettingConfig.cpp \ - $$PWD/utils/QKafkaProducer.cpp +SOURCES += $$PWD/utils/SettingConfig.cpp SOURCES += $$PWD/utils/QByteUtil.cpp SOURCES += $$PWD/utils/QSerialPortUtil.cpp SOURCES += $$PWD/utils/QLogUtil.cpp -SOURCES += -SOURCES += $$PWD/utils/QKafkaConsumer.cpp +#SOURCES += $$PWD/utils/QKafkaConsumer.cpp +#SOURCES += $$PWD/utils/QKafkaProducer.cpp SOURCES += $$PWD/utils/HttpRequestUtil.cpp SOURCES += $$PWD/utils/MD5.cpp SOURCES += $$PWD/HttpRequestController.cpp -HEADERS += $$PWD/utils/SettingConfig.h \ - $$PWD/utils/QKafkaProducer.h +HEADERS += $$PWD/utils/SettingConfig.h HEADERS += $$PWD/utils/QByteUtil.h HEADERS += $$PWD/utils/QSerialPortUtil.h HEADERS += $$PWD/utils/QLogUtil.h -HEADERS += -HEADERS += $$PWD/utils/QKafkaConsumer.h +#HEADERS += $$PWD/utils/QKafkaConsumer.h +#HEADERS += $$PWD/utils/QKafkaProducer.h HEADERS += $$PWD/utils/HttpRequestUtil.h HEADERS += $$PWD/utils/DefHead.h HEADERS += $$PWD/utils/MD5.h diff --git a/DeviceHub/common/utils/QKafkaConsumer.h b/DeviceHub/common/utils/QKafkaConsumer.h index 5d40f37..49c9f01 100644 --- a/DeviceHub/common/utils/QKafkaConsumer.h +++ b/DeviceHub/common/utils/QKafkaConsumer.h @@ -1,10 +1,10 @@ -#ifndef QKAFKACONSUMER_H +#ifndef QKAFKACONSUMER_H #define QKAFKACONSUMER_H #include #include -#include "include/librdkafka/rdkafkacpp.h" +//#include "include/librdkafka/rdkafkacpp.h" class QKafkaConsumer : public QThread { diff --git a/DeviceHub/common/utils/QKafkaProducer.h b/DeviceHub/common/utils/QKafkaProducer.h index bd0cc15..d560bb1 100644 --- a/DeviceHub/common/utils/QKafkaProducer.h +++ b/DeviceHub/common/utils/QKafkaProducer.h @@ -3,7 +3,7 @@ #include -#include "include/librdkafka/rdkafkacpp.h" +//#include "include/librdkafka/rdkafkacpp.h" class QKafkaProducer : public QObject { diff --git a/DeviceHub/device/DeviceBase.h b/DeviceHub/device/DeviceBase.h index 8a3b271..e06bee3 100644 --- a/DeviceHub/device/DeviceBase.h +++ b/DeviceHub/device/DeviceBase.h @@ -3,7 +3,7 @@ #include #include "common/utils/QSerialPortUtil.h" -#include "common/utils/QKafkaProducer.h" +//#include "common/utils/QKafkaProducer.h" #include "common/utils/QByteUtil.h" #include "common/utils/QLogUtil.h" #include "common/utils/SettingConfig.h" @@ -43,7 +43,7 @@ QString devType; QSerialPortUtil serialUtil; - QKafkaProducer kafkaProducer; +// QKafkaProducer kafkaProducer; QByteArray dataBuff; }; diff --git a/DeviceHub/device/FreqSwitcher.cpp b/DeviceHub/device/FreqSwitcher.cpp index 96ce66a..5851f26 100644 --- a/DeviceHub/device/FreqSwitcher.cpp +++ b/DeviceHub/device/FreqSwitcher.cpp @@ -14,12 +14,12 @@ connect(this, &FreqSwitcher::sendCommandToDisplay, ((DeviceHubWindow *)this->parent())->freqSwitForm, &FreqSwitcherForm::displayDeviceCommandOnForm); - connect(((DeviceHubWindow *)this->parent())->kafkaConsumer, &QKafkaConsumer::messageRecieved, - this, &FreqSwitcher::commandReceivedHandler); +// connect(((DeviceHubWindow *)this->parent())->kafkaConsumer, &QKafkaConsumer::messageRecieved, +// this, &FreqSwitcher::commandReceivedHandler); - kafkaProducer.setBrokers(SettingConfig::getInstance().KAFKA_BROKERS); - kafkaProducer.setTopic(SettingConfig::getInstance().KAFKA_DATA_TOPIC); - kafkaProducer.createProducer(); +// kafkaProducer.setBrokers(SettingConfig::getInstance().KAFKA_BROKERS); +// kafkaProducer.setTopic(SettingConfig::getInstance().KAFKA_DATA_TOPIC); +// kafkaProducer.createProducer(); this->protocol = DeviceProtocolBase::deviceProtocolFactory(devType); } @@ -112,7 +112,7 @@ QJsonObject jsonObj = frameDto->toJSON(); jsonObj.insert("clientId", SettingConfig::getInstance().CLIENT_ID); jsonObj.insert("deviceId", deviceId); - kafkaProducer.produceMessage(QString(QJsonDocument(jsonObj).toJson(QJsonDocument::Compact))); +// kafkaProducer.produceMessage(QString(QJsonDocument(jsonObj).toJson(QJsonDocument::Compact))); } // 4. 在界面上简单显示相差数据结果 @@ -167,7 +167,7 @@ cmdcb.insert("commandId", command.value("commandId").toString()); cmdcb.insert("rawCommand", QString::fromUtf8(commandBytes)); cmdcb.insert("status", "1"); - this->kafkaProducer.produceMessage(SettingConfig::getInstance().KAFKA_CMDCB_TOPIC, QString(QJsonDocument(cmdcb).toJson(QJsonDocument::Compact))); +// this->kafkaProducer.produceMessage(SettingConfig::getInstance().KAFKA_CMDCB_TOPIC, QString(QJsonDocument(cmdcb).toJson(QJsonDocument::Compact))); // display on page emit sendCommandToDisplay(command); diff --git a/DeviceHub/device/FrequencyTuning.cpp b/DeviceHub/device/FrequencyTuning.cpp index e2038c2..07780d9 100644 --- a/DeviceHub/device/FrequencyTuning.cpp +++ b/DeviceHub/device/FrequencyTuning.cpp @@ -14,12 +14,12 @@ connect(this, &FrequencyTuning::sendCommandToDisplay, ((DeviceHubWindow *)this->parent())->freqTunForm, &FrequencyTuningForm::displayDeviceCommandOnForm); - connect(((DeviceHubWindow *)this->parent())->kafkaConsumer, &QKafkaConsumer::messageRecieved, - this, &FrequencyTuning::commandReceivedHandler); +// connect(((DeviceHubWindow *)this->parent())->kafkaConsumer, &QKafkaConsumer::messageRecieved, +// this, &FrequencyTuning::commandReceivedHandler); - kafkaProducer.setBrokers(SettingConfig::getInstance().KAFKA_BROKERS); - kafkaProducer.setTopic(SettingConfig::getInstance().KAFKA_DATA_TOPIC); - kafkaProducer.createProducer(); +// kafkaProducer.setBrokers(SettingConfig::getInstance().KAFKA_BROKERS); +// kafkaProducer.setTopic(SettingConfig::getInstance().KAFKA_DATA_TOPIC); +// kafkaProducer.createProducer(); this->protocol = DeviceProtocolBase::deviceProtocolFactory(devType); } @@ -111,7 +111,7 @@ QJsonObject jsonObj = frameDto->toJSON(); jsonObj.insert("clientId", SettingConfig::getInstance().CLIENT_ID); jsonObj.insert("deviceId", deviceId); - kafkaProducer.produceMessage(QString(QJsonDocument(jsonObj).toJson(QJsonDocument::Compact))); +// kafkaProducer.produceMessage(QString(QJsonDocument(jsonObj).toJson(QJsonDocument::Compact))); } // 4. 在界面上简单显示相差数据结果 @@ -166,7 +166,7 @@ cmdcb.insert("commandId", command.value("commandId").toString()); cmdcb.insert("rawCommand", QString::fromUtf8(commandBytes)); cmdcb.insert("status", "1"); - this->kafkaProducer.produceMessage(SettingConfig::getInstance().KAFKA_CMDCB_TOPIC, QString(QJsonDocument(cmdcb).toJson(QJsonDocument::Compact))); +// this->kafkaProducer.produceMessage(SettingConfig::getInstance().KAFKA_CMDCB_TOPIC, QString(QJsonDocument(cmdcb).toJson(QJsonDocument::Compact))); // display on page emit sendCommandToDisplay(command); diff --git a/DeviceHub/device/SignalGenerator.cpp b/DeviceHub/device/SignalGenerator.cpp index e99ddc1..e2e5733 100644 --- a/DeviceHub/device/SignalGenerator.cpp +++ b/DeviceHub/device/SignalGenerator.cpp @@ -14,12 +14,12 @@ connect(this, &SignalGenerator::sendCommandToDisplay, ((DeviceHubWindow *)this->parent())->signGenForm, &SignalGeneratorForm::displayDeviceCommandOnForm); - connect(((DeviceHubWindow *)this->parent())->kafkaConsumer, &QKafkaConsumer::messageRecieved, - this, &SignalGenerator::commandReceivedHandler); +// connect(((DeviceHubWindow *)this->parent())->kafkaConsumer, &QKafkaConsumer::messageRecieved, +// this, &SignalGenerator::commandReceivedHandler); - kafkaProducer.setBrokers(SettingConfig::getInstance().KAFKA_BROKERS); - kafkaProducer.setTopic(SettingConfig::getInstance().KAFKA_DATA_TOPIC); - kafkaProducer.createProducer(); +// kafkaProducer.setBrokers(SettingConfig::getInstance().KAFKA_BROKERS); +// kafkaProducer.setTopic(SettingConfig::getInstance().KAFKA_DATA_TOPIC); +// kafkaProducer.createProducer(); this->protocol = DeviceProtocolBase::deviceProtocolFactory(devType); } @@ -114,7 +114,7 @@ QJsonObject jsonObj = frameDto->toJSON(); jsonObj.insert("clientId", SettingConfig::getInstance().CLIENT_ID); jsonObj.insert("deviceId", deviceId); - kafkaProducer.produceMessage(QString(QJsonDocument(jsonObj).toJson(QJsonDocument::Compact))); +// kafkaProducer.produceMessage(QString(QJsonDocument(jsonObj).toJson(QJsonDocument::Compact))); } // 4. 在界面上简单显示相差数据结果 @@ -169,7 +169,7 @@ cmdcb.insert("commandId", command.value("commandId").toString()); cmdcb.insert("rawCommand", QString::fromUtf8(commandBytes)); cmdcb.insert("status", "1"); - this->kafkaProducer.produceMessage(SettingConfig::getInstance().KAFKA_CMDCB_TOPIC, QString(QJsonDocument(cmdcb).toJson(QJsonDocument::Compact))); +// this->kafkaProducer.produceMessage(SettingConfig::getInstance().KAFKA_CMDCB_TOPIC, QString(QJsonDocument(cmdcb).toJson(QJsonDocument::Compact))); // display on page emit sendCommandToDisplay(command); diff --git a/DeviceHub/device/TimeSwitcher.cpp b/DeviceHub/device/TimeSwitcher.cpp index f4c772e..83f8f38 100644 --- a/DeviceHub/device/TimeSwitcher.cpp +++ b/DeviceHub/device/TimeSwitcher.cpp @@ -14,14 +14,14 @@ connect(this, &TimeSwitcher::sendCommandToDisplay, ((DeviceHubWindow *)this->parent())->tmSwitForm, &TimeSwitcherForm::displayDeviceCommandOnForm); - connect(((DeviceHubWindow *)this->parent())->kafkaConsumer, &QKafkaConsumer::messageRecieved, - this, &TimeSwitcher::commandReceivedHandler); +// connect(((DeviceHubWindow *)this->parent())->kafkaConsumer, &QKafkaConsumer::messageRecieved, +// this, &TimeSwitcher::commandReceivedHandler); - kafkaProducer.setBrokers(SettingConfig::getInstance().KAFKA_BROKERS); - kafkaProducer.setTopic(SettingConfig::getInstance().KAFKA_DATA_TOPIC); - kafkaProducer.createProducer(); +// kafkaProducer.setBrokers(SettingConfig::getInstance().KAFKA_BROKERS); +// kafkaProducer.setTopic(SettingConfig::getInstance().KAFKA_DATA_TOPIC); +// kafkaProducer.createProducer(); - this->protocol = DeviceProtocolBase::deviceProtocolFactory(typeid (this).name()); + this->protocol = DeviceProtocolBase::deviceProtocolFactory(devType); } TimeSwitcher::~TimeSwitcher() @@ -112,7 +112,7 @@ QJsonObject jsonObj = frameDto->toJSON(); jsonObj.insert("clientId", SettingConfig::getInstance().CLIENT_ID); jsonObj.insert("deviceId", deviceId); - kafkaProducer.produceMessage(QString(QJsonDocument(jsonObj).toJson(QJsonDocument::Compact))); +// kafkaProducer.produceMessage(QString(QJsonDocument(jsonObj).toJson(QJsonDocument::Compact))); } // 4. 在界面上简单显示相差数据结果 @@ -167,7 +167,7 @@ cmdcb.insert("commandId", command.value("commandId").toString()); cmdcb.insert("rawCommand", QString::fromUtf8(commandBytes)); cmdcb.insert("status", "1"); - this->kafkaProducer.produceMessage(SettingConfig::getInstance().KAFKA_CMDCB_TOPIC, QString(QJsonDocument(cmdcb).toJson(QJsonDocument::Compact))); +// this->kafkaProducer.produceMessage(SettingConfig::getInstance().KAFKA_CMDCB_TOPIC, QString(QJsonDocument(cmdcb).toJson(QJsonDocument::Compact))); // display on page emit sendCommandToDisplay(command); diff --git a/DeviceHub/protocol/DeviceProtocolBase.cpp b/DeviceHub/protocol/DeviceProtocolBase.cpp index 4303ba6..c7d5238 100644 --- a/DeviceHub/protocol/DeviceProtocolBase.cpp +++ b/DeviceHub/protocol/DeviceProtocolBase.cpp @@ -1,9 +1,8 @@ #include "DeviceProtocolBase.h" #include "FrequencyTuningProtocolBM.h" #include "SignalGeneratorProtocolBM.h" - -//#include "TimeSwitcherProtocolBM.h" -//#include "FreqSwitcherProtocolBM.h" +#include "TimeSwitcherProtocolBM.h" +#include "FreqSwitcherProtocolBM.h" //#include "TimeReplicatorProtocolBM.h" //#include "FreqReplicatorProtocolTX.h" //#include "BCodeTerminalProtocolBM.h" @@ -23,6 +22,12 @@ } else if (deviceType == "04") { return new SignalGeneratorProtocolBM(); + } else if (deviceType == "05") + { + return new TimeSwitcherProtocolBM(); + } else if (deviceType == "06") + { + return new FreqSwitcherProtocolBM(); } // if (deviceType.contains("SignalGenerator") == true)