unRecipe 9.1.0
unRcpFunctions.ctl File Reference

LIBRARY: unRecipeFunctions.ctl

Author
: Ivan Prieto Barreiro (EN-ICE-SIC)

Creation Date: April 2011

version 1.4.0

Modification History: 01/11/2011: Ivan

  • v1.1.0: The device type names have been modified to use the "CPC_" prefix.

01/08/2012: Ivan

  • v1.2.0 : Adding new functionalities to the component:
    • Dynamic creation of recipe classes.
    • Recipe activation in multiple PLCs.

09/12/2013: Ivan

  • v1.3.4 : Bug fixing and improvements in existing functionalities.

09/09/2014: Ivan

  • v1.4.0 : Bug fixing and improvements in existing functionalities.

External Functions:

Internal Functions:

global mapping unRecipeFaceplate_selectedRecipe
 
void unRecipeFunctions_writeDifferentOnlineValuesReport (dyn_int diDiffRowIndex, dyn_string dsDpNames, dyn_string dsAlias, dyn_anytype daRcpValues, dyn_anytype daOnlineValues)
 
bool _unRecipeFunctions_getRowStylesForValueComparison (dyn_anytype daValues1, dyn_anytype daValues2, dyn_int &diRowStyleIndex, dyn_int &diRowStyles, dyn_int &diDiffRowIndex)
 
void unRecipeFunctions_getOnlineValues (dyn_string dsDpNames, dyn_anytype &values, dyn_string &exceptionInfo, time t=0)
 
void _unRecipeFunctions_getTypeMapping (string sRecipeType, mapping &map, dyn_string &exceptionInfo)
 
synchronized bool _unRecipeFunctions_lockDevices (dyn_string dsDpNames, dyn_string &dsLockedDeviceDp, dyn_string &dsLockedDeviceAlias, dyn_string &exceptionInfo, bool isPeriodicSave=false)
 
synchronized bool _unRecipeFunctions_unlockDevices (dyn_string dsDpNames, dyn_string &exceptionInfo, bool isPeriodicSave=false)
 
void unRecipeFunctions_formatValues (dyn_string dsDpNames, dyn_string values, dyn_anytype &formattedValues, dyn_string &exceptionInfo)
 
bool _unRecipeFunctions_checkRecipeValues (dyn_string dsDps, dyn_anytype values, bool bShowErrorLines, dyn_string &exceptionInfo)
 
int unRecipeFunctions_checkRecipeValue (string sDpName, anytype value, dyn_string &exceptionInfo)
 
mapping _unRecipeFunctions_extractAnalogAlarms (dyn_string dsDps, dyn_anytype values)
 
dyn_int _unRecipeFunctions_checkAnalogAlarmThreshold (mapping analogAlarm)
 
bool _unRecipeFunctions_checkRecipeThresholds (dyn_string dsDps, dyn_anytype values, bool bShowErrorLines, dyn_string &exceptionInfo)
 
void _unRecipeFunctions_getRecipeObjectFromDp (string sRecipeDp, dyn_dyn_mixed &recipeObject, dyn_string &exceptionInfo)
 
void _unRecipeFunctions_orderRecipeInstanceElements (dyn_string dsDeviceOrder, dyn_dyn_mixed &recipeObject)
 
void unRecipeFunctions_getRecipeClassObject (string sRcpClassDp, dyn_mixed &recipeClassInfo, dyn_string &exceptionInfo)
 
void _unRecipeFunctions_getS7AddressDBNumber (string sDpe, string sDeviceType, string &sDb, dyn_string &exceptionInfo)
 
void unRecipeFunctions_getPlcStatus (dyn_string recipeElements, bool &bActive, dyn_string &statusMessage, dyn_string &exceptionInfo)
 
mapping unRecipeFunctions_getApplicationPcos (bool bLocalOnly=TRUE, bool bOnlyPcosWithRecipes=FALSE)
 
dyn_string unRecipeFunctions_getApplicationPcoList (mapping mApplicationPcos, string sApplication)
 
