Master functions are the functions that modify / overload the functionality of the other functions. They are characterized by a text "Master" in the name of function.
They are divided into two groups:

  • Set - sets and cancels the overloading / modification
  • Get - gets the current status of overloading

The functions for the setting - %HI_Set...Master... - use the method of overloading + disabling of the feature and cancel the overloading. They disable the access to the objects or their parts, without affecting the operation of script which controls the behavior of objects. The previous, overloaded functions work as if they were not overloaded. Also when they get the object statuses, they receive the values as if the objects were not overloaded.
For example: The visible object became hidden by using the %HI_SetMasterVisible function, but %HI_GetVisible function gets the information that the object is visible.

The functions %HI_Get...Master... get the current status of overloaded object that has been set by %HI_Set...Master... functions.

In this table below you can see the behaving of the objects when using the functions %HI_SetMasterVisible, %HI_GetMasterVisible, %HI_SetVisible, %HI_GetVisible.

%HI_SetMasterVisible / %HI_GetMasterVisible %HI_SetVisible / %HI_GetVisible Visibility
True / True True / True The object is visible.
True / True False / False The object is hide.
False / False True / True The object is hide.
False / False False / False The object is hide.

The behaving of the Master functions is configured to allow easy adjusting of the debugged scripts to the change of external conditions, e.g. the change of user and disabling some of the activities.


Example of use

The picture contains the button to switch to the history of picture. The function %HI_SetEnable enables to press this button. Other user, whose access to the history is disabled, logs on to the D2000 HI. The usage of this button is disabled by the %HI_SetMasterEnable function for this user (%HI_SetEnable is overloaded by %HI_SetMasterEnable). After the user with the rights to use this button has logged on to the application, he may use the functionality as defined by %HI_SetEnable. During blocking, %HI_GetEnable returns the value for the object as if it would not be disabled by %HI_SetMasterEnable. The overloading method do not influence the behavior that has been configured in the script and therefore this feature can be easily implemented to the previous scripts.

 ENTRY OnLogOn(IN TEXT _userName, IN BOOL _bLogOn)
  IF _userName="Operator1" THEN
 
   ; Operator1 cannot see the history
   %HI_SetMasterEnable(_BtnStartHistorie,@FALSE)
  ELSIF ! _bLogOn THEN
 
   ; the access to history is disabled if no one is logged on
   %HI_SetMasterEnable(_BtnStartHistorie,@FALSE)
  ELSE
 
   ; the access to history is not disabled by Master function
   %HI_SetMasterEnable(_BtnStartHistorie,@TRUE)
  ENDIF
 END OnLogOn 

List of Master functions and overloaded functions


Napíšte komentár