| | |
| | | Common.Logic.CurrentLogic.LogicName = logicName; |
| | | if (Common.Logic.CurrentLogic.Conditions.Count == 1) |
| | | { |
| | | ConditionView(false, frameLayout); |
| | | ConditionView(false, frameLayout,null); |
| | | } |
| | | else |
| | | { |
| | |
| | | case DeviceType.IASZone: |
| | | { |
| | | var iASZonedevice = deviceinof as IASZone; |
| | | var intvalue = conditions["AttriButeData1"]; |
| | | //var intvalue = conditions["AttriButeData1"]; |
| | | string if_value = "5"; |
| | | var intvalue = conditions["Range"]; |
| | | icon = $"ZigeeLogic/sensor{iASZonedevice.IasDeviceType}.png"; |
| | | switch (iASZonedevice.IasDeviceType) |
| | | { |
| | |
| | | } |
| | | else |
| | | { |
| | | if (conditions.ContainsKey("IgnoreTime")) |
| | | |
| | | |
| | | if (conditions.ContainsKey("IgnoreTime")&& conditions["IgnoreTime"]!="0") |
| | | { |
| | | int minute = int.Parse(conditions["IgnoreTime"]) / 60; |
| | | int second = int.Parse(conditions["IgnoreTime"]) % 60; |
| | |
| | | case 21: |
| | | case 22: |
| | | { |
| | | if (conditions.ContainsKey("IgnoreTime")) |
| | | { |
| | | |
| | | if (conditions.ContainsKey("IgnoreTime")&&conditions["IgnoreTime"] != "0") |
| | | { |
| | | int minute = int.Parse(conditions["IgnoreTime"]) / 60; |
| | | int second = int.Parse(conditions["IgnoreTime"]) % 60; |
| | | if (minute != 0 && second != 0) |
| | |
| | | } |
| | | else |
| | | { |
| | | if (intvalue == "1") |
| | | if (intvalue == if_value) |
| | | { |
| | | state = Language.StringByID(MyInternationalizationString.logicopen); |
| | | } |
| | |
| | | break; |
| | | case 40: |
| | | { |
| | | if (intvalue == "1") |
| | | if (intvalue == if_value) |
| | | { |
| | | state =Language.StringByID(MyInternationalizationString.smokescreen); |
| | | } |
| | |
| | | break; |
| | | case 42: |
| | | { |
| | | if (intvalue == "1") |
| | | if (intvalue == if_value) |
| | | { |
| | | state =Language.StringByID( MyInternationalizationString.waterleakage); |
| | | } |
| | |
| | | break; |
| | | case 43: |
| | | { |
| | | if (intvalue == "1") |
| | | if (intvalue == if_value) |
| | | { |
| | | state =Language.StringByID( MyInternationalizationString.gas); |
| | | } |
| | |
| | | break; |
| | | case 277: |
| | | { |
| | | if (intvalue == "1") |
| | | if (intvalue == if_value) |
| | | { |
| | | state =Language.StringByID( MyInternationalizationString.callthepolice); |
| | | } |
| | |
| | | break; |
| | | default: |
| | | { |
| | | if (intvalue == "1") |
| | | if (intvalue == if_value) |
| | | { |
| | | state =Language.StringByID(MyInternationalizationString.callthepolice); |
| | | } |
| | |
| | | s = "≤"; |
| | | } |
| | | break; |
| | | }
|
| | | ///转换温度值/100
|
| | | } |
| | | ///转换温度值/100 |
| | | string srtValue = (int.Parse(conditions["AttriButeData1"]) / 100).ToString(); |
| | | if (conditions["Cluster_ID"] == "1026") |
| | | { |
| | |
| | | break; |
| | | case 6: |
| | | { |
| | | var flMain = new FrameLayout { BackgroundColor = ZigbeeColor.Current.LogicViewBackgroundColor }; |
| | | frameLayout.AddChidren(flMain); |
| | | AddLogicPage.SecurityView(flMain, true); |
| | | |
| | | AddLogicPage.SecurityView(frameLayout, true); |
| | | } |
| | | break; |
| | | case 7: |
| | | { |
| | | var flMain = new FrameLayout { BackgroundColor = ZigbeeColor.Current.LogicViewBackgroundColor }; |
| | | frameLayout.AddChidren(flMain); |
| | | AddLogicPage.LocationView(flMain, true); |
| | | |
| | | AddLogicPage.LocationView(frameLayout, true); |
| | | } |
| | | break; |
| | | } |
| | |
| | | selecteddevice.del.MouseUpEventHandler += (sender, e) => |
| | | { |
| | | |
| | | var alert = new UserCenter.ShowMsgControl(UserCenter.ShowMsgType.Confirm, |
| | | var alert = new UserCenter.ShowMsgControl(ShowMsgType.Confirm, |
| | | Language.StringByID(MyInternationalizationString.doyouwanttodelete), |
| | | Language.StringByID(MyInternationalizationString.confrim)); |
| | | alert.Show(); |
| | |
| | | { |
| | | Common.Logic.CurrentLogic.Conditions.Remove(conditions); |
| | | selecteddevice.selecetdFrameLayout.RemoveFromParent(); |
| | | |
| | | var exist = Common.Logic.CurrentLogic.Conditions.Find((obj) => obj["Type"] == "7"); |
| | | if (exist == null) |
| | | { |
| | | //如果找不到地理位置作为条件的话,关闭GPS服务(减少耗电) |
| | | if (Send.It_Exist == "1") |
| | | { |
| | | Application.StopGPSLocationService(); |
| | | Send.SaveLocalFile("GPS_File", "0"); |
| | | } |
| | | } |
| | | //var logicCommunalPage = new LogicCommunalPage(); |
| | | //UserView.HomePage.Instance.AddChidren(logicCommunalPage); |
| | | //UserView.HomePage.Instance.PageIndex += 1; |
| | | //logicCommunalPage.Show(() => { }); |
| | | }; |
| | | |
| | | }; |
| | |
| | | { |
| | | var intvalue = int.Parse(tasks["Data1"]); |
| | | var colorTemperatureValue = 1000000 / (intvalue * 100); |
| | | state += Language.StringByID(MyInternationalizationString.colorTemperature) + colorTemperatureValue.ToString() + "K"; |
| | | state += Language.StringByID(MyInternationalizationString.colorTemperature) + colorTemperatureValue.ToString() + "00K"; |
| | | } |
| | | break; |
| | | } |
| | |
| | | actiondevice.del.MouseUpEventHandler += (sender, e) => |
| | | { |
| | | |
| | | var alert = new UserCenter.ShowMsgControl(UserCenter.ShowMsgType.Confirm, |
| | | var alert = new UserCenter.ShowMsgControl(ShowMsgType.Confirm, |
| | | Language.StringByID(MyInternationalizationString.doyouwanttodelete), |
| | | Language.StringByID(MyInternationalizationString.confrim)); |
| | | alert.Show(); |
| | |
| | | /// <summary> |
| | | /// 与或条件布局界面的方法 |
| | | /// </summary> |
| | | /// <param name="edit"></param> |
| | | /// <param name="frameLayout"></param> |
| | | public void ConditionView(bool edit, FrameLayout frameLayout) |
| | | /// <param name="edit">表示是否编辑</param> |
| | | /// <param name="frameLayout">显示在哪个界面</param> |
| | | /// <param name="button">显示选中文本</param> |
| | | public void ConditionView(bool edit, FrameLayout frameLayout,Button button) |
| | | { |
| | | |
| | | #region ------组合条件界面布局部分 |
| | | var flMain = new FrameLayout { BackgroundColor = ZigbeeColor.Current.LogicTranslucentColor }; |
| | | frameLayout.AddChidren(flMain); |
| | | CompleteView completeView = new CompleteView(); |
| | | flMain.AddChidren(completeView.Show(2)); |
| | | completeView.Btntitle.TextID = MyInternationalizationString.condition; |
| | | EventHandler<MouseEventArgs> clickcancel = (sender, e) => |
| | | { |
| | | UserView.HomePage.Instance.ScrollEnabled = true; |
| | | flMain.RemoveFromParent(); |
| | | }; |
| | | flMain.MouseUpEventHandler += clickcancel; |
| | | completeView.Btncancel.MouseUpEventHandler += clickcancel; |
| | | |
| | | //满足所有条件 |
| | | mFunView allFunView = new mFunView(); |
| | | allFunView.frameLayout.Y = Application.GetRealHeight(140 + 20); |
| | | completeView.Show(2).AddChidren(allFunView.Show()); |
| | | allFunView.titleBtn.TextID = MyInternationalizationString.Allconditions; |
| | | //满足其中一个条件 |
| | | mFunView ormFunview = new mFunView(); |
| | | ormFunview.frameLayout.Y = allFunView.frameLayout.Bottom; |
| | | completeView.Show(2).AddChidren(ormFunview.Show()); |
| | | ormFunview.titleBtn.TextID = MyInternationalizationString.anycondition; |
| | | ormFunview.lineBtn.BackgroundColor = ZigbeeColor.Current.LogicBackgroundColor; |
| | | #endregion |
| | | |
| | | ///满足所有条件点击事件 |
| | | allFunView.clickviewBtn.MouseUpEventHandler += (sedner, e) => |
| | | { |
| | | allFunView.selectedIconBtn.Visible = true; |
| | | ormFunview.selectedIconBtn.Visible = false; |
| | | allFunView.titleBtn.TextColor = ZigbeeColor.Current.LogicBtnSelectedColor; |
| | | ormFunview.titleBtn.TextColor = ZigbeeColor.Current.LogicBtnNotSelectedColor; |
| | | }; |
| | | ///满足其中一个条件点击事件 |
| | | ormFunview.clickviewBtn.MouseUpEventHandler += (sedner, e) => |
| | | { |
| | | allFunView.selectedIconBtn.Visible = false; |
| | | ormFunview.selectedIconBtn.Visible = true; |
| | | allFunView.titleBtn.TextColor = ZigbeeColor.Current.LogicBtnNotSelectedColor; |
| | | ormFunview.titleBtn.TextColor = ZigbeeColor.Current.LogicBtnSelectedColor; |
| | | }; |
| | | |
| | | |
| | | string stateText = ""; |
| | | if (edit) |
| | | { |
| | | if (Common.Logic.CurrentLogic.Relationship == 0) |
| | | { |
| | | allFunView.selectedIconBtn.Visible = true; |
| | | ormFunview.selectedIconBtn.Visible = false; |
| | | allFunView.titleBtn.TextColor = ZigbeeColor.Current.LogicBtnSelectedColor; |
| | | ormFunview.titleBtn.TextColor = ZigbeeColor.Current.LogicBtnNotSelectedColor; |
| | | } |
| | | else |
| | | { |
| | | allFunView.selectedIconBtn.Visible = false; |
| | | ormFunview.selectedIconBtn.Visible = true; |
| | | allFunView.titleBtn.TextColor = ZigbeeColor.Current.LogicBtnNotSelectedColor; |
| | | ormFunview.titleBtn.TextColor = ZigbeeColor.Current.LogicBtnSelectedColor; |
| | | } |
| | | } |
| | | completeView.Btncomplete.MouseUpEventHandler += (sender, e) => |
| | | { |
| | | if (!allFunView.selectedIconBtn.Visible && !ormFunview.selectedIconBtn.Visible) |
| | | { |
| | | ///可以提示未选中状态; |
| | | return; |
| | | } |
| | | flMain.RemoveFromParent(); |
| | | |
| | | if (allFunView.selectedIconBtn.Visible) |
| | | switch (Common.Logic.CurrentLogic.Relationship) |
| | | { |
| | | case 0: |
| | | { |
| | | stateText = Language.StringByID(MyInternationalizationString.Allconditions); |
| | | } |
| | | break; |
| | | case 1: |
| | | { |
| | | stateText = Language.StringByID(MyInternationalizationString.anycondition); |
| | | } |
| | | break; |
| | | } |
| | | |
| | | } |
| | | |
| | | PublicInterface publicInterface = new PublicInterface(); |
| | | var list = publicInterface.GetViewList("组合条件"); |
| | | publicInterface.SingleSelectionShow(frameLayout, list, MyInternationalizationString.condition, stateText, (str) => |
| | | { |
| | | //显示选中文本 |
| | | if (button!=null) { |
| | | button.Text = Language.StringByID(MyInternationalizationString.followingconditions)+ str; |
| | | } |
| | | if (str == Language.StringByID(MyInternationalizationString.Allconditions)) |
| | | { |
| | | Common.Logic.CurrentLogic.Relationship = 0; |
| | | |
| | | } |
| | | if (ormFunview.selectedIconBtn.Visible) |
| | | else if (str == Language.StringByID(MyInternationalizationString.anycondition)) |
| | | { |
| | | Common.Logic.CurrentLogic.Relationship = 1; |
| | | |
| | | Common.Logic.CurrentLogic.Relationship = 1; |
| | | } |
| | | if (edit) |
| | | { |
| | |
| | | { |
| | | Send.LogicControlSwitch(Common.Logic.CurrentLogic); |
| | | } |
| | | var logicCommunalPage = new LogicCommunalPage(); |
| | | UserView.HomePage.Instance.AddChidren(logicCommunalPage); |
| | | UserView.HomePage.Instance.PageIndex += 1; |
| | | logicCommunalPage.Show(() => { }); |
| | | } |
| | | else |
| | | { |
| | |
| | | UserView.HomePage.Instance.PageIndex += 1; |
| | | addLogicPage.Show(); |
| | | } |
| | | }; |
| | | |
| | | }); |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | } |
| | | } |