Changeset 16571
- Timestamp:
- 06/02/13 11:32:49 (12 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/FACT++/scripts/CheckUnderflow.js
r16533 r16571 84 84 dim.send("FAD_CONTROL/SET_FILE_FORMAT", 0); 85 85 86 // This needs a better solution! The problem is that the 87 // event builder might still be writing a file (WritingData), 88 // but even if the file is closed (CLOSE_OPEN_FILES) the 89 // thread sending data (EVENT_DATA) might still be processing 90 // events. Thus there is no real guarantee that we do not receive 91 // data of the previous run after we have started a new one. 92 if (dim.state("FAD_CONTROL").name=="RunInProgress") 86 var sub_startrun = new Subscription("FAD_CONTROL/START_RUN"); 87 var sruns = sub_startrun.get(5000); 88 89 if (dim.state("FAD_CONTROL").name=="RunInProgress" || sruns.obj['run']!=-1) 93 90 { 94 91 dim.send("FAD_CONTROL/CLOSE_OPEN_FILES"); 95 92 dim.wait("FAD_CONTROL", "Connected", 3000); 96 } 97 v8.sleep(1000); // Let 'timeout' in SendRawData pass 93 94 console.out("Waiting for open files to be closed..."); 95 v8.timeout(60000, function() { if (sub_startrun.get().obj['run']==-1) return true; }); 96 97 // Although the file should be closed now, the processing might still be on-going 98 // and delayed events might be received. The only fix for that issue is to 99 // add the run number to the data we are waiting for 100 v8.sleep(10000); 101 } 98 102 99 103 console.out("Starting drs-gain... waiting for new event"); … … 101 105 var sub_incomplete = new Subscription("FAD_CONTROL/INCOMPLETE"); 102 106 var sub_connections = new Subscription("FAD_CONTROL/CONNECTIONS"); 103 var sub_startrun = new Subscription("FAD_CONTROL/START_RUN");104 sub_startrun.get(5000);105 107 sub_connections.get(5000); 106 108 sub_startrun.get(5000); … … 118 120 if (dim.state("MCP").name=="TakingData" && service_event.get(0, false).counter>event_counter) 119 121 { 120 dim.send("FAD_CONTROL/CLOSE_OPEN_FILES");122 //dim.send("FAD_CONTROL/CLOSE_OPEN_FILES"); 121 123 dim.send("MCP/STOP"); 122 124 return;
Note:
See TracChangeset
for help on using the changeset viewer.