void PopulateMeasurementProperties(Measurement x, ResourceDescription rd)
        {
            PopulateIdentifiedObjectProperties(x, rd);

            if (x.BaseAddressHasValue)
            {
                rd.AddProperty(new Int32Property(ModelCode.MEASUREMENT_BASEADDRESS, x.BaseAddress));
            }

            if (x.DirectionHasValue)
            {
                rd.AddProperty(new EnumProperty(ModelCode.MEASUREMENT_DIRECTION, (short)x.Direction));
            }

            if (x.MeasurementTypeHasValue)
            {
                rd.AddProperty(new EnumProperty(ModelCode.MEASUREMENT_MEASUREMENTTYPE, (short)x.MeasurementType));
            }

            if (x.PowerSystemResourceHasValue)
            {
                rd.AddProperty(new ReferenceProperty(ModelCode.MEASUREMENT_POWERSYSTEMRESOURCE, GetGID(x.PowerSystemResource.ID)));
            }

            if (x.TerminalHasValue)
            {
                rd.AddProperty(new ReferenceProperty(ModelCode.MEASUREMENT_TERMINAL, GetGID(x.Terminal.ID)));
            }
        }
Exemple #2
0
        public static void PopulateSynchronousMachineProperties(DERMS.SynchronousMachine cimSynchronousMachine, ResourceDescription rd, ImportHelper importHelper, TransformAndLoadReport report)
        {
            if ((cimSynchronousMachine != null) && (rd != null))
            {
                DERMSConveter.PopulateRotatingMachineProperties(cimSynchronousMachine, rd, importHelper, report);

                if (cimSynchronousMachine.BaseQHasValue)
                {
                    rd.AddProperty(new Property(ModelCode.SYNCMACHINE_BASEQ, cimSynchronousMachine.BaseQ));
                }
                if (cimSynchronousMachine.MinQHasValue)
                {
                    rd.AddProperty(new Property(ModelCode.SYNCMACHINE_MINQ, cimSynchronousMachine.MinQ));
                }
                if (cimSynchronousMachine.MaxQHasValue)
                {
                    rd.AddProperty(new Property(ModelCode.SYNCMACHINE_MAXQ, cimSynchronousMachine.MaxQ));
                }
                if (cimSynchronousMachine.MinPHasValue)
                {
                    rd.AddProperty(new Property(ModelCode.SYNCMACHINE_MINP, cimSynchronousMachine.MinP));
                }
                if (cimSynchronousMachine.MaxPHasValue)
                {
                    rd.AddProperty(new Property(ModelCode.SYNCMACHINE_MAXP, cimSynchronousMachine.MaxP));
                }
            }
        }
Exemple #3
0
        public static void PopulateMeasurementValueProperties(DERMS.MeasurementValue cimWMeasurementValue, ResourceDescription rd, ImportHelper importHelper, TransformAndLoadReport report)
        {
            if ((cimWMeasurementValue != null) && (rd != null))
            {
                DERMSConveter.PopulateIdentifiedObjectProperties(cimWMeasurementValue, rd);

                if (cimWMeasurementValue.TimeStampHasValue)
                {
                    rd.AddProperty(new Property(ModelCode.MEASUREMENTVALUE_TIMESTAMP, cimWMeasurementValue.TimeStamp.Ticks));
                }

                if (cimWMeasurementValue.PowerTypeHasValue)
                {
                    rd.AddProperty(new Property(ModelCode.MEASUREMENTVALUE_POWERTYPE, (short)cimWMeasurementValue.PowerType));
                }

                if (cimWMeasurementValue.AddressHasValue)
                {
                    rd.AddProperty(new Property(ModelCode.MEASUREMENTVALUE_ADDRESS, cimWMeasurementValue.Address));
                }

                if (cimWMeasurementValue.SynchronousMachineHasValue)
                {
                    long gid = importHelper.GetMappedGID(cimWMeasurementValue.SynchronousMachine.ID);
                    if (gid < 0)
                    {
                        report.Report.Append("WARNING: Convert ").Append(cimWMeasurementValue.GetType().ToString()).Append(" rdfID = \"").Append(cimWMeasurementValue.ID);
                        report.Report.Append("\" - Failed to set reference to MeasurementValue: rdfID \"").Append(cimWMeasurementValue.SynchronousMachine.ID).AppendLine(" \" is not mapped to GID!");
                    }
                    rd.AddProperty(new Property(ModelCode.MEASUREMENTVALUE_SYNCMACHINE, gid));
                }
            }
        }
Exemple #4
0
        public static void PopulateSeriesCompensatorProperties(FTN.SeriesCompensator cimSeriesCompensator, ResourceDescription rd)
        {
            if ((cimSeriesCompensator != null) && (rd != null))
            {
                PowerTransformerConverter.PopulateConductingEquipmentProperties(cimSeriesCompensator, rd);

                if (cimSeriesCompensator.RHasValue)
                {
                    rd.AddProperty(new Property(ModelCode.SERIESCOMP_R, cimSeriesCompensator.R));
                }

                if (cimSeriesCompensator.R0HasValue)
                {
                    rd.AddProperty(new Property(ModelCode.SERIESCOMP_R0, cimSeriesCompensator.R0));
                }

                if (cimSeriesCompensator.XHasValue)
                {
                    rd.AddProperty(new Property(ModelCode.SERIESCOMP_X, cimSeriesCompensator.X));
                }

                if (cimSeriesCompensator.X0HasValue)
                {
                    rd.AddProperty(new Property(ModelCode.SERIESCOMP_X0, cimSeriesCompensator.X0));
                }
            }
        }
