Content

Translations, get text in actual language

In SciLab, use format en:Alarms,sk:Alarmy,cz:Alarmy
In PHP files, use function LANG('text')
example:
$component->set_label(LANG( 'Label:'));
$var_label = LANG('Subgroup left');

Control system -> control application

Pozadie s názvom application_11.png uložiť do adresára process/images

Get faceplate parameter

Imagine URL http://localhost/index.php?VP1=blablabla&ylabel=degC
You can use function $my_nice_param = get_faceplate_parameter('VP1');
You can also use function $my_nice_param = get_GET_parameter('VP1');
See also $component->add_faceplate_parameter('VP1',11);

Process file settings

V adresári process je súbor _settings.php, kde sa nastavuje napríklad aj blinking.

Tieto veci sa píšu úplne na začiatok súboru.

Setting Description
$GLOBALS['security_lowest_level'] = 15;
valuemeaning
not setpublic, all logged users and not logged visitors
0public, all logged users and not logged visitors
1-15allow only users with higher or equal security level
15only root allowed
$GLOBALS['security_exception_ids'] = array(1,7,10);
valuemeaning
not setno exception to the previous setting
array()no exception to the previous setting
array(1,7,10) users with ID 1, 7 and 10 are allowed to see this file even if their security level is lower
$GLOBALS['theme_color_background'] = '#FF0000';
valuemeaning
not setdefault dark background is used
'#FF0000'red background
$GLOBALS['theme_color_text'] = '#00FF00';
valuemeaning
not setdefault white text is used
'#00FF00'green text
$GLOBALS['show_header'] = false;
valuemeaning
not setdefault true is used
falsedo not show header
$GLOBALS['show_header'] = false;
valuemeaning
not setdefault value from settings_default.php
trueshow header at the top
falseno header, no menu, no settings
$GLOBALS['show_panel_errors'] = false;
valuemeaning
not setdefault value from settings_default.php
trueshow errors for root (security level 15)
falseno error panel, no errors at components
$GLOBALS['show_panel_alarms'] = false;
valuemeaning
not setdefault value from settings_default.php
trueshow alarm panel
falseno alarm panel
$GLOBALS['show_panel_time'] = false;
valuemeaning
not setdefault value from settings_default.php
trueshow time panel
falseno time panel, showing actual values
$GLOBALS['panel_time_step_unit'] = 60;
valuemeaning in Time Panel for history
not setdefault step unit is used (set in Header -> Settings)
1second
60minute
3600hour
3600*24day
$GLOBALS['panel_time_step'] = 10;
valuemeaning in Time Panel for history
not setdefault step is used (set in Header -> Settings)
positive integerstep units
$GLOBALS['variable_refresh_time_local'] = 1000;
valuemeaning
not setdefault variable_refresh_time is used (set in Header -> Settings)
positive integerHow often are variable values read from actual_values.txt (in msec)
$GLOBALS['parameter_refresh_time_local'] = 10000;
valuemeaning
not setdefault parameter_refresh_time is used (set in Header -> Settings)
positive integerHow often are function values read from UCC (in msec)

Component classes (goto Header -> Menu -> Examples -> All)

Declaration with common presets stare Hynkove bolo:
$component = new component_text($initialization_component);
$component = new component_text($initialization_component);
$component = new component_text($initialization_component, 'function');
$disp_txtlink_template
$disp_siglink_template
$disp_cfun_template
$component = new component_number($initialization_component);
$component = new component_number($initialization_component, 'rtudpio_server');
$disp_realval_template
$disp_realval_rtudpio_template
$component = new component_image($initialization_component); $disp_imglink_template
$disp_actionbutton_template
$component = new component_animation($initialization_component);
$component = new component_animation($initialization_component);
$component = new component_animation($initialization_component, 'rtudpio_server');
$disp_realvalimg_template
$disp_realvalinlimitsimg_template
$disp_realvalimg_rtudpio_template
$component = new component_binary($initialization_component); $disp_binval_template
$disp_binvalimg_template
$disp_binvalimg_autoswitch_template
$disp_binvalimg_autoswitch_rtudpio_template
$component = new component_interval($initialization_component); $disp_realvaltext_template
$disp_realvalinlimitsimg_rtudpio_template
$disp_realvaltext_rtudpio_template
$component = new component_graph($initialization_component); $disp_signal_template
$component = new component_batchserver($initialization_component); $disp_batchserversetup_template
$component = new component_DB_export($initialization_component);
$component = new component_DB_import($initialization_component);
$component = new component_map($initialization_component); the value of the variable must be in a format 483535859174099000
(nine digits for North, nine digits for East)