void unRecipeFunctions_getPcosWithRecipes (dyn_string &dsPcoNamesWithRecipes, dyn_string &dsPcoDpsWithRecipes, bool bLocalOnly=FALSE, string sApplication="*", dyn_string dsAllPcos=makeDynString(), dyn_string dsAllPcoDps=makeDynString())
 
void _unRecipeFunctions_loadPcosWithRecipes (string sApplication)
 
void _unRecipeFunctions_getFilteredDevices (dyn_string dsSelectedDevType, dyn_string &dsRetDpName, dyn_string &dsRetAlias, dyn_string &dsRetAppl, bool bLocalOnly=FALSE, dyn_string dsSelectedApplication=makeDynString("*"))
 
void _unRecipeFunctions_getFilteredDevicesBySystemName (string sSystemName, dyn_string dsSelectedDevType, dyn_string &dsRetDpName, dyn_string &dsRetAlias, dyn_string &dsRetAppl, dyn_string dsSelectedApplication=makeDynString("*"))
 
void _unRecipeFunctions_getVisibleApplicationsList (dyn_string &dsApplications) synchronized(g_unicosHMI_dsApplicationList)
 
void _unRecipeFunctions_getPcoChildren (string sPcoDpName, dyn_string &children, dyn_string &exceptionInfo)
 
bool unRecipeFunctions_createRecipeFrontEnd (string sAppName, string sPrefix, bool bEvent, string sAnalog, string sBool, string sEvent, dyn_string &exceptionInfo)
 
void unRecipeFunctions_openFaceplate (string sAlias, dyn_string &exceptionInfo)
 
 cpcGenericObject_OpenRecipes (string deviceName)
 

Detailed Description

UNICOS Copyright (C) CERN 2014 All rights reserved

Function Documentation

◆ unRecipeFunctions_writeDifferentOnlineValuesReport()

void unRecipeFunctions_writeDifferentOnlineValuesReport ( dyn_int  diDiffRowIndex,
dyn_string  dsDpNames,
dyn_string  dsAlias,
dyn_anytype  daRcpValues,
dyn_anytype  daOnlineValues 
)

Writes a report on the log window with the different values from the recipe and the PLC online values.

Parameters
diDiffRowIndex- [IN] Indexes of rows where there are different values
dsDpNames- [IN] Datapoint names of the recipe elements
dsAlias- [IN] Alias of the recipe elements
daRcpValues- [IN] Recipe values
daOnlineValues- [IN] PLC online values

◆ _unRecipeFunctions_getRowStylesForValueComparison()

bool _unRecipeFunctions_getRowStylesForValueComparison ( dyn_anytype  daValues1,
dyn_anytype  daValues2,
dyn_int &  diRowStyleIndex,
dyn_int &  diRowStyles,
dyn_int &  diDiffRowIndex 
)

Compares the value lists daValues1 and daValues2 and set:

  • Row indexes (diRowStyleIndex).
  • Row styles (diRowStyles): normal (0) if the values are the same, bold (1) if the values are different.
  • Index of rows with different values (diDiffRowIndex).
    Parameters
    daValues1- [IN] First list of values to compare.
    daValues2- [IN] Second list of values to compare.
    diRowStyleIndex- [OUT] Row index for the styles.
    diRowStyles- [OUT] Styles for the table rows.
    diDiffRowIndex- [OUT] Index of the rows with different values.
    Returns
    FALSE if the length of the lists is different, otherwise TRUE.

◆ unRecipeFunctions_getOnlineValues()

void unRecipeFunctions_getOnlineValues ( dyn_string  dsDpNames,
dyn_anytype &  values,
dyn_string &  exceptionInfo,
time  t = 0 
)

Get the online values of a recipe instance.

Parameters
dsDpNames- [IN] DP Names of the elements which online values are required.
values- [OUT] Online formatted values corresponding to the recipe class DPEs.
exceptionInfo- [OUT] Standard exception handling variable.

◆ _unRecipeFunctions_getTypeMapping()

void _unRecipeFunctions_getTypeMapping ( string  sRecipeType,
mapping &  map,
dyn_string &  exceptionInfo 
)

Get the DPEs associated to each device type in a recipe type.

Parameters
sRecipeType- [IN] Recipe type name.
map- [OUT] Mapping variable where Key=Device type name, Value=List containing the DPEs included in the recipe type for the specified key (device type).
exceptionInfo- [OUT] Standard exception handling variable.

