// The HV op control public void HVCoreOp() { if (Instruments.Active.ConnectedLMCount() <= 0 && !Instruments.Active.HasSR()) // LM only and non connected earlier { return; //nothing to do } NCCAction x = NC.App.Opstate.Action; NC.App.Opstate.Action = NCCAction.HVCalibration; bool ok = HVCalibInception(); // the current thread pends in this method until the active instrument completes HV processing CurState.StopTimer(1); // started in StartHVCalib if (ok) { OutputResults(NCCAction.HVCalibration); } FireEvent(EventType.ActionStop, this); NC.App.Opstate.Action = x; }
public bool AssayInception() { completed = new CountdownEvent(Instruments.Active.Count); ApplyInstrumentSettings(); var task = StartAssay(); // note: data collection occurs in async socket event callbacks through the LM DAQ server, don't need another thread if (task) { ManualResetEventSlim[] me = GetTheAssayWaitTokens(); // each active Instr has it's own analysis handler wait handle foreach (ManualResetEventSlim mres in me) { if (mres != null) { mres.Wait(); // wait for signal from DAQ + Analyzer on each active instrument. } } } completed.Wait(); // wait for all the instr assays to complete (might be more than 1 in NPOD model) CurState.StopTimer(1); // started in StartAssay > ResetForMeasurement Thread.Sleep(500); // todo: separately config the various waits, grep for Thread.Sleep to find them return(task); }