コード例 #1
0
        protected override TableDefinition Content(ReportData reportData, Dictionary <string, string> options)
        {
            TableDefinition resultTable = null;

            if (null != reportData &&
                null != reportData.CurrentSnapshot)
            {
                double?automatedFPoints = MeasureUtility.GetAutomatedIFPUGFunction(reportData.CurrentSnapshot);
                double?decisionPoints   = MeasureUtility.GetDecisionPointsNumber(reportData.CurrentSnapshot);
                double?backFiredFPoints = MeasureUtility.GetBackfiredIFPUGFunction(reportData.CurrentSnapshot);

                const string metricFormat = "N0";
                var          rowData      = new List <string>()
                {
                    Labels.Name, Labels.Total
                    , Labels.AutomatedFP, (automatedFPoints.HasValue ?  automatedFPoints.Value.ToString(metricFormat) : CastReporting.Domain.Constants.No_Data)
                    , Labels.DecisionP, (decisionPoints.HasValue ?  (decisionPoints.Value).ToString(metricFormat) : CastReporting.Domain.Constants.No_Data)
                    , Labels.BackfiredFP, (backFiredFPoints.HasValue ?  (backFiredFPoints.Value).ToString(metricFormat) :CastReporting.Domain.Constants.No_Data)
                };
                resultTable = new TableDefinition
                {
                    HasRowHeaders    = false,
                    HasColumnHeaders = true,
                    NbRows           = 6,
                    NbColumns        = 2,
                    Data             = rowData
                };
            }
            return(resultTable);
        }
コード例 #2
0
        public override TableDefinition Content(ReportData reportData, Dictionary <string, string> options)
        {
            if (reportData?.CurrentSnapshot == null)
            {
                return(null);
            }
            double?automatedFPoints = MeasureUtility.GetAutomatedIFPUGFunction(reportData.CurrentSnapshot);
            double?decisionPoints   = MeasureUtility.GetDecisionPointsNumber(reportData.CurrentSnapshot);
            double?backFiredFPoints = MeasureUtility.GetBackfiredIFPUGFunction(reportData.CurrentSnapshot);

            const string metricFormat = "N0";
            var          rowData      = new List <string>()
            {
                Labels.Name, Labels.Total
                , Labels.AutomatedFP, automatedFPoints?.ToString(metricFormat) ?? Domain.Constants.No_Value
                , Labels.DecisionP, decisionPoints?.ToString(metricFormat) ?? Domain.Constants.No_Value
                , Labels.BackfiredFP, backFiredFPoints?.ToString(metricFormat) ?? Domain.Constants.No_Value
            };
            var resultTable = new TableDefinition
            {
                HasRowHeaders    = false,
                HasColumnHeaders = true,
                NbRows           = 4,
                NbColumns        = 2,
                Data             = rowData
            };

            return(resultTable);
        }
コード例 #3
0
        public override TableDefinition Content(ReportData reportData, Dictionary <string, string> options)
        {
            TableDefinition resultTable = null;

            if (reportData?.CurrentSnapshot == null)
            {
                return(resultTable);
            }

            #region Declarations

            double?automatedFPoints = MeasureUtility.GetAutomatedIFPUGFunction(reportData.CurrentSnapshot);
            double?decisionPoints   = MeasureUtility.GetDecisionPointsNumber(reportData.CurrentSnapshot);
            double?backFiredFPoints = MeasureUtility.GetBackfiredIFPUGFunction(reportData.CurrentSnapshot);

            double?automatedFPointsPrev = MeasureUtility.GetAutomatedIFPUGFunction(reportData.PreviousSnapshot);
            double?decisionPointsPrev   = MeasureUtility.GetDecisionPointsNumber(reportData.PreviousSnapshot);
            double?backFiredFPointsPrev = MeasureUtility.GetBackfiredIFPUGFunction(reportData.PreviousSnapshot);

            double?automatedFPointsEvol = MathUtility.GetEvolution(automatedFPoints, automatedFPointsPrev);
            double?decisionPointsEvol   = MathUtility.GetEvolution(decisionPoints, decisionPointsPrev);
            double?backFiredFPointsEvol = MathUtility.GetEvolution(backFiredFPoints, backFiredFPointsPrev);

            double?automatedFPointsPercent = MathUtility.GetPercent(automatedFPointsEvol, automatedFPointsPrev);
            double?decisionPointsPercent   = MathUtility.GetPercent(decisionPointsEvol, decisionPointsPrev);
            double?backFiredFPointsPercent = MathUtility.GetPercent(backFiredFPointsEvol, backFiredFPointsPrev);

            bool hasPrevious = (reportData.PreviousSnapshot != null);

            #endregion

            const string noData       = Constants.No_Value;
            const string metricFormat = "N0";

            var rowData = new List <string>
            {
                Labels.Name, Labels.Current, Labels.Previous, Labels.Evolution, Labels.EvolutionPercent

                , Labels.AutomatedFP
                , automatedFPoints?.ToString(metricFormat) ?? noData
                , (hasPrevious && automatedFPointsPrev.HasValue)?  automatedFPointsPrev.Value.ToString(metricFormat) : noData
                , (hasPrevious && automatedFPointsEvol.HasValue)? FormatEvolution((int)automatedFPointsEvol.Value) : noData
                , (automatedFPointsPercent.HasValue)? FormatPercent(automatedFPointsPercent.Value): noData
                , Labels.DecisionP
                , decisionPoints?.ToString(metricFormat) ?? noData
                , (hasPrevious && decisionPointsPrev.HasValue)? decisionPointsPrev.Value.ToString(metricFormat) : noData
                , (hasPrevious && decisionPointsEvol.HasValue)? FormatEvolution((int)decisionPointsEvol.Value) : noData
                , (decisionPointsPercent.HasValue)? FormatPercent(decisionPointsPercent.Value): noData
                , Labels.BackfiredFP
                , backFiredFPoints?.ToString(metricFormat) ?? noData
                , (hasPrevious && backFiredFPointsPrev.HasValue)? backFiredFPointsPrev.Value.ToString(metricFormat) : noData
                , (hasPrevious && backFiredFPointsEvol.HasValue)? FormatEvolution((int)Math.Round(backFiredFPointsEvol.Value, 0)) : noData
                , (backFiredFPointsPercent.HasValue)? FormatPercent(backFiredFPointsPercent.Value): noData
            };

            resultTable = new TableDefinition
            {
                HasRowHeaders    = false,
                HasColumnHeaders = true,
                NbRows           = 4,
                NbColumns        = 5,
                Data             = rowData
            };
            return(resultTable);
        }