From 3a662a08e1c54c9a5687a43a8133c8e42981f474 Mon Sep 17 00:00:00 2001 From: WJC <wjc@hdlchina.com.cn> Date: 星期二, 31 三月 2020 14:30:23 +0800 Subject: [PATCH] 2020-03-31-1 --- ZigbeeApp/Shared/Phone/Device/Logic/SkipView.cs | 46 ++++++++++++++++++++++++++++++---------------- 1 files changed, 30 insertions(+), 16 deletions(-) diff --git a/ZigbeeApp/Shared/Phone/Device/Logic/SkipView.cs b/ZigbeeApp/Shared/Phone/Device/Logic/SkipView.cs index 06fc920..fee5add 100644 --- a/ZigbeeApp/Shared/Phone/Device/Logic/SkipView.cs +++ b/ZigbeeApp/Shared/Phone/Device/Logic/SkipView.cs @@ -56,6 +56,12 @@ doorLockLogicList.Show(); } break; case 2: { + ///杩涙潵鍒锋柊涓�娆¤澶囧垪琛紱 + Common.Logic.LogicDviceList.Clear(); + if (Common.Logic.LogicDviceList.Count == 0) + { + Common.Logic.LogicDviceList.AddRange(LocalDevice.Current.listAllDevice.ToArray()); + } //new涓�涓柊閫昏緫瀵硅薄锛� //鏂板闂ㄩ攣甯稿紑妯″紡鑷姩鍖栧叆鍙o紱 Common.Logic.CurrentLogic = new Common.Logic(); @@ -358,10 +364,10 @@ refresview.BackgroundColor = ZigbeeColor.Current.LogicBackgroundColor; } } - + int i = 1;//灞�閮ㄥ彉閲忥紝榛樿鏄涓�鏉¢�昏緫; foreach (var logic in Common.Logic.LogicList) { - + var fLayout = new FrameLayout { Height = Application.GetRealHeight(190 + 30), @@ -369,7 +375,7 @@ BackgroundColor = ZigbeeColor.Current.LogicBackgroundColor, }; refresview.AddChidren(fLayout); - + var logicRowlayout = new RowLayout { Height = Application.GetRealHeight(190 + 30), @@ -380,7 +386,14 @@ }; fLayout.AddChidren(logicRowlayout); - + if (i == 1) + { + //瀹炵幇android鏄剧ず閫昏緫鍒楄〃鐨勫渾瑙�; + fLayout.SetCornerWithSameRadius(Application.GetRealHeight(58), HDLUtils.RectCornerTopLeft); + logicRowlayout.SetCornerWithSameRadius(Application.GetRealHeight(58), HDLUtils.RectCornerTopLeft); + i = 2; + } + var logicnameBtn = new Button { Height = Application.GetRealHeight(58), @@ -396,8 +409,8 @@ var logicswitchBtn = new Button { - Width = Application.GetRealWidth(104), - Height = Application.GetRealHeight(63), + Width = Application.GetMinRealAverage(104), + Height = Application.GetMinRealAverage(63), UnSelectedImagePath = "ZigeeLogic/logicclose.png", SelectedImagePath = "ZigeeLogic/logicopen.png", X = logicRowlayout.Width - Application.GetRealWidth(104 + 58), @@ -421,7 +434,7 @@ logic.IsEnable = 0; StatusColor(logic, logicRowlayout, 0); } - Device.Logic.Send.LogicControlSwitch(logic); + Send.LogicControlSwitch(logic); //Logic.Send.AddModifyLogic(logic); }; if (logic.IsEnable == 1) @@ -507,7 +520,7 @@ logicRowlayout.AddChidren(logictimeBtn); ///鏄剧ず鎵ц鍛ㄦ湡 - Device.Logic.Method.UpdateWeek(logictimeBtn, logic); + Method.UpdateWeek(logictimeBtn, logic); List<string> indexlist = new List<string>(); @@ -521,7 +534,8 @@ indexlist.Add(linkType); } } - if (indexlist.Contains("0")) + //鎺掑垪鍥炬爣椤哄簭; + if (indexlist.Contains("0")|| indexlist.Contains("8")) { iconIndexlist.Add("0"); } @@ -546,7 +560,7 @@ Height = Application.GetMinRealAverage(82), X = Application.GetRealWidth(58) + Application.GetRealWidth(12 + (12 + 82 + 45 + 12) * i), Y = Application.GetRealHeight(58 + 30 + 30), - Radius = (uint)Application.GetRealHeight(41), + Radius = (uint)Application.GetMinRealAverage(41), BackgroundColor = ZigbeeColor.Current.LogicMiddleBackgroundColor, }; logicRowlayout.AddChidren(typebjBtn); @@ -652,16 +666,15 @@ public static void LockAddModifyLogic(int timeVlaue, CommonDevice common) { - int hour = timeVlaue / 60; - int min = timeVlaue % 60; Dictionary<string, string> timeConditionsInfo = new Dictionary<string, string>(); timeConditionsInfo.Add("Type", "0"); timeConditionsInfo.Add("IsValid", "1"); timeConditionsInfo.Add("DateType", "0"); timeConditionsInfo.Add("RemindTime", "0"); - timeConditionsInfo.Add("DelayTime", "0"); - timeConditionsInfo.Add("StartHour", hour.ToString()); - timeConditionsInfo.Add("StartMin", min.ToString()); + timeConditionsInfo.Add("EnDelay", "0"); + timeConditionsInfo.Add("DelayTime", "0"); + timeConditionsInfo.Add("StartHour", timeVlaue.ToString()); + timeConditionsInfo.Add("StartMin", "0"); Dictionary<string, object> actionsInfo = new Dictionary<string, object>(); actionsInfo.Add("LinkType", 8); actionsInfo.Add("DeviceAddr", common.DeviceAddr); @@ -669,8 +682,9 @@ actionsInfo.Add("PassData", "055704010112");//榛樿闂ㄩ攣甯稿紑 Common.Logic currentLogic = new Common.Logic(); - currentLogic.IsEnable = 0;//榛樿绂佺敤 + currentLogic.IsEnable = 1;//榛樿涓哄紑 currentLogic.TimeAttribute.Repeat = 0;//鎵ц涓�娆� + currentLogic.LogicType = 2;//鏍囪閫昏緫绫诲瀷 currentLogic.LogicName = Language.StringByID(R.MyInternationalizationString.openmode); currentLogic.Conditions.Add(timeConditionsInfo); currentLogic.Actions.Add(actionsInfo); -- Gitblit v1.8.0