Component types (second parameter)

type value example
'variable' default; gets value from actual_values.txt or DB
'variable_graph' default for component_graph; gets value from DB
'variable_param' gets value from variable alarm value - calls ucc
$component = new component_number($initialization_component, 'variable_param');
$dispvars[] = $component;
$component->set_left($left);
$component->set_top($top);
$component->set_dcu_id(1);
$component->set_id(19);
$component->set_param_id(0);
$component->set_label('0th ALARM as number:');
'function_param' gets value from function param value - calls ucc $component = new component_number($initialization_component, 'function_param');
$dispvars[] = $component;
$component->set_left($left);
$component->set_top($top);
$component->set_dcu_id(1);
$component->set_id(19);
$component->set_param_id(0);
$component->set_label('0th FUNCTION PARAMETER as number:');
'static' default for component_text, component_image, component_DB, component_DB_import, component_DB_export.
Does not change value
'function' does not change value; used only for onclick
'rtudpio_server' gets value from DB from rtVirtualIO table
'batchserver' not implemented yet

Component methods in category "universal"

Label: 7.700 2 °C
Method Description
$component->set_left(10);
valuemeaning
not setThe component will be placed 0px from left side of the page.
10The component will be placed 10px from left side of the page.
other than positive integerError raised and value remains zero
$component->set_top(10);
valuemeaning
not setThe component will be placed 0px below the header of the page.
10The component will be placed 10px below the header of the page.
other than positive integerError raised and value remains zero
$component->set_additional_refresh(100);
valuemeaning
not setStandard refresh defined in global settings
100Standard refresh defined in global settings PLUS additional refresh each 100 milliseconds.
200Note: Minimal value among variables is taken.
300Old PHP: $dispvar[$inx]['additional_refresh'] = 300;
other than positive integerError raised and value remains not set
$component->set_font_family('Roboto');
valuemeaning
not setPage default font used ('Roboto Regular')
name of the font family (see list) Display component in this font family
$component->set_font_style('italic');
valuemeaning
not setPage default font style used ('normal')
'italic' or 'normal' Display component in this font style
$component->set_font_color('#333');
valuemeaning
not setPage default color used ('#F2FFFF')
'#RRGGBB'Display component in this font color
'black'Display component in this font color
$component->set_font_size(45);
valuemeaning
not setPage default size in pixels used (12)
45Display unit in font size 45px
other than positive integerError raised and value remains unset
$component->set_font_background('orange');
valuemeaning
not setNo background color
'#RRGGBB'Component background color
'orange'Component background color
$component->set_onclick('autoswitch');
valuemeaning
not setNothing happens when component is clicked on.
'panel_function'
'panel_function_schedule'Component type must be $type = 'function'
'panel_var_complete'
'panel_var_simple'
'panel_var_ovrd'Sets width x height to 600 x 110
'panel_var_alarms'
'variable_graph'
'autoswitch'component_binary switches between 0 and 1
'set_binary_value',1component_binary value set to 1
'set_real_value',7component value set to 7
'push_button',1,1000component_binary value set to 1 and after 1000msecs set to 0
'editvalue'Show popup window for editing value (format is checked via ucc_call)
See also set_random_decimal_precision
'process/example.php'any internal page
'https://www.prosystemy.sk/'any extarnal webpage
other valueNothing happens when component is clicked on.
$component->add_onclick(); adds another onclick, use set_onclick_.... function afterwards
$component->add_next_binary_value(0,1000);
$component->add_next_binary_value(1,1000);
component_binary value set to 0 after 1000msecs
component_binary value set to 1 after another 1000msecs
$component->add_next_real_value(8,1000);
$component->add_next_real_value(6,1000);
$component->set_onclick_tooltip('Do the autoswitch!');
valuemeaning
not setOn mouseover display variable name (resp. function name) and onclick (if defined)
'any string'On mouseover, display this string.
LANG('any string')On mouseover, display this string in actual language.
$component->set_onclick_target('_self');
valuemeaning
not setDefault "_blank" is used. Onclick new page will open in a new tab/window.
'_self'Onclick new page will open in the same tab.
$component->set_faceplate_width(900);
$component->set_faceplate_height(530);
valuemeaning
not setOnclick new page will open in a new tab
900Onclick new page will open in a new window with size 900x530
other than positive integerError raised and value remains unset.
$component->set_onclick_security_lowest_level(15);
valuemeaning
not setEverybody can click the component.
0Everybody can click the component.
1-15allow only users with higher or equal security level
15only root allowed
other than positive integerError raised and value remains zero
$component->set_onclick_security_exception_ids(array(1,7));
valuemeaning
not setEverybody with security level can click the component.
array(1,7)Even if users 1 and 7 do not have sufficient security level, they are allowed.
other than array of integersError raised and value remains empty array
$component->set_display_security_lowest_level(15);
valuemeaning
not setEverybody can see the component.
0Everybody can see the component.
1-15Only users with higher or equal security level can see the component.
15Only root can see the component.
other than positive integerError raised and value remains zero
$component->set_display_security_exception_ids(array(1,7));
valuemeaning
not setEverybody with security level can see the component.
array(1,7)Even if users 1 and 7 do not have sufficient security level, they are can see the component.
other than array of integersError raised and value remains empty array
$component->add_faceplate_parameter('VP1',11);
for any component with onclick
valuemeaning
name, value Adds parameter into URL in format &name=value.
See also get_faceplate_parameter('VP1')
The same method is $component->add_GET_parameter('VP1',11);
$component->set_arithmetic_transformation("x/3+x*2+4");
valuemeaning
"some mathematical formula with x"Substitutes actulal value for x and evaluates.

