Rename zmc_heartbeat_time to heartbeat_time. Set it during waiting for prime and capturing.

pull/3557/head
Isaac Connor 2022-08-02 17:54:27 -04:00
parent 89277f8e67
commit a03189046e
2 changed files with 6 additions and 6 deletions

View File

@ -2416,7 +2416,7 @@ int Monitor::Capture() {
std::shared_ptr<ZMPacket> packet = std::make_shared<ZMPacket>();
packet->image_index = image_count;
packet->timestamp = std::chrono::system_clock::now();
shared_data->zmc_heartbeat_time = std::chrono::system_clock::to_time_t(packet->timestamp);
shared_data->heartbeat_time = std::chrono::system_clock::to_time_t(packet->timestamp);
int captureResult = camera->Capture(packet);
Debug(4, "Back from capture result=%d image count %d", captureResult, image_count);

View File

@ -202,7 +202,7 @@ protected:
uint64_t extrapad1;
};
union { /* +80 */
time_t zmc_heartbeat_time; /* Constantly updated by zmc. Used to determine if the process is alive or hung or dead */
time_t heartbeat_time; /* Constantly updated by zmc. Used to determine if the process is alive or hung or dead */
uint64_t extrapad2;
};
union { /* +88 */
@ -579,11 +579,11 @@ public:
gettimeofday(&now, nullptr);
Debug(3, "Shared data is valid, checking heartbeat %" PRIi64 " - %" PRIi64 " = %" PRIi64" < %f",
static_cast<int64>(now.tv_sec),
static_cast<int64>(shared_data->zmc_heartbeat_time),
static_cast<int64>(now.tv_sec - shared_data->zmc_heartbeat_time),
static_cast<int64>(shared_data->heartbeat_time),
static_cast<int64>(now.tv_sec - shared_data->heartbeat_time),
config.watch_max_delay);
if ((now.tv_sec - shared_data->zmc_heartbeat_time) < config.watch_max_delay)
if ((now.tv_sec - shared_data->heartbeat_time) < config.watch_max_delay)
return true;
}
return false;
@ -742,7 +742,7 @@ public:
SystemTimePoint GetStartupTime() const { return std::chrono::system_clock::from_time_t(shared_data->startup_time); }
void SetStartupTime(SystemTimePoint time) { shared_data->startup_time = std::chrono::system_clock::to_time_t(time); }
void SetHeartbeatTime(SystemTimePoint time) {
shared_data->zmc_heartbeat_time = std::chrono::system_clock::to_time_t(time);
shared_data->heartbeat_time = std::chrono::system_clock::to_time_t(time);
}
void get_ref_image();