当前位置: 首页>>代码示例>>C#>>正文


C# Measurement.CycleStatusTerminationCheck方法代码示例

本文整理汇总了C#中Measurement.CycleStatusTerminationCheck方法的典型用法代码示例。如果您正苦于以下问题:C# Measurement.CycleStatusTerminationCheck方法的具体用法?C# Measurement.CycleStatusTerminationCheck怎么用?C# Measurement.CycleStatusTerminationCheck使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Measurement的用法示例。


在下文中一共展示了Measurement.CycleStatusTerminationCheck方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: ComputeFromINCC5SRData

        // assumes initalized measurement with at least one cycle, and at least one defined counting analysis result indexed by the detector's mult params
        // NEXT: implement for LM results 
        void ComputeFromINCC5SRData(Measurement m)
        {
            ctrllog.TraceEvent(LogLevels.Info, 34071, "Recomputing: '" + m.MeasurementId.MeasDateTime.ToString() + ", " + m.MeasOption.PrintName() + "'");
            if (m.Cycles.Count < 1)
            {
                ctrllog.TraceEvent(LogLevels.Error, 34830, "Skipping, no cycles on '" + m.MeasurementId.MeasDateTime.ToString() + ", " + m.MeasOption.PrintName() + "'");
                return;
            }

            if (m.CountingAnalysisResults.Count < 1 || !m.CountingAnalysisResults.HasMultiplicity)
            {
                ctrllog.TraceEvent(LogLevels.Error, 34831, "Bad match between detector and this file type." + (!m.CountingAnalysisResults.HasMultiplicity ? " No Multiplicity counter defined." : ""));
                return; //bad match between detector and this file type.
            }

            SRInstrument PseudoInstrument = new SRInstrument(m.Detectors[0]);
            PseudoInstrument.selected = true;
            if (!Instruments.Active.Contains(PseudoInstrument))
                Instruments.Active.Add(PseudoInstrument); // add to global runtime list

            m.CurrentRepetition = 0;
            NC.App.Opstate.SOH = NCC.OperatingState.Living;

            try
            {
                // urgent: there is more work to do for the bins and AB here, AB can be copied from the detector values
                MultiplicityCountingRes mcr = (MultiplicityCountingRes)m.CountingAnalysisResults[m.Detectors[0].MultiplicityParams]; // multmult
                // start counting using the per-cycle accumulation of summary results
                Array.Clear(mcr.RAMult, 0, mcr.RAMult.Length);
                Array.Clear(mcr.NormedAMult, 0, mcr.NormedAMult.Length);
                mcr.AB.TransferIntermediates(src: m.Detectors[0].AB);

                foreach (AnalysisDefs.Cycle cycle in m.Cycles)
                {
                    if (NC.App.Opstate.IsQuitRequested)  // exit via abort or quit/save, follow-on code decides to continue with processing
                    {
                        ctrllog.TraceEvent(LogLevels.Warning, 430, "Cycle first-pass processing " + NC.App.Opstate.CancelStopAbortStateRep + " at sequence #" + cycle.seq + ", " + m.CurrentRepetition);
                        break;
                    }
                    m.CurrentRepetition++;
                    cycle.SetQCStatus(m.Detectors[0].MultiplicityParams, QCTestStatus.Pass, cycle.HighVoltage);  // multmult prep for analyis one by one
                    CycleProcessing.ApplyTheCycleConditioningSteps(cycle, m);
                    m.CycleStatusTerminationCheck(cycle);
                    ctrllog.TraceEvent(LogLevels.Verbose, 5439, "Cycle " + cycle.seq.ToString());
                    if (m.CurrentRepetition % 8 == 0)
                        FireEvent(EventType.ActionInProgress, this);
                }
                FireEvent(EventType.ActionInProgress, this);
                // trim any None's that were not processed (occurs during a cancel/stop intervention)
                m.Cycles.Trim(m.Detectors[0].MultiplicityParams); // multmult
            }
            catch (Exception e)
            {
                NC.App.Opstate.SOH = NCC.OperatingState.Trouble;
                ctrllog.TraceException(e, true);
                ctrllog.TraceEvent(LogLevels.Warning, 430, "Processing stopped at cycle " + m.CurrentRepetition);
            }
            finally
            {
                NC.App.Loggers.Flush();
            }

            if (!NC.App.Opstate.IsAbortRequested)  // stop/quit means continue with what is available
            { 
                // todo: 			if (meas.HasReportableData)
                m.CalculateMeasurementResults();
                new ReportMangler(ctrllog).GenerateReports(m);
                m.SaveMeasurementResults();
            }
            NC.App.Opstate.ResetTokens();
            Instruments.All.Remove(PseudoInstrument);
        }
