Example #1
0
        /*
         * call ConstructReportSections with a cycle to
         *   gen empty row
         *   gen header row
         *   gen data row(s)
         */
        protected Section ConstructReportSection(ReportSections section)
        {
            Section sec = null;
            if (!(bool)selectedReportSections.GetValue((int)section))
                return sec;
            try
            {
                Row[] temp;
                switch (section)
                {
                    case ReportSections.SofwareContext:
                        temp = GenSoftwareConfigRows();
                        sec = new Section(null, 1, 1, temp.Length);
                        sec[1].Add(0, "Software application configuration details");
                        sec.InsertRange(sec.dataidx, temp);
                        break;
                    case ReportSections.DescriptiveSummary:
                        sec = new Section(typeof(DescriptiveSummary), 0, 1, 1);
                        sec.Add(GenDescriptiveSummaryRow());
                        break;
                    case ReportSections.MeasurementDetails:
                        sec = new Section(typeof(MeasurementDetails), 0, 1, 1);
                        sec.Add(GenMeasurementDetailsRow(meas.CountingAnalysisResults.HasMultiplicity));
                        break;
                    case ReportSections.DetectorCalibration:

                        sec = new Section(typeof(DetectorCalibration), 0, 1, 1);
                        Row hcrow = sec[sec.Count - 1];
                        hcrow.Clear();
                        hcrow.TS = DetectorCalibrationHeader;
                        if (meas.CountingAnalysisResults.HasMultiplicity)
                        {
                            hcrow.GenFromEnum(typeof(DetectorCalibration), null, 0);
                            // there is a disconnect between the detector list and the Instrument list,
                            // there is disconnect between the detector and the subordinate SR analyzer param sets;
                            IEnumerator iter = meas.CountingAnalysisResults.GetMultiplicityEnumerator(true);
                            while (iter.MoveNext())
                            {
                                Multiplicity mkey = (Multiplicity)((KeyValuePair<SpecificCountingAnalyzerParams, object>)(iter.Current)).Key;
                                sec.Add(GenDetectorCalibrationRow(meas.Detector, mkey));
                            }
                        }
                        else
                        {
                            hcrow.GenFromEnum(typeof(BaseDetectorCalibration), null, 0);
                            sec.Add(GenDetectorCalibrationRow(meas.Detector));
                        }

                        break;
                    case ReportSections.ComputedMultiplicityIntermediates:
                        // RA, A, alpha, beta
                        // 0...3 rows
                        //sec = DoAcrossForManyMults("Averaged moments (NNV)", typeof(ComputedMultiplicityIntermediates), false);
                        //temp = GenMultiplicityIntermediatesRow(m.CountingAnalysisResults);
                        //sec.AddRange(temp);
                        break;
                    case ReportSections.ChannelCounts:
                        temp = GenChannelCountsRows();
                        sec = new Section(typeof(ChannelCounts), 1, 1, temp.Length);
                        sec[1].Add(0, "Hits per channel sums");
                        sec.InsertRange(sec.dataidx, temp);
                        break;
                    case ReportSections.ChannelRates:
                        temp = GenChannelRatesRows();
                        sec = new Section(typeof(ChannelCounts), 1, 1, temp.Length);
                        sec[1].Add(0, "Channel hits per second (averaged over the cycles)");
                        sec.InsertRange(sec.dataidx, temp);
                        break;
                    case ReportSections.RawAndMultSums:
                        sec = DoAcrossForManyMults("Summed cycle data", typeof(RawSums), false);
                        if (sec != null)
                        {
                            sec.Add(GenRawSumsRow(meas.CountingAnalysisResults));  // done: uses # of analyzers and goes across
                            temp = GenMultDistRows(meas.CountingAnalysisResults, 0); //done: sum for all analyzers, see method comments
                            Section sec2 = new Section(typeof(DistributionsAndAlphaBeta), 0, 0, temp.Length, "Bin", meas.CountingAnalysisResults.GetResultsCount(typeof(Multiplicity)));
                            sec.AddRange(sec2);
                            sec.AddRange(temp);
                        }
                        break;
                }
            }
            catch (Exception e)
            {
                ctrllog.TraceException(e);
            }
            return sec;
        }