unCPC6  6.6.8
WinCC-OA implementation of UNICOS CPC
 All Files Functions Variables Pages
cpcGenericObject.ctl File Reference

This library contains generic functions for CPC objects. More...

Functions

void cpcGenericObject_StringToMapping (string data, mapping &pairs)
 
void cpcGenericObject_SendBinaryOrder (string sDpName, string regName, int iManRegBit, string sKey, dyn_string &exceptionInfo)
 
void cpcGenericObject_SendManRegPulse (string sDpName, string regName, unsigned bitPosition, dyn_string &exceptionInfo, bool &alreadySent)
 
bool cpcGenericObject_SystemInvalid (bool bSystemIntegrityAlarmEnabled, int iSystemIntegrityAlarmValue)
 
void cpcGenericObject_WidgetValidnessAnimation (bool bSystemIntegrityAlarmEnabled, int iSystemIntegrityAlarmValue, bool dataInvalid, string &letter, string &color)
 
void cpcGenericObject_WidgetStsRegBitAnimation (bit32 bit32StsReg01, bool bStsReg01Invalid, bit32 bit32StsReg02, bool bStsReg02Invalid, dyn_int bits, dyn_int location, dyn_string letters, dyn_string colors, string &letter, string &color)
 
void cpcGenericObject_WidgetAlarmTextAnimationDoubleStsReg (bit32 bit32StsReg01, bit32 bit32StsReg02, dyn_int diBits, dyn_string dsLetters, dyn_int diBits2, dyn_string dsLetters2, string &letter, string &color)
 
void cpcGenericObject_WidgetAnimationDoubleStsReg (string sWidgetType, string sDpType, bool bLocked, string sSelectedManager, bit32 bit32StsReg01, bit32 bit32StsReg02, dyn_int diWarningBits, dyn_int diWarningBits2, dyn_string dsWarningLetters, dyn_string dsWarningLetters2, dyn_int diAlarmBits, dyn_string dsAlarmLetters, dyn_int diAlarmBits2, dyn_string dsAlarmLetters2, int iStartIStState, int iTStopIStState, int iFuStopIStState, int iAlSt, dyn_string diControlBitNames, string onBitConstant, string offBitConstant, int iAlUnackBitPosition, bool bInvalidLetter, bool bInvalidBody, int iSystemIntegrityAlarmValue, bool bSystemIntegrityAlarmEnabled)
 
void cpcGenericObject_WidgetAnimation (string sWidgetType, string sDpType, bool bLocked, string sSelectedManager, bit32 bit32StsReg01, dyn_int diWarningBits, dyn_string dsWarningLetters, dyn_int diAlarmBits, dyn_string dsAlarmLetters, dyn_string diControlBitNames, string onBitConstant, string offBitConstant, int iAlUnackBitPosition, bool bInvalidLetter, bool bInvalidBody, int iSystemIntegrityAlarmValue, bool bSystemIntegrityAlarmEnabled)
 
string cpcGenericObject_FormatValueWithUnit (float value, string format, string unit)
 
void cpcGenericObject_WidgetDisplayValueAnimation (string sShape, string sUnit, string sFormat, float fValue, string sColor, bool bInvalid)
 
void cpcGenericObject_HandleUnicosMenu (string deviceName, string sDpType, dyn_string menuList, int menuAnswer, dyn_string &exceptionInfo)
 
void cpcGenericObject_SendAllowToRestart (string deviceName, dyn_string &exceptionInfo)
 
void cpcGenericObject_addUnicosActionToMenu (string deviceName, string sDpType, dyn_string dsMenuConfig, dyn_string dsAccessOk, dyn_string &menuList)
 
void cpcGenericObject_addDefaultUnicosActionToMenu (string deviceName, string sDpType, dyn_string dsMenuConfig, dyn_string dsAccessOk, dyn_string &menuList)
 
void cpcGenericObject_notifyUsers (string deviceName, string sKey, dyn_string exceptionInfo)
 
void cpcGenericObject_UserCBGetButtonState (string deviceName, string sType, dyn_string &dsReturnData)
 
dyn_string cpcGenericObject_getCtrlLink (string sSystemName, dyn_string dsDeviceName)
 
void cpcGenericObject_animateTranslatedValue (string sShape, mapping dict, string unit, string format, anytype value, string color, bool invalid)
 
void cpcGenericObject_DisplayText (string value, string sShape, string sForeCol, bool bInvalid)
 
void cpcGenericObject_ColorBoxAnimate (string sShape, int iCommandbit, int iEnableBit, string sOneBackCol, bool bInvalid, string sZeroBackCol="unFaceplate_Unactive")
 
void cpcGenericObject_CheckboxAnimate (string sShape, bool state, bool enabled=true)
 
 cpcGenericObject_ButtonDisconnect (dyn_string dsShapes)
 
void cpcGenericObject_WidgetControlStateAnimation (bit32 bit32StsReg01, bit32 bit32StsReg02, dyn_string d_sBits, string &letter, string &color)
 
