mirror of
https://github.com/nasa/trick.git
synced 2024-12-21 14:07:51 +00:00
14a75508a3
Changed all header file once include variables to follow the same naming convention and not start with any underscores. Also deleted old incorrect copyright notices. Also removed $Id: tags from all files. Fixes #14. Fixes #22.
101 lines
2.6 KiB
Plaintext
101 lines
2.6 KiB
Plaintext
/************************TRICK HEADER*************************
|
|
PURPOSE:
|
|
(This comment lists out the other object files that are not included from c++ headers)
|
|
LIBRARY DEPENDENCIES:
|
|
(
|
|
)
|
|
*************************************************************/
|
|
|
|
#include "sim_objects/default_trick_sys.sm"
|
|
|
|
##include "test_ip/include/Ball_test.hh"
|
|
|
|
/* base ball... get it? :) */
|
|
class ballSimObject : public Trick::SimObject {
|
|
|
|
public:
|
|
Ball_alex obj ;
|
|
TEST_STRUCT t ;
|
|
my_ns::AA ns_test ;
|
|
|
|
ballSimObject() {
|
|
("default_data") obj.force.default_data() ;
|
|
("default_data") obj.state.default_data() ;
|
|
|
|
("initialization") obj.state_init() ;
|
|
|
|
("derivative") obj.force_field() ;
|
|
("derivative") obj.state_deriv() ;
|
|
("integration") trick_ret = obj.state_integ() ;
|
|
|
|
(10.0, "scheduled") trick_ret = obj.state_print() ;
|
|
|
|
("freeze") obj.state_print() ;
|
|
}
|
|
|
|
private:
|
|
ballSimObject (const ballSimObject &);
|
|
ballSimObject & operator= (const ballSimObject &);
|
|
|
|
} ;
|
|
|
|
class disabledSimObject : public Trick::SimObject {
|
|
public:
|
|
void print_me() {
|
|
message_publish( 7 , "\033[31mThis statement in disabledSimObject should not print because the sim object is disabled!!!\033[0m\n" ) ;
|
|
add_test_result( "IPtest" , "Disable sim_object" , "job not disabled\n") ;
|
|
}
|
|
disabledSimObject() {
|
|
("initialization") print_me() ;
|
|
(10.0 , "scheduled") print_me() ;
|
|
}
|
|
} ;
|
|
|
|
class emptySimObject : public Trick::SimObject {
|
|
|
|
public:
|
|
Ball_alex obj ;
|
|
|
|
private:
|
|
emptySimObject (const emptySimObject &);
|
|
emptySimObject & operator= (const emptySimObject &);
|
|
|
|
} ;
|
|
|
|
class reallyemptySimObject : public Trick::SimObject {
|
|
public:
|
|
int ii ;
|
|
} ;
|
|
|
|
class plainClass {
|
|
public:
|
|
double d ;
|
|
float f ;
|
|
plainClass() : d() , f() {} ;
|
|
}
|
|
|
|
// Instantiations
|
|
ballSimObject ball ;
|
|
disabledSimObject disabled_obj ;
|
|
|
|
// This collect can now be done in create_connections or the input file.
|
|
//collect ball.obj.state.work.external_force = {ball.obj.force.output.force[0]};
|
|
|
|
IntegLoop my_integ_loop (0.01) ball;
|
|
|
|
// Connect objects
|
|
void create_connections() {
|
|
|
|
// Set the default termination time
|
|
trick_sys.sched.set_terminate_time(300.0) ;
|
|
trick_sys.sched.set_freeze_frame(0.10) ;
|
|
|
|
|
|
my_integ_loop.getIntegrator( Runge_Kutta_2, 4 );
|
|
|
|
// Example of adding a collect in create_connections.
|
|
ball.obj.state.add_external_force( ball.obj.force.output.force ) ;
|
|
|
|
}
|
|
|