• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

C# IMeasurement类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了C#中IMeasurement的典型用法代码示例。如果您正苦于以下问题:C# IMeasurement类的具体用法?C# IMeasurement怎么用?C# IMeasurement使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



IMeasurement类属于命名空间,在下文中一共展示了IMeasurement类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C#代码示例。

示例1: SignalReferenceMeasurement

 /// <summary>
 /// Constructs a new <see cref="SignalReferenceMeasurement"/> from the specified parameters.
 /// </summary>
 /// <param name="measurement">Source <see cref="IMeasurement"/> value.</param>
 /// <param name="signalReference">Associated <see cref="SignalReference"/>.</param>
 public SignalReferenceMeasurement(IMeasurement measurement, SignalReference signalReference)
     : base(measurement.ID, measurement.Source, measurement.Value, measurement.Adder, measurement.Multiplier, measurement.Timestamp)
 {
     base.ValueQualityIsGood = measurement.ValueQualityIsGood;
     base.TimestampQualityIsGood = measurement.TimestampQualityIsGood;
     m_signalReference = signalReference;
 }
开发者ID:avs009,项目名称:gsf,代码行数:12,代码来源:SignalReferenceMeasurement.cs


示例2: SerializableMeasurement

 /// <summary>
 /// Creates a new <see cref="SerializableMeasurement"/> from an existing <see cref="IMeasurement"/> value.
 /// </summary>
 /// <param name="measurement">Source <see cref="IMeasurement"/> value.</param>
 /// <param name="encoding">Character encoding used to convert strings to binary.</param>
 public SerializableMeasurement(IMeasurement measurement, Encoding encoding)
     : this(encoding)
 {
     Metadata = measurement.Metadata;
     Value = measurement.Value;
     Timestamp = measurement.Timestamp;
     StateFlags = measurement.StateFlags;
 }
开发者ID:GridProtectionAlliance,项目名称:gsf,代码行数:13,代码来源:SerializableMeasurement.cs


示例3: SerializableMeasurement

 /// <summary>
 /// Initializes a new instance of the <see cref="SerializableMeasurement"/> class.
 /// </summary>
 /// <param name="measurement"><see cref="IMeasurement"/> from which <see cref="SerializableMeasurement"/> is to be initialized.</param>
 public SerializableMeasurement(IMeasurement measurement)
 {
     m_sourceMeasurement = measurement;
     Key = measurement.Key.ToString();
     SignalID = measurement.ID.ToString();
     Value = measurement.AdjustedValue;
     Timestamp = ((DateTime)measurement.Timestamp).ToString("yyyy-MM-dd HH:mm:ss.fff");
     SignalType = string.Empty;
     Device = string.Empty;
 }
开发者ID:rmc00,项目名称:gsf,代码行数:14,代码来源:SerializableMeasurement.cs


示例4: SerializableMeasurement

 /// <summary>
 /// Creates a new <see cref="SerializableMeasurement"/> from an existing <see cref="IMeasurement"/> value.
 /// </summary>
 /// <param name="measurement">Source <see cref="IMeasurement"/> value.</param>
 /// <param name="encoding">Character encoding used to convert strings to binary.</param>
 public SerializableMeasurement(IMeasurement measurement, Encoding encoding)
     : this(encoding)
 {
     Key = measurement.Key;
     Value = measurement.Value;
     Adder = measurement.Adder;
     Multiplier = measurement.Multiplier;
     Timestamp = measurement.Timestamp;
     StateFlags = measurement.StateFlags;
 }
开发者ID:rmc00,项目名称:gsf,代码行数:15,代码来源:SerializableMeasurement.cs


示例5: PostMeasurement

		public void PostMeasurement(IMeasurement measurement)
		{
			if (measurement == null)
			{
				return;
			}
			this.PostMeasurement(new IMeasurement[]
			{
				measurement
			});
		}
开发者ID:airdye,项目名称:libratoSharp,代码行数:11,代码来源:MetricsManager.cs