int cpcGenericObject_StsRegConstantNameToValue (string name, bit32 bit32StsReg01, bit32 bit32StsReg02)
 
void cpcGenericObject_SendBigPulse (string sDpName, string sDpe, bit32 value, dyn_string &exceptionInfo)
 
string cpcGenericObject_translateAlarmAcronym (dyn_string acronyms)
 
dyn_string cpcGenericObject_translateMultiAlarmAcronym (dyn_string dsAcronyms, dyn_string dsObjects)
 
void cpcGenericObject_ColorBoxAnimateWarning (string sShape, int iAlarmState, bool isAlertExists, bool isAlertActive, bool isAlertInvalid)
 
void cpcGenericObject_ColorBoxAnimateAlarm (string sShape, int iAlarmState, bool isAlertExists, bool isAlertActive, bool isAlertInvalid, string activeColor="unFaceplate_AlarmActive", string notAckColor="unFaceplate_AlarmNotAck")
 
dyn_bool cpcGenericObject_GetAnalogAlarmType (string sDpe, int &iAlertType, dyn_string &exceptionInfo)
 
bool cpcGenericObject_isAlarmWithMail (string dpName, int alertType)
 
bool cpcGenericObject_isInMailSMS (string dpName)
 
void cpcGenericObject_WidgetDisconnection (string sWidgetType, string sDpType)
 
string cpcGenericObject_GetAnimationFunction (string sWidgetType)
 
void cpcGenericObject_OpenHierarchy (string deviceName)
 
void cpcGenericObject_OpenAlarmsPanel (string deviceName)
 
 cpcGenericObject_OpenRecipes (string deviceName)
 
dyn_int cpcGenericObject_getMaxWidgetSize (dyn_string objects)
 
string cpcGenericObject_getDeviceWidget (string device)
 
dyn_string cpcGenericObject_getLinkedAlarms (string device, dyn_string &exceptionInfo)
 
dyn_string cpcGenericObject_getLinkedObjects (string device, string childrenType, dyn_string &exceptionInfo)
 
 cpcGenericObject_WidgetWarningAnimationDoubleStsReg (bit32 bit32StsReg01, bit32 bit32StsReg02, dyn_int diBits, dyn_int diBits2, dyn_string dsLetters, dyn_string dsLetters2, string &letter, string &color)
 
void cpcGenericObject_animateNeedRestart (dyn_string dpes, dyn_string values)
 
void cpcGenericObject_animateMaskEvent (dyn_string dpes, dyn_string values)
 
bool valueInsideRange (anytype key, anytype value, string dpe, dyn_string &exceptionInfo)
 
int cpcGenericObject_setDefaultValue (string deviceName, mapping defDpeValues, dyn_string &exceptionInfo)
 

Detailed Description

This library contains generic functions for CPC objects.

Author
Nikolay Kulman (IT-CO-FE)
Francisco Mico (IT-CO-FE)
Alexey Merezhin (EN-ICE-PLC)
Creation Date
08.07.2003
Constraints
None
Usage
Public
PVSS managers
UI, CTRL

Function Documentation

void cpcGenericObject_StringToMapping ( string  data,
mapping &  pairs 
)

Split a string like "key1=value1,key2=value2" into the mapping

Constraints
None
Usage
Public
PVSS managers
UI
Todo:
merge with splitCommaSeparatedString
Parameters
dataInput string with labels information
pairsResult mappint
Returns
If function finishedf successfully

Referenced by CPC_MassFlowController_FaceplateInitStatics(), CPC_WordParameter_FaceplateInitStatics(), CPC_WordParameter_WidgetInitStatics(), CPC_WordStatus_FaceplateInitStatics(), CPC_WordStatus_WidgetInitStatics(), and CPC_WordStatusConfig_setCustomConfig().

void cpcGenericObject_SendBinaryOrder ( string  sDpName,
string  regName,
int  iManRegBit,
string  sKey,
dyn_string &  exceptionInfo 
)

Send a binary order to the PLC. Example : auto mode request etc.

Port of unGenericObject_SendBinaryOrder. Extended to support ManReg02

Constraints
None
Usage
Public
PVSS managers
UI
Parameters
sDpNamedevice name
regNameManReg name (e.g. "ManReg01")
iManRegBitbit position in ManReg
sKeycatalogue key
exceptionInfoThe list of exceptions.

References cpcGenericObject_notifyUsers(), and cpcGenericObject_SendManRegPulse().

Referenced by cpcGenericObject_HandleUnicosMenu().

void cpcGenericObject_SendManRegPulse ( string  sDpName,
string  regName,
unsigned  bitPosition,
dyn_string &  exceptionInfo,
bool &  alreadySent 
)

Send a pulse on a specified bit of ManReg

Port of unGenericObject_SendManRegPulse. Extended to support ManReg02

