示例#1
0
 /// <summary>
 /// Constructs a new instance.
 /// </summary>
 public DataChangeMonitoredItem(
     MonitoredNode source,
     uint id,
     uint attributeId,
     NumericRange indexRange,
     QualifiedName dataEncoding,
     DiagnosticsMasks diagnosticsMasks,
     TimestampsToReturn timestampsToReturn,
     MonitoringMode monitoringMode,
     uint clientHandle,
     double samplingInterval,
     bool alwaysReportUpdates)
 {
     m_source              = source;
     m_id                  = id;
     m_attributeId         = attributeId;
     m_indexRange          = indexRange;
     m_dataEncoding        = dataEncoding;
     m_timestampsToReturn  = timestampsToReturn;
     m_diagnosticsMasks    = diagnosticsMasks;
     m_monitoringMode      = monitoringMode;
     m_clientHandle        = clientHandle;
     m_samplingInterval    = samplingInterval;
     m_nextSampleTime      = DateTime.UtcNow.Ticks;
     m_readyToPublish      = false;
     m_alwaysReportUpdates = alwaysReportUpdates;
 }
示例#2
0
        /// <summary>
        /// Constructs a new instance.
        /// </summary>
        public DataChangeMonitoredItem(
            MonitoredNode source,
            uint id,
            uint attributeId,
            NumericRange indexRange,
            QualifiedName dataEncoding,
            DiagnosticsMasks diagnosticsMasks,
            TimestampsToReturn timestampsToReturn,
            MonitoringMode monitoringMode,
            uint clientHandle,
            double samplingInterval,
            uint queueSize,
            bool discardOldest,
            DataChangeFilter filter,
            Range range,
            bool alwaysReportUpdates)
        {
            m_source              = source;
            m_id                  = id;
            m_attributeId         = attributeId;
            m_indexRange          = indexRange;
            m_dataEncoding        = dataEncoding;
            m_timestampsToReturn  = timestampsToReturn;
            m_diagnosticsMasks    = diagnosticsMasks;
            m_monitoringMode      = monitoringMode;
            m_clientHandle        = clientHandle;
            m_samplingInterval    = samplingInterval;
            m_nextSampleTime      = DateTime.UtcNow.Ticks;
            m_readyToPublish      = false;
            m_queue               = null;
            m_filter              = filter;
            m_range               = 0;
            m_alwaysReportUpdates = alwaysReportUpdates;

            if (range != null)
            {
                m_range = range.High - range.Low;
            }

            if (queueSize > 1)
            {
                m_queue = new MonitoredItemQueue();
                m_queue.SetQueueSize(queueSize, discardOldest, diagnosticsMasks);
                m_queue.SetSamplingInterval(samplingInterval);
            }
        }