public void RegisterDevices() { #region 注册调光模块 din1Dim4_3 = new Din1Dim4(0x03, this.controlSystem); if (din1Dim4_3.Register() != eDeviceRegistrationUnRegistrationResponse.Success) { ErrorLog.Error("din1Dim4_10 failed registration. Cause: {0}", din1Dim4_3.RegistrationFailureReason); } din1Dim4_4 = new Din1Dim4(0x04, this.controlSystem); if (din1Dim4_4.Register() != eDeviceRegistrationUnRegistrationResponse.Success) { ErrorLog.Error("din1Dim4_11 failed registration. Cause: {0}", din1Dim4_4.RegistrationFailureReason); } //din1Dim4_10.DinLoads[0].ParameterDimmable = eDimmable.No; #endregion #region 注册串口 if (this.controlSystem.SupportsComPort) { this.CongPu_3 = new ILiveGRODIGY8SW8(3, 8006); this.CongPu_4 = new ILiveGRODIGY8SW8(4, 8006); this.CongPu_5 = new ILiveGRODIGY8SW8(5, 8006); } #endregion }
public void RegisterDevice() { #region 注册灯光模块 din1Dim4_10 = new Din1Dim4(0x10, this.controlSystem); if (din1Dim4_10.Register() != eDeviceRegistrationUnRegistrationResponse.Success) { ErrorLog.Error("din1Dim4_10 failed registration. Cause: {0}", din1Dim4_10.RegistrationFailureReason); } din1Dim4_11 = new Din1Dim4(0x11, this.controlSystem); if (din1Dim4_11.Register() != eDeviceRegistrationUnRegistrationResponse.Success) { ErrorLog.Error("din1Dim4_11 failed registration. Cause: {0}", din1Dim4_11.RegistrationFailureReason); } din1Dim4_12 = new Din1Dim4(0x12, this.controlSystem); if (din1Dim4_12.Register() != eDeviceRegistrationUnRegistrationResponse.Success) { ErrorLog.Error("din1Dim4_12 failed registration. Cause: {0}", din1Dim4_12.RegistrationFailureReason); } din1Dim4_13 = new Din1Dim4(0x13, this.controlSystem); if (din1Dim4_13.Register() != eDeviceRegistrationUnRegistrationResponse.Success) { ErrorLog.Error("din1Dim4_13 failed registration. Cause: {0}", din1Dim4_13.RegistrationFailureReason); } din8sw8_03 = new Din8Sw8(0x03, this.controlSystem); din8sw8_03.LoadStateChange += new LoadEventHandler(din8sw8_LoadStateChange); if (din8sw8_03.Register() != eDeviceRegistrationUnRegistrationResponse.Success) { ErrorLog.Error("din8sw8_03 failed registration. Cause: {0}", din8sw8_03.RegistrationFailureReason); } din8sw8_04 = new Din8Sw8(0x4, this.controlSystem); din8sw8_04.LoadStateChange += new LoadEventHandler(din8sw8_LoadStateChange); if (din8sw8_04.Register() != eDeviceRegistrationUnRegistrationResponse.Success) { ErrorLog.Error("din8sw8_04 failed registration. Cause: {0}", din8sw8_04.RegistrationFailureReason); } din8sw8_05 = new Din8Sw8(0x5, this.controlSystem); din8sw8_05.LoadStateChange += new LoadEventHandler(din8sw8_LoadStateChange); if (din8sw8_05.Register() != eDeviceRegistrationUnRegistrationResponse.Success) { ErrorLog.Error("din8sw8_05 failed registration. Cause: {0}", din8sw8_05.RegistrationFailureReason); } #endregion }