Documentation
Example 2
Display of grades in the kitchen
Imagine you have a son named Kevin. Your heir attends 9th grade of a high school. Unfortunately, Kevin has been having problems at school for a few weeks. Therefore, you now want to hear from him weekly how things are going grade-wise in the individual subjects so that, if necessary, measures can be taken to ensure that the class goal can still be achieved.
To do this, hang an iPad on the kitchen wall. Every Friday at 6 p.m., Kevin is to enter his current performance level here, which he has previously requested from the individual subject teachers.
You now create a variable profile with associations - as described in Example 1 - so that the individual subjects and the associated grades can appear in WebFront and thus on your iPad in the kitchen.
This is sure to be a real eye-catcher in your kitchen. However, there is now a small problem. To enter the grades every Friday, Kevin has to come to your study so that you do this for him in the IP-Symcon console. (Unfortunately Kevin is only interested in mopeds and the female sex and therefore can't handle IP-Symcon)
After the first entry, you are so annoyed by Kevin's chaotic note-taking that you decide to disinherit him. Somehow, though, you don't want to donate your assets to charity after you pass away, but you don't want to suffer a nervous breakdown either.
Kevin is now to independently enter his grades directly in WebFront on the iPad in the kitchen.
To do this, you must set your previously passive variable profile to an active state. To achieve this, first create a so-called script. A script (or also called program) is a string of more or less complex functions. To do this, select "Add object" in the object tree view (right mouse button or top left) and then "Add script". Now give your script a name and press "Next" twice and "OK" once.
Now a script editor window appears.
This must not be left empty under any circumstances, as a code must be entered here that allows a request from WebFront (in our example, a press of Kevin's finger on a censor) to be taken over and displayed as the new actual state. Now replace the line "//Paste your script source code here" with “SetValue($_IPS['VARIABLE'], $_IPS['VALUE']);”. Make sure that “<?” und “?>“ are kept, as the "Start" and "End" of the script are marked by this. You can close the window now. Do not press "Execute" as this function will only respond correctly to an execution in WebFront. You can read details about this special code line in System variables.
After that, find a suitable place for your script in the tree structure.
Visualization: Enumeration
You must now link the script to your variables. A variable must always be assigned to a script so that the script recognizes what is to be switched. This script will be called action script from now on. Double-click on the selected variable to access the "Edit variable" menu. Click on "Next". Now press "Select", search for your action script in the object tree structure and confirm by double-clicking. Then click "Next" twice and confirm once with "OK".
Repeat this process for all variables (in our case subjects) that you want Kevin to edit later.
Now Kevin can finally enter his grades directly into WebFront on the iPad in the kitchen at the touch of a finger.
The display of an enumeration is only possible in WebFront if at least one association has been added in the variable profile.
You are enthusiastic. Unfortunately, you spouse is not. The WebFront in the kitchen is now too cluttered for her and looks kind of jumbled. One cannot process so much information and besides, one cannot really see how Kevin is doing in the individual subjects. Her best friend says the same thing, by the way.
Full of drive and the desire to improve your little world a bit, you storm into the study.
Visualization: Value selection
How can you now change the display in WebFront so that it is clearer, but can still be operated by Kevin?
To do this, double-click on a variable, which in our case represents a class. This will take you to the "Edit Variable" menu. Click on "Next". Now press "Change" and confirm with "Yes". Then click on "Edit". Now delete all associations (trash can on the right) and confirm with "OK". In this case, enter "1" for the step size. The step size determines in which interval the numbers (in our case grades) of the value selection are displayed in WebFront. Now click on "Save profile" and exit the menu. The change is automatically applied to all variables that use this variable profile, i.e. here for all subjects.
A simple value selection (1 to 6) is now displayed in WebFront, which Kevin can operate without any problems.
The display of a value selection is only possible if no association is present and if a step size has been specified in the "Edit Variable" menu.
You are enthusiastic. Unfortunately, you spouse is not. Somehow it is stupid that now e.g. the grades 3 and 4 are displayed one below the other, because the scale is too big, she thinks. So you can't really see how Kevin is doing in the individual subjects. Her best friend says the same thing, by the way.
Furious, you storm into the study one last time to prove to your spouse that the money you spent on your home control system was more than worth it.
Visualization: Slider
How can you change the display in WebFront again so that it is clearer but can still be operated by Kevin?
You decide to display the grades in the form of a slider in WebFront on the iPad in the kitchen. The advantage of this is that it's incredibly clear and it gives Kevin free math tutoring, because he now has to convert the grade values into percentages before entering his weekly grades, where 0 percent should represent a 6 and 100 percent a 1.
To do this, double-click on a variable, which in our case represents a class. This will take you to the "Edit Variable" menu. Click on "Next". Now press "Change" and confirm with "Yes". Again, after completion, the change is automatically applied to all variables that use this variable profile, i.e. in our case to all subjects. Now enter "%" for Suffix, because a slider can only display in percent. “0” is recommended for “Min value”, while “100” is recommended for “Max value”. The step size remains set to "1".
In WebFront, the grades are now displayed as sliders.
The display of a slider is only possible if there is no association, if "%" has been added at suffix, if "Min Value" and "Max Value" are defined but not equal, and if a step size has been specified in the "Edit Variable" menu.
You are enthusiastic. Your spouse, too. Kevin unfortunately not. You have overestimated his knowledge of mathematics beyond measure. He just can't manage to enter his grades weekly in WebFront on the iPad in the kitchen because he can't convert them to percentages. His classmates supposedly can't either.
You've had enough for good. They make an appointment with Kevin's teacher.