Exemple #5
0
        public static void PopulateCurveDataProperties(FTN.CurveData cimCurveData, ResourceDescription rd, ImportHelper importHelper, TransformAndLoadReport report)
        {
            if ((cimCurveData != null) && (rd != null))
            {
                Converter.PopulateIdentifiedObjectProperties(cimCurveData, rd);

                if (cimCurveData.XvalueHasValue)
                {
                    rd.AddProperty(new Property(ModelCode.CURVEDATA_XVALUE, cimCurveData.Xvalue));
                }
                if (cimCurveData.Y1valueHasValue)
                {
                    rd.AddProperty(new Property(ModelCode.CURVEDATA_Y1VALUE, cimCurveData.Y1value));
                }
                if (cimCurveData.Y2valueHasValue)
                {
                    rd.AddProperty(new Property(ModelCode.CURVEDATA_Y2VALUE, cimCurveData.Y2value));
                }
                if (cimCurveData.Y3valueHasValue)
                {
                    rd.AddProperty(new Property(ModelCode.CURVEDATA_Y3VALUE, cimCurveData.Y3value));
                }
                if (cimCurveData.CurveHasValue)
                {
                    long gid = importHelper.GetMappedGID(cimCurveData.Curve.ID);
                    if (gid < 0)
                    {
                        report.Report.Append("WARNING: Convert ").Append(cimCurveData.GetType().ToString()).Append(" rdfID = \"").Append(cimCurveData.ID);
                        report.Report.Append("\" - Failed to set reference to Curve: rdfID \"").Append(cimCurveData.Curve.ID).AppendLine(" \" is not mapped to GID!");
                    }
                    rd.AddProperty(new Property(ModelCode.CURVEDATA_CURVE, gid));
                }
            }
        }
Exemple #6
0
        public static void PopulateDiscreteProperties(Outage.Discrete cimDiscrete, ResourceDescription rd, ImportHelper importHelper, TransformAndLoadReport report)
        {
            if ((cimDiscrete != null) && (rd != null))
            {
                OutageConverter.PopulateMeasurementProperties(cimDiscrete, rd, importHelper, report);

                if (cimDiscrete.CurrentOpenHasValue)
                {
                    rd.AddProperty(new Property(ModelCode.DISCRETE_CURRENTOPEN, cimDiscrete.CurrentOpen));
                }

                if (cimDiscrete.MaxValueHasValue)
                {
                    rd.AddProperty(new Property(ModelCode.DISCRETE_MAXVALUE, cimDiscrete.MaxValue));
                }

                if (cimDiscrete.MeasurementTypeHasValue)
                {
                    rd.AddProperty(new Property(ModelCode.DISCRETE_MEASUREMENTTYPE, (short)GetDiscreteMeasuremetType(cimDiscrete.MeasurementType)));
                }

                if (cimDiscrete.MinValueHasValue)
                {
                    rd.AddProperty(new Property(ModelCode.DISCRETE_MINVALUE, cimDiscrete.MinValue));
                }

                if (cimDiscrete.NormalValueHasValue)
                {
                    rd.AddProperty(new Property(ModelCode.DISCRETE_NORMALVALUE, cimDiscrete.NormalValue));
                }
            }
        }
