Modificato il modo di colorare le label per nodi ROS

This commit is contained in:
2019-11-18 11:25:51 +01:00
parent 069fa97b40
commit 2f59630197
4 changed files with 20 additions and 20 deletions

View File

@@ -96,21 +96,14 @@ void RoboGlue_GUI::on_commonStatusChange() {
this->ui->lbl_follower->setText(QString().fromStdString(this->m->comSettings.nodeNames.find("follower")->second+": "+std::to_string(static_cast<uint>(m->commonStatus.followerTime))));
this->ui->lbl_recorder->setText(QString().fromStdString(this->m->comSettings.nodeNames.find("recorder")->second+": "+std::to_string(static_cast<uint>(m->commonStatus.recorderTime))));
this->ui->lbl_broadcaster->setText(QString().fromStdString(this->m->comSettings.nodeNames.find("broadcaster")->second+": "+std::to_string(static_cast<uint>(m->commonStatus.broadcasterTime))));
if(m->commonStatus.relayTime > m->comSettings.deadTime ||
m->commonStatus.followerTime > m->comSettings.deadTime ||
m->commonStatus.recorderTime > m->comSettings.deadTime ||
m->commonStatus.broadcasterTime > m->comSettings.deadTime) {
this->ui->lbl_relay->setStyleSheet("QLabel { background-color : red; color : white; }");
this->ui->lbl_follower->setStyleSheet("QLabel { background-color : red; color : white; }");
this->ui->lbl_recorder->setStyleSheet("QLabel { background-color : red; color : white; }");
this->ui->lbl_broadcaster->setStyleSheet("QLabel { background-color : red; color : white; }");
} else {
this->ui->lbl_relay->setStyleSheet("QLabel { background-color : green; color : white; }");
this->ui->lbl_follower->setStyleSheet("QLabel { background-color : green; color : white; }");
this->ui->lbl_recorder->setStyleSheet("QLabel { background-color : green; color : white; }");
this->ui->lbl_broadcaster->setStyleSheet("QLabel { background-color : green; color : white; }");
}
if (m->commonStatus.relayRunning) this->ui->lbl_relay->setStyleSheet("QLabel { background-color : red; color : white; }");
else this->ui->lbl_relay->setStyleSheet("QLabel { background-color : green; color : white; }");
if (m->commonStatus.recorderRunning) this->ui->lbl_recorder->setStyleSheet("QLabel { background-color : red; color : white; }");
else this->ui->lbl_recorder->setStyleSheet("QLabel { background-color : green; color : white; }");
if (m->commonStatus.followerRunning) this->ui->lbl_follower->setStyleSheet("QLabel { background-color : red; color : white; }");
else this->ui->lbl_follower->setStyleSheet("QLabel { background-color : green; color : white; }");
if (m->commonStatus.broadcasterRunning) this->ui->lbl_broadcaster->setStyleSheet("QLabel { background-color : red; color : white; }");
else this->ui->lbl_broadcaster->setStyleSheet("QLabel { background-color : green; color : white; }");
}
void RoboGlue_GUI::on_pad_hoverEvent(QEvent* e) {

View File

@@ -1437,6 +1437,13 @@
</property>
</widget>
</item>
<item>
<widget class="QPushButton" name="btn_stopRos">
<property name="text">
<string>Stop_ROS</string>
</property>
</widget>
</item>
</layout>
</item>
</layout>