예제 #1
0
        public DeviceController(DeviceConfig Config, ICommandReport ReportTarget)
        {
            _ReportTarget = ReportTarget;
            _Config       = Config;

            switch (Config.ConnectionType)
            {
            case "Socket":
                conn = new SocketClient(Config.IPAdress, Config.Port, this);
                break;

            case "ComPort":
                conn = new ComPortClient(this);
                break;
            }
            _Decoder = new SANWA.Utility.Decoder(Config.DeviceType);
        }
예제 #2
0
        public DeviceController(DeviceConfig Config, ICommandReport ReportTarget)
        {
            _ReportTarget = ReportTarget;
            _Config       = Config;

            switch (Config.ConnectionType)
            {
            case "Socket":
                conn = new SocketClient(Config, this);
                break;

            case "ComPort":
                conn = new ComPortClient(Config, this);
                break;
            }
            _Decoder = new SANWA.Utility.Decoder(Config.Vendor);

            Encoder = new SANWA.Utility.Encoder(Config.Vendor);


            this.Name         = _Config.DeviceName;
            this.Status       = "";
            this._IsConnected = false;
        }