Constraints
None
Usage
Public
PVSS managers
UI
Parameters
sDpNamedevice name
regNameManReg name (e.g. "ManReg01")
bitPositionbit position in ManReg
exceptionInfoThe list of exceptions.
alreadySentis bit already sent

Referenced by cpcGenericObject_SendBinaryOrder().

bool cpcGenericObject_SystemInvalid ( bool  bSystemIntegrityAlarmEnabled,
int  iSystemIntegrityAlarmValue 
)

Return front-end validness.

c_unSystemIntegrity_no_alarm_value (0) no alarm PLC is running, c_unSystemIntegrity_alarm_value_level1 (10): alarm PLC is not correctly running

Constraints
None
Usage
Public
PVSS managers
UI
Parameters
bSystemIntegrityAlarmEnabled'$FRONT_END_DP$.alarm' value
iSystemIntegrityAlarmValue'$FRONT_END_DP$.enabled' value
Returns
true if system invalid, otherwise false

Referenced by CPC_Controller_WidgetAnimation(), CPC_DigitalParameter_WidgetAnimation(), and cpcGenericObject_WidgetValidnessAnimation().

void cpcGenericObject_WidgetValidnessAnimation ( bool  bSystemIntegrityAlarmEnabled,
int  iSystemIntegrityAlarmValue,
bool  dataInvalid,
string &  letter,
string &  color 
)

Standart animation for the widget' letter

If system is invalid, then letter is "O" with "unDataNotValid" color. If data is invalid, then letter is "N" with "unDataNotValid" color. Function does not assign any other value/color.

Todo:

instead of dataInvalid iterate through ':_online.._invalid' dpes to construct this value

move to cpcWidget

Constraints
None
Usage
Public
PVSS managers
UI

References CPC_WIDGET_TEXT_INVALID, CPC_WIDGET_TEXT_OLD_DATA, and cpcGenericObject_SystemInvalid().

Referenced by CPC_AnalogAlarm_WidgetAnimation(), CPC_AnalogInput_WidgetAnimation(), CPC_AnalogParameter_WidgetAnimation(), CPC_AnalogStatus_WidgetAnimation(), CPC_DigitalAlarm_WidgetAnimation(), CPC_DigitalParameter_WidgetAnimation(), CPC_Local_WidgetAnimation(), CPC_SumAlarm_WidgetAnimation(), CPC_Word2AnalogStatus_WidgetAnimation(), CPC_WordParameter_WidgetAnimation(), CPC_WordStatus_FaceplateStatusAnimationCB(), and CPC_WordStatus_WidgetAnimation().

void cpcGenericObject_WidgetStsRegBitAnimation ( bit32  bit32StsReg01,
bool  bStsReg01Invalid,
bit32  bit32StsReg02,
bool  bStsReg02Invalid,
dyn_int  bits,
dyn_int  location,
dyn_string  letters,
dyn_string  colors,
string &  letter,
string &  color 
)

Function sets color and value associated with last enabled bit in StsReg

Todo:
move to cpcWidget
Constraints
None
Usage
Public
PVSS managers
UI
Parameters
bit32StsReg01StsReg01 value
bStsReg01Invalidis StsReg02 invalid
bit32StsReg02StsReg02 value
bStsReg02Invalidis StsReg02 invalid
bitslist of bits (positions)
locationwhere's bit - 1 for StsReg01, 2 for StsReg02
letterslist of bit's letters (associated by position in the array)
colorslist of bit's colors (associated by position in the array)
letterresult letter
colorresult color

Referenced by CPC_AnalogAlarm_WidgetAnimation().

void cpcGenericObject_WidgetAlarmTextAnimationDoubleStsReg ( bit32  bit32StsReg01,
bit32  bit32StsReg02,
dyn_int  diBits,
dyn_string  dsLetters,
dyn_int  diBits2,
dyn_string  dsLetters2,
string &  letter,
string &  color 
)

Animate the alarm part of the widget

diBits and dsLetters must have the same length. dyn arrays must be defined in priority order: lowest -> highest priority. diBits2 and dsLetters2 must have the same length. dyn arrays must be defined in priority order: lowest -> highest priority.

Todo:
move to cpcWidget
Constraints
None
Usage
Public
PVSS managers
UI
Parameters
bit32StsReg01StsReg01 value
bit32StsReg02StsReg02 value
diBitsbit positions
dsLettersassociated letters to be displayed
diBits2bit positions
dsLetters2associated letters to be displayed
letterthe letter to be displayed
colorthe color to be used

Referenced by cpcGenericObject_WidgetAnimationDoubleStsReg().

