diff --git a/DataCenter/DataCenter.cpp b/DataCenter/DataCenter.cpp index 2f2a418..443491f 100644 --- a/DataCenter/DataCenter.cpp +++ b/DataCenter/DataCenter.cpp @@ -96,18 +96,21 @@ void DataCenter::addMonitoredNode(const QString &nodeId, const QString &nodeName const QString &varName, const QString &tableName, const QString &fieldName) { - if (gOPC_NodeName.contains(nodeId)) { - qWarning() << "节点已存在:" << nodeId; + QString mNodeID = nodeId; + if(!mNodeID.contains("ns=6;s=::AsGlobalPV:")) + mNodeID = "ns=6;s=::AsGlobalPV:"+mNodeID; + if (gOPC_NodeName.contains(mNodeID)) { + qWarning() << "节点已存在:" << mNodeID; return; } // 使用全局变量存储 - gOPC_NodeName[nodeId] = nodeName.isEmpty() ? nodeId : nodeName; - gOPC_VarName[nodeId] = varName.isEmpty() ? nodeId : varName; - gOPC_SqlTable[nodeId] = tableName; - gOPC_SqlField[nodeId] = fieldName; - gOPC_NodeList.append(nodeId); - gOPC_NodeValue[nodeId] = QVariant(); + gOPC_NodeName[mNodeID] = nodeName.isEmpty() ? mNodeID : nodeName; + gOPC_VarName[mNodeID] = varName.isEmpty() ? mNodeID : varName; + gOPC_SqlTable[mNodeID] = tableName; + gOPC_SqlField[mNodeID] = fieldName; + gOPC_NodeList.append(mNodeID); + gOPC_NodeValue[mNodeID] = QVariant(); } void DataCenter::browseRecursive(const QString &nodeId) diff --git a/DataCenter/OpcUaManager.cpp b/DataCenter/OpcUaManager.cpp index c5a954f..0028358 100644 --- a/DataCenter/OpcUaManager.cpp +++ b/DataCenter/OpcUaManager.cpp @@ -196,22 +196,25 @@ bool OpcUaManager::writeNodeValue(const QString &nodeId, int maxRetry /*= 3*/, int retryIntervalMs /*= 200*/) { + QString mNodeID = nodeId; + if(!mNodeID.contains("ns=6;s=::AsGlobalPV:")) + mNodeID = "ns=6;s=::AsGlobalPV:"+mNodeID; if (!mClient || mClient->state() != QOpcUaClient::Connected) { - qWarning().noquote() << "[OPC] 客户端未连接,写入" << nodeId << "失败"; + qWarning().noquote() << "[OPC] 客户端未连接,写入" << mNodeID << "失败"; return false; } - QOpcUaNode *node = mClient->node(nodeId); + QOpcUaNode *node = mClient->node(mNodeID); if (!node) { - qWarning().noquote() << "[OPC] 无法写入节点:" << nodeId; + qWarning().noquote() << "[OPC] 无法写入节点:" << mNodeID; return false; } for (int attempt = 1; attempt <= maxRetry; ++attempt) { /* ---------- 1. 先读当前值 ---------- */ - QVariant cur = gOPC_NodeValue[nodeId]; + QVariant cur = gOPC_NodeValue[mNodeID]; if (!cur.isValid()) { - //qWarning().noquote() << "读到无效值:" << nodeId< - + EnvironmentId diff --git a/FileOperation/ConfigFiles.cpp b/FileOperation/ConfigFiles.cpp index 11c6fd5..1ec7d10 100644 --- a/FileOperation/ConfigFiles.cpp +++ b/FileOperation/ConfigFiles.cpp @@ -8,8 +8,48 @@ ConfigFiles::ConfigFiles(QObject *parent) : QObject(parent) +} +/** +* 读取配置值,若读取失败则使用默认值并写入配置文件 +* @param group 配置组名 +* @param key 配置项名 +* @param defaultValue 读取失败时使用的默认值 +* @return 读取到的值(或默认值) +*/ +template +T ConfigFiles::readAndSetDefault(const QString &Path ,const QString& group, const QString& key, const T& defaultValue) { + // 检查配置文件是否存在 + QSettings SystemConfig(Path, QSettings::IniFormat); + SystemConfig.setIniCodec("UTF-8"); // 尝试UTF-8编码 + QFileInfo configCheck(Path); + bool fileExists = configCheck.exists() && configCheck.isFile(); + + // 读取配置值 + SystemConfig.beginGroup(group); + QVariant value = SystemConfig.value(key); + SystemConfig.endGroup(); + + // 判断是否读取成功 + if (fileExists && value.isValid()) { + // 读取成功,返回转换后的值 + return value.value(); + } else { + // 读取失败(文件不存在或键不存在),使用默认值并写入配置 + if (isDebug) { + qDebug() << "配置项" << group << "/" << key << "读取失败,使用默认值:" << defaultValue; + } + + // 写入默认值到配置文件 + SystemConfig.beginGroup(group); + SystemConfig.setValue(key, defaultValue); + SystemConfig.endGroup(); + SystemConfig.sync(); // 立即同步到文件 + + return defaultValue; + } } void ConfigFiles::SystemConfig(){ + QFileInfo checkFile("./ProgramConfig.ini"); QSettings File("./ProgramConfig.ini", QSettings::IniFormat); if (checkFile.exists() && checkFile.isFile()) { @@ -23,17 +63,29 @@ void ConfigFiles::SystemConfig(){ QString Path = ConfigurationPath + "系统配置/SystemConfig.ini"; - QFileInfo SystemConfigCheck(Path); - QSettings SystemConfig(Path, QSettings::IniFormat); - if (SystemConfigCheck.exists() && SystemConfigCheck.isFile()) { - TrailRefreshTime = SystemConfig.value("System/TrailRefreshTime").toUInt(); - RTSP_Url = SystemConfig.value("System/RTSP_Url").toString(); - if(isDebug) qDebug()<<"曲线刷新时间(秒):"< ReadFile_Csv(const QString &filePath); static tsServerAddr ReadServerAddr(); void SystemConfig(); + template + T readAndSetDefault(const QString &Path ,const QString& group, const QString& key, const T& defaultValue); + bool isDebug = true; uint16_t TrailRefreshTime; + uint16_t UIRefreshTime; QString RTSP_Url; signals: diff --git a/LaunchPage.cpp b/LaunchPage.cpp index 8e17b92..ac779ef 100644 --- a/LaunchPage.cpp +++ b/LaunchPage.cpp @@ -18,40 +18,33 @@ void WindowWorker::initialize() // 根据不同页面索引准备不同的数据 switch(m_pageIndex) { case 1:{emit logMessage(QString("线程初始化->准备 主预览 数据...")); - gPageName["P01"] = "主预览"; + }break; case 2:{emit logMessage(QString("线程初始化->准备 屏蔽条件 数据...")); - gPageName["P02"] = "屏蔽条件"; emit logMessage(QString("线程初始化->读取 UI_屏蔽界面文本_配置 文件...")); ShieldConfigFile = ConfigFiles().ReadFile_Csv(ConfigurationPath + "画面配置/UI_屏蔽界面文本_配置.csv"); }break; case 3:{emit logMessage(QString("线程初始化->准备 油泵设备 数据...")); - gPageName["P301"] = "油泵设备"; emit logMessage(QString("线程初始化->读取 UI_油泵界面启停条件_配置 文件...")); PumpConditionConfigFile = ConfigFiles().ReadFile_Csv(ConfigurationPath + "画面配置/UI_油泵界面启停条件_配置.csv"); }break; case 4:{emit logMessage(QString("线程初始化->准备 截割设备 数据...")); - gPageName["P401"] = "截割设备"; emit logMessage(QString("线程初始化->读取 UI_截割界面启停条件_配置 文件")); CutConditionConfigFile = ConfigFiles().ReadFile_Csv(ConfigurationPath + "画面配置/UI_截割界面启停条件_配置.csv"); }break; case 5:{emit logMessage(QString("线程初始化->准备 装载设备 数据...")); - gPageName["P501"] = "装载设备"; emit logMessage(QString("线程初始化->读取 UI_装载界面启停条件_配置 文件")); LoaderConditionConfigFile = ConfigFiles().ReadFile_Csv(ConfigurationPath + "画面配置/UI_装载界面启停条件_配置.csv"); }break; case 6:{emit logMessage(QString("线程初始化->准备 运输设备 数据...")); - gPageName["P601"] = "运输设备"; emit logMessage(QString("线程初始化->读取 UI_运输界面启停条件_配置 文件")); TransportConditionConfigFile = ConfigFiles().ReadFile_Csv(ConfigurationPath + "画面配置/UI_运输界面启停条件_配置.csv"); }break; case 7:{emit logMessage(QString("线程初始化->准备 备用设备 数据...")); - gPageName["P07"] = "备用设备"; emit logMessage(QString("线程初始化->读取 UI_备用界面启停条件_配置 文件")); StandbyConditionConfigFile = ConfigFiles().ReadFile_Csv(ConfigurationPath + "画面配置/UI_备用界面启停条件_配置.csv"); }break; case 8:{emit logMessage(QString("线程初始化->准备 故障记录 数据...")); - gPageName["P08"] = "故障记录"; emit logMessage(QString("线程初始化->读取 UI_报警内容文本_配置 文件")); QList FileData = ConfigFiles().ReadFile_Csv(ConfigurationPath + "画面配置/UI_报警内容文本_配置.csv"); emit logMessage(QString("线程初始化->解析 UI_报警内容文本_配置 文件")); @@ -66,38 +59,21 @@ void WindowWorker::initialize() } }break; case 9:{emit logMessage(QString("线程初始化->准备 遥控测试 数据...")); - gPageName["P09"] = "遥控测试"; }break; case 10:{emit logMessage(QString("线程初始化->准备 自动智能 数据...")); - gPageName["P10"] = "自动智能"; }break; case 11:{emit logMessage(QString("线程初始化->准备 绝缘检测 数据...")); - gPageName["P11"] = "绝缘检测"; }break; case 12:{emit logMessage(QString("线程初始化->准备 网络拓扑 数据...")); - gPageName["P12.00"] = "网络拓扑"; - gPageName["P12.01"] = "硬件IO 1"; - gPageName["P12.02"] = "硬件IO 2"; - gPageName["P12.03"] = "硬件IO 3"; - gPageName["P12.04"] = "硬件IO 4"; - gPageName["P12.05"] = "硬件IO 3"; - gPageName["P12.06"] = "操作箱 1"; - gPageName["P12.07"] = "操作箱 2"; - gPageName["P12.08"] = "操作箱 3"; - gPageName["P12.09"] = "操作箱 4"; }break; case 13:{emit logMessage(QString("线程初始化->准备 本地控制 数据...")); - gPageName["P13"] = "本地控制"; }break; case 14:{emit logMessage(QString("线程初始化->准备 随机图册 数据...")); - gPageName["P14"] = "随机图册"; }break; case 15:{emit logMessage(QString("线程初始化->准备 参数设置 数据...")); - gPageName["P15"] = "参数设置"; }break; case 16:{emit logMessage(QString("线程初始化->准备 系统设置 数据...")); - gPageName["P16"] = "系统设置"; }break; } diff --git a/Pages/P00_PublicPage.cpp b/Pages/P00_PublicPage.cpp index 4cc45a6..9c90605 100644 --- a/Pages/P00_PublicPage.cpp +++ b/Pages/P00_PublicPage.cpp @@ -104,13 +104,28 @@ void P00_PublicPage::WinInit() ui->Label_VoiceWidget->move(32,70+576/2); ui->Label_VoiceWidget->hide(); - + ui->But_Page_0->setText(gPageName["P01"]); + ui->But_Page_1->setText(gPageName["P02"]); + ui->But_Page_2->setText(gPageName["P03"]); + ui->But_Page_3->setText(gPageName["P04"]); + ui->But_Page_4->setText(gPageName["P05"]); + ui->But_Page_5->setText(gPageName["P06"]); + ui->But_Page_6->setText(gPageName["P07"]); + ui->But_Page_7->setText(gPageName["P08"]); + ui->But_Page_8->setText(gPageName["P09"]); + ui->But_Page_9->setText(gPageName["P10"]); + ui->But_Page_10->setText(gPageName["P11"]); + ui->But_Page_11->setText(gPageName["P12.0"]); + ui->But_Page_12->setText(gPageName["P13"]); + ui->But_Page_13->setText(gPageName["P14"]); + ui->But_Page_14->setText(gPageName["P15"]); + ui->But_Page_15->setText(gPageName["P16"]); // 初始化定时器(作为成员变量) UIRefresh_Timer = new QTimer(this); connect(UIRefresh_Timer, &QTimer::timeout, this, &P00_PublicPage::UIRefreshTimeOut); UIRefresh_Timer->setInterval(100); - //UIRefresh_Timer->start(); + UIRefresh_Timer->start(); CursorScan_Timer = new QTimer(this); connect(CursorScan_Timer, &QTimer::timeout, this, &P00_PublicPage::CursorScanTimerOut); @@ -125,6 +140,7 @@ void P00_PublicPage::WinInit() SignalSlotInit(); gPageIndexStr = "P01"; + } void P00_PublicPage::SignalSlotInit() @@ -171,19 +187,19 @@ void P00_PublicPage::UIRefreshTimeOut(){ QDateTime currentTime = QDateTime::currentDateTime(); QString currentTimeStr = currentTime.toString("yyyy-MM-dd HH:mm:ss"); ui->Lable_SystemTime->setText(currentTimeStr); - ui->LCD_SystemVal_U1->display(gOPC_NodeValue["ns=6;s=::AsGlobalPV:IN_SystemVal.Filtered30_U"].toReal()); - ui->LCD_SystemVal_V1->display(gOPC_NodeValue["ns=6;s=::AsGlobalPV:IN_SystemVal.Filtered30_V"].toReal()); - ui->LCD_SystemVal_W1->display(gOPC_NodeValue["ns=6;s=::AsGlobalPV:IN_SystemVal.Filtered30_W"].toReal()); + ui->LCD_SystemVal_U1->display(getNodeValue("IN_SystemVal.Filtered30_U").toReal()); + ui->LCD_SystemVal_V1->display(getNodeValue("IN_SystemVal.Filtered30_V").toReal()); + ui->LCD_SystemVal_W1->display(getNodeValue("IN_SystemVal.Filtered30_W").toReal()); // 修复:使用正确的方式获取节点值并转换为整数 - uint16_t AlarmNumber = static_cast(gOPC_NodeValue["ns=6;s=::AsGlobalPV:AlarmCode.Index"].toUInt()); + uint16_t AlarmNumber = static_cast(getNodeValue("AlarmCode.Index").toUInt()); uint8_t AlarmAllNum = AlarmNumber / 256; uint8_t AlarmIndex = AlarmNumber % 256; - uint16_t LoopAlarm = static_cast(gOPC_NodeValue["ns=6;s=::AsGlobalPV:AlarmCode.Loop"].toUInt()); + uint16_t LoopAlarm = static_cast(getNodeValue("AlarmCode.Loop").toUInt()); uint8_t LoopAlarm_Dev = LoopAlarm / 256; uint8_t LoopAlarm_Ind = LoopAlarm % 256; - uint32_t Bools_4 = gOPC_NodeValue["ns=6;s=::AsGlobalPV:PageBOOLS.B4"].toUInt(); + uint32_t Bools_4 = getNodeValue("PageBOOLS.B4").toUInt(); ui->Txt_AlarmCode->setHidden(AlarmAllNum == 0); ui->Num_MainAlarmNum->setHidden(AlarmAllNum == 0); @@ -242,7 +258,7 @@ bool P00_PublicPage::OldConfirm = false; void P00_PublicPage::CursorScanTimerOut() { - uint32_t CursorControl = gOPC_NodeValue["ns=6;s=::AsGlobalPV:PageContol.CursorControl"].toUInt(); + uint32_t CursorControl = getNodeValue("PageContol.CursorControl").toUInt(); bool Up = getBitOf32Data(CursorControl,10); bool Down = getBitOf32Data(CursorControl,14); bool Left = getBitOf32Data(CursorControl,13); @@ -285,10 +301,10 @@ void P00_PublicPage::on_But_Close_clicked() // 页面切换实现 void P00_PublicPage::on_But_Page_0_clicked(){ ChangePage( 0, 1, "P01");} void P00_PublicPage::on_But_Page_1_clicked(){ ChangePage( 1, 2, "P02");} -void P00_PublicPage::on_But_Page_2_clicked(){ ChangePage( 2, 301, "P301");} -void P00_PublicPage::on_But_Page_3_clicked(){ ChangePage( 3, 401, "P401");} -void P00_PublicPage::on_But_Page_4_clicked(){ ChangePage( 4, 501, "P501");} -void P00_PublicPage::on_But_Page_5_clicked(){ ChangePage( 5, 601, "P601");} +void P00_PublicPage::on_But_Page_2_clicked(){ ChangePage( 2, 301, "P03");} +void P00_PublicPage::on_But_Page_3_clicked(){ ChangePage( 3, 401, "P04");} +void P00_PublicPage::on_But_Page_4_clicked(){ ChangePage( 4, 501, "P05");} +void P00_PublicPage::on_But_Page_5_clicked(){ ChangePage( 5, 601, "P06");} void P00_PublicPage::on_But_Page_6_clicked(){ ChangePage( 6, 7, "P07");} void P00_PublicPage::on_But_Page_7_clicked(){ ChangePage( 7, 8, "P08");} void P00_PublicPage::on_But_Page_8_clicked(){ ChangePage( 8, 9, "P09");} @@ -301,9 +317,11 @@ void P00_PublicPage::on_But_Page_14_clicked(){ ChangePage(14, 15, "P15");} void P00_PublicPage::on_But_Page_15_clicked(){ ChangePage(15, 16, "P16");} void P00_PublicPage::ChangePage(uint16_t PageIndex,uint16_t PageNum,QString PageName){ smoothScrollTo(PageIndex); - m_opcManager->writeNodeValue("ns=6;s=::AsGlobalPV:PageContol.CurrentPage", PageNum,5,100); + m_opcManager->writeNodeValue("PageContol.CurrentPage", PageNum,5,100); gPageIndexStr = PageName; - + if(PageNum != 12){ + ui->But_Page_11->setText(gPageName[gPageIndexStr12]); + } } /* 1. 读写属性 */ QRect P00_PublicPage::voiceGeometry() const diff --git a/Pages/P01_MianPage.cpp b/Pages/P01_MianPage.cpp index 7a84d6e..3b24669 100644 --- a/Pages/P01_MianPage.cpp +++ b/Pages/P01_MianPage.cpp @@ -283,31 +283,31 @@ void P01_MianPage::UIRefreshTimeOut() return; uint32_t TmpBools[10]; - TmpBools[0] = gOPC_NodeValue["ns=6;s=::AsGlobalPV:PageBOOLS.B0"] .toUInt(); - TmpBools[1] = gOPC_NodeValue["ns=6;s=::AsGlobalPV:PageBOOLS.B1"] .toUInt(); - TmpBools[2] = gOPC_NodeValue["ns=6;s=::AsGlobalPV:PageBOOLS.B2"] .toUInt(); - TmpBools[3] = gOPC_NodeValue["ns=6;s=::AsGlobalPV:PageBOOLS.B3"] .toUInt(); - TmpBools[4] = gOPC_NodeValue["ns=6;s=::AsGlobalPV:PageBOOLS.B4"] .toUInt(); - TmpBools[5] = gOPC_NodeValue["ns=6;s=::AsGlobalPV:PageBOOLS.B5"] .toUInt(); - TmpBools[6] = gOPC_NodeValue["ns=6;s=::AsGlobalPV:PageBOOLS.B6"] .toUInt(); - TmpBools[7] = gOPC_NodeValue["ns=6;s=::AsGlobalPV:PageBOOLS.B7"] .toUInt(); - TmpBools[8] = gOPC_NodeValue["ns=6;s=::AsGlobalPV:PageBOOLS.B8"] .toUInt(); - TmpBools[9] = gOPC_NodeValue["ns=6;s=::AsGlobalPV:PageBOOLS.B9"] .toUInt(); + TmpBools[0] = getNodeValue("PageBOOLS.B0") .toUInt(); + TmpBools[1] = getNodeValue("PageBOOLS.B1") .toUInt(); + TmpBools[2] = getNodeValue("PageBOOLS.B2") .toUInt(); + TmpBools[3] = getNodeValue("PageBOOLS.B3") .toUInt(); + TmpBools[4] = getNodeValue("PageBOOLS.B4") .toUInt(); + TmpBools[5] = getNodeValue("PageBOOLS.B5") .toUInt(); + TmpBools[6] = getNodeValue("PageBOOLS.B6") .toUInt(); + TmpBools[7] = getNodeValue("PageBOOLS.B7") .toUInt(); + TmpBools[8] = getNodeValue("PageBOOLS.B8") .toUInt(); + TmpBools[9] = getNodeValue("PageBOOLS.B9") .toUInt(); //杂进度条显示 QStringList LevelCor = {"rgb(255, 0, 0)","rgb(255, 0, 0)","rgb(0, 255, 0)","rgb(0, 255, 255)"}; - ProgressBar_LCD(ui->PB_SpareTemp,ui->LCD_SpareTemp,"ns=6;s=::AsGlobalPV:PB_SpareTemp.PageGroup","ns=6;s=::AsGlobalPV:IN_Sersor.SpareTemp",glMotorTempColor); - ProgressBar_LCD(ui->PB_OilLevel,ui->LCD_OilLevel,"ns=6;s=::AsGlobalPV:PB_OilLevel.PageGroup","ns=6;s=::AsGlobalPV:IN_Sersor.OilLevel",LevelCor); - ProgressBar_LCD(ui->PB_OilTemp,ui->LCD_OilTemp,"ns=6;s=::AsGlobalPV:PB_OilTemp.PageGroup","ns=6;s=::AsGlobalPV:IN_Sersor.OilTemp",glMotorTempColor); + ProgressBar_LCD(ui->PB_SpareTemp,ui->LCD_SpareTemp,"PB_SpareTemp.PageGroup","IN_Sersor.SpareTemp",glMotorTempColor); + ProgressBar_LCD(ui->PB_OilLevel,ui->LCD_OilLevel,"PB_OilLevel.PageGroup","IN_Sersor.OilLevel",LevelCor); + ProgressBar_LCD(ui->PB_OilTemp,ui->LCD_OilTemp,"PB_OilTemp.PageGroup","IN_Sersor.OilTemp",glMotorTempColor); QStringList NullColor = {"rgb(0, 255, 255)","rgb(0, 255, 255)","rgb(0, 255, 255)","rgb(0, 255, 255)"}; - ProgressBar_LCD(ui->PB_PressurePump_1,ui->LCD_PressurePump_1,"ns=6;s=::AsGlobalPV:PB_PressurePump1.PageGroup","ns=6;s=::AsGlobalPV:IN_Sersor.Pressure_Pump1",NullColor); - ProgressBar_LCD(ui->PB_PressurePump_2,ui->LCD_PressurePump_2,"ns=6;s=::AsGlobalPV:PB_PressurePump2.PageGroup","ns=6;s=::AsGlobalPV:IN_Sersor.Pressure_Pump2",NullColor); - ProgressBar_LCD(ui->PB_PressurePump_3,ui->LCD_PressurePump_3,"ns=6;s=::AsGlobalPV:PB_PressurePump3.PageGroup","ns=6;s=::AsGlobalPV:IN_Sersor.Pressure_Pump3",NullColor); + ProgressBar_LCD(ui->PB_PressurePump_1,ui->LCD_PressurePump_1,"PB_PressurePump1.PageGroup","IN_Sersor.Pressure_Pump1",NullColor); + ProgressBar_LCD(ui->PB_PressurePump_2,ui->LCD_PressurePump_2,"PB_PressurePump2.PageGroup","IN_Sersor.Pressure_Pump2",NullColor); + ProgressBar_LCD(ui->PB_PressurePump_3,ui->LCD_PressurePump_3,"PB_PressurePump3.PageGroup","IN_Sersor.Pressure_Pump3",NullColor); // 编码器数值显示 - ui->LCD_EncoderL->display(QString::number(gOPC_NodeValue["ns=6;s=::AsGlobalPV:IN_Encoder.EncoderL"] .toUInt())); - ui->LCD_EncoderR->display(QString::number(gOPC_NodeValue["ns=6;s=::AsGlobalPV:IN_Encoder.EncoderR"] .toUInt())); + ui->LCD_EncoderL->display(QString::number(getNodeValue("IN_Encoder.EncoderL") .toUInt())); + ui->LCD_EncoderR->display(QString::number(getNodeValue("IN_Encoder.EncoderR") .toUInt())); // 急停的显示 for (uint8_t i=0;i<12;i++) { QString TextObjName = QString("Led_EStop_%1").arg(i); @@ -377,17 +377,17 @@ void P01_MianPage::UIRefreshTimeOut() } void P01_MianPage::ProgressBar_LCD(QProgressBar *QPB,QLCDNumber *QLCD,QString NodeID_Bar,QString NodeID_Value,QStringList Colors){ - uint32_t PB_Group1 = gOPC_NodeValue[NodeID_Bar] .toUInt(); - float Value = gOPC_NodeValue[NodeID_Value] .toFloat(); + uint32_t PB_Group1 = getNodeValue(NodeID_Bar) .toUInt(); + float Value = getNodeValue(NodeID_Value) .toFloat(); uint16_t PValue= static_cast(PB_Group1 >> 16); // 高 16 位 uint16_t PColor = static_cast(PB_Group1 & 0xFFFF);// 低 16 位 SetProgressBar(QPB,PValue,PColor,Colors); QLCD->display(QString::number(Value,'f',2)); } void P01_MianPage::PB_Refresh(QString Dev){ - uint32_t PB_Group1 = gOPC_NodeValue["ns=6;s=::AsGlobalPV:PB_Curr_"+Dev+".PageGroup1"] .toUInt(); - uint32_t PB_Group2 = gOPC_NodeValue["ns=6;s=::AsGlobalPV:PB_Curr_"+Dev+".PageGroup2"] .toUInt(); - uint32_t PB_MotorTemp = gOPC_NodeValue["ns=6;s=::AsGlobalPV:PB_Temp_"+Dev+".PageGroup"] .toUInt(); + uint32_t PB_Group1 = getNodeValue("PB_Curr_"+Dev+".PageGroup1") .toUInt(); + uint32_t PB_Group2 = getNodeValue("PB_Curr_"+Dev+".PageGroup2") .toUInt(); + uint32_t PB_MotorTemp = getNodeValue("PB_Temp_"+Dev+".PageGroup") .toUInt(); uint16_t PercentageCurU = static_cast(PB_Group1 >> 16); // 高 16 位 uint16_t PercentageCurV = static_cast(PB_Group1 & 0xFFFF);// 低 16 位 @@ -401,19 +401,19 @@ void P01_MianPage::PB_Refresh(QString Dev){ uint16_t PercentageMotorTemp = static_cast(PB_MotorTemp >> 16); // 高 16 位 uint16_t ColorTemp = static_cast(PB_MotorTemp & 0xFFFF);// 低 16 位 - qreal CurrU = gOPC_NodeValue["ns=6;s=::AsGlobalPV:IN_Phase"+Dev+".Filtered30_U"] .toReal(); - qreal CurrV = gOPC_NodeValue["ns=6;s=::AsGlobalPV:IN_Phase"+Dev+".Filtered30_V"] .toReal(); - qreal CurrW = gOPC_NodeValue["ns=6;s=::AsGlobalPV:IN_Phase"+Dev+".Filtered30_W"] .toReal(); - qreal Temp = gOPC_NodeValue["ns=6;s=::AsGlobalPV:IN_Phase"+Dev+".Filtered_Temp"] .toReal(); + qreal CurrU = getNodeValue("IN_Phase"+Dev+".Filtered30_U") .toReal(); + qreal CurrV = getNodeValue("IN_Phase"+Dev+".Filtered30_V") .toReal(); + qreal CurrW = getNodeValue("IN_Phase"+Dev+".Filtered30_W") .toReal(); + qreal Temp = getNodeValue("IN_Phase"+Dev+".Filtered_Temp") .toReal(); qreal Curr = fmax(CurrU,fmax(CurrV,CurrW)); qreal Rated; if (Dev == "LoaderL" || Dev == "LoaderR" ) - Rated = gOPC_NodeValue["ns=6;s=::AsGlobalPV:PS.gRatedCur_Loader"] .toReal(); + Rated = getNodeValue("PS.gRatedCur_Loader") .toReal(); else if(Dev == "TransportL" || Dev == "TransportR" ) - Rated = gOPC_NodeValue["ns=6;s=::AsGlobalPV:PS.gRatedCur_Transport"] .toReal(); + Rated = getNodeValue("PS.gRatedCur_Transport") .toReal(); else{ - Rated = gOPC_NodeValue["ns=6;s=::AsGlobalPV:PS.gRatedCur_"+Dev] .toReal(); + Rated = getNodeValue("PS.gRatedCur_"+Dev) .toReal(); } @@ -457,14 +457,14 @@ void P01_MianPage::TrailRefreshTimeOut(){ if(gPageIndexStr != "P01") return; // 画板的显示 - uint32_t Diameter = gOPC_NodeValue["ns=6;s=::AsGlobalPV:RollerPosition.Diameter"] .toUInt(); - uint32_t LengthHeight = gOPC_NodeValue["ns=6;s=::AsGlobalPV:RollerPosition.LengthHeight"] .toUInt(); - uint32_t SideView = gOPC_NodeValue["ns=6;s=::AsGlobalPV:RollerPosition.SideView"] .toUInt(); - uint32_t FaceView = gOPC_NodeValue["ns=6;s=::AsGlobalPV:RollerPosition.FaceView"] .toUInt(); + uint32_t Diameter = getNodeValue("RollerPosition.Diameter") .toUInt(); + uint32_t LengthHeight = getNodeValue("RollerPosition.LengthHeight") .toUInt(); + uint32_t SideView = getNodeValue("RollerPosition.SideView") .toUInt(); + uint32_t FaceView = getNodeValue("RollerPosition.FaceView") .toUInt(); - uint32_t TransPos = gOPC_NodeValue["ns=6;s=::AsGlobalPV:RollerPosition.TransportPos"] .toUInt(); - uint32_t TmpHaul = gOPC_NodeValue["ns=6;s=::AsGlobalPV:RollerPosition.ShowHaulSpeed"] .toUInt(); - float CenterHeight = gOPC_NodeValue["ns=6;s=::AsGlobalPV:RollerPosition.CenterHeight"] .toFloat(); + uint32_t TransPos = getNodeValue("RollerPosition.TransportPos") .toUInt(); + uint32_t TmpHaul = getNodeValue("RollerPosition.ShowHaulSpeed") .toUInt(); + float CenterHeight = getNodeValue("RollerPosition.CenterHeight") .toFloat(); int16_t Roller_SideX = static_cast(SideView >> 16); // 高 16 位 int16_t Roller_SideY = static_cast(SideView & 0xFFFF);// 低 16 位 diff --git a/Pages/P02_ShieldPage.cpp b/Pages/P02_ShieldPage.cpp index 82775bb..3f4d4c1 100644 --- a/Pages/P02_ShieldPage.cpp +++ b/Pages/P02_ShieldPage.cpp @@ -59,11 +59,11 @@ void SetStyleStr(QLabel *L,bool Status,QString TStr,QString FStr){ void P02_ShieldPage::UIRefreshTimeOut(){ if(gPageIndexStr != "P02") return; - Status1 = gOPC_NodeValue["ns=6;s=::AsGlobalPV:But_Shield.DataStatus1"] .toUInt(); - Status2 = gOPC_NodeValue["ns=6;s=::AsGlobalPV:But_Shield.DataStatus2"] .toUInt(); - Shield1 = gOPC_NodeValue["ns=6;s=::AsGlobalPV:But_Shield.isShield1"] .toUInt(); - Shield2 = gOPC_NodeValue["ns=6;s=::AsGlobalPV:But_Shield.isShield2"] .toUInt(); - uint32_t TmpBool = gOPC_NodeValue["ns=6;s=::AsGlobalPV:PageBOOLS.B0"] .toUInt(); + Status1 = getNodeValue("But_Shield.DataStatus1") .toUInt(); + Status2 = getNodeValue("But_Shield.DataStatus2") .toUInt(); + Shield1 = getNodeValue("But_Shield.isShield1") .toUInt(); + Shield2 = getNodeValue("But_Shield.isShield2") .toUInt(); + uint32_t TmpBool = getNodeValue("PageBOOLS.B0") .toUInt(); // 急停的显示 for (uint8_t i=0;i<12;i++) { @@ -79,7 +79,6 @@ void P02_ShieldPage::UIRefreshTimeOut(){ SetStyleStr(ui->Status_QESR_1,getBitOf32Data(TmpBool, 14,false),"border-image: url(:/Icos/Icos/LED2_Green.png);","border-image: url(:/Icos/Icos/LED3_Rad (2).png);"); SetStyleStr(ui->Status_QESR_2,getBitOf32Data(TmpBool, 15,false),"border-image: url(:/Icos/Icos/LED2_Green.png);","border-image: url(:/Icos/Icos/LED3_Rad (2).png);"); - for (int i = 0; i < 32; ++i) { QString TextObjName = QString("TxtStatus_Shield_%1").arg(i); QLabel* Label = findChild(TextObjName); @@ -93,6 +92,19 @@ void P02_ShieldPage::UIRefreshTimeOut(){ Label->setStyleSheet(StyleStr); } } + for (int i = 0; i < 32; ++i) { + QString TextObjName = QString("TxtStatus_Shield_%1").arg(i+32); + QLabel* Label = findChild(TextObjName); + if (Label) { + QString StyleStr = "border-image: url(:/Frames/null.png);\n"; + if(getBitOf32Data(Status2, i,false)){ + StyleStr = StyleStr + TrueColor[i+32]+"\n"; + }else{ + StyleStr = StyleStr + FalseColor[i+32]+"\n"; + } + Label->setStyleSheet(StyleStr); + } + } if(isRefreshBut){ for (int i = 0; i < 32; ++i) { @@ -118,28 +130,14 @@ void P02_ShieldPage::UIRefreshTimeOut(){ if (checkBox) { if(getBitOf32Data(Shield2, i,false)){ checkBox->setChecked(true); - checkBox->setText(ShieldText[i]+32); + checkBox->setText(ShieldText[i+32]); }else{ checkBox->setChecked(false); - checkBox->setText(unShieldText[i]+32); + checkBox->setText(unShieldText[i+32]); } } } } - for (int i = 0; i < 32; ++i) { - QString TextObjName = QString("TxtStatus_Shield_%1").arg(i+32); - QLabel* Label = findChild(TextObjName); - if (Label) { - QString StyleStr = "border-image: url(:/Frames/null.png);\n"; - if(getBitOf32Data(Status1, i,false)){ - StyleStr = StyleStr + TrueColor[i+32]+"\n"; - }else{ - StyleStr = StyleStr + FalseColor[i+32]+"\n"; - } - Label->setStyleSheet(StyleStr); - } - - } } void P02_ShieldPage::WriteShield( uint8_t var,uint8_t Index,bool Checked){ isRefreshBut = false; @@ -152,7 +150,7 @@ void P02_ShieldPage::WriteShield( uint8_t var,uint8_t Index,bool Checked){ } int8_t Count = 0; if(var <2 && Index<32){ - QString NodeId = "ns=6;s=::AsGlobalPV:But_Shield.isShield"+QString::number(var+1); + QString NodeId = "But_Shield.isShield"+QString::number(var+1); bool isOK = false; if(var == 0) { writeBitOf32Data(Shield1,Index,Checked); diff --git a/Pages/P08_AlarmPage.cpp b/Pages/P08_AlarmPage.cpp index 9a0d220..cf8fecd 100644 --- a/Pages/P08_AlarmPage.cpp +++ b/Pages/P08_AlarmPage.cpp @@ -75,7 +75,7 @@ void P08_AlarmPage::WinInit() void P08_AlarmPage::UIRefreshTimeOut() { - uint16_t NewAlarmCode = gOPC_NodeValue["ns=6;s=::AsGlobalPV:AlarmCode.New"].toUInt(); + uint16_t NewAlarmCode = getNodeValue("AlarmCode.New").toUInt(); if (NewAlarmCode == m_oldAlarmCode) return; m_oldAlarmCode = NewAlarmCode; diff --git a/Pages/P09_RemotePage.cpp b/Pages/P09_RemotePage.cpp index 6f3260e..a96de12 100644 --- a/Pages/P09_RemotePage.cpp +++ b/Pages/P09_RemotePage.cpp @@ -26,9 +26,9 @@ void P09_RemotePage::WinInit() UIRefresh_Timer->start(); } qreal readCurrent(QString Dev){ - qreal CurrU = gOPC_NodeValue["ns=6;s=::AsGlobalPV:IN_Phase"+Dev+".Filtered30_U"] .toReal(); - qreal CurrV = gOPC_NodeValue["ns=6;s=::AsGlobalPV:IN_Phase"+Dev+".Filtered30_V"] .toReal(); - qreal CurrW = gOPC_NodeValue["ns=6;s=::AsGlobalPV:IN_Phase"+Dev+".Filtered30_W"] .toReal(); + qreal CurrU = getNodeValue("IN_Phase"+Dev+".Filtered30_U") .toReal(); + qreal CurrV = getNodeValue("IN_Phase"+Dev+".Filtered30_V") .toReal(); + qreal CurrW = getNodeValue("IN_Phase"+Dev+".Filtered30_W") .toReal(); return fmax(CurrU,fmax(CurrV,CurrW)); } void P09_RemotePage::SetStyle2(QLabel *Label,QStringList List,bool b1,bool b2,bool isNull){ @@ -46,10 +46,10 @@ void P09_RemotePage::UIRefreshTimeOut() if(gPageIndexStr != "P09") return; QString StyleSheetSet; - uint32_t DK1 = gOPC_NodeValue["ns=6;s=::AsGlobalPV:PageContol.RemoteDKey1"] .toUInt(); - uint32_t DK2 = gOPC_NodeValue["ns=6;s=::AsGlobalPV:PageContol.RemoteDKey2"] .toUInt(); - uint32_t AK1 = gOPC_NodeValue["ns=6;s=::AsGlobalPV:PageContol.RemoteAKey1"] .toUInt(); - uint32_t AK2 = gOPC_NodeValue["ns=6;s=::AsGlobalPV:PageContol.RemoteAKey2"] .toUInt(); + uint32_t DK1 = getNodeValue("PageContol.RemoteDKey1") .toUInt(); + uint32_t DK2 = getNodeValue("PageContol.RemoteDKey2") .toUInt(); + uint32_t AK1 = getNodeValue("PageContol.RemoteAKey1") .toUInt(); + uint32_t AK2 = getNodeValue("PageContol.RemoteAKey2") .toUInt(); // 牵引速度 ui->Slider_Haul_L->setValue(extractUInt32_8BitPart(AK1,0)); diff --git a/Pages/P11_IsolationPage.cpp b/Pages/P11_IsolationPage.cpp index e39464a..5cb53bb 100644 --- a/Pages/P11_IsolationPage.cpp +++ b/Pages/P11_IsolationPage.cpp @@ -36,7 +36,7 @@ void P11_IsolationPage::SetStyleStr(QLabel *L,bool Status,QString TStr,QString F L->setStyleSheet(Style); } void P11_IsolationPage::Refresh(const QString Dev,const uint8_t DevIndex,const uint32_t Status,const uint8_t Q_Index,const uint8_t I_Index,const uint8_t G_Index){ - uint32_t TmpValue = gOPC_NodeValue["ns=6;s=::AsGlobalPV:HMI_LC_"+Dev] .toUInt(); + uint32_t TmpValue = getNodeValue("HMI_LC_"+Dev) .toUInt(); uint16_t ET = static_cast(TmpValue >> 16); // 漏电检测消耗的时间(高16位) uint16_t WaitET = static_cast(TmpValue & 0xFFFF);// 漏电检测等待的时间(低16位) @@ -63,7 +63,7 @@ void P11_IsolationPage::UIRefreshTimeOut() { if(gPageIndexStr != "P11") return; - uint32_t Status = gOPC_NodeValue["ns=6;s=::AsGlobalPV:HMI_LC_Status"] .toUInt(); + uint32_t Status = getNodeValue("HMI_LC_Status") .toUInt(); qDebug()< #include #include - +#include +#include +#include class ReadOnlyItem : public QTableWidgetItem { public: @@ -30,13 +32,36 @@ P12_NetworkPage::~P12_NetworkPage() void P12_NetworkPage::WinInit() { ui->MainWidget->setCurrentIndex(0); - mCsvConfig[0].FileName = ConfigurationPath + "画面配置/UI_IO扩展页面1_配置.csv"; - mCsvConfig[1].FileName = ConfigurationPath + "画面配置/UI_IO扩展页面2_配置.csv"; - mCsvConfig[2].FileName = ConfigurationPath + "画面配置/UI_IO扩展页面3_配置.csv"; - gPageIndexStr12 = "P12.00"; - TableViewInit(ui->TableWidget_PLC_1,&mCsvConfig[0]); - TableViewInit(ui->TableWidget_PLC_2,&mCsvConfig[1]); - TableViewInit(ui->TableWidget_PLC_3,&mCsvConfig[2]); + gPageIndexStr12 = "P12.0"; + for (uint8_t i=0;i<9;i++) { + QString FileName = QString("画面配置/UI_IO扩展页面%1_配置.csv").arg(i+1); + QString TableWidgetObjName = QString("TableWidget_PLC_%1").arg(i+1); + mCsvConfig[i].FileName = ConfigurationPath + FileName; + QFileInfo checkFile(mCsvConfig[i].FileName); + if (checkFile.exists() && checkFile.isFile()) { + QTableWidget* TableWidget = findChild(TableWidgetObjName); + if(TableWidget) + TableViewInit(TableWidget,&mCsvConfig[i]); + } + //gPageName["P12.0"]) + QPushButton* Button = findChild(QString("But_Network_%1").arg(i)); + if(Button){ + Button->setText(gPageName["P12."+QString::number(i)]); + } + } +// mCsvConfig[0].FileName = ConfigurationPath + "画面配置/UI_IO扩展页面1_配置.csv"; +// mCsvConfig[1].FileName = ConfigurationPath + "画面配置/UI_IO扩展页面2_配置.csv"; +// mCsvConfig[2].FileName = ConfigurationPath + "画面配置/UI_IO扩展页面3_配置.csv"; +// mCsvConfig[3].FileName = ConfigurationPath + "画面配置/UI_IO扩展页面4_配置.csv"; +// mCsvConfig[4].FileName = ConfigurationPath + "画面配置/UI_IO扩展页面5_配置.csv"; +// mCsvConfig[5].FileName = ConfigurationPath + "画面配置/UI_IO扩展页面6_配置.csv"; +// mCsvConfig[6].FileName = ConfigurationPath + "画面配置/UI_IO扩展页面7_配置.csv"; +// mCsvConfig[7].FileName = ConfigurationPath + "画面配置/UI_IO扩展页面8_配置.csv"; +// mCsvConfig[8].FileName = ConfigurationPath + "画面配置/UI_IO扩展页面9_配置.csv"; + +// TableViewInit(ui->TableWidget_PLC_1,&mCsvConfig[0]); +// TableViewInit(ui->TableWidget_PLC_2,&mCsvConfig[1]); +// TableViewInit(ui->TableWidget_PLC_3,&mCsvConfig[2]); //所用定时器初始化 QTimer* UIRefresh_Timer = new QTimer(this); @@ -87,8 +112,8 @@ void P12_NetworkPage::TableViewInit( QTableWidget *tw,tsCsvConfigText *CCT){ tw->setItem(i,8,new ReadOnlyItem(CCT->PinName[i+32])); tw->setItem(i,9,new ReadOnlyItem(CCT->ShowText[i+32])); - tw->setItem(i,12,new ReadOnlyItem(CCT->PinName[i+32])); - tw->setItem(i,13,new ReadOnlyItem(CCT->ShowText[i+32])); + tw->setItem(i,12,new ReadOnlyItem(CCT->PinName[i+48])); + tw->setItem(i,13,new ReadOnlyItem(CCT->ShowText[i+48])); } } void P12_NetworkPage::TableViewDataUpdate( QTableWidget *tw,tsCsvConfigText *CCT){ @@ -96,26 +121,24 @@ void P12_NetworkPage::TableViewDataUpdate( QTableWidget *tw,tsCsvConfigText *CCT for (uint8_t j=0;j<4;j++) { uint8_t Index = i+j*16; if(CCT->Type[Index] == "数值"){ - tw->setItem(i,2+j*4,new ReadOnlyItem(variantToFormattedString(gOPC_NodeValue[CCT->DataNode[Index]],2))); + if(CCT->DataNode[Index] == "Q_OilCylindShorten.TrackR.OutPWM") + qDebug()<DataNode[Index])<DataNode[Index]), 2); + auto *item = new ReadOnlyItem(variantToFormattedString(getNodeValue(CCT->DataNode[Index]), 2)); + item->setForeground(QBrush(getColor(CCT->TColor[Index]))); + item->setTextAlignment(Qt::AlignHCenter | Qt::AlignVCenter); + tw->setItem(i, 2 + j * 4, item); }else if(CCT->Type[Index] != ""){ - QList NodeId = CCT->DataNode[Index].split("#"); - bool TmpBool = getBitOf32Data(gOPC_NodeValue[NodeId[0]].toUInt(),NodeId[1].toInt()); - tw->setItem(i,2+j*4,makeColorItem(CCT->Type[Index],TmpBool,CCT->FColor[Index],CCT->TColor[Index])); + if(CCT->DataNode[Index].contains("#")){ + QList NodeId = CCT->DataNode[Index].split("#"); + bool TmpBool = getBitOf32Data(getNodeValue(NodeId[0]).toUInt(),NodeId[1].toInt()); + tw->setItem(i,2+j*4,makeColorItem(CCT->Type[Index],TmpBool,CCT->FColor[Index],CCT->TColor[Index])); + } + } } } } -inline QColor parseCssColor(const QString &css) -{ - // 从 "color: rgb(r, g, b);" 或 "rgb(r, g, b)" 里抠出 r,g,b - static QRegularExpression re(R"(rgb\s*\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*\))"); - auto m = re.match(css); - if (m.hasMatch()) - return QColor(m.captured(1).toInt(), - m.captured(2).toInt(), - m.captured(3).toInt()); - return Qt::black; // 兜底 -} + inline QTableWidgetItem *P12_NetworkPage::makeColorItem(const QString &Type, const bool Color, const QString &Fcolor, @@ -124,8 +147,7 @@ inline QTableWidgetItem *P12_NetworkPage::makeColorItem(const QString &Type, { QColor c; QString text; - c = Color?parseCssColor(TFcolor):parseCssColor(Fcolor); - + c = Color?getColor(TFcolor):getColor(Fcolor); if(Type == "输入") text = "●"; else if(Type == "输出") @@ -167,25 +189,25 @@ void P12_NetworkPage::UIRefreshTimeOut() case 1:TableViewDataUpdate(ui->TableWidget_PLC_1,&mCsvConfig[0]);break; case 2:TableViewDataUpdate(ui->TableWidget_PLC_2,&mCsvConfig[1]);break; case 3:TableViewDataUpdate(ui->TableWidget_PLC_3,&mCsvConfig[2]);break; - case 4:UIRefresh_Page4();break; - case 5:UIRefresh_Page5();break; - case 6:UIRefresh_Page6();break; - case 7:UIRefresh_Page7();break; - case 8:UIRefresh_Page8();break; - case 9:UIRefresh_Page9();break; + case 4:TableViewDataUpdate(ui->TableWidget_PLC_4,&mCsvConfig[3]);break; + case 5:TableViewDataUpdate(ui->TableWidget_PLC_5,&mCsvConfig[4]);break; + case 6:TableViewDataUpdate(ui->TableWidget_PLC_6,&mCsvConfig[5]);break; + case 7:TableViewDataUpdate(ui->TableWidget_PLC_7,&mCsvConfig[6]);break; + case 8:TableViewDataUpdate(ui->TableWidget_PLC_8,&mCsvConfig[7]);break; +// case 9:TableViewDataUpdate(ui->TableWidget_PLC_9,&mCsvConfig[8]);break; } } -void P12_NetworkPage::on_But_Network_0_clicked(){ slideToIndex(0, "P12.00");} -void P12_NetworkPage::on_But_Network_1_clicked(){ slideToIndex(1, "P12.01");} -void P12_NetworkPage::on_But_Network_2_clicked(){ slideToIndex(2, "P12.02");} -void P12_NetworkPage::on_But_Network_3_clicked(){ slideToIndex(3, "P12.03");} -void P12_NetworkPage::on_But_Network_4_clicked(){ slideToIndex(4, "P12.04");} -void P12_NetworkPage::on_But_Network_5_clicked(){ slideToIndex(5, "P12.05");} -void P12_NetworkPage::on_But_Network_6_clicked(){ slideToIndex(6, "P12.06");} -void P12_NetworkPage::on_But_Network_7_clicked(){ slideToIndex(7, "P12.07");} -void P12_NetworkPage::on_But_Network_8_clicked(){ slideToIndex(8, "P12.08");} -void P12_NetworkPage::on_But_Network_9_clicked(){ slideToIndex(9, "P12.09");} +void P12_NetworkPage::on_But_Network_0_clicked(){ slideToIndex(0, "P12.0");} +void P12_NetworkPage::on_But_Network_1_clicked(){ slideToIndex(1, "P12.1");} +void P12_NetworkPage::on_But_Network_2_clicked(){ slideToIndex(2, "P12.2");} +void P12_NetworkPage::on_But_Network_3_clicked(){ slideToIndex(3, "P12.3");} +void P12_NetworkPage::on_But_Network_4_clicked(){ slideToIndex(4, "P12.4");} +void P12_NetworkPage::on_But_Network_5_clicked(){ slideToIndex(5, "P12.5");} +void P12_NetworkPage::on_But_Network_6_clicked(){ slideToIndex(6, "P12.6");} +void P12_NetworkPage::on_But_Network_7_clicked(){ slideToIndex(7, "P12.7");} +void P12_NetworkPage::on_But_Network_8_clicked(){ slideToIndex(8, "P12.8");} +void P12_NetworkPage::on_But_Network_9_clicked(){ slideToIndex(9, "P12.9");} void P12_NetworkPage::on_MainWidget_currentChanged(int arg1) diff --git a/Pages/P12_NetworkPage.ui b/Pages/P12_NetworkPage.ui index 8ee3c59..dcd4711 100644 --- a/Pages/P12_NetworkPage.ui +++ b/Pages/P12_NetworkPage.ui @@ -29,12 +29,16 @@ - border-image: url(:/Frames/null.png); + border-image: url(:/Frames/null.png); +color: #f3f4f6 - 0 + 1 + + font: 87 12pt "思源黑体 Heavy"; + @@ -45,10 +49,7 @@ - background-color: rgb(0, 127, 127); -border-image: url(:/Frames/null.png); -font: 87 12pt "思源黑体 Heavy"; -color: rgb(0, 255, 255); + background-color: #374151 地址:IF6.ST1.IF1 线号:331(H)-332(L) @@ -80,8 +81,7 @@ color: rgb(0, 255, 255); - background-color: rgb(0, 127, 127); -border-image: url(:/Frames/null.png); + background-color: #374151 @@ -97,8 +97,7 @@ border-image: url(:/Frames/null.png); - background-color: rgb(0, 127, 127); -border-image: url(:/Frames/null.png); + background-color: #374151 @@ -114,8 +113,7 @@ border-image: url(:/Frames/null.png); - background-color: rgb(0, 127, 127); -border-image: url(:/Frames/null.png); + background-color: #374151 @@ -131,8 +129,7 @@ border-image: url(:/Frames/null.png); - background-color: rgb(0, 127, 127); -border-image: url(:/Frames/null.png); + background-color: #374151 @@ -148,8 +145,7 @@ border-image: url(:/Frames/null.png); - background-color: rgb(0, 127, 127); -border-image: url(:/Frames/null.png); + background-color: #374151 @@ -165,8 +161,7 @@ border-image: url(:/Frames/null.png); - background-color: rgb(0, 127, 127); -border-image: url(:/Frames/null.png); + background-color: #374151 @@ -182,8 +177,7 @@ border-image: url(:/Frames/null.png); - background-color: rgb(0, 127, 127); -border-image: url(:/Frames/null.png); + background-color: #374151 @@ -199,10 +193,7 @@ border-image: url(:/Frames/null.png); - background-color: rgb(0, 127, 127); -border-image: url(:/Frames/null.png); -font: 87 12pt "思源黑体 Heavy"; -color: rgb(0, 255, 255); + background-color: #374151 地址:IF6.ST1.IF2 线号:341(H)-342(L) @@ -218,10 +209,7 @@ color: rgb(0, 255, 255); - background-color: rgb(0, 127, 127); -border-image: url(:/Frames/null.png); -font: 87 12pt "思源黑体 Heavy"; -color: rgb(0, 255, 255); + background-color: #374151 地址:IF6.ST1.IF3 线号:351(H)-353(L) @@ -245,7 +233,6 @@ color: rgb(0, 255, 255); border-image: url(:/Imgs/Imgs/Offline.png); font: 87 8pt "思源黑体 Heavy"; -color: rgb(0, 255, 255); background-color: transparent; @@ -311,7 +298,6 @@ background-color: transparent; border-image: url(:/Imgs/Imgs/Offline.png); font: 87 8pt "思源黑体 Heavy"; -color: rgb(0, 255, 255); background-color: transparent; @@ -361,7 +347,6 @@ background-color: transparent; border-image: url(:/Imgs/Imgs/Offline.png); font: 87 8pt "思源黑体 Heavy"; -color: rgb(0, 255, 255); background-color: transparent; @@ -411,7 +396,6 @@ background-color: transparent; border-image: url(:/Imgs/Imgs/Offline.png); font: 87 8pt "思源黑体 Heavy"; -color: rgb(0, 255, 255); background-color: transparent; @@ -461,7 +445,6 @@ background-color: transparent; border-image: url(:/Imgs/Imgs/Offline.png); font: 87 8pt "思源黑体 Heavy"; -color: rgb(0, 255, 255); background-color: transparent; @@ -511,7 +494,6 @@ background-color: transparent; border-image: url(:/Imgs/Imgs/Offline.png); font: 87 8pt "思源黑体 Heavy"; -color: rgb(0, 255, 255); background-color: transparent; @@ -561,7 +543,6 @@ background-color: transparent; border-image: url(:/Imgs/Imgs/Offline.png); font: 87 8pt "思源黑体 Heavy"; -color: rgb(0, 255, 255); background-color: transparent; @@ -611,7 +592,6 @@ background-color: transparent; border-image: url(:/Imgs/Imgs/Offline.png); font: 87 8pt "思源黑体 Heavy"; -color: rgb(0, 255, 255); background-color: transparent; @@ -661,7 +641,6 @@ background-color: transparent; border-image: url(:/Imgs/Imgs/Offline.png); font: 87 8pt "思源黑体 Heavy"; -color: rgb(0, 255, 255); background-color: transparent; @@ -711,7 +690,6 @@ background-color: transparent; border-image: url(:/Imgs/Imgs/Offline.png); font: 87 8pt "思源黑体 Heavy"; -color: rgb(0, 255, 255); background-color: transparent; @@ -761,7 +739,6 @@ background-color: transparent; border-image: url(:/Imgs/Imgs/Offline.png); font: 87 8pt "思源黑体 Heavy"; -color: rgb(0, 255, 255); background-color: transparent; @@ -803,8 +780,7 @@ background-color: transparent; - background-color: rgb(0, 127, 127); -border-image: url(:/Frames/null.png); + background-color: #374151 @@ -820,8 +796,7 @@ border-image: url(:/Frames/null.png); - background-color: rgb(0, 127, 127); -border-image: url(:/Frames/null.png); + background-color: #374151 @@ -837,10 +812,7 @@ border-image: url(:/Frames/null.png); - background-color: rgb(0, 127, 127); -border-image: url(:/Frames/null.png); -font: 87 12pt "思源黑体 Heavy"; -color: rgb(0, 255, 255); + background-color: #374151 地址:IF6.ST1.IF3 线号:351(H)-353(L) @@ -856,8 +828,7 @@ color: rgb(0, 255, 255); - background-color: rgb(0, 127, 127); -border-image: url(:/Frames/null.png); + background-color: #374151 @@ -873,8 +844,7 @@ border-image: url(:/Frames/null.png); - background-color: rgb(0, 127, 127); -border-image: url(:/Frames/null.png); + background-color: #374151 @@ -898,7 +868,6 @@ border-image: url(:/Frames/null.png); border-image: url(:/Imgs/Imgs/Offline.png); font: 87 8pt "思源黑体 Heavy"; -color: rgb(0, 255, 255); background-color: transparent; @@ -948,7 +917,6 @@ background-color: transparent; border-image: url(:/Imgs/Imgs/Offline.png); font: 87 8pt "思源黑体 Heavy"; -color: rgb(0, 255, 255); background-color: transparent; @@ -990,10 +958,7 @@ background-color: transparent; - background-color: rgb(0, 127, 127); -border-image: url(:/Frames/null.png); -font: 87 12pt "思源黑体 Heavy"; -color: rgb(0, 255, 255); + background-color: #374151 地址:IF6.ST1.IF4 线号:485A-485B @@ -1009,8 +974,7 @@ color: rgb(0, 255, 255); - background-color: rgb(0, 127, 127); -border-image: url(:/Frames/null.png); + background-color: #374151 @@ -1026,8 +990,7 @@ border-image: url(:/Frames/null.png); - background-color: rgb(0, 127, 127); -border-image: url(:/Frames/null.png); + background-color: #374151 @@ -1043,10 +1006,7 @@ border-image: url(:/Frames/null.png); - background-color: rgb(0, 127, 127); -border-image: url(:/Frames/null.png); -font: 87 12pt "思源黑体 Heavy"; -color: rgb(0, 255, 255); + background-color: #374151 地址:IF7 线号:301(H)-302(L) @@ -1070,7 +1030,6 @@ color: rgb(0, 255, 255); border-image: url(:/Imgs/Imgs/Offline.png); font: 87 8pt "思源黑体 Heavy"; -color: rgb(0, 255, 255); background-color: transparent; @@ -1120,7 +1079,6 @@ background-color: transparent; border-image: url(:/Imgs/Imgs/Offline.png); font: 87 8pt "思源黑体 Heavy"; -color: rgb(0, 255, 255); background-color: transparent; @@ -1170,7 +1128,6 @@ background-color: transparent; border-image: url(:/Imgs/Imgs/Offline.png); font: 87 8pt "思源黑体 Heavy"; -color: rgb(0, 255, 255); background-color: transparent; @@ -1220,7 +1177,6 @@ background-color: transparent; border-image: url(:/Imgs/Imgs/Offline.png); font: 87 8pt "思源黑体 Heavy"; -color: rgb(0, 255, 255); background-color: transparent; @@ -1262,8 +1218,7 @@ background-color: transparent; - background-color: rgb(0, 127, 127); -border-image: url(:/Frames/null.png); + background-color: #374151 @@ -1279,8 +1234,7 @@ border-image: url(:/Frames/null.png); - background-color: rgb(0, 127, 127); -border-image: url(:/Frames/null.png); + background-color: #374151 @@ -1296,8 +1250,7 @@ border-image: url(:/Frames/null.png); - background-color: rgb(0, 127, 127); -border-image: url(:/Frames/null.png); + background-color: #374151 @@ -1313,8 +1266,7 @@ border-image: url(:/Frames/null.png); - background-color: rgb(0, 127, 127); -border-image: url(:/Frames/null.png); + background-color: #374151 @@ -1330,8 +1282,7 @@ border-image: url(:/Frames/null.png); - background-color: rgb(0, 127, 127); -border-image: url(:/Frames/null.png); + background-color: #374151 @@ -1355,7 +1306,6 @@ border-image: url(:/Frames/null.png); border-image: url(:/Imgs/Imgs/Offline.png); font: 87 8pt "思源黑体 Heavy"; -color: rgb(0, 255, 255); background-color: transparent; @@ -1421,7 +1371,6 @@ background-color: transparent; border-image: url(:/Imgs/Imgs/Offline.png); font: 87 8pt "思源黑体 Heavy"; -color: rgb(0, 255, 255); background-color: transparent; @@ -1487,7 +1436,6 @@ background-color: transparent; border-image: url(:/Imgs/Imgs/Offline.png); font: 87 8pt "思源黑体 Heavy"; -color: rgb(0, 255, 255); background-color: transparent; @@ -1553,7 +1501,6 @@ background-color: transparent; border-image: url(:/Imgs/Imgs/Offline.png); font: 87 8pt "思源黑体 Heavy"; -color: rgb(0, 255, 255); background-color: transparent; @@ -1619,7 +1566,6 @@ background-color: transparent; border-image: url(:/Imgs/Imgs/Offline.png); font: 87 8pt "思源黑体 Heavy"; -color: rgb(0, 255, 255); background-color: transparent; @@ -1661,10 +1607,7 @@ background-color: transparent; - background-color: rgb(0, 127, 127); -border-image: url(:/Frames/null.png); -font: 87 12pt "思源黑体 Heavy"; -color: rgb(0, 255, 255); + background-color: #374151 地址:网口 CAN @@ -1680,8 +1623,7 @@ color: rgb(0, 255, 255); - background-color: rgb(0, 127, 127); -border-image: url(:/Frames/null.png); + background-color: #374151 @@ -1697,8 +1639,7 @@ border-image: url(:/Frames/null.png); - background-color: rgb(0, 127, 127); -border-image: url(:/Frames/null.png); + background-color: #374151 @@ -1714,8 +1655,7 @@ border-image: url(:/Frames/null.png); - background-color: rgb(0, 127, 127); -border-image: url(:/Frames/null.png); + background-color: #374151 @@ -1731,10 +1671,7 @@ border-image: url(:/Frames/null.png); - background-color: rgb(0, 127, 127); -border-image: url(:/Frames/null.png); -font: 87 12pt "思源黑体 Heavy"; -color: rgb(0, 255, 255); + background-color: #374151 地址:网口 @@ -1750,8 +1687,7 @@ color: rgb(0, 255, 255); - background-color: rgb(0, 127, 127); -border-image: url(:/Frames/null.png); + background-color: #374151 @@ -1767,8 +1703,7 @@ border-image: url(:/Frames/null.png); - background-color: rgb(0, 127, 127); -border-image: url(:/Frames/null.png); + background-color: #374151 @@ -1784,8 +1719,7 @@ border-image: url(:/Frames/null.png); - background-color: rgb(0, 127, 127); -border-image: url(:/Frames/null.png); + background-color: #374151 @@ -1801,8 +1735,7 @@ border-image: url(:/Frames/null.png); - background-color: rgb(0, 127, 127); -border-image: url(:/Frames/null.png); + background-color: #374151 @@ -1826,7 +1759,6 @@ border-image: url(:/Frames/null.png); border-image: url(:/Imgs/Imgs/Offline.png); font: 87 8pt "思源黑体 Heavy"; -color: rgb(0, 255, 255); background-color: transparent; @@ -1892,7 +1824,6 @@ background-color: transparent; border-image: url(:/Imgs/Imgs/Offline.png); font: 87 8pt "思源黑体 Heavy"; -color: rgb(0, 255, 255); background-color: transparent; @@ -1950,8 +1881,7 @@ background-color: transparent; - background-color: rgb(0, 127, 127); -border-image: url(:/Frames/null.png); + background-color: #374151 @@ -1975,7 +1905,6 @@ border-image: url(:/Frames/null.png); border-image: url(:/Imgs/Imgs/Offline.png); font: 87 8pt "思源黑体 Heavy"; -color: rgb(0, 255, 255); background-color: transparent; @@ -2033,8 +1962,7 @@ background-color: transparent; - background-color: rgb(0, 127, 127); -border-image: url(:/Frames/null.png); + background-color: #374151 @@ -2050,8 +1978,7 @@ border-image: url(:/Frames/null.png); - background-color: rgb(0, 127, 127); -border-image: url(:/Frames/null.png); + background-color: #374151 @@ -2075,7 +2002,6 @@ border-image: url(:/Frames/null.png); border-image: url(:/Imgs/Imgs/Offline.png); font: 87 8pt "思源黑体 Heavy"; -color: rgb(0, 255, 255); background-color: transparent; @@ -2133,8 +2059,7 @@ background-color: transparent; - background-color: rgb(0, 127, 127); -border-image: url(:/Frames/null.png); + background-color: #374151 @@ -2158,7 +2083,6 @@ border-image: url(:/Frames/null.png); border-image: url(:/Imgs/Imgs/Offline.png); font: 87 8pt "思源黑体 Heavy"; -color: rgb(0, 255, 255); background-color: transparent; @@ -2224,7 +2148,6 @@ background-color: transparent; border-image: url(:/Imgs/Imgs/Offline.png); font: 87 8pt "思源黑体 Heavy"; -color: rgb(0, 255, 255); background-color: transparent; @@ -2282,8 +2205,7 @@ background-color: transparent; - background-color: rgb(0, 127, 127); -border-image: url(:/Frames/null.png); + background-color: #374151 @@ -2307,7 +2229,6 @@ border-image: url(:/Frames/null.png); border-image: url(:/Imgs/Imgs/Offline.png); font: 87 8pt "思源黑体 Heavy"; -color: rgb(0, 255, 255); background-color: transparent; @@ -2365,8 +2286,7 @@ background-color: transparent; - background-color: rgb(0, 127, 127); -border-image: url(:/Frames/null.png); + background-color: #374151 @@ -2382,8 +2302,7 @@ border-image: url(:/Frames/null.png); - background-color: rgb(0, 127, 127); -border-image: url(:/Frames/null.png); + background-color: #374151 @@ -2407,7 +2326,6 @@ border-image: url(:/Frames/null.png); border-image: url(:/Imgs/Imgs/Offline.png); font: 87 8pt "思源黑体 Heavy"; -color: rgb(0, 255, 255); background-color: transparent; @@ -2465,8 +2383,7 @@ background-color: transparent; - background-color: rgb(0, 127, 127); -border-image: url(:/Frames/null.png); + background-color: #374151 @@ -2490,7 +2407,6 @@ border-image: url(:/Frames/null.png); border-image: url(:/Imgs/Imgs/Offline.png); font: 87 8pt "思源黑体 Heavy"; -color: rgb(0, 255, 255); background-color: transparent; @@ -2556,7 +2472,6 @@ background-color: transparent; border-image: url(:/Imgs/Imgs/Offline.png); font: 87 8pt "思源黑体 Heavy"; -color: rgb(0, 255, 255); background-color: transparent; @@ -2614,8 +2529,7 @@ background-color: transparent; - background-color: rgb(0, 127, 127); -border-image: url(:/Frames/null.png); + background-color: #374151 @@ -2639,7 +2553,6 @@ border-image: url(:/Frames/null.png); border-image: url(:/Imgs/Imgs/Offline.png); font: 87 8pt "思源黑体 Heavy"; -color: rgb(0, 255, 255); background-color: transparent; @@ -2697,8 +2610,7 @@ background-color: transparent; - background-color: rgb(0, 127, 127); -border-image: url(:/Frames/null.png); + background-color: #374151 @@ -2714,8 +2626,7 @@ border-image: url(:/Frames/null.png); - background-color: rgb(0, 127, 127); -border-image: url(:/Frames/null.png); + background-color: #374151 @@ -2739,7 +2650,6 @@ border-image: url(:/Frames/null.png); border-image: url(:/Imgs/Imgs/Offline.png); font: 87 8pt "思源黑体 Heavy"; -color: rgb(0, 255, 255); background-color: transparent; @@ -2797,8 +2707,7 @@ background-color: transparent; - background-color: rgb(0, 127, 127); -border-image: url(:/Frames/null.png); + background-color: #374151 @@ -2822,7 +2731,6 @@ border-image: url(:/Frames/null.png); border-image: url(:/Imgs/Imgs/Offline.png); font: 87 8pt "思源黑体 Heavy"; -color: rgb(0, 255, 255); background-color: transparent; @@ -2888,7 +2796,6 @@ background-color: transparent; border-image: url(:/Imgs/Imgs/Offline.png); font: 87 8pt "思源黑体 Heavy"; -color: rgb(0, 255, 255); background-color: transparent; @@ -2946,8 +2853,7 @@ background-color: transparent; - background-color: rgb(0, 127, 127); -border-image: url(:/Frames/null.png); + background-color: #374151 @@ -2971,7 +2877,6 @@ border-image: url(:/Frames/null.png); border-image: url(:/Imgs/Imgs/Offline.png); font: 87 8pt "思源黑体 Heavy"; -color: rgb(0, 255, 255); background-color: transparent; @@ -3029,8 +2934,7 @@ background-color: transparent; - background-color: rgb(0, 127, 127); -border-image: url(:/Frames/null.png); + background-color: #374151 @@ -3046,8 +2950,7 @@ border-image: url(:/Frames/null.png); - background-color: rgb(0, 127, 127); -border-image: url(:/Frames/null.png); + background-color: #374151 @@ -3071,7 +2974,6 @@ border-image: url(:/Frames/null.png); border-image: url(:/Imgs/Imgs/Offline.png); font: 87 8pt "思源黑体 Heavy"; -color: rgb(0, 255, 255); background-color: transparent; @@ -3129,8 +3031,7 @@ background-color: transparent; - background-color: rgb(0, 127, 127); -border-image: url(:/Frames/null.png); + background-color: #374151 @@ -3146,8 +3047,7 @@ border-image: url(:/Frames/null.png); - background-color: rgb(0, 127, 127); -border-image: url(:/Frames/null.png); + background-color: #374151 @@ -3171,7 +3071,6 @@ border-image: url(:/Frames/null.png); border-image: url(:/Imgs/Imgs/Offline.png); font: 87 8pt "思源黑体 Heavy"; -color: rgb(0, 255, 255); background-color: transparent; @@ -3324,8 +3223,7 @@ background-color: transparent; /* ====== 2. 整个表格 ====== */ QTableWidget { border-image: url(:/Frames/Frames/49.png); - gridline-color: cyan; /* 网格线颜色 */ - color: cyan; /* 默认文字颜色 */ + gridline-color: #6b7280; /* 网格线颜色 */ outline: 0; /* 去掉选中虚线框 */ font: 87 10pt "思源黑体 Heavy"; } @@ -3385,11 +3283,131 @@ QTableWidget::item { - - - - - + + + + + 0 + 0 + 1024 + 521 + + + + /* ====== 2. 整个表格 ====== */ +QTableWidget { + border-image: url(:/Frames/Frames/49.png); + gridline-color: cyan; /* 网格线颜色 */ + color: cyan; /* 默认文字颜色 */ + outline: 0; /* 去掉选中虚线框 */ + font: 87 10pt "思源黑体 Heavy"; +} +QTableWidget::item { + text-align: center; + } + + + + + + + + 0 + 0 + 1024 + 521 + + + + /* ====== 2. 整个表格 ====== */ +QTableWidget { + border-image: url(:/Frames/Frames/49.png); + gridline-color: cyan; /* 网格线颜色 */ + color: cyan; /* 默认文字颜色 */ + outline: 0; /* 去掉选中虚线框 */ + font: 87 10pt "思源黑体 Heavy"; +} +QTableWidget::item { + text-align: center; + } + + + + + + + + 0 + 0 + 1024 + 521 + + + + /* ====== 2. 整个表格 ====== */ +QTableWidget { + border-image: url(:/Frames/Frames/49.png); + gridline-color: cyan; /* 网格线颜色 */ + color: cyan; /* 默认文字颜色 */ + outline: 0; /* 去掉选中虚线框 */ + font: 87 10pt "思源黑体 Heavy"; +} +QTableWidget::item { + text-align: center; + } + + + + + + + + 0 + 0 + 1024 + 521 + + + + /* ====== 2. 整个表格 ====== */ +QTableWidget { + border-image: url(:/Frames/Frames/49.png); + gridline-color: cyan; /* 网格线颜色 */ + color: cyan; /* 默认文字颜色 */ + outline: 0; /* 去掉选中虚线框 */ + font: 87 10pt "思源黑体 Heavy"; +} +QTableWidget::item { + text-align: center; + } + + + + + + + + 0 + 0 + 1024 + 521 + + + + /* ====== 2. 整个表格 ====== */ +QTableWidget { + border-image: url(:/Frames/Frames/49.png); + gridline-color: cyan; /* 网格线颜色 */ + color: cyan; /* 默认文字颜色 */ + outline: 0; /* 去掉选中虚线框 */ + font: 87 10pt "思源黑体 Heavy"; +} +QTableWidget::item { + text-align: center; + } + + + @@ -3618,7 +3636,7 @@ QPushButton:pressed { - 阀控模块 + 电流模块 @@ -3870,6 +3888,8 @@ QPushButton:pressed { MainWidget layoutWidget - + + + diff --git a/Pages/P13_InsPage.cpp b/Pages/P13_InsPage.cpp index 070a7a9..d36e882 100644 --- a/Pages/P13_InsPage.cpp +++ b/Pages/P13_InsPage.cpp @@ -19,8 +19,8 @@ void P13_InsPage::Write32Bit(uint8_t Key ,uint8_t Index,int8_t int8){ if(Index > 3) return; if(int8 <-127 || int8 > 127) return; - QString NodeId = QString("ns=6;s=::AsGlobalPV:PanelControlKey_%1").arg(Key); - uint32_t OldValue = gOPC_NodeValue[NodeId].toUInt(); + QString NodeId = QString("PanelControlKey_%1").arg(Key); + uint32_t OldValue = getNodeValue(NodeId).toUInt(); uint8_t ByteValue = static_cast(int8); // 先转无符号字节 uint32_t Mask = ~(0xFFu << (Index * 8)); // 构造清除掩码 @@ -41,10 +41,10 @@ void P13_InsPage::Write32Bit(uint8_t Key, uint8_t Index, bool Bit) if (Index > 31) return; // 0…31 共 32 个 bit /* 2. 构造 NodeId */ - QString NodeId = QString("ns=6;s=::AsGlobalPV:PanelControlKey_%1").arg(Key); + QString NodeId = QString("PanelControlKey_%1").arg(Key); /* 3. 读当前值(缓存里直接取) */ - uint32_t OldValue = gOPC_NodeValue[NodeId].toUInt(); + uint32_t OldValue = getNodeValue(NodeId).toUInt(); /* 4. 只改指定 bit,其余位不变 */ uint32_t NewValue; diff --git a/Pages/P301_PumpPage.cpp b/Pages/P301_PumpPage.cpp index 78727d9..31236c8 100644 --- a/Pages/P301_PumpPage.cpp +++ b/Pages/P301_PumpPage.cpp @@ -33,7 +33,7 @@ void P301_PumpPage::WinInit(){ Text.replace("\\n","\n",Qt::CaseInsensitive); Label->setText(Text); } - + PercentageText.append(PumpConditionConfigFile.at(row)[1]); TrueColor.append(PumpConditionConfigFile.at(row)[2]); FalseColor.append(PumpConditionConfigFile.at(row)[3]); } @@ -153,7 +153,7 @@ void P301_PumpPage::SetProgressBar(QProgressBar *PB,const uint16_t Value,const u } void P301_PumpPage::SetProgressBar(QProgressBar *PB,QLCDNumber *LCD,const QString NodeGroup,const QString NodeLCD,const QStringList Color){ // 从OPC节点获取油位显示组数据(32位无符号整数) - uint32_t PB_Group = gOPC_NodeValue["ns=6;s=::AsGlobalPV:" + NodeGroup].toUInt(); + uint32_t PB_Group = getNodeValue("" + NodeGroup).toUInt(); // 从32位数据中拆分出16位油位百分比值和颜色值 uint16_t Percentage = static_cast(PB_Group >> 16); // 高16位:百分比 @@ -163,7 +163,7 @@ void P301_PumpPage::SetProgressBar(QProgressBar *PB,QLCDNumber *LCD,const QStrin SetProgressBar(PB, Percentage, ColorIndex, Color); // 在LCD上显示实际油位测量值 - LCD->display(gOPC_NodeValue["ns=6;s=::AsGlobalPV:" +NodeLCD].toReal()); + LCD->display(getNodeValue("" +NodeLCD).toReal()); } void P301_PumpPage::UIRefreshTimeOut() { @@ -171,10 +171,10 @@ void P301_PumpPage::UIRefreshTimeOut() return; /************************************* 电机基本信息 *************************************/ // 从OPC节点获取电机相关的状态数据(32位无符号整数) - uint32_t PB_Group1 = gOPC_NodeValue["ns=6;s=::AsGlobalPV:PB_Curr_Pump.PageGroup1"] .toUInt(); // 电流显示组1数据 - uint32_t PB_Group2 = gOPC_NodeValue["ns=6;s=::AsGlobalPV:PB_Curr_Pump.PageGroup2"] .toUInt(); // 电流显示组2数据 - uint32_t PB_MotorTemp = gOPC_NodeValue["ns=6;s=::AsGlobalPV:PB_Temp_Pump.PageGroup"] .toUInt(); // 电机温度显示数据 - uint32_t SSConditions = gOPC_NodeValue["ns=6;s=::AsGlobalPV:StartStopConditions.Pump"] .toUInt(); // 启停条件状态数据 + uint32_t PB_Group1 = getNodeValue("PB_Curr_Pump.PageGroup1") .toUInt(); // 电流显示组1数据 + uint32_t PB_Group2 = getNodeValue("PB_Curr_Pump.PageGroup2") .toUInt(); // 电流显示组2数据 + uint32_t PB_MotorTemp = getNodeValue("PB_Temp_Pump.PageGroup") .toUInt(); // 电机温度显示数据 + uint32_t SSConditions = getNodeValue("StartStopConditions.Pump") .toUInt(); // 启停条件状态数据 // 从32位数据中提取16位百分比值(高16位和低16位拆分) uint16_t PercentageCurU = static_cast(PB_Group1 >> 16); // U相电流百分比(高16位) @@ -196,16 +196,16 @@ void P301_PumpPage::UIRefreshTimeOut() SetProgressBar(ui->PB_Temp, PercentageMotorTemp, ColorTemp, glMotorTempColor); // 电机温度进度条 // 在LCD上显示实际测量值(电流和温度) - ui->LCD_Cur_1->display(gOPC_NodeValue["ns=6;s=::AsGlobalPV:IN_PhasePump.Filtered30_U"] .toReal()); // U相电流实际值 - ui->LCD_Cur_2->display(gOPC_NodeValue["ns=6;s=::AsGlobalPV:IN_PhasePump.Filtered30_V"] .toReal()); // V相电流实际值 - ui->LCD_Cur_3->display(gOPC_NodeValue["ns=6;s=::AsGlobalPV:IN_PhasePump.Filtered30_W"] .toReal()); // W相电流实际值 - ui->LCD_Temp->display( gOPC_NodeValue["ns=6;s=::AsGlobalPV:IN_PhasePump.Filtered_Temp"] .toReal()); // 电机温度实际值 + ui->LCD_Cur_1->display(getNodeValue("IN_PhasePump.Filtered30_U") .toReal()); // U相电流实际值 + ui->LCD_Cur_2->display(getNodeValue("IN_PhasePump.Filtered30_V") .toReal()); // V相电流实际值 + ui->LCD_Cur_3->display(getNodeValue("IN_PhasePump.Filtered30_W") .toReal()); // W相电流实际值 + ui->LCD_Temp->display( getNodeValue("IN_PhasePump.Filtered_Temp") .toReal()); // 电机温度实际值 // 更新32个启停条件状态标签的显示样式 for (int i = 0; i < 32; ++i) { // 根据索引查找对应的标签控件 - QLabel* Label = findChild(QString("Text_SSConditions_%1").arg(i)); + QLabel* Label = findChild(QString("Text_SSConditions_%1").arg(i+1)); // 如果找到标签 if (Label){ // 基础样式:默认背景图 @@ -236,10 +236,10 @@ void P301_PumpPage::UIRefreshTimeOut() } void P301_PumpPage::TrailRefreshTimeOut(){ - ui->CPW_1->appendPoint(0, gOPC_NodeValue["ns=6;s=::AsGlobalPV:IN_PhasePump.Filtered30_U"] .toReal()); - ui->CPW_1->appendPoint(1, gOPC_NodeValue["ns=6;s=::AsGlobalPV:IN_PhasePump.Filtered30_V"] .toReal()); - ui->CPW_1->appendPoint(2, gOPC_NodeValue["ns=6;s=::AsGlobalPV:IN_PhasePump.Filtered30_W"] .toReal()); - ui->CPW_2->appendPoint(0, gOPC_NodeValue["ns=6;s=::AsGlobalPV:IN_PhasePump.Filtered_Temp"] .toDouble()); + ui->CPW_1->appendPoint(0, getNodeValue("IN_PhasePump.Filtered30_U") .toReal()); + ui->CPW_1->appendPoint(1, getNodeValue("IN_PhasePump.Filtered30_V") .toReal()); + ui->CPW_1->appendPoint(2, getNodeValue("IN_PhasePump.Filtered30_W") .toReal()); + ui->CPW_2->appendPoint(0, getNodeValue("IN_PhasePump.Filtered_Temp") .toDouble()); } diff --git a/Pages/P401_CuttingPage.cpp b/Pages/P401_CuttingPage.cpp index 12a11c7..c2bcf17 100644 --- a/Pages/P401_CuttingPage.cpp +++ b/Pages/P401_CuttingPage.cpp @@ -152,7 +152,7 @@ void P401_CuttingPage::SetProgressBar(QProgressBar *PB,const uint16_t Value,cons } void P401_CuttingPage::SetProgressBar(QProgressBar *PB,QLCDNumber *LCD,const QString NodeGroup,const QString NodeLCD,const QStringList Color){ // 从OPC节点获取油位显示组数据(32位无符号整数) - uint32_t PB_Group = gOPC_NodeValue["ns=6;s=::AsGlobalPV:" + NodeGroup].toUInt(); + uint32_t PB_Group = getNodeValue("" + NodeGroup).toUInt(); // 从32位数据中拆分出16位油位百分比值和颜色值 uint16_t Percentage = static_cast(PB_Group >> 16); // 高16位:百分比 @@ -162,7 +162,7 @@ void P401_CuttingPage::SetProgressBar(QProgressBar *PB,QLCDNumber *LCD,const QSt SetProgressBar(PB, Percentage, ColorIndex, Color); // 在LCD上显示实际油位测量值 - LCD->display(gOPC_NodeValue["ns=6;s=::AsGlobalPV:" +NodeLCD].toReal()); + LCD->display(getNodeValue("" +NodeLCD).toReal()); } void P401_CuttingPage::UIRefreshTimeOut() { @@ -170,10 +170,10 @@ void P401_CuttingPage::UIRefreshTimeOut() return; /************************************* 电机基本信息 *************************************/ // 从OPC节点获取切割设备电机相关的状态数据(32位无符号整数) - uint32_t PB_Group1 = gOPC_NodeValue["ns=6;s=::AsGlobalPV:PB_Curr_Cut.PageGroup1"].toUInt(); // 电流显示组1数据 - uint32_t PB_Group2 = gOPC_NodeValue["ns=6;s=::AsGlobalPV:PB_Curr_Cut.PageGroup2"].toUInt(); // 电流显示组2数据 - uint32_t SSConditions = gOPC_NodeValue["ns=6;s=::AsGlobalPV:StartStopConditions.Cut"].toUInt(); // 启停条件状态数据 - uint32_t PB_MotorTemp = gOPC_NodeValue["ns=6;s=::AsGlobalPV:PB_Temp_Cut.PageGroup"].toUInt(); // 电机温度显示数据 + uint32_t PB_Group1 = getNodeValue("PB_Curr_Cut.PageGroup1").toUInt(); // 电流显示组1数据 + uint32_t PB_Group2 = getNodeValue("PB_Curr_Cut.PageGroup2").toUInt(); // 电流显示组2数据 + uint32_t PB_MotorTemp = getNodeValue("PB_Temp_Cut.PageGroup").toUInt(); // 电机温度显示数据 + uint32_t SSConditions = getNodeValue("StartStopConditions.Cut").toUInt(); // 启停条件状态数据 // 从32位数据中提取16位百分比值(高16位和低16位拆分) uint16_t PercentageCurU = static_cast(PB_Group1 >> 16); // U相电流百分比(高16位) @@ -195,23 +195,25 @@ void P401_CuttingPage::UIRefreshTimeOut() SetProgressBar(ui->PB_Temp, PercentageMotorTemp, ColorTemp, glMotorTempColor); // 电机温度进度条 // 在LCD上显示实际测量值(电流和温度) - ui->LCD_Cur_1->display(gOPC_NodeValue["ns=6;s=::AsGlobalPV:IN_PhaseCut.Filtered30_U"].toReal()); // U相电流实际值 - ui->LCD_Cur_2->display(gOPC_NodeValue["ns=6;s=::AsGlobalPV:IN_PhaseCut.Filtered30_V"].toReal()); // V相电流实际值 - ui->LCD_Cur_3->display(gOPC_NodeValue["ns=6;s=::AsGlobalPV:IN_PhaseCut.Filtered30_W"].toReal()); // W相电流实际值 - ui->LCD_Temp->display(gOPC_NodeValue["ns=6;s=::AsGlobalPV:IN_PhaseCut.Filtered_Temp"].toReal()); // 电机温度实际值 + ui->LCD_Cur_1->display(getNodeValue("IN_PhaseCut.Filtered30_U").toReal()); // U相电流实际值 + ui->LCD_Cur_2->display(getNodeValue("IN_PhaseCut.Filtered30_V").toReal()); // V相电流实际值 + ui->LCD_Cur_3->display(getNodeValue("IN_PhaseCut.Filtered30_W").toReal()); // W相电流实际值 + ui->LCD_Temp->display(getNodeValue("IN_PhaseCut.Filtered_Temp").toReal()); // 电机温度实际值 // 更新32个启停条件状态标签的显示样式 for (int i = 0; i < 32; ++i) { // 根据索引查找对应的标签控件 - QLabel* Label = findChild(QString("Text_SSConditions_%1").arg(i)); + QLabel* Label = findChild(QString("Text_SSConditions_%1").arg(i+1)); // 如果找到标签 if (Label){ // 基础样式:默认背景图 QString StyleStr = "border-image: url(:/Frames/null.png);\n"; + // 根据状态位设置不同颜色(True/False对应不同样式) StyleStr += getBitOf32Data(SSConditions, i, false) ? TrueColor[i] + "\n" : FalseColor[i] + "\n"; // 应用样式到标签 + Label->setStyleSheet(StyleStr); } } @@ -239,10 +241,10 @@ void P401_CuttingPage::UIRefreshTimeOut() } void P401_CuttingPage::TrailRefreshTimeOut(){ - ui->CPW_1->appendPoint(0, gOPC_NodeValue["ns=6;s=::AsGlobalPV:IN_PhaseCut.Filtered30_U"] .toReal()); - ui->CPW_1->appendPoint(1, gOPC_NodeValue["ns=6;s=::AsGlobalPV:IN_PhaseCut.Filtered30_V"] .toReal()); - ui->CPW_1->appendPoint(2, gOPC_NodeValue["ns=6;s=::AsGlobalPV:IN_PhaseCut.Filtered30_W"] .toReal()); - ui->CPW_2->appendPoint(0,gOPC_NodeValue["ns=6;s=::AsGlobalPV:IN_PhaseCut.Filtered_Temp"] .toDouble()); + ui->CPW_1->appendPoint(0, getNodeValue("IN_PhaseCut.Filtered30_U") .toReal()); + ui->CPW_1->appendPoint(1, getNodeValue("IN_PhaseCut.Filtered30_V") .toReal()); + ui->CPW_1->appendPoint(2, getNodeValue("IN_PhaseCut.Filtered30_W") .toReal()); + ui->CPW_2->appendPoint(0,getNodeValue("IN_PhaseCut.Filtered_Temp") .toDouble()); } diff --git a/Pages/P501_LoaderPage.cpp b/Pages/P501_LoaderPage.cpp index 14e8d73..ecd8399 100644 --- a/Pages/P501_LoaderPage.cpp +++ b/Pages/P501_LoaderPage.cpp @@ -21,18 +21,18 @@ P501_LoaderPage::~P501_LoaderPage() void P501_LoaderPage::WinInit(){ - for (int row = 1; row < CutConditionConfigFile.size()-1; ++row) + for (int row = 1; row < LoaderConditionConfigFile.size()-1; ++row) { QString TextObjName = QString("Text_SSConditions_%1").arg(row); QLabel* Label = findChild(TextObjName); if (Label) { - QString Text = CutConditionConfigFile.at(row)[1]; + QString Text = LoaderConditionConfigFile.at(row)[1]; Text.replace("\\n","\n",Qt::CaseInsensitive); Label->setText(Text); } - TrueColor.append(CutConditionConfigFile.at(row)[2]); - FalseColor.append(CutConditionConfigFile.at(row)[3]); + TrueColor.append(LoaderConditionConfigFile.at(row)[2]); + FalseColor.append(LoaderConditionConfigFile.at(row)[3]); } // 现在 ui->CPW_1 已经是一个 CurvePlotWidget* @@ -156,7 +156,7 @@ void P501_LoaderPage::SetProgressBar(QProgressBar *PB,const uint16_t Value,const } void P501_LoaderPage::SetProgressBar(QProgressBar *PB,QLCDNumber *LCD,const QString NodeGroup,const QString NodeLCD,const QStringList Color){ // 从OPC节点获取油位显示组数据(32位无符号整数) - uint32_t PB_Group = gOPC_NodeValue["ns=6;s=::AsGlobalPV:" + NodeGroup].toUInt(); + uint32_t PB_Group = getNodeValue("" + NodeGroup).toUInt(); // 从32位数据中拆分出16位油位百分比值和颜色值 uint16_t Percentage = static_cast(PB_Group >> 16); // 高16位:百分比 @@ -166,7 +166,7 @@ void P501_LoaderPage::SetProgressBar(QProgressBar *PB,QLCDNumber *LCD,const QStr SetProgressBar(PB, Percentage, ColorIndex, Color); // 在LCD上显示实际油位测量值 - LCD->display(gOPC_NodeValue["ns=6;s=::AsGlobalPV:" +NodeLCD].toReal()); + LCD->display(getNodeValue("" +NodeLCD).toReal()); } void P501_LoaderPage::UIRefreshTimeOut() { @@ -174,9 +174,9 @@ void P501_LoaderPage::UIRefreshTimeOut() return; /************************************* 电机基本信息 *************************************/ // 从OPC节点获取切割设备电机相关的状态数据(32位无符号整数) - uint32_t PB_GroupL1 = gOPC_NodeValue["ns=6;s=::AsGlobalPV:PB_Curr_LoaderL.PageGroup1"].toUInt(); // 电流显示组1数据 - uint32_t PB_GroupL2 = gOPC_NodeValue["ns=6;s=::AsGlobalPV:PB_Curr_LoaderL.PageGroup2"].toUInt(); // 电流显示组2数据 - uint32_t PB_MotorTempL = gOPC_NodeValue["ns=6;s=::AsGlobalPV:PB_Temp_LoaderL.PageGroup"].toUInt(); // 电机温度显示数据 + uint32_t PB_GroupL1 = getNodeValue("PB_Curr_LoaderL.PageGroup1").toUInt(); // 电流显示组1数据 + uint32_t PB_GroupL2 = getNodeValue("PB_Curr_LoaderL.PageGroup2").toUInt(); // 电流显示组2数据 + uint32_t PB_MotorTempL = getNodeValue("PB_Temp_LoaderL.PageGroup").toUInt(); // 电机温度显示数据 // 从32位数据中提取16位百分比值(高16位和低16位拆分) uint16_t PercentageCurLU = static_cast(PB_GroupL1 >> 16); // U相电流百分比(高16位) @@ -198,19 +198,19 @@ void P501_LoaderPage::UIRefreshTimeOut() SetProgressBar(ui->PB_TempL, PercentageMotorTempL, ColorTempL, glMotorTempColor); // 电机温度进度条 // 在LCD上显示实际测量值(电流和温度) - ui->LCD_CurL_1->display(gOPC_NodeValue["ns=6;s=::AsGlobalPV:IN_PhaseLoaderL.Filtered30_U"].toReal()); // U相电流实际值 - ui->LCD_CurL_2->display(gOPC_NodeValue["ns=6;s=::AsGlobalPV:IN_PhaseLoaderL.Filtered30_V"].toReal()); // V相电流实际值 - ui->LCD_CurL_3->display(gOPC_NodeValue["ns=6;s=::AsGlobalPV:IN_PhaseLoaderL.Filtered30_W"].toReal()); // W相电流实际值 - ui->LCD_TempL->display(gOPC_NodeValue["ns=6;s=::AsGlobalPV:IN_PhaseLoaderL.Filtered_Temp"].toReal()); // 电机温度实际值 + ui->LCD_CurL_1->display(getNodeValue("IN_PhaseLoaderL.Filtered30_U").toReal()); // U相电流实际值 + ui->LCD_CurL_2->display(getNodeValue("IN_PhaseLoaderL.Filtered30_V").toReal()); // V相电流实际值 + ui->LCD_CurL_3->display(getNodeValue("IN_PhaseLoaderL.Filtered30_W").toReal()); // W相电流实际值 + ui->LCD_TempL->display(getNodeValue("IN_PhaseLoaderL.Filtered_Temp").toReal()); // 电机温度实际值 /**************************************************************************************/ /************************************* 电机基本信息 *************************************/ // 从OPC节点获取切割设备电机相关的状态数据(32位无符号整数) - uint32_t PB_GroupR1 = gOPC_NodeValue["ns=6;s=::AsGlobalPV:PB_Curr_LoaderR.PageGroup1"].toUInt(); // 电流显示组1数据 - uint32_t PB_GroupR2 = gOPC_NodeValue["ns=6;s=::AsGlobalPV:PB_Curr_LoaderR.PageGroup2"].toUInt(); // 电流显示组2数据 - uint32_t PB_MotorTempR = gOPC_NodeValue["ns=6;s=::AsGlobalPV:PB_Temp_LoaderR.PageGroup"].toUInt(); // 电机温度显示数据 + uint32_t PB_GroupR1 = getNodeValue("PB_Curr_LoaderR.PageGroup1").toUInt(); // 电流显示组1数据 + uint32_t PB_GroupR2 = getNodeValue("PB_Curr_LoaderR.PageGroup2").toUInt(); // 电流显示组2数据 + uint32_t PB_MotorTempR = getNodeValue("PB_Temp_LoaderR.PageGroup").toUInt(); // 电机温度显示数据 // 从32位数据中提取16位百分比值(高16位和低16位拆分) uint16_t PercentageCurRU = static_cast(PB_GroupR1 >> 16); // U相电流百分比(高16位) @@ -232,21 +232,21 @@ void P501_LoaderPage::UIRefreshTimeOut() SetProgressBar(ui->PB_TempR, PercentageMotorTempR, ColorTempR, glMotorTempColor); // 电机温度进度条 // 在LCD上显示实际测量值(电流和温度) - ui->LCD_CurR_1->display(gOPC_NodeValue["ns=6;s=::AsGlobalPV:IN_PhaseLoaderR.Filtered30_U"].toReal()); // U相电流实际值 - ui->LCD_CurR_2->display(gOPC_NodeValue["ns=6;s=::AsGlobalPV:IN_PhaseLoaderR.Filtered30_V"].toReal()); // V相电流实际值 - ui->LCD_CurR_3->display(gOPC_NodeValue["ns=6;s=::AsGlobalPV:IN_PhaseLoaderR.Filtered30_W"].toReal()); // W相电流实际值 - ui->LCD_TempR->display(gOPC_NodeValue["ns=6;s=::AsGlobalPV:IN_PhaseLoaderR.Filtered_Temp"].toReal()); // 电机温度实际值 + ui->LCD_CurR_1->display(getNodeValue("IN_PhaseLoaderR.Filtered30_U").toReal()); // U相电流实际值 + ui->LCD_CurR_2->display(getNodeValue("IN_PhaseLoaderR.Filtered30_V").toReal()); // V相电流实际值 + ui->LCD_CurR_3->display(getNodeValue("IN_PhaseLoaderR.Filtered30_W").toReal()); // W相电流实际值 + ui->LCD_TempR->display(getNodeValue("IN_PhaseLoaderR.Filtered_Temp").toReal()); // 电机温度实际值 /**************************************************************************************/ /************************************* 启停条件信息 *************************************/ - uint32_t SSConditions = gOPC_NodeValue["ns=6;s=::AsGlobalPV:StartStopConditions.Loader"].toUInt(); // 启停条件状态数据 + uint32_t SSConditions = getNodeValue("StartStopConditions.Loader").toUInt(); // 启停条件状态数据 // 更新32个启停条件状态标签的显示样式 for (int i = 0; i < 32; ++i) { // 根据索引查找对应的标签控件 - QLabel* Label = findChild(QString("Text_SSConditions_%1").arg(i)); + QLabel* Label = findChild(QString("Text_SSConditions_%1").arg(i+1)); // 如果找到标签 if (Label){ // 基础样式:默认背景图 @@ -268,15 +268,15 @@ void P501_LoaderPage::UIRefreshTimeOut() } void P501_LoaderPage::TrailRefreshTimeOut(){ - ui->CPW_L1->appendPoint(0, gOPC_NodeValue["ns=6;s=::AsGlobalPV:IN_PhaseLoaderL.Filtered30_U"] .toReal()); - ui->CPW_L1->appendPoint(1, gOPC_NodeValue["ns=6;s=::AsGlobalPV:IN_PhaseLoaderL.Filtered30_V"] .toReal()); - ui->CPW_L1->appendPoint(2, gOPC_NodeValue["ns=6;s=::AsGlobalPV:IN_PhaseLoaderL.Filtered30_W"] .toReal()); - ui->CPW_L2->appendPoint(0,gOPC_NodeValue["ns=6;s=::AsGlobalPV:IN_PhaseLoaderL.Filtered_Temp"] .toDouble()); + ui->CPW_L1->appendPoint(0, getNodeValue("IN_PhaseLoaderL.Filtered30_U") .toReal()); + ui->CPW_L1->appendPoint(1, getNodeValue("IN_PhaseLoaderL.Filtered30_V") .toReal()); + ui->CPW_L1->appendPoint(2, getNodeValue("IN_PhaseLoaderL.Filtered30_W") .toReal()); + ui->CPW_L2->appendPoint(0,getNodeValue("IN_PhaseLoaderL.Filtered_Temp") .toDouble()); - ui->CPW_R1->appendPoint(0, gOPC_NodeValue["ns=6;s=::AsGlobalPV:IN_PhaseLoaderR.Filtered30_U"] .toReal()); - ui->CPW_R1->appendPoint(1, gOPC_NodeValue["ns=6;s=::AsGlobalPV:IN_PhaseLoaderR.Filtered30_V"] .toReal()); - ui->CPW_R1->appendPoint(2, gOPC_NodeValue["ns=6;s=::AsGlobalPV:IN_PhaseLoaderR.Filtered30_W"] .toReal()); - ui->CPW_R2->appendPoint(0,gOPC_NodeValue["ns=6;s=::AsGlobalPV:IN_PhaseLoaderR.Filtered_Temp"] .toDouble()); + ui->CPW_R1->appendPoint(0, getNodeValue("IN_PhaseLoaderR.Filtered30_U") .toReal()); + ui->CPW_R1->appendPoint(1, getNodeValue("IN_PhaseLoaderR.Filtered30_V") .toReal()); + ui->CPW_R1->appendPoint(2, getNodeValue("IN_PhaseLoaderR.Filtered30_W") .toReal()); + ui->CPW_R2->appendPoint(0,getNodeValue("IN_PhaseLoaderR.Filtered_Temp") .toDouble()); } void P501_LoaderPage::RotateDev(){ diff --git a/Pages/P601_TransportPage.cpp b/Pages/P601_TransportPage.cpp index dfaf465..9ce0702 100644 --- a/Pages/P601_TransportPage.cpp +++ b/Pages/P601_TransportPage.cpp @@ -21,18 +21,18 @@ P601_TransportPage::~P601_TransportPage() void P601_TransportPage::WinInit(){ - for (int row = 1; row < CutConditionConfigFile.size()-1; ++row) + for (int row = 1; row < TransportConditionConfigFile.size()-1; ++row) { QString TextObjName = QString("Text_SSConditions_%1").arg(row); QLabel* Label = findChild(TextObjName); if (Label) { - QString Text = CutConditionConfigFile.at(row)[1]; + QString Text = TransportConditionConfigFile.at(row)[1]; Text.replace("\\n","\n",Qt::CaseInsensitive); Label->setText(Text); } - TrueColor.append(CutConditionConfigFile.at(row)[2]); - FalseColor.append(CutConditionConfigFile.at(row)[3]); + TrueColor.append(TransportConditionConfigFile.at(row)[2]); + FalseColor.append(TransportConditionConfigFile.at(row)[3]); } // 现在 ui->CPW_1 已经是一个 CurvePlotWidget* @@ -156,7 +156,7 @@ void P601_TransportPage::SetProgressBar(QProgressBar *PB,const uint16_t Value,co } void P601_TransportPage::SetProgressBar(QProgressBar *PB,QLCDNumber *LCD,const QString NodeGroup,const QString NodeLCD,const QStringList Color){ // 从OPC节点获取油位显示组数据(32位无符号整数) - uint32_t PB_Group = gOPC_NodeValue["ns=6;s=::AsGlobalPV:" + NodeGroup].toUInt(); + uint32_t PB_Group = getNodeValue("" + NodeGroup).toUInt(); // 从32位数据中拆分出16位油位百分比值和颜色值 uint16_t Percentage = static_cast(PB_Group >> 16); // 高16位:百分比 @@ -166,7 +166,7 @@ void P601_TransportPage::SetProgressBar(QProgressBar *PB,QLCDNumber *LCD,const Q SetProgressBar(PB, Percentage, ColorIndex, Color); // 在LCD上显示实际油位测量值 - LCD->display(gOPC_NodeValue["ns=6;s=::AsGlobalPV:" +NodeLCD].toReal()); + LCD->display(getNodeValue("" +NodeLCD).toReal()); } void P601_TransportPage::UIRefreshTimeOut() { @@ -174,9 +174,9 @@ void P601_TransportPage::UIRefreshTimeOut() return; /************************************* 电机基本信息 *************************************/ // 从OPC节点获取切割设备电机相关的状态数据(32位无符号整数) - uint32_t PB_GroupL1 = gOPC_NodeValue["ns=6;s=::AsGlobalPV:PB_Curr_TransportL.PageGroup1"].toUInt(); // 电流显示组1数据 - uint32_t PB_GroupL2 = gOPC_NodeValue["ns=6;s=::AsGlobalPV:PB_Curr_TransportL.PageGroup2"].toUInt(); // 电流显示组2数据 - uint32_t PB_MotorTempL = gOPC_NodeValue["ns=6;s=::AsGlobalPV:PB_Temp_TransportL.PageGroup"].toUInt(); // 电机温度显示数据 + uint32_t PB_GroupL1 = getNodeValue("PB_Curr_TransportL.PageGroup1").toUInt(); // 电流显示组1数据 + uint32_t PB_GroupL2 = getNodeValue("PB_Curr_TransportL.PageGroup2").toUInt(); // 电流显示组2数据 + uint32_t PB_MotorTempL = getNodeValue("PB_Temp_TransportL.PageGroup").toUInt(); // 电机温度显示数据 // 从32位数据中提取16位百分比值(高16位和低16位拆分) uint16_t PercentageCurLU = static_cast(PB_GroupL1 >> 16); // U相电流百分比(高16位) @@ -198,19 +198,19 @@ void P601_TransportPage::UIRefreshTimeOut() SetProgressBar(ui->PB_TempL, PercentageMotorTempL, ColorTempL, glMotorTempColor); // 电机温度进度条 // 在LCD上显示实际测量值(电流和温度) - ui->LCD_CurL_1->display(gOPC_NodeValue["ns=6;s=::AsGlobalPV:IN_PhaseTransportL.Filtered30_U"].toReal()); // U相电流实际值 - ui->LCD_CurL_2->display(gOPC_NodeValue["ns=6;s=::AsGlobalPV:IN_PhaseTransportL.Filtered30_V"].toReal()); // V相电流实际值 - ui->LCD_CurL_3->display(gOPC_NodeValue["ns=6;s=::AsGlobalPV:IN_PhaseTransportL.Filtered30_W"].toReal()); // W相电流实际值 - ui->LCD_TempL->display(gOPC_NodeValue["ns=6;s=::AsGlobalPV:IN_PhaseTransportL.Filtered_Temp"].toReal()); // 电机温度实际值 + ui->LCD_CurL_1->display(getNodeValue("IN_PhaseTransportL.Filtered30_U").toReal()); // U相电流实际值 + ui->LCD_CurL_2->display(getNodeValue("IN_PhaseTransportL.Filtered30_V").toReal()); // V相电流实际值 + ui->LCD_CurL_3->display(getNodeValue("IN_PhaseTransportL.Filtered30_W").toReal()); // W相电流实际值 + ui->LCD_TempL->display(getNodeValue("IN_PhaseTransportL.Filtered_Temp").toReal()); // 电机温度实际值 /**************************************************************************************/ /************************************* 电机基本信息 *************************************/ // 从OPC节点获取切割设备电机相关的状态数据(32位无符号整数) - uint32_t PB_GroupR1 = gOPC_NodeValue["ns=6;s=::AsGlobalPV:PB_Curr_TransportR.PageGroup1"].toUInt(); // 电流显示组1数据 - uint32_t PB_GroupR2 = gOPC_NodeValue["ns=6;s=::AsGlobalPV:PB_Curr_TransportR.PageGroup2"].toUInt(); // 电流显示组2数据 - uint32_t PB_MotorTempR = gOPC_NodeValue["ns=6;s=::AsGlobalPV:PB_Temp_TransportR.PageGroup"].toUInt(); // 电机温度显示数据 + uint32_t PB_GroupR1 = getNodeValue("PB_Curr_TransportR.PageGroup1").toUInt(); // 电流显示组1数据 + uint32_t PB_GroupR2 = getNodeValue("PB_Curr_TransportR.PageGroup2").toUInt(); // 电流显示组2数据 + uint32_t PB_MotorTempR = getNodeValue("PB_Temp_TransportR.PageGroup").toUInt(); // 电机温度显示数据 // 从32位数据中提取16位百分比值(高16位和低16位拆分) uint16_t PercentageCurRU = static_cast(PB_GroupR1 >> 16); // U相电流百分比(高16位) @@ -232,21 +232,21 @@ void P601_TransportPage::UIRefreshTimeOut() SetProgressBar(ui->PB_TempR, PercentageMotorTempR, ColorTempR, glMotorTempColor); // 电机温度进度条 // 在LCD上显示实际测量值(电流和温度) - ui->LCD_CurR_1->display(gOPC_NodeValue["ns=6;s=::AsGlobalPV:IN_PhaseTransportR.Filtered30_U"].toReal()); // U相电流实际值 - ui->LCD_CurR_2->display(gOPC_NodeValue["ns=6;s=::AsGlobalPV:IN_PhaseTransportR.Filtered30_V"].toReal()); // V相电流实际值 - ui->LCD_CurR_3->display(gOPC_NodeValue["ns=6;s=::AsGlobalPV:IN_PhaseTransportR.Filtered30_W"].toReal()); // W相电流实际值 - ui->LCD_TempR->display(gOPC_NodeValue["ns=6;s=::AsGlobalPV:IN_PhaseTransportR.Filtered_Temp"].toReal()); // 电机温度实际值 + ui->LCD_CurR_1->display(getNodeValue("IN_PhaseTransportR.Filtered30_U").toReal()); // U相电流实际值 + ui->LCD_CurR_2->display(getNodeValue("IN_PhaseTransportR.Filtered30_V").toReal()); // V相电流实际值 + ui->LCD_CurR_3->display(getNodeValue("IN_PhaseTransportR.Filtered30_W").toReal()); // W相电流实际值 + ui->LCD_TempR->display(getNodeValue("IN_PhaseTransportR.Filtered_Temp").toReal()); // 电机温度实际值 /**************************************************************************************/ /************************************* 启停条件信息 *************************************/ - uint32_t SSConditions = gOPC_NodeValue["ns=6;s=::AsGlobalPV:StartStopConditions.Transport"].toUInt(); // 启停条件状态数据 + uint32_t SSConditions = getNodeValue("StartStopConditions.Transport").toUInt(); // 启停条件状态数据 // 更新32个启停条件状态标签的显示样式 for (int i = 0; i < 32; ++i) { // 根据索引查找对应的标签控件 - QLabel* Label = findChild(QString("Text_SSConditions_%1").arg(i)); + QLabel* Label = findChild(QString("Text_SSConditions_%1").arg(i+1)); // 如果找到标签 if (Label){ // 基础样式:默认背景图 @@ -263,15 +263,15 @@ void P601_TransportPage::UIRefreshTimeOut() } void P601_TransportPage::TrailRefreshTimeOut(){ - ui->CPW_L1->appendPoint(0, gOPC_NodeValue["ns=6;s=::AsGlobalPV:IN_PhaseTransportL.Filtered30_U"] .toReal()); - ui->CPW_L1->appendPoint(1, gOPC_NodeValue["ns=6;s=::AsGlobalPV:IN_PhaseTransportL.Filtered30_V"] .toReal()); - ui->CPW_L1->appendPoint(2, gOPC_NodeValue["ns=6;s=::AsGlobalPV:IN_PhaseTransportL.Filtered30_W"] .toReal()); - ui->CPW_L2->appendPoint(0,gOPC_NodeValue["ns=6;s=::AsGlobalPV:IN_PhaseTransportL.Filtered_Temp"] .toDouble()); + ui->CPW_L1->appendPoint(0, getNodeValue("IN_PhaseTransportL.Filtered30_U") .toReal()); + ui->CPW_L1->appendPoint(1, getNodeValue("IN_PhaseTransportL.Filtered30_V") .toReal()); + ui->CPW_L1->appendPoint(2, getNodeValue("IN_PhaseTransportL.Filtered30_W") .toReal()); + ui->CPW_L2->appendPoint(0,getNodeValue("IN_PhaseTransportL.Filtered_Temp") .toDouble()); - ui->CPW_R1->appendPoint(0, gOPC_NodeValue["ns=6;s=::AsGlobalPV:IN_PhaseTransportR.Filtered30_U"] .toReal()); - ui->CPW_R1->appendPoint(1, gOPC_NodeValue["ns=6;s=::AsGlobalPV:IN_PhaseTransportR.Filtered30_V"] .toReal()); - ui->CPW_R1->appendPoint(2, gOPC_NodeValue["ns=6;s=::AsGlobalPV:IN_PhaseTransportR.Filtered30_W"] .toReal()); - ui->CPW_R2->appendPoint(0,gOPC_NodeValue["ns=6;s=::AsGlobalPV:IN_PhaseTransportR.Filtered_Temp"] .toDouble()); + ui->CPW_R1->appendPoint(0, getNodeValue("IN_PhaseTransportR.Filtered30_U") .toReal()); + ui->CPW_R1->appendPoint(1, getNodeValue("IN_PhaseTransportR.Filtered30_V") .toReal()); + ui->CPW_R1->appendPoint(2, getNodeValue("IN_PhaseTransportR.Filtered30_W") .toReal()); + ui->CPW_R2->appendPoint(0,getNodeValue("IN_PhaseTransportR.Filtered_Temp") .toDouble()); } void P601_TransportPage::RotateDev(){ diff --git a/Pages/P901_RemotePage.cpp b/Pages/P901_RemotePage.cpp index 82c0bb2..906fa4c 100644 --- a/Pages/P901_RemotePage.cpp +++ b/Pages/P901_RemotePage.cpp @@ -27,9 +27,9 @@ void P901_RemotePage::WinInit() UIRefresh_Timer->start(); } qreal P901_RemotePage::readCurrent(QString Dev){ - qreal CurrU = gOPC_NodeValue["ns=6;s=::AsGlobalPV:IN_Phase"+Dev+".Filtered30_U"] .toReal(); - qreal CurrV = gOPC_NodeValue["ns=6;s=::AsGlobalPV:IN_Phase"+Dev+".Filtered30_V"] .toReal(); - qreal CurrW = gOPC_NodeValue["ns=6;s=::AsGlobalPV:IN_Phase"+Dev+".Filtered30_W"] .toReal(); + qreal CurrU = getNodeValue("IN_Phase"+Dev+".Filtered30_U") .toReal(); + qreal CurrV = getNodeValue("IN_Phase"+Dev+".Filtered30_V") .toReal(); + qreal CurrW = getNodeValue("IN_Phase"+Dev+".Filtered30_W") .toReal(); return fmax(CurrU,fmax(CurrV,CurrW)); } void P901_RemotePage::SetStyle2(QLabel *Label,QStringList List,bool b1,bool b2,bool isNull){ @@ -47,10 +47,10 @@ void P901_RemotePage::UIRefreshTimeOut() if(gPageIndexStr != "P09") return; QString StyleSheetSet; - uint32_t DK1 = gOPC_NodeValue["ns=6;s=::AsGlobalPV:PageContol.RemoteDKey1"] .toUInt(); - uint32_t DK2 = gOPC_NodeValue["ns=6;s=::AsGlobalPV:PageContol.RemoteDKey2"] .toUInt(); - uint32_t AK1 = gOPC_NodeValue["ns=6;s=::AsGlobalPV:PageContol.RemoteAKey1"] .toUInt(); - uint32_t AK2 = gOPC_NodeValue["ns=6;s=::AsGlobalPV:PageContol.RemoteAKey2"] .toUInt(); + uint32_t DK1 = getNodeValue("PageContol.RemoteDKey1") .toUInt(); + uint32_t DK2 = getNodeValue("PageContol.RemoteDKey2") .toUInt(); + uint32_t AK1 = getNodeValue("PageContol.RemoteAKey1") .toUInt(); + uint32_t AK2 = getNodeValue("PageContol.RemoteAKey2") .toUInt(); // 牵引速度 ui->Slider_Haul_L->setValue(extractUInt32_8BitPart(AK1,0)); diff --git a/Pages/P902_RemotePage.cpp b/Pages/P902_RemotePage.cpp index 318d53f..00bc378 100644 --- a/Pages/P902_RemotePage.cpp +++ b/Pages/P902_RemotePage.cpp @@ -22,9 +22,9 @@ void P902_RemotePage::WinInit() UIRefresh_Timer->start(); } qreal P902_RemotePage::readCurrent(QString Dev){ - qreal CurrU = gOPC_NodeValue["ns=6;s=::AsGlobalPV:IN_Phase"+Dev+".Filtered30_U"] .toReal(); - qreal CurrV = gOPC_NodeValue["ns=6;s=::AsGlobalPV:IN_Phase"+Dev+".Filtered30_V"] .toReal(); - qreal CurrW = gOPC_NodeValue["ns=6;s=::AsGlobalPV:IN_Phase"+Dev+".Filtered30_W"] .toReal(); + qreal CurrU = getNodeValue("IN_Phase"+Dev+".Filtered30_U") .toReal(); + qreal CurrV = getNodeValue("IN_Phase"+Dev+".Filtered30_V") .toReal(); + qreal CurrW = getNodeValue("IN_Phase"+Dev+".Filtered30_W") .toReal(); return fmax(CurrU,fmax(CurrV,CurrW)); } void P902_RemotePage::SetStyle2(QLabel *Label,QStringList List,bool b1,bool b2,bool isNull){ @@ -42,10 +42,10 @@ void P902_RemotePage::UIRefreshTimeOut() if(gPageIndexStr != "P09") return; QString StyleSheetSet; - uint32_t DK1 = gOPC_NodeValue["ns=6;s=::AsGlobalPV:PageContol.RemoteDKey1"] .toUInt(); - uint32_t DK2 = gOPC_NodeValue["ns=6;s=::AsGlobalPV:PageContol.RemoteDKey2"] .toUInt(); - uint32_t AK1 = gOPC_NodeValue["ns=6;s=::AsGlobalPV:PageContol.RemoteAKey1"] .toUInt(); - uint32_t AK2 = gOPC_NodeValue["ns=6;s=::AsGlobalPV:PageContol.RemoteAKey2"] .toUInt(); + uint32_t DK1 = getNodeValue("PageContol.RemoteDKey1") .toUInt(); + uint32_t DK2 = getNodeValue("PageContol.RemoteDKey2") .toUInt(); + uint32_t AK1 = getNodeValue("PageContol.RemoteAKey1") .toUInt(); + uint32_t AK2 = getNodeValue("PageContol.RemoteAKey2") .toUInt(); // 牵引速度 ui->Slider_Haul_L->setValue(extractUInt32_8BitPart(AK1,0)); diff --git a/Pictures/Button/Sheild_11.png b/Pictures/Button/Sheild_11.png index f83139c..e7c2717 100644 Binary files a/Pictures/Button/Sheild_11.png and b/Pictures/Button/Sheild_11.png differ diff --git a/Pictures/Button/Sheild_12.png b/Pictures/Button/Sheild_12.png index d61f504..94747a9 100644 Binary files a/Pictures/Button/Sheild_12.png and b/Pictures/Button/Sheild_12.png differ diff --git a/Pictures/Button/Sheild_21.png b/Pictures/Button/Sheild_21.png index b736935..2ae4362 100644 Binary files a/Pictures/Button/Sheild_21.png and b/Pictures/Button/Sheild_21.png differ diff --git a/Pictures/Button/Sheild_22.png b/Pictures/Button/Sheild_22.png index 844ba4d..1df8e59 100644 Binary files a/Pictures/Button/Sheild_22.png and b/Pictures/Button/Sheild_22.png differ diff --git a/Pictures/Button/button_Blue.png b/Pictures/Button/button_Blue.png index a962e83..d49527b 100644 Binary files a/Pictures/Button/button_Blue.png and b/Pictures/Button/button_Blue.png differ diff --git a/Pictures/Button/button_Green.png b/Pictures/Button/button_Green.png index f396904..0b48f22 100644 Binary files a/Pictures/Button/button_Green.png and b/Pictures/Button/button_Green.png differ diff --git a/Pictures/Button/button_Grey.png b/Pictures/Button/button_Grey.png index 7e840cf..5961d51 100644 Binary files a/Pictures/Button/button_Grey.png and b/Pictures/Button/button_Grey.png differ diff --git a/Pictures/Button/button_Red.png b/Pictures/Button/button_Red.png index 9385197..aceb910 100644 Binary files a/Pictures/Button/button_Red.png and b/Pictures/Button/button_Red.png differ diff --git a/Pictures/Button/button_qing.png b/Pictures/Button/button_qing.png index 7ead96c..ebd2426 100644 Binary files a/Pictures/Button/button_qing.png and b/Pictures/Button/button_qing.png differ diff --git a/Pictures/Devices - 副本/ICO_Alarm0.png b/Pictures/Devices - 副本/ICO_Alarm0.png deleted file mode 100644 index 03dead5..0000000 Binary files a/Pictures/Devices - 副本/ICO_Alarm0.png and /dev/null differ diff --git a/Pictures/Devices - 副本/ICO_Alarm1.png b/Pictures/Devices - 副本/ICO_Alarm1.png deleted file mode 100644 index f3bd42a..0000000 Binary files a/Pictures/Devices - 副本/ICO_Alarm1.png and /dev/null differ diff --git a/Pictures/Devices - 副本/ICO_Atlas0.png b/Pictures/Devices - 副本/ICO_Atlas0.png deleted file mode 100644 index 48f3b05..0000000 Binary files a/Pictures/Devices - 副本/ICO_Atlas0.png and /dev/null differ diff --git a/Pictures/Devices - 副本/ICO_Atlas1.png b/Pictures/Devices - 副本/ICO_Atlas1.png deleted file mode 100644 index 2efd81c..0000000 Binary files a/Pictures/Devices - 副本/ICO_Atlas1.png and /dev/null differ diff --git a/Pictures/Devices - 副本/ICO_Cutting0.png b/Pictures/Devices - 副本/ICO_Cutting0.png deleted file mode 100644 index d399f8b..0000000 Binary files a/Pictures/Devices - 副本/ICO_Cutting0.png and /dev/null differ diff --git a/Pictures/Devices - 副本/ICO_Cutting1.png b/Pictures/Devices - 副本/ICO_Cutting1.png deleted file mode 100644 index 70053fd..0000000 Binary files a/Pictures/Devices - 副本/ICO_Cutting1.png and /dev/null differ diff --git a/Pictures/Devices - 副本/ICO_Cylinder0.png b/Pictures/Devices - 副本/ICO_Cylinder0.png deleted file mode 100644 index 2936dcb..0000000 Binary files a/Pictures/Devices - 副本/ICO_Cylinder0.png and /dev/null differ diff --git a/Pictures/Devices - 副本/ICO_Cylinder1.png b/Pictures/Devices - 副本/ICO_Cylinder1.png deleted file mode 100644 index 5282171..0000000 Binary files a/Pictures/Devices - 副本/ICO_Cylinder1.png and /dev/null differ diff --git a/Pictures/Devices - 副本/ICO_INS0.png b/Pictures/Devices - 副本/ICO_INS0.png deleted file mode 100644 index 5e9bb8a..0000000 Binary files a/Pictures/Devices - 副本/ICO_INS0.png and /dev/null differ diff --git a/Pictures/Devices - 副本/ICO_INS1.png b/Pictures/Devices - 副本/ICO_INS1.png deleted file mode 100644 index 1fe787b..0000000 Binary files a/Pictures/Devices - 副本/ICO_INS1.png and /dev/null differ diff --git a/Pictures/Devices - 副本/ICO_Intelligent0.png b/Pictures/Devices - 副本/ICO_Intelligent0.png deleted file mode 100644 index 68ca38e..0000000 Binary files a/Pictures/Devices - 副本/ICO_Intelligent0.png and /dev/null differ diff --git a/Pictures/Devices - 副本/ICO_Intelligent1.png b/Pictures/Devices - 副本/ICO_Intelligent1.png deleted file mode 100644 index 579b900..0000000 Binary files a/Pictures/Devices - 副本/ICO_Intelligent1.png and /dev/null differ diff --git a/Pictures/Devices - 副本/ICO_Isolation0.png b/Pictures/Devices - 副本/ICO_Isolation0.png deleted file mode 100644 index 46bf7c6..0000000 Binary files a/Pictures/Devices - 副本/ICO_Isolation0.png and /dev/null differ diff --git a/Pictures/Devices - 副本/ICO_Isolation1.png b/Pictures/Devices - 副本/ICO_Isolation1.png deleted file mode 100644 index 297a2e7..0000000 Binary files a/Pictures/Devices - 副本/ICO_Isolation1.png and /dev/null differ diff --git a/Pictures/Devices - 副本/ICO_Loader0.png b/Pictures/Devices - 副本/ICO_Loader0.png deleted file mode 100644 index 21fdb03..0000000 Binary files a/Pictures/Devices - 副本/ICO_Loader0.png and /dev/null differ diff --git a/Pictures/Devices - 副本/ICO_Loader1.png b/Pictures/Devices - 副本/ICO_Loader1.png deleted file mode 100644 index 57a9eae..0000000 Binary files a/Pictures/Devices - 副本/ICO_Loader1.png and /dev/null differ diff --git a/Pictures/Devices - 副本/ICO_Main0 - 副本.png b/Pictures/Devices - 副本/ICO_Main0 - 副本.png deleted file mode 100644 index cd9c0eb..0000000 Binary files a/Pictures/Devices - 副本/ICO_Main0 - 副本.png and /dev/null differ diff --git a/Pictures/Devices - 副本/ICO_Main0.png b/Pictures/Devices - 副本/ICO_Main0.png deleted file mode 100644 index 1b99a9e..0000000 Binary files a/Pictures/Devices - 副本/ICO_Main0.png and /dev/null differ diff --git a/Pictures/Devices - 副本/ICO_Main1 - 副本.png b/Pictures/Devices - 副本/ICO_Main1 - 副本.png deleted file mode 100644 index a635196..0000000 Binary files a/Pictures/Devices - 副本/ICO_Main1 - 副本.png and /dev/null differ diff --git a/Pictures/Devices - 副本/ICO_Main1.png b/Pictures/Devices - 副本/ICO_Main1.png deleted file mode 100644 index a635196..0000000 Binary files a/Pictures/Devices - 副本/ICO_Main1.png and /dev/null differ diff --git a/Pictures/Devices - 副本/ICO_Network0.png b/Pictures/Devices - 副本/ICO_Network0.png deleted file mode 100644 index 91664ea..0000000 Binary files a/Pictures/Devices - 副本/ICO_Network0.png and /dev/null differ diff --git a/Pictures/Devices - 副本/ICO_Network1.png b/Pictures/Devices - 副本/ICO_Network1.png deleted file mode 100644 index e088119..0000000 Binary files a/Pictures/Devices - 副本/ICO_Network1.png and /dev/null differ diff --git a/Pictures/Devices - 副本/ICO_Parameter0.png b/Pictures/Devices - 副本/ICO_Parameter0.png deleted file mode 100644 index 75fd6cf..0000000 Binary files a/Pictures/Devices - 副本/ICO_Parameter0.png and /dev/null differ diff --git a/Pictures/Devices - 副本/ICO_Parameter1.png b/Pictures/Devices - 副本/ICO_Parameter1.png deleted file mode 100644 index c9018c9..0000000 Binary files a/Pictures/Devices - 副本/ICO_Parameter1.png and /dev/null differ diff --git a/Pictures/Devices - 副本/ICO_Pump0.png b/Pictures/Devices - 副本/ICO_Pump0.png deleted file mode 100644 index 48e5aaf..0000000 Binary files a/Pictures/Devices - 副本/ICO_Pump0.png and /dev/null differ diff --git a/Pictures/Devices - 副本/ICO_Pump1.png b/Pictures/Devices - 副本/ICO_Pump1.png deleted file mode 100644 index d22ebe0..0000000 Binary files a/Pictures/Devices - 副本/ICO_Pump1.png and /dev/null differ diff --git a/Pictures/Devices - 副本/ICO_Remote0.png b/Pictures/Devices - 副本/ICO_Remote0.png deleted file mode 100644 index dece176..0000000 Binary files a/Pictures/Devices - 副本/ICO_Remote0.png and /dev/null differ diff --git a/Pictures/Devices - 副本/ICO_Remote1.png b/Pictures/Devices - 副本/ICO_Remote1.png deleted file mode 100644 index 5088654..0000000 Binary files a/Pictures/Devices - 副本/ICO_Remote1.png and /dev/null differ diff --git a/Pictures/Devices - 副本/ICO_Setting0.png b/Pictures/Devices - 副本/ICO_Setting0.png deleted file mode 100644 index 0c30f64..0000000 Binary files a/Pictures/Devices - 副本/ICO_Setting0.png and /dev/null differ diff --git a/Pictures/Devices - 副本/ICO_Setting1.png b/Pictures/Devices - 副本/ICO_Setting1.png deleted file mode 100644 index 8f7464c..0000000 Binary files a/Pictures/Devices - 副本/ICO_Setting1.png and /dev/null differ diff --git a/Pictures/Devices - 副本/ICO_Shield0.png b/Pictures/Devices - 副本/ICO_Shield0.png deleted file mode 100644 index a848ee8..0000000 Binary files a/Pictures/Devices - 副本/ICO_Shield0.png and /dev/null differ diff --git a/Pictures/Devices - 副本/ICO_Shield1.png b/Pictures/Devices - 副本/ICO_Shield1.png deleted file mode 100644 index cf21343..0000000 Binary files a/Pictures/Devices - 副本/ICO_Shield1.png and /dev/null differ diff --git a/Pictures/Devices - 副本/ICO_Transport0.png b/Pictures/Devices - 副本/ICO_Transport0.png deleted file mode 100644 index 3683b77..0000000 Binary files a/Pictures/Devices - 副本/ICO_Transport0.png and /dev/null differ diff --git a/Pictures/Devices - 副本/ICO_Transport1.png b/Pictures/Devices - 副本/ICO_Transport1.png deleted file mode 100644 index 1996adc..0000000 Binary files a/Pictures/Devices - 副本/ICO_Transport1.png and /dev/null differ diff --git a/Pictures/Devices/ICO_Alarm0.png b/Pictures/Devices/ICO_Alarm0.png index 4de4e08..9261708 100644 Binary files a/Pictures/Devices/ICO_Alarm0.png and b/Pictures/Devices/ICO_Alarm0.png differ diff --git a/Pictures/Devices/ICO_Alarm1.png b/Pictures/Devices/ICO_Alarm1.png index f3bd42a..67e13d6 100644 Binary files a/Pictures/Devices/ICO_Alarm1.png and b/Pictures/Devices/ICO_Alarm1.png differ diff --git a/Pictures/Devices/ICO_Atlas0.png b/Pictures/Devices/ICO_Atlas0.png index 003c251..14ab956 100644 Binary files a/Pictures/Devices/ICO_Atlas0.png and b/Pictures/Devices/ICO_Atlas0.png differ diff --git a/Pictures/Devices/ICO_Atlas1.png b/Pictures/Devices/ICO_Atlas1.png index 2efd81c..a62254d 100644 Binary files a/Pictures/Devices/ICO_Atlas1.png and b/Pictures/Devices/ICO_Atlas1.png differ diff --git a/Pictures/Devices/ICO_Cutting0.png b/Pictures/Devices/ICO_Cutting0.png index 7456d13..28bf44e 100644 Binary files a/Pictures/Devices/ICO_Cutting0.png and b/Pictures/Devices/ICO_Cutting0.png differ diff --git a/Pictures/Devices/ICO_Cutting1.png b/Pictures/Devices/ICO_Cutting1.png index 70053fd..d982205 100644 Binary files a/Pictures/Devices/ICO_Cutting1.png and b/Pictures/Devices/ICO_Cutting1.png differ diff --git a/Pictures/Devices/ICO_Cylinder0.png b/Pictures/Devices/ICO_Cylinder0.png index 078d4b5..d69a5a5 100644 Binary files a/Pictures/Devices/ICO_Cylinder0.png and b/Pictures/Devices/ICO_Cylinder0.png differ diff --git a/Pictures/Devices/ICO_Cylinder1.png b/Pictures/Devices/ICO_Cylinder1.png index 5282171..2fc56f4 100644 Binary files a/Pictures/Devices/ICO_Cylinder1.png and b/Pictures/Devices/ICO_Cylinder1.png differ diff --git a/Pictures/Devices/ICO_INS0.png b/Pictures/Devices/ICO_INS0.png index 0f529ab..a438c68 100644 Binary files a/Pictures/Devices/ICO_INS0.png and b/Pictures/Devices/ICO_INS0.png differ diff --git a/Pictures/Devices/ICO_INS1.png b/Pictures/Devices/ICO_INS1.png index 1fe787b..90d8335 100644 Binary files a/Pictures/Devices/ICO_INS1.png and b/Pictures/Devices/ICO_INS1.png differ diff --git a/Pictures/Devices/ICO_Intelligent0.png b/Pictures/Devices/ICO_Intelligent0.png index d36f742..7457b9b 100644 Binary files a/Pictures/Devices/ICO_Intelligent0.png and b/Pictures/Devices/ICO_Intelligent0.png differ diff --git a/Pictures/Devices/ICO_Intelligent1.png b/Pictures/Devices/ICO_Intelligent1.png index 579b900..0d39a50 100644 Binary files a/Pictures/Devices/ICO_Intelligent1.png and b/Pictures/Devices/ICO_Intelligent1.png differ diff --git a/Pictures/Devices/ICO_Isolation0.png b/Pictures/Devices/ICO_Isolation0.png index 3533d5e..776d9f1 100644 Binary files a/Pictures/Devices/ICO_Isolation0.png and b/Pictures/Devices/ICO_Isolation0.png differ diff --git a/Pictures/Devices/ICO_Isolation1.png b/Pictures/Devices/ICO_Isolation1.png index 297a2e7..98bf8eb 100644 Binary files a/Pictures/Devices/ICO_Isolation1.png and b/Pictures/Devices/ICO_Isolation1.png differ diff --git a/Pictures/Devices/ICO_Loader0.png b/Pictures/Devices/ICO_Loader0.png index 9409598..4e7e2c2 100644 Binary files a/Pictures/Devices/ICO_Loader0.png and b/Pictures/Devices/ICO_Loader0.png differ diff --git a/Pictures/Devices/ICO_Loader1.png b/Pictures/Devices/ICO_Loader1.png index 57a9eae..bcfdb3e 100644 Binary files a/Pictures/Devices/ICO_Loader1.png and b/Pictures/Devices/ICO_Loader1.png differ diff --git a/Pictures/Devices/ICO_Main0.png b/Pictures/Devices/ICO_Main0.png index 1b99a9e..223bb25 100644 Binary files a/Pictures/Devices/ICO_Main0.png and b/Pictures/Devices/ICO_Main0.png differ diff --git a/Pictures/Devices/ICO_Main1.png b/Pictures/Devices/ICO_Main1.png index a635196..535c81b 100644 Binary files a/Pictures/Devices/ICO_Main1.png and b/Pictures/Devices/ICO_Main1.png differ diff --git a/Pictures/Devices/ICO_Network0.png b/Pictures/Devices/ICO_Network0.png index de075c6..7e2fd0a 100644 Binary files a/Pictures/Devices/ICO_Network0.png and b/Pictures/Devices/ICO_Network0.png differ diff --git a/Pictures/Devices/ICO_Network1.png b/Pictures/Devices/ICO_Network1.png index e088119..a7ba38e 100644 Binary files a/Pictures/Devices/ICO_Network1.png and b/Pictures/Devices/ICO_Network1.png differ diff --git a/Pictures/Devices/ICO_Parameter0.png b/Pictures/Devices/ICO_Parameter0.png index f51f30d..d249cf5 100644 Binary files a/Pictures/Devices/ICO_Parameter0.png and b/Pictures/Devices/ICO_Parameter0.png differ diff --git a/Pictures/Devices/ICO_Parameter1.png b/Pictures/Devices/ICO_Parameter1.png index c9018c9..ff278c5 100644 Binary files a/Pictures/Devices/ICO_Parameter1.png and b/Pictures/Devices/ICO_Parameter1.png differ diff --git a/Pictures/Devices/ICO_Pump0.png b/Pictures/Devices/ICO_Pump0.png index 682cadc..a9ba7ae 100644 Binary files a/Pictures/Devices/ICO_Pump0.png and b/Pictures/Devices/ICO_Pump0.png differ diff --git a/Pictures/Devices/ICO_Pump1.png b/Pictures/Devices/ICO_Pump1.png index d22ebe0..4cc4983 100644 Binary files a/Pictures/Devices/ICO_Pump1.png and b/Pictures/Devices/ICO_Pump1.png differ diff --git a/Pictures/Devices/ICO_Remote0.png b/Pictures/Devices/ICO_Remote0.png index 0e5eb36..dd5efbe 100644 Binary files a/Pictures/Devices/ICO_Remote0.png and b/Pictures/Devices/ICO_Remote0.png differ diff --git a/Pictures/Devices/ICO_Remote1.png b/Pictures/Devices/ICO_Remote1.png index 5088654..1773aa1 100644 Binary files a/Pictures/Devices/ICO_Remote1.png and b/Pictures/Devices/ICO_Remote1.png differ diff --git a/Pictures/Devices/ICO_Setting0.png b/Pictures/Devices/ICO_Setting0.png index 6893d77..f685c56 100644 Binary files a/Pictures/Devices/ICO_Setting0.png and b/Pictures/Devices/ICO_Setting0.png differ diff --git a/Pictures/Devices/ICO_Setting1.png b/Pictures/Devices/ICO_Setting1.png index 8f7464c..a63e308 100644 Binary files a/Pictures/Devices/ICO_Setting1.png and b/Pictures/Devices/ICO_Setting1.png differ diff --git a/Pictures/Devices/ICO_Shield0.png b/Pictures/Devices/ICO_Shield0.png index d72f526..4114a5f 100644 Binary files a/Pictures/Devices/ICO_Shield0.png and b/Pictures/Devices/ICO_Shield0.png differ diff --git a/Pictures/Devices/ICO_Shield1.png b/Pictures/Devices/ICO_Shield1.png index cf21343..7c58d51 100644 Binary files a/Pictures/Devices/ICO_Shield1.png and b/Pictures/Devices/ICO_Shield1.png differ diff --git a/Pictures/Devices/ICO_Transport0.png b/Pictures/Devices/ICO_Transport0.png index b2503f1..31a4398 100644 Binary files a/Pictures/Devices/ICO_Transport0.png and b/Pictures/Devices/ICO_Transport0.png differ diff --git a/Pictures/Devices/ICO_Transport1.png b/Pictures/Devices/ICO_Transport1.png index 1996adc..01fb503 100644 Binary files a/Pictures/Devices/ICO_Transport1.png and b/Pictures/Devices/ICO_Transport1.png differ diff --git a/Pictures/Frames/49.png b/Pictures/Frames/49.png index d4853d3..548ca47 100644 Binary files a/Pictures/Frames/49.png and b/Pictures/Frames/49.png differ diff --git a/Pictures/Frames/Alarm.png b/Pictures/Frames/Alarm.png index 2158b2d..a903d0d 100644 Binary files a/Pictures/Frames/Alarm.png and b/Pictures/Frames/Alarm.png differ diff --git a/Pictures/Frames/BottomBar.png b/Pictures/Frames/BottomBar.png index 170482d..1b27269 100644 Binary files a/Pictures/Frames/BottomBar.png and b/Pictures/Frames/BottomBar.png differ diff --git a/Pictures/Frames/Main.png b/Pictures/Frames/Main.png index b12d665..6331581 100644 Binary files a/Pictures/Frames/Main.png and b/Pictures/Frames/Main.png differ diff --git a/Pictures/Frames/Top.png b/Pictures/Frames/Top.png index 4c0a6b5..8a1b718 100644 Binary files a/Pictures/Frames/Top.png and b/Pictures/Frames/Top.png differ diff --git a/Pictures/Frames/Top1.png b/Pictures/Frames/Top1.png index 4da86d3..d51c6c3 100644 Binary files a/Pictures/Frames/Top1.png and b/Pictures/Frames/Top1.png differ diff --git a/Pictures/Frames/Top2.png b/Pictures/Frames/Top2.png index f21ad64..cfc21a2 100644 Binary files a/Pictures/Frames/Top2.png and b/Pictures/Frames/Top2.png differ diff --git a/Pictures/Frames/bg_1.png b/Pictures/Frames/bg_1.png index 24d95fd..d32d437 100644 Binary files a/Pictures/Frames/bg_1.png and b/Pictures/Frames/bg_1.png differ diff --git a/Pictures/Frames/bg_datetime.png b/Pictures/Frames/bg_datetime.png index 679ce05..dffe8a6 100644 Binary files a/Pictures/Frames/bg_datetime.png and b/Pictures/Frames/bg_datetime.png differ diff --git a/Pictures/Frames/bg_ele_mode.png b/Pictures/Frames/bg_ele_mode.png index 97c58ec..4ba1db7 100644 Binary files a/Pictures/Frames/bg_ele_mode.png and b/Pictures/Frames/bg_ele_mode.png differ diff --git a/Pictures/Frames/bg_title_2.png b/Pictures/Frames/bg_title_2.png index 5272bc2..a6e4e43 100644 Binary files a/Pictures/Frames/bg_title_2.png and b/Pictures/Frames/bg_title_2.png differ diff --git a/Pictures/Frames/bg_title_3.png b/Pictures/Frames/bg_title_3.png index 7a3e5fb..d19a0db 100644 Binary files a/Pictures/Frames/bg_title_3.png and b/Pictures/Frames/bg_title_3.png differ diff --git a/Pictures/Frames/bg_yingbianli.png b/Pictures/Frames/bg_yingbianli.png index daf9fb6..9bf04b7 100644 Binary files a/Pictures/Frames/bg_yingbianli.png and b/Pictures/Frames/bg_yingbianli.png differ diff --git a/Pictures/Frames/newbg_speed.png b/Pictures/Frames/newbg_speed.png index dbdb9da..e8e59fd 100644 Binary files a/Pictures/Frames/newbg_speed.png and b/Pictures/Frames/newbg_speed.png differ diff --git a/Pictures/Icos/Arrow_High.png b/Pictures/Icos/Arrow_High.png index 0a4e6b0..6d1a274 100644 Binary files a/Pictures/Icos/Arrow_High.png and b/Pictures/Icos/Arrow_High.png differ diff --git a/Pictures/Icos/Arrow_Low.png b/Pictures/Icos/Arrow_Low.png index c86728c..f320fa8 100644 Binary files a/Pictures/Icos/Arrow_Low.png and b/Pictures/Icos/Arrow_Low.png differ diff --git a/Pictures/Icos/Arrow_Pull.png b/Pictures/Icos/Arrow_Pull.png index 85b3c58..5016116 100644 Binary files a/Pictures/Icos/Arrow_Pull.png and b/Pictures/Icos/Arrow_Pull.png differ diff --git a/Pictures/Icos/Arrow_Push.png b/Pictures/Icos/Arrow_Push.png index 905b45e..041926f 100644 Binary files a/Pictures/Icos/Arrow_Push.png and b/Pictures/Icos/Arrow_Push.png differ diff --git a/Pictures/Icos/Arrow_Stop.png b/Pictures/Icos/Arrow_Stop.png index 392bdb0..5ac9291 100644 Binary files a/Pictures/Icos/Arrow_Stop.png and b/Pictures/Icos/Arrow_Stop.png differ diff --git a/Pictures/Icos/Exclamation.png b/Pictures/Icos/Exclamation.png index e4e1971..39311d1 100644 Binary files a/Pictures/Icos/Exclamation.png and b/Pictures/Icos/Exclamation.png differ diff --git a/Pictures/Icos/LED1_Green.png b/Pictures/Icos/LED1_Green.png index 4139e45..33dbd75 100644 Binary files a/Pictures/Icos/LED1_Green.png and b/Pictures/Icos/LED1_Green.png differ diff --git a/Pictures/Icos/LED1_Grey.png b/Pictures/Icos/LED1_Grey.png index c630f4c..bf13a04 100644 Binary files a/Pictures/Icos/LED1_Grey.png and b/Pictures/Icos/LED1_Grey.png differ diff --git a/Pictures/Icos/LED1_Rad.png b/Pictures/Icos/LED1_Rad.png index 8bdaa35..50aaadc 100644 Binary files a/Pictures/Icos/LED1_Rad.png and b/Pictures/Icos/LED1_Rad.png differ diff --git a/Pictures/Icos/LED1_Yello.png b/Pictures/Icos/LED1_Yello.png index 4f53977..12a92bf 100644 Binary files a/Pictures/Icos/LED1_Yello.png and b/Pictures/Icos/LED1_Yello.png differ diff --git a/Pictures/Icos/LED2_Green.png b/Pictures/Icos/LED2_Green.png index 438d0a8..2c87a88 100644 Binary files a/Pictures/Icos/LED2_Green.png and b/Pictures/Icos/LED2_Green.png differ diff --git a/Pictures/Icos/LED2_Grey.png b/Pictures/Icos/LED2_Grey.png index 0cd3500..d007195 100644 Binary files a/Pictures/Icos/LED2_Grey.png and b/Pictures/Icos/LED2_Grey.png differ diff --git a/Pictures/Icos/LED2_Yello.png b/Pictures/Icos/LED2_Yello.png index e8cf261..faf95d9 100644 Binary files a/Pictures/Icos/LED2_Yello.png and b/Pictures/Icos/LED2_Yello.png differ diff --git a/Pictures/Icos/LED3_Green.png b/Pictures/Icos/LED3_Green.png index d7e97a2..faade0c 100644 Binary files a/Pictures/Icos/LED3_Green.png and b/Pictures/Icos/LED3_Green.png differ diff --git a/Pictures/Icos/LED3_Grey.png b/Pictures/Icos/LED3_Grey.png index bb80e15..c692f64 100644 Binary files a/Pictures/Icos/LED3_Grey.png and b/Pictures/Icos/LED3_Grey.png differ diff --git a/Pictures/Icos/LED3_Rad (1).png b/Pictures/Icos/LED3_Rad (1).png index 97fd23a..caac2d4 100644 Binary files a/Pictures/Icos/LED3_Rad (1).png and b/Pictures/Icos/LED3_Rad (1).png differ diff --git a/Pictures/Icos/LED3_Rad (2).png b/Pictures/Icos/LED3_Rad (2).png index 06bae21..ad867d5 100644 Binary files a/Pictures/Icos/LED3_Rad (2).png and b/Pictures/Icos/LED3_Rad (2).png differ diff --git a/Pictures/Icos/LED3_Yello.png b/Pictures/Icos/LED3_Yello.png index 9868e7a..bd5ff04 100644 Binary files a/Pictures/Icos/LED3_Yello.png and b/Pictures/Icos/LED3_Yello.png differ diff --git a/Pictures/Icos/Pos.png b/Pictures/Icos/Pos.png index b485e28..e197f5a 100644 Binary files a/Pictures/Icos/Pos.png and b/Pictures/Icos/Pos.png differ diff --git a/Pictures/Icos/Slider_C.png b/Pictures/Icos/Slider_C.png index 9bb2613..e62fd9e 100644 Binary files a/Pictures/Icos/Slider_C.png and b/Pictures/Icos/Slider_C.png differ diff --git a/Pictures/Icos/Slider_O.png b/Pictures/Icos/Slider_O.png index 7b5715f..38f2538 100644 Binary files a/Pictures/Icos/Slider_O.png and b/Pictures/Icos/Slider_O.png differ diff --git a/Pictures/Icos/Slider_X.png b/Pictures/Icos/Slider_X.png index 0d1b9d5..c02df2e 100644 Binary files a/Pictures/Icos/Slider_X.png and b/Pictures/Icos/Slider_X.png differ diff --git a/Pictures/Icos/Sursor.png b/Pictures/Icos/Sursor.png index 62640fb..95fd054 100644 Binary files a/Pictures/Icos/Sursor.png and b/Pictures/Icos/Sursor.png differ diff --git a/Pictures/Icos/arrow1.png b/Pictures/Icos/arrow1.png index 17465d3..8fff396 100644 Binary files a/Pictures/Icos/arrow1.png and b/Pictures/Icos/arrow1.png differ diff --git a/Pictures/Icos/arrow2.png b/Pictures/Icos/arrow2.png index 2e99786..e9d6d4e 100644 Binary files a/Pictures/Icos/arrow2.png and b/Pictures/Icos/arrow2.png differ diff --git a/Pictures/Icos/arrow3.png b/Pictures/Icos/arrow3.png index e725fa4..efed80c 100644 Binary files a/Pictures/Icos/arrow3.png and b/Pictures/Icos/arrow3.png differ diff --git a/Pictures/Icos/arrow_down.png b/Pictures/Icos/arrow_down.png index 176dddb..4aa3591 100644 Binary files a/Pictures/Icos/arrow_down.png and b/Pictures/Icos/arrow_down.png differ diff --git a/Pictures/Icos/arrow_left.png b/Pictures/Icos/arrow_left.png index ee30f77..94f3e6b 100644 Binary files a/Pictures/Icos/arrow_left.png and b/Pictures/Icos/arrow_left.png differ diff --git a/Pictures/Icos/arrow_right.png b/Pictures/Icos/arrow_right.png index f7e5e42..d3af426 100644 Binary files a/Pictures/Icos/arrow_right.png and b/Pictures/Icos/arrow_right.png differ diff --git a/Pictures/Icos/arrow_up.png b/Pictures/Icos/arrow_up.png index d32e2af..de8a5db 100644 Binary files a/Pictures/Icos/arrow_up.png and b/Pictures/Icos/arrow_up.png differ diff --git a/Pictures/Icos/ico_Haul.png b/Pictures/Icos/ico_Haul.png index 8ad7390..3210786 100644 Binary files a/Pictures/Icos/ico_Haul.png and b/Pictures/Icos/ico_Haul.png differ diff --git a/Pictures/Icos/ico_Haul1.png b/Pictures/Icos/ico_Haul1.png index d0357a2..005d7fe 100644 Binary files a/Pictures/Icos/ico_Haul1.png and b/Pictures/Icos/ico_Haul1.png differ diff --git a/Pictures/Icos/ico_Haul3.png b/Pictures/Icos/ico_Haul3.png index 49fb72c..5eee0df 100644 Binary files a/Pictures/Icos/ico_Haul3.png and b/Pictures/Icos/ico_Haul3.png differ diff --git a/Pictures/Icos/icon_Close1.png b/Pictures/Icos/icon_Close1.png index 64a5590..c5121ee 100644 Binary files a/Pictures/Icos/icon_Close1.png and b/Pictures/Icos/icon_Close1.png differ diff --git a/Pictures/Icos/icon_Close2.png b/Pictures/Icos/icon_Close2.png index 9a1eff1..fdd9baa 100644 Binary files a/Pictures/Icos/icon_Close2.png and b/Pictures/Icos/icon_Close2.png differ diff --git a/Pictures/Icos/icon_Close3.png b/Pictures/Icos/icon_Close3.png index d196578..7f389f1 100644 Binary files a/Pictures/Icos/icon_Close3.png and b/Pictures/Icos/icon_Close3.png differ diff --git a/Pictures/Icos/icon_Help1.png b/Pictures/Icos/icon_Help1.png index 1d3ba64..760a043 100644 Binary files a/Pictures/Icos/icon_Help1.png and b/Pictures/Icos/icon_Help1.png differ diff --git a/Pictures/Icos/icon_Help2.png b/Pictures/Icos/icon_Help2.png index 8c24254..8c39cec 100644 Binary files a/Pictures/Icos/icon_Help2.png and b/Pictures/Icos/icon_Help2.png differ diff --git a/Pictures/Icos/icon_Help3.png b/Pictures/Icos/icon_Help3.png index 2cf5754..c6a5d3a 100644 Binary files a/Pictures/Icos/icon_Help3.png and b/Pictures/Icos/icon_Help3.png differ diff --git a/Pictures/Icos/icon_health_warning.png b/Pictures/Icos/icon_health_warning.png index 8ce6562..fbdadf8 100644 Binary files a/Pictures/Icos/icon_health_warning.png and b/Pictures/Icos/icon_health_warning.png differ diff --git a/Pictures/Icos/icon_magnify1.png b/Pictures/Icos/icon_magnify1.png index dd7c7a6..1383449 100644 Binary files a/Pictures/Icos/icon_magnify1.png and b/Pictures/Icos/icon_magnify1.png differ diff --git a/Pictures/Icos/icon_magnify2.png b/Pictures/Icos/icon_magnify2.png index c478cfb..22fc0da 100644 Binary files a/Pictures/Icos/icon_magnify2.png and b/Pictures/Icos/icon_magnify2.png differ diff --git a/Pictures/Icos/icon_reduce1.png b/Pictures/Icos/icon_reduce1.png index c507936..8f152e2 100644 Binary files a/Pictures/Icos/icon_reduce1.png and b/Pictures/Icos/icon_reduce1.png differ diff --git a/Pictures/Icos/icon_reduce2.png b/Pictures/Icos/icon_reduce2.png index 32cf2b9..cd35d8b 100644 Binary files a/Pictures/Icos/icon_reduce2.png and b/Pictures/Icos/icon_reduce2.png differ diff --git a/Pictures/Icos/icon_shorten.png b/Pictures/Icos/icon_shorten.png index 8e94bb3..f5f9e0c 100644 Binary files a/Pictures/Icos/icon_shorten.png and b/Pictures/Icos/icon_shorten.png differ diff --git a/Pictures/Icos/icon_stretch.png b/Pictures/Icos/icon_stretch.png index 87e35b5..eb5f898 100644 Binary files a/Pictures/Icos/icon_stretch.png and b/Pictures/Icos/icon_stretch.png differ diff --git a/Pictures/Icos/logo.png b/Pictures/Icos/logo.png index 6299d08..53ca865 100644 Binary files a/Pictures/Icos/logo.png and b/Pictures/Icos/logo.png differ diff --git a/Pictures/Icos/图层 6.png b/Pictures/Icos/图层 6.png index 28afc68..fdc327b 100644 Binary files a/Pictures/Icos/图层 6.png and b/Pictures/Icos/图层 6.png differ diff --git a/Pictures/Imgs/CCC.png b/Pictures/Imgs/CCC.png index d2e6fcd..37ec871 100644 Binary files a/Pictures/Imgs/CCC.png and b/Pictures/Imgs/CCC.png differ diff --git a/Pictures/Imgs/CurrentSersor.png b/Pictures/Imgs/CurrentSersor.png index bf6709b..2255d37 100644 Binary files a/Pictures/Imgs/CurrentSersor.png and b/Pictures/Imgs/CurrentSersor.png differ diff --git a/Pictures/Imgs/EJM_Device.png b/Pictures/Imgs/EJM_Device.png index 990cad5..1ab03d9 100644 Binary files a/Pictures/Imgs/EJM_Device.png and b/Pictures/Imgs/EJM_Device.png differ diff --git a/Pictures/Imgs/IOX.png b/Pictures/Imgs/IOX.png index 363b00e..491a539 100644 Binary files a/Pictures/Imgs/IOX.png and b/Pictures/Imgs/IOX.png differ diff --git a/Pictures/Imgs/LB60.png b/Pictures/Imgs/LB60.png index bf4caa7..26cdbdf 100644 Binary files a/Pictures/Imgs/LB60.png and b/Pictures/Imgs/LB60.png differ diff --git a/Pictures/Imgs/MIR785-W.png b/Pictures/Imgs/MIR785-W.png index 0738289..43a1f8f 100644 Binary files a/Pictures/Imgs/MIR785-W.png and b/Pictures/Imgs/MIR785-W.png differ diff --git a/Pictures/Imgs/MOXA.png b/Pictures/Imgs/MOXA.png index f9c860e..e04a739 100644 Binary files a/Pictures/Imgs/MOXA.png and b/Pictures/Imgs/MOXA.png differ diff --git a/Pictures/Imgs/MatrixKeyboard.png b/Pictures/Imgs/MatrixKeyboard.png index d897fd9..e202414 100644 Binary files a/Pictures/Imgs/MatrixKeyboard.png and b/Pictures/Imgs/MatrixKeyboard.png differ diff --git a/Pictures/Imgs/Offline.png b/Pictures/Imgs/Offline.png index 3509416..b06bbc0 100644 Binary files a/Pictures/Imgs/Offline.png and b/Pictures/Imgs/Offline.png differ diff --git a/Pictures/Imgs/Oil.png b/Pictures/Imgs/Oil.png index 3d7fecf..c6cb8b4 100644 Binary files a/Pictures/Imgs/Oil.png and b/Pictures/Imgs/Oil.png differ diff --git a/Pictures/Imgs/PLC_Min.png b/Pictures/Imgs/PLC_Min.png index f885aea..5dd6761 100644 Binary files a/Pictures/Imgs/PLC_Min.png and b/Pictures/Imgs/PLC_Min.png differ diff --git a/Pictures/Imgs/Remote.png b/Pictures/Imgs/Remote.png index d993764..7924d67 100644 Binary files a/Pictures/Imgs/Remote.png and b/Pictures/Imgs/Remote.png differ diff --git a/Pictures/Imgs/Remote_1.png b/Pictures/Imgs/Remote_1.png index 65775a9..cf37ea1 100644 Binary files a/Pictures/Imgs/Remote_1.png and b/Pictures/Imgs/Remote_1.png differ diff --git a/Pictures/Imgs/Remote_2.png b/Pictures/Imgs/Remote_2.png index f7fdcc3..65c2c5f 100644 Binary files a/Pictures/Imgs/Remote_2.png and b/Pictures/Imgs/Remote_2.png differ diff --git a/Pictures/Imgs/newbg_all.png b/Pictures/Imgs/newbg_all.png index a7f916d..2383ca4 100644 Binary files a/Pictures/Imgs/newbg_all.png and b/Pictures/Imgs/newbg_all.png differ diff --git a/Pictures/Imgs/pro_05.png b/Pictures/Imgs/pro_05.png index b35d69c..d4ce1c9 100644 Binary files a/Pictures/Imgs/pro_05.png and b/Pictures/Imgs/pro_05.png differ diff --git a/Pictures/Imgs/摄像头.png b/Pictures/Imgs/摄像头.png index bdf4493..8039f0b 100644 Binary files a/Pictures/Imgs/摄像头.png and b/Pictures/Imgs/摄像头.png differ diff --git a/Pictures/null.png b/Pictures/null.png index e11ed3d..c188ac0 100644 Binary files a/Pictures/null.png and b/Pictures/null.png differ diff --git a/Pictures/sRGB.icc b/Pictures/sRGB.icc new file mode 100644 index 0000000..cbb16d4 Binary files /dev/null and b/Pictures/sRGB.icc differ diff --git a/Pictures/批量修改为sRGB图片.ps1 b/Pictures/批量修改为sRGB图片.ps1 new file mode 100644 index 0000000..ae6aa45 --- /dev/null +++ b/Pictures/批量修改为sRGB图片.ps1 @@ -0,0 +1,40 @@ +# 配置图片根目录(已填写你的路径) +$rootDirectory = ".\" + +# 要处理的图片格式(仅处理PNG,可根据需要添加其他格式) +$imageExtensions = @("*.png") + +# ImageMagick的magick命令路径(默认安装路径,需根据实际安装情况修改) +$magickPath = "D:\Application\ImageMagick-7.1.2-Q16-HDRI\magick.exe" + +# 检查magick.exe是否存在 +if (-not (Test-Path $magickPath)) { + Write-Host "错误:未找到magick.exe,请检查ImageMagick安装路径是否正确!" -ForegroundColor Red + Write-Host "提示:默认路径为C:\Program Files\ImageMagick-版本号\magick.exe" -ForegroundColor Yellow + exit +} + +# 递归查找所有图片文件 +$imageFiles = Get-ChildItem -Path $rootDirectory -Include $imageExtensions -Recurse -File + +if ($imageFiles.Count -eq 0) { + Write-Host "未找到任何图片文件" -ForegroundColor Yellow + exit +} + +# 批量处理图片 +foreach ($file in $imageFiles) { + Write-Host "正在处理: $($file.FullName)" + + # 使用magick命令,路径添加引号处理特殊字符 + & $magickPath "$($file.FullName)" -strip "$($file.FullName)" + + # 检查处理结果 + if ($LASTEXITCODE -eq 0) { + Write-Host "✅ 处理成功: $($file.Name)" -ForegroundColor Green + } else { + Write-Host "❌ 处理失败: $($file.Name)" -ForegroundColor Red + } +} + +Write-Host "`n处理完成,共处理了 $($imageFiles.Count) 个文件" -ForegroundColor Cyan diff --git a/PublicFunctions/Basic.cpp b/PublicFunctions/Basic.cpp index 50edafc..e0c661b 100644 --- a/PublicFunctions/Basic.cpp +++ b/PublicFunctions/Basic.cpp @@ -1,5 +1,5 @@ #include "Basic.h" - +#include /** * @brief map 映射函数,把x的值,映射到out_min到out_max的范围内 @@ -173,4 +173,99 @@ uint16_t extractUInt32_16BitPart(uint32_t data, int index) { return 00; } } +/** + * @brief getNodeValue 获取节点内的值 + * @param nodeId 欲获取的节点文本 + * @return 类型:QVariant 节点的值 + */ +QVariant getNodeValue(const QString &nodeId){ + QString mNodeID = nodeId; + if(!mNodeID.contains("ns=6;s=::AsGlobalPV:")) + mNodeID = "ns=6;s=::AsGlobalPV:"+mNodeID; + return gOPC_NodeValue[mNodeID]; +} +/** + * @brief getColorStr 获取颜色文本 + * @param Str 欲获取的文本内容 + * @return 返回颜色文本 + */ +QString getColorStr(QString str) +{ + /* + 颜色文本的表现形式: + color: rgb(255, 0, 0); + color: #ff0000; + 颜色文本格式: + color: rgb(255, 0, 0); + color: rgb(255, 0, 0) + rgb(255, 0, 0) + rgb(255, 0, 0); + 255, 0, 0 + 255, 0, 0; + + color: #ff0000 + color: #ff0000; + #ff0000 + #ff0000; + ff0000 + ff0000; + */ + str = str.trimmed(); + + /* 1. 先尝试匹配 rgb(r, g, b) 形式 */ + static QRegularExpression reRgb( + R"(^\s*(?:color\s*:\s*)?rgb\s*\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*\);?\s*$)", + QRegularExpression::CaseInsensitiveOption); + auto match = reRgb.match(str); + if (match.hasMatch()) { + int r = match.captured(1).toInt(); + int g = match.captured(2).toInt(); + int b = match.captured(3).toInt(); + return QString("color: rgb(%1, %2, %3);").arg(r).arg(g).arg(b); + } + + /* 2. 再尝试匹配 #hex 或裸 hex 形式 */ + static QRegularExpression reHex( + R"(^\s*(?:color\s*:\s*)?(?:#)?([0-9a-f]{6});?\s*$)", + QRegularExpression::CaseInsensitiveOption); + match = reHex.match(str); + if (match.hasMatch()) { + QString hex = match.captured(1).toLower(); + return QString("color: #%1;").arg(hex); + } + + /* 3. 都不符合,原样返回(或按需返回空串) */ + return str; +} +/** + * @brief getColor + * @param str 任意颜色字符串 + * @return QColor(无效 QColor 表示解析失败) + */ +QColor getColor(const QString &str) +{ + QString s = str.trimmed(); + + /* 1. rgb(r, g, b) */ + static QRegularExpression reRgb( + R"(^\s*(?:color\s*:\s*)?rgb\s*\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*\);?\s*$)", + QRegularExpression::CaseInsensitiveOption); + auto m = reRgb.match(s); + if (m.hasMatch()) { + int r = m.captured(1).toInt(); + int g = m.captured(2).toInt(); + int b = m.captured(3).toInt(); + return QColor(r, g, b); + } + + /* 2. #RRGGBB 或 RRGGBB */ + static QRegularExpression reHex( + R"(^\s*(?:color\s*:\s*)?(?:#)?([0-9a-fA-F]{6});?\s*$)"); + m = reHex.match(s); + if (m.hasMatch()) + return QColor('#' + m.captured(1)); // QColor 接受 "#ff0000" + + /* 3. 解析失败 */ + return QColor(); // 无效颜色 +} diff --git a/PublicFunctions/Basic.h b/PublicFunctions/Basic.h index ec1cd53..d7195e9 100644 --- a/PublicFunctions/Basic.h +++ b/PublicFunctions/Basic.h @@ -1,9 +1,10 @@ #ifndef BASIC_H #define BASIC_H #include +#include #include #include - +#include /** * @brief map 映射函数,把x的值,映射到out_min到out_max的范围内 @@ -81,4 +82,25 @@ uint8_t extractUInt32_8BitPart(uint32_t data, uint8_t index); * @throws std::out_of_range 当索引超出0-1范围时 */ uint16_t extractUInt32_16BitPart(uint32_t data, int index); + +/** + * @brief getNodeValue 获取节点内的值 + * @param nodeId 欲获取的节点文本 + * @return 类型:QVariant 节点的值 + */ +QVariant getNodeValue(const QString &nodeId); + +/** + * @brief getColorStr 获取颜色文本 + * @param Str 欲获取的文本内容 + * @return 返回颜色文本 + */ +QString getColorStr(QString Str); + +/** + * @brief getColor + * @param str 任意颜色字符串 + * @return QColor(无效 QColor 表示解析失败) + */ +QColor getColor(const QString &str); #endif // BASIC_H