Corretta gestione Heartbeat

This commit is contained in:
2019-11-05 16:47:55 +01:00
parent 64a4b9b122
commit bf368d6ac6
6 changed files with 22 additions and 12 deletions

View File

@@ -92,13 +92,13 @@ void RoboGlue_GUI::disableLockAxes(){
void RoboGlue_GUI::on_commonStatusChange() {
modlog->trace("on_commonStatusChange Received");
// TODO: aggiungere e interpretare le flag per capire se i nodi ros sono tutti vivi dall'heartbeat
this->ui->lbl_relay->setText(QString().fromStdString(std::to_string(m->commonStatus.relayLast)));
this->ui->lbl_follower->setText(QString().fromStdString(std::to_string(m->commonStatus.followerLast)));
this->ui->lbl_recorder->setText(QString().fromStdString(std::to_string(m->commonStatus.recorderLast)));
this->ui->lbl_relay->setText(QString().fromStdString(std::to_string(m->commonStatus.relayTime)));
this->ui->lbl_follower->setText(QString().fromStdString(std::to_string(m->commonStatus.followerTime)));
this->ui->lbl_recorder->setText(QString().fromStdString(std::to_string(m->commonStatus.recorderTime)));
if(m->commonStatus.relayLast > m->comSettings.deadTime ||
m->commonStatus.followerLast > m->comSettings.deadTime ||
m->commonStatus.recorderLast > m->comSettings.deadTime) {
if(m->commonStatus.relayTime > m->comSettings.deadTime ||
m->commonStatus.followerTime > m->comSettings.deadTime ||
m->commonStatus.recorderTime > 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; }");