public static Color GetAlarmColor(EnmAlarm level) { switch (level) { case EnmAlarm.Level1: return(Color.Red); case EnmAlarm.Level2: return(Color.Orange); case EnmAlarm.Level3: return(Color.Yellow); case EnmAlarm.Level4: return(Color.SkyBlue); default: return(Color.White); } }
public static EnmState LevelToState(EnmAlarm level) { switch (level) { case EnmAlarm.Level0: return(EnmState.Normal); case EnmAlarm.Level1: return(EnmState.Level1); case EnmAlarm.Level2: return(EnmState.Level2); case EnmAlarm.Level3: return(EnmState.Level3); case EnmAlarm.Level4: return(EnmState.Level4); default: return(EnmState.Invalid); } }
public static string GetAlarmDisplay(EnmAlarm level) { switch (level) { case EnmAlarm.Level0: return("正常"); case EnmAlarm.Level1: return("一级告警"); case EnmAlarm.Level2: return("二级告警"); case EnmAlarm.Level3: return("三级告警"); case EnmAlarm.Level4: return("四级告警"); default: return("未定义"); } }