gxc
2019-12-25 944b87b6bcccb095cd73f13f4410fb20faf48f74
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设备属性上报, (Action<ZigBee.Device.CommonDevice>)((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>
@@ -453,24 +474,25 @@
                Height = Application.GetRealHeight(450),
                Width = Application.GetRealWidth(selectRow_Width),
                Gravity = Gravity.CenterHorizontal,
                Radius = (uint)Application.GetRealHeight(17),
                Radius = (uint)Application.GetRealHeight(35),
                BackgroundColor = ZigbeeColor.Current.GXCTextWhiteColor
            };
            selectFL.AddChidren(itemFL);
            itemFL.Animate = Animate.DownToUp;
            //itemFL.Animate = Animate.DownToUp;
            var selectLocalPicture = new Button()
            {
                Height = Application.GetRealHeight(selectRow_Height) - 1,
                TextID = R.MyInternationalizationString.LocalPicture,
                TextColor = ZigbeeColor.Current.GXCTextSelectedColor4
                TextColor = ZigbeeColor.Current.GXCTextSelectedColor4,
                TextSize = 17
            };
            itemFL.AddChidren(selectLocalPicture);
            var selectLocalLine = new Button()
            {
                Y = selectLocalPicture.Bottom,
                Height = 1,
                BackgroundColor = ZigbeeColor.Current.GXCLineColor
                BackgroundColor = ZigbeeColor.Current.GXCGrayLineColor2
            };
            itemFL.AddChidren(selectLocalLine);
@@ -479,14 +501,15 @@
                Y = selectLocalLine.Bottom,
                Height = Application.GetRealHeight(selectRow_Height) - 1,
                TextID = R.MyInternationalizationString.Photograph,
                TextColor = ZigbeeColor.Current.GXCTextSelectedColor4
                TextColor = ZigbeeColor.Current.GXCTextSelectedColor4,
                TextSize = 17
            };
            itemFL.AddChidren(selectPhotographBtn);
            var selectPhotographLine = new Button()
            {
                Y = selectPhotographBtn.Bottom,
                Height = 1,
                BackgroundColor = ZigbeeColor.Current.GXCLineColor,
                BackgroundColor = ZigbeeColor.Current.GXCGrayLineColor2,
            };
            itemFL.AddChidren(selectPhotographLine);
@@ -495,7 +518,8 @@
                Y = selectPhotographLine.Bottom,
                Height = Application.GetRealHeight(selectRow_Height) - 1,
                TextID = R.MyInternationalizationString.MyAblums,
                TextColor = ZigbeeColor.Current.GXCTextSelectedColor4
                TextColor = ZigbeeColor.Current.GXCTextSelectedColor4,
                TextSize = 17
            };
            itemFL.AddChidren(selectAblumsBtn);
@@ -508,7 +532,8 @@
                TextID = R.MyInternationalizationString.Cancel,
                TextColor = ZigbeeColor.Current.GXCTextSelectedColor4,
                BackgroundColor = ZigbeeColor.Current.GXCTextWhiteColor,
                Radius = (uint)Application.GetRealHeight(17)
                Radius = (uint)Application.GetRealHeight(35),
                TextSize = 17
            };
            selectFL.AddChidren(cancelBtn);