示例6: MeasurementWrapper

 /// <summary>
 /// Creates a new instance of the <see cref="MeasurementWrapper"/> class.
 /// </summary>
 /// <param name="measurement">The measurement to be wrapped by the wrapper.</param>
 public MeasurementWrapper(IMeasurement measurement)
 {
     Adder = measurement.Adder;
     SignalID = measurement.ID.ToString();
     ID = unchecked((int)measurement.Key.ID);
     Multiplier = measurement.Multiplier;
     Source = measurement.Key.Source;
     TagName = measurement.TagName;
     Timestamp = measurement.Timestamp;
     Value = measurement.Value;
 }
开发者ID:GridProtectionAlliance,项目名称:gsf,代码行数:15,代码来源:MeasurementWrapper.cs


示例7: TemporalMeasurement

        /// <summary>
        /// Constructs a new <see cref="TemporalMeasurement"/> given the specified parameters.
        /// </summary>
        /// <param name="measurement">Source <see cref="IMeasurement"/> value.</param>
        /// <param name="lagTime">Past time deviation tolerance, in seconds - this becomes the amount of time to wait before publishing begins.</param>
        /// <param name="leadTime">Future time deviation tolerance, in seconds - this becomes the tolerated +/- accuracy of the local clock to real-time.</param>
        public TemporalMeasurement(IMeasurement measurement, double lagTime, double leadTime)
        {
            if (measurement != null)
            {
                Metadata = measurement.Metadata;
                Value = measurement.Value;
                Timestamp = measurement.Timestamp;
                StateFlags = measurement.StateFlags;
            }

            if (lagTime <= 0)
                throw new ArgumentOutOfRangeException(nameof(lagTime), "lagTime must be greater than zero, but it can be less than one");

            if (leadTime <= 0)
                throw new ArgumentOutOfRangeException(nameof(leadTime), "leadTime must be greater than zero, but it can be less than one");

            m_lagTime = lagTime;
            m_leadTime = leadTime;
        }
开发者ID:GridProtectionAlliance,项目名称:gsf,代码行数:25,代码来源:TemporalMeasurement.cs


示例8: TemporalMeasurement

        /// <summary>
        /// Constructs a new <see cref="TemporalMeasurement"/> given the specified parameters.
        /// </summary>
        /// <param name="measurement">Source <see cref="IMeasurement"/> value.</param>
        /// <param name="lagTime">Past time deviation tolerance, in seconds - this becomes the amount of time to wait before publishing begins.</param>
        /// <param name="leadTime">Future time deviation tolerance, in seconds - this becomes the tolerated +/- accuracy of the local clock to real-time.</param>
        public TemporalMeasurement(IMeasurement measurement, double lagTime, double leadTime)
        {
            if (measurement != null)
            {
                Key = measurement.Key;
                Value = measurement.Value;
                Adder = measurement.Adder;
                Multiplier = measurement.Multiplier;
                Timestamp = measurement.Timestamp;
                StateFlags = measurement.StateFlags;
            }

            if (lagTime <= 0)
                throw new ArgumentOutOfRangeException("lagTime", "lagTime must be greater than zero, but it can be less than one");

            if (leadTime <= 0)
                throw new ArgumentOutOfRangeException("leadTime", "leadTime must be greater than zero, but it can be less than one");

            m_lagTime = lagTime;
            m_leadTime = leadTime;
        }
开发者ID:rmc00,项目名称:gsf,代码行数:27,代码来源:TemporalMeasurement.cs


示例9: ApplyStreamBackgroundAsync

 public override void ApplyStreamBackgroundAsync(IDAQOutputStream s, IMeasurement background)
 {
 }
开发者ID:Symphony-DAS,项目名称:symphony-core,代码行数:3,代码来源:SimulationDAQController.cs