Exemple #7
0
        public static void PopulateIrregularTimePointProperties(FTN.IrregularTimePoint cimIrregularTimePoint, ResourceDescription rd, ImportHelper importHelper, TransformAndLoadReport report)
        {
            if ((cimIrregularTimePoint != null) && (rd != null))
            {
                PowerTransformerConverter.PopulateIdentifiedObjectProperties(cimIrregularTimePoint, rd);

                if (cimIrregularTimePoint.TimeHasValue)
                {
                    rd.AddProperty(new Property(ModelCode.IRREGULARTIMEPOINT_TIME, cimIrregularTimePoint.Time));
                }
                if (cimIrregularTimePoint.Value1HasValue)
                {
                    rd.AddProperty(new Property(ModelCode.IRREGULARTIMEPOINT_VALUE1, cimIrregularTimePoint.Value1));
                }
                if (cimIrregularTimePoint.Value2HasValue)
                {
                    rd.AddProperty(new Property(ModelCode.IRREGULARTIMEPOINT_VALUE2, cimIrregularTimePoint.Value2));
                }

                if (cimIrregularTimePoint.IntervalScheduleHasValue)
                {
                    long gid = importHelper.GetMappedGID(cimIrregularTimePoint.IntervalSchedule.ID);
                    if (gid < 0)
                    {
                        report.Report.Append("WARNING: Convert ").Append(cimIrregularTimePoint.GetType().ToString()).Append(" rdfID = \"").Append(cimIrregularTimePoint.ID);
                        report.Report.Append("\" - Failed to set reference to IntervalSchedule: rdfID \"").Append(cimIrregularTimePoint.IntervalSchedule.ID).AppendLine(" \" is not mapped to GID!");
                    }
                    rd.AddProperty(new Property(ModelCode.IRREGULARTIMEPOINT_IRREGULARIINTERVALSCHEDULE, gid));
                }
            }
        }
        public static void PopulateSubGeographicalRegionProperties(FTN.SubGeographicalRegion cimSubGeographicalRegion, ResourceDescription rd, ImportHelper importHelper, TransformAndLoadReport report)
        {
            if ((cimSubGeographicalRegion != null) && (rd != null))
            {
                PowerTransformerConverter.PopulateIdentifiedObjectProperties(cimSubGeographicalRegion, rd);

                if (cimSubGeographicalRegion.LongitudeHasValue)
                {
                    rd.AddProperty(new Property(ModelCode.SUBGEOGRAPHICALREGION_LONGITUDE, cimSubGeographicalRegion.Longitude));
                }

                if (cimSubGeographicalRegion.LatitudeHasValue)
                {
                    rd.AddProperty(new Property(ModelCode.SUBGEOGRAPHICALREGION_LATITUDE, cimSubGeographicalRegion.Latitude));
                }

                if (cimSubGeographicalRegion.RegionHasValue)
                {
                    long gid = importHelper.GetMappedGID(cimSubGeographicalRegion.Region.ID);
                    if (gid < 0)
                    {
                        report.Report.Append("WARNING: Convert ").Append(cimSubGeographicalRegion.GetType().ToString()).Append(" rdfID = \"").Append(cimSubGeographicalRegion.ID);
                        report.Report.Append("\" - Failed to set reference to GeograhicalRegion: rdfID \"").Append(cimSubGeographicalRegion.Region.ID).AppendLine(" \" is not mapped to GID!");
                    }
                    rd.AddProperty(new Property(ModelCode.SUBGEOGRAPHICALREGION_GEOREG, gid));
                }
            }
        }
        public static void PopulateEnergyConsumerProperties(FTN.EnergyConsumer cimEnergyConsumer, ResourceDescription rd, ImportHelper importHelper, TransformAndLoadReport report)
        {
            if ((cimEnergyConsumer != null) && (rd != null))
            {
                PowerTransformerConverter.PopulateConductingEquipmentProperties(cimEnergyConsumer, rd, importHelper, report);

                if (cimEnergyConsumer.PfixedHasValue)
                {
                    rd.AddProperty(new Property(ModelCode.ENERGYCONSUMER_PFIXED, cimEnergyConsumer.Pfixed));
                }

                if (cimEnergyConsumer.QfixedHasValue)
                {
                    rd.AddProperty(new Property(ModelCode.ENERGYCONSUMER_QFIXED, cimEnergyConsumer.Qfixed));
                }

                if (cimEnergyConsumer.EquipmentContainerHasValue)
                {
                    long gid = importHelper.GetMappedGID(cimEnergyConsumer.EquipmentContainer.ID);
                    if (gid < 0)
                    {
                        report.Report.Append("WARNING: Convert ").Append(cimEnergyConsumer.GetType().ToString()).Append(" rdfID = \"").Append(cimEnergyConsumer.ID);
                        report.Report.Append("\" - Failed to set reference to EquipmentContainer: rdfID \"").Append(cimEnergyConsumer.EquipmentContainer.ID).AppendLine(" \" is not mapped to GID!");
                    }
                    rd.AddProperty(new Property(ModelCode.EQUIPMENT_CONTAINER, gid));
                }
            }
        }
        public static void PopulateAsynchronousMachineProperties(FTN.AsynchronousMachine cimAsynchronousMachine, ResourceDescription rd, ImportHelper importHelper, TransformAndLoadReport report)
        {
            if ((cimAsynchronousMachine != null) && (rd != null))
            {
                SCADAConverter.PopulateRegulatingCondEqProperties(cimAsynchronousMachine, rd, importHelper, report);

                if (cimAsynchronousMachine.CosPhiHasValue)
                {
                    rd.AddProperty(new Property(ModelCode.ASYNCMACHINE_COSPHI, cimAsynchronousMachine.CosPhi));
                }
                if (cimAsynchronousMachine.RatedPHasValue)
                {
                    rd.AddProperty(new Property(ModelCode.ASYNCMACHINE_RATEDP, cimAsynchronousMachine.RatedP));
                }
                if (cimAsynchronousMachine.MaximumTempHasValue)
                {
                    rd.AddProperty(new Property(ModelCode.ASYNCMACHINE_MAXTEMP, cimAsynchronousMachine.MaximumTemp));
                }
                if (cimAsynchronousMachine.MinimumTempHasValue)
                {
                    rd.AddProperty(new Property(ModelCode.ASYNCMACHINE_MINTEMP, cimAsynchronousMachine.MinimumTemp));
                }
                if (cimAsynchronousMachine.CurrentTempHasValue)
                {
                    rd.AddProperty(new Property(ModelCode.ASYNCMACHINE_CURRTEMP, cimAsynchronousMachine.CurrentTemp));
                }
            }
        }
        public static void PopulatePointProperties(FTN.Point cimPoint, ResourceDescription rd, ImportHelper importHelper, TransformAndLoadReport report)
        {
            if ((cimPoint != null) && (rd != null))
            {
                PowerTransformerConverter.PopulateIdentifiedObjectProperties(cimPoint, rd);

                if (cimPoint.LongitudeHasValue)
                {
                    rd.AddProperty(new Property(ModelCode.POINT_LONGITUDE, cimPoint.Longitude));
                }

                if (cimPoint.LatitudeHasValue)
                {
                    rd.AddProperty(new Property(ModelCode.POINT_LATITUDE, cimPoint.Latitude));
                }

                if (cimPoint.LineHasValue)
                {
                    long gid = importHelper.GetMappedGID(cimPoint.Line.ID);
                    if (gid < 0)
                    {
                        report.Report.Append("WARNING: Convert ").Append(cimPoint.GetType().ToString()).Append(" rdfID = \"").Append(cimPoint.ID);
                        report.Report.Append("\" - Failed to set reference to ACLINESEGMENT: rdfID \"").Append(cimPoint.Line.ID).AppendLine(" \" is not mapped to GID!");
                    }
                    rd.AddProperty(new Property(ModelCode.POINT_LINE, gid));
                }
            }
        }
        public static void PopulateTransformerWindingProperties(FTN.TransformerWinding cimTransformerWinding, ResourceDescription rd, ImportHelper importHelper, TransformAndLoadReport report)
        {
            if ((cimTransformerWinding != null) && (rd != null))
            {
                SCADAConverter.PopulateConductingEquipmentProperties(cimTransformerWinding, rd, importHelper, report);

                if (cimTransformerWinding.PowerTransformerHasValue)
                {
                    long gid = importHelper.GetMappedGID(cimTransformerWinding.PowerTransformer.ID);
                    if (gid < 0)
                    {
                        report.Report.Append("WARNING: Convert ").Append(cimTransformerWinding.GetType().ToString()).Append(" rdfID = \"").Append(cimTransformerWinding.ID);
                        report.Report.Append("\" - Failed to set reference to PowerTransformer: rdfID \"").Append(cimTransformerWinding.PowerTransformer.ID).AppendLine(" \" is not mapped to GID!");
                    }
                    rd.AddProperty(new Property(ModelCode.TRANSFORMERWINDING_POWERTR, gid));
                }
                if (cimTransformerWinding.RatioTapChangerHasValue)
                {
                    long gid = importHelper.GetMappedGID(cimTransformerWinding.RatioTapChanger.ID);
                    if (gid < 0)
                    {
                        report.Report.Append("WARNING: Convert ").Append(cimTransformerWinding.GetType().ToString()).Append(" rdfID = \"").Append(cimTransformerWinding.ID);
                        report.Report.Append("\" - Failed to set reference to RatioTapChanger: rdfID \"").Append(cimTransformerWinding.RatioTapChanger.ID).AppendLine(" \" is not mapped to GID!");
                    }
                    rd.AddProperty(new Property(ModelCode.TRANSFORMERWINDING_RATIOTC, gid));
                }
            }
        }