◆ _unRecipeFunctions_lockDevices()

synchronized bool _unRecipeFunctions_lockDevices ( dyn_string  dsDpNames,
dyn_string &  dsLockedDeviceDp,
dyn_string &  dsLockedDeviceAlias,
dyn_string &  exceptionInfo,
bool  isPeriodicSave = false 
)

Try to lock the devices specified.

Parameters
dsDpNames- [IN] DP names of the devices to lock.
dsLockedDeviceDp- [OUT] DP names of the devices that are already locked.
dsLockedDeviceAlias- [OUT] Alias of the devices that are already locked.
exceptionInfo- [OUT] Standard exception handling variable.
isPeriodicSave- [IN] Determines whether the function is running in the background or not.
Returns
TRUE if the devices were locked, otherwise FALSE.

◆ _unRecipeFunctions_unlockDevices()

synchronized bool _unRecipeFunctions_unlockDevices ( dyn_string  dsDpNames,
dyn_string &  exceptionInfo,
bool  isPeriodicSave = false 
)

Try to unlock the devices specified.

Parameters
dsDpNames- [IN] DP names of the devices to unlock.
exceptionInfo- [OUT] Standard exception handling variable.
isPeriodicSave- [IN] Determines whether the function is running in the background or not.
Returns
TRUE if the devices were unlocked, otherwise FALSE.

◆ unRecipeFunctions_formatValues()

void unRecipeFunctions_formatValues ( dyn_string  dsDpNames,
dyn_string  values,
dyn_anytype &  formattedValues,
dyn_string &  exceptionInfo 
)

Gets the formatted values of a set of DPEs.

Parameters
dsDpNames- [IN] List of dp names in the UNICOS format.
values- [IN] List of values for the specified dpNames.
formattedValues- [OUT] Formatted values.
exceptionInfo- [OUT] Standard exception handling variable.

◆ _unRecipeFunctions_checkRecipeValues()

bool _unRecipeFunctions_checkRecipeValues ( dyn_string  dsDps,
dyn_anytype  values,
bool  bShowErrorLines,
dyn_string &  exceptionInfo 
)

Internal function to check if the recipe values are valid according to the defined ranges.

Parameters
dsDps- [IN] Datapoint elements of the recipe values.
values- [IN] Recipe values.
bShowErrorLines- [IN] TRUE if the values out of range must be highlighted in the table.
exceptionInfo- [OUT] Standard exception handling variable.
Returns
TRUE if the recipe values are Ok according to the ranges, otherwise FALSE.

◆ unRecipeFunctions_checkRecipeValue()

int unRecipeFunctions_checkRecipeValue ( string  sDpName,
anytype  value,
dyn_string &  exceptionInfo 
)

Check if the recipe value is valid according to the defined range.

Parameters
sDpName- [IN] Data point name of the recipe element.
value- [IN] Value of the recipe element.
exceptionInfo- [OUT] Standard exception handling routine.
Returns
0 if the value is in the defined range or if no range is defined, otherwise -1.

◆ _unRecipeFunctions_extractAnalogAlarms()

mapping _unRecipeFunctions_extractAnalogAlarms ( dyn_string  dsDps,
dyn_anytype  values 
)

Extract from the list all analog alarms and save it to a dictionary with keys: name: Contain the root name of the DPE (without properties) | -> property: Property of the alarm, HH, H, L, LL | -> value: Value of the alarm thresold | -> position: Position of the value in the array structure dsDps/values

Parameters
dsDps- [IN] Datapoint elements of the recipe values.
values- [IN] Recipe values.
bShowErrorLines- [IN] TRUE if the values out of range must be highlighted in the table.
Returns
mapping containing the result

◆ _unRecipeFunctions_checkAnalogAlarmThreshold()

dyn_int _unRecipeFunctions_checkAnalogAlarmThreshold ( mapping  analogAlarm)

Returns a list of positions with thresholds invalid with the rule HH >= H >= L >= LL The structure of the input map is: property: Property of the alarm, HH, H, L, LL | -> value: Value of the alarm thresold | -> position: Position of the value in the array structure dsDps/values The structure should be a subset of the mapping of _unRecipeFunctions_extractAnalogAlarms

