private void ReportChanges(ConditionState alarm)
        {
            // report changes to node attributes.
            alarm.ClearChangeMasks(_nodeManager.SystemContext, true);

            // check if events are being monitored for the source.
            if (this.AreEventsMonitored)
            {
                // create a snapshot.
                InstanceStateSnapshot e = new InstanceStateSnapshot();
                e.Initialize(_nodeManager.SystemContext, alarm);

                // report the event.
                alarm.ReportEvent(_nodeManager.SystemContext, e);
            }
        }
        public void ReportEvent(ConditionState alarm = null)
        {
            if (alarm == null)
            {
                alarm = GetAlarm();
            }

            if (alarm.EnabledState.Id.Value)
            {
                alarm.EventId.Value     = Guid.NewGuid().ToByteArray();
                alarm.Time.Value        = DateTime.UtcNow;
                alarm.ReceiveTime.Value = alarm.Time.Value;

                Log("ReportEvent", " Value " + m_alarmController.GetValue().ToString() +
                    " Message " + alarm.Message.Value.Text);

                alarm.ClearChangeMasks(SystemContext, true);

                InstanceStateSnapshot eventSnapshot = new InstanceStateSnapshot();
                eventSnapshot.Initialize(SystemContext, alarm);
                alarm.ReportEvent(SystemContext, eventSnapshot);
            }
        }