开发者ID:tempbottle,项目名称:INCC6,代码行数:74,代码来源:FileCtrlINCC5.cs

示例2: Replay

        void Replay(Measurement m, ConstructedSource src)
        {
            ctrllog.TraceEvent(LogLevels.Info, 34071, "Replay this: '" + m.MeasurementId.MeasDateTime.ToString() + ", " + m.MeasOption.PrintName() + "'");
            m.AcquireState.comment += " replay";
            // todo: make sure assay type on measurement is not overridden by cmd line artifacts 
            NC.App.Opstate.Measurement = m;
            SRInstrument PseudoInstrument = new SRInstrument(m.Detectors[0]);  // psuedo LM until we can map from user or deduce from file content at run-time
            PseudoInstrument.id.source = ConstructedSource.INCCTransfer;
            // remove PseudoInstrument.id.SetSRType(PseudoInstrument.id.Type); // hack, the SR type should be pre-defined by an earlier import of a INCCInitialDataDetectorFile
            PseudoInstrument.selected = true;
            if (!Instruments.Active.Contains(PseudoInstrument))
                Instruments.Active.Add(PseudoInstrument); // add to global runtime list

            m.CurrentRepetition = 0;
            NC.App.Opstate.SOH = NCC.OperatingState.Living;
            try
            {
                MultiplicityCountingRes mcr = (MultiplicityCountingRes)m.CountingAnalysisResults.First().Value;
                for (int i = 0; i < mcr.RAMult.Length; i++)  // count again using the per-cycle accumulation of summary results
                    mcr.RAMult[i] = 0;
                for (int i = 0; i < mcr.NormedAMult.Length; i++)
                    mcr.NormedAMult[i] = 0;
                m.Detectors[0].Id.source = src;
                // need to get alpha beta onto the summary too.
                mcr.AB.TransferIntermediates(m.Detectors[0].AB);

                foreach (AnalysisDefs.Cycle cycle in m.Cycles)
                {
                    if (NC.App.Opstate.IsCancellationRequested)  // cancellation occurs here and at selected steps in the internal file and analyzer processing 
                        break;
                    m.CurrentRepetition++;
                    CycleProcessing.ApplyTheCycleConditioningSteps(cycle, m);
                    m.CycleStatusTerminationCheck(cycle);
                }
            }
            catch (Exception e)
            {
                NC.App.Opstate.SOH = NCC.OperatingState.Trouble;
                ctrllog.TraceException(e, true);
				ctrllog.TraceEvent(LogLevels.Warning, 430, "Processing stopped at cycle " + m.CurrentRepetition);
            }
            finally
            {
                NC.App.Loggers.Flush();
            }
			// todo: 			if (meas.HasReportableData)
            m.CalculateMeasurementResults();

            ReportMangler rm = new ReportMangler(ctrllog);
            rm.GenerateReports(m);

            m.SaveMeasurementResults();

            Instruments.All.Remove(PseudoInstrument);
        }
开发者ID:tempbottle,项目名称:INCC6,代码行数:55,代码来源:FileCtrl.cs

