// Properties //Constructors public DmpxTS(DmTx201C DmTX201C) { try { dmTx201C = DmTX201C; dmTx201C.Register(); dmTx201C.BaseEvent += new BaseEventHandler(dmTx201C_BaseEvent); CrestronConsole.PrintLine("DM TX Registration Status is" + dmTx201C.Registered); } catch (Exception e) { CrestronConsole.PrintLine("DMTX201 Registration error is: " + e); } }
public override void InitializeSystem() { ComPort.ComPortSpec displayComSpec = new ComPort.ComPortSpec { BaudRate = ComPort.eComBaudRates.ComspecBaudRate9600, DataBits = ComPort.eComDataBits.ComspecDataBits8, Parity = ComPort.eComParityType.ComspecParityNone, StopBits = ComPort.eComStopBits.ComspecStopBits1, SoftwareHandshake = ComPort.eComSoftwareHandshakeType.ComspecSoftwareHandshakeNone, HardwareHandShake = ComPort.eComHardwareHandshakeType.ComspecHardwareHandshakeNone }; try { if (this.SupportsEthernet) { _dmRx = new Am300(0x15, this); _display = new Display(_dmRx.ComPorts[1], displayComSpec); _switcher = new AirMediaSwitcher(_dmRx); if (_dmRx.Register() != eDeviceRegistrationUnRegistrationResponse.Success) { ErrorLog.Error("Unable to register {0} on IP ID {1}!", _dmRx.Name, _dmRx.ID); } _dmTx = new DmTx201C(0x14, this); _dmTx.HdmiInput.InputStreamChange += OnLaptopHDMI; _dmTx.VgaInput.InputStreamChange += OnLaptopVGA; if (_dmTx.Register() != eDeviceRegistrationUnRegistrationResponse.Success) { ErrorLog.Error("Unable to register {0} on IP ID {1}!", _dmTx.Name, _dmTx.ID); } } if (this.SupportsCresnet) { _occSensor = new GlsOdtCCn(0x97, this); _occupancy = new RoomOccupancy(_occSensor, 15 * 60 * 60); // 15 minutes _occupancy.RoomOccupied = TurnSystemOn; _occupancy.RoomVacant = TurnSystemOff; if (_occSensor.Register() != eDeviceRegistrationUnRegistrationResponse.Success) { ErrorLog.Error("Unable to register {0} on Cresnet ID {1}!", _occSensor.Name, _occSensor.ID); } } } catch (Exception e) { ErrorLog.Error("Error in InitializeSystem: {0}", e.Message); } }