private ResourceDescription CreatSynchronousMachineResourceDescription(Outage.SynchronousMachine cimSynchronousMachine)
        {
            ResourceDescription rd = null;

            if (cimSynchronousMachine != null)
            {
                long gid = ModelCodeHelper.CreateGlobalId(0, (short)DMSType.SYNCHRONOUSMACHINE, importHelper.CheckOutIndexForDMSType(DMSType.SYNCHRONOUSMACHINE));
                rd = new ResourceDescription(gid);
                importHelper.DefineIDMapping(cimSynchronousMachine.ID, gid);

                OutageConverter.PopulateSynchronousMachineProperties(cimSynchronousMachine, rd, importHelper, report);
            }

            return(rd);
        }
예제 #2
0
        public static void PopulateSynchronousMachineProperties(Outage.SynchronousMachine cimSynchronousMachine, ResourceDescription rd, ImportHelper importHelper, TransformAndLoadReport report)
        {
            if ((cimSynchronousMachine != null) && (rd != null))
            {
                OutageConverter.PopulateConductingEquipmentProperties(cimSynchronousMachine, rd, importHelper, report);

                if (cimSynchronousMachine.CapacityHasValue)
                {
                    rd.AddProperty(new Property(ModelCode.SYNCHRONOUSMACHINE_CAPACITY, cimSynchronousMachine.Capacity));
                }

                if (cimSynchronousMachine.CurrentRegimeHasValue)
                {
                    rd.AddProperty(new Property(ModelCode.SYNCHRONOUSMACHINE_CURRENTREGIME, cimSynchronousMachine.CurrentRegime));
                }
            }
        }
        private void ImportSynchronousMachines()
        {
            SortedDictionary <string, object> cimSynchronousMachines = concreteModel.GetAllObjectsOfType("Outage.SynchronousMachine");

            if (cimSynchronousMachines != null)
            {
                foreach (KeyValuePair <string, object> cimSynchronousMachinePair in cimSynchronousMachines)
                {
                    Outage.SynchronousMachine cimSynchronousMachine = cimSynchronousMachinePair.Value as Outage.SynchronousMachine;
                    ResourceDescription       rd = CreatSynchronousMachineResourceDescription(cimSynchronousMachine);
                    if (rd != null)
                    {
                        string mrid = cimSynchronousMachine.MRID;
                        CreateAndInsertDeltaOperation(mrid, rd);

                        report.Report.Append("SynchronousMachine ID: ").Append(cimSynchronousMachine.ID).Append(" SUCCESSFULLY converted to GID: ").AppendLine($"0x{rd.Id:X16}");
                    }
                    else
                    {
                        report.Report.Append("SynchronousMachine ID: ").Append(cimSynchronousMachine.ID).AppendLine(" FAILED to be converted");
                    }
                }
            }
        }