Exemple #13
0
        public static void PopulateAssetFunctionProperties(FTN.AssetFunction cimAssetFunction, ResourceDescription rd)
        {
            if ((cimAssetFunction != null) && (rd != null))
            {
                PowerTransformerConverter.PopulateIdentifiedObjectProperties(cimAssetFunction, rd);

                if (cimAssetFunction.ConfigIDHasValue)
                {
                    rd.AddProperty(new Property(ModelCode.ASSETFUNCTION_CONFIGID, cimAssetFunction.ConfigID));
                }
                if (cimAssetFunction.FirmwareIDHasValue)
                {
                    rd.AddProperty(new Property(ModelCode.ASSETFUNCTION_FIRMWAREID, cimAssetFunction.FirmwareID));
                }
                if (cimAssetFunction.HardwareIDHasValue)
                {
                    rd.AddProperty(new Property(ModelCode.ASSETFUNCTION_HARDWAREID, cimAssetFunction.HardwareID));
                }
                if (cimAssetFunction.PasswordHasValue)
                {
                    rd.AddProperty(new Property(ModelCode.ASSETFUNCTION_PASSWORD, cimAssetFunction.Password));
                }
                if (cimAssetFunction.ProgramIDHasValue)
                {
                    rd.AddProperty(new Property(ModelCode.ASSETFUNCTION_PROGRAMID, cimAssetFunction.ProgramID));
                }
            }
        }
Exemple #14
0
        public static void PopulateAssetProperties(Asset cimAsset, ResourceDescription rd, ImportHelper importHelper, TransformAndLoadReport report)
        {
            if ((cimAsset != null) && (rd != null))
            {
                PowerTransformerConverter.PopulateIdentifiedObjectProperties(cimAsset, rd);

                if (cimAsset.CriticalHasValue)
                {
                    rd.AddProperty(new Property(ModelCode.ASSET_CRITICAL, cimAsset.Critical));
                }
                if (cimAsset.InitialConditionHasValue)
                {
                    rd.AddProperty(new Property(ModelCode.ASSET_INITIALCONDITION, cimAsset.InitialCondition));
                }
                if (cimAsset.InitialLossOfLifeHasValue)
                {
                    rd.AddProperty(new Property(ModelCode.ASSET_INITIALLOSSOFLIFE, cimAsset.InitialLossOfLife));
                }
                if (cimAsset.LotNumberHasValue)
                {
                    rd.AddProperty(new Property(ModelCode.ASSET_LOTNUMBER, cimAsset.LotNumber));
                }
                if (cimAsset.PurchasePriceHasValue)
                {
                    rd.AddProperty(new Property(ModelCode.ASSET_PURCHASEPRICE, cimAsset.PurchasePrice));
                }
                if (cimAsset.SerialNumberHasValue)
                {
                    rd.AddProperty(new Property(ModelCode.ASSET_SERIALNUMBER, cimAsset.SerialNumber));
                }
                if (cimAsset.TypeHasValue)
                {
                    rd.AddProperty(new Property(ModelCode.ASSET_TYPE, cimAsset.Type));
                }
                if (cimAsset.UtcNumberHasValue)
                {
                    rd.AddProperty(new Property(ModelCode.ASSET_UTCNUMBER, cimAsset.UtcNumber));
                }
                if (cimAsset.AssetInfoHasValue)
                {
                    long gid = importHelper.GetMappedGID(cimAsset.AssetInfo.ID);
                    if (gid < 0)
                    {
                        report.Report.Append("WARNING: Convert ").Append(cimAsset.GetType().ToString()).Append(" rdfID = \"").Append(cimAsset.ID);
                        report.Report.Append("\" - Failed to set reference to AssetModel: rdfID \"").Append(cimAsset.AssetInfo.ID).AppendLine(" \" is not mapped to GID!");
                    }
                    rd.AddProperty(new Property(ModelCode.ASSET_ASSETINFO, gid));
                }
                if (cimAsset.OrganisationRolesHasValue)
                {
                    long gid = importHelper.GetMappedGID(cimAsset.OrganisationRoles.ID);
                    if (gid < 0)
                    {
                        report.Report.Append("WARNING: Convert ").Append(cimAsset.GetType().ToString()).Append(" rdfID = \"").Append(cimAsset.ID);
                        report.Report.Append("\" - Failed to set reference to AssetModel: rdfID \"").Append(cimAsset.OrganisationRoles.ID).AppendLine(" \" is not mapped to GID!");
                    }
                    rd.AddProperty(new Property(ModelCode.ASSET_ASSETORGANISATIONROLE, gid));
                }
            }
        }
        public static void PopulateRegularTimePointProperties(RegularTimePoint r, ResourceDescription rd, ImportHelper i, TransformAndLoadReport report)
        {
            if (r != null && rd != null)
            {
                PowerTransformerConverter.PopulateIdentifiedObjectProperties(r, rd);

                if (r.SequenceNumberHasValue)
                {
                    rd.AddProperty(new Property(ModelCode.REGULARTIMEPOINT_SEQUENCENO, r.SequenceNumber));
                }
                if (r.Value1HasValue)
                {
                    rd.AddProperty(new Property(ModelCode.REGULARTIMEPOINT_VALUE1, r.Value1));
                }
                if (r.Value2HasValue)
                {
                    rd.AddProperty(new Property(ModelCode.REGULARTIMEPOINT_VALUE2, r.Value2));
                }
                if (r.IntervalScheduleHasValue)
                {
                    long gid = i.GetMappedGID(r.IntervalSchedule.ID);
                    if (gid < 0)
                    {
                        report.Report.Append("WARNING: Convert ").Append(r.GetType().ToString()).Append(" rdfID = \"").Append(r.ID);
                        report.Report.Append("\" - Failed to set reference to IntervalSchedule: rdfID \"").Append(r.IntervalSchedule.ID).AppendLine(" \" is not mapped to GID!");
                    }
                    else
                    {
                        rd.AddProperty(new Property(ModelCode.REGULARTIMEPOINT_INTERVALSCHEDULE, gid));
                    }
                }
            }
        }
        public static void PopulateACLineSegmentProperties(FTN.ACLineSegment cimACLineSegment, ResourceDescription rd, ImportHelper importHelper, TransformAndLoadReport report)
        {
            if ((cimACLineSegment != null) && (rd != null))
            {
                PowerTransformerConverter.PopulateConductorProperties(cimACLineSegment, rd, importHelper, report);

                if (cimACLineSegment.RatedCurrentHasValue)
                {
                    rd.AddProperty(new Property(ModelCode.ACLINESEGMENT_CURRENTFLOW, cimACLineSegment.RatedCurrent));
                }

                if (cimACLineSegment.FeederCableHasValue)
                {
                    rd.AddProperty(new Property(ModelCode.ACLINESEGMENT_FEEDERCABLE, cimACLineSegment.FeederCable));
                }

                if (cimACLineSegment.EquipmentContainerHasValue)
                {
                    long gid = importHelper.GetMappedGID(cimACLineSegment.EquipmentContainer.ID);
                    if (gid < 0)
                    {
                        report.Report.Append("WARNING: Convert ").Append(cimACLineSegment.GetType().ToString()).Append(" rdfID = \"").Append(cimACLineSegment.ID);
                        report.Report.Append("\" - Failed to set reference to EquipmentContainer: rdfID \"").Append(cimACLineSegment.EquipmentContainer.ID).AppendLine(" \" is not mapped to GID!");
                    }
                    rd.AddProperty(new Property(ModelCode.EQUIPMENT_CONTAINER, gid));
                }
            }
        }
