public int ReportAlarm(string alarmCode) { AlarmObject alarmObject = new AlarmObject(alarmCode); if (AlarmListPanelControl.getSingleton().GetAlarmInfo(ref alarmObject) == true) { } else { alarmObject.Message = "This alarm is not being defined!"; alarmObject.Reset = true; } reportAlarmList.Add(alarmObject); Log(alarmObject, AlarmLogType.Occur); if (alarmReportDataGridView.Rows.Count > 0) { alarmReportDataGridView.Rows[0].Selected = true; } InsertAlarmToAlarmReportTable(alarmObject); alarmTabControlEX.SelectedTab = currentAlarmTabPageEX; return(0); }
public static AlarmListPanelControl getSingleton() { if (singleton == null) { singleton = new AlarmListPanelControl(); } return(singleton); }
private void AlarmLogSpilt(ref List <AlarmObject> AlarmLogList, string szInfo, DateTime startTime, DateTime endTime, string szCode) { string[] szAllInfo = szInfo.Split(' '); bool bCreatNewAlarmObject = true; if (startTime.Ticks > 1 && endTime.Ticks > 1) { DateTime logTime = DateTime.Parse(szAllInfo[0] + " " + szAllInfo[1]); if (logTime.Ticks < startTime.Ticks || logTime.Ticks > endTime.Ticks) { return; } } if (szCode != "" && szAllInfo[3] != szCode) { return; } foreach (AlarmObject tmpAlarm in AlarmLogList) { if (tmpAlarm.Identifier == long.Parse(szAllInfo[2]) && tmpAlarm.AlarmCode == szAllInfo[3]) { if (szAllInfo[4] == "Released") { tmpAlarm.ReleaseTime = szAllInfo[0] + " " + szAllInfo[1]; tmpAlarm.ResetResult = szAllInfo[6]; bCreatNewAlarmObject = false; return; } } } if (bCreatNewAlarmObject) { AlarmObject tmpAlarm = new AlarmObject(szAllInfo[3]); if (AlarmListPanelControl.getSingleton().GetAlarmInfo(ref tmpAlarm) == true) { } else { tmpAlarm.Message = "This alarm is not being defined!"; tmpAlarm.Reset = true; } tmpAlarm.Identifier = long.Parse(szAllInfo[2]); tmpAlarm.ReportTime = szAllInfo[0] + " " + szAllInfo[1]; tmpAlarm.ReleaseTime = ""; AlarmLogList.Add(tmpAlarm); } }
public static AlarmListPanelControl getSingleton() { if (singleton == null) singleton = new AlarmListPanelControl(); return singleton; }