void cpcGenericObject_WidgetAnimationDoubleStsReg ( string  sWidgetType,
string  sDpType,
bool  bLocked,
string  sSelectedManager,
bit32  bit32StsReg01,
bit32  bit32StsReg02,
dyn_int  diWarningBits,
dyn_int  diWarningBits2,
dyn_string  dsWarningLetters,
dyn_string  dsWarningLetters2,
dyn_int  diAlarmBits,
dyn_string  dsAlarmLetters,
dyn_int  diAlarmBits2,
dyn_string  dsAlarmLetters2,
int  iStartIStState,
int  iTStopIStState,
int  iFuStopIStState,
int  iAlSt,
dyn_string  diControlBitNames,
string  onBitConstant,
string  offBitConstant,
int  iAlUnackBitPosition,
bool  bInvalidLetter,
bool  bInvalidBody,
int  iSystemIntegrityAlarmValue,
bool  bSystemIntegrityAlarmEnabled 
)

Animate widget

di$...$Bits and ds$...$Letters must have the same length. dyn arrays must be defined in priority order: lowest -> highest priority .

Todo:
move to cpcWidget
Constraints
None
Usage
Internal
PVSS managers
UI
Parameters
sWidgetTypewidget type = dpType + widgetType. ex: AnaDigHeater
sDpTypeobject
bLockedfor select animation
sSelectedManagerfor select animation
bit32StsReg01status register
bit32StsReg02status register (empty in case of not using the stsReg02)
diWarningBitswarning bit positions in status register.
diWarningBits2warning bit positions in status register. (empty in case of not using the stsReg02)
dsWarningLettersassociated warning letters to be displayed.
dsWarningLetters2associated warning letters to be displayed. (empty in case of not using the stsReg02)
diAlarmBitsalarm bit positions in status register (StsReg01).
dsAlarmLettersassociated alarm letters to be displayed (StsReg01).
diAlarmBits2alarm bit positions in status register (StsReg02).
dsAlarmLetters2associated alarm letters to be displayed (StsReg02).
iStartIStStatestart interlock dpe value
iTStopIStStatetemporal stop interlock dpe value
iFuStopIStStatefull stop interlock dpe value
iAlStalarm dpe value
diControlBitNameslist of StsReg constants for controls
onBitConstanton bit constant name
offBitConstantoff bit constant name
iAlUnackBitPositionalarm unack status bit position in status register
bInvalidLettertrue if invalid letter as to be shown
bInvalidBodyinvalid animation on body ?
iSystemIntegrityAlarmValuethe value of the systemIntegrity alarm for the PLC:
bSystemIntegrityAlarmEnabledthe systemIntegrity alarm is enabled

References CPC_StsReg02_NEEDRESTART, CPC_WIDGET_TEXT_ALARM_FUSTOPIST, CPC_WIDGET_TEXT_ALARM_TSTOPIST, CPC_WIDGET_TEXT_CONTROL_FORCED, CPC_WIDGET_TEXT_INVALID, CPC_WIDGET_TEXT_MANUAL_RESTART, CPC_WIDGET_TEXT_OLD_DATA, cpcGenericObject_GetAnimationFunction(), cpcGenericObject_StsRegConstantNameToValue(), cpcGenericObject_WidgetAlarmTextAnimationDoubleStsReg(), and cpcGenericObject_WidgetControlStateAnimation().

Referenced by CPC_AnaDig_WidgetAnimation(), CPC_AnaDO_WidgetAnimation(), CPC_Analog_WidgetAnimation(), CPC_MassFlowController_WidgetAnimation(), CPC_OnOff_WidgetAnimation(), CPC_SteppingMotor_WidgetAnimation(), and cpcGenericObject_WidgetAnimation().

void cpcGenericObject_WidgetAnimation ( string  sWidgetType,
string  sDpType,
bool  bLocked,
string  sSelectedManager,
bit32  bit32StsReg01,
dyn_int  diWarningBits,
dyn_string  dsWarningLetters,
dyn_int  diAlarmBits,
dyn_string  dsAlarmLetters,
dyn_string  diControlBitNames,
string  onBitConstant,
string  offBitConstant,
int  iAlUnackBitPosition,
bool  bInvalidLetter,
bool  bInvalidBody,
int  iSystemIntegrityAlarmValue,
bool  bSystemIntegrityAlarmEnabled 
)

Animate widget

di$...$Bits and ds$...$Letters must have the same length. dyn arrays must be defined in priority order: lowest -> highest priority .

Todo:
move to cpcWidget
Constraints
None
Usage
Internal
PVSS managers
UI
Parameters
sWidgetTypewidget type = dpType + widgetType. ex: AnaDigHeater
sDpTypeobject
bLockedfor select animation
sSelectedManagerfor select animation
bit32StsReg01status register
diWarningBitswarning bit positions in status register.
dsWarningLettersassociated warning letters to be displayed.
diAlarmBitsalarm bit positions in status register.
dsAlarmLettersassociated alarm letters to be displayed.
diControlBitNameslist of StsReg constants for controls
onBitConstanton bit constant name
offBitConstantoff bit constant name
iAlUnackBitPositionalarm unack status bit position in status register
bInvalidLettertrue if invalid letter as to be shown
bInvalidBodyinvalid animation on body ?
iSystemIntegrityAlarmValuethe value of the systemIntegrity alarm for the PLC:
bSystemIntegrityAlarmEnabledthe systemIntegrity alarm is enabled

