| | |
| | | } |
| | | //显示文本 |
| | | lightSwitchView.btnState.TextID = id; |
| | | selectedState = device.functionType + "_" + strValue; |
| | | selectedState = device.spk + "_" + strValue; |
| | | //设备属性值,云雀上定义好的; |
| | | string keyVlaue = "on_off"; |
| | | AddDictionary(keyVlaue, strValue); |
| | |
| | | |
| | | } |
| | | /// <summary> |
| | | /// 开关功能展开界面 |
| | | /// </summary> |
| | | /// <param name="frame"></param> |
| | | /// <param name="device"></param> |
| | | /// <param name="button"></param> |
| | | /// <param name="len"></param> |
| | | public void SwitchViewMethod(FrameLayout frame, Entity.Function device, Button button, int len) |
| | | { |
| | | |
| | | LogicView.SwitchView switchView = new LogicView.SwitchView(); |
| | | switchView.FLayoutView(frame, len, button.Text, (Action<string>)((strValue) => |
| | | { |
| | | int id = 0; |
| | | switch (strValue) |
| | | { |
| | | case "on": |
| | | { |
| | | id = StringId.onLogic; |
| | | } |
| | | break; |
| | | case "off": |
| | | { |
| | | id = StringId.offLogic; |
| | | } |
| | | break; |
| | | } |
| | | button.TextID = id; |
| | | keyVlaue = "on_off"; |
| | | Dictionary<string, string> dic = new Dictionary<string, string>(); |
| | | LogicMethod.dictionary(dic, "key", "on_off"); |
| | | LogicMethod.dictionary(dic, "comparator", "="); |
| | | LogicMethod.dictionary(dic, "data_type", "string"); |
| | | LogicMethod.dictionary(dic, "value", strValue); |
| | | AddDictionaryData(dicSateteList, keyVlaue, dic); |
| | | selectedState = device.spk + "_" + strValue; |
| | | |
| | | })); |
| | | |
| | | } |
| | | /// <summary> |
| | | /// 显示编辑之前的设备状态 |
| | | /// </summary> |
| | | /// <param name="device">编辑设备</param> |
| | |
| | | { |
| | | //有数据重新赋值 |
| | | dicSateteList = dicList; |
| | | } |
| | | switch (device.spk) |
| | | { |
| | | //开关灯光 light.Switch |
| | | case SPK.LightDimming: |
| | | case SPK.LightRGB: |
| | | case SPK.LightRGBW: |
| | | case SPK.LightCCT: |
| | | case SPK.LightSwitch: |
| | | //窗帘 |
| | | case SPK.CurtainSwitch: |
| | | case SPK.CurtainRoller: |
| | | case SPK.CurtainTrietex: |
| | | //空调 |
| | | case SPK.AcStandard: |
| | | //地热 |
| | | case SPK.FloorHeatStandard: |
| | | { |
| | | foreach (var dic in dicList) |
| | | { |
| | | string value = dic["value"]; |
| | | if (value == "on") |
| | | { |
| | | button1.Text = Language.StringByID(StringId.onLogic); |
| | | } |
| | | else |
| | | { |
| | | button1.Text = Language.StringByID(StringId.offLogic); |
| | | } |
| | | } |
| | | } |
| | | break; |
| | | |
| | | } |
| | | InpOrOutLogicMethod.EditState(device, dicList, button1, button2, button3, button4); |
| | | } |