Esempio 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);
        }
Esempio 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);
            }
        }
Esempio 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));
        }
Esempio 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;
         }
     }
 }
Esempio n. 5
0
 public void PLCDisconnect(PLCItem plc)
 {
     plc.Disconnection(ApplicationName, PLCServerApplicationName);
 }