Exemple #17
0
        public static void PopulateMeasurementProperties(Outage.Measurement cimMeasurement, ResourceDescription rd, ImportHelper importHelper, TransformAndLoadReport report)
        {
            if ((cimMeasurement != null) && (rd != null))
            {
                OutageConverter.PopulateIdentifiedObjectProperties(cimMeasurement, rd);

                if (cimMeasurement.AddressHasValue)
                {
                    rd.AddProperty(new Property(ModelCode.MEASUREMENT_ADDRESS, cimMeasurement.Address));
                }

                if (cimMeasurement.IsInputHasValue)
                {
                    rd.AddProperty(new Property(ModelCode.MEASUREMENT_ISINPUT, cimMeasurement.IsInput));
                }

                if (cimMeasurement.TerminalHasValue)
                {
                    long gid = importHelper.GetMappedGID(cimMeasurement.Terminal.ID);
                    if (gid < 0)
                    {
                        report.Report.Append("WARNING: Convert ").Append(cimMeasurement.GetType().ToString()).Append(" rdfID: \"").Append(cimMeasurement.ID);
                        report.Report.Append("\" - Failed to set reference to Terminal: rdfID \"").Append(cimMeasurement.Terminal.ID).AppendLine(" \" is not mapped to GID!");
                    }

                    rd.AddProperty(new Property(ModelCode.MEASUREMENT_TERMINAL, gid));
                }
            }
        }
 public static void PopulateEquipmentProperties(FTN.Equipment cimEquipment, ResourceDescription rd, ImportHelper importHelper, TransformAndLoadReport report)
 {
     if ((cimEquipment != null) && (rd != null))
     {
         PowerTransformerConverter.PopulatePowerSystemResourceProperties(cimEquipment, rd, importHelper, report);
         if (cimEquipment.AggregateHasValue)
         {
             rd.AddProperty(new Property(ModelCode.EQUIPMENT_AGGREGATE, cimEquipment.Aggregate));
         }
         if (cimEquipment.NormallyInServiceHasValue)
         {
             rd.AddProperty(new Property(ModelCode.EQUIPMENT_NORMALLYSERVICE, cimEquipment.NormallyInService));
         }
         if (cimEquipment.EquipmentContainerHasValue)
         {
             long gid = importHelper.GetMappedGID(cimEquipment.EquipmentContainer.ID);
             if (gid < 0)
             {
                 report.Report.Append("WARNING: Convert ").Append(cimEquipment.GetType().ToString()).Append(" rdfID = \"").Append(cimEquipment.ID);
                 report.Report.Append("\" - Failed to set reference to EquipmentContainer: rdfID \"").Append(cimEquipment.EquipmentContainer.ID).AppendLine(" \" is not mapped to GID!");
             }
             rd.AddProperty(new Property(ModelCode.EQUIPMENT_EC, gid));
         }
     }
 }
