remove unnecessary (confusing) example on user code blocks

This commit is contained in:
Scott Fennell 2022-05-26 14:06:33 -05:00 committed by GitHub
parent a6eeff930f
commit 7d66ed3c84
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -540,40 +540,9 @@ that provide standard Trick Simulation functionality.
* `##include "cannon/include/cannon_analytic.h"` The S_define must `##include`
type definitions for all of the classes and structures that it uses. It also
needs to include prototypes for all of the functions that it calls. You may also
put the prototypes in the `S_define` block as shown below. But if you need to
call any of the C functions from the input file then you must include the
put the prototypes in the `S_define` block using ([user code blocks](/trick/documentation/building_a_simulation/Simulation-Definition-File#user-code-block)), but if you need to call any of the C functions from the input file then you must include the
prototypes in a header file (the preferred method).
```c++
/*********************************************************************
PURPOSE: (S_define Header)
LIBRARY_DEPENDENCY: ((cannon/src/cannon_analytic.c)
(cannon/src/cannon_init.c)
(cannon/src/cannon_shutdown.c))
*********************************************************************/
#include "sim_objects/default_trick_sys.sm"
##include "cannon/include/cannon.h"
%{
extern "C" {
extern int cannon_analytic(CANNON*) ;
}
%}
class CannonSimObject : public Trick::SimObject {
public:
CANNON cannon ;
CannonSimObject() {
("initialization") cannon_init( &cannon ) ;
("default_data") cannon_default_data( &cannon ) ;
(0.01, "scheduled") cannon_analytic( &cannon ) ;
("shutdown") cannon_shutdown( &cannon) ;
}
} ;
CannonSimObject dyn ;
```
**Listing 7a - `Alternate Way of Adding Prototypes to S_define`**
### Data Lines
`Class CannonSimObject : public Trick::SimObject`