示例10: ProcessMeasurements

 /// <summary>
 /// Serializes measurements to data output stream.
 /// </summary>
 /// <remarks>
 /// <para>
 /// Derived classes must implement this function to process queued measurements.
 /// For example, this function would "archive" measurements if output adapter is for a historian.
 /// </para>
 /// <para>
 /// It is important that consumers "resume" connection cycle if processing fails (e.g., connection
 /// to archive is lost). Here is an example:
 /// <example>
 /// <code>
 /// protected virtual void ProcessMeasurements(IMeasurement[] measurements)
 /// {
 ///     try
 ///     {
 ///         // Process measurements...
 ///         foreach (IMeasurement measurement in measurement)
 ///         {
 ///             ArchiveMeasurement(measurement);
 ///         }
 ///     }
 ///     catch (Exception)
 ///     {                
 ///         // So long as user hasn't requested to stop, restart connection cycle
 ///         if (Enabled)
 ///             Start();
 ///     }
 /// }
 /// </code>
 /// </example>
 /// </para>
 /// </remarks>
 protected abstract void ProcessMeasurements(IMeasurement[] measurements);
开发者ID:rmc00,项目名称:gsf,代码行数:35,代码来源:OutputAdapterBase.cs


示例11: QueueMeasurementForProcessing

 /// <summary>
 /// Queues a single measurement for processing. Measurement is automatically filtered to the defined <see cref="IAdapter.InputMeasurementKeys"/>.
 /// </summary>
 /// <param name="measurement">Measurement to queue for processing.</param>
 public virtual void QueueMeasurementForProcessing(IMeasurement measurement)
 {
     QueueMeasurementsForProcessing(new IMeasurement[] { measurement });
 }
开发者ID:rmc00,项目名称:gsf,代码行数:8,代码来源:OutputAdapterBase.cs


示例12: CompactMeasurement

        /// <summary>
        /// Creates a new <see cref="CompactMeasurement"/> from an existing <see cref="IMeasurement"/> value.
        /// </summary>
        /// <param name="measurement">Source <see cref="IMeasurement"/> value.</param>
        /// <param name="signalIndexCache">Signal index cache used to serialize or deserialize runtime information.</param>
        /// <param name="includeTime">Set to <c>true</c> to include time in serialized packet; otherwise <c>false</c>.</param>
        /// <param name="baseTimeOffsets">Base time offset array - set to <c>null</c> to use full fidelity measurement time.</param>
        /// <param name="timeIndex">Time index to use for base offset.</param>
        /// <param name="useMillisecondResolution">Flag that determines if millisecond resolution is in use for this serialization.</param>
        public CompactMeasurement(IMeasurement measurement, SignalIndexCache signalIndexCache, bool includeTime, long[] baseTimeOffsets, int timeIndex, bool useMillisecondResolution)
        {
            ID = measurement.ID;
            Key = measurement.Key;
            Value = measurement.Value;
            Adder = measurement.Adder;
            Multiplier = measurement.Multiplier;
            Timestamp = measurement.Timestamp;
            StateFlags = measurement.StateFlags;

            m_signalIndexCache = signalIndexCache;
            m_includeTime = includeTime;

            // We keep a clone of the base time offsets, if provided, since array contents can change at any time
            if (baseTimeOffsets == null)
                m_baseTimeOffsets = s_emptyBaseTimeOffsets;
            else
                m_baseTimeOffsets = new long[] { baseTimeOffsets[0], baseTimeOffsets[1] };

            m_timeIndex = timeIndex;
            m_useMillisecondResolution = useMillisecondResolution;
        }
开发者ID:rmc00,项目名称:gsf,代码行数:31,代码来源:CompactMeasurement.cs


示例13: ProcessMeasurements

        /// <summary>
        /// Archives <paramref name="measurements"/> locally.
        /// </summary>
        /// <param name="measurements">Measurements to be archived.</param>
        protected override void ProcessMeasurements(IMeasurement[] measurements)
        {
            if ((object)measurements != null)
            {
                foreach (IMeasurement measurement in measurements)
                {
                    // Create the command string to insert the measurement as a record in the table.
                    StringBuilder commandString = new StringBuilder("INSERT INTO Measurement VALUES ('");
                    IDbCommand command = m_connection.CreateCommand();

                    commandString.Append(measurement.ID);
                    commandString.Append("','");
                    commandString.Append((long)measurement.Timestamp);
                    commandString.Append("',");
                    commandString.Append(measurement.AdjustedValue);
                    commandString.Append(')');

                    command.CommandText = commandString.ToString();
                    command.ExecuteNonQuery();

                }
                m_measurementCount += measurements.Length;
            }
        }
