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)
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)
synchronized bool _unRecipeFunctions_unlockDevices (dyn_string dsDpNames, dyn_string &exceptionInfo)
public void unRecipeFunctions_formatValues (dyn_string dsDpNames, dyn_string values, dyn_anytype &formattedValues, dyn_string &exceptionInfo)
public bool _unRecipeFunctions_checkRecipeValues (dyn_string dsDps, dyn_anytype values, bool bShowErrorLines, dyn_string &exceptionInfo)
int unRecipeFunctions_checkRecipeValue (string sDpName, anytype value, dyn_string &exceptionInfo)
void _unRecipeFunctions_getRecipeObjectFromDp (string sRecipeDp, dyn_dyn_mixed &recipeObject, dyn_string &exceptionInfo)
private 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)
public mapping unRecipeFunctions_getApplicationPcos (bool bLocalOnly=TRUE, bool bOnlyPcosWithRecipes=FALSE)
public dyn_string unRecipeFunctions_getApplicationPcoList (mapping mApplicationPcos, string sApplication)
public void unRecipeFunctions_getPcosWithRecipes (dyn_string &dsPcoNamesWithRecipes, dyn_string &dsPcoDpsWithRecipes, bool bLocalOnly=FALSE, string sApplication="*", dyn_string dsAllPcos=makeDynString(), dyn_string dsAllPcoDps=makeDynString())
public void _unRecipeFunctions_loadPcosWithRecipes (string sApplication)
public void _unRecipeFunctions_getFilteredDevices (dyn_string dsSelectedDevType, dyn_string &dsRetDpName, dyn_string &dsRetAlias, dyn_string &dsRetAppl, bool bLocalOnly=FALSE, dyn_string dsSelectedApplication=makeDynString("*"))
public 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)

Detailed Description

UNICOS Copyright (C) CERN 2014 All rights reserved


Function Documentation

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

References unRecipeFunctions_writeInRecipeLog().

Referenced by unRecipeFunctions_compareOnlineValues(), and unRecipeFunctions_editRecipeValuesAndShowDifferences().

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.

Referenced by unRecipeFunctions_compareOnlineValues(), and unRecipeFunctions_editRecipeValuesAndShowDifferences().

void unRecipeFunctions_getOnlineValues ( dyn_string  dsDpNames,
dyn_anytype &  values,
dyn_string &  exceptionInfo 
)

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.

References unRecipeFunctions_formatValues(), and unRecipeFunctions_getOnlineValueDpes().

Referenced by _unRecipeFunctions_setOnlineValuesForNewDpes(), unRecipeFunctions_adoptOnlineValues(), unRecipeFunctions_compareOnlineValues(), and unRecipeFunctions_displayOnlineValues().

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.

Referenced by unRecipeFunctions_addRecipeClassDevices().

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

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.
Returns:
TRUE if the devices were locked, otherwise FALSE.

References _unRecipeFunctions_unlockDevices(), unRecipeFunctions_handleDpGetSetError(), and unRecipeFunctions_writeInRecipeLog().

Referenced by _unRecipeFunctions_canActivateRecipeInPlcs(), _unRecipeFunctions_saveRecipeClassToDb(), and _unRecipeFunctions_saveRecipeInstanceToDb().

synchronized bool _unRecipeFunctions_unlockDevices ( dyn_string  dsDpNames,
dyn_string &  exceptionInfo 
)

Try to unlock the devices specified.

Parameters:
dsDpNames - [IN] DP names of the devices to unlock.
exceptionInfo - [OUT] Standard exception handling variable.
Returns:
TRUE if the devices were unlocked, otherwise FALSE.

References unRecipeFunctions_handleDpGetSetError(), and unRecipeFunctions_writeInRecipeLog().

Referenced by _unRecipeFunctions_finalizeSaveRecipeToDb(), _unRecipeFunctions_lockDevices(), and unRecipeFunctions_unlockRecipeBuffers().

public 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.