Exemple #19
0
        public static void PopulateBasicIntervalScheduleProperties(FTN.BasicIntervalSchedule cimBasicIntervalSchedule, ResourceDescription rd, ImportHelper importHelper, TransformAndLoadReport report)
        {
            if ((cimBasicIntervalSchedule != null) && (rd != null))
            {
                PowerTransformerConverter.PopulateIdentifiedObjectProperties(cimBasicIntervalSchedule, rd);

                if (cimBasicIntervalSchedule.StartTimeHasValue)
                {
                    rd.AddProperty(new Property(ModelCode.BASICINTERVALSCHEDULE_STARTTIME, cimBasicIntervalSchedule.StartTime));
                }
                if (cimBasicIntervalSchedule.Value1MultiplierHasValue)
                {
                    rd.AddProperty(new Property(ModelCode.BASICINTERVALSCHEDULE_VALUE1MULTIPLIER, (short)GetDMSUnitMultiplier(cimBasicIntervalSchedule.Value1Multiplier)));
                }
                if (cimBasicIntervalSchedule.Value1UnitHasValue)
                {
                    rd.AddProperty(new Property(ModelCode.BASICINTERVALSCHEDULE_VALUE1UNIT, (short)GetDMSUnitSymbol(cimBasicIntervalSchedule.Value1Unit)));
                }
                if (cimBasicIntervalSchedule.Value2MultiplierHasValue)
                {
                    rd.AddProperty(new Property(ModelCode.BASICINTERVALSCHEDULE_VALUE2MULTIPLIER, (short)GetDMSUnitMultiplier(cimBasicIntervalSchedule.Value2Multiplier)));
                }
                if (cimBasicIntervalSchedule.Value2UnitHasValue)
                {
                    rd.AddProperty(new Property(ModelCode.BASICINTERVALSCHEDULE_VALUE2UNIT, (short)GetDMSUnitSymbol(cimBasicIntervalSchedule.Value2Unit)));
                }
            }
        }
        public static void PopulateMeasurmentProperties(FTN.Measurement cimMeasurment, ResourceDescription rd, ImportHelper importHelper, TransformAndLoadReport report)
        {
            if ((cimMeasurment != null) && (rd != null))
            {
                OMSConverter.PopulateIdentifiedObjectProperties(cimMeasurment, rd);

                if (cimMeasurment.DirectionHasValue)
                {
                    rd.AddProperty(new Property(ModelCode.MEASUREMENT_DIRECTION, (short)cimMeasurment.Direction));
                }
                if (cimMeasurment.MeasurementTypeHasValue)
                {
                    rd.AddProperty(new Property(ModelCode.MEASUREMENT_TYPE, cimMeasurment.MeasurementType));
                }
                if (cimMeasurment.UnitSymbolHasValue)
                {
                    var unitSym = GetDMSUnitSymbol(cimMeasurment.UnitSymbol);
                    rd.AddProperty(new Property(ModelCode.MEASUREMENT_UNITSYMB, (short)unitSym));
                    //rd.AddProperty(new Property(ModelCode.MEASUREMENT_UNITSYMB, (long)cimMeasurment.UnitSymbol));
                    //rd.AddProperty(new Property(ModelCode.MEASUREMENT_UNITSYMB, (short)cimMeasurment.UnitSymbol));
                    //rd.AddProperty(new Property(ModelCode.MEASUREMENT_UNITSYMB, cimMeasurment.UnitSymbol.ToString()));
                }
                if (cimMeasurment.PowerSystemResourceHasValue)
                {
                    long gid = importHelper.GetMappedGID(cimMeasurment.PowerSystemResource.ID);
                    if (gid < 0)
                    {
                        report.Report.Append("WARNING: Convert ").Append(cimMeasurment.GetType().ToString()).Append(" rdfID = \"").Append(cimMeasurment.ID);
                        report.Report.Append("\" - Failed to set reference to TransformerWinding: rdfID \"").Append(cimMeasurment.PowerSystemResource.ID).AppendLine(" \" is not mapped to GID!");
                    }
                    rd.AddProperty(new Property(ModelCode.MEASUREMENT_PSR, gid));
                }
            }
        }
Exemple #21
0
        public static void PopulateSwitchingOperationProperties(FTN.SwitchingOperation cimSwitchingOperation, ResourceDescription rd, ImportHelper importHelper, TransformAndLoadReport report)
        {
            if ((cimSwitchingOperation != null) && (rd != null))
            {
                PowerTransformerConverter.PopulateIdentifiedObjectProperties(cimSwitchingOperation, rd);

                if (cimSwitchingOperation.NewStateHasValue)
                {
                    rd.AddProperty(new Property(ModelCode.SWITCHINGOPERATION_NEWSTATE, (short)GetDMSSwichState(cimSwitchingOperation.NewState)));
                }
                if (cimSwitchingOperation.OperationTimeHasValue)
                {
                    rd.AddProperty(new Property(ModelCode.SWITCHINGOPERATION_OPERATIONTIME, cimSwitchingOperation.OperationTime));
                }

                if (cimSwitchingOperation.OutageScheduleHasValue)
                {
                    long gid = importHelper.GetMappedGID(cimSwitchingOperation.OutageSchedule.ID);
                    if (gid < 0)
                    {
                        report.Report.Append("WARNING: Convert ").Append(cimSwitchingOperation.GetType().ToString()).Append(" rdfID = \"").Append(cimSwitchingOperation.ID);
                        report.Report.Append("\" - Failed to set reference to OutageSchedule: rdfID \"").Append(cimSwitchingOperation.OutageSchedule.ID).AppendLine(" \" is not mapped to GID!");
                    }
                    rd.AddProperty(new Property(ModelCode.SWITCHINGOPERATION_OUTAGESCHEDULE, gid));
                }
            }
        }
        public static void PopulateDiscreteProperties(FTN.Discrete cimDiscrete, ResourceDescription rd, ImportHelper importHelper, TransformAndLoadReport report)
        {
            if ((cimDiscrete != null) && (rd != null))
            {
                OMSConverter.PopulateMeasurmentProperties(cimDiscrete, rd, importHelper, report);

                if (cimDiscrete.MinValueHasValue)
                {
                    rd.AddProperty(new Property(ModelCode.DISCRETE_MINVAL, cimDiscrete.MinValue));
                }
                if (cimDiscrete.MaxValueHasValue)
                {
                    rd.AddProperty(new Property(ModelCode.DISCRETE_MAXVAL, cimDiscrete.MaxValue));
                }
                if (cimDiscrete.NormalValueHasValue)
                {
                    rd.AddProperty(new Property(ModelCode.DISCRETE_NORMVAL, cimDiscrete.NormalValue));
                }
                if (cimDiscrete.ValidCommandsHasValue)
                {
                    rd.AddProperty(new Property(ModelCode.DISCRETE_VALIDCOMMANDS, GetDMSCommand(cimDiscrete.ValidCommands)));
                }

                if (cimDiscrete.ValidStatesHasValue)
                {
                    rd.AddProperty(new Property(ModelCode.DISCRETE_VALIDSTATES, GetDMSStates(cimDiscrete.ValidStates)));
                }
            }
        }
