| | |
| | | break; |
| | | //窗帘 |
| | | case FunctionType.Curtain: |
| | | { |
| | | //3表示(开,关,暂停)功能 |
| | | SwitchView(fLayout, device, index, edit, 3); |
| | | } |
| | | break; |
| | | case FunctionType.MotorCurtain: |
| | | case FunctionType.RollingShutter: |
| | | { |
| | | //3表示(开,关,暂停)功能 |
| | | SwitchBrightnessView(fLayout, device, index, edit, 3); |
| | | SwitchView(fLayout, device, index, edit, 3); |
| | | } |
| | | break; |
| | | case FunctionType.AC: |
| | |
| | | ///模式点击事件 |
| | | floorHeatingModehView.btnClick.MouseUpEventHandler += (sender, e) => |
| | | { |
| | | FrameLayout frame = new FrameLayout |
| | | { |
| | | BackgroundColor = CSS.CSS_Color.viewTrans60lucence, |
| | | }; |
| | | this.AddChidren(frame); |
| | | List<string> modeStr = new List<string> { |
| | | Language.StringByID(StringId.dayMode), |
| | | Language.StringByID(StringId.nightMode), |
| | |
| | | Language.StringByID(StringId.ordinaryMode), |
| | | Language.StringByID(StringId.timeMode), |
| | | }; |
| | | FrameLayout frame = new FrameLayout |
| | | { |
| | | BackgroundColor = CSS.CSS_Color.viewTrans60lucence, |
| | | }; |
| | | this.AddChidren(frame); |
| | | LogicView.DateView modeView = new LogicView.DateView(); |
| | | modeView.btnTitle.TextID = StringId.modeLogic; |
| | | modeView.FLayoutView(frame, modeStr.Count); |
| | | modeView.btnCancel.MouseUpEventHandler += (sender2, e2) => |
| | | { |
| | | frame.RemoveFromParent(); |
| | | }; |
| | | ///定义一个Btn记录选中状态 |
| | | Button checkBtn = new Button |
| | | { |
| | | Tag = "unknown", |
| | | }; |
| | | for (int i = 0; i < modeStr.Count; i++) |
| | | { |
| | | LogicView.CheckView modeTypeView = new LogicView.CheckView(); |
| | | modeTypeView.frameLayout.Y = Application.GetRealHeight(56 + 50 * i); |
| | | modeView.frameLayout.AddChidren(modeTypeView.FLayoutView()); |
| | | modeTypeView.btnText.Text = modeStr[i]; |
| | | modeTypeView.btnClick.Tag = modeStr[i];//标记 |
| | | ///之前的状态文本 |
| | | string currText= floorHeatingModehView.btnState.Text; |
| | | PublicInterface modeView = new PublicInterface(); |
| | | modeView.SingleSelectionShow(frame, modeStr, Language.StringByID(StringId.modeLogic), currText |
| | | , (stateValue) => |
| | | { |
| | | string keyVlaue = "mode"; |
| | | Dictionary<string, string> dic = new Dictionary<string, string>(); |
| | | LogicMethod.dictionary(dic, "key", "mode"); |
| | | LogicMethod.dictionary(dic, "value", GetModeValueString(stateValue, "FloorHeating")); |
| | | AddDictionaryData(dicSateteList, keyVlaue, dic); |
| | | floorHeatingModehView.btnState.Text = stateValue; |
| | | selectedState = device.functionType + "_mode"; |
| | | }); |
| | | |
| | | if (floorHeatingModehView.btnState.Text == modeStr[i]) |
| | | { |
| | | //显示之前的选中状态 |
| | | checkBtn.IsSelected = false; |
| | | modeTypeView.btnCheckIcon.IsSelected = true; |
| | | checkBtn = modeTypeView.btnCheckIcon; |
| | | checkBtn.Tag = modeTypeView.btnClick.Tag.ToString(); |
| | | } |
| | | //星期的点击事件 |
| | | modeTypeView.btnClick.MouseUpEventHandler += (sender1, e1) => |
| | | { |
| | | checkBtn.IsSelected = false; |
| | | modeTypeView.btnCheckIcon.IsSelected = true; |
| | | checkBtn = modeTypeView.btnCheckIcon; |
| | | checkBtn.Tag = modeTypeView.btnClick.Tag.ToString(); |
| | | }; |
| | | |
| | | } |
| | | modeView.btnConfirm.MouseUpEventHandler += (sender1, e1) => |
| | | { |
| | | if (checkBtn.Tag.ToString() == "unknown") |
| | | { |
| | | return; |
| | | } |
| | | |
| | | Dictionary<string, string> dic = new Dictionary<string, string>(); |
| | | LogicMethod.dictionary(dic, "key", "mode"); |
| | | string keyVlaue = "mode"; |
| | | LogicMethod.dictionary(dic, "value", GetModeValueString(checkBtn.Tag.ToString(), "FloorHeating")); |
| | | floorHeatingModehView.btnState.Text = checkBtn.Tag.ToString(); |
| | | selectedState = device.functionType + "_mode"; |
| | | AddDictionaryData(dicSateteList, keyVlaue, dic); |
| | | RemView(frame); |
| | | }; |
| | | }; |
| | | if (edit) |
| | | { |
| | |
| | | } |
| | | break; |
| | | case FunctionType.Curtain: |
| | | case FunctionType.MotorCurtain: |
| | | case FunctionType.RollingShutter: |
| | | { |
| | | foreach (var dic in dicList) |
| | | { |
| | |
| | | } |
| | | break; |
| | | } |
| | | } |
| | | } |
| | | break; |
| | | case FunctionType.MotorCurtain: |
| | | case FunctionType.RollingShutter: |
| | | { |
| | | |
| | | foreach (var dic in dicList) |
| | | { |
| | | string value = dic["value"]; |
| | | switch (dic["key"]) |
| | | { |
| | | case "on_off": |
| | | { |
| | | switch (value) |
| | | { |
| | | case "on": |
| | | { |
| | | button1.Text = Language.StringByID(StringId.onLogic); |
| | | } |
| | | break; |
| | | case "off": |
| | | { |
| | | button1.Text = Language.StringByID(StringId.offLogic); |
| | | } |
| | | break; |
| | | case "stop": |
| | | { |
| | | button1.Text = Language.StringByID(StringId.stop); |
| | | } |
| | | break; |
| | | } |
| | | } |
| | | break; |
| | | case "percent": |
| | | { |
| | | |
| | | button2.Text = value; |
| | | } |
| | | break; |
| | | } |
| | | |
| | | } |
| | | } |
| | | break; |