Ejemplo n.º 1
0
        public override void Map(IDictionary <MeasurementKey, IMeasurement> measurements)
        {
            SignalLookup.UpdateMeasurementLookup(measurements);
            TypeMapping inputMapping = MappingCompiler.GetTypeMapping(InputMapping);

            Reset();
            openLSE.Model.LSE.Input inputData = CreateLSEInput(inputMapping);
            Reset();
            openLSE.Model.LSE._InputMeta inputMeta = CreateLSE_InputMeta(inputMapping);

            Algorithm.Output algorithmOutput = Algorithm.Execute(inputData, inputMeta);
            Subscriber.SendMeasurements(m_unmapper.Unmap(algorithmOutput.OutputData, algorithmOutput.OutputMeta));
        }
Ejemplo n.º 2
0
        private openLSE.Model.LSE._InputMeta CreateLSE_InputMeta(TypeMapping typeMapping)
        {
            Dictionary <string, FieldMapping> fieldLookup = typeMapping.FieldMappings.ToDictionary(mapping => mapping.Field.Identifier);

            openLSE.Model.LSE._InputMeta obj = new openLSE.Model.LSE._InputMeta();

            {
                // Create openLSE.Model.ECA._DigitalsMeta UDT for "Digitals" field
                FieldMapping fieldMapping  = fieldLookup["Digitals"];
                TypeMapping  nestedMapping = GetTypeMapping(fieldMapping);

                PushRelativeFrame(fieldMapping);
                obj.Digitals = CreateECA_DigitalsMeta(nestedMapping);
                PopRelativeFrame(fieldMapping);
            }

            {
                // Create openLSE.Model.ECA._StatusWordsMeta UDT for "StatusWords" field
                FieldMapping fieldMapping  = fieldLookup["StatusWords"];
                TypeMapping  nestedMapping = GetTypeMapping(fieldMapping);

                PushRelativeFrame(fieldMapping);
                obj.StatusWords = CreateECA_StatusWordsMeta(nestedMapping);
                PopRelativeFrame(fieldMapping);
            }

            {
                // Create openLSE.Model.ECA._PhasorCollectionMeta UDT for "VoltagePhasors" field
                FieldMapping fieldMapping  = fieldLookup["VoltagePhasors"];
                TypeMapping  nestedMapping = GetTypeMapping(fieldMapping);

                PushRelativeFrame(fieldMapping);
                obj.VoltagePhasors = CreateECA_PhasorCollectionMeta(nestedMapping);
                PopRelativeFrame(fieldMapping);
            }

            {
                // Create openLSE.Model.ECA._PhasorCollectionMeta UDT for "CurrentPhasors" field
                FieldMapping fieldMapping  = fieldLookup["CurrentPhasors"];
                TypeMapping  nestedMapping = GetTypeMapping(fieldMapping);

                PushRelativeFrame(fieldMapping);
                obj.CurrentPhasors = CreateECA_PhasorCollectionMeta(nestedMapping);
                PopRelativeFrame(fieldMapping);
            }

            return(obj);
        }