Functions | |
unUnRcpInstance_ObjectListGetValueTime (string sDeviceName, string sDeviceType, dyn_string &dsReturnData) | |
unUnRcpInstance_FaceplateStatusRegisterCB (string sDp, bool bSystemConnected) | |
unUnRcpInstance_FaceplateStatusDisconnection () | |
unUnRcpInstance_FaceplateConnect (string deviceName) | |
unUnRcpInstance_FaceplateDisconnect (string deviceName) | |
unUnRcpInstance_ButtonRegisterCB (string sDp, bool bSystemConnected) | |
unUnRcpInstance_UserLoginGetButtonState (string deviceName, string sType, dyn_string &dsReturnData) | |
unUnRcpInstance_ButtonSetState (string deviceName, string sDpType, dyn_string dsUserAccess, dyn_string dsData) | |
unUnRcpInstance_ButtonDisconnection () | |
unUnRcpInstance_ButtonUserAccess (string sDpName, string sDpType, dyn_string &dsAccess) | |
unUnRcpInstance_ButtonAnimationCB (string sDpLock, bool bLocked, string sDpSelect, string sSelectedManager, string sDpState, string sState) | |
unUnRcpInstance_WidgetRegisterCB (string sDp, bool bSystemConnected) | |
unUnRcpInstance_WidgetDisconnection (string sWidgetType) | |
unUnRcpInstance_WidgetConnect (string deviceName, string sFrontEnd) | |
unUnRcpInstance_WidgetDisconnect (string deviceName, string sFrontEnd) | |
unUnRcpInstance_WidgetCB (string sDpLocked, bool bLocked, string sDpSelectedManager, string sSelectedManager, string sDpState, string sState, string sDpFESystemIntegrityAlarmValue, int iFESystemIntegrityAlarmValue, string sDpFESystemIntegrityAlarmEnabled, bool bFESystemIntegrityAlarmEnabled, string sDpLastActivatedOfThisType, string sLastActivatedOfThisType) | |
unUnRcpInstance_MenuConfiguration (string sDpName, string sDpType, dyn_string dsAccessOk, dyn_string &menuList) | |
unUnRcpInstance_HandleMenu (string deviceName, string sDpType, dyn_string menuList, int iMenuAnswer) | |
unUnRcpInstance_StateAnimation (bool bSystemConnected, string sWidgetType, int iFESystemIntegrityAlarmValue, bool bFESystemIntegrityAlarmEnabled) | |
unUnRcpInstance_StateDisconnection (string sWidgetType) |
UNICOS Copyright (C) CERN 2014 All rights reserved
unRcpUnRcpInstance.ctl This library contains the widget, faceplate, etc. functions of UnRcpInstance.
15/09/2014 : Ivan
unUnRcpInstance_ObjectListGetValueTime | ( | string | sDeviceName, | |
string | sDeviceType, | |||
dyn_string & | dsReturnData | |||
) |
Function called from snapshot utility of the treeDeviceOverview to get the time and value
sDeviceName | input, device name | |
sDeviceType | input, device type | |
dsReturnData | output, return data, array of 5 strings |
unUnRcpInstance_FaceplateStatusRegisterCB | ( | string | sDp, | |
bool | bSystemConnected | |||
) |
faceplate DistributedControl callback of the faceplate status panel
sDp | input, the DistributedControl system name DP name | |
bSystemConnected | input, the state of the system name |
References unUnRcpInstance_FaceplateConnect(), unUnRcpInstance_FaceplateDisconnect(), and unUnRcpInstance_FaceplateStatusDisconnection().
unUnRcpInstance_FaceplateStatusDisconnection | ( | ) |
set the faceplate when the device system is disconnected
Referenced by unUnRcpInstance_FaceplateConnect(), and unUnRcpInstance_FaceplateStatusRegisterCB().
unUnRcpInstance_FaceplateConnect | ( | string | deviceName | ) |
dpConnect to the device data
deviceName | input, the device DP name |
References unUnRcpInstance_FaceplateStatusDisconnection().
Referenced by unUnRcpInstance_FaceplateStatusRegisterCB().
unUnRcpInstance_FaceplateDisconnect | ( | string | deviceName | ) |
dpDisconnect to the device data
deviceName | input, the device DP name |
Referenced by unUnRcpInstance_FaceplateStatusRegisterCB().
unUnRcpInstance_ButtonRegisterCB | ( | string | sDp, | |
bool | bSystemConnected | |||
) |
Contextual button DistributedControl callback of the contextual device button panel
sDp | input, the DistributedControl system name DP name | |
bSystemConnected | input, the state of the system name |
References unUnRcpInstance_ButtonDisconnection().
unUnRcpInstance_UserLoginGetButtonState | ( | string | deviceName, | |
string | sType, | |||
dyn_string & | dsReturnData | |||
) |
return the device data, this function is called when the user logs in and logs out
deviceName | input, the device DP name | |
sType | input, the device type | |
dsReturnData | output, the device data, [1] = lock state, [2] = lock by, [3] .. [6] device data |
unUnRcpInstance_ButtonSetState | ( | string | deviceName, | |
string | sDpType, | |||
dyn_string | dsUserAccess, | |||
dyn_string | dsData | |||
) |
Set the state of the contextual button of the device
deviceName | input, the device DP name | |
sDpType | input, the device type | |
dsUserAccess | input, list of allowed action on the device | |
dsData | input, the device data [1] = lock state, [2] = lock by, [3] .. [6] device data |
Referenced by unUnRcpInstance_ButtonAnimationCB().
unUnRcpInstance_ButtonDisconnection | ( | ) |
set the state of the device action button when the device system is disconnected
Referenced by unUnRcpInstance_ButtonRegisterCB().
unUnRcpInstance_ButtonUserAccess | ( | string | sDpName, | |
string | sDpType, | |||
dyn_string & | dsAccess | |||
) |
returns the list of allowed action on the device for a user logged in
sDpName | input, the device DP name | |
sDpType | input, the device type | |
dsAccess | input, list of allowed action on the device |
References _unRecipeFunctions_getDefaultInstancePrivileges().
unUnRcpInstance_ButtonAnimationCB | ( | string | sDpLock, | |
bool | bLocked, | |||
string | sDpSelect, | |||
string | sSelectedManager, | |||
string | sDpState, | |||
string | sState | |||
) |
callback function on the device data
sDpLock | input, the lock DPE | |
bLocked | input, selected lock state of the device | |
sDpSelect | input, the select DPE | |
sSelectedManager | input, user and Ui that selected the device | |
sDpState | input, the datapoint name of the recipe instance | |
sState | input, state of the recipe instance |
References unUnRcpInstance_ButtonSetState().
unUnRcpInstance_WidgetRegisterCB | ( | string | sDp, | |
bool | bSystemConnected | |||
) |
widget DistributedControl callback
sDp | input, the DistributedControl system name DP name | |
bSystemConnected | input, the state of the system name |
References unUnRcpInstance_WidgetConnect(), unUnRcpInstance_WidgetDisconnect(), and unUnRcpInstance_WidgetDisconnection().
unUnRcpInstance_WidgetDisconnection | ( | string | sWidgetType | ) |
set the widget when the system is disconnected
sWidgetType | input, the type of widget |
use the exec mechanism to allow multiple widget.
Referenced by unUnRcpInstance_WidgetConnect(), and unUnRcpInstance_WidgetRegisterCB().
unUnRcpInstance_WidgetConnect | ( | string | deviceName, | |
string | sFrontEnd | |||
) |
dpConnect to the device data
deviceName | input, front-end device DP name | |
sFrontEnd | input, front-end device name |
References unUnRcpInstance_WidgetDisconnection().
Referenced by unUnRcpInstance_WidgetRegisterCB().
unUnRcpInstance_WidgetDisconnect | ( | string | deviceName, | |
string | sFrontEnd | |||
) |
dpDisconnect to the device data
deviceName | input, front-end device DP name | |
sFrontEnd | input, front-end device name |
Referenced by unUnRcpInstance_WidgetRegisterCB().
unUnRcpInstance_WidgetCB | ( | string | sDpLocked, | |
bool | bLocked, | |||
string | sDpSelectedManager, | |||
string | sSelectedManager, | |||
string | sDpState, | |||
string | sState, | |||
string | sDpFESystemIntegrityAlarmValue, | |||
int | iFESystemIntegrityAlarmValue, | |||
string | sDpFESystemIntegrityAlarmEnabled, | |||
bool | bFESystemIntegrityAlarmEnabled, | |||
string | sDpLastActivatedOfThisType, | |||
string | sLastActivatedOfThisType | |||
) |
callback function on the device data
sDpLocked | input, the lock DPE | |
bLocked | input, the lock state | |
sDpSelectedManager | input, the selected manager DPE | |
sSelectedManager | input, the selected manager | |
sDpState | input, the recipe instance state DPE | |
sState | input, the recipe instance state value | |
sDpFESystemIntegrityAlarmValue | input, front-end device system integrity alarm DPE | |
iFESystemIntegrityAlarmValue | input, front-end device system integrity alarm value | |
sDpFESystemIntegrityAlarmEnabled | input, front-end device system integrity enable DPE | |
bFESystemIntegrityAlarmEnabled | input, front-end device system integrity enable value | |
sDpLastActivatedOfThisType | input, datapoint name of the last recipe activated of the recipe class | |
sLastActivatedOfThisType | input, name of the last recipe activated of the recipe class |
use the exec mechanism to allow multiple widget.
References _unRecipeFunctions_adjustStringToSize().
unUnRcpInstance_MenuConfiguration | ( | string | sDpName, | |
string | sDpType, | |||
dyn_string | dsAccessOk, | |||
dyn_string & | menuList | |||
) |
pop-up menu
sDpName | input, device DP name | |
sDpType | input, device type | |
dsAccessOk | input, the access control | |
menuList | output, pop-up menu to show, dyn_string to be given to the popupMenu function |
e.g.: device menu enable/disabled depending on the device access right int pos, iMenu=UN_POPUPMENU_MIN; string sAccess, sOperAction, sExpAction, sAdminAction, sMenu; dyn_string exceptionInfo, dsArchiveName; dyn_bool dbPermissions;
pos = dynContains(menuList, "PUSH_BUTTON, Device configuration, 10, 1"); if(pos > 0) { get the access rigth on the device unGenericDpFunctions_getAccessControlPriviledgeRigth(sDpName, g_dsDomainAccessControl, dbPermissions, sOperAction, sExpAction, sAdminAction, exceptionInfo); sAccess = "0"; if(dbPermissions[4]) { sAccess = "1"; }
sprintf(sMenu, "%d", (iMenu+1)); dynInsertAt(menuList, "SEPARATOR", pos); dynInsertAt(menuList, "PUSH_BUTTON, device menu, "+sMenu+", "+sAccess, pos); dynInsertAt(menuList, "SEPARATOR", pos); }
e.g.: add all the device actions dyn_string dsUserAccess; int pos,i, len, iMenu=UN_POPUPMENU_MIN; string sMenu;
pos = dynContains(menuList, "PUSH_BUTTON, Device configuration, 10, 1"); if(pos > 0) { get the allowed device actions for the user logged in unUnRcpInstance_ButtonUserAccess(sDpName, "UnRcpInstance", dsUserAccess); remove Select if it is in the list len = dynContains(dsUserAccess, UN_POPUPMENU_SELECT_TEXT); if(len > 0) dynRemove(dsUserAccess, len); len = dynlen(dsUserAccess); if(len > 0) dynInsertAt(menuList, "SEPARATOR", pos);
add all the device actions for(i=1;i<=len;i++) { sprintf(sMenu, "%d", (iMenu+1)); iMenu++; dynInsertAt(menuList, "PUSH_BUTTON, "+dsUserAccess[i]+", "+sMenu+", 1", pos); } if(len > 0) dynInsertAt(menuList, "SEPARATOR", pos); }
e.g.: add all the device actions depending on the current device value dyn_string dsUserAccess; int pos,i, len, iMenu=UN_POPUPMENU_MIN; string sMenu, sAccess, sMenuText; int iData; bool bSelected; bool bActionOk; dyn_string dsButtons = makeDynString("..", "..", "..");
pos = dynContains(menuList, "PUSH_BUTTON, Device configuration, 10, 1"); if(pos > 0) { get the allowed device actions for the user logged in unUnRcpInstance_ButtonUserAccess(sDpName, "UnRcpInstance", dsUserAccess); bSelected = dynContains(menuList, "PUSH_BUTTON, Deselect, 1, 1"); dpGet(sDpName+".ProcessInput.iData", iData); remove Select if it is in the list len = dynContains(dsUserAccess, UN_POPUPMENU_SELECT_TEXT); if(len > 0) dynRemove(dsUserAccess, len); len = dynlen(dsButtons); if(dynlen(dsUserAccess) > 0) dynInsertAt(menuList, "SEPARATOR", pos);
add the device actions for(i=1;i<=len;i++) { sprintf(sMenu, "%d", (iMenu+1)); iMenu++; sAccess = "0"; bActionOk = (dynContains(dsUserAccess, dsButtons[i]) > 0); // User access switch(dsButtons[i]) { case "..": bActionOk = bActionOk & bSelected & (iData == ".."); sMenuText = "Action .."; break; default: bActionOk = false; sMenuText = ""; break; } if(bActionOk) sAccess = "1"; if(sMenuText != "") dynInsertAt(menuList, "PUSH_BUTTON, "+sMenuText+", "+sMenu+", "+sAccess, pos); } if(dynlen(dsUserAccess) > 0) dynInsertAt(menuList, "SEPARATOR", pos); }
unUnRcpInstance_HandleMenu | ( | string | deviceName, | |
string | sDpType, | |||
dyn_string | menuList, | |||
int | iMenuAnswer | |||
) |
handle the answer of the popup menu
deviceName | input, device DP name | |
sDpType | input, device type | |
menuList | input, the access control | |
iMenuAnswer | input, selected menu value |
e.g.: handle the device actions find the corresponding device action text dsTemp = dynPatternMatch("PUSH_BUTTON, *, 1", menuList); len = dynlen(dsTemp); for(i=1;i<=len;i++) { dsSplit = strsplit(dsTemp[i], ","); sscanf(dsSplit[3], "%d", iMenu); if(iMenu == iMenuAnswer) { switch(strltrim(dsSplit[2], " ")) { case "..": do the action break; } } }
unUnRcpInstance_StateAnimation | ( | bool | bSystemConnected, | |
string | sWidgetType, | |||
int | iFESystemIntegrityAlarmValue, | |||
bool | bFESystemIntegrityAlarmEnabled | |||
) |
animate the device State widget !!!!! function trigger by exec call, $-param and variable of the widget cannot be used, all the necessary data must be given to the function. The use of global var (global keyword declaration) is allowed
bSystemConnected | input, connection state of the system, true=system connected/false=system not connected | |
sWidgetType | input, the type of widget | |
iFESystemIntegrityAlarmValue | input, front-end device system integrity alarm value | |
bFESystemIntegrityAlarmEnabled | input, front-end device system integrity enable value |
!!!!!!! all parameters must be given: function launched by exec
unUnRcpInstance_StateDisconnection | ( | string | sWidgetType | ) |
animate the the device State widget when the system is disconnected !!!!! function trigger by exec call, $-param and variable of the widget cannot be used, all the necessary data must be given to the function. The use of global var (global keyword declaration) is allowed
sWidgetType | input, the type of widget |