Aggiunto nodo broadcaster a interfaccia e shared memory

This commit is contained in:
2019-11-15 14:49:45 +01:00
parent 623ae0bedb
commit 5c7caa3259
4 changed files with 18 additions and 8 deletions

View File

@@ -19,6 +19,7 @@ void RoboGlue_SHARED::on_statusTimer(void){
commonStatus.relayTime = fabs(commonStatus.relayLast - curTime);
commonStatus.followerTime = fabs(commonStatus.followerLast - curTime);
commonStatus.recorderTime = fabs(commonStatus.recorderLast - curTime);
commonStatus.broadcasterTime = fabs(commonStatus.broadcasterLast - curTime);
emit this->commonStatusChange();
}
////////////////////////////////////////////////////////////////
@@ -88,6 +89,7 @@ void RoboGlue_SHARED::restoreComSettings() {
comSettings.nodeNames["relay"] = settings->value("relay").toString().toStdString();
comSettings.nodeNames["follower"] = settings->value("follower").toString().toStdString();
comSettings.nodeNames["recorder"] = settings->value("recorder").toString().toStdString();
comSettings.nodeNames["broadcaster"] = settings->value("broadcaster").toString().toStdString();
settings->endGroup();
settings->endGroup();
settings->endGroup();
@@ -153,6 +155,7 @@ void RoboGlue_SHARED::saveComSettings() {
settings->setValue("relay", QString().fromStdString(comSettings.nodeNames.find("relay")->second));
settings->setValue("follower", QString().fromStdString(comSettings.nodeNames.find("follower")->second));
settings->setValue("recorder", QString().fromStdString(comSettings.nodeNames.find("recorder")->second));
settings->setValue("broadcaster", QString().fromStdString(comSettings.nodeNames.find("broadcaster")->second));
settings->endGroup();
settings->endGroup();
settings->endGroup();

View File

@@ -30,6 +30,7 @@
#include <QSize>
#include <QTimer>
#include <stdexcept>
#include <ctime>
#include <libJson/json.hpp>
#include <libURcom/URCLinterface.h>
#include <boost/algorithm/string.hpp>
@@ -56,12 +57,14 @@ public:
bool followerRunning = false;
bool recorderRunning = false;
// ROS node last seen
double relayLast = 0.0;
double followerLast = 0.0;
double recorderLast = 0.0;
double relayTime = 0.0;
double followerTime = 0.0;
double recorderTime = 0.0;
double relayLast = static_cast<double>(time(NULL));
double followerLast = static_cast<double>(time(NULL));
double recorderLast = static_cast<double>(time(NULL));
double broadcasterLast = static_cast<double>(time(NULL));
double relayTime = static_cast<double>(time(NULL));
double followerTime = static_cast<double>(time(NULL));
double recorderTime = static_cast<double>(time(NULL));
double broadcasterTime = static_cast<double>(time(NULL));
} commonStatus;
/////////// PERMANENT SETTINGS VARIABLES /////////