Пример #1
0
        public static void mapSmartTraceCall_into_DataGridView(DataGridView dgvDataGridView,
                                                               TraceType tTraceType,
                                                               O2AssessmentData_OunceV6 fadO2AssessmentDataOunceV6)
        {
            var lsSmartTraceCalls = new List<Int32>();

            dgvDataGridView.Columns.Clear();
            dgvDataGridView.Columns.Add("ID", tTraceType + " ID");
            dgvDataGridView.Columns.Add("Signature", tTraceType + " Signature");
            dgvDataGridView.Columns.Add("Number of Occurences", "Number of Occurences");
            dgvDataGridView.Columns.Add("Number of Occurences ND", "Number of Occurences ND");
            dgvDataGridView.Columns.Add("Number of Occurences IR", "Number of Occurences IR");

            int iFindings = 0, iTracesFound = 0;
            if (StringsAndLists.notNull(fadO2AssessmentDataOunceV6.arAssessmentRun, typeof (AssessmentRun).Name))
                if (null != fadO2AssessmentDataOunceV6.arAssessmentRun.Assessment.Assessment)
                    foreach (Assessment aAssessment in fadO2AssessmentDataOunceV6.arAssessmentRun.Assessment.Assessment)
                        foreach (AssessmentAssessmentFile afAssessmentFile in aAssessment.AssessmentFile)
                            if (null != afAssessmentFile.Finding)
                                foreach (AssessmentAssessmentFileFinding fFinding in afAssessmentFile.Finding)
                                {
                                    iFindings++;
                                    if (fFinding.Trace != null)
                                    {
                                        iTracesFound++;
                                        int iSmartTraces =
                                            AnalysisSearch.findTraceTypeInSmartTrace_Recursive_returnSigId(
                                                fFinding.Trace, tTraceType);
                                        if (-1 != iSmartTraces && false == lsSmartTraceCalls.Contains(iSmartTraces))
                                            lsSmartTraceCalls.Add(iSmartTraces);
                                    }
                                }

            dgvDataGridView.DataSource = null;
            int iSmartTrace_Sum = 0, iNotDuplicated_Sum = 0, iIgnoreRoot_Sum = 0;
            /// need to figure out what are the cases when iSmartTraceIndex =0
            foreach (int iSmartTraceIndex in lsSmartTraceCalls)
                if (iSmartTraceIndex > 0)
                {
                    int iSmartTrace = 0, iNotDuplicated = 0, iIgnoreRoot = 0;
                    calculateSmartTraceCallStatistics(fadO2AssessmentDataOunceV6.arAssessmentRun, (UInt32) iSmartTraceIndex,
                                                      tTraceType, ref iSmartTrace, ref iNotDuplicated, ref iIgnoreRoot);
                    iSmartTrace_Sum += iSmartTrace;
                    iNotDuplicated_Sum += iNotDuplicated;
                    iIgnoreRoot_Sum += iIgnoreRoot;
                    dgvDataGridView.Rows.Add(new Object[]
                                                 {
                                                     iSmartTraceIndex,
                                                     fadO2AssessmentDataOunceV6.arAssessmentRun.StringIndeces[
                                                         iSmartTraceIndex - 1].value,
                                                     //iKey-1 because of the way StringIndeces is populated   
                                                     iSmartTrace,
                                                     iNotDuplicated,
                                                     iIgnoreRoot
                                                 });
                }
                else
                    DI.log.error("_NOT RECOGNIZED STRING for ID ", iSmartTraceIndex.ToString());


            // reset DataGridView Column width
            O2Forms.dataGridView_Utils_MaxColumnsWidth(dgvDataGridView);
            // all done
            DI.log.info(
                "Found {0} Unique SmartTraces of Type {1}   (In {2} Findings (with {3} traces)). Totals: SmartTraces={4} , NonDuplicated={5} , IgnoreRoot = {6} ",
                lsSmartTraceCalls.Count.ToString(), tTraceType.ToString(), iFindings.ToString(), iTracesFound.ToString(),
                iSmartTrace_Sum.ToString(), iNotDuplicated_Sum.ToString(), iIgnoreRoot_Sum.ToString());
        }
Пример #2
0
		public virtual void Trace(IAgentInfo agentInfo, TraceType traceType, params object[] values) {
			this.Trace(agentInfo, traceType.ToString(), values);
		}