|
|
|
@ -153,6 +153,21 @@ public:
|
|
|
|
|
});
|
|
|
|
|
timer->start(5000);
|
|
|
|
|
|
|
|
|
|
interruptedButton->setCheckable(true);
|
|
|
|
|
normalButton->setCheckable(true);
|
|
|
|
|
standbyButton->setCheckable(true);
|
|
|
|
|
hutdownButton->setCheckable(true);
|
|
|
|
|
failureButton->setCheckable(true);
|
|
|
|
|
runButton->setCheckable(true);
|
|
|
|
|
|
|
|
|
|
connect(interruptedButton, &QPushButton::clicked, this, [=](){this->addTag();});
|
|
|
|
|
connect(normalButton, &QPushButton::clicked, this, [=](){this->addTag();});
|
|
|
|
|
connect(standbyButton, &QPushButton::clicked, this, [=](){this->addTag();});
|
|
|
|
|
connect(hutdownButton, &QPushButton::clicked, this, [=](){this->addTag();});
|
|
|
|
|
connect(failureButton, &QPushButton::clicked, this, [=](){this->addTag();});
|
|
|
|
|
connect(runButton, &QPushButton::clicked, this, [=](){this->addTag();});
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// connect(exchangeButton, &QPushButton::clicked, this, [=](){this->exchangeClicked();});
|
|
|
|
|
|
|
|
|
|
} // setupUi
|
|
|
|
@ -210,6 +225,9 @@ public:
|
|
|
|
|
int index = 0;
|
|
|
|
|
QList<MonitorTag*> tags;
|
|
|
|
|
for (auto it = allFans.begin(); it != allFans.end(); ++it) {
|
|
|
|
|
if(!shouldDisplay(it->second.fanCode)){
|
|
|
|
|
continue;
|
|
|
|
|
}
|
|
|
|
|
if (index == 6){
|
|
|
|
|
tagList.append(tags);
|
|
|
|
|
tags.clear();
|
|
|
|
@ -217,6 +235,7 @@ public:
|
|
|
|
|
count++;
|
|
|
|
|
}
|
|
|
|
|
MonitorTag *newTag = new MonitorTag(it->second, state);
|
|
|
|
|
connect(newTag->stateBox, QOverload<int>::of(&QComboBox::currentIndexChanged), [this](int index) {addTag();});
|
|
|
|
|
monitorLayout->addWidget(newTag, count, index);
|
|
|
|
|
tags.append(newTag);
|
|
|
|
|
index++;
|
|
|
|
@ -255,6 +274,29 @@ public:
|
|
|
|
|
runButton->setText(QString("启动 ") + QString::number(fans.runFans.size()));
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
bool shouldDisplay(QString FanCode){
|
|
|
|
|
vector<QString> displayList;
|
|
|
|
|
if (interruptedButton->isChecked()){displayList.insert(displayList.end(), fans.interruptedFans.begin(), fans.interruptedFans.end());}
|
|
|
|
|
if (normalButton->isChecked()){displayList.insert(displayList.end(), fans.normalFans.begin(), fans.normalFans.end());}
|
|
|
|
|
if (standbyButton->isChecked()){displayList.insert(displayList.end(), fans.standbyFans.begin(), fans.standbyFans.end());}
|
|
|
|
|
if (hutdownButton->isChecked()){displayList.insert(displayList.end(), fans.hutdownFans.begin(), fans.hutdownFans.end());}
|
|
|
|
|
if (failureButton->isChecked()){displayList.insert(displayList.end(), fans.failureFans.begin(), fans.failureFans.end());}
|
|
|
|
|
if (runButton->isChecked()){displayList.insert(displayList.end(), fans.runFans.begin(), fans.runFans.end());}
|
|
|
|
|
if (!interruptedButton->isChecked()
|
|
|
|
|
&& !normalButton->isChecked()
|
|
|
|
|
&& !standbyButton->isChecked()
|
|
|
|
|
&& !hutdownButton->isChecked()
|
|
|
|
|
&& !failureButton->isChecked()
|
|
|
|
|
&& !runButton->isChecked()){
|
|
|
|
|
return true;
|
|
|
|
|
}
|
|
|
|
|
if (std::find(displayList.begin(), displayList.end(), FanCode) != displayList.end()) {
|
|
|
|
|
return true;
|
|
|
|
|
}else{
|
|
|
|
|
return false;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
MonitorWidget()
|
|
|
|
|
{
|
|
|
|
|
setupUi(this);
|
|
|
|
|