References cpcGenericObject_WidgetAnimationDoubleStsReg().

Referenced by CPC_Controller_WidgetAnimation().

string cpcGenericObject_FormatValueWithUnit ( float  value,
string  format,
string  unit 
)

Returns formatted value concatenated with unit

Constraints
None
Usage
Internal
PVSS managers
UI
Parameters
valueoriginal value
formatdpe format
unitdpe unit
Returns
formatted value with unit

Referenced by CPC_AnalogStatus_WidgetAnimation(), CPC_Controller_WidgetAnimation(), CPC_Word2AnalogStatus_WidgetAnimation(), and CPC_WordParameter_WidgetAnimation().

void cpcGenericObject_WidgetDisplayValueAnimation ( string  sShape,
string  sUnit,
string  sFormat,
float  fValue,
string  sColor,
bool  bInvalid 
)

Animation of widget display values

Todo:
move to cpcWidget
Constraints
None
Usage
Internal
PVSS managers
UI
Parameters
sShapedisplay values shapes
sUnitdpe unit
sFormatdpe format
fValuedpe value
sColoranimation color
bInvalidis dpe invalid

Referenced by CPC_AnalogAlarm_WidgetAnimation(), CPC_AnalogParameter_WidgetAnimation(), and CPC_MassFlowController_WidgetAnimation().

void cpcGenericObject_HandleUnicosMenu ( string  deviceName,
string  sDpType,
dyn_string  menuList,
int  menuAnswer,
dyn_string &  exceptionInfo 
)
void cpcGenericObject_addUnicosActionToMenu ( string  deviceName,
string  sDpType,
dyn_string  dsMenuConfig,
dyn_string  dsAccessOk,
dyn_string &  menuList 
)

Add the UNICOS action to the UNICOS device

Constraints
None
Usage
Public
PVSS managers
UI
Parameters
deviceNamethe device dp name
sDpTypethe device dp type
dsMenuConfiglist of requested action
dsAccessOklist of authorized action
menuListoutput menu

References CPC_FACEPLATE_BUTTON_ALLOW_RESTART, CPC_POPUPMENU_ACK_NUMBER, CPC_POPUPMENU_ALLOW_TO_RESTART_TEXT, CPC_POPUPMENU_BLOCK_PLC_NUMBER, CPC_POPUPMENU_MANUAL_IO_ERROR_BLOCK, CPC_POPUPMENU_MANUAL_IO_ERROR_NUMBER, CPC_POPUPMENU_MASK_ALST_NUMBER, CPC_POPUPMENU_MASK_ALST_TEXT, CPC_POPUPMENU_MASK_IST_NUMBER, CPC_POPUPMENU_MASK_IST_TEXT, CPC_POPUPMENU_MASK_POSST_NUMBER, CPC_POPUPMENU_MASKEVENT_NUMBER, CPC_POPUPMENU_UNMASKEVENT_NUMBER, CPC_StsReg01_AUIHMBST, CPC_StsReg01_MALBRST, CPC_StsReg01_MIOERBRST, and cpcGenericDpFunctions_getDeviceProperty().

Referenced by CPC_AnaDig_MenuConfiguration(), CPC_AnaDO_MenuConfiguration(), CPC_Analog_MenuConfiguration(), CPC_AnalogAlarm_MenuConfiguration(), CPC_AnalogInput_MenuConfiguration(), CPC_AnalogParameter_MenuConfiguration(), CPC_AnalogStatus_MenuConfiguration(), CPC_Controller_MenuConfiguration(), CPC_DigitalAlarm_MenuConfiguration(), CPC_DigitalInput_MenuConfiguration(), CPC_DigitalParameter_MenuConfiguration(), CPC_Local_MenuConfiguration(), CPC_MassFlowController_MenuConfiguration(), CPC_OnOff_MenuConfiguration(), CPC_ProcessControlObject_MenuConfiguration(), CPC_SteppingMotor_MenuConfiguration(), CPC_SumAlarm_MenuConfiguration(), CPC_WordParameter_MenuConfiguration(), and CPC_WordStatus_MenuConfiguration().

void cpcGenericObject_notifyUsers ( string  deviceName,
string  sKey,
dyn_string  exceptionInfo 
)

Notify users about success or failed operation

Constraints
None
Usage
Public
PVSS managers
UI
Parameters
deviceNamedevice name
sKeymessage key. unCPCOperator.cat msg catalog should contain $KEY$OK and $KEY$FAILED messages
exceptionInfo'OK' message if it's emtpy.

Referenced by cpcGenericObject_HandleUnicosMenu(), and cpcGenericObject_SendBinaryOrder().

void cpcGenericObject_UserCBGetButtonState ( string  deviceName,
string  sType,
dyn_string &  dsReturnData 
)

Function called before the button set state when a user logs in. Common function for all the UNICOS device types.

