Exemplo n.º 1
0
        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);
        }
Exemplo n.º 2
0
 public static AlarmListPanelControl getSingleton()
 {
     if (singleton == null)
     {
         singleton = new AlarmListPanelControl();
     }
     return(singleton);
 }
Exemplo n.º 3
0
        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);
            }
        }
Exemplo n.º 4
0
 public static AlarmListPanelControl getSingleton()
 {
     if (singleton == null)
         singleton = new AlarmListPanelControl();
     return singleton;
 }