当前位置: 首页>>代码示例>>C#>>正文


C# Ticks.DistanceBeyondSecond方法代码示例

本文整理汇总了C#中Ticks.DistanceBeyondSecond方法的典型用法代码示例。如果您正苦于以下问题:C# Ticks.DistanceBeyondSecond方法的具体用法?C# Ticks.DistanceBeyondSecond怎么用?C# Ticks.DistanceBeyondSecond使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Ticks的用法示例。


在下文中一共展示了Ticks.DistanceBeyondSecond方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: CreateNewFrame

        /// <summary>
        /// Creates a new BPA PDCstream specific <see cref="DataFrame"/> for the given <paramref name="timestamp"/>.
        /// </summary>
        /// <param name="timestamp">Timestamp for new <see cref="IFrame"/> in <see cref="Ticks"/>.</param>
        /// <returns>New BPA PDCstream <see cref="DataFrame"/> at given <paramref name="timestamp"/>.</returns>
        /// <remarks>
        /// Note that the <see cref="ConcentratorBase"/> class (which the <see cref="ActionAdapterBase"/> is derived from)
        /// is designed to sort <see cref="IMeasurement"/> implementations into an <see cref="IFrame"/> which represents
        /// a collection of measurements at a given timestamp. The <c>CreateNewFrame</c> method allows consumers to create
        /// their own <see cref="IFrame"/> implementations, in our case this will be a BPA PDCstream data frame.
        /// </remarks>
        protected override IFrame CreateNewFrame(Ticks timestamp)
        {
            // We create a new BPA PDCstream data frame based on current configuration frame
            ushort sampleNumber = (ushort)((timestamp.DistanceBeyondSecond() + 1.0D) / base.TicksPerFrame);

            DataFrame dataFrame = new DataFrame(timestamp, m_configurationFrame, 1, sampleNumber);
            DataCell dataCell;

            foreach (ConfigurationCell configurationCell in m_configurationFrame.Cells)
            {
                // Create a new BPA PDCstream data cell (i.e., a PMU entry for this frame)
                dataCell = new DataCell(dataFrame, configurationCell, true);

                // Add data cell to the frame
                dataFrame.Cells.Add(dataCell);
            }

            return dataFrame;
        }
开发者ID:rmc00,项目名称:gsf,代码行数:30,代码来源:Concentrator.cs

示例2: GetNTPTimestampFromTicks

        protected static ulong GetNTPTimestampFromTicks(Ticks timestamp)
        {
            timestamp -= GetBaseDateOffsetTicks(timestamp);

            uint seconds = (uint)Math.Truncate(timestamp.ToSeconds());
            uint fraction = (uint)(timestamp.DistanceBeyondSecond().ToSeconds() * uint.MaxValue);

            return Word.MakeQword(seconds, fraction);
        }
开发者ID:avs009,项目名称:gsf,代码行数:9,代码来源:NtpTimeTag.cs


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