1
wxr
2023-03-31 7e42cc13a14b7de31c9f5d5c61cdf24f3246335d
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
using System;
using Shared.SimpleControl;
 
namespace Shared
{
    /// <summary>
    /// 空调
    /// </summary>
    [System.Serializable]
    public class FreshAir : Common
    {
        public FreshAir ()
        {
            Type = DeviceType.FreshAir;
            DeviceTextID = SimpleControl.R.MyInternationalizationString.FreshAir;
        }
        //新风通道号(1 - 200) + 开关(1,0) + 风速(0 关,1低,2中,3高) + 模式(0手动,1 自动,2 智能,3 定时)
 
        /// <summary>
        /// 开关(1,0)
        /// </summary>
        public byte SwitchStatus;
 
        /// <summary>
        /// 风速(0 关,1低,2中,3高)
        /// </summary>
        public byte WindSpeed;
 
        /// <summary>
        /// 模式(0--(智能模式/模式0), 1--(新风模式/模式1)  2--(内循环模式/模式2),  3--(恒温模式/模式3))
        /// </summary>
        public byte SetPattern;
 
        /// <summary>
        /// 模拟量 2个byte
        /// 0启用1不启用
        /// </summary>
        public byte EnableValue1;
        public byte EnableValue2;
 
        /// <summary>
        /// 室内温度
        /// </summary>
        public float InTemp;
 
        /// <summary>
        /// 室外温度
        /// </summary>
        public float OutTemp;
 
        /// <summary>
        /// 室内湿度
        /// </summary>
        public float Humidity;
 
        /// <summary>
        /// PM2.5
        /// </summary>
        public float PM25;
 
        /// <summary>
        /// The tvoc.
        /// </summary>
        public float TVOC;
 
        /// <summary>
        /// The CO2.
        /// </summary>
        public float CO2;
 
 
 
        #region BLL
        public bool EditRemark (string remake)
        {
            bool result = false;
            byte [] remakeBytes = CommonPage.MyEncodingGB2312.GetBytes (remake);
            byte [] resultBytes = Control.ControlBytesSendHasReturn (Command.ReadDeviceLoopInfo, this.SubnetID, this.DeviceID, new byte [] { this.BigClass, this.MinClass, this.LoopID });
            if (resultBytes != null) {
                byte [] uBytes = new byte [20];
                Array.Copy (remakeBytes, 0, uBytes, 0, remakeBytes.Length < 20 ? remakeBytes.Length : 20);
                Array.Copy (uBytes, 0, resultBytes, 3, 20 < uBytes.Length ? 20 : uBytes.Length);
                var reBytes = Control.ControlBytesSendHasReturn (Command.SetDeviceLoopInfo, this.SubnetID, this.DeviceID, resultBytes);
                if (reBytes != null) {
                    IO.FileUtils.SaveEquipmentMessage (this, this.LoopID.ToString ());
                    this.Name = remake;
                    result = true;
                } 
            }
            return result;
        }
        #endregion
    }
}