开发者ID:rmc00,项目名称:gsf,代码行数:28,代码来源:MySqlOutputAdapter.cs


示例14: Clone

 /// <summary>Creates a copy of the specified measurement using a new value and timestamp</summary>
 public static Measurement Clone(IMeasurement measurementToClone, double value, long ticks)
 {
     return new Measurement(measurementToClone.ID, measurementToClone.Source, value, measurementToClone.Adder, measurementToClone.Multiplier, ticks);
 }
开发者ID:avs009,项目名称:gsf,代码行数:5,代码来源:Measurement.cs


示例15: ClearIfNotGreaterThan

 // Indicates whether the given measurement is not greater
 // than the set point, offset by the hysteresis.
 private bool ClearIfNotGreaterThan(IMeasurement measurement)
 {
     return (measurement.Value <= m_setPoint - m_hysteresis);
 }
开发者ID:rmc00,项目名称:gsf,代码行数:6,代码来源:Alarm.cs


示例16: CompareTo

 /// <summary>This implementation of a basic measurement compares itself by value</summary>
 public int CompareTo(IMeasurement other)
 {
     return m_value.CompareTo(other.Value);
 }
开发者ID:avs009,项目名称:gsf,代码行数:5,代码来源:Measurement.cs


示例17: ClearIfNotLessThan

 // Indicates whether the given measurement is not less
 // than the set point, offset by the hysteresis.
 private bool ClearIfNotLessThan(IMeasurement measurement)
 {
     return (measurement.Value >= m_setPoint + m_hysteresis);
 }
开发者ID:rmc00,项目名称:gsf,代码行数:6,代码来源:Alarm.cs


示例18: ToString

        public static string ToString(IMeasurement measurement)
        {
            if (measurement == null)
            {
                return "Undefined";
            }
            else
            {
                string tagName = measurement.TagName;
                string keyText = measurement.Key.ToString();

                if (string.IsNullOrEmpty(tagName))
                    return keyText;
                else
                    return string.Format("{0} [{1}]", tagName, keyText);
            }
        }
开发者ID:avs009,项目名称:gsf,代码行数:17,代码来源:Measurement.cs


示例19: ClearIfNotFlatline

        // Indicates whether the given measurement's value has changed.
        private bool ClearIfNotFlatline(IMeasurement measurement)
        {
            if (measurement.Value != m_lastValue)
            {
                m_lastChanged = measurement.Timestamp;
                m_lastValue = measurement.Value;

                return true;
            }

            return false;
        }
开发者ID:rmc00,项目名称:gsf,代码行数:13,代码来源:Alarm.cs


示例20: CheckDelay

        // Keeps track of the signal's timestamps to determine whether a given
        // measurement is eligible to raise the alarm based on the delay.
        private bool CheckDelay(IMeasurement measurement, bool raiseCondition)
        {
            Ticks dist;

            if (!raiseCondition)
            {
                // Keep track of the last time
                // the signal failed the raise test
                m_lastNegative = measurement.Timestamp;
            }
            else
            {
                // Get the amount of time since the last
                // time the signal failed the raise test
                dist = measurement.Timestamp - m_lastNegative;

                // If the amount of time is larger than
                // the delay threshold, raise the alarm
                if (dist >= Ticks.FromSeconds(m_delay.GetValueOrDefault()))
                    return true;
            }

            return false;
        }
开发者ID:rmc00,项目名称:gsf,代码行数:26,代码来源:Alarm.cs



注:本文中的IMeasurement类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C# IMedia类代码示例发布时间:2022-05-24
下一篇:
C# IMeasureService类代码示例发布时间:2022-05-24
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap