HDL Home App 第二版本 旧平台金堂用 正在使用
黄学彪
2021-01-14 d78515ac4ac8cf4a1785d9df18058d6724f12b79
ZigbeeApp/Shared/Phone/ZigBee/Device/TemperatureSensor.cs
@@ -169,20 +169,73 @@
            {
                co2Quality = 0;
            }
            //产品部要求,暂时去掉Co2
            /*if (tempera.currentPmData == 0 && tempera.currentCO2 == 0)
            {
                curQuality = 0;
            }
            else
            {
            if (co2Quality == 1 && pmQuality == 1)
            {
                curQuality = 1;
            }
            else if (co2Quality == 2 || pmQuality == 2)
            {
                curQuality = 2;
            }
            else
                {
                    if (co2Quality > 2 || pmQuality > 2)
            {
                curQuality = 3;
            }
                    else
                    {
                        curQuality = 2;
                    }
                }
            }if (tempera.currentPmData == 0 && tempera.currentCO2 == 0)
            {
                curQuality = 0;
            }
            else
            {
                if (co2Quality == 1 && pmQuality == 1)
                {
                    curQuality = 1;
                }
                else
                {
                    if (co2Quality > 2 || pmQuality > 2)
                    {
                        curQuality = 3;
                    }
                    else
                    {
                        curQuality = 2;
                    }
                }
            }*/
            if (tempera.currentPmData == 0)
            {
                curQuality = 0;
            }
            else
            {
                if (co2Quality == 1)
                {
                    curQuality = 1;
                }
                else
                {
                    if (co2Quality > 2)
                    {
                        curQuality = 3;
                    }
                    else
                    {
                        curQuality = 2;
                    }
                }
            }
            return curQuality;
        }
@@ -227,7 +280,6 @@
                                      result = new ResponseAllData { responseData = tempD };
                                      System.Console.WriteLine($"UI收到通知后的主题_command:0400_{ topic}");
                                  }
                              }
                          }
                      }
@@ -380,48 +432,6 @@
            return result;
        }
        private string HexStringToString(string hs)
        {
            //以%分割字符串,并去掉空字符
            string[] chars = hs.Split(new char[] { '%' }, StringSplitOptions.RemoveEmptyEntries);
            byte[] b = new byte[chars.Length];
            //逐个字符变为16进制字节数据
            for (int i = 0; i < chars.Length; i++)
            {
                b[i] = Convert.ToByte(chars[i], 16);
            }
            //按照指定编码将字节数组变为字符串
            return System.Text.Encoding.UTF8.GetString(b);
        }
        private string StringToHexString1(string s)
        {
            var bytes = new byte[36];
            var reamarkGwBytes = System.Text.Encoding.UTF8.GetBytes(s);
            System.Array.Copy(reamarkGwBytes, 0, bytes, 0, 36 < reamarkGwBytes.Length ? 36 : reamarkGwBytes.Length);
            string result = string.Empty;
            for (int i = 0; i < bytes.Length; i++)//逐字节变为16进制字符,以%隔开
            {
                result += "%" + Convert.ToString(bytes[i], 16);
            }
            return result;
        }
        private string HexStringToString1(string hs)
        {
            //以%分割字符串,并去掉空字符
            string[] chars = hs.Split(new char[] { '%' }, StringSplitOptions.RemoveEmptyEntries);
            byte[] b = new byte[chars.Length];
            //逐个字符变为16进制字节数据
            for (int i = 0; i < chars.Length; i++)
            {
                b[i] = Convert.ToByte(chars[i], 16);
            }
            //按照指定编码将字节数组变为字符串
            return System.Text.Encoding.UTF8.GetString(b);
        }
        ///<summary >
        /// 获取led失能时间
        /// <para>number:序号</para> 
@@ -554,7 +564,7 @@
            /// <summary>
            /// 起始时
            /// </summary>
            public int startHour;
            public int startHour = -1;
            /// <summary>
            /// 起始分
            /// </summary>
@@ -562,7 +572,7 @@
            /// <summary>
            /// 结束时
            /// </summary>
            public int endHour;
            public int endHour = -1;
            /// <summary>
            /// 结束分
            /// </summary>