| | |
| | | DeviceType.IASZone, |
| | | DeviceType.OnOffSwitch, |
| | | DeviceType.OnOffOutput,//楼梯灯 |
| | | DeviceType.DoorLock |
| | | DeviceType.DoorLock, |
| | | DeviceType.TemperatureSensor, |
| | | }; |
| | | |
| | | ///楼层点击事件 |
| | |
| | | EventHandler<MouseEventArgs> foolrnameclick = (sender13, e13) => |
| | | { |
| | | roomhorizontalScrol.RemoveAll(); |
| | | devicetypehorizontalScrol.RemoveAll(); |
| | | middle.RemoveAll(); |
| | | foolrname.Text = btnfoolrname.Text; |
| | | flMain.RemoveFromParent(); |
| | | var list = Send.GetRoomList(btnfoolrname.Tag.ToString()); |
| | |
| | | ///第一次进来 |
| | | var roomlists = new List<Common.Room>(); |
| | | roomlists.Clear(); |
| | | if (Config.Instance.Home.FloorDics.Count < 1) |
| | | if (Config.Instance.Home.FloorDics.Count < 2) |
| | | { |
| | | foolrname.Visible = false; |
| | | dropdown.Visible = false; |
| | |
| | | devicetypelist.Add(Language.StringByID(MyInternationalizationString.Curtains)); |
| | | } |
| | | |
| | | var iASZonejosn = devicelist.Find((device) => device.CommonDevice.Type == DeviceType.IASZone); |
| | | var iASZonejosn = devicelist.Find((device) => device.CommonDevice.Type == DeviceType.IASZone|| device.CommonDevice.Type == DeviceType.TemperatureSensor); |
| | | if (iASZonejosn != null) |
| | | { |
| | | devicetypelist.Add(Language.StringByID(MyInternationalizationString.sensor)); |
| | |
| | | else if (devicetype == Language.StringByID(MyInternationalizationString.sensor)) |
| | | { |
| | | list.Add(DeviceType.IASZone); |
| | | list.Add(DeviceType.TemperatureSensor); |
| | | } |
| | | else if (devicetype == Language.StringByID(MyInternationalizationString.doorLock)) |
| | | { |
| | |
| | | deviceIconBtn.SelectedImagePath = $"ZigeeLogic/selectedsensor{iASZonedevice.IasDeviceType}.png"; |
| | | |
| | | |
| | | } |
| | | break; |
| | | case DeviceType.TemperatureSensor: |
| | | { |
| | | var temperatureSensor = common.CommonDevice as TemperatureSensor; |
| | | if (temperatureSensor.SensorDiv == 1) |
| | | { |
| | | deviceIconBtn.UnSelectedImagePath = $"ZigeeLogic/temperature.png"; |
| | | deviceIconBtn.SelectedImagePath = $"ZigeeLogic/selectedtemperature.png"; |
| | | } |
| | | else |
| | | { |
| | | deviceIconBtn.UnSelectedImagePath = "ZigeeLogic/humidity.png"; |
| | | deviceIconBtn.SelectedImagePath = "ZigeeLogic/selectedhumidity.png"; |
| | | } |
| | | } |
| | | break; |
| | | case DeviceType.OnOffSwitch: |
| | |
| | | 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); |
| | |
| | | ///查找成员以及成员门锁触发源(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; |
| | | |
| | | } |
| | | |
| | | } |
| | | |
| | |
| | | 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); |
| | |
| | | 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");//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", "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; |
| | | } |
| | | |
| | | Btncomplete.MouseUpEventHandler += (sender2, e2) => |