增加UI配置项

This commit is contained in:
2025-10-16 17:40:00 +08:00
parent eeb5af98eb
commit f88b815723
181 changed files with 718 additions and 465 deletions

View File

@@ -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<uint16_t>(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<uint16_t>(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<QLabel*>(QString("Text_SSConditions_%1").arg(i));
QLabel* Label = findChild<QLabel*>(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());
}