增加UI配置项
This commit is contained in:
@@ -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<QLabel*>(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<uint16_t>(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<uint16_t>(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<uint16_t>(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<QLabel*>(QString("Text_SSConditions_%1").arg(i));
|
||||
QLabel* Label = findChild<QLabel*>(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(){
|
||||
|
||||
Reference in New Issue
Block a user