fwGeneral  8.4.1
fwColour.ctl File Reference

Functions

void fwColour_connectItemBackColToStatus (string dpe, dyn_string &exceptionInfo)
 
void fwColour_connectShapeBackColToStatus (string dpe, string shapeName, dyn_string &exceptionInfo)
 
void _fwCalculateColourWithAlertCB (mapping userData, string dpe1, string alertColour, string dpe2, bool alarmActive, string dpe3, bool dataInvalid)
 
void _fwCalculateColourWithSummaryAlertCB (mapping userData, string dpe1, string alertColour, string dpe2, bool alarmActive)
 
void _fwCalculateColourWithoutAlertCB (mapping userData, string dpe1, bool dataInvalid)
 
void fwColour_convertStatusToColour (string &elementColour, string alertColour, bool masked, bool invalid, dyn_string &exceptionInfo)
 
string fwColour_getColourForDpe (string dpe)
 

Detailed Description

This library is used to convert the given states of a device into the colour which represents this state. Funcitons are also available for dpConnecting the colour of graphical elements to a device state.

Creation Date
23/01/01
Modification History
02/05/01 Oliver Holme - Added support for connecting to summary alerts Created new function _fwCalculateColourWithSummaryAlertCB()

11/09/14 Lorenzo Masetti - 13 years later... - added possibility to specify shapeName (fwColour_connectShapeBackColToStatus). Implemented with dpConnnectUserData. New function fwColour_getColourForDpe to get the colour without connecting

Constraints
Author
Oliver Holme (IT-CO)

Function Documentation

void fwColour_connectItemBackColToStatus ( string  dpe,
dyn_string &  exceptionInfo 
)

This function controls the background colour of the item from within which the function was called. The colour is controlled by dpConnecting to the invalid bit of the given data point element, and if it exists, the alert active bit and the alert colour are also connected to. When the function is called, and any time when the alert state or invalid state changes, a function is called which evaluates the current state, selects the relevant colour and sets the background colour of the graphical item.

Modification History
02/05/01 Oliver Holme - Added support for connecting to summary alerts If a summary alert exists, the _fwCalculateColourWithSummaryAlertCB is connected to. If no alert exists on a dpe of type structure, the OK colour is shown.
Constraints
This function can only be called from within a graphical interface
Usage
Public
PVSS managers
VISION
Parameters
dpedata point element
exceptionInfodetails of any exceptions are placed in here.
void fwColour_connectShapeBackColToStatus ( string  dpe,
string  shapeName,
dyn_string &  exceptionInfo 
)

This function controls the background colour of the specified shape. See fwColour_connectItemBackColToStatus for details

Parameters
dpedata point element
shapeNamename of the shape
exceptionInfodetails of any exceptions are placed in here.
void _fwCalculateColourWithAlertCB ( mapping  userData,
string  dpe1,
string  alertColour,
string  dpe2,
bool  alarmActive,
string  dpe3,
bool  dataInvalid 
)

This functions takes the given states of a data point element and calls a function which calcultes the relevant colour. The function then set the background colour of graphical item "this" to that colour.

Constraints
This function is designed as a 'work' function and should only be used by giving it as the function name in a dpConnect statement
Usage
Private
PVSS managers
VISION
Parameters
userDatacontains a mapping with the shapeName
dpe1data point element
alertColoura string containing the name of the current alert colour
dpe2data point element
alarmActivea bit to represent if alert handling is active or not (TRUE = active, FALSE = inactive)
dpe3data point element
dataInvalida bit to represent if data is invalid or not (TRUE = invalid, FALSE = valid)
Reviewed:
2018-07-25 Callback
void _fwCalculateColourWithSummaryAlertCB ( mapping  userData,
string  dpe1,
string  alertColour,
string  dpe2,
bool  alarmActive 
)

This functions takes the given state of a summary alert and calls a function which calculates the relevant colour. The function then set the background colour of graphical item "this" to that colour.

Constraints
This function is designed as a 'work' function and should only be used by giving it as the function name in a dpConnect statement
Usage
Private
PVSS managers
VISION
Parameters
userDatacontains a mapping with the shapeName
dpe1data point element
alertColoura string containing the name of the current alert colour
dpe2data point element
alarmActivea bit to represent if alert handling is active or not (TRUE = active, FALSE = inactive)
Reviewed:
2018-07-25 Callback
void _fwCalculateColourWithoutAlertCB ( mapping  userData,
string  dpe1,
bool  dataInvalid 
)

This functions takes the given states of a data point element and calls a function which calcultes the relevant colour. The function then set the background colour of graphical item "this" to that colour.

Constraints
This function is designed as a 'work' function and should only be used by giving it as the function name in a dpConnect statement
Usage
Private
PVSS managers
VISION
Parameters
userDatacontains a mapping with the shapeName
dpe1data point element
dataInvalida bit to represent if data is invalid or not (TRUE = invalid, FALSE = valid)
Reviewed:
2018-07-25 Callback
void fwColour_convertStatusToColour ( string &  elementColour,
string  alertColour,
bool  masked,
bool  invalid,
dyn_string &  exceptionInfo 
)

This functions takes the given states of a data point element and calculates the appropriate colour which summarises its status.

Constraints
None
Usage
Private
PVSS managers
VISION
Parameters
elementColourthe calculated status colour is returned here.
alertColoura string containing the name of the current alert colour
maskeda bit to represent if alert is maksed or not (TRUE = masked, FALSE = unmasked)
invalida bit to represent if data is invalid or not (TRUE = invalid, FALSE = valid)
exceptionInfodetails of any exceptions are placed in here.
string fwColour_getColourForDpe ( string  dpe)

The function returns the current color to be used to display dpe with the same logic of fwColour_connectShapeBackColToStatus

Constraints
None
Usage
Public
PVSS managers
VISION
Parameters
dpedata point element
Returns
color