Exemple #1
0
 protected void OnDeviceConnectionStateChanged(Device _device)
 {
     if (DeviceConnectionStateChanged != null)
     {
         TCPClientEventArgs ms = new TCPClientEventArgs();
         ms.Device = _device;
         DeviceConnectionStateChanged(this, ms);
     }
 }
Exemple #2
0
        protected void OnAnyBinarySignalValueChanged(List <BinarySignal> _valueChangedSignals)
        {
            Log.Instance.Trace("{1}: {2} methodu {0} ip adresi için cagrıldı", ipAddress, this.GetType().Name, MethodBase.GetCurrentMethod().Name);

            TCPClientEventArgs args = new TCPClientEventArgs();

            args.BinarySignals = _valueChangedSignals;

            AnyBinarySignalValueChanged?.Invoke(this, args);
        }
Exemple #3
0
        protected void OnAnyAnalogSignalValueChanged(List <AnalogSignal> _valueChangedSignals)
        {
            Log.Instance.Trace("{1}: {2} methodu {0} ip adresi için cagrıldı", ipAddress, this.GetType().Name, MethodBase.GetCurrentMethod().Name);
            TCPClientEventArgs ms = new TCPClientEventArgs();

            ms.AnalogSignals = _valueChangedSignals;

            if (AnyAnalogSignalValueChanged != null)
            {
                AnyAnalogSignalValueChanged(this, ms);
            }
        }
Exemple #4
0
 protected void OnConnectedToServer()
 {
     Log.Instance.Trace("{1}: {2} methodu {0} ip adresi için cagrıldı", ipAddress, this.GetType().Name, MethodBase.GetCurrentMethod().Name);
     if (Devices == null)
     {
         throw new Exception(string.Format("{0} Hata: Device bulunamadı", this.GetType().Name));
     }
     else
     {
         OrderSignalsByAddress();
     }
     if (ConnectedToServer != null)
     {
         TCPClientEventArgs ms = new TCPClientEventArgs();
         ms.ipAddress = ipAddress;
         ConnectedToServer(this, ms);
     }
 }
Exemple #5
0
        protected void OnDisconnectedFromServer(List <Device> _devices)
        {
            Log.Instance.Trace("{1}: {2} methodu {0} ip adresi için cagrıldı", ipAddress, this.GetType().Name, MethodBase.GetCurrentMethod().Name);

            Log.Instance.Error("{0}: Driver baglantı hatası => {1} ip adresi ile bağlantı problemi", this.GetType().Name, ipAddress);
            foreach (Device d in Devices)
            {
                d.Connected = false;
            }

            dtDisconnected = DateTime.Now;
            TCPClientEventArgs ms = new TCPClientEventArgs();

            ms.Devices = _devices;
            if (DisconnectedFromServer != null)
            {
                DisconnectedFromServer(this, ms);
            }
        }