Changeset 15094 for trunk/FACT++
- Timestamp:
- 03/18/13 14:42:46 (12 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/FACT++/scripts/CheckUnderflow.js
r15071 r15094 79 79 //console.out("Most probablay the camera has not been checked for underflows yet."); 80 80 81 dim.send("FAD_CONTROL/START_DRS_CALIBRATION"); 82 dim.send("FAD_CONTROL/SET_FILE_FORMAT", 0); 83 81 84 var service_event = new Subscription("FAD_CONTROL/EVENT_DATA"); 82 85 var event = service_event.get(5000, false); 83 86 87 // This needs a better solution! The problem is that the 88 // event builder might still be writing a file (WritingData), 89 // but even if the file is closed (CLOSE_OPEN_FILES) the 90 // thread sending data (EVENT_DATA) might still be processing 91 // events. Thus there is no real guarantee that we do not receive 92 // data of the previous run after we have started a new one. 93 dim.wait("Connected", 10000); 94 v8.sleep(1000); // Let 'timeout' in SendRawData pass 95 84 96 var event_counter = event.counter; 85 97 86 dim.send("FAD_CONTROL/START_DRS_CALIBRATION");87 dim.send(" FAD_CONTROL/SET_FILE_FORMAT", 0);98 console.out("Starting drs-gain"); 99 dim.send("MCP/START", -1, 5, "drs-gain"); 88 100 89 console.out("Starting drs-gain"); 90 dim.send("MCP/START", -1, 3, "drs-gain"); 101 console.out("Waiting for new event"); 91 102 92 // FIXME: add a timeout here (10s)93 console.out("Waiting for new event");94 103 var d = new Date(); 95 while (event_counter == service_event.get(0, false).counter) 96 v8.sleep(); 104 v8.timeout(10000, function() { if (service_event.get(0, false).counter>event_counter) return true; }); 97 105 98 106 console.out("Event received: "+(new Date()-d)+"ms"); … … 163 171 { 164 172 if (stat0.count>8) 165 throw new Error("Underflow condition detected in about "+ stat0.count/9+" DRS.");173 throw new Error("Underflow condition detected in about "+parseInt(stat0.count/9+.5)+" DRS."); 166 174 167 175 log.warn("There is probably an underflow condition in one DRS... please check manually.");
Note:
See TracChangeset
for help on using the changeset viewer.