Changeset 17923
- Timestamp:
- 07/22/14 13:45:29 (10 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/FACT++/scripts/takeRun.js
r17922 r17923 173 173 //} 174 174 175 // ================================================================176 // Function for Critical voltage177 // ================================================================178 179 // INSTALL a watchdog... send FAD_CONTROL/CLOSE_OPEN_FILES180 // could send MCP/RESET as well but would result in a timeout181 var callback = dim.onchange['FEEDBACK'];182 dim.onchange['FEEDBACK'] = function(state)183 {184 if (callback)185 callback.call(this, state);186 187 if ((state.name=="Critical" || state.name=="OnStandby") &&188 (this.last!="Critical" && this.last!="OnStandby"))189 {190 console.out("Feedback state changed from "+this.last+" to "+state.name+" [takeRun.js]");191 192 // Includes FAD_CONTROL/CLOSE_ALL_OPEN_FILES193 dim.send("MCP/STOP");194 }195 196 this.last=state.name;197 }198 199 175 // Here we could check and handle fad losses 200 176 … … 265 241 } 266 242 267 // This is to check if we have missed the event. This can happen as268 // a race condition when the MCP/STOP is sent by the event handler269 // but the run was not yet fully configured.270 var statefb = dim.state("FEEDBACK").name;271 if (statefb=="Critical" || statefb=="OnStandby")272 {273 console.out("Run started by FEEDBACK in state "+statefb);274 dim.send("MCP/STOP"); // Includes FAD_CONTROL/CLOSE_ALL_OPEN_FILES275 276 dim.onchange['FEEDBACK'] = callback;277 278 return true;279 }280 281 243 dim.wait("MCP", "Idle", time>0 ? time*1250 : undefined); // run time plus 25% 282 283 // REMOVE watchdog284 dim.onchange['FEEDBACK'] = callback;285 244 286 245 if (incomplete)
Note:
See TracChangeset
for help on using the changeset viewer.