HDL Home App 第二版本 旧平台金堂用 正在使用
黄学彪
2019-12-20 23fb45dd846ed8b62304c408c6bbe64265d4ac8b
ZigbeeApp/Shared/Phone/Device/Room/EditRoom.cs
@@ -44,7 +44,7 @@
        /// </summary>
        public int OldIconPathType;
        #endregion
        public EditRoom()
@@ -207,6 +207,7 @@
                        return;
                    }
                    room.TemperatrueDevice = $"{selectTemp.DeviceAddr}{selectTemp.DeviceEpoint}";
                    temperatureRow.SetTitle(R.MyInternationalizationString.Getting);
                    HdlGatewayReceiveLogic.Current.RemoveEvent("TemperatrueDevice");
                    HdlGatewayReceiveLogic.Current.AddAttributeEvent("TemperatrueDevice",  ReceiveComandDiv.A设备属性上报, ((report) =>
@@ -227,6 +228,7 @@
                                {
                                    //0℃
                                    temperatureRow.NameText.Text = "0.0℃";
                                    room.Temperatrue = 0;
                                }
                                else if (data.AttriButeData > 32767)
                                {
@@ -235,6 +237,7 @@
                                    //小数点需要一位
                                    strValue = strValue.Substring(0, strValue.Length - 1);
                                    temperatureRow.NameText.Text = strValue.Insert(strValue.Length - 1, ".") + "℃";
                                    room.Temperatrue = int.Parse(strValue) * 0.1;
                                }
                                else
                                {
@@ -242,6 +245,7 @@
                                    string strValue = data.AttriButeData.ToString();
                                    strValue = strValue.Substring(0, strValue.Length - 1);
                                    temperatureRow.NameText.Text = strValue.Insert(strValue.Length - 1, ".") + "℃";
                                    room.Temperatrue = int.Parse(strValue) *0.1;
                                }
                            }
                        }
@@ -252,6 +256,7 @@
            };
            if (string.IsNullOrEmpty(room.TemperatrueDevice) == false)
            {
                temperatureRow.SetTitle(R.MyInternationalizationString.Getting);
                HdlGatewayReceiveLogic.Current.RemoveEvent("TemperatrueDevice");
                HdlGatewayReceiveLogic.Current.AddAttributeEvent("TemperatrueDevice",  ReceiveComandDiv.A设备属性上报, (Action<ZigBee.Device.CommonDevice>)((report) =>
                {
@@ -271,6 +276,7 @@
                            {
                                //0℃
                                temperatureRow.NameText.Text = "0.0℃";
                                room.Temperatrue = 0;
                            }
                            else if (data.AttriButeData > 32767)
                            {
@@ -279,6 +285,7 @@
                                //小数点需要一位
                                strValue = strValue.Substring(0, strValue.Length - 1);
                                temperatureRow.NameText.Text = strValue.Insert(strValue.Length - 1, ".") + "℃";
                                room.Temperatrue = int.Parse(strValue) * 0.1;
                            }
                            else
                            {
@@ -286,6 +293,7 @@
                                string strValue = data.AttriButeData.ToString();
                                strValue = strValue.Substring(0, strValue.Length - 1);
                                temperatureRow.NameText.Text = strValue.Insert(strValue.Length - 1, ".") + "℃";
                                room.Temperatrue = int.Parse(strValue) * 0.1;
                            }
                        }
                    }
@@ -296,6 +304,10 @@
                {
                    (dev as ZigBee.Device.TemperatureSensor).ReadTemperatureOrHumidity();
                }
            }
            else
            {
                temperatureRow.SetTitle(R.MyInternationalizationString.No);
            }
@@ -318,6 +330,7 @@
                        return;
                    }
                    room.HumidityDevice = $"{selectTemp.DeviceAddr}{selectTemp.DeviceEpoint}";
                    humidityRow.SetTitle(R.MyInternationalizationString.Getting);
                    HdlGatewayReceiveLogic.Current.RemoveEvent("HumidityDevice");
                    HdlGatewayReceiveLogic.Current.AddAttributeEvent("HumidityDevice",  ReceiveComandDiv.A设备属性上报, (report) =>
@@ -337,6 +350,7 @@
                                {
                                    //0
                                    humidityRow.NameText.Text = "0.0%";
                                    room.Humidity = 0;
                                }
                                else
                                {
@@ -344,6 +358,7 @@
                                    string strValue = data.AttriButeData.ToString();
                                    strValue = strValue.Substring(0, strValue.Length - 1);
                                    humidityRow.NameText.Text = strValue.Insert(strValue.Length - 1, ".") + "%";
                                    room.Humidity = int.Parse(strValue) * 0.1;
                                }
                            }
                        }
@@ -354,6 +369,7 @@
            };
            if (string.IsNullOrEmpty(room.HumidityDevice) == false)
            {
                humidityRow.SetTitle(R.MyInternationalizationString.Getting);
                HdlGatewayReceiveLogic.Current.RemoveEvent("HumidityDevice");
                HdlGatewayReceiveLogic.Current.AddAttributeEvent("HumidityDevice",  ReceiveComandDiv.A设备属性上报, (report) =>
                {
@@ -372,6 +388,7 @@
                            {
                                //0
                                humidityRow.NameText.Text = "0.0%";
                                room.Humidity = 0;
                            }
                            else
                            {
@@ -379,6 +396,7 @@
                                string strValue = data.AttriButeData.ToString();
                                strValue = strValue.Substring(0, strValue.Length - 1);
                                humidityRow.NameText.Text = strValue.Insert(strValue.Length - 1, ".") + "%";
                                room.Humidity = int.Parse(strValue) * 0.1;
                            }
                        }
                    }
@@ -390,6 +408,10 @@
                    (dev as ZigBee.Device.TemperatureSensor).ReadTemperatureOrHumidity();
                }
            }
            else
            {
                humidityRow.SetTitle(R.MyInternationalizationString.No);
            }
            if (Config.Instance.Home.FloorDics.Count == 0 || room.IsLove)
            {
@@ -397,7 +419,7 @@
                humidityRow.Y= Application.GetRealHeight(446);
            }
            var confirm = new Device.CommonForm.CompleteButton(1700, 700, 127);
            var confirm = new Device.CommonForm.CompleteButton(1700, 900, 127);
            confirm.SetTitle(R.MyInternationalizationString.Confrim);
            AddChidren(confirm);
            confirm.MouseUpEventHandler += (sender, e) =>
@@ -423,7 +445,6 @@
                action?.Invoke();
                RemoveFromParent();
            };
        }
        /// <summary>