public string[] StringifyCycleMultiplicityDetails() { string[] x = null; try { int j = 0; RatesResultEnhanced rrm = countresults.GetFirstRatesResultMod(); // devnote: only the first is used here, still need multiple rate analyzer output x = new string[3]; if (rrm != null) { x[j++] = string.Format("Channel hits (BaseA): {0}", rrm.NsChnImage()); x[j++] = string.Format("Channel hits (CyclC): {0}", NsChnImage()); x[j++] = string.Format("Cycle status text: " + LMLoggers.LognLM.FlattenChars(Message)); System.Collections.IEnumerator iter = countresults.GetATypedResultEnumerator(typeof(AnalysisDefs.Multiplicity)); while (iter.MoveNext()) { MultiplicityCountingRes mcr = (MultiplicityCountingRes)iter.Current; try { string[] temp = mcr.StringifyCurrentMultiplicityDetails(); Array.Resize(ref x, temp.Length + x.Length); Array.Copy(temp, 0, x, j, temp.Length); j += temp.Length; } catch (Exception ex) { logger?.TraceEvent(LogLevels.Error, 87118, "StringifyCycleMultiplicityDetails error: " + ex.Message); } } } else { x = new string[1] { "" }; //Martyn says this is useless. HN 10-6-2015 //x[j++] = "No multiplicity data for JSR-12 instruments."; } } catch (Exception ex2) { logger?.TraceEvent(LogLevels.Error, 87119, "StringifyCycleMultiplicityDetails error: " + ex2.Message); } return(x); }
public bool Transfer(BaseRate ba, RateResult rates) { if (rates == null) { return(true); } bool res = true; try { RatesResultEnhanced rrm = new RatesResultEnhanced(rates.numCompletedGates, ba.gateWidthTics); rrm.totaltime = new TimeSpan(this.TS.Ticks); countresults.Add(ba, rrm); rrm.TransferRawResult(rates); } catch (OutOfMemoryException e) { ba.reason = "BaseRate transfer " + e.Message; res = false; logger?.TraceEvent(LogLevels.Error, 87405, ba.reason); } return(res); }
public bool Transfer(BaseRate ba, RateResult rates) { if (rates == null) return true; bool res = true; try { RatesResultEnhanced rrm = new RatesResultEnhanced(rates.numCompletedGates, ba.gateWidthTics); rrm.totaltime = new TimeSpan(this.TS.Ticks); countresults.Add(ba, rrm); rrm.TransferRawResult(rates); } catch (OutOfMemoryException e) { ba.reason = "BaseRate transfer " + e.Message; res = false; logger.TraceEvent(LogLevels.Error, 87405, ba.reason); } return res; }
// todo: these are too much cut-and-paste, the class design is shouting out loud here through the results class hierarchy, so do one Row[] GenRatesRows(RatesResultEnhanced rrm, Cycle c = null) { Row[] rows = new Row[2]; rows[0] = GenRatesParamsRow(rrm, c); // interval and completed intervals Row[] rows2 = GenRatesDataRows(rrm, c); // the channel rate for the cycle rows[1] = rows2[0]; return rows; }
Row GenRatesParamsRow(RatesResultEnhanced rrm, Cycle c = null) { Row row = new Row(); int shift = 0; if (c != null) { row.Add(0, c.seq.ToString()); shift = 1; } row.Add((int)RateInterval.GateWidth + shift, rrm.gateWidthInTics.ToString()); row.Add((int)RateInterval.CompletedGates + shift, rrm.completedIntervals.ToString()); row.Add((int)RateInterval.OverallTime + shift, rrm.totaltime.TotalSeconds.ToString()); return row; }
Row[] GenRatesDataRows(RatesResultEnhanced rrm, Cycle c = null) { Row[] rows = { new Row() }; int shift = 0; if (c != null) // add the cycle label column { rows[0].Add(0, c.seq.ToString()); shift = 1; } // the channel hits/gatewidth for the cycle for (int i = 0; i < N.ChannelCount; i++) { double v = 0; if (c.TS.TotalSeconds != 0) v = rrm.neutronsPerChannel[i] / c.TS.TotalSeconds; rows[0].Add(i + shift, v.ToString()); } return rows; }
Row[] GenChnCountsRow(RatesResultEnhanced rrm, Cycle c = null) { Row[] rows = { new Row() }; int shift = 0; if (c != null) // add the cycle label column { rows[0].Add(0, c.seq.ToString()); shift = 1; } // the channel hits for the cycle for (int i = 0; i < N.ChannelCount; i++) { rows[0].Add(i + shift, rrm.neutronsPerChannel[i].ToString()); } return rows; }