CrabtreeOn,印度客户定制APP,迁移2.0平台版本
陈嘉乐
2021-03-03 91c2194fce3958afed333119c3aeed3c49ef6bcf
Crabtree/SmartHome/HDL/Operation/Device/FoolHeat.cs
@@ -6,20 +6,20 @@
namespace Shared
{
[System.Serializable]
   public class FoolHeat:Common
   {
      public FoolHeat ()
      {
         this.Type = DeviceType.FoolHeat;;
    [System.Serializable]
    public class FoolHeat : Common
    {
        public FoolHeat ()
        {
            this.Type = DeviceType.FoolHeat; ;
            DeviceTextID = SimpleControl.R.MyInternationalizationString.FoolHeat;
      }
        }
      /// <summary>
      /// 工作模式
        /// <summary>
        /// 工作模式
        /// 0制热,1制冷,2,3
      /// </summary>
      public byte WorkingMode = 0;
        /// </summary>
        public byte WorkingMode = 0;
        /// <summary>
        /// 温度模式
        /// </summary>
@@ -31,13 +31,13 @@
        /// </summary>
      public byte TemperatureType;
      public byte NormalTemperature;
        public byte NormalTemperature;
      public byte DayTemperature;
        public byte DayTemperature;
      public byte NightTemperature;
        public byte NightTemperature;
      public byte AwayTemperature;
        public byte AwayTemperature;
        public byte Timer;//0 = Day, 1 = Night
@@ -55,14 +55,14 @@
        /// <summary>
        /// 工作温度
        /// </summary>
        public byte WorkingTemperature =5;
        public byte WorkingTemperature = 5;
        public byte PIDSpeed;
        public byte IndoorTemperature;
        public byte FloorTemperature;
        public byte[] FH_Bytes;
        public byte [] FH_Bytes;
        public FoolHeat Serverx_FH_CMD (CommandType commandType, byte[] updataBytes = null)
        public FoolHeat Serverx_FH_CMD (CommandType commandType, byte [] updataBytes = null)
        {
            if (updataBytes != null)
                FH_Bytes = updataBytes;
@@ -101,7 +101,7 @@
            } else if (commandType == CommandType.TemperatrueMode) {
                FH_Bytes = Control.ControlBytesSendHasReturn (Command.SetFoolHeat, SubnetID, DeviceID, new byte [] { LoopID, FH_Bytes [1], FH_Bytes [2], TemperatureType, FH_Bytes [4], FH_Bytes [5], FH_Bytes [6], FH_Bytes [7], 0, 0 });
                return this;
            }
            }
            this.WorkingMode = FH_Bytes [1] > 10 ? (byte)1 : (byte)0;
            this.Status = (byte)(FH_Bytes [1] % 2);
@@ -144,11 +144,11 @@
            return this;
        }
        public  enum CommandType
        public enum CommandType
        {
            Read = 0,
            Switch = 1,
            Temperatrue =3,
            Temperatrue = 3,
            TemperatrueMode = 7,
            WorkMode = 9,
            Null = 999,
@@ -161,14 +161,37 @@
        /// <returns></returns>
        public string SetModeAttribute {
            get {
                return TemperatureType switch {
                    1 => "normal",
                    2 => "day",
                    3 => "night",
                    4 => "away",
                    5 => "timer",
                    _ => "normal",
                };
                //return TemperatureType switch {
                //    1 => "normal",
                //    2 => "day",
                //    3 => "night",
                //    4 => "away",
                //    5 => "timer",
                //    _ => "normal",
                //};
                string mode;
                switch (TemperatureType) {
                case 1:
                    mode = "normal";
                    break;
                case 2:
                    mode = "day";
                    break;
                case 3:
                    mode = "night";
                    break;
                case 4:
                    mode = "away";
                    break;
                case 5:
                    mode = "timer";
                    break;
                default:
                    mode = "normal";
                    break;
                }
                return mode;
            }
        }