Changeset 16743 for trunk/FACT++


Ignore:
Timestamp:
06/06/13 12:02:54 (11 years ago)
Author:
tbretz
Message:
Use the QoS (num open files) of the RUNS service to detect whether a file is open or not.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/FACT++/scripts/CheckUnderflow.js

    r16571 r16743  
    8484    dim.send("FAD_CONTROL/SET_FILE_FORMAT", 0);
    8585
    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)
     86    var sub_runs = new Subscription("FAD_CONTROL/RUNS");
     87    var sruns = sub_runs.get(5000, false);
     88
     89    if (dim.state("FAD_CONTROL").name=="RunInProgress" || sruns.qos==1)
    9090    {
    9191        dim.send("FAD_CONTROL/CLOSE_OPEN_FILES");
     
    9393
    9494        console.out("Waiting for open files to be closed...");
    95         v8.timeout(60000, function() { if (sub_startrun.get().obj['run']==-1) return true; });
     95        v8.timeout(60000, function() { if (sub_runs.get(false).qos==0) return true; });
    9696
    9797        // Although the file should be closed now, the processing might still be on-going
    9898        // and delayed events might be received. The only fix for that issue is to
    9999        // add the run number to the data we are waiting for
    100         v8.sleep(10000);
    101     }
     100        v8.sleep(5000);
     101    }
     102
     103    sub_runs.close();
    102104
    103105    console.out("Starting drs-gain... waiting for new event");
    104106
     107    var sub_startrun = new Subscription("FAD_CONTROL/START_RUN");
    105108    var sub_incomplete = new Subscription("FAD_CONTROL/INCOMPLETE");
    106109    var sub_connections = new Subscription("FAD_CONTROL/CONNECTIONS");
Note: See TracChangeset for help on using the changeset viewer.