增加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

@@ -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<uint16_t>(PB_Group1 >> 16); // 高 16 位
uint16_t PColor = static_cast<uint16_t>(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<uint16_t>(PB_Group1 >> 16); // 高 16 位
uint16_t PercentageCurV = static_cast<uint16_t>(PB_Group1 & 0xFFFF);// 低 16 位
@@ -401,19 +401,19 @@ void P01_MianPage::PB_Refresh(QString Dev){
uint16_t PercentageMotorTemp = static_cast<uint16_t>(PB_MotorTemp >> 16); // 高 16 位
uint16_t ColorTemp = static_cast<uint16_t>(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<int16_t>(SideView >> 16); // 高 16 位
int16_t Roller_SideY = static_cast<int16_t>(SideView & 0xFFFF);// 低 16 位