Changeset 15378 for trunk/FACT++/scripts/Main.js
- Timestamp:
- 04/19/13 14:18:38 (12 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/FACT++/scripts/Main.js
r15362 r15378 308 308 // Here we could check and handle fad losses 309 309 310 try 311 { 312 dim.wait("MCP", "TakingData", 15000); 313 } 314 catch (e) 315 { 316 console.out(""); 317 console.out("MCP: "+dim.state("MCP").name); 318 console.out("FAD_CONTROL: "+dim.state("FAD_CONTROL").name); 319 console.out("FTM_CONTROL: "+dim.state("FTM_CONTROL").name); 320 console.out(""); 321 322 if (dim.state("MCP").name!="Configuring3" || 323 dim.state("FAD_CONTROL").name!="Configuring2") 324 throw e; 325 326 console.out(""); 327 console.out("Waiting for fadctrl to get configured timed out... checking for in-run FAD loss."); 328 329 var con = sub_connections.get(); 330 var stat = con.obj['status']; 331 332 console.out("Sending MCP/RESET"); 333 dim.send("MCP/RESET"); 334 335 dim.wait("FTM_CONTROL", "Idle", 3000); 336 dim.wait("FAD_CONTROL", "Connected", 3000); 337 dim.wait("MCP", "Idle", 3000); 338 339 /*** FOR REMOVE ***/ 340 /* 341 var reset = [ ]; 342 343 for (var i=0; i<40; i++) 344 if (stat[i]!=0x43) 345 { 346 console.out(" FAD %2d".$(i)+" not in Configured state."); 347 reset.push(parseInt(i/10)); 348 } 349 350 reset = reset.filter(function(elem,pos){return reset.indexOf(elem)==pos;}); 351 352 if (reset.length>0) 310 for (var n=0; n<3; n++) 311 { 312 try 313 { 314 dim.wait("MCP", "TakingData", 15000); 315 } 316 catch (e) 353 317 { 354 318 console.out(""); 355 console.out(" FADs belong to crate(s): "+reset); 319 console.out("MCP: "+dim.state("MCP").name); 320 console.out("FAD_CONTROL: "+dim.state("FAD_CONTROL").name); 321 console.out("FTM_CONTROL: "+dim.state("FTM_CONTROL").name); 356 322 console.out(""); 357 }*/ 358 /**** FOR REMOVE ****/ 359 360 var list = []; 361 for (var i=0; i<40; i++) 362 if (stat[i]!=0x43) 363 list.push(i); 364 365 reconnect(list, "configuration"); 366 367 return false; 368 } 323 324 if (dim.state("MCP").name!="Configuring3" || 325 dim.state("FAD_CONTROL").name!="Configuring2") 326 throw e; 327 328 console.out(""); 329 console.out("Waiting for fadctrl to get configured timed out... checking for in-run FAD loss."); 330 331 var con = sub_connections.get(); 332 var stat = con.obj['status']; 333 334 console.out("Sending MCP/RESET"); 335 dim.send("MCP/RESET"); 336 337 dim.wait("FTM_CONTROL", "Idle", 3000); 338 dim.wait("FAD_CONTROL", "Connected", 3000); 339 dim.wait("MCP", "Idle", 3000); 340 341 var list = []; 342 for (var i=0; i<40; i++) 343 if (stat[i]!=0x43) 344 list.push(i); 345 346 reconnect(list, "configuration"); 347 348 if (n<2) 349 return false; 350 351 throw e; 352 } 353 } 354 369 355 370 356 dim.wait("MCP", "Idle", time>0 ? time*1250 : undefined); // run time plus 25% … … 1248 1234 1249 1235 var len = 300; 1250 while (len> 0)1236 while (len>15) 1251 1237 { 1252 1238 var time = new Date();
Note:
See TracChangeset
for help on using the changeset viewer.