HDL Home App 第二版本 旧平台金堂用 正在使用
黄学彪
2019-12-30 3dcbd186c42c598c0c08d1cd37034cf2baa09e54
ZigbeeApp/Shared/Phone/UserCenter/Residence/EditorRoomInforForm.cs
@@ -312,7 +312,7 @@
            btnTemper.Text = Language.StringByID(R.MyInternationalizationString.uGetting);
            HdlGatewayReceiveLogic.Current.RemoveEvent("TemperatrueDevice");
            HdlGatewayReceiveLogic.Current.AddAttributeEvent("TemperatrueDevice", ReceiveComandDiv.A设备属性上报, (Action<ZigBee.Device.CommonDevice>)((report) =>
            HdlGatewayReceiveLogic.Current.AddAttributeEvent("TemperatrueDevice", ReceiveComandDiv.A设备属性上报, ((report) =>
            {
                string mainKeys = Common.LocalDevice.Current.GetDeviceMainKeys(report);
                if (cloneRoom.TemperatrueDevice != mainKeys || btnTemper == null)
@@ -326,26 +326,29 @@
                {
                    if (data.AttributeId == (int)ZigBee.Device.AttriButeId.MeasuredValue)
                    {
                        if (data.AttriButeData == 0)
                        HdlThreadLogic.Current.RunMain(() =>
                        {
                            //0℃
                            btnTemper.Text = "0.0℃";
                        }
                        else if (data.AttriButeData > 32767)
                        {
                            //负数(特殊处理)
                            string strValue = (data.AttriButeData - 65536).ToString();
                            //小数点需要一位
                            strValue = strValue.Substring(0, strValue.Length - 1);
                            btnTemper.Text = strValue.Insert(strValue.Length - 1, ".") + "℃";
                        }
                        else
                        {
                            //小数点需要一位
                            string strValue = data.AttriButeData.ToString();
                            strValue = strValue.Substring(0, strValue.Length - 1);
                            btnTemper.Text = strValue.Insert(strValue.Length - 1, ".") + "℃";
                        }
                            if (data.AttriButeData == 0)
                            {
                                //0℃
                                btnTemper.Text = "0.0℃";
                            }
                            else if (data.AttriButeData > 32767)
                            {
                                //负数(特殊处理)
                                string strValue = (data.AttriButeData - 65536).ToString();
                                //小数点需要一位
                                strValue = strValue.Substring(0, strValue.Length - 1);
                                btnTemper.Text = strValue.Insert(strValue.Length - 1, ".") + "℃";
                            }
                            else
                            {
                                //小数点需要一位
                                string strValue = data.AttriButeData.ToString();
                                strValue = strValue.Substring(0, strValue.Length - 1);
                                btnTemper.Text = strValue.Insert(strValue.Length - 1, ".") + "℃";
                            }
                        });
                    }
                }
            }));
@@ -418,18 +421,21 @@
                {
                    if (data.AttributeId == (int)ZigBee.Device.AttriButeId.MeasuredValue)
                    {
                        if (data.AttriButeData == 0)
                        HdlThreadLogic.Current.RunMain(() =>
                        {
                            //0
                            btnHumi.Text = "0.0%";
                        }
                        else
                        {
                            //小数点需要一位(湿度没有负数)
                            string strValue = data.AttriButeData.ToString();
                            strValue = strValue.Substring(0, strValue.Length - 1);
                            btnHumi.Text = strValue.Insert(strValue.Length - 1, ".") + "%";
                        }
                            if (data.AttriButeData == 0)
                            {
                                //0
                                btnHumi.Text = "0.0%";
                            }
                            else
                            {
                                //小数点需要一位(湿度没有负数)
                                string strValue = data.AttriButeData.ToString();
                                strValue = strValue.Substring(0, strValue.Length - 1);
                                btnHumi.Text = strValue.Insert(strValue.Length - 1, ".") + "%";
                            }
                        });
                    }
                }
            });