From d7ad5a3953a8cd001659092ebde204b881f94b9d Mon Sep 17 00:00:00 2001 From: WJC <wjc@hdlchina.com.cn> Date: 星期四, 31 十月 2019 10:47:13 +0800 Subject: [PATCH] 2019-10-31-1 --- ZigbeeApp/Shared/Phone/Device/Logic/DeviceStateCondition.cs | 92 ++++++++++++++++++++++++++++++++++++++++------ 1 files changed, 80 insertions(+), 12 deletions(-) diff --git a/ZigbeeApp/Shared/Phone/Device/Logic/DeviceStateCondition.cs b/ZigbeeApp/Shared/Phone/Device/Logic/DeviceStateCondition.cs index 585af4d..24b3a70 100644 --- a/ZigbeeApp/Shared/Phone/Device/Logic/DeviceStateCondition.cs +++ b/ZigbeeApp/Shared/Phone/Device/Logic/DeviceStateCondition.cs @@ -1371,8 +1371,7 @@ case DeviceType.DoorLock: { #region ------ - var doorlockifonlist = Send.ReadDoorLockIfon("ccccccfffe300347"); - //var list = Send.ReadDoorLockIfon(common.DeviceAddr); + var doorlockifonlist = await Send.UserListIfon(common.DeviceAddr); var pra = new UserCenter.MemberListInfoPra(); string result = await UserCenter.UserCenterLogic.GetResponseDataByRequestHttps("ZigbeeUsers/GetSubAccountByDistributedMark", false, pra); var listInfo = Newtonsoft.Json.JsonConvert.DeserializeObject<List<UserCenter.MemberInfoRes>>(result); @@ -1386,9 +1385,20 @@ ///鏌ユ壘鎴愬憳浠ュ強鎴愬憳闂ㄩ攣瑙﹀彂婧�(1鎸夐敭/3鍗�/15鎸囩汗) if (doorlockifonlist[j].CloudAccountId == membershipifon.SubAccountDistributedMark) { - membership.UserIdMode.Add(doorlockifonlist[j].UserIdMode); - membership.MembershipName = membershipifon.UserName; + var lockMode = new Send.LockMode(); + lockMode.UserId = doorlockifonlist[j].DoorLockLocalUserId; + lockMode.OpenMode = doorlockifonlist[j].OpenLockMode; + membership.UserIdMode.Add(lockMode); membership.MembershipId = membershipifon.SubAccountDistributedMark; + if (string.IsNullOrEmpty(membershipifon.UserName)) + { + membership.MembershipName = membershipifon.Account; + } + else + { + membership.MembershipName = membershipifon.UserName; + + } } @@ -1396,7 +1406,7 @@ if (membership.UserIdMode.Count != 0) { ///杩囨护鎺夐噸澶嶆暟鎹紱 - var str = Send.UserList.Find((c) => { return c.MembershipId == membership.MembershipId; }); + var str = Send.UserList.Find((c) => { return c.MembershipId == membershipifon.SubAccountDistributedMark; }); if (str == null) { Send.UserList.Add(membership); @@ -1413,32 +1423,90 @@ memberList.Show(common); } break; - case DeviceType.TemperatureSensor: { - + string current = Language.StringByID(MyInternationalizationString.current); + devicefra.Y = Application.GetRealHeight(1920 - 140 - 160 * 2 - 20 - 50); + devicefra.Height = Application.GetRealHeight(140 + 160 * 2 + 20 + 50); var temperatureSensor = common as TemperatureSensor; + var Btntemperaturevalue = new Button + { + TextColor = ZigbeeColor.Current.LogicBtnCancelColor, + Height = Application.GetRealHeight(60), + Width = Application.GetRealWidth(400), + TextAlignment = TextAlignment.CenterLeft, + X = Application.GetRealWidth(80), + Y = timetype.Bottom + Application.GetRealHeight(70), + }; + devicefra.AddChidren(Btntemperaturevalue); + + var horizontalSeekBarVol = new HorizontalSeekBar + { + Width = Application.GetRealWidth(920), + Height = Application.GetRealHeight(80), + Radius = (uint)Application.GetRealHeight(25), + Y = timetype.Bottom + Application.GetRealHeight(70 + 60 + 70), + X = Application.GetRealWidth(80), + ProgressColor = ZigbeeColor.Current.LogicProgressColorSelected, + Max = 100, + SleepTime = 1000, + ThumbRadius = 9, + }; + devicefra.AddChidren(horizontalSeekBarVol); + horizontalSeekBarVol.MouseUpEventHandler += (sender, e) => + { + SelectedDeviceStatuscondition = "TemperatureSensor"; + if (temperatureSensor.SensorDiv == 1) + { + dictionary(deviceConditionsInfo, "AttriButeData1", horizontalSeekBarVol.Progress.ToString()); + + Btntemperaturevalue.Text = current + ">" + horizontalSeekBarVol.Progress.ToString() + "鈩�"; + + } + else + { + Btntemperaturevalue.Text = current + "<" + horizontalSeekBarVol.Progress.ToString() + "%"; + dictionary(deviceConditionsInfo, "AttriButeData1", horizontalSeekBarVol.Progress.ToString());//娓╁害鍊� + } + }; + + + if (temperatureSensor.SensorDiv == 1) { dictionary(deviceConditionsInfo, "Cluster_ID", "1026"); dictionary(deviceConditionsInfo, "AttriButeId", "0"); - dictionary(deviceConditionsInfo, "Range", "0"); + dictionary(deviceConditionsInfo, "Range", "0");//0澶т簬AttriButeData1鏃惰Е鍙戝姩浣� dictionary(deviceConditionsInfo, "AttriButeData1", "0"); dictionary(deviceConditionsInfo, "AttriButeData2", "0"); - - + Btntemperaturevalue.Text = current + ">0鈩�"; } else { - + Btntemperaturevalue.Text = current + "<0%"; dictionary(deviceConditionsInfo, "Cluster_ID", "1029"); dictionary(deviceConditionsInfo, "AttriButeId", "0"); - dictionary(deviceConditionsInfo, "Range", "0");//琛ㄧず澶т簬鍊� + dictionary(deviceConditionsInfo, "Range", "2");//2灏忎簬AttriButeData1鏃惰Е鍙戝姩浣� dictionary(deviceConditionsInfo, "AttriButeData1", "0");//娓╁害鍊� dictionary(deviceConditionsInfo, "AttriButeData2", "0"); } + if (edit && devices != null) + { + horizontalSeekBarVol.Progress = int.Parse(devices["AttriButeData1"]); + if (temperatureSensor.SensorDiv == 1) + { + + Btntemperaturevalue.Text = current + ">" + devices["AttriButeData1"] + "鈩�"; + + } + else + { + Btntemperaturevalue.Text = current + "<" + devices["AttriButeData1"] + "%"; + } + } + } break; } -- Gitblit v1.8.0