public static void PopulateDisconnectorProperties(Disconnector d, ResourceDescription rd, ImportHelper importHelper, TransformAndLoadReport report) { if (d != null && rd != null) { PowerTransformerConverter.PopulateSwitchProperties(d, rd, importHelper, report); } }
private Dictionary <string, SwitchingEquipment> ConvertSwitchingEquipment(Container breakerContainer, Container disconnectorContainer) { Dictionary <string, SwitchingEquipment> equipment = new Dictionary <string, SwitchingEquipment>(); foreach (var item in breakerContainer.Entities.Values) { if (item is Breaker) { Breaker breaker = item as Breaker; if (!equipment.ContainsKey(breaker.MRID)) { equipment.Add(breaker.MRID, new SwitchingEquipment() { Mrid = breaker.MRID, ManipulationConut = breaker.ManipulationCount }); } } } foreach (var item in disconnectorContainer.Entities.Values) { if (item is Disconnector) { Disconnector disconnector = item as Disconnector; if (!equipment.ContainsKey(disconnector.MRID)) { equipment.Add(disconnector.MRID, new SwitchingEquipment() { Mrid = disconnector.MRID, ManipulationConut = disconnector.ManipulationCount }); } } } return(equipment); }
private ResourceDescription CreateDisconnectorResourceDescription(Disconnector s) { ResourceDescription rd = null; if (s != null) { long gid = ModelCodeHelper.CreateGlobalId(0, (short)DMSType.DISCONNECTOR, importHelper.CheckOutIndexForDMSType(DMSType.DISCONNECTOR)); rd = new ResourceDescription(gid); importHelper.DefineIDMapping(s.ID, gid); PowerTransformerConverter.PopulateDisconnectorProperties(s, rd, importHelper, report); } return(rd); }
/// <summary> /// Creates entity for specified global inside the container. /// </summary> /// <param name="globalId">Global id of the entity for insert</param> /// <returns>Created entity (identified object).</returns> public IdentifiedObject CreateEntity(long globalId) { short type = ModelCodeHelper.ExtractTypeFromGlobalId(globalId); IdentifiedObject io = null; switch ((DMSType)type) { case DMSType.CURVE: io = new Curve(globalId); break; case DMSType.CURVEDATA: io = new CurveData(globalId); break; case DMSType.DISCONNECTOR: io = new Disconnector(globalId); break; case DMSType.IRREGULARTIMEPOINT: io = new IrregularTimePoint(globalId); break; case DMSType.OUTAGESCHEDULE: io = new OutageSchedule(globalId); break; case DMSType.PROTSWITCH: io = new ProtectedSwitch(globalId); break; case DMSType.REGULARTIMEPOINT: io = new RegularTimePoint(globalId); break; case DMSType.REGULARINTERVALSCHEDULE: io = new RegularIntervalSchedule(globalId); break; default: string message = String.Format("Failed to create entity because specified type ({0}) is not supported.", type); CommonTrace.WriteTrace(CommonTrace.TraceError, message); throw new Exception(message); } // Add entity to map this.AddEntity(io); return(io); }
private void ImportDisconnector() { SortedDictionary <string, object> ps = concreteModel.GetAllObjectsOfType("FTN.Disconnector"); foreach (var v in ps) { Disconnector s = v.Value as Disconnector; ResourceDescription rd = CreateDisconnectorResourceDescription(s); if (rd != null) { delta.AddDeltaOperation(DeltaOpType.Insert, rd, true); report.Report.Append("DISCONNECTOR ID = ").Append(s.ID).Append(" SUCCESSFULLY converted to GID = ").AppendLine(rd.Id.ToString()); } else { report.Report.Append("DISCONNECTOR ID = ").Append(s.ID).AppendLine(" FAILED to be converted"); } } report.Report.AppendLine(); }
private void ImportDisconnector() { SortedDictionary <string, object> cimDisconnectors = concreteModel.GetAllObjectsOfType("FTN.Disconnector"); if (cimDisconnectors != null) { foreach (KeyValuePair <string, object> item in cimDisconnectors) { Disconnector cimDisconnector = item.Value as Disconnector; ResourceDescription rd = CreateDisconnectorResourceDescription(cimDisconnector); if (rd != null) { delta.AddDeltaOperation(DeltaOpType.Insert, rd, true); report.Report.Append("Disconnector ID = ").Append(cimDisconnector.ID).Append(" SUCCESSFULLY converted to GID = ").AppendLine(rd.Id.ToString()); } else { report.Report.Append("Disconnector ID = ").Append(cimDisconnector.ID).AppendLine(" FAILED to be converted"); } } report.Report.AppendLine(); } }
/// <summary> /// Creates entity for specified global inside the container. /// </summary> /// <param name="globalId">Global id of the entity for insert</param> /// <returns>Created entity (identified object).</returns> public IdentifiedObject CreateEntity(long globalId) { short type = ModelCodeHelper.ExtractTypeFromGlobalId(globalId); IdentifiedObject io = null; switch ((DMSType)type) { case DMSType.TERMINAL: io = new Terminal(globalId); break; case DMSType.ANALOG: io = new Analog(globalId); break; case DMSType.ASYNCHRONOUSMACHINE: io = new AsynchronousMachine(globalId); break; case DMSType.BREAKER: io = new Breaker(globalId); break; case DMSType.CONNECTIVITYNODE: io = new ConnectivityNode(globalId); break; case DMSType.DISCONNECTOR: io = new Disconnector(globalId); break; case DMSType.DISCRETE: io = new Discrete(globalId); break; case DMSType.POWERTRANSFORMER: io = new PowerTransformer(globalId); break; case DMSType.RATIOTAPCHANGER: io = new RatioTapChanger(globalId); break; case DMSType.SUBSTATION: io = new Substation(globalId); break; case DMSType.TRANSFORMERWINDING: io = new TransformerWinding(globalId); break; default: string message = String.Format("Failed to create entity because specified type ({0}) is not supported.", type); CommonTrace.WriteTrace(CommonTrace.TraceError, message); throw new Exception(message); } // Add entity to map this.AddEntity(io); return(io); }
/// <summary> /// Creates entity for specified global inside the container. /// </summary> /// <param name="globalId">Global id of the entity for insert</param> /// <returns>Created entity (identified object).</returns> public IdentifiedObject CreateEntity(long globalId) { short type = ModelCodeHelper.ExtractTypeFromGlobalId(globalId); IdentifiedObject io = null; switch ((DMSType)type) { case DMSType.BASEVOLTAGE: { io = new BaseVoltage(globalId); break; } case DMSType.TERMINAL: { io = new Terminal(globalId); break; } case DMSType.CONNECTIVITYNODE: { io = new ConnectivityNode(globalId); break; } case DMSType.POWERTRANSFORMER: { io = new PowerTransformer(globalId); break; } case DMSType.ENERGYSOURCE: { io = new EnergySource(globalId); break; } case DMSType.ENERGYCONSUMER: { io = new EnergyConsumer(globalId); break; } case DMSType.TRANSFORMERWINDING: { io = new TransformerWinding(globalId); break; } case DMSType.FUSE: { io = new Fuse(globalId); break; } case DMSType.DISCONNECTOR: { io = new Disconnector(globalId); break; } case DMSType.BREAKER: { io = new Breaker(globalId); break; } case DMSType.LOADBREAKSWITCH: { io = new LoadBreakSwitch(globalId); break; } case DMSType.ACLINESEGMENT: { io = new ACLineSegment(globalId); break; } case DMSType.DISCRETE: { io = new Discrete(globalId); break; } case DMSType.ANALOG: { io = new Analog(globalId); break; } case DMSType.SYNCHRONOUSMACHINE: { io = new SynchronousMachine(globalId); break; } default: { string message = String.Format("Failed to create entity because specified type ({0}) is not supported.", type); Logger.LogError(message); throw new Exception(message); } } // Add entity to map this.AddEntity(io); return(io); }
void PopulateDisconnectorProperties(Disconnector x, ResourceDescription rd) { PopulateSwitchProperties(x, rd); }