ReportStateChange() protected method

Reports the state change for the condition.
protected ReportStateChange ( ISystemContext context, bool ignoreDisabledState ) : void
context ISystemContext The context.
ignoreDisabledState bool if set to true the event is reported event if the condition is in the disabled state.
return void
コード例 #1
0
        /// <summary>
        /// Create a branch based off the original Event
        /// </summary>
        /// <param name="context">The system context.</param>
        /// <param name="branchId">The Desired Branch Id</param>
        /// <returns>ConditionState newly created branch</returns>
        public virtual ConditionState CreateBranch(ISystemContext context, NodeId branchId)
        {
            ConditionState state = null;

            Type   alarmType     = this.GetType();
            object branchedAlarm = Activator.CreateInstance(alarmType, this);

            if (branchedAlarm != null)
            {
                ConditionState branchedNodeState = (ConditionState)branchedAlarm;
                branchedNodeState.Initialize(context, this);
                branchedNodeState.BranchId.Value         = branchId;
                branchedNodeState.AutoReportStateChanges = AutoReportStateChanges;
                branchedNodeState.ReportStateChange(context, false);

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

                Dictionary <string, ConditionState> branches = GetBranches();

                branches.Add(postEventId, branchedNodeState);

                state = branchedNodeState;
            }

            return(state);
        }