| TRICK 7 TO TRICK 10 S_DEFINE FILE DIFFERENCES KEY : |  |  |  |  |  |  |
| Bold = Default behavior |  |  |  |  |  |  |
| Green = New Trick 10 feature or implementation is different than Trick 7 |  |  |  |  |  |  |
| Blue = Need a Trick 10 interface routine |  |  |  |  |  |  |
| Orange = Not implemented in Trick 10 / presumably not needed |  |  |  |  |  |  |
| Red Bold = Not implemented in Trick 10 / needs to be fixed |  |  |  |  |  |  |
TRICK 7 | TRICK 10 | DESCRIPTION |  |  |  |  |  |
[/* PURPOSE: (<purpose_statement>) */] | [/* PURPOSE: (<purpose_statement>) [DEFAULT_DATA: ( [ (<type> <variable> <rel_path>/<default_data_file>) ] )] [LIBRARY DEPENDENCIES: ( [ (<rel_path>/<model_source.c|cc|cpp>) ] ]) */] | OPTIONAL TRICK COMMENT HEADER TRICK10: DEFAULT DATA FILES CONTAINING ASSIGNMENT STATEMENTS ONLY ARE STILL SUPPORTED. YOU CAN SPECIFY THEM IN THE HEADER (BUT USING DEFAULT DATA JOBS IS THE RECOMMENDED METHOD). IF THERE ARE ANY FUNCTION CALLS IN THE S_DEFINE THAT ONLY OCCUR IN THE S_DEFINE, SPECIFY A LIBRARY DEPENDENCY TO THE SOURCE SO THAT IT IS BUILT. |  |  |  |  |  |
| ##include "<rel_path>/<model_header_file.h|hh>" | TRICK10: ANY DATA DECLARED IN THE S_DEFINE MUST HAVE AN ASSOCIATED HEADER FILE INCLUDED WITH THE SPECIAL ## SYNTAX. |  |  |  |  |  |
%{ <user_code_block> %} | %{ <user_code_block> %} | ADD ANY USER GLOBAL C/C++ CODE HERE TRICK10: IF YOU HAVE A LIB DEPENDENCY TO A C FUNCTION, DECLARE ITS PROTOTYPE HERE AS extern "C" <type> <myfunction>(<args>); |  |  |  |  |  |
#define <label> <value> | #define <label> <value> | DEFINE A C PREPROCESSOR MACRO |  |  |  |  |  |
#include <another_s_define_module> | #include <another_s_define_module> | INLINE INCLUDE OTHER FILES CONTAINING S_DEFINE SYNTAX |  |  |  |  |  |
sim_object { |  |  |  |  |  |  |  |
sim_services/include: EXECUTIVE exec (sim_services/include/executive.d); |  |  |  |  |  |  |  |
(automatic) sim_services/input_processor: |  |  |  |  |  |  |  |
input_processor(INPUT_PROCESSOR* IP = &sys.exec.ip); |  |  |  |  |  |  |  |
[(automatic_last) sim_services/exec: |  |  |  |  |  |  |  |
var_server_sync(EXECUTIVE * E = &sys.exec ) ;] |  |  |  |  |  |  |  |
} sys ; | #include "sim_objects/default_trick_sys.sm" | DECLARE THE NECESSARY TRICK SIM OBJECTS |  |  |  |  |  |
sim_object { | class <my_sim_object_type> : public Trick::SimObject { | START OF A USER SIM OBJECT DECLARATION |  |  |  |  |  |
| [public:|protected:|private:] |  |  |  |  |  |  |
<rel_path>:<type> <variable>[<dim>] [(<default_data_file>) [,<default_data_file>])] ; | <type> <variable>[<dim>] ; | DECLARE MODEL DATA (TRICK7: FINDS DATA VIA REL_PATH, AND OPTIONAL DEFAULT DATA SPECIFIED HERE; TRICK10: FINDS DATA VIA ##INCLUDE, DEFAULT DATA DONE IN JOB OR IN HEADER ABOVE) |  |  |  |  |  |
| <my_sim_object_type> ([<args>]) [: <initializer_list>] { | TRICK10: START OF SIM OBJECT CONSTRUCTOR |  |  |  |  |  |
[import <import_tag> <sim_object>.<variable> ;] | NOT IMPLEMENTED | SYNCED DATA IMPORT FROM MASTER/SLAVE; TRICK10: RARELY USED FEATURE HAS BEEN DEPRECATED |  |  |  |  |  |
[C<#>] [{<job_tag>}] [P<#>] [I<sim_object>] ([<cycle_time>, [<start_time>, [<stop_time>]]] <job_class>) <rel_path>:<module> ([<param_type> <param> = <arg> [, É]) ; | [C<#>] [{<job_tag>}] [P<#>][I<sim_object> NOT IMPLEMENTED] ([<cycle_time>, [<start_time>, [<stop_time>]]] "<job_class>") [<return_val> =] <module> ([<arg>][, É]) ; | SPECIFY A JOB TO BE MANAGED BY TRICK EXECUTIVE |  |  |  |  |  |
[export <export_tag> <sim_object>.<variable> ;] | NOT IMPLEMENTED | SYNCED DATA EXPORT TO MASTER/SLAVE; TRICK10: RARELY USED FEATURE HAS BEEN DEPRECATED |  |  |  |  |  |
| [<user_code_block>] | TRICK10: C/C++ USER CODE IN CONSTRUCTOR: ASSIGN VARIABLES, CALL FUNCTIONS, ETC. |  |  |  |  |  |
| } | TRICK10: END OF SIM OBJECT CONSTRUCTOR |  |  |  |  |  |
} <sim_object> ; | } ; | END OF A USER SIM OBJECT DECLARATION (TRICK7: ALSO INSTANTIATE THE SIM OBJECT) |  |  |  |  |  |
| [<my_sim_object_type> <sim_object>[(<args>)] ;] | TRICK10: INSTANTIATE THE SIM OBJECT AND PASS CONSTRUCTOR ARGUMENTS |  |  |  |  |  |
[job_class_order { <job_class_1>, <job_class_2>, ... } ;] | [job_class_order { "<job_class_1>", "<job_class_2>", ... } ;] | SPECIFY A JOB CLASS ORDER DIFFERENT THAN THE TRICK DEFAULT ORDER |  |  |  |  |  |
[integrate (<integration_dt>) <sim_object> [, É] ;] | [IntegLoop <my_integ_loop> (<integration_dt>) <sim_object> [, É] ;] | SPECIFY STATE INTEGRATION |  |  |  |  |  |
[collect <reference> = {[<reference2> [, É]]} ;] | [collect <reference> = {[<reference2> [, É]]} ;] | CREATE A COLLECTION (ARRAY) OF SAME TYPED VARIABLES |  |  |  |  |  |
| [void create_connections() { | TRICK10: C/C++ USER CODE THAT IS RUN AFTER ALL DATA IS INSTANTIATED BUT BEFORE DEFAULT DATA |  |  |  |  |  |
[freeze (<cycle_time>) ;] | [trick_sys.sched.set_freeze_frame(<cycle_time>);] | SET FREEZE CYCLE TIME |  |  |  |  |  |
[<sim_object>:<module_after>([dup_id]) depends on | [trick_sys.sched.add_depends_on_job( |  |  |  |  |  |  |
<sim_object>:<module_before>([dup_id]) | "<sim_object.module_after>", <dup_id>, |  |  |  |  |  |  |
[and <sim_object>:<module_before>([dup_id])]] | "<sim_object.module_before>", <dup_id>);] | SPECIFY EXECUTION ORDER FOR CHILD THREADS |  |  |  |  |  |
| [<user_code_block>] | TRICK10: C/C++ OTHER MISC USER CODE: ASSIGN VARIABLES, CALL FUNCTIONS, ETC. |  |  |  |  |  |
| }] | TRICK10: END OF CREATE_CONNECTIONS USER CODE |  |  |  |  |  |