V 10
1
LANG:1 8 (NoName)
PANEL,350 198 482 370 N "_3DFace" 0
EEE E E 1 -1 -1 0  90 70
"" 0 1
EE 2
"CBRef""1"
"EClose"E
""
DISPLAY_LAYER, 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0
LAYER, 0 
1
LANG:1 6 Layer1
13 0
"Button1"
""
1 90 70 E E E 1 E 1 E N "_3DText" E N "_3DFace" E E
 E E
1 0 0 0 0 0
EE E
0
1
LANG:1 0 
0
1
LANG:1 105 -microsoft windows-Arial-bold-r-normal-*-*-120-100-100-*-*-iso8859-1|-13,0,0,0,700,0,0,0,0,3,2,1,34,Arial
0 ""
88 68 392 132
T 
1
LANG:1 27 create Warn And Alert Class
"main()
{
	createWarnAndAlertClass();
}

//this subroutinr cretae a number of alert class datapoint (warning and alarm) of different priorities
createWarnAndAlertClass()
{
	int iclass, error;
	string warning_dp, alarm_dp, script;
	
	//create alarms (warning and alarm) with different priorities
	for(iclass=1; iclass<=3; iclass++)
	   {
	   		//========================================================================================
	   		//==========================1) create warning class datapoints ===========================
	   		//========================================================================================
	   		sprintf(warning_dp, \"Warning_%d\", iclass);
			//create datapoint if it does not exist already
			error = 0;
			if (!dpExists(warning_dp))
	 	 	   {
				  //create warning datapoint of type _AlertClass (PVSS internal type)
 				  error = dpCreate(warning_dp, \"_AlertClass\"); 
 	  	 	   }
 	  	 	if(error != 0) DebugN(\"==========ERROR: when creating \"+ warning_dp +\" datapoint\");

 			//set some of the warning datapoint parameters
			dpSetWait(warning_dp + \".:_alert_class.._type\", 14,
 
			  		  warning_dp + \".:_alert_class.._archive\", TRUE,
 
			  		  warning_dp + \".:_alert_class.._ack_type\", 3,
 
			  		  warning_dp + \".:_alert_class.._perm\", 5,
 
		 	  		  warning_dp + \".:_alert_class.._prior\", 40 + iclass,
 
			  		  //warning_dp + \".:_alert_class.._color_c_ack\", \"Blue\",
 
			  		  //warning_dp + \".:_alert_class.._color_c_nack\", \"Red\",
 
 			  		  warning_dp + \".:_alert_class.._abbr\", \"W\"+iclass);
 			
 			//this is the script that will be executed automaticaly by PVSS. the warningAlarmWent(...)
 			//method is defined in a script which file is scripts/lib/AlertClassScripts.ctl
 			//the following is execuetd when the warning comes
 			script = \"main(string dpeName, time tm, int i)\"+
 						\"{\"+
 							\"warningAlarmCame(dpeName, tm, \\\"WARNING\\\");\"+
 						\"}\";
 			dpSetWait(warning_dp + \".:_alert_class.._ctrl_c_nack\", script);
 			
 			//the following is execuetd when the alert goes
 			script = \"main(string dpeName, time tm, int i)\"+
 						\"{\"+
 							\"warningAlarmWent(dpeName, tm, \\\"WARNING\\\");\"+
 						\"}\";
 			dpSetWait(warning_dp + \".:_alert_class.._ctrl_c_ack\", script,
 					  warning_dp + \".:_alert_class.._ctrl_g_nack\", script);

			//=========================================================================================
 	   		//=================================2) create Alarm class datapoints =======================
 	   		//=========================================================================================
	   		//sprintf(alarm_dp, \"Alarm_%d\", iclass);
	   		sprintf(alarm_dp, \"Fatal_%d\", iclass);
			//create datapoint if it does not exist already
			error = 0;
			if (!dpExists(alarm_dp))
	 	 	   {
				  //create alarm datapoints of type _AlertClass (PVSS internal type)
 				  error = dpCreate(alarm_dp, \"_AlertClass\"); 
 	  	 	   }
			if(error != 0) DebugN(\"==========ERROR: when creating \"+ warning_dp +\" datapoint\");
 			//set some of the alarm datapoint parameters
			dpSetWait(alarm_dp + \".:_alert_class.._type\", 14,
 
			  		  alarm_dp + \".:_alert_class.._archive\", TRUE,
 
			  		  alarm_dp + \".:_alert_class.._ack_type\", 3,
 
			  		  alarm_dp + \".:_alert_class.._perm\", 5,
 
		 	  		  alarm_dp + \".:_alert_class.._prior\", 60 + iclass,
 
			  		  //alarm_dp + \".:_alert_class.._color_c_ack\", \"Blue\",
 
			  		  //alarm_dp + \".:_alert_class.._color_c_nack\", \"Red\",
 
 			  		  alarm_dp + \".:_alert_class.._abbr\", \"F\"+iclass);
 			
 			//this is the script that will be executed automaticaly by PVSS. the warningAlarmWent(...)
 			//method is defined in a script which file is scripts/lib/AlertClassScripts.ctl.
 			//the following is execuetd when the alert comes
 			script = \"main(string dpeName, time tm, int i)\"+
 						\"{\"+
 							\"warningAlarmCame(dpeName, tm, \\\"ALARM\\\");\"+
 						\"}\";
 			dpSetWait(alarm_dp + \".:_alert_class.._ctrl_c_nack\", script);
 			
 			//the following is execuetd when the alert goes
 			script = \"main(string dpeName, time tm, int i)\"+
 						\"{\"+
 							\"warningAlarmWent(dpeName, tm, \\\"ALARM\\\");\"+
 						\"}\";
 			dpSetWait(alarm_dp + \".:_alert_class.._ctrl_c_ack\", script,
 					  alarm_dp + \".:_alert_class.._ctrl_g_nack\", script);
 		}//end of for(iclass=0,...)
 								   
}" 0
 E E E
0
LAYER, 1 
1
LANG:1 6 Layer2
0
LAYER, 2 
1
LANG:1 6 Layer3
0
LAYER, 3 
1
LANG:1 6 Layer4
0
LAYER, 4 
1
LANG:1 6 Layer5
0
LAYER, 5 
1
LANG:1 6 Layer6
0
LAYER, 6 
1
LANG:1 6 Layer7
0
LAYER, 7 
1
LANG:1 6 Layer8
0
0