Exemple #1
0
        public void On_Connection_Error(string DIOName, string ErrorMsg)
        {
            //斷線 發ALARM
            logger.Debug("On_Error_Occurred");
            AlarmInfo CurrentAlarm = new AlarmInfo();

            CurrentAlarm.NodeName  = DIOName;
            CurrentAlarm.AlarmCode = "00200001";
            CurrentAlarm.NeedReset = false;
            try
            {
                AlarmMessage Detail = AlmMapping.Get("DIO", CurrentAlarm.AlarmCode);

                CurrentAlarm.SystemAlarmCode = Detail.CodeID;
                CurrentAlarm.Desc            = Detail.Code_Cause;
                CurrentAlarm.EngDesc         = Detail.Code_Cause_English;
                CurrentAlarm.Type            = Detail.Code_Type;
                CurrentAlarm.IsStop          = Detail.IsStop;
                if (CurrentAlarm.IsStop)
                {
                    //RouteCtrl.Stop();
                }
            }
            catch (Exception e)
            {
                CurrentAlarm.Desc = "未定義";
                logger.Error(DIOName + "(GetAlarmMessage)" + e.Message + "\n" + e.StackTrace);
            }
            CurrentAlarm.TimeStamp = DateTime.Now;
            AlarmManagement.Add(CurrentAlarm);
            AlarmUpdate.UpdateAlarmList(AlarmManagement.GetAll());
            AlarmUpdate.UpdateAlarmHistory(AlarmManagement.GetHistory());
        }
Exemple #2
0
        public void On_Command_TimeOut(Node Node, Transaction Txn)
        {
            logger.Debug("On_Command_TimeOut");
            AlarmInfo CurrentAlarm = new AlarmInfo();

            CurrentAlarm.NodeName  = Node.Name;
            CurrentAlarm.AlarmCode = "00200002";
            CurrentAlarm.NeedReset = false;
            try
            {
                AlarmMessage Detail = AlmMapping.Get("SYSTEM", CurrentAlarm.AlarmCode);

                CurrentAlarm.SystemAlarmCode = Detail.CodeID;
                CurrentAlarm.Desc            = Detail.Code_Cause;
                CurrentAlarm.EngDesc         = Detail.Code_Cause_English;
                CurrentAlarm.Type            = Detail.Code_Type;
                CurrentAlarm.IsStop          = Detail.IsStop;
                if (CurrentAlarm.IsStop)
                {
                    //RouteCtrl.Stop();
                }
            }
            catch (Exception e)
            {
                CurrentAlarm.Desc = "未定義";
                logger.Error(Node.Controller + "-" + Node.AdrNo + "(GetAlarmMessage)" + e.Message + "\n" + e.StackTrace);
            }
            CurrentAlarm.TimeStamp = DateTime.Now;
            AlarmManagement.Add(CurrentAlarm);
            AlarmUpdate.UpdateAlarmList(AlarmManagement.GetAll());
            AlarmUpdate.UpdateAlarmHistory(AlarmManagement.GetHistory());
        }
Exemple #3
0
 public static void Add(AlarmInfo Alm)
 {
     AlarmList.Add(Alm);
     AlarmHistory.Add(Alm);
     AlarmUpdate.UpdateStatusSignal(Alm.NodeName, "Red");
     AlarmUpdate.UpdateMessage(Alm.NodeName + " Alarm Happen " + Alm.AlarmCode + ":" + Alm.Desc);
     AlarmUpdate.UpdateAlarmList(AlarmList.ToList());
     AlarmUpdate.UpdateAlarmHistory(AlarmHistory.ToList());
 }
Exemple #4
0
        public void On_Command_Error(Node Node, Transaction Txn, CommandReturnMessage Msg)
        {
            switch (Txn.FormName)
            {
            case "FormManual":
                switch (Node.Type)
                {
                case "LOADPORT":
                    //ManualPortStatusUpdate.LockUI(false);
                    break;
                }
                break;
            }
            logger.Debug("On_Command_Error");
            AlarmInfo CurrentAlarm = new AlarmInfo();

            CurrentAlarm.NodeName  = Node.Name;
            CurrentAlarm.AlarmCode = Msg.Value;
            CurrentAlarm.NeedReset = true;
            try
            {
                AlarmMessage Detail = AlmMapping.Get(Node.Name, CurrentAlarm.AlarmCode);

                CurrentAlarm.SystemAlarmCode = Detail.CodeID;
                CurrentAlarm.Desc            = Detail.Code_Cause;
                CurrentAlarm.EngDesc         = Detail.Code_Cause_English;
                CurrentAlarm.Type            = Detail.Code_Type;
                CurrentAlarm.IsStop          = Detail.IsStop;
                if (CurrentAlarm.IsStop)
                {
                    // RouteCtrl.Stop();
                }
            }
            catch (Exception e)
            {
                CurrentAlarm.Desc = "未定義";
                logger.Error(Node.Controller + "-" + Node.AdrNo + "(GetAlarmMessage)" + e.Message + "\n" + e.StackTrace);
            }
            CurrentAlarm.TimeStamp = DateTime.Now;

            AlarmManagement.Add(CurrentAlarm);

            AlarmUpdate.UpdateAlarmList(AlarmManagement.GetAll());
            AlarmUpdate.UpdateAlarmHistory(AlarmManagement.GetHistory());
        }
Exemple #5
0
        public void On_TaskJob_Aborted(TaskJobManagment.CurrentProceedTask Task, string NodeName, string ReportType, string Message)
        {
            if (Task.Id.Equals("FormManual"))
            {
                ManualPortStatusUpdate.LockUI(false);
            }
            AlarmInfo CurrentAlarm = new AlarmInfo();

            CurrentAlarm.NodeName  = "SYSTEM";
            CurrentAlarm.AlarmCode = Message;
            CurrentAlarm.NeedReset = false;
            try
            {
                AlarmMessage Detail = AlmMapping.Get("SYSTEM", CurrentAlarm.AlarmCode);
                if (!Detail.Code_Group.Equals("UNDEFINITION"))
                {
                    CurrentAlarm.SystemAlarmCode = Detail.CodeID;
                    CurrentAlarm.Desc            = Detail.Code_Cause;
                    CurrentAlarm.EngDesc         = Detail.Code_Cause_English;
                    CurrentAlarm.Type            = Detail.Code_Type;
                    CurrentAlarm.IsStop          = Detail.IsStop;
                    if (CurrentAlarm.IsStop)
                    {
                        //RouteCtrl.Stop();
                    }
                    CurrentAlarm.TimeStamp = DateTime.Now;

                    AlarmManagement.Add(CurrentAlarm);

                    AlarmUpdate.UpdateAlarmList(AlarmManagement.GetAll());
                    AlarmUpdate.UpdateAlarmHistory(AlarmManagement.GetHistory());
                }
            }
            catch (Exception e)
            {
                CurrentAlarm.Desc = "未定義";
                logger.Error("(GetAlarmMessage)" + e.Message + "\n" + e.StackTrace);
            }
        }
Exemple #6
0
 private void FormAlarmHis_Load(object sender, EventArgs e)
 {
     From.Value = DateTime.Now.AddDays(-1);
     To.Value   = DateTime.Now;
     AlarmUpdate.UpdateAlarmHistory(AlarmManagement.GetHistory(From.Value, To.Value));
 }