Exemple #23
0
        public static void PopulateTerminalProperties(FTN.Terminal cimTerminal, ResourceDescription rd, ImportHelper importHelper, TransformAndLoadReport report)
        {
            if ((cimTerminal != null) && (rd != null))
            {
                PowerTransformerConverter.PopulateIdentifiedObjectProperties(cimTerminal, rd);

                if (cimTerminal.ConnectivityNodeHasValue)
                {
                    long gid = importHelper.GetMappedGID(cimTerminal.ConnectivityNode.ID);
                    if (gid < 0)
                    {
                        report.Report.Append("WARNING: Convert ").Append(cimTerminal.GetType().ToString()).Append(" rdfID = \"").Append(cimTerminal.ID);
                        report.Report.Append("\" - Failed to set reference to Terminal: rdfID \"").Append(cimTerminal.ConnectivityNode.ID).AppendLine(" \" is not mapped to GID!");
                    }
                    rd.AddProperty(new Property(ModelCode.TERMINAL_CONNODE, gid));
                }

                if (cimTerminal.ConductingEquipmentHasValue)
                {
                    long gid = importHelper.GetMappedGID(cimTerminal.ConductingEquipment.ID);
                    if (gid < 0)
                    {
                        report.Report.Append("WARNING: Convert ").Append(cimTerminal.GetType().ToString()).Append(" rdfID = \"").Append(cimTerminal.ID);
                        report.Report.Append("\" - Failed to set reference to Terminal: rdfID \"").Append(cimTerminal.ConductingEquipment.ID).AppendLine(" \" is not mapped to GID!");
                    }
                    rd.AddProperty(new Property(ModelCode.TERMINAL_CONDEQ, gid));
                }
            }
        }
Exemple #24
0
        public static void PopulateConductingEquipmentProperties(FTN.ConductingEquipment cimConductingEquipment, ResourceDescription rd, ImportHelper importHelper, TransformAndLoadReport report)
        {
            if ((cimConductingEquipment != null) && (rd != null))
            {
                PowerTransformerConverter.PopulateEquipmentProperties(cimConductingEquipment, rd, importHelper, report);

                if (cimConductingEquipment.PhasesHasValue)
                {
                    rd.AddProperty(new Property(ModelCode.CONDEQ_PHASES, (short)GetDMSPhaseCode(cimConductingEquipment.Phases)));
                }
                if (cimConductingEquipment.RatedVoltageHasValue)
                {
                    rd.AddProperty(new Property(ModelCode.CONDEQ_RATEDVOLTAGE, cimConductingEquipment.RatedVoltage));
                }
                if (cimConductingEquipment.BaseVoltageHasValue)
                {
                    long gid = importHelper.GetMappedGID(cimConductingEquipment.BaseVoltage.ID);
                    if (gid < 0)
                    {
                        report.Report.Append("WARNING: Convert ").Append(cimConductingEquipment.GetType().ToString()).Append(" rdfID = \"").Append(cimConductingEquipment.ID);
                        report.Report.Append("\" - Failed to set reference to BaseVoltage: rdfID \"").Append(cimConductingEquipment.BaseVoltage.ID).AppendLine(" \" is not mapped to GID!");
                    }
                    rd.AddProperty(new Property(ModelCode.CONDEQ_BASVOLTAGE, gid));
                }
            }
        }
Exemple #25
0
        public static void PopulateBasicIntervalScheduleProperties(FTN.BasicIntervalSchedule cimBasicIntervalSchedule, ResourceDescription rd)
        {
            if ((cimBasicIntervalSchedule != null) && rd != null)
            {
                IES1Converter.PopulateIdentifiedObjectProperties(cimBasicIntervalSchedule, rd);

                if (cimBasicIntervalSchedule.StartTimeHasValue)
                {
                    rd.AddProperty(new Property(ModelCode.BASIC_INT_SCHED_STARTTIME, cimBasicIntervalSchedule.StartTime));
                }
                if (cimBasicIntervalSchedule.Value1MultiplierHasValue)
                {
                    rd.AddProperty(new Property(ModelCode.BASIC_INT_SCHED_VAL1MUL, (short)GetUnitMultiplier(cimBasicIntervalSchedule.Value1Multiplier)));
                }
                if (cimBasicIntervalSchedule.Value1UnitHasValue)
                {
                    rd.AddProperty(new Property(ModelCode.BASIC_INT_SCHED_VAL1UNIT, (short)GetUnitSymbol(cimBasicIntervalSchedule.Value1Unit)));
                }
                if (cimBasicIntervalSchedule.Value2MultiplierHasValue)
                {
                    rd.AddProperty(new Property(ModelCode.BASIC_INT_SCHED_VAL2MUL, (short)GetUnitMultiplier(cimBasicIntervalSchedule.Value2Multiplier)));
                }
                if (cimBasicIntervalSchedule.Value2UnitHasValue)
                {
                    rd.AddProperty(new Property(ModelCode.BASIC_INT_SCHED_VAL2UNIT, (short)GetUnitSymbol(cimBasicIntervalSchedule.Value2Unit)));
                }
            }
        }
 public static void PopulateSwitchProperties(Switch s, ResourceDescription rd, ImportHelper importHelper, TransformAndLoadReport report)
 {
     if (s != null && rd != null)
     {
         PowerTransformerConverter.PopulateConductingEquipmentProperties(s, rd, importHelper, report);
         if (s.NormalOpenHasValue)
         {
             rd.AddProperty(new Property(ModelCode.SWITCH_NORMOPEN, s.NormalOpen));
         }
         if (s.RatedCurrentHasValue)
         {
             rd.AddProperty(new Property(ModelCode.SWITCH_RATEDCURRENT, s.RatedCurrent));
         }
         if (s.RetainedHasValue)
         {
             rd.AddProperty(new Property(ModelCode.SWITCH_RETAINED, s.Retained));
         }
         if (s.SwitchOnCountHasValue)
         {
             rd.AddProperty(new Property(ModelCode.SWITCH_ONCOUNT, s.SwitchOnCount));
         }
         if (s.SwitchOnDateHasValue)
         {
             rd.AddProperty(new Property(ModelCode.SWITCH_ONDATE, s.SwitchOnDate));
         }
     }
 }
