Пример #1
0
 public void RemoveRelay(ElectricalRelaySPST sw)
 {
     if (switches.Contains(sw))
     {
         switches.Remove(sw);
     }
     RemoveDevice(sw.FirstContact);
     RemoveDevice(sw.SecondContact);
     RemoveDevice(sw.Coil);
 }
Пример #2
0
        // 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);
        }