修改画面载入逻辑(未成功)
This commit is contained in:
@@ -11,23 +11,14 @@ P08_AlarmPage::P08_AlarmPage(QWidget *parent) :
|
||||
ui(new Ui::P08_AlarmPage)
|
||||
{
|
||||
ui->setupUi(this);
|
||||
WinInit();
|
||||
QTimer::singleShot(3000, this, &P08_AlarmPage::WinInit);
|
||||
}
|
||||
|
||||
P08_AlarmPage::~P08_AlarmPage()
|
||||
{
|
||||
delete ui;
|
||||
}
|
||||
uint16_t OldAlarmCode = 0;
|
||||
void P08_AlarmPage::WinInit()
|
||||
{
|
||||
OldAlarmCode = 0;
|
||||
//所用定时器初始化
|
||||
QTimer* UIRefresh_Timer = new QTimer(this);
|
||||
connect(UIRefresh_Timer, &QTimer::timeout, this, &P08_AlarmPage::UIRefreshTimeOut);
|
||||
UIRefresh_Timer->setInterval(100); // 设置定时器间隔为 1000 毫秒(1 秒)
|
||||
UIRefresh_Timer->start();
|
||||
}
|
||||
|
||||
static QColor parseCssRgb(const QString &css)
|
||||
{
|
||||
// 正则把 "rgb(255, 0, 0)" 里的数字抠出来
|
||||
@@ -39,17 +30,18 @@ static QColor parseCssRgb(const QString &css)
|
||||
m.captured(3).toInt());
|
||||
return Qt::black; // 解析失败就回退到黑色
|
||||
}
|
||||
|
||||
void P08_AlarmPage::UIRefreshTimeOut()
|
||||
void P08_AlarmPage::WinInit()
|
||||
{
|
||||
|
||||
uint16_t NewAlarmCode = gOPC_NodeValue["ns=6;s=::AsGlobalPV:AlarmCode.New"] .toUInt();
|
||||
if (NewAlarmCode == OldAlarmCode)
|
||||
return;
|
||||
ui->ListWidget_AlarmList->clear();
|
||||
|
||||
m_oldAlarmCode = 0;
|
||||
//所用定时器初始化
|
||||
QTimer* UIRefresh_Timer = new QTimer(this);
|
||||
connect(UIRefresh_Timer, &QTimer::timeout, this, &P08_AlarmPage::UIRefreshTimeOut);
|
||||
UIRefresh_Timer->setInterval(100); // 设置定时器间隔为 1000 毫秒(1 秒)
|
||||
UIRefresh_Timer->start();
|
||||
#if defined(Q_OS_LINUX)
|
||||
auto rows = P08_sql.selectLatest("AlarmHistory", 100);
|
||||
for (const auto &row : rows) {
|
||||
|
||||
// 0 时间 1 报警内容 2 排查方法 3 报警代码
|
||||
QDateTime t = row[0].toDateTime();
|
||||
QString text1 = row[1].toString();
|
||||
@@ -70,8 +62,39 @@ void P08_AlarmPage::UIRefreshTimeOut()
|
||||
item->setForeground(parseCssRgb(colorStr));
|
||||
ui->ListWidget_AlarmList->addItem(item);
|
||||
|
||||
if(m_oldAlarmCode == 0)
|
||||
m_oldAlarmCode = code;
|
||||
}
|
||||
|
||||
OldAlarmCode = NewAlarmCode;
|
||||
#elif defined(Q_OS_WIN)
|
||||
//qDebug() << All_SqlTable[i] << otherFields;
|
||||
#endif
|
||||
|
||||
}
|
||||
|
||||
|
||||
void P08_AlarmPage::UIRefreshTimeOut()
|
||||
{
|
||||
|
||||
uint16_t NewAlarmCode = gOPC_NodeValue["ns=6;s=::AsGlobalPV:AlarmCode.New"].toUInt();
|
||||
if (NewAlarmCode == m_oldAlarmCode)
|
||||
return;
|
||||
m_oldAlarmCode = NewAlarmCode;
|
||||
|
||||
|
||||
// 2. 解析设备码 + 索引码
|
||||
uint8_t devCode = NewAlarmCode >> 8; // 高 8 位
|
||||
uint8_t idxCode = NewAlarmCode & 0xFF; // 低 8 位
|
||||
|
||||
|
||||
// 4. 格式化字符串
|
||||
QString timeStr = QDateTime::currentDateTime().toString("MM-dd hh:mm:ss");
|
||||
QString alarmStr = QString("[%1] %2 %3")
|
||||
.arg(timeStr)
|
||||
.arg(QString::number(NewAlarmCode,16))
|
||||
.arg(AlarmText[devCode][idxCode].AlarmText);
|
||||
|
||||
QString colorStr = AlarmText[devCode][idxCode].TextColor;
|
||||
QListWidgetItem *item = new QListWidgetItem(alarmStr);
|
||||
item->setForeground(parseCssRgb(colorStr));
|
||||
ui->ListWidget_AlarmList->addItem(item);
|
||||
}
|
||||
|
||||
@@ -19,6 +19,7 @@ private slots:
|
||||
void UIRefreshTimeOut();
|
||||
private:
|
||||
Ui::P08_AlarmPage *ui;
|
||||
uint16_t m_oldAlarmCode = 0;
|
||||
};
|
||||
|
||||
#endif // P08_ALARMPAGE_H
|
||||
|
||||
@@ -10,7 +10,7 @@ P301_PumpPage::P301_PumpPage(QWidget *parent) :
|
||||
{
|
||||
ui->setupUi(this);
|
||||
|
||||
WinInit();
|
||||
QTimer::singleShot(1000, this, &P301_PumpPage::WinInit);
|
||||
|
||||
// QTimer::singleShot(2000, this, &P301_PumpPage::Show3D);
|
||||
qDebug()<<"P301_PumpPage 初始化完成!";
|
||||
@@ -158,8 +158,8 @@ void P301_PumpPage::UIRefreshTimeOut()
|
||||
return;
|
||||
uint32_t PB_Group1 = gOPC_NodeValue["ns=6;s=::AsGlobalPV:PB_Curr_Pump.PageGroup1"] .toUInt();
|
||||
uint32_t PB_Group2 = gOPC_NodeValue["ns=6;s=::AsGlobalPV:PB_Curr_Pump.PageGroup2"] .toUInt();
|
||||
uint32_t PB_GroupOilLevel = gOPC_NodeValue["ns=6;s=::AsGlobalPV:PB_Curr_Pump.PageGroup2"] .toUInt();
|
||||
uint32_t PB_GroupOilTemp = gOPC_NodeValue["ns=6;s=::AsGlobalPV:PB_Curr_Pump.PageGroup2"] .toUInt();
|
||||
uint32_t PB_GroupOilLevel = gOPC_NodeValue["ns=6;s=::AsGlobalPV:PB_OilLevel.PageGroup"] .toUInt();
|
||||
uint32_t PB_GroupOilTemp = gOPC_NodeValue["ns=6;s=::AsGlobalPV:PB_OilTemp.PageGroup"] .toUInt();
|
||||
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();
|
||||
@@ -197,8 +197,8 @@ void P301_PumpPage::UIRefreshTimeOut()
|
||||
ui->LCD_Cur_3->display( gOPC_NodeValue["ns=6;s=::AsGlobalPV:IN_PhasePump.Filtered30_W"] .toReal());
|
||||
|
||||
ui->LCD_Temp->display( gOPC_NodeValue["ns=6;s=::AsGlobalPV:IN_PhasePump.Filtered_Temp"] .toReal());
|
||||
ui->LCD_OilLevel->display( gOPC_NodeValue["ns=6;s=::AsGlobalPV:IN_Sersor.OilLevel "] .toReal());
|
||||
ui->LCD_OilTemp->display( gOPC_NodeValue["ns=6;s=::AsGlobalPV:IN_Sersor.OilTemp "] .toReal());
|
||||
ui->LCD_OilLevel->display( gOPC_NodeValue["ns=6;s=::AsGlobalPV:IN_Sersor.OilLevel"] .toReal());
|
||||
ui->LCD_OilTemp->display( gOPC_NodeValue["ns=6;s=::AsGlobalPV:IN_Sersor.OilTemp"] .toReal());
|
||||
|
||||
for (int i = 0; i < 32; ++i) {
|
||||
QLabel* Label = findChild<QLabel*>(QString("Text_SSConditions_%1").arg(i));
|
||||
@@ -216,12 +216,10 @@ void P301_PumpPage::UIRefreshTimeOut()
|
||||
}
|
||||
|
||||
void P301_PumpPage::TrailRefreshTimeOut(){
|
||||
if(this->isHidden())
|
||||
return;
|
||||
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, 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());
|
||||
|
||||
}
|
||||
|
||||
|
||||
@@ -1359,7 +1359,7 @@ QProgressBar::chunk {
|
||||
}</string>
|
||||
</property>
|
||||
<property name="maximum">
|
||||
<number>150</number>
|
||||
<number>1500</number>
|
||||
</property>
|
||||
<property name="value">
|
||||
<number>24</number>
|
||||
@@ -1438,8 +1438,11 @@ QProgressBar::chunk {
|
||||
background-color: #05B8CC;
|
||||
}</string>
|
||||
</property>
|
||||
<property name="minimum">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<property name="maximum">
|
||||
<number>150</number>
|
||||
<number>1000</number>
|
||||
</property>
|
||||
<property name="value">
|
||||
<number>24</number>
|
||||
@@ -1678,6 +1681,8 @@ color: rgb(0, 255, 255);</string>
|
||||
<container>1</container>
|
||||
</customwidget>
|
||||
</customwidgets>
|
||||
<resources/>
|
||||
<resources>
|
||||
<include location="../Pictures/Pictures.qrc"/>
|
||||
</resources>
|
||||
<connections/>
|
||||
</ui>
|
||||
|
||||
@@ -1,14 +1,230 @@
|
||||
#include "P401_CuttingPage.h"
|
||||
#include "ui_P401_CuttingPage.h"
|
||||
#include <GlobalDefinitions/Variable.h>
|
||||
#include <FileOperation/ConfigFiles.h>
|
||||
|
||||
P401_CuttingPage::P401_CuttingPage(QWidget *parent) :
|
||||
QWidget(parent),
|
||||
ui(new Ui::P401_CuttingPage)
|
||||
{
|
||||
ui->setupUi(this);
|
||||
|
||||
QTimer::singleShot(1000, this, &P401_CuttingPage::WinInit);
|
||||
|
||||
// QTimer::singleShot(2000, this, &P401_CuttingPage::Show3D);
|
||||
qDebug()<<"P401_CuttingPage 初始化完成!";
|
||||
|
||||
}
|
||||
|
||||
P401_CuttingPage::~P401_CuttingPage()
|
||||
{
|
||||
delete ui;
|
||||
}
|
||||
|
||||
void P401_CuttingPage::WinInit(){
|
||||
|
||||
for (int row = 1; row < PumpConditionConfigFile.size(); ++row)
|
||||
{
|
||||
QString TextObjName = QString("Text_SSConditions_%1").arg(row);
|
||||
QLabel* Label = findChild<QLabel*>(TextObjName);
|
||||
if (Label) {
|
||||
QString Text = PumpConditionConfigFile.at(row)[1];
|
||||
Text.replace("\\n","\n",Qt::CaseInsensitive);
|
||||
Label->setText(Text);
|
||||
}
|
||||
|
||||
TrueColor.append(PumpConditionConfigFile.at(row)[2]);
|
||||
FalseColor.append(PumpConditionConfigFile.at(row)[3]);
|
||||
}
|
||||
|
||||
// 现在 ui->CPW_1 已经是一个 CurvePlotWidget*
|
||||
ui->CPW_1->addSeries("电机电流U", Qt::green);
|
||||
ui->CPW_1->addSeries("电机电流V", Qt::blue);
|
||||
ui->CPW_1->addSeries("电机电流W", Qt::darkCyan);
|
||||
// 现在 ui->CPW_1 已经是一个 CurvePlotWidget*
|
||||
ui->CPW_2->addSeries("电机温度", Qt::green);
|
||||
|
||||
|
||||
//所用定时器初始化
|
||||
QTimer* UIRefresh_Timer = new QTimer(this);
|
||||
connect(UIRefresh_Timer, &QTimer::timeout, this, &P401_CuttingPage::UIRefreshTimeOut);
|
||||
UIRefresh_Timer->setInterval(100); // 设置定时器间隔为 1000 毫秒(1 秒)
|
||||
UIRefresh_Timer->start();
|
||||
|
||||
//所用定时器初始化
|
||||
QTimer* TrailRefresh_Timer = new QTimer(this);
|
||||
connect(TrailRefresh_Timer, &QTimer::timeout, this, &P401_CuttingPage::TrailRefreshTimeOut);
|
||||
TrailRefresh_Timer->setInterval(100); // 设置定时器间隔为 1000 毫秒(1 秒)
|
||||
TrailRefresh_Timer->start();
|
||||
}
|
||||
void P401_CuttingPage::Show3D()
|
||||
{
|
||||
DevName3D = "泵站电机";
|
||||
mObjLoader = new ObjLoader();
|
||||
mObjLoader->setEnDebug(true);
|
||||
mObjLoader->init3DScene(ui->Frame_Dev3D);
|
||||
mObjLoader->setCameraSpeed(200.0, 200.0);
|
||||
|
||||
// 准备模型路径
|
||||
QString filePath = "./3D模型文件/掘锚一体机/电机/" + DevName3D + ".obj";
|
||||
m_currentDevName = DevName3D;
|
||||
m_currentFilePath = filePath;
|
||||
m_currentPosition = QVector3D(-407.46, -59.49, 0);
|
||||
|
||||
// 检查文件是否存在
|
||||
if (!QFile::exists(filePath)) {
|
||||
qCritical() << "模型文件不存在: " << filePath;
|
||||
return;
|
||||
}
|
||||
|
||||
// 创建工作线程和工作对象
|
||||
m_workerThread = new QThread(this);
|
||||
m_workerLoader = new ObjLoader(); // 专用预处理加载器
|
||||
|
||||
// 移动工作对象到工作线程
|
||||
m_workerLoader->moveToThread(m_workerThread);
|
||||
|
||||
// 连接信号槽
|
||||
connect(m_workerThread, &QThread::started, [=]() {
|
||||
// 在工作线程中预处理模型(仅计算中心和半径)
|
||||
QVector3D center = m_workerLoader->parseObjCenter(filePath);
|
||||
float radius = m_workerLoader->calculateModelRadiusFromFile(filePath);
|
||||
emit preprocessFinished(center, radius);
|
||||
});
|
||||
|
||||
// 预处理完成后,在主线程加载模型
|
||||
connect(this, &P401_CuttingPage::preprocessFinished, this, [=](QVector3D center, float radius) {
|
||||
m_modelCenter = center;
|
||||
m_modelRadius = radius;
|
||||
|
||||
// 使用定时器确保在主线程事件循环中执行
|
||||
QTimer::singleShot(0, this, [=]() {
|
||||
emit loadModelRequest(m_currentDevName, m_currentFilePath, center, radius);
|
||||
});
|
||||
|
||||
// 清理工作线程
|
||||
m_workerThread->quit();
|
||||
m_workerThread->wait();
|
||||
m_workerLoader->deleteLater();
|
||||
});
|
||||
|
||||
// 主线程中实际加载模型
|
||||
connect(this, &P401_CuttingPage::loadModelRequest, this, [=](const QString& devName, const QString& filePath, QVector3D center, float radius) {
|
||||
bool LoaderOK = mObjLoader->loadModelAsync(devName, filePath, QVector3D(0, 0, 0), center, radius);
|
||||
if (!LoaderOK) {
|
||||
qCritical() << "泵站电机加载:失败";
|
||||
return;
|
||||
}
|
||||
|
||||
mObjLoader->addAxisGizmo(nullptr, 5.0f);
|
||||
mObjLoader->addAxisGizmo(mObjLoader->getDevice(devName)->entity, 3.0f);
|
||||
SetPos(0.005,QVector3D(-407.46, -59.49, 0),QVector3D(0, 0, 0));//409.5, 59.5, 0
|
||||
|
||||
if (LoaderOK) {
|
||||
QTimer *RotateDev_Timer = new QTimer(this);
|
||||
connect(RotateDev_Timer, &QTimer::timeout, this, &P401_CuttingPage::RotateDev);
|
||||
RotateDev_Timer->setInterval(33);
|
||||
RotateDev_Timer->start();
|
||||
}
|
||||
});
|
||||
|
||||
// 启动工作线程
|
||||
m_workerThread->start();
|
||||
}
|
||||
|
||||
void P401_CuttingPage::SetPos(float Zoom,QVector3D Move,QVector3D Pos){
|
||||
|
||||
mObjLoader->scaleDevice(DevName3D,Zoom);
|
||||
mObjLoader->moveArmLocalOriginTo(DevName3D, Move);//14.1, -1.4, 3.4
|
||||
mObjLoader->setParentDevicePosition(DevName3D, Pos); // 世界坐标
|
||||
|
||||
// 6. 重置相机(确保能看到所有设备)
|
||||
Qt3DRender::QCamera* cam = mObjLoader->getCamera();
|
||||
if (cam) {
|
||||
cam->setPosition(QVector3D(0, 3, 12)); // 相机在 Z 轴 30 位置,远离模型
|
||||
cam->setViewCenter(QVector3D(0, 0, 0)); // 看向电控箱体的世界位置
|
||||
}
|
||||
}
|
||||
void P401_CuttingPage::SetProgressBar(QProgressBar *PB,uint16_t Value,uint8_t ColorIndex,QStringList Color){
|
||||
PB->setValue(Value);
|
||||
if(ColorIndex < Color.length()){
|
||||
PB->setStyleSheet("QProgressBar {\n background-color: transparent;\n border: 2px solid #888888;\n border-radius: 3px;\n}\nQProgressBar::chunk {\n background-color:"+Color[ColorIndex]+";\n}");
|
||||
}
|
||||
}
|
||||
void P401_CuttingPage::UIRefreshTimeOut()
|
||||
{
|
||||
if(this->isHidden())
|
||||
return;
|
||||
uint32_t PB_Group1 = gOPC_NodeValue["ns=6;s=::AsGlobalPV:PB_Curr_Pump.PageGroup1"] .toUInt();
|
||||
uint32_t PB_Group2 = gOPC_NodeValue["ns=6;s=::AsGlobalPV:PB_Curr_Pump.PageGroup2"] .toUInt();
|
||||
uint32_t PB_GroupOilLevel = gOPC_NodeValue["ns=6;s=::AsGlobalPV:PB_OilLevel.PageGroup"] .toUInt();
|
||||
uint32_t PB_GroupOilTemp = gOPC_NodeValue["ns=6;s=::AsGlobalPV:PB_OilTemp.PageGroup"] .toUInt();
|
||||
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();
|
||||
|
||||
|
||||
uint16_t PercentageCurU = static_cast<uint16_t>(PB_Group1 >> 16); // 高 16 位
|
||||
uint16_t PercentageCurV = static_cast<uint16_t>(PB_Group1 & 0xFFFF);// 低 16 位
|
||||
uint16_t PercentageCurW = static_cast<uint16_t>(PB_Group2 >> 16); // 高 16 位
|
||||
uint16_t PercentageTmpColor = static_cast<uint16_t>(PB_Group2 & 0xFFFF);// 低 16 位
|
||||
|
||||
uint8_t ColorU = (PercentageTmpColor / 10) % 10;
|
||||
uint8_t ColorV = (PercentageTmpColor / 100) % 10;
|
||||
uint8_t ColorW = PercentageTmpColor % 10;
|
||||
|
||||
|
||||
uint16_t PercentageOilLevel = static_cast<uint16_t>(PB_GroupOilLevel >> 16); // 高 16 位
|
||||
uint16_t ColorOilLevel = static_cast<uint16_t>(PB_GroupOilLevel & 0xFFFF);// 低 16 位
|
||||
|
||||
uint16_t PercentageOilTemp = static_cast<uint16_t>(PB_GroupOilTemp >> 16); // 高 16 位
|
||||
uint16_t ColorOilTemp = static_cast<uint16_t>(PB_GroupOilTemp & 0xFFFF);// 低 16 位
|
||||
|
||||
uint16_t PercentageMotorTemp = static_cast<uint16_t>(PB_MotorTemp >> 16); // 高 16 位
|
||||
uint16_t ColorTemp = static_cast<uint16_t>(PB_MotorTemp & 0xFFFF);// 低 16 位
|
||||
|
||||
|
||||
SetProgressBar(ui->PB_Cur_1,PercentageCurU,ColorU,glMotorCurColor);
|
||||
SetProgressBar(ui->PB_Cur_2,PercentageCurV,ColorV,glMotorCurColor);
|
||||
SetProgressBar(ui->PB_Cur_3,PercentageCurW,ColorW,glMotorCurColor);
|
||||
SetProgressBar(ui->PB_Temp,PercentageMotorTemp,ColorTemp,glMotorTempColor);
|
||||
// SetProgressBar(ui->PB_OilLevel,PercentageOilLevel,ColorOilLevel,slOilLevel);
|
||||
// SetProgressBar(ui->PB_OilTemp,PercentageOilTemp,ColorOilTemp,slOilTemp);
|
||||
|
||||
ui->LCD_Cur_1->display( gOPC_NodeValue["ns=6;s=::AsGlobalPV:IN_PhasePump.Filtered30_U"] .toReal());
|
||||
ui->LCD_Cur_2->display( gOPC_NodeValue["ns=6;s=::AsGlobalPV:IN_PhasePump.Filtered30_V"] .toReal());
|
||||
ui->LCD_Cur_3->display( gOPC_NodeValue["ns=6;s=::AsGlobalPV:IN_PhasePump.Filtered30_W"] .toReal());
|
||||
|
||||
ui->LCD_Temp->display( gOPC_NodeValue["ns=6;s=::AsGlobalPV:IN_PhasePump.Filtered_Temp"] .toReal());
|
||||
ui->LCD_OilLevel->display( gOPC_NodeValue["ns=6;s=::AsGlobalPV:IN_Sersor.OilLevel"] .toReal());
|
||||
ui->LCD_OilTemp->display( gOPC_NodeValue["ns=6;s=::AsGlobalPV:IN_Sersor.OilTemp"] .toReal());
|
||||
|
||||
for (int i = 0; i < 32; ++i) {
|
||||
QLabel* Label = findChild<QLabel*>(QString("Text_SSConditions_%1").arg(i));
|
||||
if (Label) {
|
||||
QString StyleStr = "border-image: url(:/Frames/null.png);\n";
|
||||
if(getBitOf32Data(SSConditions, i,false)){
|
||||
StyleStr = StyleStr + TrueColor[i]+"\n";
|
||||
}else{
|
||||
StyleStr = StyleStr + FalseColor[i]+"\n";
|
||||
}
|
||||
|
||||
Label->setStyleSheet(StyleStr);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void P401_CuttingPage::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());
|
||||
|
||||
}
|
||||
|
||||
void P401_CuttingPage::RotateDev(){
|
||||
mAngle = mAngle + 1;
|
||||
if(mAngle > 360) mAngle =0;
|
||||
mObjLoader->rotateArmToAbsoluteYAngle(DevName3D, mAngle);
|
||||
|
||||
}
|
||||
|
||||
@@ -2,7 +2,9 @@
|
||||
#define P401_CUTTINGPAGE_H
|
||||
|
||||
#include <QWidget>
|
||||
|
||||
#include <QProgressBar>
|
||||
#include <PublicFunctions/CurvePlotWidget.h>
|
||||
#include <PublicFunctions/ObjLoader.h>
|
||||
namespace Ui {
|
||||
class P401_CuttingPage;
|
||||
}
|
||||
@@ -14,9 +16,35 @@ class P401_CuttingPage : public QWidget
|
||||
public:
|
||||
explicit P401_CuttingPage(QWidget *parent = nullptr);
|
||||
~P401_CuttingPage();
|
||||
void WinInit();
|
||||
void SetProgressBar(QProgressBar *PB,uint16_t Value,uint8_t ColorIndex,QStringList Color);
|
||||
void SetPos(float Zoom,QVector3D Move,QVector3D Pos);
|
||||
private slots:
|
||||
void UIRefreshTimeOut();
|
||||
void TrailRefreshTimeOut();
|
||||
void Show3D();
|
||||
void RotateDev();
|
||||
signals:
|
||||
void preprocessFinished(QVector3D center, float radius);
|
||||
void loadModelRequest(const QString& devName, const QString& filePath, QVector3D center, float radius);
|
||||
|
||||
private:
|
||||
Ui::P401_CuttingPage *ui;
|
||||
|
||||
QStringList PercentageText;
|
||||
QStringList TrueColor;
|
||||
QStringList FalseColor;
|
||||
QString DevName3D = "";
|
||||
uint16_t mAngle = 0;
|
||||
ObjLoader *mObjLoader;
|
||||
|
||||
QThread* m_workerThread;
|
||||
ObjLoader* m_workerLoader;
|
||||
QVector3D m_modelCenter;
|
||||
float m_modelRadius;
|
||||
QString m_currentDevName;
|
||||
QString m_currentFilePath;
|
||||
QVector3D m_currentPosition;
|
||||
};
|
||||
|
||||
#endif // P401_CUTTINGPAGE_H
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
Reference in New Issue
Block a user