Changeset 15362 for trunk/FACT++/scripts
- Timestamp:
- 04/18/13 10:20:09 (12 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/FACT++/scripts/Main.js
r15354 r15362 133 133 incomplete = inc; 134 134 135 console.out(" Sending MCP/STOP");135 console.out("", "Incomplete event detected, sending MCP/STOP"); 136 136 dim.send("MCP/STOP"); 137 137 } … … 241 241 } 242 242 243 console.out(" ...waiting for 5s");244 v8.sleep( 5000);243 console.out(" ...waiting for 3s"); 244 v8.sleep(3000); 245 245 246 246 for (var i=0; i<list.length; i++) … … 266 266 267 267 incomplete = 0; 268 268 269 dim.send("MCP/START", time?time:-1, count?count:-1, type); 269 270 … … 337 338 338 339 /*** FOR REMOVE ***/ 340 /* 339 341 var reset = [ ]; 340 342 … … 353 355 console.out(" FADs belong to crate(s): "+reset); 354 356 console.out(""); 355 } 357 }*/ 356 358 /**** FOR REMOVE ****/ 357 359 … … 363 365 reconnect(list, "configuration"); 364 366 365 throwe;367 return false; 366 368 } 367 369 … … 370 372 if (incomplete) 371 373 { 372 console.out("Incomplete: "+incomplete);373 374 374 console.out(""); 375 375 console.out("MCP: "+dim.state("MCP").name); 376 376 console.out("FAD_CONTROL: "+dim.state("FAD_CONTROL").name); 377 377 console.out("FTM_CONTROL: "+dim.state("FTM_CONTROL").name); 378 console.out("");379 378 380 379 dim.wait("MCP", "Idle", 3000); … … 392 391 reconnect(list, "data taking"); 393 392 394 throw new Error("In-run FAD loss detected."); 393 return false; 394 395 //throw new Error("In-run FAD loss detected."); 395 396 } 396 397 … … 421 422 continue; 422 423 423 // Does that fix the runopen before runclose problem?424 //dim.wait("FAD_CONTROL", "Connected", 3000);425 //v8.sleep(1000);426 427 424 if (!takeRun("drs-gain", 1000)) // 40 / 20s (50Hz) 428 425 continue; 429 426 430 // Does that fix the runopen before runclose problem?431 //dim.wait("FAD_CONTROL", "Connected", 3000);432 //v8.sleep(1000);433 434 427 if (!takeRun("drs-pedestal", 1000)) // 40 / 20s (50Hz) 435 428 continue; 436 429 437 dim.send("FAD_CONTROL/SET_FILE_FORMAT", 2); 438 if (!takeRun("drs-pedestal", 1000)) // 40 / 20s (50Hz) 439 continue; 440 if (!takeRun("drs-time", 1000)) // 40 / 20s (50Hz) 441 continue; 442 430 break; 431 } 432 433 dim.send("FAD_CONTROL/SET_FILE_FORMAT", 2); 434 435 while (!takeRun("drs-pedestal", 1000)); // 40 / 20s (50Hz) 436 while (!takeRun("drs-time", 1000)); // 40 / 20s (50Hz) 437 438 while (1) 439 { 443 440 dim.send("FAD_CONTROL/RESET_SECONDARY_DRS_BASELINE"); 444 if (!takeRun("pedestal", 1000)) // 40 / 10s (80Hz) 445 continue; 446 447 dim.send("FAD_CONTROL/SET_FILE_FORMAT", 2); 448 if (!takeRun("pedestal", 1000)) // 40 / 10s (80Hz) 449 continue; 441 if (takeRun("pedestal", 1000)) // 40 / 10s (80Hz) 442 break; 443 } 444 445 dim.send("FAD_CONTROL/SET_FILE_FORMAT", 2); 446 447 while (!takeRun("pedestal", 1000)); // 40 / 10s (80Hz) 448 450 449 // ----------- 451 450 // 4'40 / 2'00 452 453 break;454 }455 451 456 452 console.out(" DRS calibration done [%.1f]".$((new Date()-tm)/1000)); … … 712 708 dim.send("FEEDBACK/ENABLE_OUTPUT", false); 713 709 dim.send("FTM_CONTROL/STOP_TRIGGER"); 714 715 dim.wait("FEEDBACK", "CurrentCtrlIdle", 3000); 716 dim.wait("FTM_CONTROL", "Idle", 3000); 710 dim.send("BIAS_CONTROL/DISCONNECT"); 711 712 dim.wait("FEEDBACK", "CurrentCtrlIdle", 3000); 713 dim.wait("FTM_CONTROL", "Idle", 3000); 714 dim.wait("BIAS_CONTROL", "Disconnected", 3000); 717 715 718 716 var report = sub.get(); … … 911 909 var sub; 912 910 var lastId; 913 var sun = Sun.horizon(-1 3);911 var sun = Sun.horizon(-12); 914 912 var system_on; // undefined 915 913 … … 933 931 // Check if we have to take action do to sun-rise 934 932 var was_up = sun.isUp; 935 sun = Sun.horizon(-1 3);933 sun = Sun.horizon(-12); 936 934 if (!was_up && sun.isUp) 937 935 { … … 1006 1004 console.out("\n"+(new Date()).toUTCString()+": Current measurement: "+obs[sub]); 1007 1005 1008 var power_states = sun.isUp || system_on===false ? [ "DriveOff" ] : [ "SystemOn" ]; 1006 // FIXME: Maybe print a warning if Drive is on during day time! 1007 1008 // It is not ideal that we allow the drive to be on during day time, but 1009 // otherwise it is difficult to allow e.g. the STARTUP at the beginning of the night 1010 var power_states = sun.isUp || system_on===false ? [ "DriveOff", "SystemOn" ] : [ "SystemOn" ]; 1009 1011 var drive_states = sun.isUp || system_on===false ? undefined : [ "Armed", "Tracking", "OnTrack" ]; 1010 1012 … … 1039 1041 if (!checkStates(table)) 1040 1042 { 1041 throw new Error("Something unexpected has happened. One of the servers "+1043 throw new Error("Something unexpected has happened. One of the servers "+ 1042 1044 "is in a state in which it should not be. Please,"+ 1043 1045 "try to find out what happened...");
Note:
See TracChangeset
for help on using the changeset viewer.