ZigbeeApp/Shared/Phone/MainPage/ControlForm/DevicePmSensorDetailCardForm.cs
@@ -166,22 +166,6 @@ btnPmUnit.TextAlignment = TextAlignment.CenterLeft; framePmPic.AddChidren(btnPmUnit); this.listControl.Add(btnPmUnit); frameHumidityPic.MouseUpEventHandler += (sender, e) => { pMSensor.currentPmData = 35; UpdateStatus(); }; frameTemperaturePic.MouseUpEventHandler += (sender, e) => { pMSensor.currentPmData = 99; UpdateStatus(); }; framePmPic.MouseUpEventHandler += (sender, e) => { pMSensor.currentPmData = 100; UpdateStatus(); }; } #endregion @@ -281,16 +265,13 @@ if (pMSensor.currentPmData < 10) { this.listControl[2].Width = Application.GetRealWidth(193 - 70); this.listControl[2].Width = Application.GetRealWidth(188 - 70); this.listControl[3].X = Application.GetRealWidth(180 - 70); } else { this.listControl[2].Width = Application.GetRealWidth(193 - 40); this.listControl[3].X = Application.GetRealWidth(153 - 25); this.listControl[2].BackgroundColor = 0xff00ff00; this.listControl[3].BackgroundColor = 0xff00ffff; this.listControl[3].X = Application.GetRealWidth(137); } } @@ -298,7 +279,7 @@ { curQuality = Language.StringByID(R.MyInternationalizationString.ExcellentAirQuality); this.listControl[2].Width = Application.GetRealWidth(193 - 40); this.listControl[3].X = Application.GetRealWidth(153 - 25); this.listControl[3].X = Application.GetRealWidth(137); } else if (pMSensor.currentPmData <= 115 && pMSensor.currentPmData > 75) { @@ -307,16 +288,12 @@ if (pMSensor.currentPmData < 100) { this.listControl[2].Width = Application.GetRealWidth(193 - 40); this.listControl[3].X = Application.GetRealWidth(153 - 25); this.listControl[2].BackgroundColor = 0xff00ff00; this.listControl[3].BackgroundColor = 0xff00ffff; this.listControl[3].X = Application.GetRealWidth(137); } else { this.listControl[2].Width = Application.GetRealWidth(162); this.listControl[3].X = Application.GetRealWidth(153); this.listControl[2].BackgroundColor = 0xff00ff00; this.listControl[3].BackgroundColor = 0xff00ffff; } } else if (pMSensor.currentPmData <= 150 && pMSensor.currentPmData > 115) @@ -340,8 +317,8 @@ else { curQuality = ""; this.listControl[2].Width = Application.GetRealWidth(0); this.listControl[3].Gravity = Gravity.CenterHorizontal; this.listControl[2].Width = Application.GetRealWidth(162); this.listControl[3].X = Application.GetRealWidth(153); } //设置状态文字 return curQuality; ZigbeeApp/Shared/Phone/UserCenter/Device/Panel/PanelFangyueFreshAirButtonSettionForm.cs
@@ -208,7 +208,7 @@ rowNewWind.ButtonClickEvent += (sender, e) => { var addDevicePage = new Shared.Phone.UserCenter.DeviceBind.PanelFangyueFreshAirTargetsForm(this.deviceObj, bindFreshAirDev, bindList, 1); var addDevicePage = new Shared.Phone.UserCenter.DeviceBind.PanelFangyueFreshAirTargetsForm(this.deviceObj, bindFreshAirDev, 1); Shared.Phone.UserView.HomePage.Instance.AddChidren(addDevicePage); Shared.Phone.UserView.HomePage.Instance.PageIndex += 1; addDevicePage.Show(); @@ -283,7 +283,6 @@ { bindTemperatureName = bDev.ESName; } bindTemperatureDev = device; } if (bD.SensorDiv == 2) @@ -317,28 +316,12 @@ { if (bDev.BindCluster == 1026) { if (string.IsNullOrEmpty(bDev.ESName)) { bindTemperatureName = device.DeviceEpointName; } else { bindTemperatureName = bDev.ESName; } bindTemperatureName = Common.LocalDevice.Current.GetDeviceEpointName(device) + "-" + Language.StringByID(R.MyInternationalizationString.TemperatureSensor); bindTemperatureDev = device; } if (bDev.BindCluster == 1029) { if (string.IsNullOrEmpty(bDev.ESName)) { bindHumidityName = device.DeviceEpointName; } else { bindHumidityName = bDev.ESName; } bindHumidityName = Common.LocalDevice.Current.GetDeviceEpointName(device) + "-" + Language.StringByID(R.MyInternationalizationString.HumiditySensor); bindHumidityDev = device; } if (bDev.BindCluster == 1066) @@ -383,7 +366,7 @@ var btnPMStatu = rowPM.AddMostRightView(msg, 700); rowPM.ButtonClickEvent += (sender, e) => { var addDevicePage = new Shared.Phone.UserCenter.DeviceBind.PanelFangyueFreshAirTargetsForm(this.deviceObj, bindPMDev, bindList, 4); var addDevicePage = new Shared.Phone.UserCenter.DeviceBind.PanelFangyueFreshAirTargetsForm(this.deviceObj, bindPMDev, 4); Shared.Phone.UserView.HomePage.Instance.AddChidren(addDevicePage); Shared.Phone.UserView.HomePage.Instance.PageIndex += 1; addDevicePage.Show(); @@ -428,7 +411,7 @@ var btnTemperatureStatu = rowTemPerature.AddMostRightView(msg, 700); rowTemPerature.ButtonClickEvent += (sender, e) => { var addDevicePage = new Shared.Phone.UserCenter.DeviceBind.PanelFangyueFreshAirTargetsForm(this.deviceObj, bindTemperatureDev, bindList, 2); var addDevicePage = new Shared.Phone.UserCenter.DeviceBind.PanelFangyueFreshAirTargetsForm(this.deviceObj, bindTemperatureDev, 2); Shared.Phone.UserView.HomePage.Instance.AddChidren(addDevicePage); Shared.Phone.UserView.HomePage.Instance.PageIndex += 1; addDevicePage.Show(); @@ -473,7 +456,7 @@ var btnHumidityStatu = rowHumidity.AddMostRightView(msg, 700); rowHumidity.ButtonClickEvent += (sender, e) => { var addDevicePage = new Shared.Phone.UserCenter.DeviceBind.PanelFangyueFreshAirTargetsForm(this.deviceObj, bindHumidityDev, bindList, 3); var addDevicePage = new Shared.Phone.UserCenter.DeviceBind.PanelFangyueFreshAirTargetsForm(this.deviceObj, bindHumidityDev, 3); Shared.Phone.UserView.HomePage.Instance.AddChidren(addDevicePage); Shared.Phone.UserView.HomePage.Instance.PageIndex += 1; addDevicePage.Show(); ZigbeeApp/Shared/Phone/UserCenter/Device/Panel/PanelFangyueFreshAirTargetsForm.cs
@@ -18,16 +18,11 @@ /// <param name="device"></param> /// <param name="deviceBindType">1:新风;2:温度传感器;3:湿度传感器;4:PM2.5传感器</param> /// <param name="bindDev">绑定目标 </param> public PanelFangyueFreshAirTargetsForm(CommonDevice device, CommonDevice bindDev, List<BindListResponseObj> bindList, int deviceBindType) public PanelFangyueFreshAirTargetsForm(CommonDevice device, CommonDevice bindDev, int deviceBindType) { this.curControlDev = device as FreshAir; this.curBindDevice = bindDev; this.curDeviceBindType = deviceBindType; curControlDev.bindList = bindList; if (bindList.Count == 0) { canReadBindList = true; } } #endregion @@ -108,10 +103,7 @@ /// PM绑定目标回调 /// </summary> public Action<string> actionPMTarget = null; /// <summary> /// 是否能点击保存按钮 /// </summary> private bool canReadBindList = false; #endregion #region UI设计 @@ -735,27 +727,24 @@ //获取所有房间中匹配的能绑的目标 currentPanelSupportBindDeviceList = GetAllRoomSupportDeviceList(); //获取面板中存在的绑定目标 if (canReadBindList) //获取面板中存在的绑定目标 var panelBindListRes = await this.curControlDev.GetDeviceBindAsync(); if (panelBindListRes != null && panelBindListRes.getAllBindResponseData != null) { var panelBindListRes = await this.curControlDev.GetDeviceBindAsync(); if (panelBindListRes != null && panelBindListRes.getAllBindResponseData != null) curControlDev.bindList.Clear(); foreach (var bDev in panelBindListRes.getAllBindResponseData.BindList) { curControlDev.bindList.Clear(); foreach (var bDev in panelBindListRes.getAllBindResponseData.BindList) { curControlDev.bindList.Add(bDev); } curControlDev.bindList.Add(bDev); } else } else { Application.RunOnMainThread(() => { Application.RunOnMainThread(() => { CommonPage.Loading.Hide(); midVerticalScrolViewLayout.EndHeaderRefreshing(); new Tip() { MaxWidth = 150, Text = Language.StringByID(R.MyInternationalizationString.GwResponseOvertime), Direction = AMPopTipDirection.None, CloseTime = 1 }.Show(Common.CommonPage.Instance); }); } CommonPage.Loading.Hide(); midVerticalScrolViewLayout.EndHeaderRefreshing(); new Tip() { MaxWidth = 150, Text = Language.StringByID(R.MyInternationalizationString.GwResponseOvertime), Direction = AMPopTipDirection.None, CloseTime = 1 }.Show(Common.CommonPage.Instance); }); } targetList.Clear(); @@ -1003,12 +992,7 @@ btnFinifh.BackgroundColor = Shared.Common.ZigbeeColor.Current.XMBlack; this.RemoveFromParent(); }); var mainKey = delDevice.DeviceAddr + delDevice.Epoint; var dev1 = curControlDev.bindList.Find(obj => (obj != null) && (obj.BindMacAddr + obj.BindEpoint == mainKey)); if (dev1 != null) { curControlDev.bindList.Remove(dev1); } } else { @@ -1121,12 +1105,6 @@ return; } } var mainKey = delDevice.DeviceAddr + delDevice.Epoint; var dev2 = curControlDev.bindList.Find(obj => (obj != null) && (obj.BindMacAddr + obj.BindEpoint == mainKey)); if (dev2 != null) { curControlDev.bindList.Remove(dev2); } } } else @@ -1163,12 +1141,6 @@ return; } } var mainKey = delDevice.DeviceAddr + delDevice.Epoint; var dev3 = curControlDev.bindList.Find(obj => (obj != null) && (obj.BindMacAddr + obj.BindEpoint == mainKey)); if (dev3 != null) { curControlDev.bindList.Remove(dev3); } } } @@ -1199,9 +1171,7 @@ addBindInfo.BindType = 0; addBindInfo.BindMacAddr = de.DeviceAddr; addBindInfo.BindEpoint = de.DeviceEpoint; addBindeDev.BindList.Add(addBindInfo); addBindeDev.BindName = de.DeviceEpointName; switch (curDeviceBindType) { case 2: @@ -1217,6 +1187,7 @@ } break; } addBindeDev.BindList.Add(addBindInfo); } var dev = new AddedDeviceBindResponseAllData(); @@ -1272,13 +1243,6 @@ btnFinifh.BackgroundColor = Shared.Common.ZigbeeColor.Current.XMBlack; this.RemoveFromParent(); }); var mainKey = addBindeDev.DeviceAddr + addBindeDev.Epoint; var dev4 = curControlDev.bindList.Find(obj => (obj != null) && (obj.BindMacAddr + obj.BindEpoint == mainKey)); if (dev4 != null) { curControlDev.bindList.Add(dev4); } } else if (dev.addedDeviceBindResponseData.Result == 1) {