JLChen
2020-05-28 04bd96cbf5d12a4e4b116d2b05fd0d05ea81ee23
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
using System;
using System.Collections.Generic;
 
namespace Shared
{
    /// <summary>
    /// 美林空调系统
    /// ACMerrill = 0x0706,
    /// </summary>
    [System.Serializable]
    public class ACMerrill : Common
    {
        public ACMerrill ()
        {
            Type = DeviceType.ACMerrill;
            DeviceTextID = 553;
        }
 
        /// <summary>
        /// 开关
        /// </summary>
        public byte Power;
 
        /// <summary>
        /// 0:回家模式 1:离家模式
        /// </summary>
        public byte ScenesMode;
 
        /// <summary>
        /// 0制热、1制冷、2通风
        /// </summary>
        public byte WorkMode;
 
        /// <summary>
        /// 日功耗
        /// </summary>
        public float DailyPowerConsumption;
 
        /// <summary>
        /// 月功耗
        /// </summary>
        public float MonthlyPowerConsumption;
 
        /// <summary>
        /// 当前功率
        /// </summary>
        public float CurrentPower;
 
        /// <summary>
        /// 系统下空调回路总算
        /// </summary>
        public List<ACMerrillLoop> mACMerrillLoopList = new List<ACMerrillLoop> ();
 
    }
 
 
    /// <summary>
    /// 各回路空调状态
    /// </summary>
    [System.Serializable]
    public class ACMerrillLoop
    {
        //public ACMerrillLoop ()
        //{
        //}
 
        /// <summary>
        /// 备注
        /// </summary>
        public string Name;
 
        /// <summary>
        /// 子网号
        /// </summary>
        public byte SubnetID;
 
        /// <summary>
        /// 设备号
        /// </summary>
        public byte DeviceID;
 
        /// <summary>
        /// 回路号
        /// </summary>
        public byte LoopID;
 
 
        [Newtonsoft.Json.JsonIgnore]
        public virtual string CommonLoopID {
            get {
                return SubnetID.ToString () + "_" + DeviceID.ToString () + "_" + LoopID.ToString ();
            }
        }
 
        public static readonly int Time = 1;
        /// <summary>
        /// 最近更新的时间
        /// </summary>
        public DateTime LastUpdateTime = System.DateTime.Now.AddMinutes (-Time);
 
        /// <summary>
        /// 温度模式
        /// </summary>
        public byte TemperatureMode = 0;
 
        /// <summary>
        /// 开关 0关 ,1开
        /// </summary>
        public byte Power;
        /// <summary>
        /// 室内温度
        /// </summary>
        public byte IndoorTemperature;
        /// <summary>
        /// 室内湿度
        /// </summary>
        public byte IndoorHumidity;
        /// <summary>
        /// 设置模式 :0制冷、1制热、2通风
        /// </summary>
        public byte SetMode = 0;
        /// <summary>
        /// 设置风速
        /// </summary>
        public byte SetFanSpeed;
        /// <summary>
        /// 设置温度 5到35
        /// </summary>
        public byte SetTemperature = 26;
 
        /// <summary>
        /// 实际工作模式及风速
        /// </summary>
        public byte RealModeAndFanSpeed;
 
        public byte [] GetACSendBytes () {
            byte [] sendBytes = new byte [13];
            sendBytes [0] = this.LoopID;
            sendBytes [1] = 0;
            sendBytes [2] = this.IndoorTemperature;
            sendBytes [3] = this.SetTemperature;
            sendBytes [4] = this.SetTemperature;
            sendBytes [5] = this.SetTemperature;
            sendBytes [6] = this.SetTemperature;
            sendBytes [7] = this.RealModeAndFanSpeed;
            sendBytes [8] = this.Power;
            sendBytes [9] = this.SetMode;
            sendBytes [10] = this.SetFanSpeed;
            sendBytes [11] = this.SetTemperature;
            sendBytes [12] = this.IndoorHumidity;//扫风状态位改为:室内湿度
 
            return sendBytes;
        }
       
    }
 
    ///// <summary>
    ///// 各回路空调状态
    ///// </summary>
    //[System.Serializable]
    //public class ACMerrillLoop : AC
    //{
    //    public ACMerrillLoop ()
    //    {
    //        Type = DeviceType.ACMerrill;
    //        DeviceTextID = 42; //SimpleControl.R.MyInternationalizationString.AC;
    //        SetTemperature = 26;
    //    }
 
    //    /// <summary>
    //    /// 室内湿度
    //    /// </summary>
    //    public byte IndoorHumidity;
 
 
 
    //}
 
 
}