Parameters
analogAlarm- [IN] Mapping containing one analog alarm
Returns
List of int containing the position of invalid thresolds

◆ _unRecipeFunctions_checkRecipeThresholds()

bool _unRecipeFunctions_checkRecipeThresholds ( dyn_string  dsDps,
dyn_anytype  values,
bool  bShowErrorLines,
dyn_string &  exceptionInfo 
)

Check if the recipe thresholds are valid according to HH >= H >= L >= LL

Parameters
dsDps- [IN] Datapoint elements of the recipe values.
values- [IN] Recipe values.
bShowErrorLines- [IN] TRUE if the values out of range must be highlighted in the table.
exceptionInfo- [OUT] Standard exception handling variable.
Returns
TRUE if the recipe values are Ok according to the ranges, otherwise FALSE.

◆ _unRecipeFunctions_getRecipeObjectFromDp()

void _unRecipeFunctions_getRecipeObjectFromDp ( string  sRecipeDp,
dyn_dyn_mixed &  recipeObject,
dyn_string &  exceptionInfo 
)

Get the recipe instance object.

Parameters
sRecipeDp- [IN] Datapoint name of the recipe instance.
recipeObject- [OUT] Recipe instance object from fwConfigDB.
exceptionInfo- [OUT] Standard exception handling variable.

◆ unRecipeFunctions_getRecipeClassObject()

void unRecipeFunctions_getRecipeClassObject ( string  sRcpClassDp,
dyn_mixed &  recipeClassInfo,
dyn_string &  exceptionInfo 
)

Get the recipe class object from the JCOP library.

Parameters
sRcpClassDp- [IN] Recipe class name.
recipeClassInfo- [OUT] Recipe class object returned from the JCOP library.
exceptionInfo- [OUT] Standard exception handling variable.

◆ _unRecipeFunctions_getS7AddressDBNumber()

void _unRecipeFunctions_getS7AddressDBNumber ( string  sDpe,
string  sDeviceType,
string &  sDb,
dyn_string &  exceptionInfo 
)

Gets the DB number of a S7 address for a DPE.

Parameters
sDpe- [IN] DPE which DB number is required.
sDeviceType- [IN] Device type name of the dpe.
sDb- [OUT] DB number of the DPE S7 address.
exceptionInfo- [OUT] Standard exception handling variable.

◆ unRecipeFunctions_getPlcStatus()

void unRecipeFunctions_getPlcStatus ( dyn_string  recipeElements,
bool &  bActive,
dyn_string &  statusMessage,
dyn_string &  exceptionInfo 
)

Gets the PLC status of a recipe.

Parameters
recipeElements- [IN] List of DPEs.
bActive- [OUT] True if the PLCs are active, otherwise false.
statusMessage- [OUT] PLC status message.
exceptionInfo- [OUT] Standard exception handling variable.

◆ unRecipeFunctions_getApplicationPcos()

mapping unRecipeFunctions_getApplicationPcos ( bool  bLocalOnly = TRUE,
bool  bOnlyPcosWithRecipes = FALSE 
)

Gets a mapping where the key is the application name and the value is a dyn_string containing the PCOs in that application.

Parameters
bLocalOnly- [IN] TRUE if and only if the local applications must be included, otherwise FALSE.
bOnlyPcosWithRecipes- [IN] TRUE if and only if the PCOs with recipes must be included, otherwise FALSE.
Returns
map where key=application name, value = List of PCOs for the application

◆ unRecipeFunctions_getApplicationPcoList()

dyn_string unRecipeFunctions_getApplicationPcoList ( mapping  mApplicationPcos,
string  sApplication 
)

Gets the list of PCOs for the specified application.

Parameters
mApplicationPcos- [IN] Mapping where the key is the application name and the value is the list of PCOs for the application
sApplication- [IN] Application name or '*' to get the PCOs of all the applications
Returns
dyn_string containing the list of PCOs for the selected application

◆ unRecipeFunctions_getPcosWithRecipes()

