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
using System;
using System.Collections.Generic;
using Shared.SimpleControl;
 
namespace Shared
{
    [Serializable]
    public class LongXiModule : AC
    {
        public LongXiModule ()
        {
            Type = DeviceType.LongXiAC;
            DeviceTextID = SimpleControl.R.MyInternationalizationString.AC;
        }
 
        public string[] LongXiDevicePaths = new string[7];
 
        public LongXiAC[] LongXiACs {
            get{
                LongXiAC [] longXiACs = new LongXiAC [7];
                LongXiAC lxAC1 = Newtonsoft.Json.JsonConvert.DeserializeObject<LongXiAC> (CommonPage.MyEncodingUTF8.GetString (IO.FileUtils.ReadFile (LongXiDevicePaths [0])));
                if (lxAC1 == null) {
                    lxAC1 = new LongXiAC (){
                        LongXiDeviceType = 1
                    };
                }
                LongXiAC lxAC2 = Newtonsoft.Json.JsonConvert.DeserializeObject<LongXiAC> (CommonPage.MyEncodingUTF8.GetString (IO.FileUtils.ReadFile (LongXiDevicePaths [1])));
                if (lxAC2 == null) {
                    lxAC2 = new LongXiAC (){
                        LongXiDeviceType = 2
                    };
                }
                LongXiAC lxAC3 = Newtonsoft.Json.JsonConvert.DeserializeObject<LongXiAC> (CommonPage.MyEncodingUTF8.GetString (IO.FileUtils.ReadFile (LongXiDevicePaths [2])));
                if (lxAC3 == null) {
                    lxAC3 = new LongXiAC (){
                        LongXiDeviceType = 3
                    };
                }
                LongXiAC lxAC4 = Newtonsoft.Json.JsonConvert.DeserializeObject<LongXiAC> (CommonPage.MyEncodingUTF8.GetString (IO.FileUtils.ReadFile (LongXiDevicePaths [3])));
                if (lxAC4 == null) {
                    lxAC4 = new LongXiAC (){
                        LongXiDeviceType = 4
                    };
                }
                LongXiAC lxAC5 = Newtonsoft.Json.JsonConvert.DeserializeObject<LongXiAC> (CommonPage.MyEncodingUTF8.GetString (IO.FileUtils.ReadFile (LongXiDevicePaths [4])));
                if (lxAC4 == null) {
                    lxAC4 = new LongXiAC () {
                        LongXiDeviceType = 5
                    };
                }
                LongXiAC lxAC6 = Newtonsoft.Json.JsonConvert.DeserializeObject<LongXiAC> (CommonPage.MyEncodingUTF8.GetString (IO.FileUtils.ReadFile (LongXiDevicePaths [5])));
                if (lxAC4 == null) {
                    lxAC4 = new LongXiAC () {
                        LongXiDeviceType = 6
                    };
                }
                LongXiAC lxAC7 = Newtonsoft.Json.JsonConvert.DeserializeObject<LongXiAC> (CommonPage.MyEncodingUTF8.GetString (IO.FileUtils.ReadFile (LongXiDevicePaths [6])));
                if (lxAC4 == null) {
                    lxAC4 = new LongXiAC () {
                        LongXiDeviceType = 7
                    };
                }
                longXiACs [0] = lxAC1;
                longXiACs [1] = lxAC2;
                longXiACs [2] = lxAC3;
                longXiACs [3] = lxAC4;
                longXiACs [4] = lxAC5;
                longXiACs [5] = lxAC6;
                longXiACs [6] = lxAC7;
                return longXiACs;
            }
        }
    }
 
    [Serializable]
    public class LongXiAC : AC
    {
 
        public LongXiAC(){
            Type = DeviceType.LongXiAC;
            DeviceTextID = SimpleControl.R.MyInternationalizationString.AC;
        }
 
        /// <summary>
        /// 1 : 新风空调
        /// 2-7 : 二次过滤
        /// </summary>
        public int LongXiDeviceType = 0;
 
        //[0]=AIR_STRUCT [air_NO].HDL_AIR_NO ;   //空调号
        //[1]=TEMP_MODE;//0
        //[2]=AIR_STRUCT [air_NO].ROOM_TEMP;     //室内温度
        //[3]=AIR_STRUCT [air_NO].SET_COOL_T;
        //[4]=AIR_STRUCT [air_NO].SET_HOT_T;
        //[5]=AIR_STRUCT [air_NO].SET_AUTO_T;
        //[6]=AIR_STRUCT [air_NO].SET_DRY_T;
        //[7]=AIR_STRUCT [air_NO].fact_MODE_FAN;
        //[8]=AIR_STRUCT [air_NO].POWER>>7;      //新风开关
        //[9]=AIR_STRUCT [air_NO].SET_MODE;      //新风模式
        //[10]=AIR_STRUCT [air_NO].SET_FAN;      //新风风速 
        //[11]=0;
        /// <summary>
        /// [12]=AIR_STRUCT [air_NO].wave;         
        /// 自动开1  手动关 0
        /// The wave.
        /// </summary>
        public byte Wave =0;
        //[13]=0XAB;
        //[14]=0xCD;           
 
        /// <summary>
        /// [15] =AIR_STRUCT [air_NO].HEAT_LEVEL;  
        /// 电加热状态 1开 0关  
        /// </summary>
        public byte ElectricHeating =0;
 
        //[16] =AIR_STRUCT [air_NO].FANG_DONG;   //防冻开关 1开 0关
        public byte Antifreeze = 0;
        //[17] =AIR_STRUCT [air_NO].OUTDOOR_TEMP;//室外温度
        public byte OutTemp;
 
        /// <summary>
        /// [18] =AIR_STRUCT [air_NO].SHI_DU;      
        /// 湿度
        /// </summary>
        public byte Humidity;
        /// <summary>
        /// [19] =AIR_STRUCT [air_NO].VOC_H;       
        /// [20] =AIR_STRUCT [air_NO].VOC_L;    
        /// The tvoc.
        /// </summary>
        public int TVOC;
        /// <summary>
        /// [21]=AIR_STRUCT [air_NO].PM25_H;     
        /// [22]=AIR_STRUCT [air_NO].PM25_L;  
        /// The PM 25.
        /// </summary>
        public int PM25;
 
        public string modeText {
            get{//0 制冷1制热,2通风,3自动,4除湿
                if(SetMode == 0){
                    return "制冷";
                }else{
                    return "自动";
                }
            }
        }
 
        public string windText {
            get{// 0 自动,1高风2中风,3低风     
                if(SetFanSpeed == 3)
                {
                    return "低风";
                }else if(SetFanSpeed == 2){
                    return "中风";
                }else  {
                    return "高风";
                }
            }
        }
    }
}