Component methods in category "label"

Label: 7.700 2 °C
Method Description
$component->set_label('Label:');
valuemeaning
not setNo label
'any string'Showing label in the first table cell
LANG('any string')Showing label in actual language in the first table cell
$component->set_label_font_family('Comic Sans MS');
valuemeaning
not setComponent universal font family used
name of the font family (see list) Display label in this font family
$component->set_label_font_color('#008500');
valuemeaning
not setComponent universal font color used
'#RRGGBB'Display label in this font color
'green'Display label in this font color
$component->set_label_font_size(40);
valuemeaning
not setComponent universal font size used
40Display label in font size 40px
other than positive integerError raised and value remains unset

Component methods in category "value"

Label: 7.700 2 °C
Method Description
$component->set_dcu_id(1);
valuemeaning
not setError raised (except rtudpio_server - it ignores dcu_id)
1 Sets dcu ID to 1
other than positive integerError raised and value remains unset
$component->set_id(0);
use only one - either set_id or set_name
valuemeaning
not setError raised
0 Sets variable ID / function ID / rtudp iocFunId to 0
other than positive integer including 0Error raised and value remains unset
$component->set_name('cfn:: Bin.Zero_out0');
use only one - either set_id or set_name
valuemeaning
not setError raised (except rtudpio_server - it ignores name)
'any string' Sets variable name / function name
$component->set_multi_id(
array(
array(1,'cfn:: Physical AI11_out0','teplota exterieru'),
array(1,3,'teplota interieru'),
array(1,8,'vlhkosť vzduchu')
)
);
for component_graph class
use only one - either set_dcu_id + set_id (for one variable) or set_multi_id (for one or more variables)
valuemeaning
not setError raised
array(
array(dcu ID; variable ID or name; variable pretty name),
array(dcu ID; variable ID or name; variable pretty name),
array(dcu ID; variable ID or name; variable pretty name)
)
Validates and sets multi ID
other than allowedError raised and value remains unset
$component->set_param_id(0);
valuemeaning
not setError raised
0 Sets function parameter ID / rtudp iocVarId to 0
other than positive integer including 0Error raised and value remains unset
$component->set_overwrite(7.7);
valuemeaning
not setComponent value is calculated normally
any real number Component value is NOT calculated and overwrite value is displayed.
other than realError raised and value remains unset
$component->set_value_font_family('Courier New');
valuemeaning
not setComponent universal font family used
name of the font family (see list) Display value in this font family
$component->set_value_font_color('pink');
valuemeaning
not setComponent universal font color used
'#RRGGBB'Display value in this font color
'pink'Display value in this font color
$component->set_value_font_size(40);
valuemeaning
not setComponent universal font size used
40Display value and waiting spinner in font size 40px
other than positive integerError raised and value remains unset
$component->set_msg_icon('WRONG_ID','<strong>!!!</strong>');
valuemeaning
not setDefault icons used
message name, HTML code (see list) For message with this name display this HTML code
$component->set_msg_font_family('Courier New');
valuemeaning
not setComponent universal font family used
name of the font family (see list) Display message in this font family
$component->set_msg_font_color('red');
valuemeaning
not setComponent universal font color used
'#RRGGBB'Display message in this font color
'red'Display message in this font color
$component->set_msg_font_size(40);
valuemeaning
not setComponent universal font size used
40Display message in font size 40px
other than positive integerError raised and value remains unset
$component->set_msg_font_size(40);
valuemeaning
not setComponent universal font size used
40Display message in font size 40px
other than positive integerError raised and value remains unset
$component->set_min_value(7);
$component->set_max_value(14);
valuemeaning
not setDefault value -0x7FFFFFFFFFFFFFFF is used
Default value +0x7FFFFFFFFFFFFFFF is used
any real numberMin, max value
other than realError raised and value remains unset
$component->set_random_decimal_precision(7);
valuemeaning
not setIgnored
77 decimal places are normal, 8&9 place is random number
Used only when editing value, see editvalue
other than positive integerError raised and value remains unset
$component->set_number_format('%5.3f');
for component_number class
valuemeaning
not setDefault format %5.2f is used
'%5.3f'5 fields, 3 of them are decimal More
'gpslat'GPS North/South
'gpslong'GPS East/West
$component->set_scale_x(400);
$component->set_scale_y(400);
for component_number class
for component_image class
valuemeaning
not setError raised.
400 horizontal scale 400px is set = how many parts are there between min and max
or vertical scale 400px is set
calculation:
$delta = $scale_x / ($max_value - $min_value);
$position = ($value - $min_value) * $delta;
$component->set_time_frame(2000);
for component_graph class
for variable_graph onclick
valuemeaning
not setDefault time frame 1000 seconds is used
2000Time frame 2000 seconds is used
$component->set_archiveonly('yes');
for component_graph class
for variable_graph onclick
valuemeaning
not setDefault value 'no' is used, show graph from all history recording data
'yes'Show graph only from archive
$component->set_digitsAfterDecimal(15);
for component_graph class
for variable_graph onclick
valuemeaning
not setDefault 2 digits after decimal is used
1515 digits after decimal is used, which is maximum
$component->set_image('images/spritesheet_numbered.png');