示例3: EndOfCycleProcessing

        /// <summary>
        /// 
        /// </summary>
        /// <param name="meas"></param>
        /// <returns></returns>
        public override bool EndOfCycleProcessing(Measurement meas, bool last = false)
        {
            bool happyfun = true;

            if (last)
            {
                if (NC.App.Opstate.SOH == NCC.OperatingState.Living) // all other states mean do not wait here
                {
                    // drain analyzer queue
                    EndCountingWhenFinishedWithPresentEventQueue();
                    // wait for results to be available
                    AssayPendingWait();
                }
                else
                {
                    logger.TraceEvent(LogLevels.Warning, 952, "Processing is '{0}', not waiting for analyzer completion", NC.App.Opstate.SOH);
                    EndAnalysisImmediately(); // again ok?
                }
                try
                {
                    // reset the counters
                    State.Sup.ResetCompletely(closeCounters:true);
                }
                catch (Exception ex)
                {
                    logger.TraceEvent(LogLevels.Error, 143, "EndOfCycleProcessing reset internal error: " + ex.Message);
                    happyfun = false;
                }
            }
            else
            {
                if (NC.App.Opstate.SOH == NCC.OperatingState.Living) // all other states mean do not wait here
                {
                    // drain analyzer queue
                    EndCountingWhenFinishedWithPresentEventQueue();
                    // wait for results to be available
                    AssayPendingWait();
                }
                else
                {
                    logger.TraceEvent(LogLevels.Warning, 952, "Processing is '{0}', not waiting for analyzer completion", NC.App.Opstate.SOH);
                    EndAnalysisImmediately(); // again ok?
                }

                // get results and put them on the cycle object
                State.Sup.GetCountingResults();

                try
                {
                    // transfer results to my internal representation
                    happyfun = state.TransferResults(meas.AnalysisParams);
                }
                catch (Exception ex)
                {
                    logger.TraceEvent(LogLevels.Error, 142, "EndOfCycleProcessing result transfer internal error: " + ex.Message);
                    happyfun = false;
                }
                try
                {
                    // reset the counters
                    State.Sup.ResetCompletely(closeCounters:false);
                }
                catch (Exception ex)
                {
                    logger.TraceEvent(LogLevels.Error, 143, "EndOfCycleProcessing reset internal error: " + ex.Message);
                    happyfun = false;
                }
                try
                {
                    state.cycle.SetDatastreamEndStatus();
                    CycleProcessing.ApplyTheCycleConditioningSteps(state.cycle, meas);
                    meas.CycleStatusTerminationCheck(state.cycle);

                }
                catch (Exception ex)
                {
                    logger.TraceEvent(LogLevels.Error, 144, "EndOfCycleProcessing summary internal error: " + ex.Message);
                }
            }

            return happyfun;
        }
开发者ID:hnordquist,项目名称:INCC6,代码行数:87,代码来源:LMRDT.cs

示例4: ComputeFromINCC5SRData

        // assumes initalized measurement with at least one cycle, and at least one defined counting analysis result indexed by the detector's mult params, including VSRs fror LM
        void ComputeFromINCC5SRData(Measurement m)
        {
            string pre = (m.AcquireState.data_src == ConstructedSource.Reanalysis ? "Rec" : "C");
            ctrllog.TraceEvent(LogLevels.Info, 34071, pre + "omputing: '" + m.MeasurementId.MeasDateTime.ToString() + ", " + m.MeasOption.PrintName() + "'");
            if (m.Cycles.Count < 1)
            {
                ctrllog.TraceEvent(LogLevels.Error, 34830, "Skipping, no cycles on '" + m.MeasurementId.MeasDateTime.ToString() + ", " + m.MeasOption.PrintName() + "'");
                return;
            }

            if (m.CountingAnalysisResults.Count < 1 || !m.CountingAnalysisResults.HasMultiplicity)
            {
                ctrllog.TraceEvent(LogLevels.Error, 34831, "Bad match between detector and this file type." + (!m.CountingAnalysisResults.HasMultiplicity ? " No Multiplicity counter defined." : ""));
                return; //bad match between detector and this file type.
            }

            SRInstrument PseudoInstrument = new SRInstrument(m.Detector);
            PseudoInstrument.selected = true;
            if (!Instruments.Active.Contains(PseudoInstrument))
                Instruments.Active.Add(PseudoInstrument); // add to global runtime list

            m.CurrentRepetition = 0;
            NC.App.Opstate.SOH = OperatingState.Living;

            try
            {
                MultiplicityCountingRes mcr = (MultiplicityCountingRes)m.CountingAnalysisResults[m.Detector.MultiplicityParams]; // APluralityOfMultiplicityAnalyzers: check for use of multiple analyzers
                // start counting using the per-cycle accumulation of summary results
                Array.Clear(mcr.RAMult, 0, mcr.RAMult.Length);
                Array.Clear(mcr.NormedAMult, 0, mcr.NormedAMult.Length);
                Array.Clear(mcr.UnAMult, 0, mcr.UnAMult.Length);

                mcr.AB.TransferIntermediates(src: m.Detector.AB);  // remove, redundant copy in most cases
                CycleList cl = m.Cycles;
                m.Cycles = new CycleList();
                foreach (Cycle cycle in cl) // process incrementally to match expected outlier processing behavior from INCC
                {
                    if (NC.App.Opstate.IsQuitRequested)  // exit via abort or quit/save, follow-on code decides to continue with processing
                    {
                        ctrllog.TraceEvent(LogLevels.Warning, 430, "Cycle first-pass processing " + NC.App.Opstate.CancelStopAbortStateRep + " at sequence #" + cycle.seq + ", " + m.CurrentRepetition);
                        break;
                    }
                    m.CurrentRepetition++;
                    m.Cycles.Add(cycle);
                    m.SetQCStatus(cycle);
                    CycleProcessing.ApplyTheCycleConditioningSteps(cycle, m);
                    m.CycleStatusTerminationCheck(cycle);
                    ctrllog.TraceEvent(LogLevels.Verbose, 5439, "Cycle " + cycle.seq.ToString());
                    if (m.CurrentRepetition % 8 == 0)
                        FireEvent(EventType.ActionInProgress, this);
                }
                FireEvent(EventType.ActionInProgress, this);
                // trim any None's that were not processed (occurs during a cancel/stop intervention)
                m.Cycles.Trim(m.Detector.MultiplicityParams); // APluralityOfMultiplicityAnalyzers: expand when detector has multiple analyzers
            }
            catch (Exception e)
            {
                NC.App.Opstate.SOH = OperatingState.Trouble;
                ctrllog.TraceException(e, true);
                ctrllog.TraceEvent(LogLevels.Warning, 430, "Processing stopped at cycle " + m.CurrentRepetition);
            }
            finally
            {
                NC.App.Loggers.Flush();
            }

            if (!NC.App.Opstate.IsAbortRequested)  // stop/quit means continue with what is available
            {
                if (m.HasReportableData)
                {
                    m.CalculateMeasurementResults();
                    new ReportMangler(ctrllog).GenerateReports(m);
                    m.SaveMeasurementResults();
                }
            }
            NC.App.Opstate.ResetTokens();
            Instruments.All.Remove(PseudoInstrument);
        }
