public void RemoveRelay(ElectricalRelaySPST sw) { if (switches.Contains(sw)) { switches.Remove(sw); } RemoveDevice(sw.FirstContact); RemoveDevice(sw.SecondContact); RemoveDevice(sw.Coil); }
// Relay Management Methods public ElectricalRelaySPST CreateRelay(string swName = null) { if (FindSwitchByName(swName) != null) { return(null); } var newSwitch = new ElectricalRelaySPST(swName); switches.Add(newSwitch); newSwitch.FirstContact = CreateDevice(swName + "(1)"); newSwitch.SecondContact = CreateDevice(swName + "(2)"); newSwitch.Coil = CreateDevice(swName + "(c)"); return(newSwitch); }