Constraints
This library works with an unicos button panel and need global variables declared in this panel
  • g_dsUserAccess, dyn_string, button identifier is added to this variable if user access
  • $sDpName, string, the device DP name
  • g_sFaceplateButtonType, string, faceplate type
Usage
Public
PVSS managers
UI
Parameters
deviceNamedevice name
sTypedevice type
dsReturnDatadata
dyn_string cpcGenericObject_getCtrlLink ( string  sSystemName,
dyn_string  dsDeviceName 
)

Get the list of Controller

Constraints
None
Usage
Public
PVSS managers
UI
Parameters
sSystemNamesystem name
dsDeviceNamelist of devices

Referenced by CPC_AnaDig_WidgetInitStatics(), CPC_AnaDO_WidgetInitStatics(), CPC_Analog_WidgetInitStatics(), CPC_MassFlowController_WidgetInitStatics(), and CPC_SteppingMotor_WidgetInitStatics().

void cpcGenericObject_animateTranslatedValue ( string  sShape,
mapping  dict,
string  unit,
string  format,
anytype  value,
string  color,
bool  invalid 
)

Animate value translated

Todo:
move to the unFaceplate
See Also
unFaceplate_animateTranslatedValue
Constraints
None
Usage
Public
PVSS managers
UI
Parameters
sShapegraphical object name
dictdictionary mapping
unitvalue's unit
formatvalue's format
valuevalue to translate/animate
coloranimation color
invalidis dpe invalid
void cpcGenericObject_DisplayText ( string  value,
string  sShape,
string  sForeCol,
bool  bInvalid 
)

Animate text value

Todo:

move to the unFaceplate

unify params order

Constraints
None
Usage
Public
PVSS managers
UI
Parameters
valuevalue to translate/animate
sShapegraphical object name
sForeColanimation color
bInvalidis dpe invalid

Referenced by CPC_AnalogAlarm_FaceplateInitStatics(), CPC_DigitalAlarm_FaceplateInitStatics(), and CPC_ProcessControlObject_animateOptionMode().

void cpcGenericObject_ColorBoxAnimate ( string  sShape,
int  iCommandbit,
int  iEnableBit,
string  sOneBackCol,
bool  bInvalid,
string  sZeroBackCol = "unFaceplate_Unactive" 
)

Animate boolean (bit) value

Todo:
move to the unFaceplate
Constraints
None
Usage
Public
PVSS managers
UI
Parameters
sShapegraphical object name
iCommandbitbit value
iEnableBitis bit enabled
sOneBackColactive color
bInvalidis dpe invalid
sZeroBackColinactive color

Referenced by CPC_AnalogInput_FaceplateStatusAnimationCB(), CPC_AnalogStatus_FaceplateStatusAnimationCB(), CPC_DigitalInput_FaceplateStatusAnimationCB(), CPC_Local_FaceplateStatusAnimationCB(), CPC_MassFlowController_FaceplateStatusAnimationCB(), and cpcGenericObject_animateNeedRestart().

cpcGenericObject_ButtonDisconnect ( dyn_string  dsShapes)

Animate faceplate buttons disconnection

Constraints
None
Usage
Public
PVSS managers
UI
Parameters
dsShapesbuttons (graphical objects) to disconnect
void cpcGenericObject_WidgetControlStateAnimation ( bit32  bit32StsReg01,
bit32  bit32StsReg02,
dyn_string  d_sBits,
string &  letter,
string &  color 
)

Control state animation

Based on constant's name convention, function find an active bit and set according letter (CPC_WIDGET_TEXT_CONTROL_$BIT_NAME$) and color (unWidget_ControlStateManualLocal or unWidget_ControlStateForced if letter == CPC_WIDGET_TEXT_CONTROL_FORCED)

Todo:
move to cpcWidget
Constraints
None
Usage
Public
PVSS managers
UI
Parameters
bit32StsReg01StsReg01 value
bit32StsReg02StsReg02 value
d_sBitslist of bit constants
letterresult letter
colorresult color

References CPC_WIDGET_TEXT_CONTROL_FORCED, cpcConfigGenericFunctions_getConstantByName(), and cpcConfigGenericFunctions_getStringConstantByName().

Referenced by CPC_ProcessControlObject_WidgetAnimation(), and cpcGenericObject_WidgetAnimationDoubleStsReg().

int cpcGenericObject_StsRegConstantNameToValue ( string  name,
bit32  bit32StsReg01,
bit32  bit32StsReg02 
)

Retrieve an online value of a bit

Constraints
None
Usage
Public
PVSS managers
UI
Parameters
namebit name (position constant)
bit32StsReg01StsReg01 value
bit32StsReg02StsReg02 value
Returns
a bit value from StsReg

References cpcConfigGenericFunctions_getConstantByName().

Referenced by cpcGenericObject_WidgetAnimationDoubleStsReg().

void cpcGenericObject_SendBigPulse ( string  sDpName,
string  sDpe,
bit32  value,
dyn_string &  exceptionInfo 
)

Send a pulse with a specified number

