V 10
1
LANG:1 8 (NoName)
PANEL,410 178 985 736 N {51,102,153} 0
EEE E E 1 -1 -1 0  720 110
"" 0 1
E"/*===================================-======================================*/
/*          CREATE/REMOVE ARCHIVE CONFIG PANEL FOR SCT_DCS                  */
/*-----------------------------------=--------------------------------------*/
/* AUTHORs:        A. Abdesselam

   DESIGN ISSUEs:  definitions (implementations) of functons used in this pannel
   MODIF_HISTORY:  30.01.2003 - first version
  ===================================-======================================*/
  
//this function gets the selected path from the comboxes (User Addresses Coordinates)
//this function get the selected path in the comboxes: only one path 
//(look at the other one below for several path)
getDpePath(string& dpePath)
{
	int rack, crate, parameter_pos, ch_hv_lv_pos;
	string parameter, ch_hv_lv, used_para, ch_hv_lv_num, message;
	
	//get the actual value of Rack, Crate, Ch_HV_LV, Ch_HV_LV_Num and Parameter
	getValue(\"Rack\", \"text\", rack);
	getValue(\"Crate\", \"text\", crate);
	getValue(\"Ch_HV_LV_Num\", \"text\", ch_hv_lv_num);
	getValue(\"Parameters\", \"text\", parameter);
	getValue(\"Parameters\", \"selectedPos\", parameter_pos);//position of the para in the combobox
	getValue(\"Ch_HV_LV\", \"text\", ch_hv_lv);
	getValue(\"Ch_HV_LV\", \"selectedPos\", ch_hv_lv_pos);
	
	//redefintion of crate number
	crate = (rack-1)*4 + crate -1; //-1 because we start from 0 (in the data point numbering)
	
	//crate path: make a 2 digit label for crates
	sprintf(dpePath, \"Crate%02d\", crate);

	//find out which HVca, LVca and Ch is used
	switch(ch_hv_lv)
	  {
		case \"HV Cards\":
			dpePath = \"There is no monitored parameter!\";
			//dpePath = dpePath+\".HV_card0\"+ch_hv_lv_num+\".\"+parameter+\".Recv\";
		break;
		
		case \"LV Cards\":
		    if(ch_hv_lv_num == \"All\")
		       {
		         message = \"\\nSorry, \\\"All\\\" is not a LV card!!\";		      
   	             ChildPanelOn(\"objects/warning.pnl\",\"Warning!!\", makeDynString(\"$message:\" + message), 100, 100);
   	             dpePath = \"\";
   	             //set normal color: script finished
                 setValue(\"\",\"backCol\",\"{204,204,102}\");
   	             return;
   	           }
   	        else if(parameter == \"All\")
		       {
		         message = \"\\nSorry, \\\"All\\\" is not a parameter!!\";		      
   	             ChildPanelOn(\"objects/warning.pnl\",\"Warning!!\", makeDynString(\"$message:\" + message), 100, 100);
   	             dpePath = \"\";
   	             //set normal color: script finished
                 setValue(\"\",\"backCol\",\"{204,204,102}\");
   	             return;
   	           }
			//card parameter path: make a 2 digit label for LV card
			sprintf(dpePath, \"%s.%s.%s\", dpePath, ch_hv_lv_num, parameter);				
		break;
		
		default://it is channel parameter
			if(ch_hv_lv_num == \"All\")
		       {
		         message = \"\\nSorry, \\\"All\\\" is not a Channel!!\";		      
   	             ChildPanelOn(\"objects/warning.pnl\",\"Warning!!\", makeDynString(\"$message:\" + message), 100, 100);
   	             dpePath = \"\";
   	             //set normal color: script finished
                 setValue(\"\",\"backCol\",\"{204,204,102}\");
   	             return;
   	           }
   	        else if(parameter == \"All\")
		       {
		         message = \"\\nSorry, \\\"All\\\" is not a parameter!!\";		      
   	             ChildPanelOn(\"objects/warning.pnl\",\"Warning!!\", makeDynString(\"$message:\" + message), 100, 100);
   	             dpePath = \"\";
   	             //set normal color: script finished
                 setValue(\"\",\"backCol\",\"{204,204,102}\");
   	             return;
   	           }
			//make a 2 digit label for channel
			sprintf(dpePath, \"%s.%s.%s\", dpePath, ch_hv_lv_num, parameter);
		break;
	  }
}

//this function get the selected paths in the comboxes: can get several paths 
//(look at the other one above for getting only one path)
getDpePaths(dyn_string& dpePaths)
{
	int rack, crate, channel, parameter_pos, ch_hv_lv_pos;
	int index, sub_index, start_chan, end_chan;
	string parameter, ch_hv_lv, used_para, ch_hv_lv_num, para_path, message;
	dyn_string LV_cardParametersNames, channelParametersNames, controllerParametersNames, string_split;
	
	//channel monitorted parameters
	channelParametersNames = makeDynString(\"LVchStat\", \"HVchStat\", \"LVch_Vcc\", \"LVps_Vcc\",
	             \"LVretVcc\", \"LVch_Icc\", \"LVch_Vdd\", \"LVps_Vdd\", \"LVretVdd\", \"LVch_Idd\", 
	             \"LVchVCSV\", \"LVchVCSI\", \"LVchPINV\", \"LVchPINI\", \"MOch_Tm0\", \"MOch_Tm1\", 
	             \"HVchVolt\", \"HVchCurr\");
    //LV card monitorted parameters
	LV_cardParametersNames = makeDynString(\"LVcaTemp\", \"LVcaPowr\");
	//Crate Controller monitorted parameters
	controllerParametersNames = makeDynString(\"CCieEcod\", \"CCieEcod1\", \"CCieEcod2\", \"CCieEcod3\",
				                              \"CCieEcod4\", \"CCieEcod5\");
	//get the actual value of Rack, Crate, Ch_HV_LV, Ch_HV_LV_Num and Parameter
	getValue(\"Rack\", \"text\", rack);
	getValue(\"Crate\", \"text\", crate);
	getValue(\"Ch_HV_LV_Num\", \"text\", ch_hv_lv_num);
	getValue(\"Parameters\", \"text\", parameter);
	getValue(\"Parameters\", \"selectedPos\", parameter_pos);//position of the para in the combobox
	getValue(\"Ch_HV_LV\", \"text\", ch_hv_lv);
	getValue(\"Ch_HV_LV\", \"selectedPos\", ch_hv_lv_pos);
	
	//redefintion of crate number
	crate = (rack-1)*4 + crate -1; //-1 because we start from 0 (in the data point numbering)
	
	//crate path: make a 2 digit label for crates
	sprintf(para_path, \"Crate%02d\", crate);
   
	//find out which HVca, LVca and Ch is used
	switch(ch_hv_lv)
	  {
		case \"HV Cards\":
			dpePaths[1] = \"there is no monitored parameter for HV card!\";
			//dpePath = dpePath+\".HV_card0\"+ch_hv_lv_num+\".\"+parameter+\".Recv\";
		break;

		case \"Controller\":
			if(parameter == \"All\") //All LV card parameters (for only one card)
			  {
			     for(sub_index=1; sub_index<=dynlen(controllerParametersNames); sub_index++)
			        {
			           sprintf(dpePaths[sub_index], \"%s.%s.%s\",
			                              para_path, ch_hv_lv_num, controllerParametersNames[sub_index]);
			        }
			  }
			else //only one LV card parameter
			  {
			     sprintf(dpePaths[1], \"%s.%s.%s\", para_path, ch_hv_lv_num, parameter);
			  }			
		break;

		case \"LV Cards\":
			//card parameter path: make a 2 digit label for LV card
			if(ch_hv_lv_num == \"All\") //All LV cards
			   {
			      for(index=0; index<12; index++) // 12 is the number of LV cards per crate
			         {
			            if(parameter == \"All\") //All LV card parameters
			              {
			                 for(sub_index=1; sub_index<=dynlen(LV_cardParametersNames); sub_index++)
			                    {
			                       sprintf(dpePaths[2*index+sub_index],//2*index, because sub_index run on 2
			                               \"%s.LV_card%02d.%s\", para_path, index, LV_cardParametersNames[sub_index]);
			                    }
			              }
			             else //only one LV card parameter (for only one card)
			              {
			                 sprintf(dpePaths[index+1], \"%s.LV_card%02d.%s\", para_path, index, parameter);
			              }	
			         }//end of for(...)	  
			   }
			else //only one LV card
			   {
			      if(parameter == \"All\") //All LV card parameters (for only one card)
			         {
			            for(sub_index=1; sub_index<=dynlen(LV_cardParametersNames); sub_index++)
			               {
			                  sprintf(dpePaths[sub_index], \"%s.%s.%s\",
			                              para_path, ch_hv_lv_num, LV_cardParametersNames[sub_index]);
			               }
			         }
			       else //only one LV card parameter
			         {
			            sprintf(dpePaths[1], \"%s.%s.%s\", para_path, ch_hv_lv_num, parameter);
			         }
			   }			
		break;
		
		default://it is channel parameters

			if(ch_hv_lv_num == \"All\") //All channels
			   {
			      for(index=0; index<48; index++) // 48 is the number of channels per crate
			         {
			            if(parameter == \"All\") //All channel parameters
			              {
			                 for(sub_index=1; sub_index<=dynlen(channelParametersNames); sub_index++)
			                    {
			                       sprintf(dpePaths[16*index+sub_index],//2*index, because sub_index run on 16
			                               \"%s.Channel%02d.%s\", para_path, index, channelParametersNames[sub_index]);
			                    }
			              }
			             else //only one channel parameter (for only one card)
			              {
			                 sprintf(dpePaths[index+1], \"%s.Channel%02d.%s\", para_path, index, parameter);
			              }	
			         }//end of for(...)	  
			   }
			else if(substr(ch_hv_lv_num, 0, 4) == \"Chan\")//only one channel
			   {
			      if(parameter == \"All\") //All channel parameters (for only one card)
			         {
			            for(sub_index=1; sub_index<=dynlen(channelParametersNames); sub_index++)
			               {
			                  sprintf(dpePaths[sub_index], \"%s.%s.%s\",
			                              para_path, ch_hv_lv_num, channelParametersNames[sub_index]);
			               }
			         }
			       else //only one channel parameter
			         {
			            sprintf(dpePaths[1], \"%s.%s.%s\", para_path, ch_hv_lv_num, parameter);
			         }
			   }
			 else if(patternMatch ( \"*-*\", ch_hv_lv_num)) //M-N channels
			   {
			   	  //get the start and the end (ie M and N)
			      string_split = strsplit(ch_hv_lv_num, \"-\");
			      if(dynlen(string_split)<=1 || string_split[1]==\" \")
			         {
			            message = \"\\n  Please, enter something like l-m and\\n\"+
			                      \"  press return key!\";		      
   	                    ChildPanelOn(\"objects/warning.pnl\",\"Warning!!\", makeDynString(\"$message:\" + message), 100, 100);
   	             
   	                    //set normal color: script finished
                        setValue(\"\",\"backCol\",\"{204,204,102}\");
   	                    return;
			         }
			      sscanf(string_split[1], \"%d\", start_chan);
			      sscanf(string_split[2], \"%d\", end_chan);
			     
			      //now the same as the case before (ie \"All\" case)
			      for(index=0; index<=end_chan-start_chan; index++) // 48 is the number of channels per crate
			         {
			            if(parameter == \"All\") //All channel parameters
			              {
			                 for(sub_index=1; sub_index<=dynlen(channelParametersNames); sub_index++)
			                    {
			                       sprintf(dpePaths[16*index+sub_index],//16*index, because sub_index run on 16
			                               \"%s.Channel%02d.%s\", para_path, index+start_chan, 
			                                                                  channelParametersNames[sub_index]);
			                    }
			              }
			             else //only one channel parameter (for only one card)
			              {
			                 sprintf(dpePaths[index+1], \"%s.Channel%02d.%s\", para_path, index+start_chan, parameter);
			              }	
			         }//end of for(...)	 
			      
			   }
			 else if(patternMatch ( \"*,*\", ch_hv_lv_num)) //l,m,n,... channels
			   {
			   	  //get the start channel numbers (ie l,m,n,...)
			      string_split = strsplit(ch_hv_lv_num, \",\");
			      if(dynlen(string_split) <= 1 || string_split[1]==\" \")
			         {
			            message = \"\\n  Please, enter something like l,m and\\n\"+
			                      \"  press return key!\";		      
   	                    ChildPanelOn(\"objects/warning.pnl\",\"Warning!!\", makeDynString(\"$message:\" + message), 100, 100);
   	             
   	                    //set normal color: script finished
                        setValue(\"\",\"backCol\",\"{204,204,102}\");
   	                    return;
			         }
			      //now the same as the case before
			      for(index=0; index<dynlen(string_split); index++) // 48 is the number of channels per crate
			         {
			            if(parameter == \"All\") //All channel parameters
			              {
			                 for(sub_index=1; sub_index<=dynlen(channelParametersNames); sub_index++)
			                    {
			                       sscanf(string_split[index+1], \"%d\", channel);//implicit convertion (in the line below)
			                                                               //seems do not work. since this line!
			                       sprintf(dpePaths[16*index+sub_index],//2*index, because sub_index run on 16
			                               \"%s.Channel%02d.%s\", para_path, channel, channelParametersNames[sub_index]);
			                    }
			              }
			             else //only one channel parameter (for only one card)
			              {
			                 sscanf(string_split[index+1], \"%d\", channel); //implicit convertion (in the line below)
			                                                               //seems do not work. since this line!
			                 sprintf(dpePaths[index+1], \"%s.Channel%02d.%s\", para_path, channel, parameter);
			              }	
			         }//end of for(...)	 			      
			   }			
		break;
	  }
}


//set the alert limits: we assume having five ranges (ie four limits are needed: 
//alarm low, warn low, warn high, alarm high
setAlert(string dpeName, int Priority, float alarm_low, float warn_low,
                                                float warn_high, float alarm_high)
{
  int alert_exist, status;
  unsigned num_ranges = 0;

  //test if the alert exist already
  status = dpGet(dpeName + \":_alert_hdl.._type\", alert_exist);

  if(!status && !alert_exist)
    {
  	   //set analog alert (13 means analag alerts and 12 binary alerts)
	   dpSet(dpeName + \":_alert_hdl.._type\", 13,
	
 	   //set three ranges
	   dpeName + \":_alert_hdl.1._type\", 4,  //alarm low range
	   dpeName + \":_alert_hdl.2._type\", 4,  //warning low range
	   dpeName + \":_alert_hdl.3._type\", 4,  //normal range
	   dpeName + \":_alert_hdl.4._type\", 4,  //waring high range
	   dpeName + \":_alert_hdl.5._type\", 4,  //alarm high range
 
       //set each range: each range consists of two values (borders)
	   dpeName + \":_alert_hdl.1._u_limit\", alarm_low, 
	   dpeName + \":_alert_hdl.2._l_limit\", alarm_low, 
	   dpeName + \":_alert_hdl.2._u_limit\", warn_low, 
	   dpeName + \":_alert_hdl.3._l_limit\", warn_low,
	   dpeName + \":_alert_hdl.3._u_limit\", warn_high,
	   dpeName + \":_alert_hdl.4._l_limit\", warn_high,
	   dpeName + \":_alert_hdl.4._u_limit\", alarm_high,
	   dpeName + \":_alert_hdl.5._l_limit\", alarm_high,
			 
 	   //set the limit of each range, look for consistency!	
	   dpeName + \":_alert_hdl.1._u_incl\", TRUE,  
	   dpeName + \":_alert_hdl.2._l_incl\", FALSE, 
	   dpeName + \":_alert_hdl.2._u_incl\", TRUE, 
	   dpeName + \":_alert_hdl.3._l_incl\", FALSE, 
	   dpeName + \":_alert_hdl.3._u_incl\", FALSE, 
	   dpeName + \":_alert_hdl.4._l_incl\", TRUE, 
	   dpeName + \":_alert_hdl.4._u_incl\", FALSE, 
	   dpeName + \":_alert_hdl.5._l_incl\", TRUE, 

	   //set alert texts
	   dpeName + \":_alert_hdl.1._text\", \"alarm: Too Low Value\",  
	   dpeName + \":_alert_hdl.2._text\", \"Warning: Low Value\", 
	   dpeName + \":_alert_hdl.3._text\", \"Normal Value\",
	   dpeName + \":_alert_hdl.4._text\", \"Warning: High Value\",
	   dpeName + \":_alert_hdl.5._text\", \"alarm: Too High Value\",
 
       //set alert class
	   dpeName + \":_alert_hdl.1._class\", \"Alarm_\"+Priority+\".\", 
	   dpeName + \":_alert_hdl.2._class\", \"Warning_\"+Priority+\".\",
	   dpeName + \":_alert_hdl.4._class\", \"Warning_\"+Priority+\".\",
	   dpeName + \":_alert_hdl.5._class\", \"Alarm_\"+Priority+\".\",
	
	   //working with the original value
	   dpeName + \":_alert_hdl.._orig_hdl\", TRUE, 
 
 	   //activates the alert handling
	   dpeName + \":_alert_hdl.._active\", TRUE); 
    }
  else
    {
  	   //get the number of  alert ranges
	   dpGet(dpeName + \":_alert_hdl.._num_ranges\", num_ranges);
	
	  //make sure there are 5 ranges (the case of script)
	  if(num_ranges == 5)
	    {
	  	   //acknoledge the alert if any, otherwise the parameters cann't be changed
	       dpSet(dpeName + \":_alert_hdl.._ack\", 1);

		   //desactivates the alert handling
	   	   dpSet(dpeName + \":_alert_hdl.._active\", FALSE, 
	
    	   //set each range: each range consists of two values (borders)
	 	   dpeName + \":_alert_hdl.1._u_limit\", alarm_low, 
		   dpeName + \":_alert_hdl.2._l_limit\", alarm_low, 
		   dpeName + \":_alert_hdl.2._u_limit\", warn_low, 
		   dpeName + \":_alert_hdl.3._l_limit\", warn_low,
		   dpeName + \":_alert_hdl.3._u_limit\", warn_high,
		   dpeName + \":_alert_hdl.4._l_limit\", warn_high,
		   dpeName + \":_alert_hdl.4._u_limit\", alarm_high,
		   dpeName + \":_alert_hdl.5._l_limit\", alarm_high);
 
		   //re-activates the alert handling
		   dpSet(dpeName + \":_alert_hdl.._active\", TRUE);
	    }
	  else
	    {
	 	   Debug(\"ERROR in alert script, there are not 5 ranges as assumed\");
	    }
    }//end of else
}

//Function (NoName)_General()" 0
 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
2 45
"Text13"
""
1 20 21 E E E 1 E 1 E N {0,0,0} E N {204,204,204} E E
 E E
43 0 0 0 0 0
EE E
0
1
LANG:1 0 
1
"dashclr"N "_Transparent"
E E 0 1 1 0 1 E U  1 E 22 23 68 41
1 2 0 "s" 0 0 0 64 0 0  22 23
 1
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 ""
1
LANG:1 4 Rack
2 46
"Text14"
""
1 103 21 E E E 1 E 1 E N {0,0,0} E N {204,204,204} E E
 E E
44 0 0 0 0 0
EE E
0
1
LANG:1 0 
1
"dashclr"N "_Transparent"
E E 0 1 1 0 1 E U  1 E 105 23 151 41
1 2 0 "s" 0 0 0 64 0 0  105 23
 1
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 ""
1
LANG:1 5 Crate
2 47
"Text16"
""
1 356 20 E E E 1 E 1 E N {0,0,0} E N {204,204,204} E E
 E E
45 0 0 0 0 0
EE E
0
1
LANG:1 0 
1
"dashclr"N "_Transparent"
E E 0 1 1 0 1 E U  1 E 358 22 407 43
1 2 0 "s" 0 0 0 64 0 0  358 22
 1
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 ""
1
LANG:1 6 Params
2 59
"Text3"
""
1 630 520 E E E 1 E 1 E N {0,0,0} E N {204,204,204} E E
 E E
57 0 0 0 0 0
EE E
0
1
LANG:1 0 
1
"dashclr"N "_Transparent"
E E 0 1 1 0 1 E U  1 E 632 522 698 548
1 2 0 "s" 0 0 0 64 0 0  632 522
 1
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 ""
1
LANG:1 8 Alrm Low
2 61
"Text5"
""
1 895 520 E E E 1 E 1 E N {0,0,0} E N {204,204,204} E E
 E E
59 0 0 0 0 0
EE E
0
1
LANG:1 0 
1
"dashclr"N "_Transparent"
E E 0 1 1 0 1 E U  1 E 897 522 963 548
1 2 0 "s" 0 0 0 64 0 0  897 522
 1
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 ""
1
LANG:1 9 Alrm High
2 62
"Text6"
""
1 821 520 E E E 1 E 1 E N {0,0,0} E N {204,204,204} E E
 E E
60 0 0 0 0 0
EE E
0
1
LANG:1 0 
1
"dashclr"N "_Transparent"
E E 0 1 1 0 1 E U  1 E 823 522 889 548
1 2 0 "s" 0 0 0 64 0 0  823 522
 1
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 ""
1
LANG:1 9 Warn High
2 63
"Text7"
""
1 704 520 E E E 1 E 1 E N {0,0,0} E N {204,204,204} E E
 E E
61 0 0 0 0 0
EE E
0
1
LANG:1 0 
1
"dashclr"N "_Transparent"
E E 0 1 1 0 1 E U  1 E 706 522 772 548
1 2 0 "s" 0 0 0 64 0 0  706 522
 1
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 ""
1
LANG:1 8 Warn Low
13 0
"Button1"
""
1 690 110 E E E 1 E 1 E N {0,51,255} E N {204,204,102} 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-*-*-140-100-100-*-*-iso8859-1|-16,0,0,0,700,0,0,0,0,3,2,1,34,Arial
0 ""
688 108 922 172
T 
1
LANG:1 21 Create Archive Config
"main()
{  
   int index, archiveManager;
   string dpeName, message;
   dyn_string selctionBoxItems, parametersNames;
   dyn_string paths_split1, paths_split2;
  
   //set red color: script started
   setValue(\"\",\"backCol\",\"red\");
  
   //get the choosen dpe paths (names)
   getValue(\"PVSS_Addresses\", \"items\", selctionBoxItems);
   
   if(dynlen(selctionBoxItems) == 2)
     {
     	//for instance, return if the no datpoint elemenet was chosed
     	message = \"No item has been choosen! \\n You have to choose at least ome item\"; 
        ChildPanelOn(\"objects/warning.pnl\",\"Warning!!\",makeDynString(\"$message:\" + message), 100, 100);
     	//set normal color: script finished
        setValue(\"\",\"backCol\",\"{204,204,102}\");
        
      	return;
     }
   //get the selected archive manager
   getValue(\"archiveManager\", \"selectedPos\", archiveManager);
   
   //we know the format of the lines in \"PVSS_Addresses\" selecton box. we consider only the four
   //last lines. (one may have to see first the format in the selection box!!)
   for(index=3; index<=dynlen(selctionBoxItems); index++)
      {
      	 //split the items to PVSS path and User Path
      	 paths_split1 = strsplit(selctionBoxItems[index], \" \");

      	 //take PVSS path
      	 dpeName = paths_split1[1];
      	 
		 dpSetWait(dpeName+\".Recv:_archive.._type\", 45,
 		           dpeName+\".Recv:_archive.._archive\", TRUE,
 		           dpeName+\".Recv:_archive.1._type\", 15,
 		           dpeName+\".Recv:_archive.1._class\", \"_ValueArchive_\"+archiveManager);
      }
   //set normal color: script finished
   setValue(\"\",\"backCol\",\"{204,204,102}\");
}" 0
 E E E
13 1
"Button2"
""
1 690 210 E E E 1 E 1 E N {0,51,255} E N {204,204,102} E E
 E E
2 0 0 0 0 0
EE E
0
1
LANG:1 0 
0
1
LANG:1 105 -microsoft windows-Arial-bold-r-normal-*-*-140-100-100-*-*-iso8859-1|-16,0,0,0,700,0,0,0,0,3,2,1,34,Arial
0 ""
688 208 922 272
T 
1
LANG:1 21 Delete Archive Config
"main()
{
   int index;
   string dpeName, message;
   dyn_string selctionBoxItems, parametersNames;
   dyn_string paths_split1, paths_split2;
  
   //set red color: script finished
   setValue(\"\",\"backCol\",\"red\");
  
   //get the choosen dpe paths (names)
   getValue(\"PVSS_Addresses\", \"items\", selctionBoxItems);
   
   if(dynlen(selctionBoxItems) == 2)
     {
     	//for instance, return if the no datpoint elemenet was chosed
     	message = \"No item has been choosen! \\n You have to choose at least ome item\"; 
        ChildPanelOn(\"objects/warning.pnl\",\"Warning!!\",makeDynString(\"$message:\" + message), 100, 100);
     	//set normal color: script finished
        setValue(\"\",\"backCol\",\"{204,204,102}\");
        
      	return;
     }
   //delete the archive config for the selectionned items (parameters)
   for(index=3; index<=dynlen(selctionBoxItems); index++)
      {
      	 dpSetWait(selctionBoxItems[index]+\".Recv:_archive.._type\", 0);
      }
      
   //set normal color: script finished
   setValue(\"\",\"backCol\",\"{204,204,102}\");
}" 0
 E E E
22 12
"archiveManager"
""
1 720 44 E E E 1 E 1 E N "_WindowText" E N {204,204,204} E E
 E E
13 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 ""
718 42 922 73
3
1
LANG:1 21 01) 5 minutes archive
 0
1
LANG:1 16 02) Hour archive
 0
1
LANG:1 15 03) Day archive
 0
E
E
E
 0 0
17 40
"PVSS_Addresses"
""
1 54 70 E E E 1 E 0 E N {0,255,255} E N {102,102,102} E E
 E E
38 0 0 0 0 0
EE E
0
1
LANG:1 0 
0
1
LANG:1 109 -microsoft windows-Courier-bold-r-normal-*-*-100-100-100-*-*-iso8859-1|-13,0,0,0,700,0,0,0,0,1,2,1,49,Courier
0 ""
52 68 500 682
2
1
LANG:1 15 PVSS Addresses:
 0
1
LANG:1 0 
 0
E
E
E

3 1
13 41
"show_items"
""
1 349 -30 E E E 1 E 1 E N {0,51,255} E N {204,204,102} E E
 E E
39 0 0 0 0 0
EE E
0
1
LANG:1 0 
0
1
LANG:1 117 -microsoft windows-Courier New-bold-r-normal-*-*-120-100-100-*-*-iso8859-1|-13,0,0,0,700,0,0,0,0,3,2,1,49,Courier New
0 ""
347 -32 531 -2
T 
1
LANG:1 10 Show Items
"/* Histogram_1 'Go' for Barr
123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456*/

main()
{ 
	bool visible;
	
	getValue(\"PVSS_Addresses\", \"visible\", visible);

	if(visible)
	  {
		 setValue(\"PVSS_Addresses\", \"visible\", FALSE);
		 setValue(\"delete_item\", \"visible\", FALSE);
		 setValue(\"delete_all_items\", \"visible\", FALSE);
	  }
	else
	  {
		 setValue(\"PVSS_Addresses\", \"visible\", TRUE); 
		 setValue(\"delete_item\", \"visible\", TRUE); 
		 setValue(\"delete_all_items\", \"visible\", TRUE);
	  }
}
" 0
 E E E
13 42
"Button23"
""
1 535 -30 E E E 1 E 1 E N {0,51,255} E N {204,204,102} E E
 E E
40 0 0 0 0 0
EE E
0
1
LANG:1 0 
0
1
LANG:1 117 -microsoft windows-Courier New-bold-r-normal-*-*-120-100-100-*-*-iso8859-1|-13,0,0,0,700,0,0,0,0,3,2,1,49,Courier New
0 ""
533 -32 717 -2
T 
1
LANG:1 8 Add Item
"/* Histogram_1 'Go' for Barr
123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456*/

main()
{ 
  int    selectedPosition, number_of_items, index;
  dyn_string dpePaths;
  shape PVSS_Addresses;

  //set choice boxes visible
  setValue(\"PVSS_Addresses\", \"visible\", TRUE);
  setValue(\"delete_item\", \"visible\", TRUE);
  setValue(\"delete_all_items\", \"visible\", TRUE);
    
  //get the selected parameter's path
  //this function is defined in the general part
  getDpePaths(dpePaths);
 
 /* 
  if(dpePaths == \"\")
    {
    	DebugN(\"============== no parameter selected. Please, select on parameter!\");
    	return;
    }
 */
 
  //append to the list a new Address
  getValue(\"PVSS_Addresses\", \"selectedPos\", selectedPosition);
  if(selectedPosition <3) //no item is selected
    {
       //append the item at the end of the list
       for(index=1; index<=dynlen(dpePaths); index++)
          {
             setValue(\"PVSS_Addresses\", \"appendItem\", dpePaths[index]);
          }
    }
  else // replace the item with selected position
    {
       setValue(\"PVSS_Addresses\", \"replacePos\", selectedPosition, dpePaths[1]);
    }
}
" 0
 E E E
13 43
"delete_item"
""
1 319 681 E E E 1 E 0 E N {0,51,255} E N {204,204,102} E E
 E E
41 0 0 0 0 0
EE E
0
1
LANG:1 0 
0
1
LANG:1 117 -microsoft windows-Courier New-bold-r-normal-*-*-120-100-100-*-*-iso8859-1|-13,0,0,0,700,0,0,0,0,3,2,1,49,Courier New
0 ""
317 679 501 709
T 
1
LANG:1 20 Delete Selected Item
"/* Histogram_1 'Go' for Barr
123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456*/

main()
{ 
  int    selectedPosition, number_of_items;
  shape PVSS_Addresses;
   
  PVSS_Addresses = getShape(\"PVSS_Addresses\");
  
  //get the selected item
  getValue(PVSS_Addresses, \"selectedPos\", selectedPosition);
  
  if(selectedPosition > 2) //an item is selected
    {
 	   //detelete the selected item
 	   PVSS_Addresses.deletePos(selectedPosition);
    }
  else //no item is selected
    {
       number_of_items = PVSS_Addresses.itemCount();
       //delete the last item
       if(number_of_items > 2) PVSS_Addresses.deletePos(number_of_items);
    }
}
" 0
 E E E
13 44
"delete_all_items"
""
1 133 681 E E E 1 E 0 E N {0,51,255} E N {204,204,102} E E
 E E
42 0 0 0 0 0
EE E
0
1
LANG:1 0 
0
1
LANG:1 117 -microsoft windows-Courier New-bold-r-normal-*-*-120-100-100-*-*-iso8859-1|-13,0,0,0,700,0,0,0,0,3,2,1,49,Courier New
0 ""
131 679 315 709
T 
1
LANG:1 16 Delete All Items
"/* Histogram_1 'Go' for Barr
123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456*/

main()
{ 
  int index, number_of_items;
  shape PVSS_Addresses;
  
  //set red color: script running
  setValue(\"\",\"backCol\",\"red\");
  
  PVSS_Addresses = getShape(\"PVSS_Addresses\");
  
  //get the number of selected items in the combox
  number_of_items = PVSS_Addresses.itemCount();
  
  //delete all items but the two first
  for(index=0; index!=number_of_items-2; index++) 
     {
        PVSS_Addresses.deletePos(number_of_items-index);
     }
     
  //set normal color: script finished
  setValue(\"\",\"backCol\",\"{204,204,102}\");
}
" 0
 E E E
13 48
"Button3"
""
1 133 45 E E E 1 E 1 E N {0,51,255} E N {204,204,102} E E
 E E
46 0 0 0 0 0
EE E
0
1
LANG:1 0 
0
1
LANG:1 117 -microsoft windows-Courier New-bold-r-normal-*-*-120-100-100-*-*-iso8859-1|-13,0,0,0,700,0,0,0,0,3,2,1,49,Courier New
0 ""
131 43 315 73
T 
1
LANG:1 10 Show Items
"/* Histogram_1 'Go' for Barr
123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456*/

main()
{ 
	bool visible;
	
	getValue(\"PVSS_Addresses\", \"visible\", visible);

	if(visible)
	  {
		 setValue(\"PVSS_Addresses\", \"visible\", FALSE);
		 setValue(\"delete_item\", \"visible\", FALSE);
		 setValue(\"delete_all_items\", \"visible\", FALSE);
	  }
	else
	  {
		 setValue(\"PVSS_Addresses\", \"visible\", TRUE); 
		 setValue(\"delete_item\", \"visible\", TRUE); 
		 setValue(\"delete_all_items\", \"visible\", TRUE);
	  }
}
" 0
 E E E
13 49
"Button4"
""
1 319 45 E E E 1 E 1 E N {0,51,255} E N {204,204,102} E E
 E E
47 0 0 0 0 0
EE E
0
1
LANG:1 0 
0
1
LANG:1 117 -microsoft windows-Courier New-bold-r-normal-*-*-120-100-100-*-*-iso8859-1|-13,0,0,0,700,0,0,0,0,3,2,1,49,Courier New
0 ""
317 43 501 73
T 
1
LANG:1 8 Add Item
"/* Histogram_1 'Go' for Barr
123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456*/

main()
{ 
  int    selectedPosition, number_of_items, index;
  dyn_string dpePaths;
  shape PVSS_Addresses;

  //set choice boxes visible
  setValue(\"PVSS_Addresses\", \"visible\", TRUE);
  setValue(\"delete_item\", \"visible\", TRUE);
  setValue(\"delete_all_items\", \"visible\", TRUE);
    
  //get the selected parameter's path
  //this function is defined in the general part
  getDpePaths(dpePaths);
 
 /* 
  if(dpePaths == \"\")
    {
    	DebugN(\"============== no parameter selected. Please, select on parameter!\");
    	return;
    }
 */
 
  //append to the list a new Address
  getValue(\"PVSS_Addresses\", \"selectedPos\", selectedPosition);
  if(selectedPosition <3) //no item is selected
    {
       //append the item at the end of the list
       for(index=1; index<=dynlen(dpePaths); index++)
          {
             setValue(\"PVSS_Addresses\", \"appendItem\", dpePaths[index]);
          }
    }
  else // replace the item with selected position
    {
       setValue(\"PVSS_Addresses\", \"replacePos\", selectedPosition, dpePaths[1]);
    }
}
" 0
 E E E
21 50
"Rack"
""
1 63 20 E E E 1 E 1 E N "_WindowText" E N "_Window" E E
 E E
48 0 0 0 0 0
EE E
0
1
LANG:1 0 
0
1
LANG:1 117 -microsoft windows-Courier New-bold-r-normal-*-*-120-100-100-*-*-iso8859-1|-12,0,0,0,700,0,0,0,0,3,2,1,49,Courier New
0 ""
61 18 105 45
0
E
E
E

N 1 22 1 1 0 1
21 51
"Crate"
""
1 143 20 E E E 1 E 1 E N "_WindowText" E N "_Window" E E
 E E
49 0 0 0 0 0
EE E
0
1
LANG:1 0 
0
1
LANG:1 117 -microsoft windows-Courier New-bold-r-normal-*-*-120-100-100-*-*-iso8859-1|-12,0,0,0,700,0,0,0,0,3,2,1,49,Courier New
0 ""
141 18 185 45
0
E
E
E

N 1 4 1 1 0 1
22 53
"Parameters"
""
1 408 20 E E E 1 E 1 E N "_WindowText" E N {255,255,255} E E
 E E
51 0 0 0 0 0
EE E
0
1
LANG:1 0 
0
2
LANG:1 105 -microsoft windows-Arial-bold-r-normal-*-*-110-100-100-*-*-iso8859-1|-12,0,0,0,700,0,0,0,0,3,2,1,34,Arial
LANG:5 119 -microsoft windows-Courier New-normal-r-normal-*-*-110-100-100-*-*-iso8859-1|-12,0,0,0,400,0,0,0,0,3,2,1,49,Courier New
0 ""
406 18 500 44
0
E
E
E
 0 0
13 55
"Button5"
""
1 690 310 E E E 1 E 1 E N {0,51,255} E N {204,204,102} E E
 E E
53 0 0 0 0 0
EE E
0
1
LANG:1 0 
0
1
LANG:1 105 -microsoft windows-Arial-bold-r-normal-*-*-140-100-100-*-*-iso8859-1|-16,0,0,0,700,0,0,0,0,3,2,1,34,Arial
0 ""
688 308 922 372
T 
1
LANG:1 27 Find Actual Archived Params
"main()
{
   int index, crate, channel, lvcard, parameter, archive_type;
   int hostMax, nodeMax, portMax, unitMax, crateMax, lvcardMax, channelMax; 
   string cratePath, lvcardPath, channelPath;
   string message;
   dyn_string selctionBoxItems, parametersNames;
   dyn_string paths_split1, paths_split2;
   
   dyn_string LV_cardParametersNames, channelParametersNames;
	
   channelParametersNames = makeDynString(\"LVch_Vcc\", \"LVps_Vcc\", \"LVretVcc\", \"LVch_Icc\", 
				\"LVch_Vdd\", \"LVps_Vdd\", \"LVretVdd\", \"LVch_Idd\", \"LVchVCSV\", \"LVchVCSI\", 
				\"LVchPINV\", \"LVchPINI\", \"MOch_Tm0\", \"MOch_Tm1\", \"HVchVolt\", \"HVchCurr\");
   LV_cardParametersNames = makeDynString(\"LVcaTemp\", \"LVcaPowr\");
  
   //set red color: script finished
   setValue(\"\",\"backCol\",\"red\");
  
   //get the system configuration (find how many crate are used)
   dpGet(\"SCTmops1:Hmax.Numb:_original.._value\"  , hostMax);
   dpGet(\"SCTmops1:Nmax.Numb:_original.._value\"  , nodeMax);
   dpGet(\"SCTmops1:Pmax.Numb:_original.._value\"  , portMax);
   dpGet(\"SCTmops1:Umax.Numb:_original.._value\"  , unitMax);
   dpGet(\"SCTmops1:Cmax.Numb:_original.._value\"  , channelMax);

   lvcardMax = 12; //to be replaced later (wait for info from Serguey!!)
   crateMax = hostMax * nodeMax * portMax * unitMax;
  
   //set choice boxes visible
   setValue(\"PVSS_Addresses\", \"visible\", TRUE);
   setValue(\"delete_item\", \"visible\", TRUE);
   setValue(\"delete_all_items\", \"visible\", TRUE);
  
   //we want to loop on all the parameters in our system
   //1)loop on all the crate
   for(crate=0; crate<crateMax; crate++)
    {
       // form the crate path. take care of the two digit format!
		sprintf(cratePath, \"Crate%02d\", crate);
       // 2)loop on the channels in a crate
       for(channel=0; channel<channelMax; channel++)
          {
             //form channel path. take care of the two digit format!
             sprintf(channelPath, \"%s.Channel%02d\", cratePath, channel);
             //find how many  channel parameters have archive config
             for(parameter=1; parameter<=dynlen(channelParametersNames); parameter++)
                {  
             	   //get parameter range of the alarm: alrm low, warn low, ok, warn high or alrm high
               	   dpGet(channelPath+\".\"+channelParametersNames[parameter]
               		   		 								+\".Recv:_archive.._type\", archive_type);
               	   if(archive_type == 45) setValue(\"PVSS_Addresses\", \"appendItem\", 
               	                                  channelPath+\".\"+channelParametersNames[parameter]);
                }
          }
       // 3)loop on the channels in a crate
       for(lvcard=0; lvcard<lvcardMax; lvcard++)
          {
             //form lvcard path. take care of the two digit format!
             sprintf(lvcardPath, \"%s.LV_card%02d\", cratePath, lvcard);
             //find how many  lvcard parameters have archive config
             for(parameter=1; parameter<=dynlen(LV_cardParametersNames); parameter++)
                {  
             	   //get parameter range of the alarm: alrm low, warn low, ok, warn high or alrm high
               	   dpGet(lvcardPath+\".\"+LV_cardParametersNames[parameter]
               		   		 								+\".Recv:_archive.._type\", archive_type);
               	   if(archive_type == 45) setValue(\"PVSS_Addresses\", \"appendItem\", 
               	                                  lvcardPath+\".\"+LV_cardParametersNames[parameter]);
                }          
          }
    }//end of for(crate=0; ...)

   //set normal color: script finished
   setValue(\"\",\"backCol\",\"{204,204,102}\");
}" 0
 E E E
13 56
"Button6"
""
1 690 610 E E E 1 E 1 E N {0,51,255} E N {204,204,102} E E
 E E
54 0 0 0 0 0
EE E
0
1
LANG:1 0 
0
1
LANG:1 105 -microsoft windows-Arial-bold-r-normal-*-*-140-100-100-*-*-iso8859-1|-16,0,0,0,700,0,0,0,0,3,2,1,34,Arial
0 ""
688 608 922 672
T 
1
LANG:1 17 Set Alerts Limits
"main()
{  
   int index, archiveManager, err;
   float alarm_low, warn_low, warn_high, alarm_high;
   string alarm_low_str, warn_low_str, warn_high_str, alarm_high_str;
   string dpeName, message;
   dyn_string selctionBoxItems, parametersNames;
   dyn_string paths_split1, paths_split2;
  
   //set red color: script started
   setValue(\"\",\"backCol\",\"red\");
  
   //get the choosen dpe paths (names)
   getValue(\"PVSS_Addresses\", \"items\", selctionBoxItems);
   
   if(dynlen(selctionBoxItems) == 2)
     {
     	//for instance, return if the no datpoint elemenet was chosed
     	message = \"No item has been choosen! \\n You have to choose at least ome item\"; 
        ChildPanelOn(\"objects/warning.pnl\",\"Warning!!\",makeDynString(\"$message:\" + message), 100, 100);
     	//set normal color: script finished
        setValue(\"\",\"backCol\",\"{204,204,102}\");
        
      	return;
     }
   //get the selected alert limits. we need to get them in string fromat beacuse we
   //want to check if any of the field is empty! couldn't be done with float! 
   getValue(\"alarm_low\", \"text\", alarm_low_str);
   getValue(\"warn_low\", \"text\", warn_low_str);
   getValue(\"warn_high\", \"text\", warn_high_str);
   getValue(\"alarm_high\", \"text\", alarm_high_str);
   
   if(alarm_low_str==\"\" || warn_low_str==\"\" || warn_high_str ==\"\" || alarm_high_str==\"\")
     {
     	//for instance, return if the no datpoint elemenet was chosed
     	message = \"\\n Please, input all the alerts limits\"; 
        ChildPanelOn(\"objects/warning.pnl\",\"Warning!!\",makeDynString(\"$message:\" + message), 100, 100);
     	//set normal color: script finished
        setValue(\"\",\"backCol\",\"{204,204,102}\");
        
      	return;
     }
     
   //convertion from string to float
   sscanf(alarm_low_str, \"%f\", alarm_low);
   sscanf(warn_low_str, \"%f\", warn_low);
   sscanf(warn_high_str, \"%f\", warn_high);
   sscanf(alarm_high_str, \"%f\", alarm_high);
  
   //we know the format of the lines in \"PVSS_Addresses\" selecton box. we consider only the four
   //last lines. (one may have to see first the format in the selection box!!)
   for(index=3; index<=dynlen(selctionBoxItems); index++)
      {
      	 //split the items to PVSS path and User Path
      	 paths_split1 = strsplit(selctionBoxItems[index], \" \");

      	 //take PVSS path
      	 dpeName = paths_split1[1];
      	 
		 setAlert(dpeName+\".Recv\", 1, alarm_low, warn_low, warn_high, alarm_high);
      }
   //set normal color: script finished
   setValue(\"\",\"backCol\",\"{204,204,102}\");
}" 0
 E E E
14 64
"alarm_low"
""
1 630 551 E E E 1 E 1 E N "_WindowText" E N "_Window" E E
 E E
62 0 0 0 0 0
EE E
0
1
LANG:1 0 
0
1
LANG:1 117 -microsoft windows-Courier New-bold-r-normal-*-*-160-100-100-*-*-iso8859-1|-19,0,0,0,700,0,0,0,0,3,2,1,49,Courier New
0 ""
628 549 702 582
3 "s" 0 0 0 0 0 0 
E
E
E
14 65
"alarm_high"
""
1 895 551 E E E 1 E 1 E N "_WindowText" E N "_Window" E E
 E E
63 0 0 0 0 0
EE E
0
1
LANG:1 0 
0
1
LANG:1 117 -microsoft windows-Courier New-bold-r-normal-*-*-160-100-100-*-*-iso8859-1|-19,0,0,0,700,0,0,0,0,3,2,1,49,Courier New
0 ""
893 549 967 582
3 "s" 0 0 0 0 0 0 
E
E
E
14 66
"warn_high"
""
1 822 551 E E E 1 E 1 E N "_WindowText" E N "_Window" E E
 E E
64 0 0 0 0 0
EE E
0
1
LANG:1 0 
0
1
LANG:1 117 -microsoft windows-Courier New-bold-r-normal-*-*-160-100-100-*-*-iso8859-1|-19,0,0,0,700,0,0,0,0,3,2,1,49,Courier New
0 ""
820 549 894 582
3 "s" 0 0 0 0 0 0 
E
E
E
14 67
"warn_low"
""
1 704 551 E E E 1 E 1 E N "_WindowText" E N "_Window" E E
 E E
65 0 0 0 0 0
EE E
0
1
LANG:1 0 
0
1
LANG:1 117 -microsoft windows-Courier New-bold-r-normal-*-*-160-100-100-*-*-iso8859-1|-19,0,0,0,700,0,0,0,0,3,2,1,49,Courier New
0 ""
702 549 776 582
3 "s" 0 0 0 0 0 0 
E
E
E
22 69
"Ch_HV_LV"
""
1 183 20 E E E 1 E 1 E N "Schwarz" E N {255,255,255} E E
 E E
66 0 0 0 0 0
EE E
0
1
LANG:1 0 
0
1
LANG:1 105 -microsoft windows-Arial-bold-r-normal-*-*-110-100-100-*-*-iso8859-1|-12,0,0,0,700,0,0,0,0,3,2,1,34,Arial
0 ""
181 18 267 44
4
1
LANG:1 8 Channels
 1
1
LANG:1 8 LV Cards
 0
1
LANG:1 8 HV Cards
 0
1
LANG:1 10 Controller
 0
"main()
{
	int index;
	string channel;
	dyn_string para_list, items_list;

	// initialise the channels cards combox
	setValue(\"Ch_HV_LV\", \"text\", \"Channels\");
	
	//set the list of items for Ch_HV_LV_Num combox in channel case
	items_list = makeDynString(\"All\", \"M-N\", \"l,m,n...\");
	for(index=0; index<48; index++)
	   {
	   	  sprintf(channel, \"Channel%02d\", index);
	      dynAppend(items_list, channel);
	   }
	setValue(\"Ch_HV_LV_Num\", \"items\", items_list);
	//display the first item
	setValue(\"Ch_HV_LV_Num\", \"selectedPos\", 1);
	
    // initialise the Parameters combox
	para_list = makeDynString(\"All\", \"LVchStat\", \"HVchStat\", \"LVch_Vcc\", \"LVps_Vcc\", \"LVretVcc\", \"LVch_Icc\", 
				              \"LVch_Vdd\", \"LVps_Vdd\", \"LVretVdd\", \"LVch_Idd\", \"LVchVCSV\", \"LVchVCSI\", 
				              \"LVchPINV\", \"LVchPINI\", \"MOch_Tm0\", \"MOch_Tm1\", \"HVchVolt\", \"HVchCurr\");
				
	setValue(\"Parameters\", \"items\", para_list);
	setValue(\"Parameters\", \"selectedPos\", 1);				

}" 0

"/* Hist_2 'Card/Chan' for MoPS
123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456*/
main()
{	
	int index;
	string ch_hv_lv, channel;
	dyn_string para_list, items_list;

	// set the max number...etc. depending on the item used
	getValue(\"Ch_HV_LV\", \"text\", ch_hv_lv);
	switch(ch_hv_lv)
		{
			case \"LV Cards\":
	            //set the list of items for Ch_HV_LV_Num combox in LV cards case
				items_list = makeDynString(\"All\");
				for(index=0; index<12; index++)
	   			   {
	   	  			  sprintf(channel, \"LV_card%02d\", index);
	      			  dynAppend(items_list, channel);
	  			   }
			    setValue(\"Ch_HV_LV_Num\", \"items\", items_list);
			    //display the first item
			    setValue(\"Ch_HV_LV_Num\", \"selectedPos\", 1);
			    
			    //list of monitored parameters in LV Cards
				setValue(\"Parameters\", \"items\", makeDynString(\"All\", \"LVcaTemp\", \"LVcaPowr\"));
				setValue(\"Parameters\", \"selectedPos\", 1);
			break;
			
			case \"HV Cards\":
				//set the list of items for Ch_HV_LV_Num combox in HV cards case
				items_list = makeDynString(\"All\");
				for(index=0; index<6; index++)
	   			   {
	   	  			  sprintf(channel, \"HV_card%02d\", index);
	      			  dynAppend(items_list, channel);
	  			   }
			    setValue(\"Ch_HV_LV_Num\", \"items\", items_list);
		 	    //display the first item
			    setValue(\"Ch_HV_LV_Num\", \"selectedPos\", 1);
			    
			    //list of monitored parameters in HV Cards
				setValue(\"Parameters\", \"items\", makeDynString(\"no params\"));
				setValue(\"Parameters\", \"selectedPos\", 1);
			break;
			
			case \"Controller\":
				//set the list of items for Ch_HV_LV_Num combox in controller case
				items_list = makeDynString(\"Controller\");
			    setValue(\"Ch_HV_LV_Num\", \"items\", items_list);
		 	    //display the first item
			    setValue(\"Ch_HV_LV_Num\", \"selectedPos\", 1);
			    
			    //list of monitored parameters in Controller
				setValue(\"Parameters\", \"items\", makeDynString(\"All\", \"CCieEcod\", \"CCieEcod1\", \"CCieEcod2\", \"CCieEcod3\",
				                                              \"CCieEcod4\", \"CCieEcod5\" ));
				setValue(\"Parameters\", \"selectedPos\", 1);
			break;
			
			default: //it is channel
			    //set the list of items for Ch_HV_LV_Num combox in channel case
				items_list = makeDynString(\"All\", \"M-N\", \"l,m,n...\");
				for(index=0; index<48; index++)
	   			   {
	   	  			  sprintf(channel, \"Channel%02d\", index);
	      			  dynAppend(items_list, channel);
	  			   }
			    setValue(\"Ch_HV_LV_Num\", \"items\", items_list);
		 	    //display the first item
			    setValue(\"Ch_HV_LV_Num\", \"selectedPos\", 1);
				
				//list of monitored parameters in Channels
				para_list = makeDynString(\"All\", \"LVchStat\", \"HVchStat\", \"LVch_Vcc\", \"LVps_Vcc\", \"LVretVcc\", \"LVch_Icc\", 
				\"LVch_Vdd\", \"LVps_Vdd\", \"LVretVdd\", \"LVch_Idd\", \"LVchVCSV\", \"LVchVCSI\", 
				\"LVchPINV\", \"LVchPINI\", \"MOch_Tm0\", \"MOch_Tm1\", \"HVchVolt\", \"HVchCurr\");
				
				setValue(\"Parameters\", \"items\", para_list);
				setValue(\"Parameters\", \"selectedPos\", 1);				
			break;						
		}
}" 0

E
 0 0
22 70
"Ch_HV_LV_Num"
""
1 262 20 E E E 1 E 1 E N "_WindowText" E N {255,255,255} E E
 E E
67 0 0 0 0 0
EE E
0
1
LANG:1 0 
0
1
LANG:1 105 -microsoft windows-Arial-bold-r-normal-*-*-110-100-100-*-*-iso8859-1|-12,0,0,0,700,0,0,0,0,3,2,1,34,Arial
0 ""
260 18 358 44
0
E
"main()
{
	string value;
	getValue(\"\", \"text\", value);
	
	if(value == \"M-N\")
	  {
	     setValue(\"\", \"text\", \" - \");
	  }
	else if(value == \"l,m,n...\")
	  {
	     setValue(\"\", \"text\", \" , \");
	  }
}" 0

E
 1 0
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