/////////////////// // MOUSER MENU // /////////////////// private void AnalysisWizardClick(object sender, RoutedEventArgs e) { AcquireParameters acq = null; Detector det = null; Integ.GetCurrentAcquireDetectorPair(ref acq, ref det); if (!det.ListMode) { MessageBox.Show("'" + det.ToString() + "' is not a List Mode detector,\r\ncreate or select a List Mode detector\r\n with Setup > Facility/Inspection...", "List Mode Acquire"); return; } NewUI.AnalysisWizard f = new NewUI.AnalysisWizard(NewUI.AnalysisWizard.AWSteps.Step1, acq, det); System.Windows.Forms.DialogResult dr = f.ShowDialog(); if (dr == System.Windows.Forms.DialogResult.OK) { if (acq.modified || acq.lm.modified) { INCCDB.AcquireSelector sel = new INCCDB.AcquireSelector(det, acq.item_type, DateTime.Now); acq.MeasDateTime = sel.TimeStamp; acq.lm.TimeStamp = sel.TimeStamp; NC.App.DB.AcquireParametersMap().Add(sel, acq); // it's a new one, not the existing one modified NC.App.DB.UpdateAcquireParams(acq, det.ListMode); } switch (NC.App.Opstate.Measurement.AcquireState.data_src) // global access to latest acq here, same as acq set in wizard { case ConstructedSource.Live: UIIntegration.Controller.file = false; // make sure to use the DAQ controller, not the file controller NC.App.AppContext.FileInput = null; // reset the cmd line file input flag if (NC.App.Opstate.Measurement.Detectors[0].ListMode) { // NC.App.DB.UpdateAcquireParams(ap, det.ListMode); //update it again // NC.App.DB.UpdateDetector(det); // if ok, the analyzers are set up, so can kick it off now. if (NC.App.Opstate.Measurement.Detectors[0].Id.SRType == InstrType.PTR32) { Ptr32Instrument instrument = new Ptr32Instrument(NC.App.Opstate.Measurement.Detectors[0]); instrument.DAQState = DAQInstrState.Offline; instrument.selected = true; instrument.Init(NC.App.Logger(LMLoggers.AppSection.Data), NC.App.Logger(LMLoggers.AppSection.Analysis)); if (!Instruments.Active.Contains(instrument)) { Instruments.Active.Add(instrument); } } else { LMInstrument lm = new LMInstrument(NC.App.Opstate.Measurement.Detectors[0]); lm.DAQState = DAQInstrState.Offline; // these are manually initiated as opposed to auto-pickup lm.selected = false; //must broadcast first to get it selected if (!Instruments.All.Contains(lm)) { Instruments.All.Add(lm); // add to global runtime list } } } else { SRInstrument sri = new SRInstrument(NC.App.Opstate.Measurement.Detectors[0]); sri.selected = true; sri.Init(NC.App.Loggers.Logger(LMLoggers.AppSection.Data), NC.App.Loggers.Logger(LMLoggers.AppSection.Analysis)); if (!Instruments.All.Contains(sri)) { Instruments.All.Add(sri); // add to global runtime list } } break; case ConstructedSource.DB: UIIntegration.Controller.file = true; return; //break; case ConstructedSource.Manual: UIIntegration.Controller.file = true; return; //break; case ConstructedSource.CycleFile: case ConstructedSource.ReviewFile: UIIntegration.Controller.file = true; string xs = UIIntegration.GetUsersFolder("Select Input Folder", NC.App.AppContext.FileInput); if (!String.IsNullOrEmpty(xs)) { NC.App.AppContext.FileInput = xs; NC.App.AppContext.FileInputList = null; // no explicit file list } SRInstrument sri2 = new SRInstrument(NC.App.Opstate.Measurement.Detectors[0]); sri2.selected = true; sri2.Init(NC.App.Loggers.Logger(LMLoggers.AppSection.Data), NC.App.Loggers.Logger(LMLoggers.AppSection.Analysis)); if (!Instruments.All.Contains(sri2)) { Instruments.All.Add(sri2); // add to global runtime list } break; case ConstructedSource.NCDFile: NC.App.AppContext.NCDFileAssay = true; // suntoucher, this is right here how we're flowing now UIIntegration.Controller.file = true; break; case ConstructedSource.SortedPulseTextFile: NC.App.AppContext.PulseFileAssay = true; UIIntegration.Controller.file = true; break; case ConstructedSource.PTRFile: NC.App.AppContext.PTRFileAssay = true; UIIntegration.Controller.file = true; break; default: break; } NC.App.Opstate.Measurement.Detectors[0].Id.source = NC.App.Opstate.Measurement.AcquireState.data_src; // set the detector overall data source value here UIIntegration.Controller.SetAssay(); // tell the controller to do an assay operation using the current measurement state UIIntegration.Controller.Perform(); // start the measurement file or DAQ thread } }
/////////////////// // MOUSER MENU // /////////////////// private void AnalysisWizardClick(object sender, RoutedEventArgs e) { AcquireParameters acq = null; Detector det = null; Integ.GetCurrentAcquireDetectorPair(ref acq, ref det); if (!det.ListMode) { MessageBox.Show("'" + det.ToString() + "' is not a List Mode detector,\r\ncreate or select a List Mode detector\r\n with Setup > Facility/Inspection...", "List Mode Acquire"); return; } NewUI.AnalysisWizard f = new NewUI.AnalysisWizard(NewUI.AnalysisWizard.AWSteps.Step1, acq, det); System.Windows.Forms.DialogResult dr = f.ShowDialog(); if (dr == System.Windows.Forms.DialogResult.OK) { if (acq.modified || acq.lm.modified) { INCCDB.AcquireSelector sel = new INCCDB.AcquireSelector(det, acq.item_type, DateTime.Now); acq.MeasDateTime = sel.TimeStamp; acq.lm.TimeStamp = sel.TimeStamp; NC.App.DB.AcquireParametersMap().Add(sel, acq); // it's a new one, not the existing one modified NC.App.DB.UpdateAcquireParams(acq, det.ListMode); } switch (NC.App.Opstate.Measurement.AcquireState.data_src) // global access to latest acq here, same as acq set in wizard { case ConstructedSource.Live: UIIntegration.Controller.file = false; // make sure to use the DAQ controller, not the file controller NC.App.AppContext.FileInput = null; // reset the cmd line file input flag if (NC.App.Opstate.Measurement.Detectors[0].ListMode) { // NC.App.DB.UpdateAcquireParams(ap, det.ListMode); //update it again // NC.App.DB.UpdateDetector(det); // if ok, the analyzers are set up, so can kick it off now. if (NC.App.Opstate.Measurement.Detectors[0].Id.SRType == InstrType.PTR32) { Ptr32Instrument instrument = new Ptr32Instrument(NC.App.Opstate.Measurement.Detectors[0]); instrument.DAQState = DAQInstrState.Offline; instrument.selected = true; instrument.Init(NC.App.Logger(LMLoggers.AppSection.Data), NC.App.Logger(LMLoggers.AppSection.Analysis)); if (!Instruments.Active.Contains(instrument)) { Instruments.Active.Add(instrument); } } else { LMInstrument lm = new LMInstrument(NC.App.Opstate.Measurement.Detectors[0]); lm.DAQState = DAQInstrState.Offline; // these are manually initiated as opposed to auto-pickup lm.selected = false; //must broadcast first to get it selected if (!Instruments.All.Contains(lm)) Instruments.All.Add(lm); // add to global runtime list } } else { SRInstrument sri = new SRInstrument(NC.App.Opstate.Measurement.Detectors[0]); sri.selected = true; sri.Init(NC.App.Loggers.Logger(LMLoggers.AppSection.Data), NC.App.Loggers.Logger(LMLoggers.AppSection.Analysis)); if (!Instruments.All.Contains(sri)) Instruments.All.Add(sri); // add to global runtime list } break; case ConstructedSource.DB: UIIntegration.Controller.file = true; return; //break; case ConstructedSource.Manual: UIIntegration.Controller.file = true; return; //break; case ConstructedSource.CycleFile: case ConstructedSource.ReviewFile: UIIntegration.Controller.file = true; string xs = UIIntegration.GetUsersFolder("Select Input Folder", NC.App.AppContext.FileInput); if (!String.IsNullOrEmpty(xs)) { NC.App.AppContext.FileInput = xs; NC.App.AppContext.FileInputList = null; // no explicit file list } SRInstrument sri2 = new SRInstrument(NC.App.Opstate.Measurement.Detectors[0]); sri2.selected = true; sri2.Init(NC.App.Loggers.Logger(LMLoggers.AppSection.Data), NC.App.Loggers.Logger(LMLoggers.AppSection.Analysis)); if (!Instruments.All.Contains(sri2)) Instruments.All.Add(sri2); // add to global runtime list break; case ConstructedSource.NCDFile: NC.App.AppContext.NCDFileAssay = true; // suntoucher, this is right here how we're flowing now UIIntegration.Controller.file = true; break; case ConstructedSource.SortedPulseTextFile: NC.App.AppContext.PulseFileAssay = true; UIIntegration.Controller.file = true; break; case ConstructedSource.PTRFile: NC.App.AppContext.PTRFileAssay = true; UIIntegration.Controller.file = true; break; default: break; } NC.App.Opstate.Measurement.Detectors[0].Id.source = NC.App.Opstate.Measurement.AcquireState.data_src; // set the detector overall data source value here UIIntegration.Controller.SetAssay(); // tell the controller to do an assay operation using the current measurement state UIIntegration.Controller.Perform(); // start the measurement file or DAQ thread } }