Constraints
None
Usage
Public
PVSS managers
UI
Parameters
sDpNameobject name
sDpeDpe name
valuethe pulse value of ManReg
exceptionInfodetails of any exceptions are returned here
string cpcGenericObject_translateAlarmAcronym ( dyn_string  acronyms)

Translate interlock acronyms

Todo:
move to unFaceplate
Constraints
None
Usage
Public
PVSS managers
UI
Parameters
acronymstypes of linked interlocks
Returns
human representation for linked interlocks

References dynJoin().

Referenced by CPC_AnalogAlarm_FaceplateInitStatics(), CPC_DigitalAlarm_FaceplateInitStatics(), and cpcGenericObject_translateMultiAlarmAcronym().

dyn_string cpcGenericObject_translateMultiAlarmAcronym ( dyn_string  dsAcronyms,
dyn_string  dsObjects 
)

Translate interlock acronyms attaching master object

Parameters
dsAcronyms,input,dyn_string,Typesof linked interlocks
dsObjects,input,dyn_string,Masterof each alarm
Returns
dyn_string, List of type of alarm and its master

References cpcGenericObject_translateAlarmAcronym().

Referenced by CPC_AnalogAlarm_FaceplateInitStatics(), and CPC_DigitalAlarm_FaceplateInitStatics().

void cpcGenericObject_ColorBoxAnimateWarning ( string  sShape,
int  iAlarmState,
bool  isAlertExists,
bool  isAlertActive,
bool  isAlertInvalid 
)

Animate warning colorBoxes

Color :

  • if alert hdl does not exist, backcolor = "unAlarmDoesNotExist"
  • else if bInvalid = true, backcolor = "unDataNotValid"
  • else if alarm unack., backcolor = "unFaceplate_AlarmNotAck"
  • else if alarm active and ack., backcolor = "unFaceplate_AlarmActive"
  • else backcolor = "unFaceplate_Unactive"
Todo:
move to unFaceplate
Constraints
None
Usage
Public
PVSS managers
UI
Parameters
sShapecolorbox shape name
iAlarmStateact state alarm
isAlertExistsis alert exist
isAlertActiveis alert active
isAlertInvalidis alert invalid

References cpcGenericObject_ColorBoxAnimateAlarm().

Referenced by CPC_AnalogInput_FaceplateStatusAnimationCB(), and CPC_AnalogStatus_FaceplateStatusAnimationCB().

void cpcGenericObject_ColorBoxAnimateAlarm ( string  sShape,
int  iAlarmState,
bool  isAlertExists,
bool  isAlertActive,
bool  isAlertInvalid,
string  activeColor = "unFaceplate_AlarmActive",
string  notAckColor = "unFaceplate_AlarmNotAck" 
)

Animate alarm colorBoxes

Color :

  • if alert hdl does not exist, backcolor = "unAlarmDoesNotExist"
  • else if bInvalid = true, backcolor = "unDataNotValid"
  • else if alarm unack., backcolor = "unFaceplate_AlarmNotAck"
  • else if alarm active and ack., backcolor = "unFaceplate_AlarmActive"
  • else backcolor = "unFaceplate_Unactive"
Todo:
move to unFaceplate
Constraints
None
Usage
Public
PVSS managers
UI
Parameters
sShapecolorbox shape name
iAlarmStateact state alarm
isAlertExistsis alert exist
isAlertActiveis alert active
isAlertInvalidis alert invalid
activeColoractive color, default is "unFaceplate_AlarmActive"
notAckColornot acknowledge color, default is "unFaceplate_AlarmNotAck"

Referenced by CPC_AnalogInput_FaceplateStatusAnimationCB(), CPC_AnalogStatus_FaceplateStatusAnimationCB(), CPC_DigitalInput_FaceplateStatusAnimationCB(), CPC_Local_FaceplateStatusAnimationCB(), and cpcGenericObject_ColorBoxAnimateWarning().

dyn_bool cpcGenericObject_GetAnalogAlarmType ( string  sDpe,
int &  iAlertType,
dyn_string &  exceptionInfo 
)

Retrieve 5 ranges alarm type

Return in iAlertType:

  1. DPCONFIG_ALERT_NONBINARYSIGNAL if Unicos 5 ranges alert_hdl is correct (and if sDpe is analogic)
  2. DPCONFIG_ALERT_BINARYSIGNAL for boolean sDpe
  3. DPCONFIG_NONE if no alert_hdl is defined or if alert_hdl is a bad analogic alarm
Constraints
None
Usage
Public
PVSS managers
UI
Parameters
sDpedpe
iAlertTypealert type
exceptionInfofor errors

Referenced by CPC_AnalogInput_FaceplateInitStatics(), CPC_AnalogInput_WidgetInitStatics(), CPC_AnalogStatus_FaceplateInitStatics(), and CPC_AnalogStatus_WidgetInitStatics().

bool cpcGenericObject_isAlarmWithMail ( string  dpName,
int  alertType 
)

