本文整理汇总了C#中Measurement.SaveMeasurementResults方法的典型用法代码示例。如果您正苦于以下问题:C# Measurement.SaveMeasurementResults方法的具体用法?C# Measurement.SaveMeasurementResults怎么用?C# Measurement.SaveMeasurementResults使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Measurement
的用法示例。
在下文中一共展示了Measurement.SaveMeasurementResults方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: 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);
}
示例2: 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);
}
示例3: 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);
}