开发者ID:hnordquist,项目名称:INCC6,代码行数:79,代码来源:FileCtrlINCC5.cs

示例5: EndOfCycleProcessing

        /// <summary>
        /// 
        /// </summary>
        /// <param name="meas"></param>
        /// <returns></returns>
        public override bool EndOfCycleProcessing(Measurement meas, bool last = false)
        {
            bool happyfun = true;

            if (NC.App.Opstate.SOH == NCC.OperatingState.Living) // all other states mean do not wait here
            {
                // drain analyzer queue
                EndCountingWhenFinishedWithPresentEventQueue();
                // wait for results to be available
                AssayPendingWait();
            }
            else
            {
                logger.TraceEvent(LogLevels.Warning, 952, "Processing is '{0}', not waiting for analyzer completion", NC.App.Opstate.SOH);
                EndAnalysisImmediately(); // again ok?
            }

            // the transformed results are already resident on each SR thread controller object

            try
            {
                // not much for this subclass
                happyfun = state.TransferResults(meas.AnalysisParams);
                Cycle.CountingAnalysisResults.Add(SRCtrl.Det.MultiplicityParams, SRCtrl.TransformedResults);
            }
            catch (System.Exception ex)
            {
                logger.TraceEvent(LogLevels.Error, 142, "EndOfCycleProcessing result transfer internal error: " + ex.Message);
                happyfun = false;
            }
            //try
            //{
            //    // reset the counters
            //    State.Sup.ResetCompletely();
            //}
            //catch (Exception ex)
            //{
            //    logger.TraceEvent(LogLevels.Error, 143, "EndOfCycleProcessing reset internal error: " + ex.Message);
            //    happyfun = false;
            //}
            try
            {
                state.cycle.SetDatastreamEndStatus();
                CycleProcessing.ApplyTheCycleConditioningSteps(state.cycle, meas);
                meas.CycleStatusTerminationCheck(state.cycle);
                FlushCycleSummaryResults();
            }
            catch (System.Exception ex)
            {
                logger.TraceEvent(LogLevels.Error, 144, "EndOfCycleProcessing summary internal error: " + ex.Message);
            }

            return happyfun;
        }
开发者ID:hnordquist,项目名称:INCC6,代码行数:59,代码来源:SRRDT.cs


注:本文中的Measurement.CycleStatusTerminationCheck方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。