| | |
| | | switch (outputTarget.target_type) |
| | | { |
| | | case "1": |
| | | case "5": |
| | | { |
| | | //用sid找到设备; |
| | | var device = LogicMethod.Current.GetDevice(outputTarget.sid); |
| | |
| | | //区别不同设备,显示不同设备状态 |
| | | switch (device.spk) |
| | | { |
| | | |
| | | case SPK.CommonSeries: |
| | | targetView.btnIcon.UnSelectedImagePath = "FunctionIcon/Icon/groupControl.png"; |
| | | stateStr = GetKeyValue("on_off", dicList) == "on" ? Language.StringByID(StringId.onLogic) : Language.StringByID(StringId.offLogic); |
| | |
| | | } |
| | | } |
| | | break; |
| | | |
| | | |
| | | case SPK.LightRGB: |
| | | case SPK.LightRGBW: |
| | | case SPK.LightCCT: |
| | | case SPK.LightDimming: |
| | | { |
| | | if(device.spk == SPK.LightRGB) |
| | | { |
| | | string colorful = GetKeyValue(FunctionAttributeKey.Colorful, dicList); |
| | | if (!string.IsNullOrEmpty(colorful)) |
| | | { |
| | | targetView.btnIcon.UnSelectedImagePath = "FunctionIcon/Icon/groupControl.png"; |
| | | if (colorful == "on") |
| | | { |
| | | stateStr = Language.StringByID(StringId.onLogic); |
| | | } |
| | | else if (colorful == "off") |
| | | { |
| | | stateStr = Language.StringByID(StringId.offLogic); |
| | | } |
| | | |
| | | break; |
| | | } |
| | | } |
| | | |
| | | string on_off = GetKeyValue("on_off", dicList); |
| | | string brightness = GetKeyValue("brightness", dicList); |
| | | if (on_off == "on" && brightness != "") |
| | |
| | | |
| | | } |
| | | break; |
| | | |
| | | case SPK.GroupControl: //群控 |
| | | { |
| | | targetView.btnIcon.UnSelectedImagePath = "FunctionIcon/Icon/groupControl.png"; |
| | | string on_off = GetKeyValue("on_off", dicList); |
| | | string brightness = GetKeyValue("brightness", dicList); |
| | | string cct = GetKeyValue(FunctionAttributeKey.CCT, dicList); |
| | | string colorful = GetKeyValue(FunctionAttributeKey.Colorful, dicList); |
| | | if (on_off == "on" && brightness != "") |
| | | { |
| | | stateStr = Language.StringByID(StringId.onLogic) + brightness + "%"; |
| | | } |
| | | else if (on_off == "on") |
| | | { |
| | | stateStr = Language.StringByID(StringId.onLogic); |
| | | } |
| | | else if (on_off == "off") |
| | | { |
| | | stateStr = Language.StringByID(StringId.offLogic); |
| | | } |
| | | else if (brightness != "") |
| | | { |
| | | stateStr = brightness + "%"; |
| | | } |
| | | //色温这个属性才有效 |
| | | if (!string.IsNullOrEmpty(cct)) |
| | | { |
| | | stateStr += "," + Language.StringByID(StringId.ColorTemperature) + cct + "k"; |
| | | } |
| | | |
| | | if (!string.IsNullOrEmpty(colorful)) |
| | | { |
| | | stateStr += "," + Language.StringByID(StringId.ColorfulFunction); |
| | | if (colorful == "on") |
| | | { |
| | | stateStr += Language.StringByID(StringId.onLogic); |
| | | } |
| | | else if (colorful == "off") |
| | | { |
| | | stateStr += Language.StringByID(StringId.offLogic); |
| | | } |
| | | |
| | | break; |
| | | } |
| | | |
| | | string rgb = GetKeyValue("rgb", dicList); |
| | | if (!string.IsNullOrEmpty(rgb) && rgb.Length > 6) |
| | | { |
| | | targetView.btnStateColor.Visible = true; |
| | | targetView.btnStateColor.BackgroundColor = new LogicView.RGBColorView().GetBackgroundColor(rgb); |
| | | } |
| | | |
| | | |
| | | } |
| | | break; |
| | | |
| | | case SPK.CurtainSwitch: |
| | | { |
| | | foreach (var dic in dicList) |
| | |
| | | } |
| | | } |
| | | break; |
| | | case SPK.GroupControl://群控 |
| | | { |
| | | foreach (var dic in dicList) |
| | | { |
| | | string value = dic["value"]; |
| | | switch (dic["key"]) |
| | | { |
| | | case "on_off": |
| | | case "colorful": |
| | | { |
| | | if (value == "on") |
| | | { |
| | | button1.Text = Language.StringByID(StringId.onLogic); |
| | | } |
| | | else |
| | | { |
| | | button1.Text = Language.StringByID(StringId.offLogic); |
| | | } |
| | | } |
| | | break; |
| | | case "brightness": |
| | | { |
| | | if (button1 == null) |
| | | { |
| | | //怕调试软件乱上东西导致抛异常 |
| | | break; |
| | | } |
| | | button1.Text = value + "%"; |
| | | } |
| | | break; |
| | | case "cct": |
| | | { |
| | | if (button1 == null) |
| | | { |
| | | //怕调试软件乱上东西导致抛异常 |
| | | break; |
| | | } |
| | | button1.Text = value + "k"; |
| | | } |
| | | break; |
| | | case "rgb": |
| | | { |
| | | if (button1 == null) |
| | | { |
| | | //怕调试软件乱上东西导致抛异常 |
| | | break; |
| | | } |
| | | if (!string.IsNullOrEmpty(value) && value.Length > 6) |
| | | { |
| | | button1.BackgroundColor = new LogicView.RGBColorView().GetBackgroundColor(value); |
| | | button1.Tag = value; |
| | | } |
| | | } |
| | | break; |
| | | |
| | | } |
| | | |
| | | } |
| | | } |
| | | break; |
| | | case SPK.CurtainSwitch: |
| | | { |
| | | foreach (var dic in dicList) |