Aggiunta parametrizzazione topic mqtt e nomi dei nodi ros
This commit is contained in:
@@ -27,7 +27,7 @@ RoboGlue_GUI::RoboGlue_GUI(RoboGlue_SHARED *mem) : m(mem) {
|
||||
connect(this, SIGNAL(pad_hoverEvent(QEvent *)),
|
||||
this, SLOT(on_pad_hoverEvent(QEvent *)));
|
||||
connect(m, SIGNAL(commonStatusChange()),
|
||||
this, SLOT(on_commonStatusChange));
|
||||
this, SLOT(on_commonStatusChange()));
|
||||
|
||||
/////// READ NAME DEFINITION JSON FILE //////////
|
||||
try {
|
||||
@@ -92,6 +92,21 @@ 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)));
|
||||
|
||||
if(m->commonStatus.relayLast > m->comSettings.deadTime ||
|
||||
m->commonStatus.followerLast > m->comSettings.deadTime ||
|
||||
m->commonStatus.recorderLast > 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; }");
|
||||
} 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; }");
|
||||
}
|
||||
}
|
||||
|
||||
void RoboGlue_GUI::on_pad_hoverEvent(QEvent* e) {
|
||||
|
||||
Reference in New Issue
Block a user