Exemplo n.º 1
0
        public void PLCRemove(string plcName, string ipAddress)
        {
            var plc = new PLCItem(plcName, ipAddress, mdsClient);

            plc.Disconnection(ApplicationName, PLCServerApplicationName);

            model.ListPLCItems.Remove(plc);
        }
Exemplo n.º 2
0
        public void PLCAdd(string plcName, string ipAddress)
        {
            var plc = new PLCItem(plcName, ipAddress, mdsClient);

            if (plc.Connection(ApplicationName, PLCServerApplicationName))
            {
                model.ListPLCItems.Add(plc);
            }
        }
Exemplo n.º 3
0
        public bool Equals(PLCItem plc)
        {
            // If parameter is null return false:
            if (plc == null)
            {
                return(false);
            }

            // Return true if either fields match:
            return((Name == plc.Name && IPAddress == plc.IPAddress));
        }
Exemplo n.º 4
0
 private void SetPLCButtonsState(PLCItem plc)
 {
     if (plc == null)
     {
         btnDelete.IsEnabled     = false;
         btnDisconnect.IsEnabled = false;
         btnConnect.IsEnabled    = false;
     }
     else
     {
         btnDelete.IsEnabled = true;
         if (plc.ConnectionStatus == PLCConnectionStatus.Connected)
         {
             btnConnect.IsEnabled    = false;
             btnDisconnect.IsEnabled = true;
         }
         else
         {
             btnConnect.IsEnabled    = true;
             btnDisconnect.IsEnabled = false;
         }
     }
 }
Exemplo n.º 5
0
 public void PLCDisconnect(PLCItem plc)
 {
     plc.Disconnection(ApplicationName, PLCServerApplicationName);
 }