diff --git a/.gitignore b/.gitignore index e68000d7..8f45bde9 100644 --- a/.gitignore +++ b/.gitignore @@ -21,6 +21,7 @@ bin/trick-fxplot bin/trick-gxplot bin/trick-trk2ascii bin/trick-trk2csv +bin/trick-trkConvert aclocal.m4 autom4te.cache trick_test diff --git a/include/trick/FrameLog.hh b/include/trick/FrameLog.hh index fd2c3667..a61fb143 100644 --- a/include/trick/FrameLog.hh +++ b/include/trick/FrameLog.hh @@ -13,6 +13,7 @@ PROGRAMMERS: #include "trick/FrameDataRecordGroup.hh" #include "trick/attributes.h" #include "trick/JobData.hh" +#include "trick/Clock.hh" namespace Trick { @@ -77,10 +78,12 @@ namespace Trick { /** Save the name of the trick master/slave sim object.\n */ std::string ms_sim_object_name; /**< trick_io(**) */ + Trick::Clock & clock ; /**< trick_io(**) */ + /** @brief Constructor. */ - FrameLog() ; + FrameLog(Trick::Clock & in_clock) ; /** @brief Destructor. @@ -152,6 +155,8 @@ namespace Trick { */ int shutdown() ; + void set_clock(Trick::Clock & in_clock) ; + private: std::vector trick_jobs; // ** vector containing all trick job names std::vector user_jobs; // ** vector containing all user job names @@ -188,6 +193,9 @@ namespace Trick { */ int create_DP_timeline_files(); + // This object is not copyable + void operator =(const FrameLog &) {}; + } ; } ; diff --git a/share/trick/sim_objects/default_trick_sys.sm b/share/trick/sim_objects/default_trick_sys.sm index 9fa9f74c..33c6bd75 100644 --- a/share/trick/sim_objects/default_trick_sys.sm +++ b/share/trick/sim_objects/default_trick_sys.sm @@ -588,7 +588,7 @@ class FrameLogSimObject : public Trick::SimObject { Trick::FrameLog frame_log ; - FrameLogSimObject() { + FrameLogSimObject(Trick::Clock &in_clock) : frame_log(in_clock) { // Frame log Instrumentation class jobs. Not scheduled by default {TRK} P0 ("instrumentation") frame_log.frame_clock_start(curr_job) ; {TRK} P65535 ("instrumentation") frame_log.frame_clock_stop(curr_job) ; @@ -606,9 +606,13 @@ class FrameLogSimObject : public Trick::SimObject { // the frame_log and rt_sync shutdown jobs should be last in sim {TRK} P65535 ("shutdown") frame_log.shutdown() ; } + + private: + // This object is not copyable + void operator =(const FrameLogSimObject &) {}; } -FrameLogSimObject trick_frame_log ; +FrameLogSimObject trick_frame_log(trick_real_time.gtod_clock) ; #endif #ifndef TRICK_NO_MASTERSLAVE diff --git a/trick_source/sim_services/FrameLog/FrameLog.cpp b/trick_source/sim_services/FrameLog/FrameLog.cpp index 23e8ed94..7ff87b6c 100644 --- a/trick_source/sim_services/FrameLog/FrameLog.cpp +++ b/trick_source/sim_services/FrameLog/FrameLog.cpp @@ -11,7 +11,6 @@ #include "trick/FrameDataRecordGroup.hh" #include "trick/exec_proto.hh" #include "trick/exec_proto.h" -#include "trick/clock_proto.h" #include "trick/data_record_proto.h" #include "trick/command_line_protos.h" #include "trick/message_proto.h" @@ -20,7 +19,7 @@ Trick::FrameLog * the_fl = NULL ; //Constructor. -Trick::FrameLog::FrameLog() { +Trick::FrameLog::FrameLog(Trick::Clock & in_clock) : clock(in_clock) { frame_log_flag = false ; drg_trick = NULL ; drg_frame = NULL ; @@ -342,7 +341,7 @@ int Trick::FrameLog::frame_clock_start(Trick::JobData * curr_job ) { /** @par Detailed Design: */ if ( target_job != NULL ) { /** @li Set target job's start time. */ - target_job->rt_start_time = clock_time() ; + target_job->rt_start_time = clock.clock_time() ; } return(0) ; @@ -359,7 +358,7 @@ int Trick::FrameLog::frame_clock_stop(Trick::JobData * curr_job) { if ( target_job != NULL ) { if ( target_job->rt_start_time >= 0 ) { /** @li Set current job's stop time and frame time. */ - target_job->rt_stop_time = clock_time() ; + target_job->rt_stop_time = clock.clock_time() ; target_job->frame_time += (target_job->rt_stop_time - target_job->rt_start_time); thread = target_job->thread; @@ -678,6 +677,11 @@ int Trick::FrameLog::shutdown() { return(0) ; } + +void Trick::FrameLog::set_clock(Trick::Clock & in_clock) { + clock = in_clock ; +} + //Call all the Create routines for the DP directory and all DP files. int Trick::FrameLog::create_DP_files() { int ret=0;