This commit is contained in:
2025-10-20 22:28:37 +08:00
parent eeb5af98eb
commit 7d148d79c9
429 changed files with 13624 additions and 586480 deletions

View File

@@ -7,7 +7,7 @@ P501_LoaderPage::P501_LoaderPage(QWidget *parent) :
ui(new Ui::P501_LoaderPage)
{
ui->setupUi(this);
QTimer::singleShot(10, this, &P501_LoaderPage::WinInit);
// QTimer::singleShot(5000, this, &P501_LoaderPage::WinInit);
// QTimer::singleShot(2000, this, &P501_LoaderPage::Show3D);
@@ -21,33 +21,33 @@ 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);
QString TextObjName = QString("Loader_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*
ui->CPW_L1->addSeries("左U", Qt::green);
ui->CPW_L1->addSeries("左V", Qt::blue);
ui->CPW_L1->addSeries("左W", Qt::darkCyan);
// 现在 ui->CPW_1 已经是一个 CurvePlotWidget*
ui->CPW_L2->addSeries("左温", Qt::green);
// 现在 ui->Loader_CPW_1 已经是一个 CurvePlotWidget*
ui->Loader_CPW_L1->addSeries("左U", Qt::green);
ui->Loader_CPW_L1->addSeries("左V", Qt::blue);
ui->Loader_CPW_L1->addSeries("左W", Qt::darkCyan);
// 现在 ui->Loader_CPW_1 已经是一个 CurvePlotWidget*
ui->Loader_CPW_L2->addSeries("左温", Qt::green);
// 现在 ui->CPW_1 已经是一个 CurvePlotWidget*
ui->CPW_R1->addSeries("右U", Qt::green);
ui->CPW_R1->addSeries("右V", Qt::blue);
ui->CPW_R1->addSeries("右W", Qt::darkCyan);
// 现在 ui->CPW_1 已经是一个 CurvePlotWidget*
ui->CPW_R2->addSeries("右温", Qt::green);
// 现在 ui->Loader_CPW_1 已经是一个 CurvePlotWidget*
ui->Loader_CPW_R1->addSeries("右U", Qt::green);
ui->Loader_CPW_R1->addSeries("右V", Qt::blue);
ui->Loader_CPW_R1->addSeries("右W", Qt::darkCyan);
// 现在 ui->Loader_CPW_1 已经是一个 CurvePlotWidget*
ui->Loader_CPW_R2->addSeries("右温", Qt::green);
//所用定时器初始化
QTimer* UIRefresh_Timer = new QTimer(this);
@@ -58,7 +58,7 @@ void P501_LoaderPage::WinInit(){
//所用定时器初始化
QTimer* TrailRefresh_Timer = new QTimer(this);
connect(TrailRefresh_Timer, &QTimer::timeout, this, &P501_LoaderPage::TrailRefreshTimeOut);
TrailRefresh_Timer->setInterval(ConfigFiles().TrailRefreshTime * 1000); // 设置定时器间隔为 1000 毫秒1 秒)
TrailRefresh_Timer->setInterval(10000); // 设置定时器间隔为 1000 毫秒1 秒)
TrailRefresh_Timer->start();
}
void P501_LoaderPage::Show3D()
@@ -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,17 +166,17 @@ 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()
{
if(!gPageIndexStr.contains("P501"))
if(!gPageIndexStr.contains("P05"))
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("Loader_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->Loader_CPW_L1->appendPoint(0, getNodeValue("IN_PhaseLoaderL.Filtered30_U") .toReal());
ui->Loader_CPW_L1->appendPoint(1, getNodeValue("IN_PhaseLoaderL.Filtered30_V") .toReal());
ui->Loader_CPW_L1->appendPoint(2, getNodeValue("IN_PhaseLoaderL.Filtered30_W") .toReal());
ui->Loader_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->Loader_CPW_R1->appendPoint(0, getNodeValue("IN_PhaseLoaderR.Filtered30_U") .toReal());
ui->Loader_CPW_R1->appendPoint(1, getNodeValue("IN_PhaseLoaderR.Filtered30_V") .toReal());
ui->Loader_CPW_R1->appendPoint(2, getNodeValue("IN_PhaseLoaderR.Filtered30_W") .toReal());
ui->Loader_CPW_R2->appendPoint(0,getNodeValue("IN_PhaseLoaderR.Filtered_Temp") .toDouble());
}
void P501_LoaderPage::RotateDev(){