V 10
1
LANG:1 8 (NoName)
PANEL,256 167 823 606 N {255,255,255} 0
"main()
{
    int card, channel, crateNumbValue;
   string dpLVca_Stat, dpLV_Stat, dpVcc, dpVdd, dpHV_Mask, dpHV_Stat, dpVolt;
  
  //get the actual crate number
  dpGet(\"Crate.Numb:_original.._value\", crateNumbValue);
  
  // Card parameters 
  for(card=0; card<2; card++)
     {
        sprintf(dpLVca_Stat,\"Crate%02d.LV_card%02d.LVcaStat.Recv:_online.._value\", crateNumbValue, card);
        dpConnect(\"changeLVCardColor\", dpLVca_Stat);  
     }
     
  // Channel parameters      
  for(channel=0; channel<8; channel++)
     {              
        //connect color to LV stat
        sprintf(dpLV_Stat,\"Crate00.Channel%02d.LVchStat.Recv:_online.._value\", channel);
        sprintf(dpVcc,\"Crate00.Channel%02d.LVch_Vcc.Recv:_online.._value\", channel);
        sprintf(dpVdd,\"Crate00.Channel%02d.LVch_Vdd.Recv:_online.._value\",channel);
        dpConnect(\"changeLVChannelColor\", dpLV_Stat, dpVcc, dpVdd);  
        
        //connect color to HV stat
        sprintf(dpHV_Mask,\"Crate00.HV_card00.HVcaMask.Recv:_online.._value\"); 
        sprintf(dpHV_Stat,\"Crate00.Channel%02d.HVchStat.Recv:_online.._value\",  channel);
        sprintf(dpVolt,\"Crate00.Channel%02d.HVchVolt.Recv:_online.._value\",  channel);
        dpConnect(\"changeHVChannelColor\", dpHV_Mask, dpHV_Stat, dpVolt);    
     }
     
   // connect to new crate
   dpConnect(\"connectChangeColorAllChannel\", FALSE, \"Crate.Numb:_original.._value\");
}" 0
EE E E 1 -1 -1 0  50 580
"" 0 1
E"EP_childPanelOn()
{
   ChildPanelOnCentralModal(\"subpanels/ErrorMask.pnl\",\"\",makeDynString(\"\"));
}


Set_State(int iState, int crate, int cardtype) 
{
   dyn_errClass err;
   int i,j;
   int channel, ack, ackE;
   string cardname, datapoint, datapoint2, datapoint3;
   int terval = 5;
   int n_good =0;
   int fatal, expectedE;
   int start, stop;
   string systemName,cooling_state,cooling_status;
   

   // Must not ramp up if environmental alarm in progress
   // (ramp down is still allowed)
   if (iState>0) {
      dpGet(\"Fatl.Numb:_original.._value\",fatal);
      if(fatal!=0){
         dpSet(\"Info.Name:_original.._value\", \"Set_State: Request Denied due to Environment Alarm (code \"+fatal+\")\");
         DebugN(\"Set_State: Request Denied due to Environment Alarm (code \"+fatal+\")\");
         return;     
      }
   }
// same for SR cooling, commented out for Oxford
/*   if (iState>0) {
     systemName=getSystemName(40);
     dpGet(systemName +\"Cooling.State:_original.._value\",cooling_state);  
     dpGet(systemName +\"Cooling.Status:_original.._value\",cooling_status);        
     if(cooling_state!=\"Ready\"||cooling_status!=\"OK\"){
         dpSet(\"Info.Name:_original.._value\", \"Set_State: Request Denied due to Cooling Alarm (code \"+fatal+\")\");
         DebugN(\"Set_State: Request Denied due to Cooling Alarm (code \"+fatal+\")\");
         return;     
      }
   }
*/
   if (cardtype == 255) {
     // state transition for both LV and HV 
     // - can send single command
     start = 0;
     stop = 0;
     terval = 100;
     expectedE = 1;
     sprintf(cardname,\"LV and HV\"); 
   }else{
     // state transition for LV only or HV only
     // - must send 47 commands
     start = 0;
     stop = 47;
     terval = 5;
     expectedE = 0;
     if (cardtype == 64){
        sprintf(cardname,\"HV\");
     }else{
        sprintf(cardname,\"LV\");
     }
   }

   dpSet(\"Info.Name:_original.._value\", \"Set_State: Crate \"+crate+\" \"+cardname+\" to state \"+iState);

   sprintf(datapoint,\"Crate%02d.Controller.CCch_Set.Send:_original.._value\",crate);
   sprintf(datapoint2,\"Crate%02d.Controller.CCcf_Ack.Recv:_online.._value\",crate);
   sprintf(datapoint3,\"Crate%02d.Controller.CCcf_AckE.Recv:_online.._value\",crate);
     
   for (i=start;i<=stop;i++) {

      // Set channel
      channel = i+cardtype | (( iState & 0x00ff )<<8);
      dpSetWait(datapoint,channel);
 
      //Get Acknowledgement
      ack=-1;
      j=0;
      while ((ack!=channel)&&(j<200)) {
         delay(0,terval);
         dpGet(datapoint2,ack);
         j++;
      }
      dpGet(datapoint3,ackE);           

      // Report errors
      if (ack!=channel)  {
         dpSet(\"Info.Name:_original.._value\", \"Set_State: Timeout (channel \"+channel+\" ack \"+ack+\" ackE \"+ackE+\" after \"+(j*terval)+\"mS)\");
         DebugN(\"Set_State: Timeout (channel \"+channel+\" ack \"+ack+\" ackE \"+ackE+\" after\"+(j*terval)+\"mS)\");
      }else if (ackE!=expectedE) {
         dpSet(\"Info.Name:_original.._value\", \"Set_State: Error (channel \"+channel+\" ack \"+ack+\" ackE \"+ackE+\" after \"+(j*terval)+\"mS)\");
         DebugN(\"Set_State: Error (channel \"+channel+\" ack \"+ack+\" ackE \"+ackE+\" after\"+(j*terval)+\"mS)\");     
      } else {
         n_good++;
      }
   }
   
   if (cardtype==0) {
      DebugN(\"Set_State: \"+n_good+\" LV channels changed to state \"+iState);
   } else if (cardtype==64) {
      DebugN(\"Set_State: \"+n_good+\" HV channels changed to state \"+iState);
   }

   err = getLastError();
   if (dynlen(err) > 0)
      errorDialog(err);
}


/*
EP_childPanelOn(int channel)
{
string dpChannel;

dpSet(\"HVch.Numb:_original.._value\", channel);

  ChildPanelOnRelativ(\"subpanels/ValuesSmall.pnl\",
      \"ValuesSmall\",
      makeDynString(\"\"),
      0, 0);
      
}
*/

displayPopup(string objectName)
{
  int channel, iOldValue;
  dyn_string objSplit;
  
  
  //get channel number
  objSplit = strsplit(objectName, \"_\");
  
  sscanf(objSplit[2], \"Channel%d\", channel);
  DebugN(\"name\",objectName,\"type\",objSplit[1],\"channel\",objSplit[2],channel);

  //dpSet(\"HVch.Numb:_original.._value\", channel);

  dpGet(\"HVch.Numb:_online.._value\", iOldValue);
  dpSet(\"HVch.Indx:_original.._value\", iOldValue);
  
  dpGet(\"Crate.Numb:_online.._value\", iOldValue);
  dpSet(\"Crate.Indx:_original.._value\", iOldValue);
  
  dpSetWait(\"HVch.Numb:_original.._value\", channel);

  ChildPanelOnRelativ(\"subpanels/ValuesSmall.pnl\",
      \"ValuesSmall\",
      makeDynString(\"\"),
      0, 0);
      
}

connectChangeColorAllChannel(string crateNumbPath, int  crateNumbValue)
{
  int card, channel, oldCrate;
  string dpLVca_Stat, dpLV_Stat, dpVcc, dpVdd, dpHV_Mask, dpHV_Stat, dpVolt;
  
  //get the old crate number
  dpGet(\"Crate.Indx:_original.._value\", oldCrate);
 
  // Card parameters 
  for(card=0; card<12; card++)
     {
        //1) disconnect old crate
        sprintf(dpLVca_Stat,\"Crate%02d.LV_card%02d.LVcaStat.Recv:_online.._value\", oldCrate, card);
        dpDisconnect(\"changeLVCardColor\", dpLVca_Stat); 
        
        //2) connect to new crate
        sprintf(dpLVca_Stat,\"Crate%02d.LV_card%02d.LVcaStat.Recv:_online.._value\", crateNumbValue, card);
        dpConnect(\"changeLVCardColor\", dpLVca_Stat);  
     }
     
  // Channel parameters
  for(channel=0; channel<48; channel++)
     {
        //1) disconnect old crate
        //first for LV Channels
        sprintf(dpLV_Stat,\"Crate%02d.Channel%02d.LVchStat.Recv:_online.._value\", oldCrate, channel);
        sprintf(dpVcc,\"Crate%02d.Channel%02d.LVch_Vcc.Recv:_online.._value\", oldCrate, channel);
        sprintf(dpVdd,\"Crate%02d.Channel%02d.LVch_Vdd.Recv:_online.._value\", oldCrate, channel);
        //disconnect color to LV stat
        dpDisconnect(\"changeLVChannelColor\", dpLV_Stat, dpVcc, dpVdd); 
        //second for HV channels
        sprintf(dpHV_Mask,\"Crate%02d.HV_card%02d.HVcaMask.Recv:_online.._value\", oldCrate, (channel/8)); 
        sprintf(dpHV_Stat,\"Crate%02d.Channel%02d.HVchStat.Recv:_online.._value\", oldCrate, channel);
        sprintf(dpVolt,\"Crate%02d.Channel%02d.HVchVolt.Recv:_online.._value\", oldCrate, channel);
        //disconnect color to HV stat
        dpDisconnect(\"changeHVChannelColor\", dpHV_Mask, dpHV_Stat, dpVolt);
        
        //2) connect to new crate
        sprintf(dpLV_Stat,\"Crate%02d.Channel%02d.LVchStat.Recv:_online.._value\", crateNumbValue, channel);
        sprintf(dpVcc,\"Crate%02d.Channel%02d.LVch_Vcc.Recv:_online.._value\", crateNumbValue, channel);
        sprintf(dpVdd,\"Crate%02d.Channel%02d.LVch_Vdd.Recv:_online.._value\", crateNumbValue,channel);
        //dconnect color to LV stat
        dpConnect(\"changeLVChannelColor\", dpLV_Stat, dpVcc, dpVdd);  
        
        //connect color to HV stat
        sprintf(dpHV_Mask,\"Crate%02d.HV_card%02d.HVcaMask.Recv:_online.._value\", crateNumbValue, (channel/8)); 
        sprintf(dpHV_Stat,\"Crate%02d.Channel%02d.HVchStat.Recv:_online.._value\", crateNumbValue, channel);
        sprintf(dpVolt,\"Crate%02d.Channel%02d.HVchVolt.Recv:_online.._value\", crateNumbValue, channel);
        dpConnect(\"changeHVChannelColor\", dpHV_Mask, dpHV_Stat, dpVolt);    
     }
}

changeLVCardColor(string dpStatPath, int dpStatValue)
{
  int card;
  dyn_string dpeSplit;
  
  dpeSplit = strsplit(dpStatPath, \".\");
  //get channel number
  sscanf(dpeSplit[2], \"LV_card%d\", card);

  // set default colour to Black
  setValue(\"LV_Card\"+card, \"backCol\", \"Black\");
  
  if(dpStatValue & 0x3f){             // ERROR
    setValue(\"LV_Card\"+card, \"backCol\", \"Red\");
  }
}

changeLVChannelColor(string dpStatPath, int dpStatValue, string dpVccPath, float dpVccValue,
                   string dpVddPath, float dpVddValue)
{
  int channel;
  dyn_string dpeSplit;
  
  dpeSplit = strsplit(dpStatPath, \".\");
  //get channel number
  sscanf(dpeSplit[2], \"Channel%d\", channel);

  // set default colour to Yellow
  // - will be shown if channel output ON but volts less than nominal
  setValue(\"LV_Channel\"+channel, \"backCol\", \"Yellow\");

  
  if(((dpStatValue & 0x80)==0) && !(dpStatValue & 0x20)){        // mask OFF if not failed
    setValue(\"LV_Channel\"+channel, \"backCol\", \"Black\");
  }else if(dpStatValue & 0x20){       // channel FAIL
    setValue(\"LV_Channel\"+channel, \"backCol\", \"Red\");
  }else if((dpStatValue & 0x40)==0){  // output OFF
    setValue(\"LV_Channel\"+channel, \"backCol\", \"White\");
  }else if ((dpVccValue > 3.2) && (dpVddValue > 3.7)){  // OK
    setValue(\"LV_Channel\"+channel, \"backCol\", \"Green\");
  }
}

changeHVChannelColor(string dpMaskPath, int dpMaskValue, string dpStatPath, int dpStatValue,
                   string dpVccPath, float dpHvoltValue)
{
  int channel;
  dyn_string dpeSplit;
  
  dpeSplit = strsplit(dpStatPath, \".\");
  //get channel number
  sscanf(dpeSplit[2], \"Channel%d\", channel);
  // by default set colour WHITE
  setValue(\"HV_Channel\"+channel, \"backCol\", \"White\");

  // OLD code   

  // First Check STATUS byte for fail conditions
//  if(dpStatValue & 0x08){        // OFF
//    setValue(\"HV_Channel\"+channel, \"backCol\", \"Black\");
//  }
//  else if (dpStatValue & 0xC0){  // TRIP!!
//    setValue(\"HV_Channel\"+channel, \"backCol\", \"Red\");
//  }
//  else if(dpStatValue & 0x10){   // ramping
//    setValue(\"HV_Channel\"+channel, \"backCol\", \"Yellow\");
//  }
//  // Finally show channel status as OK if volts are ON
//  else if (dpHvoltValue>19.0){    // Channel ON above 20V
//    setValue(\"HV_Channel\"+channel, \"backCol\", \"Green\");
//  }
  
  // NEW code
   
  // First Check STATUS byte for fail conditions
  if((dpMaskValue & (0x01<<(channel%8)) )== 0){        // OFF
    setValue(\"HV_Channel\"+channel, \"backCol\", \"Black\");
  }else{
    setValue(\"HV_Channel\"+channel, \"backCol\", \"White\");
  
    if (dpStatValue & 0xC0){  // TRIP!!
      setValue(\"HV_Channel\"+channel, \"backCol\", \"Red\");
    }
    else if(dpStatValue & 0x10){   // ramping
      setValue(\"HV_Channel\"+channel, \"backCol\", \"Yellow\");
    }
    // Finally show channel status as OK if volts are ON
    else if (dpHvoltValue>19.0){    // Channel ON above 20V
      setValue(\"HV_Channel\"+channel, \"backCol\", \"Green\");
    }
  }
}
" 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
6 144
"Border3"
""
1 372 338 E E E 1 E 1 E N {0,0,0} E N {255,51,51} E E
 E E
143 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 372 318 402 338
2 145
"Text2"
""
1 408 319 E E E 1 E 1 E N {0,0,0} E N "_Transparent" E E
 E E
144 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  0 E 410 321 436 342
0 2 0 "s" 0 0 0 64 0 0  410 321
 1
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 ""
1
LANG:1 4 TRIP
6 146
"Border4"
""
1 370 257 E E E 1 E 1 E N {0,0,0} E N {255,255,102} E E
 E E
145 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 370 237 400 257
6 0
"Border1"
""
1 263 530 E E E 1 E 1 E N {0,0,0} E N {204,204,204} E E
 E E
1 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 263 151 293 530
2 147
"Text3"
""
1 408 228 E E E 1 E 1 E N {0,0,0} E N "_Transparent" E E
 E E
146 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  0 E 410 230 488 246
0 2 0 "s" 0 0 0 64 0 0  410 230
 1
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 ""
1
LANG:1 14 LV - low volts
6 148
"Border5"
""
1 370 218 E E E 1 E 1 E N {0,0,0} E N {255,255,255} E E
 E E
147 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 370 198 400 218
2 149
"Text4"
""
1 408 198 E E E 1 E 1 E N {0,0,0} E N "_Transparent" E E
 E E
148 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  0 E 410 200 470 212
0 2 0 "s" 0 0 0 64 0 0  410 200
 1
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 ""
1
LANG:1 7 MASK ON
6 17
"Border18"
""
1 402 585 E E E 1 E 1 E N {0,0,0} E N {204,204,204} E E
 E E
18 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 322 151 353 530
6 16
"Border17"
""
1 317 557 E E E 1 E 1 E N {0,0,0} E N {255,102,102} E E
 E E
17 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 293 151 323 530
7 155
"LV_Channel4"
""
1 338 314 E E E 1 E 1 E N {0,0,0} E N {255,255,255} E E
 E "main()
{
  shape this = getShape(\"\");
  displayPopup(this.name);
}" 0

154 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 338 314 10 10
7 156
"LV_Channel5"
""
1 358 332 E E E 1 E 1 E N {0,0,0} E N {255,255,255} E E
 E "main()
{
  shape this = getShape(\"\");
  displayPopup(this.name);
}" 0

155 0 0 0 0 0
E"
" 0
 E
0
1
LANG:1 0 
1
"dashclr"N "_Transparent"
E E 0 1 1 0 1 E U  1 E 338 271 10 10
7 157
"LV_Channel6"
""
1 378 451 E E E 1 E 1 E N {0,0,0} E N {255,255,255} E E
 E "main()
{
  shape this = getShape(\"\");
  displayPopup(this.name);
}" 0

156 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 338 230 10 10
7 158
"LV_Channel7"
""
1 398 671 E E E 1 E 1 E N {0,0,0} E N {255,255,255} E E
 E "main()
{
  shape this = getShape(\"\");
  displayPopup(this.name);
}" 0

157 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 338 190 10 10
7 273
"LV_Channel0"
""
1 298 541 E E E 1 E 1 E N {0,0,0} E N {255,255,255} E E
 E "main()
{
  shape this = getShape(\"\");
  displayPopup(this.name);
}" 0

267 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 278 480 10 10
2 275
"Text5"
""
1 268 489 E E E 1 E 1 E N {0,0,0} E N "_Transparent" E E
 E E
269 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  0 E 270 491 361 509
0 2 0 "s" 0 0 0 64 0 0  270 491
 1
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 ""
1
LANG:1 29 0       0                    
2 286
"Text10"
""
1 274 908 E E E 1 E 1 E N {0,0,0} E N "_Transparent" E E
 E E
280 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  0 E 270 448 391 469
0 2 0 "s" 0 0 0 64 0 0  270 448
 1
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 ""
1
LANG:1 28 1       1                   
2 287
"Text11"
""
1 286 1349 E E E 1 E 1 E N {0,0,0} E N "_Transparent" E E
 E E
281 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  0 E 272 406 421 429
0 2 0 "s" 0 0 0 64 0 0  272 406
 1
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 ""
1
LANG:1 28 2       2                   
2 290
"Text14"
""
1 311 1359 E E E 1 E 1 E N {0,0,0} E N "_Transparent" E E
 E E
284 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  0 E 301 322 371 339
0 2 0 "s" 0 0 0 64 0 0  301 322
 1
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 ""
1
LANG:1 28 4       4                   
2 291
"Text15"
""
1 318 2189 E E E 1 E 1 E N {0,0,0} E N "_Transparent" E E
 E E
285 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  0 E 301 281 371 309
0 2 0 "s" 0 0 0 64 0 0  301 281
 1
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 ""
1
LANG:1 30 5       5                     
2 292
"Text16"
""
1 334 1797 E E E 1 E 1 E N {0,0,0} E N "_Transparent" E E
 E E
286 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  0 E 301 240 391 259
0 2 0 "s" 0 0 0 64 0 0  301 240
 1
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 ""
1
LANG:1 26 6       6                 
2 293
"Text17"
""
1 319 1824 E E E 1 E 1 E N {0,0,0} E N "_Transparent" E E
 E E
287 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  0 E 301 199 351 219
0 2 0 "s" 0 0 0 64 0 0  301 199
 1
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 ""
1
LANG:1 25 7       7                
6 294
"Border2"
""
1 370 178 E E E 1 E 1 E N {0,0,0} E N {0,0,0} E E
 E E
288 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 370 158 400 178
2 295
"Text1"
""
1 407 158 E E E 1 E 1 E N {0,0,0} E N "_Transparent" E E
 E E
289 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  0 E 409 160 480 181
0 2 0 "s" 0 0 0 64 0 0  409 160
 1
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 ""
1
LANG:1 8 MASK OFF
6 296
"Border8"
""
1 371 298 E E E 1 E 1 E N {0,0,0} E N {0,255,0} E E
 E E
290 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 371 278 401 298
2 297
"Text7"
""
1 410 278 E E E 1 E 1 E N {0,0,0} E N "_Transparent" E E
 E E
291 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  0 E 412 280 438 296
0 2 0 "s" 0 0 0 64 0 0  412 280
 1
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 ""
1
LANG:1 2 OK
2 299
"Text6"
""
1 1143 806 E E E 1 E 1 E N {0,0,0} E N "_Transparent" E E
 E E
293 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  0 E 252 130 391 149
0 2 0 "s" 0 0 0 64 0 0  252 130
 1
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 ""
1
LANG:1 22    LV0    HV0  LV1    
2 349
"Text13"
""
1 289 1351 E E E 1 E 1 E N {0,0,0} E N "_Transparent" E E
 E E
342 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  0 E 271 363 391 379
0 2 0 "s" 0 0 0 64 0 0  271 363
 1
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 ""
1
LANG:1 29 3       3                    
7 350
"HV_Channel0"
""
1 307 482 E E E 1 E 1 E N {0,0,0} E N {255,255,255} E E
 E "main()
{
 shape this = getShape(\"\");
  displayPopup(this.name);
}" 0

343 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 307 482 10 10
7 351
"HV_Channel7"
""
1 307 189 E E E 1 E 1 E N {0,0,0} E N {255,255,255} E E
 E "main()
{
  shape this = getShape(\"\");
  displayPopup(this.name);
}" 0

344 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 307 189 10 10
7 352
"HV_Channel5"
""
1 307 270 E E E 1 E 1 E N {0,0,0} E N {255,255,255} E E
 E "main()
{
  shape this = getShape(\"\");
  displayPopup(this.name);
}" 0

345 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 307 270 10 10
7 353
"HV_Channel4"
""
1 307 313 E E E 1 E 1 E N {0,0,0} E N {255,255,255} E E
 E "main()
{
  shape this = getShape(\"\");
  displayPopup(this.name);
}" 0

346 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 307 313 10 10
7 354
"HV_Channel3"
""
1 307 353 E E E 1 E 1 E N {0,0,0} E N {255,255,255} E E
 E "main()
{
  shape this = getShape(\"\");
  displayPopup(this.name);
}" 0

347 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 307 353 10 10
7 355
"HV_Channel2"
""
1 307 393 E E E 1 E 1 E N {0,0,0} E N {255,255,255} E E
 E "main()
{
 shape this = getShape(\"\");
  displayPopup(this.name);
}" 0

348 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 307 393 10 10
7 356
"HV_Channel1"
""
1 307 438 E E E 1 E 1 E N {0,0,0} E N {255,255,255} E E
 E "main()
{
 shape this = getShape(\"\");
  displayPopup(this.name);
}" 0

349 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 307 438 10 10
7 357
"LV_Channel1"
""
1 297 498 E E E 1 E 1 E N {0,0,0} E N {255,255,255} E E
 E "main()
{
  shape this = getShape(\"\");
  DebugN (this.name);
  displayPopup(this.name);
}" 0

350 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 277 437 10 10
7 358
"LV_Channel2"
""
1 317 616 E E E 1 E 1 E N {0,0,0} E N {255,255,255} E E
 E "main()
{
  shape this = getShape(\"\");
  displayPopup(this.name);
}" 0

351 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 277 395 10 10
7 359
"LV_Channel3"
""
1 337 834 E E E 1 E 1 E N {0,0,0} E N {255,255,255} E E
 E "main()
{
  shape this = getShape(\"\");
  displayPopup(this.name);
}" 0

352 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 277 353 10 10
7 360
"HV_Channel6"
""
1 307 230 E E E 1 E 1 E N {0,0,0} E N {255,255,255} E E
 E "main()
{
  shape this = getShape(\"\");
  displayPopup(this.name);
}" 0

353 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 307 230 10 10
2 363
"Text9"
""
1 408 247 E E E 1 E 1 E N {0,0,0} E N "_Transparent" E E
 E E
356 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  0 E 410 249 487 266
0 2 0 "s" 0 0 0 64 0 0  410 249
 1
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 ""
1
LANG:1 11 HV -RAMPING
7 364
"LV_Card0"
""
1 288 191 E E E 1 E 1 E N {0,0,0} E N {255,255,255} E E
 E "main()
{
  shape this = getShape(\"\");
  displayPopup(this.name);
}" 0

357 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 278 161 5 5
7 365
"LV_Card1"
""
1 348 191 E E E 1 E 1 E N {0,0,0} E N {255,255,255} E E
 E "main()
{
  shape this = getShape(\"\");
  displayPopup(this.name);
}" 0

358 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 338 161 5 5
2 376
"Text8"
""
1 1582 905 E E E 1 E 1 E N {0,0,0} E N "_Transparent" E E
 E E
369 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  0 E 272 22 478 48
0 2 0 "s" 0 0 0 64 0 0  272 22
 1
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 ""
1
LANG:1 18 TESTBEAM SCT PANEL
6 378
"Border6"
""
1 30 488 E E E 1 E 1 E N {0,0,0} E N {255,255,255} E E
 E E
371 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 30 158 230 488
2 379
"Text12"
""
1 30 158 E E E 1 E 1 E N {0,0,0} E N {255,255,255} E E
 E E
372 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 32 160 228 181
1 2 0 "s" 0 0 0 65 0 0  32 160
 1
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 ""
1
LANG:1 18 One Crate Controll
2 380
"Text18"
""
1 30 419 E E E 1 E 1 E N {0,0,0} E N {255,255,255} E E
 E E
373 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 32 421 228 442
1 2 0 "s" 0 0 0 65 0 0  32 421
 1
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 ""
1
LANG:1 14 One Crate Mask
6 393
"Border7"
""
1 20 580 E E E 1 E 1 E N "_WindowText" E N "_Transparent" E E
 E E
386 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  0 E 20 50 520 580
2 394
"Text19"
""
1 1492 945 E E E 1 E 1 E N {0,0,0} E N "_Transparent" E E
 E E
387 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  0 E 182 62 388 88
0 2 0 "s" 0 0 0 64 0 0  182 62
 1
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 ""
1
LANG:1 18 SCT Power Supplies
6 400
"Border9"
""
1 520 380 E E E 1 E 1 E N "_WindowText" E N "_Transparent" E E
 E E
393 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  0 E 520 50 810 380
2 401
"Text22"
""
1 1902 945 E E E 1 E 1 E N {0,0,0} E N "_Transparent" E E
 E E
394 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  0 E 592 62 798 88
0 2 0 "s" 0 0 0 64 0 0  592 62
 1
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 ""
1
LANG:1 17 SCT Environmental
2 402
"Text23"
""
1 1872 1275 E E E 1 E 1 E N {0,0,0} E N "_Transparent" E E
 E E
395 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  0 E 562 392 768 418
0 2 0 "s" 0 0 0 64 0 0  562 392
 1
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 ""
1
LANG:1 13 Communication
2 406
"Text20"
""
1 560 111 E E E 1 E 1 E N {0,0,0} E N "_Transparent" E E
 E E
399 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  0 E 562 113 599 128
0 2 0 "s" 0 0 0 192 0 0  562 113
 1
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 ""
1
LANG:1 6 Status
2 407
"Text21"
""
1 667 111 E E E 1 E 1 E N {0,0,0} E N {255,255,255} E E
 E E
400 0 0 0 0 0
EE E
0
1
LANG:1 0 
1
"dashclr"N "_Transparent"
"// SimpleCtrlScriptStart {invalid}

// Revised PWP 20.07.2004
// - Will ramp down up to 88 crates, if the relevant datapoints exist
// - Actions are logged to the info bar and to the local table

main()
{
  EP_textFieldIn();
}

EP_textFieldIn()
{
dyn_errClass err;

  if( dpSubStr( \"Monitoring.Crate_Ramp_Off:_original\", DPSUB_DP_EL ) == \"\" )
  {
    setValue(\"\", \"color\", \"_dpdoesnotexist\");
    return;
  }

//dpconnect to environmental project datapoint
  dpConnect(\"EP_textFieldInCB\", \"Fatl.Numb:_original.._value\");

  err = getLastError();
  if (dynlen(err) > 0){
      setValue(\"\", \"color\", \"_dpdoesnotexist\");
   }

}


EP_textFieldInCB(string dp1, int code)
{
   string message;
   
   // sending back confirmation to environmental, necessary for Acknowledgement
   dpSet(\"Fatl.Indx:_original.._value\",code);

   if ( code>0 ) {
 	 sprintf(message, \"Alarm (code %d)\",code);
 	 EP_logger(message);
 	 
	 setValue( \"\", \"text\", \"RAMPDOWN\" );
	 setValue( \"\", \"backCol\", \"alarmKamUnq\" );
	 EP_childPanelOn();
	 EP_sendPDO();
   }
	
   if ( code==0 ) {
      EP_logger(\"All Clear\");
      
      setValue( \"\", \"text\", \"OK\" );
      setValue( \"\", \"backCol\", \"Green\" );
   }
}


EP_childPanelOn()
{
 ChildPanelOnCentralModal(\"subpanels\\\\Environmental_Error.pnl\",
      \"Environmental Error\",
      makeDynString(\"\"));
}


EP_sendPDO()
{
   dyn_errClass err;
   int crate, n_off,channel;
   string datapoint, message;

   n_off = 0;
   
   for(crate=0;crate<=88;crate++) {
      sprintf(datapoint,\"Crate%02d.Controller.CCch_Set.Send:_original.._value\",crate);
      if(dpExists(datapoint)){
        channel = 255| (( 0 & 0x00ff )<<8); // all channels OFF
 //       channel=255;
	      dpSetWait(datapoint,channel);
        n_off++;
      }
   }
   
   sprintf(message, \"Rampdown %d crates\", n_off);
   EP_logger(message);
   
   err = getLastError();
   if (dynlen(err) > 0) {
	  errorDialog(err);
   }
}

EP_logger(string message){

   int row,col;
   time t;
   string tim;
  
   t=getCurrentTime();
   tim=formatTime(\"%H:%M:%S\", t);
   
   getValue(\"Table1\", \"currentCell\", row, col);
   setValue(\"Table1\", \"appendLine\", row, \"#1\", tim, \"#2\",message);
   
   dpSet(\"Info.Name:_original.._value\", \"Environmental Alarm: \"+message);
}
// SimpleCtrlScript {EP_textFieldIn}
// DP {Monitoring.Crate_Ramp_Off}
// DPConfig {:_original.._value}
// DPType {bool}
// UseDPUnit {TRUE}
// UseDPFormat {TRUE}
// SimpleCtrlScriptEnd {EP_textFieldIn}
" 0
 E 0 1 1 0 1 E U  1 E 669 113 735 129
1 2 0 "s" 0 0 0 64 0 0  669 113
 1
1
LANG:1 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 ""
1
LANG:1 5 Text4
2 408
"Text24"
""
1 609 90 E E E 1 E 1 E N {0,0,0} E N "_Transparent" E E
 E E
401 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  0 E 611 92 692 107
0 2 0 "s" 0 0 0 192 0 0  611 92
 1
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 ""
1
LANG:1 13 Environmental
2 410
"Text25"
""
1 564 134 E E E 1 E 1 E N {0,0,0} E N "_Transparent" E E
 E E
403 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  0 E 566 136 596 151
0 2 0 "s" 0 0 0 192 0 0  566 136
 1
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 ""
1
LANG:1 5 State
2 411
"Text26"
""
1 667 134 E E E 1 E 1 E N {0,0,0} E N {255,255,255} E E
 E E
404 0 0 0 0 0
EE E
0
1
LANG:1 0 
1
"dashclr"N "_Transparent"
"// SimpleCtrlScriptStart {invalid}

// Revised PWP 20.07.2004
// - Will ramp down up to 88 crates, if the relevant datapoints exist
// - Actions are logged to the info bar and to the local table

main()
{
  EP_textFieldIn();
}

EP_textFieldIn()
{
dyn_errClass err;

  if( dpSubStr( \"Monitoring.Crate_Ramp_Off:_original\", DPSUB_DP_EL ) == \"\" )
  {
    setValue(\"\", \"color\", \"_dpdoesnotexist\");
    return;
  }

//dpconnect to environmental project datapoint
  dpConnect(\"EP_textFieldInCB\", \"Fatl.Numb:_original.._value\");

  err = getLastError();
  if (dynlen(err) > 0){
      setValue(\"\", \"color\", \"_dpdoesnotexist\");
   }

}


EP_textFieldInCB(string dp1, int code)
{
   string message;
   
   // sending back confirmation to environmental, necessary for Acknowledgement
   dpSet(\"Fatl.Indx:_original.._value\",code);

   if ( code>0 ) {
 	 sprintf(message, \"Alarm (code %d)\",code);
 	 EP_logger(message);
 	 
	 setValue( \"\", \"text\", \"RAMPDOWN\" );
	 setValue( \"\", \"backCol\", \"alarmKamUnq\" );
	 EP_childPanelOn();
	 EP_sendPDO();
   }
	
   if ( code==0 ) {
      EP_logger(\"All Clear\");
      
      setValue( \"\", \"text\", \"OK\" );
      setValue( \"\", \"backCol\", \"Green\" );
   }
}


EP_childPanelOn()
{
 ChildPanelOnCentralModal(\"subpanels\\\\Environmental_Error.pnl\",
      \"Environmental Error\",
      makeDynString(\"\"));
}


EP_sendPDO()
{
   dyn_errClass err;
   int crate, n_off,channel;
   string datapoint, message;

   n_off = 0;
   
   for(crate=0;crate<=88;crate++) {
      sprintf(datapoint,\"Crate%02d.Controller.CCch_Set.Send:_original.._value\",crate);
      if(dpExists(datapoint)){
        channel = 255| (( 0 & 0x00ff )<<8); // all channels OFF
 //       channel=255;
	      dpSetWait(datapoint,channel);
        n_off++;
      }
   }
   
   sprintf(message, \"Rampdown %d crates\", n_off);
   EP_logger(message);
   
   err = getLastError();
   if (dynlen(err) > 0) {
	  errorDialog(err);
   }
}

EP_logger(string message){

   int row,col;
   time t;
   string tim;
  
   t=getCurrentTime();
   tim=formatTime(\"%H:%M:%S\", t);
   
   getValue(\"Table1\", \"currentCell\", row, col);
   setValue(\"Table1\", \"appendLine\", row, \"#1\", tim, \"#2\",message);
   
   dpSet(\"Info.Name:_original.._value\", \"Environmental Alarm: \"+message);
}
// SimpleCtrlScript {EP_textFieldIn}
// DP {Monitoring.Crate_Ramp_Off}
// DPConfig {:_original.._value}
// DPType {bool}
// UseDPUnit {TRUE}
// UseDPFormat {TRUE}
// SimpleCtrlScriptEnd {EP_textFieldIn}
" 0
 E 0 1 1 0 1 E U  1 E 669 136 735 152
1 2 0 "s" 0 0 0 64 0 0  669 136
 1
1
LANG:1 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 ""
1
LANG:1 5 Text4
13 381
"Button5"
""
1 40 188 E E E 1 E 1 E N {0,0,0} E N {153,204,255} E E
 E E
374 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 ""
38 186 132 220
T 
1
LANG:1 9 ON ALL HV
"// SimpleCtrlScriptStart {invalid}
main()
{
   int iState, crate, cardtype;
 
   setValue(\"\", \"backCol\", \"Red\");
   iState=1;
   cardtype=64;
   
   dpGet(\"Crate.Numb:_original.._value\", crate);  
   Set_State(iState, crate, cardtype); 
 
   setValue(\"\", \"backCol\", \"{153,204,255}\");
}


// SimpleCtrlScript {EP_setDP}
// DP1 {Crate1.HVchRamp}
// Config1 {:_original.._value}
// Type1 {int}
// Value1 {1}
// SimpleCtrlScriptEnd {EP_setDP}
" 0
 E E E
13 382
"ReadCard"
""
1 988 308 E E E 1 E 1 E N {255,255,255} E N {102,102,255} E E
 E E
375 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 ""
38 276 222 310
T 
1
LANG:1 4 READ
"// SimpleCtrlScriptStart {invalid}

main()
{
  EP_setDP();
}

EP_setDP()
{
dyn_errClass err;
int crate,channel, i;
string datapoint;

dpGet(\"Crate.Numb:_original.._value\",crate);
sprintf(datapoint,\"Crate%02d.Controller.CCchRead.Send:_original.._value\", crate);
for (i=0;i<=47;i++){
channel=i+64;
dpSetWait(datapoint, channel);
dpSetWait(datapoint,i);
delay(0,10);
  err = getLastError();
  if (dynlen(err) > 0)
    errorDialog(err);
 }
}

// SimpleCtrlScript {EP_setDP}
// DP1 {Crate00.Controller.CCco_Set}
// Config1 {:_original.._value}
// Type1 {int}
// Value1 {1}
// SimpleCtrlScriptEnd {EP_setDP}
" 0
 E E E
13 383
"Button1"
""
1 94 658 E E E 1 E 1 E N {0,0,0} E N {153,204,255} E E
 E E
376 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 ""
38 446 132 480
T 
1
LANG:1 12 ALL MASKS ON
"// SimpleCtrlScriptStart {invalid}
main()
{
  EP_setDP();
}

EP_setDP()
{
dyn_errClass err;
int i;
string datapoint;
int crate;


dpGet(\"Crate.Numb:original.._value\",crate);
 for (i=0;i<=5;i++)
  {
  sprintf(datapoint, \"Crate%02d.HV_card%02d.HVcaMask.Send:_original.._value\",crate,i);

  dpSetWait(datapoint, 255);
  }
 for (i=0;i<=11;i++)
  {
  sprintf(datapoint, \"Crate%02d.LV_card%02d.LVcaMask.Send:_original.._value\",crate,i);

  dpSetWait(datapoint, 15);
  }

err = getLastError();
if (dynlen(err) > 0)
errorDialog(err);  

//DebugN(\"Mask on...\");
dpSet(\"Info.Name:_original.._value\", \"Mask on...\");     
  
}

// SimpleCtrlScript {EP_setDP}
// DP1 {Crate1.HVchRamp}
// Config1 {:_original.._value}
// Type1 {int}
// Value1 {1}
// SimpleCtrlScriptEnd {EP_setDP}
" 0
 E E E
13 384
"AllMasksOff"
""
1 203 978 E E E 1 E 1 E N {0,0,0} E N {153,204,255} E E
 E E
377 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 ""
128 446 222 480
T 
1
LANG:1 12 ALL MSKS OFF
"// SimpleCtrlScriptStart {invalid}
main()
{
  EP_setDP();
}

EP_setDP()
{
dyn_errClass err;
int i;
string datapoint;
int crate,volt ;
int flag;

flag=0;
dpGet(\"Crate.Numb:original.._value\",crate);
 for (i=0;i<=47;i++)
   {
   sprintf(datapoint,\"Crate%02d.Channel%02d.HVchVolt.Recv:_online.._value\",crate,i);
   dpGet(datapoint,volt);
   if(volt>10) flag=1;
   }
  if(flag==0)
  {
    for (i=0;i<=5;i++)
      {
      sprintf(datapoint, \"Crate%02d.HV_card%02d.HVcaMask.Send:_original.._value\",crate,i);
      //DebugN(datapoint,i);
      dpSetWait(datapoint, 0);
      }
    for (i=0;i<=11;i++)
      {
      sprintf(datapoint, \"Crate%02d.LV_card%02d.LVcaMask.Send:_original.._value\",crate,i);
      //DebugN(datapoint,i);
      dpSetWait(datapoint, 0);
      }
  }
  else 
  {
   ChildPanelOnCentral(\"realmask.pnl\", \"realmask\", \"\");
  } 

err = getLastError();
if (dynlen(err) > 0)
errorDialog(err); 

dpSet(\"Info.Name:_original.._value\", \"Mask off...\");        
  
}




// SimpleCtrlScript {EP_setDP}
// DP1 {Crate1.HVchRamp}
// Config1 {:_original.._value}
// Type1 {int}
// Value1 {1}
// SimpleCtrlScriptEnd {EP_setDP}
" 0
 E E E
13 385
"Button9"
""
1 40 218 E E E 1 E 1 E N {0,0,0} E N {153,204,255} E E
 E E
378 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 ""
38 216 132 250
T 
1
LANG:1 12 STNBY ALL HV
"// SimpleCtrlScriptStart {invalid}
main()
{
   int iState, crate, cardtype;
 
   setValue(\"\", \"backCol\", \"Red\");
   iState=2;
   cardtype=64;
   
   dpGet(\"Crate.Numb:_original.._value\", crate);  
   Set_State(iState, crate, cardtype); 
 
   setValue(\"\", \"backCol\", \"{153,204,255}\");
}

// SimpleCtrlScript {EP_setDP}
// DP1 {Crate1.HVchRamp}
// Config1 {:_original.._value}
// Type1 {int}
// Value1 {1}
// SimpleCtrlScriptEnd {EP_setDP}
" 0
 E E E
13 386
"Button12"
""
1 40 248 E E E 1 E 1 E N {0,0,0} E N {153,204,255} E E
 E E
379 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 ""
38 246 132 280
T 
1
LANG:1 10 OFF ALL HV
"// SimpleCtrlScriptStart {invalid}
main()
{
   int iState, crate, cardtype;
 
   setValue(\"\", \"backCol\", \"Red\");
   iState=0;
   cardtype=64;
   
   dpGet(\"Crate.Numb:_original.._value\", crate);  
   Set_State(iState, crate, cardtype); 
 
   setValue(\"\", \"backCol\", \"{153,204,255}\");
}

// SimpleCtrlScript {EP_setDP}
// DP1 {Crate1.HVchRamp}
// Config1 {:_original.._value}
// Type1 {int}
// Value1 {1}
// SimpleCtrlScriptEnd {EP_setDP}
" 0
 E E E
13 387
"Button2"
""
1 130 188 E E E 1 E 1 E N {0,0,0} E N {153,204,255} E E
 E E
380 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 ""
128 186 222 220
T 
1
LANG:1 9 ON ALL LV
"// SimpleCtrlScriptStart {invalid}
main()
{
   int iState, crate, cardtype;
 
   setValue(\"\", \"backCol\", \"Red\");
   iState=1;
   cardtype=0;
   
   dpGet(\"Crate.Numb:_original.._value\", crate);  
   Set_State(iState, crate, cardtype); 
 
   setValue(\"\", \"backCol\", \"{153,204,255}\");
}
// SimpleCtrlScript {EP_setDP}
// DP1 {Crate1.HVchRamp}
// Config1 {:_original.._value}
// Type1 {int}
// Value1 {1}
// SimpleCtrlScriptEnd {EP_setDP}
" 0
 E E E
13 388
"Button3"
""
1 130 218 E E E 1 E 1 E N {0,0,0} E N {153,204,255} E E
 E E
381 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 ""
128 216 222 250
T 
1
LANG:1 12 STNBY ALL LV
"// SimpleCtrlScriptStart {invalid}
main()
{
   int iState, crate, cardtype;
 
   setValue(\"\", \"backCol\", \"Red\");
   iState=2;
   cardtype=0;
   
   dpGet(\"Crate.Numb:_original.._value\", crate);  
   Set_State(iState, crate, cardtype); 
 
   setValue(\"\", \"backCol\", \"{153,204,255}\");
}
// SimpleCtrlScript {EP_setDP}
// DP1 {Crate1.HVchRamp}
// Config1 {:_original.._value}
// Type1 {int}
// Value1 {1}
// SimpleCtrlScriptEnd {EP_setDP}
" 0
 E E E
13 389
"Button4"
""
1 130 248 E E E 1 E 1 E N {0,0,0} E N {153,204,255} E E
 E E
382 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 ""
128 246 222 280
T 
1
LANG:1 10 OFF ALL LV
"// SimpleCtrlScriptStart {invalid}
main()
{
   int iState, crate, cardtype;
 
   setValue(\"\", \"backCol\", \"Red\");
   iState=0;
   cardtype=0;
   
   dpGet(\"Crate.Numb:_original.._value\", crate);  
   Set_State(iState, crate, cardtype); 
 
   setValue(\"\", \"backCol\", \"{153,204,255}\");
}
// SimpleCtrlScript {EP_setDP}
// DP1 {Crate1.HVchRamp}
// Config1 {:_original.._value}
// Type1 {int}
// Value1 {1}
// SimpleCtrlScriptEnd {EP_setDP}
" 0
 E E E
13 390
"Button6"
""
1 80 318 E E E 1 E 1 E N {0,0,0} E N {153,204,255} E E
 E E
383 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 ""
78 316 192 350
T 
1
LANG:1 12 ON LV and HV
"// SimpleCtrlScriptStart {invalid}
main()
{
   int iState, crate, cardtype;
 
   setValue(\"\", \"backCol\", \"Red\");
   iState=1;
   cardtype=255; // special code for all cards, all channels
   
   dpGet(\"Crate.Numb:_original.._value\", crate);  
   Set_State(iState, crate, cardtype); 
 
   setValue(\"\", \"backCol\", \"{153,204,255}\");
}

// SimpleCtrlScript {EP_setDP}
// DP1 {Crate1.HVchRamp}
// Config1 {:_original.._value}
// Type1 {int}
// Value1 {1}
// SimpleCtrlScriptEnd {EP_setDP}
" 0
 E E E
13 391
"Button7"
""
1 80 348 E E E 1 E 1 E N {0,0,0} E N {153,204,255} E E
 E E
384 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 ""
78 346 192 380
T 
1
LANG:1 16 STNBY  LV and HV
"// SimpleCtrlScriptStart {invalid}
main()
{
   int iState, crate, cardtype;
 
   setValue(\"\", \"backCol\", \"Red\");
   iState=2;
   cardtype=255; // special code for all cards, all channels
   
   dpGet(\"Crate.Numb:_original.._value\", crate);  
   Set_State(iState, crate, cardtype); 
 
   setValue(\"\", \"backCol\", \"{153,204,255}\");
}

// SimpleCtrlScript {EP_setDP}
// DP1 {Crate1.HVchRamp}
// Config1 {:_original.._value}
// Type1 {int}
// Value1 {1}
// SimpleCtrlScriptEnd {EP_setDP}
" 0
 E E E
13 392
"Button8"
""
1 80 378 E E E 1 E 1 E N {0,0,0} E N {153,204,255} E E
 E E
385 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 ""
78 376 192 410
T 
1
LANG:1 13 OFF LV and HV
"// SimpleCtrlScriptStart {invalid}
main()
{
   int iState, crate, cardtype;
 
   setValue(\"\", \"backCol\", \"Red\");
   iState=0;
   cardtype=255; // special code for all cards, all channels
   
   dpGet(\"Crate.Numb:_original.._value\", crate);  
   Set_State(iState, crate, cardtype); 
 
   setValue(\"\", \"backCol\", \"{153,204,255}\");
}

// SimpleCtrlScript {EP_setDP}
// DP1 {Crate1.HVchRamp}
// Config1 {:_original.._value}
// Type1 {int}
// Value1 {1}
// SimpleCtrlScriptEnd {EP_setDP}
" 0
 E E E
14 404
"TextField1"
""
1 657 435 E E E 1 E 1 E N "_WindowText" E N "_Window" E E
 E E
397 0 0 0 0 0
EE E
0
1
LANG:1 0 
0
1
LANG:1 107 -microsoft windows-Arial-normal-r-normal-*-*-120-100-100-*-*-iso8859-1|-13,0,0,0,400,0,0,0,0,3,2,1,34,Arial
0 ""
655 433 705 460
3 "s" 0 0 0 0 0 0 
E
"main()
{


  dpConnect(\"alarmcanbus\",\"Crate00.Controller.CCieStat.Recv:_online.._value\");

}

alarmcanbus(string dp, int iNewValue)
{
 
  if(iNewValue==1)
  {
    ChildPanelOnCentral(\"/subpanels/CANBUS.pnl\", \"CANBUS\", \" \");
     setValue(\"\", \"text\", \"NO communication\" );
  }
	else if ( iNewValue==127||iNewValue==255)
	{
	 setValue(\"\", \"text\", \"ELMB preoperational\" );
	}
	else if ( iNewValue==5||iNewValue==133)
  {
  setValue(\"\", \"text\", \"OK\" );
	}
}

 //EP_textFieldInCB1(string dp, float fNewValue)" 0

E
25 409
"Table1"
""
1 539 90 E E E 1 E 1 E N "_WindowText" E N "_Window" E E
 E E
402 0 0 0 0 0
EE E
0
1
LANG:1 0 
0
1
LANG:1 118 -microsoft windows-Courier New-normal-r-normal-*-*-110-100-100-*-*-iso8859-1|-12,0,0,0,400,0,0,0,0,0,0,0,0,Courier New
0 ""
558 168 761 247
E E 0 0 1 2 1 "#1" 0 1 0 "s" 1
LANG:1 2 #1
E1
LANG:1 0 
 80 "#2" 0 1 0 "s" 1
LANG:1 2 #2
E1
LANG:1 0 
 200 25 25 "" 1 1
LANG:1 2 #1
8 18 1
LANG:1 118 -microsoft windows-Courier New-normal-r-normal-*-*-110-100-100-*-*-iso8859-1|-12,0,0,0,400,0,0,0,0,0,0,0,0,Courier New
0 ""
0 1 1 0 0
1 0
13 412
"Button10"
""
1 390 410 E E E 1 E 1 E N "_3DText" E N "_3DFace" E E
 E E
404 0 0 0 0 0
EE E
0
1
LANG:1 0 
0
1
LANG:1 107 -microsoft windows-Arial-normal-r-normal-*-*-120-100-100-*-*-iso8859-1|-13,0,0,0,400,0,0,0,0,3,2,1,34,Arial
0 ""
388 408 482 452
T 
1
LANG:1 8 Button10
"main()
{
ChildPanelOnCentralModal(\"_SCT_Diagn_MoPS.pnl\",
      makeDynString(\"\"));
}" 0
 E E E
13 413
"Button11"
""
1 550 430 E E E 1 E 1 E N "_3DText" E N {255,153,102} E E
 E E
405 0 0 0 0 0
EE E
0
1
LANG:1 0 
0
1
LANG:1 107 -microsoft windows-Arial-normal-r-normal-*-*-120-100-100-*-*-iso8859-1|-13,0,0,0,400,0,0,0,0,3,2,1,34,Arial
0 ""
548 428 622 462
T 
1
LANG:1 5 Reset
"main()
{
 string datapoint;
 sprintf(datapoint,\"Crate00.Controller.CCie_NMT.Send:_original.._value\");
 dpSetWait(datapoint,130);
 delay(5);
 dpSetWait(datapoint,1);
}

" 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