Esempio n. 1
0
        // Attempts to cast given frame into a F-NET configuration frame - theoretically this will
        // allow the same configuration frame to be used for any protocol implementation
        internal static ConfigurationFrame CastToDerivedConfigurationFrame(IConfigurationFrame sourceFrame)
        {
            // See if frame is already a F-NET frame (if so, we don't need to do any work)
            ConfigurationFrame derivedFrame = sourceFrame as ConfigurationFrame;

            if (derivedFrame == null)
            {
                // Create a new F-NET configuration frame converted from equivalent configuration information; F-NET only supports one device
                if (sourceFrame.Cells.Count > 0)
                {
                    derivedFrame = new ConfigurationFrame(sourceFrame.IDCode, sourceFrame.Timestamp, sourceFrame.FrameRate, sourceFrame.Cells[0].NominalFrequency, Common.DefaultTimeOffset, Common.DefaultStationName);
                }
                else
                {
                    derivedFrame = new ConfigurationFrame(sourceFrame.IDCode, sourceFrame.Timestamp, sourceFrame.FrameRate, LineFrequency.Hz60, Common.DefaultTimeOffset, Common.DefaultStationName);
                }
            }

            return(derivedFrame);
        }
Esempio n. 2
0
 /// <summary>
 /// Creates a new <see cref="DataFrame"/> from specified parameters.
 /// </summary>
 /// <param name="timestamp">The exact timestamp, in <see cref="Ticks"/>, of the data represented by this <see cref="DataFrame"/>.</param>
 /// <param name="configurationFrame">The <see cref="ConfigurationFrame"/> associated with this <see cref="DataFrame"/>.</param>
 /// <param name="sampleIndex">The sample index of this <see cref="DataFrame"/>.</param>
 /// <remarks>
 /// This constructor is used by a consumer to generate a F-NET data frame.
 /// </remarks>
 public DataFrame(Ticks timestamp, ConfigurationFrame configurationFrame, uint sampleIndex)
     : base(new DataCellCollection(), timestamp, configurationFrame)
 {
     m_sampleIndex = sampleIndex;
 }
Esempio n. 3
0
        private int m_numberOfSatellites = 1; // We'll initially assume synchronization is good until told otherwise

        #endregion

        #region [ Constructors ]

        /// <summary>
        /// Creates a new <see cref="ConfigurationCell"/> from specified parameters.
        /// </summary>
        /// <param name="parent">The reference to parent <see cref="ConfigurationFrame"/> of this <see cref="ConfigurationCell"/>.</param>
        /// <param name="nominalFrequency">The nominal <see cref="LineFrequency"/> of the <see cref="FrequencyDefinition"/> of this <see cref="ConfigurationCell"/>.</param>
        /// <param name="timeOffset">The time offset of F-NET device in <see cref="Ticks"/>.</param>
        internal ConfigurationCell(ConfigurationFrame parent, LineFrequency nominalFrequency, Ticks timeOffset)
            : base(parent, parent.IDCode, Common.MaximumPhasorValues, Common.MaximumAnalogValues, Common.MaximumDigitalValues)
        {
            NominalFrequency = nominalFrequency;
            m_timeOffset     = timeOffset;
        }
Esempio n. 4
0
        private int m_numberOfSatellites = 1; // We'll initially assume synchronization is good until told otherwise

        #endregion

        #region [ Constructors ]

        /// <summary>
        /// Creates a new <see cref="ConfigurationCell"/> from specified parameters.
        /// </summary>
        /// <param name="parent">The reference to parent <see cref="ConfigurationFrame"/> of this <see cref="ConfigurationCell"/>.</param>
        /// <param name="nominalFrequency">The nominal <see cref="LineFrequency"/> of the <see cref="FrequencyDefinition"/> of this <see cref="ConfigurationCell"/>.</param>
        /// <param name="timeOffset">The time offset of F-NET device in <see cref="Ticks"/>.</param>
        internal ConfigurationCell(ConfigurationFrame parent, LineFrequency nominalFrequency, Ticks timeOffset)
            : base(parent, parent.IDCode, Common.MaximumPhasorValues, Common.MaximumAnalogValues, Common.MaximumDigitalValues)
        {
            NominalFrequency = nominalFrequency;
            m_timeOffset = timeOffset;
        }