Exemple #27
0
        public static void PopulateSubstationProperties(DERMS.Substation cimSubstation, ResourceDescription rd, ImportHelper importHelper, TransformAndLoadReport report)
        {
            if ((cimSubstation != null) && (rd != null))
            {
                DERMSConveter.PopulateEquipmentContainerProperties(cimSubstation, rd, importHelper, report);

                if (cimSubstation.LatitudeHasValue)
                {
                    rd.AddProperty(new Property(ModelCode.SUBSTATION_LATITUDE, cimSubstation.Latitude));
                }
                if (cimSubstation.LongitudeHasValue)
                {
                    rd.AddProperty(new Property(ModelCode.SUBSTATION_LONGITUDE, cimSubstation.Longitude));
                }

                if (cimSubstation.RegionHasValue)
                {
                    long gid = importHelper.GetMappedGID(cimSubstation.Region.ID);
                    if (gid < 0)
                    {
                        report.Report.Append("WARNING: Convert ").Append(cimSubstation.GetType().ToString()).Append(" rdfID = \"").Append(cimSubstation.ID);
                        report.Report.Append("\" - Failed to set reference to Equipment: rdfID \"").Append(cimSubstation.Region.ID).AppendLine(" \" is not mapped to GID!");
                    }
                    rd.AddProperty(new Property(ModelCode.SUBSTATION_SUBREGION, gid));
                }
            }
        }
        public static void PopulateBasicIntervalScheduleProperties(BasicIntervalSchedule b, ResourceDescription rd)
        {
            if (b != null && rd != null)
            {
                PowerTransformerConverter.PopulateIdentifiedObjectProperties(b, rd);

                if (b.StartTimeHasValue)
                {
                    rd.AddProperty(new Property(ModelCode.BINTERVALSCHEDULE_STARTTIME, b.StartTime));
                }
                if (b.Value1MultiplierHasValue)
                {
                    rd.AddProperty(new Property(ModelCode.BINTERVALSCHEDULE_V1MULTIPLIER, (short)GetDMSUnitMultiplier(b.Value1Multiplier)));
                }
                if (b.Value1UnitHasValue)
                {
                    rd.AddProperty(new Property(ModelCode.BINTERVALSCHEDULE_V1UNIT, (short)GetDMSUNitSymbol(b.Value1Unit)));
                }
                if (b.Value2MultiplierHasValue)
                {
                    rd.AddProperty(new Property(ModelCode.BINTERVALSCHEDULE_V2MULTIPLIER, (short)GetDMSUnitMultiplier(b.Value2Multiplier)));
                }
                if (b.Value2UnitHasValue)
                {
                    rd.AddProperty(new Property(ModelCode.BINTERVALSCHEDULE_V2UNIT, (short)GetDMSUNitSymbol(b.Value2Unit)));
                }
            }
        }
Exemple #29
0
        public static void PopulatePhaseImpedanceDataProperties(PhaseImpedanceData cimPhaseImpedanceData, ResourceDescription rd, ImportHelper importHelper, TransformAndLoadReport report)
        {
            if ((cimPhaseImpedanceData != null) && (rd != null))
            {
                PowerTransformerConverter.PopulateIdentifiedObjectProperties(cimPhaseImpedanceData, rd);

                if (cimPhaseImpedanceData.RHasValue)
                {
                    rd.AddProperty(new Property(ModelCode.PHASEIMPDTA_R, cimPhaseImpedanceData.R));
                }
                if (cimPhaseImpedanceData.BHasValue)
                {
                    rd.AddProperty(new Property(ModelCode.PHASEIMPDTA_B, cimPhaseImpedanceData.B));
                }
                if (cimPhaseImpedanceData.SequenceNumberHasValue)
                {
                    rd.AddProperty(new Property(ModelCode.PHASEIMPDTA_SEQNUM, cimPhaseImpedanceData.SequenceNumber));
                }
                if (cimPhaseImpedanceData.XHasValue)
                {
                    rd.AddProperty(new Property(ModelCode.PHASEIMPDTA_X, cimPhaseImpedanceData.X));
                }
                if (cimPhaseImpedanceData.PhaseImpedanceHasValue)
                {
                    long gid = importHelper.GetMappedGID(cimPhaseImpedanceData.PhaseImpedance.ID);
                    if (gid < 0)
                    {
                        report.Report.Append("WARNING: Convert ").Append(cimPhaseImpedanceData.GetType().ToString()).Append(" rdfID = \"").Append(cimPhaseImpedanceData.ID);
                        report.Report.Append("\" - Failed to set reference to PhaseImpedance: rdfID \"").Append(cimPhaseImpedanceData.PhaseImpedance.ID).AppendLine(" \" is not mapped to GID!");
                    }
                    rd.AddProperty(new Property(ModelCode.ACLINESGMNT_PERLGTHIMPDNC, gid));
                }
            }
        }
        public static void PopulateSeasonDayTypeScheduleProperties(FTN.SeasonDayTypeSchedule cimSeasonDayTypeSchedule, ResourceDescription rd, ImportHelper importHelper, TransformAndLoadReport report)
        {
            if ((cimSeasonDayTypeSchedule != null) && (rd != null))
            {
                PowerTransformerConverter.PopulateRegularIntervalScheduleProperties(cimSeasonDayTypeSchedule, rd);

                if (cimSeasonDayTypeSchedule.DayTypeHasValue)
                {
                    long gid = importHelper.GetMappedGID(cimSeasonDayTypeSchedule.DayType.ID);
                    if (gid < 0)
                    {
                        report.Report.Append("WARNING: Convert ").Append(cimSeasonDayTypeSchedule.GetType().ToString()).Append(" rdfID = \"").Append(cimSeasonDayTypeSchedule.ID);
                        report.Report.Append("\" - Failed to set reference to DayType: rdfID \"").Append(cimSeasonDayTypeSchedule.DayType.ID).AppendLine(" \" is not mapped to GID!");
                    }
                    rd.AddProperty(new Property(ModelCode.SDTS_DAYTYPE, gid));
                }

                if (cimSeasonDayTypeSchedule.SeasonHasValue)
                {
                    long gid = importHelper.GetMappedGID(cimSeasonDayTypeSchedule.Season.ID);
                    if (gid < 0)
                    {
                        report.Report.Append("WARNING: Convert ").Append(cimSeasonDayTypeSchedule.GetType().ToString()).Append(" rdfID = \"").Append(cimSeasonDayTypeSchedule.ID);
                        report.Report.Append("\" - Failed to set reference to Season: rdfID \"").Append(cimSeasonDayTypeSchedule.Season.ID).AppendLine(" \" is not mapped to GID!");
                    }
                    rd.AddProperty(new Property(ModelCode.SDTS_SEASON, gid));
                }
            }
        }