Opc.Ua.InstanceStateSnapshot.Initialize C# (CSharp) Method

Initialize() public method

Initializes the snapshot from an instance.
public Initialize ( ISystemContext context, BaseInstanceState state ) : void
context ISystemContext The context.
state BaseInstanceState The state.
return void
        public void Initialize(
            ISystemContext context, 
            BaseInstanceState state)
        {
            m_typeDefinitionId = state.TypeDefinitionId;
            m_snapshot = CreateChildNode(context, state);
        }

Usage Example

コード例 #1
0
        /// <summary>
        /// Reports the state change for the condition.
        /// </summary>
        /// <param name="context">The context.</param>
        /// <param name="ignoreDisabledState">if set to <c>true</c> the event is reported event if the condition is in the disabled state.</param>
        protected void ReportStateChange(ISystemContext context, bool ignoreDisabledState)
        {
            // check the disabled state.
            if (!ignoreDisabledState && !this.EnabledState.Id.Value)
            {
                return;
            }

            if (AutoReportStateChanges)
            {
                // create a new event instance.
                this.EventId.Value     = Guid.NewGuid().ToByteArray();
                this.Time.Value        = DateTime.UtcNow;
                this.ReceiveTime.Value = this.Time.Value;

                ClearChangeMasks(context, includeChildren: true);

                // report a state change event.
                if (EventsMonitored())
                {
                    InstanceStateSnapshot snapshot = new InstanceStateSnapshot();
                    snapshot.Initialize(context, this);
                    ReportEvent(context, snapshot);
                }
            }
        }
All Usage Examples Of Opc.Ua.InstanceStateSnapshot::Initialize