mirror of
https://github.com/nasa/trick.git
synced 2025-06-02 15:40:59 +00:00
Add methods in base SimObject to turn whole sim object on/off.
Added enable/disable methods to the SimObject base class. Used enable/disable to be consistent with the JobData class that already had these defined. fixes #103
This commit is contained in:
parent
e12ddbcfe1
commit
80fb82e9f6
@ -47,6 +47,9 @@ namespace Trick {
|
|||||||
/** Jobs in this sim_object */
|
/** Jobs in this sim_object */
|
||||||
std::vector <Trick::JobData *> jobs ; /* trick_io(**) */
|
std::vector <Trick::JobData *> jobs ; /* trick_io(**) */
|
||||||
|
|
||||||
|
/** Default destructor that doesn't do anything. */
|
||||||
|
virtual ~SimObject() ;
|
||||||
|
|
||||||
/** Returns a job with a specific name. */
|
/** Returns a job with a specific name. */
|
||||||
Trick::JobData * get_job( std::string job_name , unsigned int instance_num = 1 ) ;
|
Trick::JobData * get_job( std::string job_name , unsigned int instance_num = 1 ) ;
|
||||||
|
|
||||||
@ -90,8 +93,16 @@ namespace Trick {
|
|||||||
double in_cycle, const char * in_name, const char * in_tag = "", int in_phase = 60000 ,
|
double in_cycle, const char * in_name, const char * in_tag = "", int in_phase = 60000 ,
|
||||||
double in_start = 0.0 , double in_stop = 1.0e37) ;
|
double in_start = 0.0 , double in_stop = 1.0e37) ;
|
||||||
|
|
||||||
/** Default destructor that doesn't do anything. */
|
|
||||||
virtual ~SimObject() ;
|
/**
|
||||||
|
* Enables all jobs in the SimObject
|
||||||
|
*/
|
||||||
|
void enable() ;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Disables all jobs in the SimObject
|
||||||
|
*/
|
||||||
|
void disable() ;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Calls all jobs that are not "dynamic_event" class
|
* Calls all jobs that are not "dynamic_event" class
|
||||||
|
@ -99,3 +99,17 @@ Trick::JobData * Trick::SimObject::get_job( std::string job_name, unsigned int j
|
|||||||
return NULL ;
|
return NULL ;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void Trick::SimObject::enable() {
|
||||||
|
std::vector <Trick::JobData *>::iterator it ;
|
||||||
|
for ( it = jobs.begin() ; it != jobs.end() ; it++ ) {
|
||||||
|
(*it)->enable() ;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
void Trick::SimObject::disable() {
|
||||||
|
std::vector <Trick::JobData *>::iterator it ;
|
||||||
|
for ( it = jobs.begin() ; it != jobs.end() ; it++ ) {
|
||||||
|
(*it)->disable() ;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user