mirror of
https://github.com/nasa/trick.git
synced 2025-01-18 18:56:31 +00:00
remove unnecessary (confusing) example on user code blocks
This commit is contained in:
parent
a6eeff930f
commit
7d66ed3c84
@ -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`
|
||||
|
Loading…
Reference in New Issue
Block a user