public override void AddReference(ModelCode referenceId, long globalId) { switch (referenceId) { case ModelCode.REGULATINGCONTROL_TERMINAL: RegulatingControl.Add(globalId); break; default: base.AddReference(referenceId, globalId); break; } }
public override void GetReferences(Dictionary <ModelCode, List <long> > references, TypeOfReference refType) { if (ConductingEquipment != 0 && (refType == TypeOfReference.Reference || refType == TypeOfReference.Both)) { references[ModelCode.TERMINAL_CONDUCTINGEQUIPMENT] = new List <long>(); references[ModelCode.TERMINAL_CONDUCTINGEQUIPMENT].Add(ConductingEquipment); } if (RegulatingControl != null && RegulatingControl.Count > 0 && (refType == TypeOfReference.Target || refType == TypeOfReference.Both)) { references[ModelCode.TERMINAL_REGULATINGCONTROL] = RegulatingControl.GetRange(0, RegulatingControl.Count); } base.GetReferences(references, refType); }
public static void PopulateRegulatingControlProperties(RegulatingControl rc, ResourceDescription rd, ImportHelper importHelper, TransformAndLoadReport report) { if ((rc != null) && (rd != null)) { IES1Converter.PopulatePowerSystemResourceProperties(rc, rd); if (rc.DiscreteHasValue) { rd.AddProperty(new Property(ModelCode.REGULATING_CONTROL_DISCRETE, rc.Discrete)); } if (rc.ModeHasValue) { rd.AddProperty(new Property(ModelCode.REGULATING_CONTROL_MODE, (short)GetRegulatingControlModeKind(rc.Mode))); } if (rc.MonitoredPhaseHasValue) { rd.AddProperty(new Property(ModelCode.REGULATING_CONTROL_MONITORED_PHASE, (short)GetDMSPhaseCode(rc.MonitoredPhase))); } if (rc.TargetRangeHasValue) { rd.AddProperty(new Property(ModelCode.REGULATING_CONTROL_TARGET_RANGE, rc.TargetRange)); } if (rc.TargetValueHasValue) { rd.AddProperty(new Property(ModelCode.REGULATING_CONTROL_TARGET_VALUE, rc.TargetValue)); } if (rc.TerminalHasValue) { long gid = importHelper.GetMappedGID(rc.Terminal.ID); if (gid < 0) { report.Report.Append("WARNING: Convert ").Append(rc.GetType().ToString()).Append(" rdfID = \"").Append(rc.ID); report.Report.Append("\" - Failed to set reference to Terminal: rdfID \"").Append(rc.Terminal.ID).AppendLine(" \" is not mapped to GID!"); } rd.AddProperty(new Property(ModelCode.REGULATING_CONTROL_TERMINAL, gid)); } } }
public override void RemoveReference(ModelCode referenceId, long globalId) { switch (referenceId) { case ModelCode.REGULATINGCONTROL_TERMINAL: if (RegulatingControl.Contains(globalId)) { RegulatingControl.Remove(globalId); } else { CommonTrace.WriteTrace(CommonTrace.TraceWarning, "Entity (GID = 0x{0:x16}) doesn't contain reference 0x{1:x16}.", this.GlobalId, globalId); } break; default: base.RemoveReference(referenceId, globalId); break; } }