Corretto calcolo del tempo heartbeat
This commit is contained in:
@@ -31,13 +31,13 @@ void mqtt_callback::message_arrived(mqtt::const_message_ptr msg) {
|
||||
intMsg[mem_->comSettings.TS]);
|
||||
if (!intMsg[mem_->comSettings.NODE].compare(mem_->comSettings.nodeNames["relay"])){
|
||||
mem_->commonStatus.relayRunning = true;
|
||||
mem_->commonStatus.relayLast = std::stod(intMsg[mem_->comSettings.TS]);
|
||||
mem_->commonStatus.relayLast = fabs(mem_->commonStatus.relayLast - std::stod(intMsg[mem_->comSettings.TS]));
|
||||
} else if (!intMsg[mem_->comSettings.NODE].compare(mem_->comSettings.nodeNames["follower"])) {
|
||||
mem_->commonStatus.followerRunning = true;
|
||||
mem_->commonStatus.followerLast = std::stod(intMsg[mem_->comSettings.TS]);
|
||||
mem_->commonStatus.followerLast = fabs(mem_->commonStatus.followerLast - std::stod(intMsg[mem_->comSettings.TS]));
|
||||
} else if (!intMsg[mem_->comSettings.NODE].compare(mem_->comSettings.nodeNames["recorder"])) {
|
||||
mem_->commonStatus.recorderRunning = true;
|
||||
mem_->commonStatus.recorderLast = std::stod(intMsg[mem_->comSettings.TS]);
|
||||
mem_->commonStatus.recorderLast = fabs(mem_->commonStatus.recorderLast - std::stod(intMsg[mem_->comSettings.TS]));
|
||||
} else {
|
||||
log_->error("Node {} unknown", intMsg[mem_->comSettings.NODE].c_str());
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user