Javascript in SIMA

1. Content assist

  • Ctrl-space open the content assist

  • The content assist contains all variables for the model

  • The model object are also available in the content assist

1327254268 image13

1562464177 image14

2. Model objects & properties

  • The model information is available using scripts.

  • The model properties for the object are available by typing <objectname>.

520311132 image15

2055196331 image16

3. Set variables using scripts

  • Simple variables

958690427 image17

1493437163 image18

4. Set as variable

  • A variable name is suggested by SIMA

  • The name can be changed by the user

1931235866 image19

1854041590 image20

1564227658 image21

5. Example: Set as variable in the environment

  • peakPeriod is suggested by SIMA

875916611 image22

348977414 image23

6. Variable with conditionals

189972368 image24

7. Set variables calling a script

  • Define a script

  • In this example it is called

    • Add_two_numbers_Func

53082309 image26

1408668781 image25

8. Set variables calling a script, cont.

  • Syntax for the variable using the script

8222428 image27

9. Set current environment using a string

1053788769 image28
  • Set current and current depth as string

  • Get the values at each point using index

  • Split & indices 0 - 3

1859639387 image29

572315029 image30

10. External scripts

  • Make an equidistant signal

899752880 image31

1348025156 image32

11. External scripts stored in storage task

1478097099 image33

12. Signals in SIMA

1005940609 image34