|
|
|
@ -27,7 +27,7 @@ class MonitorWidget:public QWidget
|
|
|
|
|
public:
|
|
|
|
|
QVBoxLayout *verticalLayout;
|
|
|
|
|
QHBoxLayout *operationLayout;
|
|
|
|
|
QPushButton *exchangeButton;
|
|
|
|
|
// QPushButton *exchangeButton;
|
|
|
|
|
QSpacerItem *horizontalSpacer;
|
|
|
|
|
QGridLayout *monitorLayout;
|
|
|
|
|
QHBoxLayout *filterlLayout;
|
|
|
|
@ -54,17 +54,17 @@ public:
|
|
|
|
|
verticalLayout->setContentsMargins(0, 0, 0, 0);
|
|
|
|
|
operationLayout = new QHBoxLayout();
|
|
|
|
|
operationLayout->setObjectName(QString::fromUtf8("operationLayout"));
|
|
|
|
|
exchangeButton = new QPushButton(MonitorWidget);
|
|
|
|
|
exchangeButton->setObjectName(QString::fromUtf8("exchangeButton"));
|
|
|
|
|
// exchangeButton = new QPushButton(MonitorWidget);
|
|
|
|
|
// exchangeButton->setObjectName(QString::fromUtf8("exchangeButton"));
|
|
|
|
|
|
|
|
|
|
operationLayout->addWidget(exchangeButton);
|
|
|
|
|
// operationLayout->addWidget(exchangeButton);
|
|
|
|
|
|
|
|
|
|
horizontalSpacer = new QSpacerItem(40, 20, QSizePolicy::Expanding, QSizePolicy::Minimum);
|
|
|
|
|
|
|
|
|
|
operationLayout->addItem(horizontalSpacer);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
verticalLayout->addLayout(operationLayout);
|
|
|
|
|
// verticalLayout->addLayout(operationLayout);
|
|
|
|
|
|
|
|
|
|
monitorLayout = new QGridLayout();
|
|
|
|
|
monitorLayout->setObjectName(QString::fromUtf8("monitorLayout"));
|
|
|
|
@ -79,7 +79,8 @@ public:
|
|
|
|
|
monitorLayout->setColumnStretch(6, 1);
|
|
|
|
|
fillWidget = new QWidget();
|
|
|
|
|
fillWidget->setLayout(monitorLayout);
|
|
|
|
|
connect(exchangeButton, &QPushButton::clicked, this, [=](){this->changeState();});
|
|
|
|
|
fillWidget->setObjectName(QString::fromUtf8("fillWidget"));
|
|
|
|
|
// connect(exchangeButton, &QPushButton::clicked, this, [=](){this->changeState();});
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
QScrollArea *scrollArea = new QScrollArea();
|
|
|
|
@ -88,6 +89,7 @@ public:
|
|
|
|
|
scrollArea->setWidgetResizable(true);
|
|
|
|
|
scrollArea->setHorizontalScrollBarPolicy(Qt::ScrollBarAlwaysOff);
|
|
|
|
|
scrollArea->setVerticalScrollBarPolicy(Qt::ScrollBarAlwaysOn);
|
|
|
|
|
scrollArea->setObjectName(QString::fromUtf8("scrollArea"));
|
|
|
|
|
|
|
|
|
|
verticalLayout->addWidget(scrollArea);
|
|
|
|
|
|
|
|
|
@ -129,8 +131,8 @@ public:
|
|
|
|
|
runButton->setIcon(QIcon(":/Static/fanRun.png"));
|
|
|
|
|
|
|
|
|
|
filterlLayout->addWidget(runButton);
|
|
|
|
|
filterlLayout->setContentsMargins(10, 10, 10, 10);
|
|
|
|
|
filterlLayout->setSpacing(20);
|
|
|
|
|
filterlLayout->setContentsMargins(30, 10, 30, 30);
|
|
|
|
|
filterlLayout->setSpacing(50);
|
|
|
|
|
|
|
|
|
|
verticalLayout->addLayout(filterlLayout);
|
|
|
|
|
|
|
|
|
@ -151,14 +153,14 @@ public:
|
|
|
|
|
});
|
|
|
|
|
timer->start(5000);
|
|
|
|
|
|
|
|
|
|
connect(exchangeButton, &QPushButton::clicked, this, [=](){this->exchangeClicked();});
|
|
|
|
|
// connect(exchangeButton, &QPushButton::clicked, this, [=](){this->exchangeClicked();});
|
|
|
|
|
|
|
|
|
|
} // setupUi
|
|
|
|
|
|
|
|
|
|
void retranslateUi(QWidget *MonitorWidget)
|
|
|
|
|
{
|
|
|
|
|
MonitorWidget->setWindowTitle(QCoreApplication::translate("MonitorWidget", "Form", nullptr));
|
|
|
|
|
exchangeButton->setText(QCoreApplication::translate("MonitorWidget", "\345\244\247\345\260\217\345\233\276\346\240\207\345\210\207\346\215\242", nullptr));
|
|
|
|
|
// exchangeButton->setText(QCoreApplication::translate("MonitorWidget", "\345\244\247\345\260\217\345\233\276\346\240\207\345\210\207\346\215\242", nullptr));
|
|
|
|
|
} // retranslateUi
|
|
|
|
|
|
|
|
|
|
void exchangeClicked()
|
|
|
|
@ -234,6 +236,8 @@ public:
|
|
|
|
|
monitorLayout->setRowStretch(1, 1);
|
|
|
|
|
monitorLayout->setRowStretch(2, 1);
|
|
|
|
|
monitorLayout->setRowStretch(3, 1);
|
|
|
|
|
}else{
|
|
|
|
|
fillWidget->setFixedHeight(228 * ceil(allFans.size() / 4));
|
|
|
|
|
}
|
|
|
|
|
fillWidget->setFixedWidth(1900);
|
|
|
|
|
setButtonMes();
|
|
|
|
@ -243,12 +247,12 @@ public:
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void setButtonMes(){
|
|
|
|
|
interruptedButton->setText(QString("通讯中断") + QString::number(fans.interruptedFans.size()));
|
|
|
|
|
normalButton->setText(QString("正常运行") + QString::number(fans.normalFans.size()));
|
|
|
|
|
standbyButton->setText(QString("待机等风") + QString::number(fans.standbyFans.size()));
|
|
|
|
|
hutdownButton->setText(QString("停机维护") + QString::number(fans.hutdownFans.size()));
|
|
|
|
|
failureButton->setText(QString("故障停机") + QString::number(fans.interruptedFans.size()));
|
|
|
|
|
runButton->setText(QString("启动") + QString::number(fans.runFans.size()));
|
|
|
|
|
interruptedButton->setText(QString("通讯中断 ") + QString::number(fans.interruptedFans.size()));
|
|
|
|
|
normalButton->setText(QString("正常运行 ") + QString::number(fans.normalFans.size()));
|
|
|
|
|
standbyButton->setText(QString("待机等风 ") + QString::number(fans.standbyFans.size()));
|
|
|
|
|
hutdownButton->setText(QString("停机维护 ") + QString::number(fans.hutdownFans.size()));
|
|
|
|
|
failureButton->setText(QString("故障停机 ") + QString::number(fans.interruptedFans.size()));
|
|
|
|
|
runButton->setText(QString("启动 ") + QString::number(fans.runFans.size()));
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
MonitorWidget()
|
|
|
|
|