References unRecipeFunctions_getInstanceRange(), unRecipeFunctions_getOnlineValueDpes(), and unRecipeFunctions_getRangeElementFromPVSSDPE().

Referenced by _unRecipeFunctions_cellEditionFinished(), _unRecipeFunctions_highlightEditedValue(), _unRecipeFunctions_saveRecipeValues(), SOFT_FE_UnRcpInstance_setConfig(), unRecipeDbFunctions_getRecipeInstanceDbValues(), unRecipeFunctions_activateRecipe(), unRecipeFunctions_getOnlineValues(), and unRecipeFunctions_loadRecipeInstanceData().

public 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.

References unRecipeFunctions_checkRecipeValue().

Referenced by unRecipeFunctions_activateRecipe(), unRecipeFunctions_checkRecipeValues(), unRecipeFunctions_displayDbValues(), unRecipeFunctions_displayOnlineValues(), unRecipeFunctions_editRecipeInstance(), unRecipeFunctions_loadRecipeInstanceData(), and unRecipeFunctions_loadSingleRecipeFromDb().

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.

References unRecipeFunctions_getDeviceRange(), and unRecipeFunctions_getRangeValues().

Referenced by _unRecipeFunctions_cellEditionFinished(), and _unRecipeFunctions_checkRecipeValues().

void _unRecipeFunctions_getRecipeObjectFromDp ( string  sRecipeDp,
dyn_dyn_mixed &  recipeObject,
dyn_string &  exceptionInfo 
)
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.

References unRecipeFunctions_normalizeDp().

Referenced by _unRecipeFunctions_createRecipeInstance(), _unRecipeFunctions_getExistingClassOrCreateNewClassFromDb(), _unRecipeFunctions_isRecipeClassDefinitionValid(), _unRecipeFunctions_loadPropertiesTableInfo(), SOFT_FE_UnRcpClass_ExportConfig(), SOFT_FE_UnRcpInstance_setConfig(), unRecipeFunctions_applyRecipeClassModifications(), unRecipeFunctions_checkRecipeStatus(), and unRecipeFunctions_loadRecipeClassData().

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.

Referenced by _unRecipeFunctions_createRecipeHeaderDBNumber().

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.

Referenced by unRecipeFunctions_activateRecipe(), unRecipeFunctions_checkRecipeStatus(), and unRecipeFunctions_getRecipeStatus().

public 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

References _unRecipeFunctions_getFilteredDevices(), unRecipeFunctions_getPcosWithRecipes(), and unRecipeFunctions_mappingInsertValue().

public 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
public 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.

References _unRecipeFunctions_getFilteredDevices().

Referenced by _unRecipeFunctions_loadPcosWithRecipes(), and unRecipeFunctions_getApplicationPcos().

public 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.

References unRecipeFunctions_getPcosWithRecipes().

Referenced by unRecipeFunctions_selectPcoRecipes().

public 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.

Referenced by _unRecipeFunctions_getRecipeInstancesOfClass(), unRecipeFunctions_addRecipeClassDevices(), unRecipeFunctions_getApplicationPcos(), unRecipeFunctions_getPcoList(), unRecipeFunctions_getPcosWithRecipes(), and unRecipeFunctions_getRecipeClasses().

void _unRecipeFunctions_getVisibleApplicationsList ( dyn_string &  dsApplications  ) 

Get the list of visible applications.

Parameters:
dsApplications - [OUT] List of visible applications.
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.

References cpcGenericObject_getLinkedObjects(), and unRecipeFunctions_normalizeDp().

Referenced by unRecipeFunctions_getInitialRecipesFromPcoHierarchy(), and unRecipeFunctions_getLastActivatedRecipesFromPcoHierarchy().

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.

Referenced by _unRecipeFunctions_createPredefinedRecipeInstance(), and _unRecipeFunctions_createRecipeClass().

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.

Generated on 11 Mar 2019 for unCPC6 by  doxygen 1.6.1