/// <summary>
        ///    create a bare bone datacolumn with the given id, name, path and dimension
        ///    Also makes sure that molweight is being updated for the created column
        /// </summary>
        private DataColumn createDataColumn(string columnId, string columnName, IEnumerable <string> path, IQuantity quantity,
                                            IDimension dimension, BaseGrid timeColumn, Simulation simulation)
        {
            var newColumn = new DataColumn(columnId, columnName, dimension, timeColumn)
            {
                QuantityInfo = new QuantityInfo(path, quantity.QuantityType),
                DataInfo     = newDataInfo(dimension),
            };

            _dataRepositoryTask.UpdateMolWeight(newColumn, quantity, simulation.Model);
            return(newColumn);
        }
示例#2
0
        private DataColumn createColumn(BaseGrid xValues, IQuantity quantity, IValues yValues, IEnumerable <string> quantityPath, IModelCoreSimulation simulation)
        {
            var column = new DataColumn(_dataNamingService.GetEntityName(yValues.EntityId), quantity.Dimension, xValues)
            {
                DataInfo =
                {
                    Origin              = ColumnOrigins.Calculation,
                    ComparisonThreshold = (float)yValues.ComparisonThreshold
                },
                Values       = new List <float>(yValues.Values.ToFloatArray()),
                QuantityInfo = new QuantityInfo(yValues.Name, quantityPath, quantity.QuantityType),
                DisplayUnit  = _displayUnitRetriever.PreferredUnitFor(quantity)
            };

            _dataRepositoryTask.UpdateMolWeight(column, quantity, simulation.Model);

            return(column);
        }