Esempio n. 1
0
        public IEnumerable <IMeasurement> Unmap(SEL421_PowerCalculator.Model.SEL421.Outputs outputData, SEL421_PowerCalculator.Model.SEL421._OutputsMeta outputMeta)
        {
            List <IMeasurement> measurements  = new List <IMeasurement>();
            TypeMapping         outputMapping = MappingCompiler.GetTypeMapping(OutputMapping);

            CollectFromSEL421Outputs(measurements, outputMapping, outputData, outputMeta);

            return(measurements);
        }
Esempio n. 2
0
        private SEL421_PowerCalculator.Model.SEL421.Outputs FillSEL421Outputs(TypeMapping typeMapping)
        {
            Dictionary <string, FieldMapping> fieldLookup = typeMapping.FieldMappings.ToDictionary(mapping => mapping.Field.Identifier);

            SEL421_PowerCalculator.Model.SEL421.Outputs obj = new SEL421_PowerCalculator.Model.SEL421.Outputs();

            {
                // We don't need to do anything, but we burn a key index to keep our
                // array index in sync with where we are in the data structure
                BurnKeyIndex();
            }

            {
                // We don't need to do anything, but we burn a key index to keep our
                // array index in sync with where we are in the data structure
                BurnKeyIndex();
            }

            {
                // We don't need to do anything, but we burn a key index to keep our
                // array index in sync with where we are in the data structure
                BurnKeyIndex();
            }

            {
                // We don't need to do anything, but we burn a key index to keep our
                // array index in sync with where we are in the data structure
                BurnKeyIndex();
            }

            {
                // We don't need to do anything, but we burn a key index to keep our
                // array index in sync with where we are in the data structure
                BurnKeyIndex();
            }

            {
                // We don't need to do anything, but we burn a key index to keep our
                // array index in sync with where we are in the data structure
                BurnKeyIndex();
            }

            {
                // We don't need to do anything, but we burn a key index to keep our
                // array index in sync with where we are in the data structure
                BurnKeyIndex();
            }

            {
                // We don't need to do anything, but we burn a key index to keep our
                // array index in sync with where we are in the data structure
                BurnKeyIndex();
            }

            {
                // We don't need to do anything, but we burn a key index to keep our
                // array index in sync with where we are in the data structure
                BurnKeyIndex();
            }

            {
                // We don't need to do anything, but we burn a key index to keep our
                // array index in sync with where we are in the data structure
                BurnKeyIndex();
            }

            {
                // We don't need to do anything, but we burn a key index to keep our
                // array index in sync with where we are in the data structure
                BurnKeyIndex();
            }

            {
                // We don't need to do anything, but we burn a key index to keep our
                // array index in sync with where we are in the data structure
                BurnKeyIndex();
            }

            return(obj);
        }
Esempio n. 3
0
        private void CollectFromSEL421Outputs(List <IMeasurement> measurements, TypeMapping typeMapping, SEL421_PowerCalculator.Model.SEL421.Outputs data, SEL421_PowerCalculator.Model.SEL421._OutputsMeta meta)
        {
            Dictionary <string, FieldMapping> fieldLookup = typeMapping.FieldMappings.ToDictionary(mapping => mapping.Field.Identifier);

            {
                // Convert value from "P1" field to measurement
                FieldMapping fieldMapping = fieldLookup["P1"];
                IMeasurement measurement  = MakeMeasurement(meta.P1, (double)data.P1);
                measurements.Add(measurement);
            }

            {
                // Convert value from "P2" field to measurement
                FieldMapping fieldMapping = fieldLookup["P2"];
                IMeasurement measurement  = MakeMeasurement(meta.P2, (double)data.P2);
                measurements.Add(measurement);
            }

            {
                // Convert value from "P3" field to measurement
                FieldMapping fieldMapping = fieldLookup["P3"];
                IMeasurement measurement  = MakeMeasurement(meta.P3, (double)data.P3);
                measurements.Add(measurement);
            }

            {
                // Convert value from "P4" field to measurement
                FieldMapping fieldMapping = fieldLookup["P4"];
                IMeasurement measurement  = MakeMeasurement(meta.P4, (double)data.P4);
                measurements.Add(measurement);
            }

            {
                // Convert value from "P5" field to measurement
                FieldMapping fieldMapping = fieldLookup["P5"];
                IMeasurement measurement  = MakeMeasurement(meta.P5, (double)data.P5);
                measurements.Add(measurement);
            }

            {
                // Convert value from "P6" field to measurement
                FieldMapping fieldMapping = fieldLookup["P6"];
                IMeasurement measurement  = MakeMeasurement(meta.P6, (double)data.P6);
                measurements.Add(measurement);
            }

            {
                // Convert value from "Q1" field to measurement
                FieldMapping fieldMapping = fieldLookup["Q1"];
                IMeasurement measurement  = MakeMeasurement(meta.Q1, (double)data.Q1);
                measurements.Add(measurement);
            }

            {
                // Convert value from "Q2" field to measurement
                FieldMapping fieldMapping = fieldLookup["Q2"];
                IMeasurement measurement  = MakeMeasurement(meta.Q2, (double)data.Q2);
                measurements.Add(measurement);
            }

            {
                // Convert value from "Q3" field to measurement
                FieldMapping fieldMapping = fieldLookup["Q3"];
                IMeasurement measurement  = MakeMeasurement(meta.Q3, (double)data.Q3);
                measurements.Add(measurement);
            }

            {
                // Convert value from "Q4" field to measurement
                FieldMapping fieldMapping = fieldLookup["Q4"];
                IMeasurement measurement  = MakeMeasurement(meta.Q4, (double)data.Q4);
                measurements.Add(measurement);
            }

            {
                // Convert value from "Q5" field to measurement
                FieldMapping fieldMapping = fieldLookup["Q5"];
                IMeasurement measurement  = MakeMeasurement(meta.Q5, (double)data.Q5);
                measurements.Add(measurement);
            }

            {
                // Convert value from "Q6" field to measurement
                FieldMapping fieldMapping = fieldLookup["Q6"];
                IMeasurement measurement  = MakeMeasurement(meta.Q6, (double)data.Q6);
                measurements.Add(measurement);
            }
        }