/// <summary> /// Set up the meta-data needed for cycle processing. /// Important for cycles obtained from files and the database. /// </summary> /// <param name="data_src">Source of cycle data</param> /// <param name="SRType">Expected detector type</param> /// <param name="dto">The start DateTimeOffset timestamp of the cycle</param> /// <param name="path">Filename of source of cycle, if any</param> public void UpdateDataSourceId(ConstructedSource data_src, InstrType SRType, DateTimeOffset dto, string path) { dsid.source = data_src; dsid.SRType = SRType; dsid.FileName = path; dsid.dt = dto; }
public static double TimeBase(this ConstructedSource src, InstrType device) { double te = 1e-7; // JSR files, LMMM and MCA-527 use 100 ns units, but MCA-527 can change switch (device) { case InstrType.PTR32: case InstrType.MCNPX: case InstrType.N1: te = 1e-8; break; } switch (src) // src takes precedence over the inst type { case ConstructedSource.PTRFile: case ConstructedSource.SortedPulseTextFile: te = 1e-8; break; case ConstructedSource.NCDFile: case ConstructedSource.MCA527File: // LMMM and MCA-527 use 100 ns units, but MCA-527 can change (a header field value) te = 1e-7; break; } return(te); }
/// <summary> /// if this combination of data source and specific device point to a virtual SR return true o.w. false /// </summary> /// <param name="src"></param> /// <param name="device"></param> /// <returns></returns> public static bool UsingVirtualSRCounting(this ConstructedSource src, InstrType device) { bool needsAdditionalSpecification = ((src == ConstructedSource.Live && (device >= InstrType.NPOD && device <= InstrType.MCA527)) // it is a Live LM DAQ, or || (src >= ConstructedSource.NCDFile && src <= ConstructedSource.SortedPulseTextFile)); // data from other source and the processing went through the raw counting code return(needsAdditionalSpecification); }
public static string NameForViewing(this ConstructedSource src, InstrType device) { if (device.IsListMode() && src.Live()) { return(ListModeLiveName); } else { return(PrettyName[src]); } }
public DataSourceIdentifier(DataSourceIdentifier dsid) { iname = string.Copy(dsid.iname); srtype = dsid.srtype; version = dsid.version; elecid = string.Copy(dsid.elecid); filename = string.Copy(dsid.filename); dt = new DateTimeOffset(dsid.dt.Ticks, dsid.dt.Offset); source = dsid.source; desc = string.Copy(dsid.desc); type = string.Copy(dsid.type); Type t = dsid.conninfo.GetType(); ConstructorInfo ci = t.GetConstructor(new Type[] { t }); conninfo = (ConnectionInfo)ci.Invoke(new object[] { dsid.conninfo }); }
public static double TimeBase(this ConstructedSource src, InstrType device) { double te = 1e-7; switch (device) { case InstrType.PTR32: case InstrType.MCNPX: case InstrType.NILA: // TODO: not yet defined Nov 2013 MTS case InstrType.N1: te = 1e-8; break; } switch (src) { case ConstructedSource.PTRFile: case ConstructedSource.SortedPulseTextFile: case ConstructedSource.NILAFile: te = 1e-8; break; } return(te); }
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); }
public static string HappyFunName(this ConstructedSource src) { return(PrettyName[src]); }
public static bool LMFiles(this ConstructedSource src, InstrType device) { bool ack = (src >= ConstructedSource.NCDFile && src <= ConstructedSource.SortedPulseTextFile) && device.IsListMode(); // data from other source and the processing went through the raw counting code return(ack); }
public static bool MightHaveScalerData(this ConstructedSource src, InstrType device) { return((device <= InstrType.UNAP) && (src.INCC5FileData() || src.INCCTransferData() || src == ConstructedSource.Reanalysis)); }
public static bool SRDAQ(this ConstructedSource src, InstrType device) { return((src == ConstructedSource.Live) && (device <= InstrType.UNAP)); // it is a Live SR DAQ }
public static bool INCCTransferData(this ConstructedSource src) { return(src == ConstructedSource.INCCTransferCopy || src == ConstructedSource.INCCTransfer); }
public static bool INCC5FileData(this ConstructedSource src) { return(src == ConstructedSource.DB || src == ConstructedSource.CycleFile || src == ConstructedSource.ReviewFile || src == ConstructedSource.Manual); }
public static bool AcquireChoices(this ConstructedSource src) { return(src >= ConstructedSource.Live && src <= ConstructedSource.ReviewFile); }
public static bool Live(this ConstructedSource src) { return(src == ConstructedSource.Live); }
/// <summary> /// Set up the meta-data needed for cycle processing. /// Important for cycles obtained from files and the database. /// </summary> /// <param name="data_src">Source of cycle data</param> /// <param name="SRType">Expected detector type</param> /// <param name="dto">The start DateTimeOffset timestamp of the cycle</param> /// <param name="path">Filename of source of cycle, if any</param> public void UpdateDataSourceId(ConstructedSource data_src, InstrType SRType, DateTimeOffset dto, string path) { dsid.source = data_src; dsid.SRType = SRType; if (!string.IsNullOrEmpty(path)) dsid.FileName = path; dsid.dt = dto; }
public static bool IsDB(this ConstructedSource src) { return(src == ConstructedSource.DB); }