JLChen
2020-06-04 6d55af8792cf8fbef0055e677b900fc352dba9a2
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
using System;
namespace Shared.SimpleControl
{
    public class FreshAirBLL
    {
        public FreshAirBLL ()
        {
        }
 
        public string GetWindIcon(byte iconCode)
        {
            string iconPath = "";
            // 风速(0 关,1低,2中,3高)
 
            switch (iconCode){
            case 0:
                iconPath = "AC/ACAuto.png";
                break;
            case 1:
                iconPath = "AC/ACLowWind.png";
                break;
            case 2:
                iconPath = "AC/ACStroke.png";
                break;
            case 3:
                iconPath = "AC/ACHighWind.png";
                break;
            }
 
            return iconPath;
        }
        public int GetWindTextID(byte iconCode)
        {
            int textID = 1000000;
            // 风速(0 关,1低,2中,3高)
 
            switch (iconCode){
            case 0:
                    textID = R.MyInternationalizationString.Auto;
                break;
            case 1:
                    textID = R.MyInternationalizationString.Low;
                break;
            case 2:
                    textID = R.MyInternationalizationString.Stroke;
                break;
            case 3:
                    textID = R.MyInternationalizationString.High;
                break;
            }
            return textID;
        }
        public int GetModeTextID (byte iconCode)
        {
            int textID = 1000000;
            // + 模式(0--(智能模式/模式0), 1--(新风模式/模式1)  2--(内循环模式/模式2),  3--(恒温模式/模式3))
 
            switch (iconCode) {
            case 0:
                textID = R.MyInternationalizationString.Smart;
                break;
            case 1:
                textID = R.MyInternationalizationString.Manual;
                break;
            case 2:
                textID = R.MyInternationalizationString.InternalCirculation;
                break;
            case 3:
                textID = R.MyInternationalizationString.ConstantTemp;
                break;
            }
            return textID;
        }
        public string GetModeIcon (byte iconCode)
        {
            string iconPath = "";
            // + 模式(0--(智能模式/模式0), 1--(新风模式/模式1)  2--(内循环模式/模式2),  3--(恒温模式/模式3))
 
            switch (iconCode) {
            case 0:
                iconPath = "FreshAir/FASmart.png";
                break;
            case 1:
                iconPath = "FreshAir/FAManual.png";
                break;
            case 2:
                iconPath = "FreshAir/FAInternalCirculation.png";
                break;
            case 3:
                iconPath = "FreshAir/FAConstantTemp.png";
                break;
            }
            return iconPath;
        }
 
        /// <summary>
        /// 新风协议控制
        /// </summary>
        public void ControlFreshAir(FreshAir freshAir)
        {
            //新风协议控制
            //附加数据:  新风通道号(1 - 200) + 开关(0,1) + 风速(0 关,1低,2中,3高) + 模式(0手动,1 自动,2 智能,3 定时)
            //FreshAirControl = 0x144A,
            Control.ControlBytesSend (Command.FreshAirControl, freshAir.SubnetID, freshAir.DeviceID, new byte [] { freshAir.LoopID,freshAir.SwitchStatus,freshAir.WindSpeed,freshAir.SetPattern});
        }
    
    
    }
}