Changeset 18515
- Timestamp:
- 06/01/16 21:39:29 (8 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/FACT++/scripts/Main.js
r18429 r18515 161 161 162 162 var isClosed = dim.state("LID_CONTROL").name=="Closed"; 163 var isInconsistent = dim.state("LID_CONTROL").name=="Inconsistent"; 163 164 164 165 var tm = new Date(); 165 166 166 167 // Wait for lid to be open 167 if (isClosed )168 if (isClosed || isInconsistent) 168 169 { 169 170 dim.log("Opening lid"); … … 183 184 dim.wait("LID_CONTROL", "Open", 30000); 184 185 185 if (isClosed )186 if (isClosed || isInconsistent) 186 187 dim.log("Lid open [%.1fs]".$((new Date()-tm)/1000)); 187 188 } … … 205 206 dim.send("LID_CONTROL/CLOSE"); 206 207 } 207 dim.wait("LID_CONTROL", "Closed", 30000); 208 v8.timeout(30000, function() { if (dim.state("LID_CONTROL").name=="Closed" || dim.state("LID_CONTROL").name=="Inconsistent") return true; }); 209 //dim.wait("LID_CONTROL", "Closed", 30000); 210 //dim.wait("LID_CONTROL", "Inconsistent", 30000); 208 211 209 212 if (isOpen) … … 248 251 for (var i=0; i<320; i++) 249 252 { 253 // This is a fix for the channel with a shortcut 254 if (i==272) 255 continue; 256 250 257 var dU = Uov[i]-Unom; 251 258 … … 444 451 dim.log("Taking single p.e. run."); 445 452 while (!irq && !takeRun("single-pe", 10000)); 453 454 /* 455 Maybe we need to send a trigger... but data runs contain pedestal triggers... so it should work in any case... 456 var customRun = function() 457 { 458 v8.sleep(500);//wait that configuration is set 459 dim.wait("FTM_CONTROL", "TriggerOn", 15000); 460 dim.send("FAD_CONTROL/SEND_SINGLE_TRIGGER"); 461 dim.send("RATE_CONTROL/STOP"); 462 dim.send("FTM_CONTROL/STOP_TRIGGER"); 463 dim.wait("FTM_CONTROL", "Valid", 3000); 464 dim.send("FTM_CONTROL/ENABLE_TRIGGER", true); 465 dim.send("FTM_CONTROL/SET_TIME_MARKER_DELAY", 123); 466 dim.send("FTM_CONTROL/SET_THRESHOLD", -1, obs[sub].threshold); 467 v8.sleep(500);//wait that configuration is set 468 dim.send("FTM_CONTROL/START_TRIGGER"); 469 dim.wait("FTM_CONTROL", "TriggerOn", 15000); 470 }*/ 471 472 473 dim.log("Taking data run with closed lid."); 474 while (!irq && !takeRun("data", -1, 300)); 446 475 } 447 476 … … 957 986 [ "BIAS_CONTROL", [ "VoltageOff", "VoltageOn", "Ramping" ] ], 958 987 [ "FEEDBACK", [ "Calibrated", "InProgress", "OnStandby", "Warning", "Critical" ] ], 959 [ "LID_CONTROL", [ "Open", "Closed" ] ], 988 // [ "LID_CONTROL", [ "Open", "Closed" ] ], 989 [ "LID_CONTROL", [ "Open", "Closed", "Inconsistent" ] ], 960 990 [ "DRIVE_CONTROL", drive_states/*[ "Armed", "Tracking", "OnTrack" ]*/ ], 961 991 [ "FTM_CONTROL", [ "Valid", "TriggerOn" ] ], … … 1168 1198 if (irq || !takeRun("pedestal", 1000)) // 80 Hz -> 10s 1169 1199 continue; 1170 if (irq || !takeRun("light-pulser-ext", 1000)) // 80 Hz -> 10s1171 continue;1200 //if (irq || !takeRun("light-pulser-ext", 1000)) // 80 Hz -> 10s 1201 // continue; 1172 1202 break; 1173 1203 } … … 1376 1406 } 1377 1407 1378 takeRun( customRun, -1, obs[sub].time);1408 takeRun("custom", -1, obs[sub].time, customRun); 1379 1409 } 1380 1410 dim.log("Task finished [CUSTOM].");
Note:
See TracChangeset
for help on using the changeset viewer.