Return is alarm configured with Mail/SMS

Constraints
None
Usage
Public
PVSS managers
UI
Parameters
dpNamedpe
alertTypealert type
Reviewed:
2018-08-01 FalsePositive
bool cpcGenericObject_isInMailSMS ( string  dpName)
void cpcGenericObject_WidgetDisconnection ( string  sWidgetType,
string  sDpType 
)
string cpcGenericObject_GetAnimationFunction ( string  sWidgetType)

Return widget animation function for a given widget type

Constraints
None
Usage
Public
PVSS managers
UI

Referenced by CPC_Local_WidgetAnimation(), CPC_ProcessControlObject_WidgetAnimation(), and cpcGenericObject_WidgetAnimationDoubleStsReg().

void cpcGenericObject_OpenHierarchy ( string  deviceName)

Open hierarchy window for a device

Constraints
None
Usage
Public
PVSS managers
UI
Parameters
deviceNamedevice name

Referenced by cpcGenericObject_HandleUnicosMenu().

void cpcGenericObject_OpenAlarmsPanel ( string  deviceName)

Open alarm window for a device

Constraints
None
Usage
Public
PVSS managers
UI
Parameters
deviceNamedevice name

Referenced by cpcGenericObject_HandleUnicosMenu().

cpcGenericObject_OpenRecipes ( string  deviceName)

Open recipe window

Constraints
None
Usage
Public
PVSS managers
UI
Parameters
deviceNamedevice name

Referenced by cpcGenericObject_HandleUnicosMenu().

dyn_int cpcGenericObject_getMaxWidgetSize ( dyn_string  objects)

Returns max width and max height withing objects widgets

Constraints
None
Usage
Public
PVSS managers
UI
Parameters
objectslist of objects

References cpcGenericObject_getDeviceWidget().

string cpcGenericObject_getDeviceWidget ( string  device)

Returns a widget associated with device.

Constraints
None
Usage
Public
PVSS managers
UI
Parameters
devicedevice name

Referenced by cpcGenericObject_getMaxWidgetSize().

dyn_string cpcGenericObject_getLinkedAlarms ( string  device,
dyn_string &  exceptionInfo 
)

Return a list of alarms linked to object

Constraints
None
Usage
Public
PVSS managers
UI
Parameters
devicedevice name
exceptionInfofor errors

References CPC_CONFIG_CHILDREN_KEY.

Referenced by cpcGenericObject_addDefaultUnicosActionToMenu().

dyn_string cpcGenericObject_getLinkedObjects ( string  device,
string  childrenType,
dyn_string &  exceptionInfo 
)

Returns device's childrens filtered by type

Constraints
None
Usage
Public
PVSS managers
UI
Parameters
devicedevice name
childrenTypedp type to fileter children with
exceptionInfofor errors

References CPC_CONFIG_CHILDREN_KEY.

void cpcGenericObject_animateNeedRestart ( dyn_string  dpes,
dyn_string  values 
)

Animate 'allow restart needed' bit.

Faceplate should contain unFaceplate_Colorbox.pnl graphical object named "NEEDRESTART".

Constraints
None
Usage
Public
PVSS managers
UI
Parameters
dpesconnected dpe names
valuesconnected dpe values

References cpcGenericObject_ColorBoxAnimate().

Referenced by CPC_AnaDig_FaceplateStatusAnimationCB(), CPC_AnaDO_FaceplateStatusAnimationCB(), CPC_Analog_FaceplateStatusAnimationCB(), CPC_OnOff_FaceplateStatusAnimationCB(), CPC_ProcessControlObject_FaceplateStatusAnimationCB(), and CPC_SteppingMotor_FaceplateStatusAnimationCB().

bool valueInsideRange ( anytype  key,
anytype  value,
string  dpe,
dyn_string &  exceptionInfo 
)
Check if given value is in the range of specified dpe

Note: only Min-Max range is supported; if there is no config or config of another nature, value is accepted as in range

Constraints
None
Usage
Public
Parameters
keyname of the value; for logging purpose
valuevalue to be checked
dpeData Point Element holding the pvRange configuration
exceptionInfofor exception handling

Referenced by cpcGenericObject_setDefaultValue().

int cpcGenericObject_setDefaultValue ( string  deviceName,
mapping  defDpeValues,
dyn_string &  exceptionInfo 
)
For given device set its default values specified in defDpeValues mapping (DefDPEname:value)

Function checks if all Def DPEs exist for specified deviceName (e.g. deviceName.ProcessOutput.DefDPEName) and if provided values are in correct ranges (if applicable) If any of the DefDpes does not exist or any value is outside valid range, no changes will be applied to the system

Constraints
None
Usage
Public
Parameters
deviceNamename of the device
defDpeValuesMapping between Def DPE names and values to be set on them
exceptionInfofor exception handling
Returns
0 if everything went successfully; -1 if any of DefDPEs does not exist or any value is invalid; n if n dpSets failed

References valueInsideRange().