"PVSSReceiveSumAlertStatus"
Passes the results of a dpQuery to the GIS Viewer.
Synopsis
void PVSSReceiveSumAlertStatus(string strStatus);
Parameters
Parameter | Description |
---|---|
strStatus | The alert state (alert color) queried using a dpQuery or, for example, dpQueryConnectSingle. |
Description
The GIS Viewer can 'receive' the alarm status of the _SumAlertPanel data points and use this info to change the color of the associated shapes.
Call PVSSSetSumAlertPanels method to pass a list of _SumAlertPanel data points to the GIS Viewer. This should be a list of _SumAlertPanels that you want to associate to shapes in the GIS Viewer.
Execute a dpQuery() or, for example, a dpQueryConnectSingle to receive the alert color of the _SumAlertPanel data points and to pass the results of the query to the GIS Viewer by calling 'PVSS_ReceiveSumAlertStatus'.
Then use the function PVSSLinkSumAlertToShape to link the data point with a shape.
Example
The following code sends the names of all SumAlertPanel data points to the GIS Viewer, queries the alarm colors of the SumAlertPanel DP's and passes them to the
GIS Viewer using PVSSReceiveSumAlertStatus. The code also links the shape "Austria"; of the layer "COUNTRY"; to a PVSS_SumAlertPanel data point.
In case of an alert, the shape "Austria" will blink.
main()
{
dyn_string strDefinition;
dyn_string color;
// We can tell the GIS viewer what _SumAlertPanel data points it needs to 'process'
// This example will just send the names of all data points to the viewer
dyn_string strTest = dpNames( "*", "_SumAlertPanel" ) ;
GisViewer_ewo1.PVSSSetSumAlertPanels( (string)strTest );
// We can now make a 'mapping' that associates a shape with a certain _SumAlertPanel data point
strDefinition = makeDynString("COUNTRY@NAME@Austria@System1:Panel1_1" );
// ^^ Layer
// ^^ Field
// ^^ Value of field
// ^^ Name of _SumAlertPanel data point
GisViewer_ewo1.PVSSLinkSumAlertToShape( strDefinition );
// We now establish a query that will send the alert colors of the _SumAlertPanel data points to the GisViewer
string strQuery = "SELECT '.Warning:_alert_hdl.._act_state_color', '.Alert:_alert_hdl.._act_state_color','.Danger:_alert_hdl.._act_state_color'
FROM '*' WHERE ( _DPT = \"_SumAlertPanel\")";
dpQueryConnectSingle( "CallBackSumAlertPanel", "MyId", strQuery);
}
void CallBackSumAlertPanel( string strID, dyn_dyn_anytype a )
{
string strLine;
string strOneLine;
// We turn the dyn_dyn_anytype that we receive into something more useful so that the GIS viewer can handle it
for( int t = 2; t <= dynlen( a ); t++)
{
if( t > 2 )
strLine += "|";
// The GIS viewer receives a list where each line looks as follows:
// <dp>,<warning color>,<alert color>,<danger color>
strOneLine = a[t][1] + "," + a[t][2] + "," + a[t][3] + "," + a[t][4];
strLine += strOneLine;
}
// Send the (formatted) dp's and colors to our GIS Viewer
GisViewer_ewo1.PVSSReceiveSumAlertStatus( strLine );
DebugN("status of the sum alert panel data points:",strLine);
}
Assignment
GIS Viewer