Ejemplo n.º 1
0
        public DataColumnInReportDefinition Add(DataColumnInReportTypeEnum columnType, DataColumnInfoSourceEnum infoSource)
        {
            DataColumnInReportDefinition output = new DataColumnInReportDefinition();

            output.columnType = columnType;
            output.infoSource = infoSource;
            Add(columnType.ToString(), output);
            return(output);
        }
Ejemplo n.º 2
0
        public DataColumnInReportDefinition Add(DataColumnInReportTypeEnum columnType, DataColumn column, dataPointAggregationType aggregation, string unit = "")
        {
            DataColumnInReportDefinition output = new DataColumnInReportDefinition();

            output.columnType       = columnType;
            output.aggregation      = aggregation;
            output.columnSourceName = column.ColumnName;
            output.columnPriority   = column.GetPriority();
            output.format           = column.GetFormat();

            Type   valueType = typeof(string);
            string name = ""; string description = ""; string letter = "";

            switch (aggregation)
            {
            default:
            case dataPointAggregationType.max:
            case dataPointAggregationType.min:
            case dataPointAggregationType.sum:
            case dataPointAggregationType.firstEntry:
            case dataPointAggregationType.lastEntry:
            case dataPointAggregationType.range:
                valueType = column.DataType;
                break;

            case dataPointAggregationType.avg:
            case dataPointAggregationType.stdev:
            case dataPointAggregationType.var:
            case dataPointAggregationType.entropy:
                valueType = typeof(double);
                if (output.format.isNullOrEmpty())
                {
                    output.format = "F5";
                }
                break;

            case dataPointAggregationType.count:
                valueType = typeof(int);
                break;
            }
            letter = column.GetLetter();

            if (columnType == DataColumnInReportTypeEnum.dataSummed)
            {
                if (!letter.isNullOrEmpty())
                {
                    letter = aggregation.ToString() + "(" + letter + ")";
                }
                output.columnLetter = letter;

                output.columnDescription = "(" + aggregation.ToString() + ") of " + column.ColumnName + ". " + column.GetDesc();
            }
            output.columnName       = column.ColumnName + " (" + aggregation.ToString() + ")";
            output.columnSourceName = column.ColumnName;

            output.importance      = column.GetImportance();
            output.columnUnit      = column.GetUnit();
            output.columnValueType = valueType;
            output.columnDefault   = valueType.GetDefaultValue();
            output.columnGroup     = column.GetGroup();

            output.spe = column.GetSPE();
            Add(column.ColumnName, output);

            return(output);
        }