private Beta_Application_CTPT_LineZ.Model.GPA.VI_data FillGPAVI_data(TypeMapping typeMapping) { Dictionary <string, FieldMapping> fieldLookup = typeMapping.FieldMappings.ToDictionary(mapping => mapping.Field.Identifier); Beta_Application_CTPT_LineZ.Model.GPA.VI_data obj = new Beta_Application_CTPT_LineZ.Model.GPA.VI_data(); { // Initialize Beta_Application_CTPT_LineZ.Model.GPA.Phasor UDT for "Voltage" field FieldMapping fieldMapping = fieldLookup["Voltage"]; TypeMapping nestedMapping = GetTypeMapping(fieldMapping); PushRelativeFrameTime(fieldMapping); obj.Voltage = this.FillGPAPhasor(nestedMapping); PopRelativeFrameTime(fieldMapping); } { // Initialize Beta_Application_CTPT_LineZ.Model.GPA.Phasor UDT for "Current" field FieldMapping fieldMapping = fieldLookup["Current"]; TypeMapping nestedMapping = GetTypeMapping(fieldMapping); PushRelativeFrameTime(fieldMapping); obj.Current = this.FillGPAPhasor(nestedMapping); PopRelativeFrameTime(fieldMapping); } return(obj); }
private void CollectFromGPAVI_data(List <IMeasurement> measurements, TypeMapping typeMapping, Beta_Application_CTPT_LineZ.Model.GPA.VI_data data, Beta_Application_CTPT_LineZ.Model.GPA._VI_dataMeta meta) { Dictionary <string, FieldMapping> fieldLookup = typeMapping.FieldMappings.ToDictionary(mapping => mapping.Field.Identifier); { // Convert values from Beta_Application_CTPT_LineZ.Model.GPA.Phasor UDT for "Voltage" field to measurements FieldMapping fieldMapping = fieldLookup["Voltage"]; TypeMapping nestedMapping = GetTypeMapping(fieldMapping); CollectFromGPAPhasor(measurements, nestedMapping, data.Voltage, meta.Voltage); } { // Convert values from Beta_Application_CTPT_LineZ.Model.GPA.Phasor UDT for "Current" field to measurements FieldMapping fieldMapping = fieldLookup["Current"]; TypeMapping nestedMapping = GetTypeMapping(fieldMapping); CollectFromGPAPhasor(measurements, nestedMapping, data.Current, meta.Current); } }