void unRecipeFunctions_getPcosWithRecipes ( dyn_string &  dsPcoNamesWithRecipes,
dyn_string &  dsPcoDpsWithRecipes,
bool  bLocalOnly = FALSE,
string  sApplication = "*",
dyn_string  dsAllPcos = makeDynString(),
dyn_string  dsAllPcoDps = makeDynString() 
)

Get the list of PCOs with recipes

Parameters
dsPcoNamesWithRecipes- [OUT] Alias of the PCOs with recipes found.
dsPcoDpsWithRecipes- [OUT] Dp names of the PCOs with recipes found.
bLocalOnly- [IN] TRUE if and only if the PCOs on the local application must be queried, otherwise FALSE.
sApplication- [IN] Applications where to look for the PCOs with recipes.
dsAllPcos- [IN] List of PCO aliases, if not provided it will search for the PCOs in the specified applications and systems.
dsAllPcoDps- [IN] List of PCO dp names, if not provided it will search for the PCO dpnames in the specified applications and systems.

◆ _unRecipeFunctions_loadPcosWithRecipes()

void _unRecipeFunctions_loadPcosWithRecipes ( string  sApplication)

Load the PCO List in the PcoList combo box.

Parameters
sApplication- [IN] Application name where to load the PCOs from.

◆ _unRecipeFunctions_getFilteredDevices()

void _unRecipeFunctions_getFilteredDevices ( dyn_string  dsSelectedDevType,
dyn_string &  dsRetDpName,
dyn_string &  dsRetAlias,
dyn_string &  dsRetAppl,
bool  bLocalOnly = FALSE,
dyn_string  dsSelectedApplication = makeDynString("*") 
)

Get the list of devices filtering the applications and the device types specified.

Parameters
dsSelectedDevType- [IN] List of selected device types.
dsRetDpName- [OUT] List of DP Names found.
dsRetAlias- [OUT] List of devices aliases found.
dsRetAppl- [OUT] List of applications of the found devices.
bLocalOnly- [IN] TRUE if only the devices from the local system must be returned, otherwise FALSE.
dsSelectedApplication- [IN] List of applications where to look for the devices.

◆ _unRecipeFunctions_getVisibleApplicationsList()

void _unRecipeFunctions_getVisibleApplicationsList ( dyn_string &  dsApplications)

Get the list of visible applications.

Parameters
dsApplications- [OUT] List of visible applications.

◆ _unRecipeFunctions_getPcoChildren()

void _unRecipeFunctions_getPcoChildren ( string  sPcoDpName,
dyn_string &  children,
dyn_string &  exceptionInfo 
)

Get all the PCOs that are children of the sPco device (recursive method, get all the PCOs in the hierarchy).

Parameters
sPcoDpName- [IN] Name of the PCO which children are requested.
children- [OUT] Contains the alias of all the PCO children of the sPcoDp device.
exceptionInfo- [OUT] Standard exception handling variable.

◆ unRecipeFunctions_createRecipeFrontEnd()

bool unRecipeFunctions_createRecipeFrontEnd ( string  sAppName,
string  sPrefix,
bool  bEvent,
string  sAnalog,
string  sBool,
string  sEvent,
dyn_string &  exceptionInfo 
)

Create the SOFT_FE for the recipes.

Parameters
sAppName- [IN] Application name.
sPrefix- [IN] Application prefix.
bEvent- [IN] TRUE=16 bit event type, FALSE=32 bit event type
sAnalog- [IN] Name of the analog archive file.
sBool- [IN] Name of the boolean archive file.
sEvent- [IN] Name of the event archive file.
exceptionInfo- [OUT] Standard exception handling variable.
Returns
TRUE if and only if the recipe front-end was created successfully.

◆ unRecipeFunctions_openFaceplate()

void unRecipeFunctions_openFaceplate ( string  sAlias,
dyn_string &  exceptionInfo 
)

Open the faceplate of a device provided the device alias.

Parameters
sAlias- [IN] Device alias
exceptionInfo- [OUT] Standard exception handling variable.

◆ cpcGenericObject_OpenRecipes()

cpcGenericObject_OpenRecipes ( string  deviceName)

Open recipe window

Constraints
None
Usage
Public
PVSS managers
UI
Parameters
deviceNamedevice name