From c93585e55e176a38571c6a79ea58bf936774f60a Mon Sep 17 00:00:00 2001 From: Sean Harmeyer Date: Mon, 25 Nov 2024 13:27:13 -0600 Subject: [PATCH] I'm not proud, I'm rushed. --- include/trick/FrameLog.hh | 3 +++ include/trick/JobData.hh | 2 +- trick_source/sim_services/FrameLog/FrameLog.cpp | 11 +++++++++++ 3 files changed, 15 insertions(+), 1 deletion(-) diff --git a/include/trick/FrameLog.hh b/include/trick/FrameLog.hh index edff7600..4f8e799a 100644 --- a/include/trick/FrameLog.hh +++ b/include/trick/FrameLog.hh @@ -158,6 +158,9 @@ namespace Trick { void set_clock(Trick::Clock & in_clock) ; + + Trick::JobData target_job_array; /* -- job array to access job info in realtime */ + private: std::vector trick_jobs; // ** vector containing all trick job names std::vector user_jobs; // ** vector containing all user job names diff --git a/include/trick/JobData.hh b/include/trick/JobData.hh index 8ad72103..fbc12b1f 100644 --- a/include/trick/JobData.hh +++ b/include/trick/JobData.hh @@ -92,7 +92,7 @@ namespace Trick { long long frame_time ; /**< trick_io(**) */ /** Cumulative time in seconds used for job in frame (rt_stop_time - rt_start_time) / time_tic_value */ - double frame_time_seconds; /**< trick_io(**) trick_units(s) */ + double frame_time_seconds; /**< trick_io(*io) trick_units(s) */ /** Sim_object_id.id (for job identification in timeline logging) */ double frame_id; /**< trick_io(**) */ diff --git a/trick_source/sim_services/FrameLog/FrameLog.cpp b/trick_source/sim_services/FrameLog/FrameLog.cpp index 2eb4516e..9c10db8e 100644 --- a/trick_source/sim_services/FrameLog/FrameLog.cpp +++ b/trick_source/sim_services/FrameLog/FrameLog.cpp @@ -361,6 +361,13 @@ int Trick::FrameLog::frame_clock_stop(Trick::JobData * curr_job) { Trick::JobData * target_job = (Trick::JobData *)curr_job->sup_class_data ; int thread, mode; double time_scale; + + bool isMonitor = false; + + std::string monitor_job_name = "trick_real_time.rt_sync.rt_monitor"; + + if ( monitor_job_name.compare(target_job->name) == 0 ) + isMonitor = true; /** @par Detailed Design: */ if ( target_job != NULL ) { @@ -370,6 +377,10 @@ int Trick::FrameLog::frame_clock_stop(Trick::JobData * curr_job) { time_scale = 1.0 / target_job->time_tic_value; target_job->frame_time += (target_job->rt_stop_time - target_job->rt_start_time); target_job->frame_time_seconds = target_job->frame_time * time_scale; + if (isMonitor) + { + target_job_array = *target_job; + } thread = target_job->thread; mode = exec_get_mode();