for component_image class
for component_animation class
valuemeaning
not setError raised.
path to imageDisplay image (resp. animation section).
wrong path to imageDisplay path.
$component->set_width(20);
$component->set_height(20);

for component_image class
for component_animation class
for component_map class
valuemeaning
not setDisplay image in full size.
Display map in size 300x300.
20Display image with width (resp. height) 20px
other than positive integerError raised and value remains unset
$component->set_nrows(4);
for component_animation class
valuemeaning
not setDefault value 1 is used
4Number of rows in animation picture
other than positive integerError raised and value remains unset
$component->set_ncolumns(4);
for component_animation class
valuemeaning
not setDefault value 1 is used
4Number of columns in animation picture
other than positive integerError raised and value remains unset
$component->set_zero_image('images/button_off.png', 'OFF');
$component->set_one_image('images/button_on.png', 'ON');
for component_binary class
valuemeaning
not set Default image '../content/examples/images/button_off.png' (resp. button_on) is used and no ylabel.
relative path to image in process directory Display value as binary image, parse ylabel from image name.
path to image and ylabel textDisplay value as binary image, set ylabel for onclick graph.
$component->set_zero_text('OFF');
$component->set_one_text('ON');
for component_binary class
valuemeaning
not set Default text OFF (resp. ON) is used and no ylabel.
'any string' Display value as binary text, set ylabel.
LANG('any string') Display value as binary text in actual language, set ylabel.
$component->set_zero_font_family('Roboto');
$component->set_zero_font_color('#EEE');
$component->set_zero_font_size(20);
$component->set_zero_image_width(20);
$component->set_zero_image_height(20);
$component->set_one_font_family('Roboto');
$component->set_one_font_color('#EEE');
$component->set_one_font_size(20);
$component->set_one_image_width(20);
$component->set_one_image_height(20);
for component_binary class
$component->set_interval_font_family('Roboto');
$component->set_interval_font_color('#EEE');
$component->set_interval_font_size(20);
$component->set_interval_image_width(20);
$component->set_interval_image_height(20);
for component_interval class
$component->add_interval_text($to=0.5, $text='OFF');
$component->add_interval_text($to=1.5, $text=LANG('ON'));
$component->add_interval_image($to=0.5, $image='images/button_off.png');
for component_interval class
$component->rotate_according_to_my_own_value();
for component_number class
for component_image class
no parameter
the value of the variable is used as degrees
$component->set_map_zoom(0.05);
for component_map class
valuemeaning
not set Default value 0.0001 is used.
0.05 The size of the displayed box is
North - 0.05 and North + 0.05
East - 0.05 and East + 0.05
0.0001 Maximal zoom (smallest area)
200 Minimal zoom (all globe)
other than positive float Error raised and value remains unset

