using System; namespace MECF.Framework.Common.Device.Bases { /// /// 预设的信号灯塔元件动作。 /// public class SignalTowerPartAction : IComparable { /// /// 信号灯塔元件动作构造函数。 /// /// 信号灯类型。 /// 信号灯输出状态。 /// 闪烁模式。如果传入空值,则自动调用 /// 以创建默认闪烁模式。 public SignalTowerPartAction(LightType light, TowerLightStatus status, STBlinkPattern blinkPattern = null) { Light = light; Status = status; if(blinkPattern != null) BlinkPattern = blinkPattern; else BlinkPattern = STBlinkPattern.GetFastBlinkPattern(); } /// /// 返回信号灯实例。 /// public LightType Light { get; } /// /// 设置或返回信号灯的输出状态。 /// 支持的状态请参考枚举。 /// public TowerLightStatus Status { get; set; } /// /// 设置或返回信号灯闪烁模式。 /// public STBlinkPattern BlinkPattern { get; set; } #region Methods public bool DoAction(out string reason) { throw new NotImplementedException(); } /// public int CompareTo(object obj) { if (obj is not SignalTowerPartAction target) return -1; return (BlinkPattern == target.BlinkPattern && Status == target.Status && Light == target.Light) ? 0 : -1; } #endregion } }