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