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

@@ -15,6 +15,10 @@ RoboGlue_SHARED::~RoboGlue_SHARED(){
}
void RoboGlue_SHARED::on_statusTimer(void){
double curTime = static_cast<double>(std::time(NULL));
commonStatus.relayTime = fabs(commonStatus.relayLast - curTime);
commonStatus.followerTime = fabs(commonStatus.followerLast - curTime);
commonStatus.recorderTime = fabs(commonStatus.recorderLast - curTime);
emit this->commonStatusChange();
}
////////////////////////////////////////////////////////////////

View File

@@ -59,6 +59,9 @@ public:
double relayLast = 0.0;
double followerLast = 0.0;
double recorderLast = 0.0;
double relayTime = 0.0;
double followerTime = 0.0;
double recorderTime = 0.0;
} commonStatus;
/////////// PERMANENT SETTINGS VARIABLES /////////