Пример #1
0
        protected override void CreateBranch()
        {
            if (SupportsBranching)
            {
                ConditionState alarm = GetAlarm();

                int currentSeverity = alarm.Severity.Value;
                int newSeverity     = GetSeverity();
                // A branch is created at the end of an active cycle
                // This could be a transition between alarm states,
                // or a transition to inactive
                // So a branch can only be created when the severity changes
                if (currentSeverity > AlarmDefines.INACTIVE_SEVERITY &&
                    newSeverity != currentSeverity)
                {
                    NodeId         branchId = GetNewBranchId();
                    ConditionState branch   = alarm.CreateBranch(SystemContext, branchId);

                    string postEventId = Utils.ToHexString(branch.EventId.Value as byte[]);

                    Log("CreateBranch", " Branch " + branchId.ToString() +
                        " EventId " + postEventId + " created, Message " + alarm.Message.Value.Text);

                    m_alarmController.SetBranchCount(alarm.GetBranchCount());
                }
            }
        }
Пример #2
0
        public bool HasBranches()
        {
            bool hasBranches = false;

            ConditionState alarm = m_alarm as ConditionState;

            if (alarm != null)
            {
                hasBranches = alarm.GetBranchCount() > 0;
            }

            return(hasBranches);
        }