private void updateSetting() { ItensityClass itensityCls; itensityCls = this.ExecutePrm.PrmOPT.FindChn(LightChn.Red); if (itensityCls != null) { if ((int)itensityCls.Chanel == LightingOPT.SwitchChannel(LightChn.Red)) { this.tbRed.Value = MathUtils.Limit(itensityCls.Value, this.min, this.max); this.lblChn1.Text = this.tbRed.Value.ToString(); } } itensityCls = this.ExecutePrm.PrmOPT.FindChn(LightChn.Green); if (itensityCls != null) { if ((int)itensityCls.Chanel == LightingOPT.SwitchChannel(LightChn.Green)) { this.tbGreen.Value = MathUtils.Limit(itensityCls.Value, this.min, this.max); this.lblChn2.Text = this.tbGreen.Value.ToString(); } } itensityCls = this.ExecutePrm.PrmOPT.FindChn(LightChn.Blue); if (itensityCls != null) { if ((int)itensityCls.Chanel == LightingOPT.SwitchChannel(LightChn.Blue)) { this.tbBlue.Value = MathUtils.Limit(itensityCls.Value, this.min, this.max); this.lblChn3.Text = this.tbBlue.Value.ToString(); } } }
public void Init() { if (this.setting.Vendor == LightVendor.OPT) { //断开连接 LightingOPT opt = Lighting as LightingOPT; opt.Disconnect(); //连接 if (!opt.Connect(TimeSpan.FromSeconds(1))) { AlarmServer.Instance.Fire(this, AlarmInfoSensors.ErrorLightConncet); } return; } }