IGWiki Main Page

Ricerca pagine
Guida ricerche





IGSuiteJSup code (Bozza)
  Modifica PaginaWiki ViewStorico paginaProprietàGet PdfCalcTranslatorVisualizza il documento in formato stampabile.PreferitesPosso Aiutarti

JSup uses code in many places to provide values/conditions/action/etc. to animations, script, channels, etc.

Normally the code is entered in a Code multitab control:


/img/JSup/mathCode-in-textField.pngSome animations contain parameter expressions that can only be entered in Math code language in simple text fields (see the picture on the right).

Code languages

The code in JSup can be entered in two different language.

  • Math code: for simple mathematics expressions (simply to get the value of a tag or combine some tag values in a math expression).
  • JavaCode: for advanced elaboration and to have access to external Java libraries (for some animations of for JavaCode functions the JavaCode language is the only allowed).

Code execution

An Action code is executed when the user, for example, presses a button, or when a condition is met (for a condition script).

A code that is used to provide a value (or a condition) to an animation or a script, instead, is executed the first time (when the window that contains the animation code is displayed) and then when a some trigger tag changes its value (see tag change deadband to limit the changes of a tag).

  • /img/JSup/autoTriggers.pngAuto triggers: by default the trigger tags are automatically detected in the code content: all the tag used in the code (except the tags that are used as assignment target). Used tag array elements are dynamically detected and looked for changes. This is the simplest way and, in 99% of the situations, is right one. Auto trigger recalculate the code when any of the contained tag value changes.
  • /img/JSup/customTriggers.pngCustom triggers must be provided when the Auto triggers checkbox is not selected. To select them you have to move to the Custom trigger tab. Then press the Add button and selected the trigger from the tag list dialog. At least one custom trigger must be provided. If you want the code to be never triggered then you can add a never triggered tag (usually a boolean read only tag with no I/O hooks). Custom trigger must be used in two different (and opposite) situations:
    • The values of the tags used in the code change to often, and you want to limit the times the code is executed in a second. So you can decide to executed the code only once in a second and you can set the system tag $Second as custom trig.
    • The code result depends on some external data (file, database, ...) that is not a tag. In such situation, with Auto trigger mode, the code would never be recalculated. So you can set a custom trigger: the system tag $Second to execute the code once per second, or a tag whose value is forced in a timed script.

Code documentation

The documentation for the Math code and for JavaCode is always available in the MathExpression help / JavaCode help tabs of the code control.

  • The documentation is in Wikipedia LinkHTML format, so you can click the hyperlinks to change the displayed page and Alt+left/right arrows to go back/forward in the page history.
  • You can maximize the documentation text to full screen with a double right click of the mouse.

Code locations


Nome: JSup Code - Revisione: 0 - Autore: Alessandro Forlani (24.08.2009) - Modificata da: Alessandro Forlani (02.09.2009) - Categoria: JSup - Scadenza: 24.08.2010 - Permessi di visualizzazione: Tutti indistintamente - Permessi di modifica: Solo al proprietario - Copyright © Administrator All right reserved

Need account? Non hai un account?
Login
Password
Secure connection


Ultimi documenti modificati
   
getrss

Documenti recenti
   
    Nessuna corrispondenza trovata