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
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
using System;
namespace Shared
{
    /// <summary>
    /// DALI模块
    /// </summary>
    [System.Serializable]
    public class LightDALI : LightDimming
    {
        public LightDALI ()
        {
            this.Type = DeviceType.LightDALI;
            DeviceTextID = 3; //SimpleControl.R.MyInternationalizationString.Lights;
        }
        /// <summary>
        /// DALI是否连接了灯光
        /// </summary>
        public byte LinkLightStatus;
 
        public bool DALIModule = true;
 
        /// <summary>
        /// 回路在线(0x00不在,oxff在线)
        /// </summary>
        public byte Online;
 
        /// <summary>
        /// 回路类型(全部有亮度,另8有色温)
        /// </summary>
        public byte LoopType = 8;
 
        //色温物理最暖H + 最暖L,色温物理最冷H + 最冷L,                       4byte
 
        /// <summary>
        /// 物理暖色高位
        /// </summary>
        public byte WarmTones_High_Modular;
        /// <summary>
        /// 物理暖色低位
        /// </summary>
        public byte WarmTones_Low_Modular;
        /// <summary>
        /// 物理冷色高位
        /// </summary>
        public byte CoolTones_High_Modular;
        /// <summary>
        /// 物理冷色低位
        /// </summary>
        public byte CoolTones_Low_Modular;
        /// <summary>
        /// 物理暖色值
        /// </summary>
        public int WarmTones_Modular {
            get { return WarmTones_High_Modular * 256 + WarmTones_Low_Modular; }
        }
        /// <summary>
        /// 物理冷色值
        /// </summary>
        public int CoolTones_Modular {
            get { return CoolTones_High_Modular * 256 + CoolTones_Low_Modular; }
        }
 
        //色温最暖H + 最暖L,色温最冷H + 最冷L,                               4byte
 
        /// <summary>
        /// 逻辑暖色高位
        /// </summary>
        public byte WarmTones_High;
        /// <summary>
        /// 逻辑暖色低位
        /// </summary>
        public byte WarmTones_Low;
        /// <summary>
        /// 逻辑冷色高位
        /// </summary>
        public byte CoolTones_High;
        /// <summary>
        /// 逻辑冷色低位
        /// </summary>
        public byte CoolTones_Low;
        /// <summary>
        /// 逻辑暖色值
        /// </summary>
        public int WarmTones {
            get { return WarmTones_High * 256 + WarmTones_Low; }
        }
        /// <summary>
        /// 逻辑冷色值
        /// </summary>
        public int CoolTones {
            get { return CoolTones_High * 256 + CoolTones_Low; }
        }
        //当前色温H + L,                                                      2byte
        /// <summary>
        /// 当前色温高位
        /// </summary>
        public byte CurTones_High;
        /// <summary>
        /// 当前色温低位
        /// </summary>
        public byte CurTones_Low;
        /// <summary>
        /// 当前色温值
        /// </summary>
        public int CurTone {
            get { return CurTones_High * 256 + CurTones_Low ; }
        }
        /// <summary>
        /// 逻辑色温值域
        /// </summary>
        /// <value>The tones range.</value>
        public int TonesRange {
            get { return System.Math.Abs (CoolTones - WarmTones); }
        }
        /// <summary>
        /// 物理色温值域
        /// </summary>
        /// <value>The tones range modular.</value>
        public int TonesRange_Modular {
            get { return System.Math.Abs (CoolTones_Modular - WarmTones_Modular); }
        }
        /// <summary>
        /// 返回色温功能是否正常,当色温值域大于0时,才能正常使用色温功能
        /// </summary>
        public bool TonesFunction {
            get { return TonesRange > 0; }
        }
    }
}