Component methods in category "unit"

Label: 7.700 2 °C
Method Description
$component->set_unit('°C');
for component_number class
valuemeaning
not setNo unit displayed
'any string' Display unit
$component->set_unit_font_family('Roboto');
valuemeaning
not setComponent universal font family used
name of the font family (see list) Display unit in this font family
$component->set_unit_font_color('#000000');
valuemeaning
not setComponent universal font color used
'#RRGGBB'Display unit in this font color
'black'Display unit in this font color
$component->set_unit_font_size(20);
valuemeaning
not setComponent universal font size used
20Display unit in font size 20px
other than positive integerError raised and value remains unset

Special component methods

Method Description
$component->set_DB_host('127.0.0.1');
for component_DB_export class
for component_DB_import class
valuemeaning
not setDefault host '127.0.0.1' is used.
'any string'Set host
$component->set_DB_user('root');
for component_DB_export class
for component_DB_import class
valuemeaning
not setError raised
'any string'Set user
$component->set_DB_password('heslo');
for component_DB_export class
for component_DB_import class
valuemeaning
not setError raised
'any string'Set password
$component->set_DB_name('somename');
for component_DB_export class
for component_DB_import class
valuemeaning
not setError raised
'any string'Set DB name
$component->set_category('somename');
for component_DB_export class
for component_DB_import class
valuemeaning
not setUse directory 'data'
'any string'Set subdirectory name
$component->set_DB_tables(array('table1', 'table2', 'table3'));
for component_DB_export class
valuemeaning
not setError raised
array of table namesSet tables

Component messages

message name default icon other icon examples and codes old PHP
'OVERRIDE' (ucc info) none $component->set_msg_icon('OVERRIDE', ''); $dispvar[$inx]['msg_icon_OVERRIDE']= '';
'ALARM' (ucc info)
$component->set_msg_font_color('red');
$component->set_msg_icon('ALARM', '&#9888;');
// https://www.w3schools.com/charsets/ref_emoji.asp
$dispvar[$inx]['msg_icon_ALARM']= '';
'MISSED_CONNECTIONS' (ucc info) ❶ &#10102;
➀ &#10112;
➊ &#10122;
$dispvar[$inx]['msg_icon_MISSED_CONNECTIONS']= '';
'OVERWRITE' (visualization info) ℹ &#8505; $dispvar[$inx]['msg_icon_OVERWRITE']= '';
'VALUE_BELOW_MIN' (visualization info) $dispvar[$inx]['msg_icon_VALUE_BELOW_MIN']= '';
'VALUE_ABOVE_MAX' (visualization info) $dispvar[$inx]['msg_icon_VALUE_ABOVE_MAX']= '';
'WRONG_DCU' (error) $component->set_msg_icon('ALARM', '&#8855;'); $dispvar[$inx]['msg_icon_WRONG_DCU']= '';
'WRONG_ID' (error) $dispvar[$inx]['msg_icon_WRONG_ID']= '';
'WRONG_NAME' (error) $dispvar[$inx]['msg_icon_WRONG_NAME']= '';
'WRONG_PARAM_ID' (error) $dispvar[$inx]['msg_icon_WRONG_PARAM_ID']= '';
'NO_DATA' (error) no_data.png $component->set_msg_icon('NO_DATA', '<img src="content/examples/images/no_data.png" width="20" alt="no_data.png" />'); $dispvar[$inx]['msg_icon_NO_DATA']= '';
default (other error) ❓ &#10067;
?
$component->set_msg_font_color('red');
$component->set_msg_icon('default', '?');
$dispvar[$inx]['msg_icon_default']= '';