public string GetAlarmTypeString(EAlarmType AlarmType) { switch (AlarmType) { case EAlarmType.Server: return("系统事件"); case EAlarmType.SOE: return("SOE事件"); case EAlarmType.StateChange: return("开关变位"); case EAlarmType.OverLimit: return("数值越限"); case EAlarmType.StationState: return("通信状态"); case EAlarmType.VarError: return("变量错误"); case EAlarmType.ManualAct: return("人工操作"); default: return("未定义"); } }
public bool bConfirm; //是否需要确认 , public CAlarmMsgEventArgs() { Date_Time = DateTime.Now; StaName = ""; Recorder = ""; Remark = ""; ConfirmTime = null; ConfirmName = ""; priority = EAlarmPriority.PRIORITY_2; eAlarmType = EAlarmType.NONE; bConfirm = true; }
private void cAlarmMsgAddMsg(string text, EAlarmType AlarmType, EAlarmPriority priority) { //string sShow = "[" + staAlarm.GetAlarmTypeString(AlarmType) + "]" + text + ";等级:" + staAlarm.GetPriorityString(priority); //MessageBox.Show(sShow); CAlarmMsgEventArgs e = new CAlarmMsgEventArgs(); e.Date_Time = DateTime.Now; e.Recorder = text; e.priority = priority; e.eAlarmType = AlarmType; e.StaName = staName; staAlarm.OnAlarmEvent(e); }
public string Translate(EAlarmType type) { switch (type) { case EAlarmType.FuelLow: return("FUEL LOW"); case EAlarmType.PowerLow: return("POWER LOW"); case EAlarmType.RadiationHigh: return("RAD HIGH"); case EAlarmType.TemperatureHigh: return("TEMP HIGH"); default: return(string.Empty); } }
public void AddMsg(string StaName, string Recorder, EAlarmType eAlarmType, EAlarmPriority priority) { SAlarmMsg newMsg = new SAlarmMsg(); newMsg.StaName = StaName; newMsg.Recorder = Recorder; newMsg.priority = priority; newMsg.eAlarmType = eAlarmType; ListAlarmMsg.Add(newMsg); bUpdate = true; switch (priority) { case EAlarmPriority.PRIORITY_1: ListAlarmMsg1.Add(newMsg); while (ListAlarmMsg1.Count > CCONST.ListMax) { ListAlarmMsg1.RemoveAt(0); } OnBoiled(newMsg); break; case EAlarmPriority.PRIORITY_2: ListAlarmMsg2.Add(newMsg); while (ListAlarmMsg2.Count > CCONST.ListMax) { ListAlarmMsg2.RemoveAt(0); } OnBoiled(newMsg); break; case EAlarmPriority.PRIORITY_3: ListAlarmMsg3.Add(newMsg); while (ListAlarmMsg3.Count > CCONST.ListMax) { ListAlarmMsg3.RemoveAt(0); } break; } }