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); }
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; }