| | |
| | | #region 编辑设备状态 |
| | | switch (device.spk) |
| | | { |
| | | //群控 |
| | | case SPK.GroupControl: |
| | | int bottom = 50; |
| | | int attributesNameId=0; |
| | | int count = 0; |
| | | foreach (var attr in (device as GroupControl).attributes) |
| | | { |
| | | if (attr.key == FunctionAttributeKey.OnOff || |
| | | attr.key == FunctionAttributeKey.Brightness || |
| | | attr.key == FunctionAttributeKey.CCT || |
| | | attr.key == FunctionAttributeKey.RGB || |
| | | attr.key == FunctionAttributeKey.Colorful) |
| | | { |
| | | LogicView.FunTypeView view = new LogicView.FunTypeView(); |
| | | view.btnState.Name = "群控"; |
| | | view.frameLayout.Y = count * Application.GetRealHeight(50); |
| | | fLayout.AddChidren(view.FLayoutView()); |
| | | count++; |
| | | switch (attr.key) |
| | | { |
| | | case FunctionAttributeKey.OnOff: |
| | | attributesNameId = StringId.switchLogic; |
| | | ///开关点击事件 |
| | | view.btnClick.MouseUpEventHandler += (sender, e) => |
| | | { |
| | | SwitchViewMethod(device, view.btnState, 2); |
| | | }; |
| | | break; |
| | | case FunctionAttributeKey.Brightness: |
| | | attributesNameId = StringId.brightnesLogic; |
| | | view.btnState.Text = "5%";//产品经理晓辉要求改的 2021-11-06 |
| | | ///亮度点击事件 |
| | | view.btnClick.MouseUpEventHandler += (sender, e) => |
| | | { |
| | | BrightnessMethod(device, view.btnState, view.btnText.Text); |
| | | |
| | | }; |
| | | break; |
| | | case FunctionAttributeKey.CCT: |
| | | attributesNameId = StringId.ColorTemperature; |
| | | ///色温点击事件 |
| | | view.btnClick.MouseUpEventHandler += (sender, e) => |
| | | { |
| | | ColorTemperatureMethod(device, view.btnState, view.btnText.Text); |
| | | |
| | | }; |
| | | break; |
| | | case FunctionAttributeKey.RGB: |
| | | attributesNameId = StringId.rgbsepan; |
| | | view.btnState.Tag = ""; |
| | | view.btnState.Width = Application.GetRealWidth(16); |
| | | view.btnState.Height = Application.GetRealWidth(16); |
| | | view.btnState.Radius = (uint)Application.GetRealWidth(8); |
| | | view.btnState.X = Application.GetRealWidth(375 - 48 - 16); |
| | | ///RGB色盘点击事件 |
| | | view.btnClick.MouseUpEventHandler += (sender, e) => |
| | | { |
| | | RgbColorDiskMethod(device, view.btnState, view.btnText.Text); |
| | | }; |
| | | break; |
| | | case FunctionAttributeKey.Colorful: |
| | | attributesNameId = StringId.ColorfulFunction; |
| | | ///开关点击事件 |
| | | view.btnClick.MouseUpEventHandler += (sender, e) => |
| | | { |
| | | SwitchViewMethod(device, view.btnState, 2); |
| | | }; |
| | | break; |
| | | } |
| | | view.btnText.TextID = attributesNameId; |
| | | if (edit) |
| | | { |
| | | //显示编辑之前的设备状态 |
| | | GetEditDeviceState(device, index, view.btnState, null, null, null); |
| | | } |
| | | } |
| | | } |
| | | |
| | | //设备延时iewv |
| | | DelayView(fLayout, Application.GetRealHeight(50)* count); |
| | | break; |
| | | //插座(有USB) |
| | | case SPK.PanelSocket: |
| | | { |
| | |
| | | ///RGB色盘 |
| | | LogicView.FunTypeView rgbView = new LogicView.FunTypeView(); |
| | | rgbView.frameLayout.Y = brightnessView.frameLayout.Bottom; |
| | | //rgbView.btnText.TextID = StringId.brightnesLogic; |
| | | rgbView.btnText.Text= "RGB色盘"; |
| | | rgbView.btnText.TextID = StringId.rgbsepan; |
| | | rgbView.btnState.Tag = ""; |
| | | rgbView.btnState.Width = Application.GetRealWidth(16); |
| | | rgbView.btnState.Height = Application.GetRealWidth(16); |
| | |
| | | } |
| | | } |
| | | break; |
| | | case SPK.GroupControl: |
| | | { |
| | | outputDevice.target_type = "5"; |
| | | } |
| | | break; |
| | | |
| | | } |
| | | outputDevice.status.AddRange(dicSateteList); |
| | |
| | | } |
| | | } |
| | | break; |
| | | case SPK.GroupControl: |
| | | { |
| | | keyVlaue = "colorful"; |
| | | } |
| | | break; |
| | | } |
| | | //数据封装 |
| | | AddDictionary(keyVlaue, strValue); |
| | |
| | | case SPK.LightRGB: |
| | | case SPK.LightRGBW: |
| | | case SPK.LightCCT: |
| | | case SPK.GroupControl: |
| | | { |
| | | keyVlaue = "brightness"; |
| | | } |
| | |
| | | switch (device.spk) |
| | | { |
| | | case SPK.LightCCT: |
| | | case SPK.GroupControl: |
| | | { |
| | | keyVlaue = "cct"; |
| | | } |
| | |
| | | switch (device.spk) |
| | | { |
| | | case SPK.LightRGB: |
| | | case SPK.GroupControl: |
| | | { |
| | | keyVlaue = "rgb"; |
| | | } |