protected bool BuildClusterValuesStruct(AnalysisParams analysis) { //Private Function BuildClusterValuesStruct(Analysis As AnalysisParams) As Boolean //Dim I As Long //Dim SubStr As String // I = 1 // SubStr = ExtractSubString(txtClusterValues, ";", I) // Do While Trim(SubStr) <> "" // If UBound(Analysis.CP) = 0 Then // ReDim Analysis.CP(1 To I) As ClusterParam // Else // ReDim Preserve Analysis.CP(1 To I) As ClusterParam // End If // If InStr(1, SubStr, "-") > 0 Then // Analysis.CP(I).Type = cnstClusterValueRange // Analysis.CP(I).From = CVar(ExtractSubString(SubStr, "-", 1)) // Analysis.CP(I).To = CVar(ExtractSubString(SubStr, "-", 2)) // Else // Analysis.CP(I).Type = cnstClusterUniqueValue // Analysis.CP(I).Equale = CVar(SubStr) // End If // I = I + 1 // SubStr = ExtractSubString(txtClusterValues, ";", I) // Loop //End Function }
/// <summary> /// Object hash code /// </summary> /// <returns></returns> public override int GetHashCode() { unchecked { var hashCode = Name != null?Name.GetHashCode() : 0; hashCode = (hashCode * 397) ^ (AnalysisSoftware != null ? AnalysisSoftware.GetHashCode() : 0); hashCode = (hashCode * 397) ^ (AnalysisParams != null ? AnalysisParams.GetHashCode() : 0); hashCode = (hashCode * 397) ^ (Threshold != null ? Threshold.GetHashCode() : 0); return(hashCode); } }
/// <summary> /// Imprint a new measurement with as much information as possible from a results_rec. /// </summary> /// <param name="rec">The results_rec with the measurement details</param> /// <param name="meaId">Unique id for the measurement, from the results_rec fields</param> /// <param name="logger">logger handle</param> /// <returns>A new measurement</returns> public Measurement(INCCResults.results_rec rec, MeasId meaId, LMLoggers.LognLM logger) { HVCalibrationParameters hv = NCC.IntegrationHelpers.GetCurrentHVCalibrationParams(rec.det); MeasurementTuple mt = new MeasurementTuple(new DetectorList(rec.det), rec.tests, rec.norm, rec.bkg, rec.iso, rec.acq, hv); this.mt = mt; this.logger = logger; mid = meaId; InitMisc(); if (rec.det.ListMode) { AnalysisParams = NC.App.LMBD.CountingParameters(rec.det, applySRFromDetector: true); if (meaId.MeasOption.IsListMode()) // pure List Mode, not INCC5 { // for a list-mode-only measurement with a multiplicity analyzer the detector SR params must match at least one of the multiplicity analyzer SR params NCC.IntegrationHelpers.ApplyVSRChangesToDefaultDetector(this); } else // it is an INCC5 analysis driven with LM data { // prepare or identify an active CA entry with matching CA gatewidth and FA, with remaining SR params as the detector AnalysisParams.PrepareMatchingVSR(rec.det.MultiplicityParams); } } else { // prepare analyzer params from detector SR params AnalysisParams = NC.App.LMBD.CountingParameters(rec.det, applySRFromDetector: false); if (!AnalysisParams.Exists(w => { return((w is Multiplicity) && (w as Multiplicity).Equals(rec.det.MultiplicityParams)); })) { AnalysisParams.Add(rec.det.MultiplicityParams); } } // get the INCC5 analysis methods INCCAnalysisState = new INCCAnalysisState(); INCCSelector sel = new INCCSelector(rec.acq.detector_id, rec.acq.item_type); AnalysisMethods am; bool found = NC.App.DB.DetectorMaterialAnalysisMethods.TryGetValue(sel, out am); if (found) { am.selector = sel; // gotta do this so that the equality operator is correct INCCAnalysisState.Methods = am; } else { INCCAnalysisState.Methods = new AnalysisMethods(sel); } InitializeContext(clearCounterResults: true); PrepareINCCResults(); // a list mode measurement may not have a multiplicity analyzer at all, create on results, copying the current values if (CountingAnalysisResults.ContainsKey(rec.det.MultiplicityParams)) { MultiplicityCountingRes mcr = (MultiplicityCountingRes)CountingAnalysisResults[rec.det.MultiplicityParams]; if (rec.mcr.AB.Unset) { SDTMultiplicityCalculator.SetAlphaBeta(rec.det.MultiplicityParams, rec.mcr); // works only if MaxBins is set } mcr.CopyFrom(rec.mcr); // copy the mcr results onto the first moskey entry // the same results are copied to the full results structure MeasOptionSelector mos = new MeasOptionSelector(MeasOption, rec.det.MultiplicityParams); INCCResult result = INCCAnalysisState.Lookup(mos); result.CopyFrom(rec.mcr); } Stratum = new Stratum(rec.st); // the stratum from the results rec }