예제 #1
0
 public static void PopulateLoadBreakSwitchProperties(Outage.LoadBreakSwitch cimLoadBreakSwitch, ResourceDescription rd, ImportHelper importHelper, TransformAndLoadReport report)
 {
     if ((cimLoadBreakSwitch != null) && (rd != null))
     {
         OutageConverter.PopulateProtectedSwitchProperties(cimLoadBreakSwitch, rd, importHelper, report);
     }
 }
        private ResourceDescription CreateLoadBreakSwitchResourceDescription(Outage.LoadBreakSwitch cimLoadBreakSwitch)
        {
            ResourceDescription rd = null;

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

                OutageConverter.PopulateLoadBreakSwitchProperties(cimLoadBreakSwitch, rd, importHelper, report);
            }

            return(rd);
        }
        private void ImportLoadBreakSwitches()
        {
            SortedDictionary <string, object> cimLoadBreakSwitchs = concreteModel.GetAllObjectsOfType("Outage.LoadBreakSwitch");

            if (cimLoadBreakSwitchs != null)
            {
                foreach (KeyValuePair <string, object> cimLoadBreakSwitchPair in cimLoadBreakSwitchs)
                {
                    Outage.LoadBreakSwitch cimLoadBreakSwitch = cimLoadBreakSwitchPair.Value as Outage.LoadBreakSwitch;
                    ResourceDescription    rd = CreateLoadBreakSwitchResourceDescription(cimLoadBreakSwitch);
                    if (rd != null)
                    {
                        string mrid = cimLoadBreakSwitch.MRID;
                        CreateAndInsertDeltaOperation(mrid, rd);

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