Warning: Trying to access array offset on false in /home/imagemte/www/wp-content/plugins/wp-mail-bank/includes/class-mail-bank-auth-host.php on line 336
Warning: Trying to access array offset on false in /home/imagemte/www/wp-content/plugins/wp-mail-bank/wp-mail-bank.php on line 563
Warning: Trying to access array offset on false in /home/imagemte/www/wp-content/plugins/wp-mail-bank/wp-mail-bank.php on line 520 Tuto-HMI-User – Imagem Technology
When composing complex and dynamic HMIs, Magneto Studio® allows for non-predefined directives to be integrated in the form of code expressed in C language syntax but used with the same ease as a script. This choice allows for optimal embedded development while remaining within the reach of a non-developer (the general expressions remain as simple as Javascript or Python).
Information (developer): single quotes (') are used to indicate that this is code that will be compiled directly. The included expression can be either a single statement, a sequence of statements or a call to a function declared and instantiated in the user source code. In any case, it must respect the syntax of the C language. Tip: If the result obtained does not correspond to that expected during development, opening the terminal (area 5) will provide information about errors specific to the program generation stages (compilation and linking phase).
Assigning variables to text
Once you have created your variables, we will see how to assign them to elements of your interface.
To do this :
Create or select a text.
Make the text editable by clicking on the "Editable" checkbox in the properties area (area 3).
Open the editor (format for saving a project), click on the "Editor" button (area 4).
Search in the editor for your text object.
Edit " text : " by returning your variable in the single quotes. (exemple : " text : ‘return Heures;’ ").
Assigning a function to an action
To assign a function to an action you must either have imported your code into the project (in C Language) and have previously activated the necessary libraries if needed (see the section Importing your source code) or use standard C code.
Once done:
Create an action.
Choose the "code" type.
Open the editor.
Edit line "onPress : " and replace by "onPress : 'maFonction();' "
Example of a standard code call:
Edit the line " onPress : '' " and replace by " onPress : 'printf("Hello World !");' "
We use cookies to ensure that we give you the best experience on our website. If you continue to use this site we will assume that you are happy with it.