示例#1
0
文件: DataCell.cs 项目: avs009/gsf
        // Static Methods

        // Delegate handler to create a new IEEE C37.118 data cell
        internal static IDataCell CreateNewCell(IChannelFrame parent, IChannelFrameParsingState<IDataCell> state, int index, byte[] binaryImage, int startIndex, out int parsedLength)
        {
            DataCell dataCell = new DataCell(parent as IDataFrame, (state as IDataFrameParsingState).ConfigurationFrame.Cells[index]);

            parsedLength = dataCell.Initialize(binaryImage, startIndex, 0);

            return dataCell;
        }
示例#2
0
        /// <summary>
        /// Creates a new IEEE C37.118 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 IEEE C37.118 <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 an IEEE C37.118 data frame.
        /// </remarks>
        protected override IFrame CreateNewFrame(Ticks timestamp)
        {
            // We create a new IEEE C37.118 data frame based on current configuration frame
            DataFrame dataFrame = new DataFrame(timestamp, m_configurationFrame);
            DataCell dataCell;
            bool configurationChanged = false;

            if (m_configurationChanged)
            {
                // Change notifications should only last for one minute
                if ((DateTime.UtcNow.Ticks - m_notificationStartTime).ToSeconds() <= 60.0D)
                    configurationChanged = true;
                else
                    m_configurationChanged = false;
            }

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

                // Assume good status flags for virtual devices
                if ((bool)configurationCell.Tag)
                    dataCell.StatusFlags = 0;

                // Mark cells with configuration changed flag if configuration was reloaded
                if (configurationChanged)
                    dataCell.ConfigurationChangeDetected = true;

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

            return dataFrame;
        }
示例#3
0
文件: PhasorValue.cs 项目: avs009/gsf
 /// <summary>
 /// Creates a new <see cref="PhasorValue"/> from specified parameters.
 /// </summary>
 /// <param name="parent">The <see cref="DataCell"/> parent of this <see cref="PhasorValue"/>.</param>
 /// <param name="phasorDefinition">The <see cref="PhasorDefinition"/> associated with this <see cref="PhasorValue"/>.</param>
 /// <param name="angle">The <see cref="TVA.Units.Angle"/> value (a.k.a., the argument) of this <see cref="PhasorValue"/>, in radians.</param>
 /// <param name="magnitude">The magnitude value (a.k.a., the absolute value or modulus) of this <see cref="PhasorValue"/>.</param>
 public PhasorValue(DataCell parent, PhasorDefinition phasorDefinition, Angle angle, double magnitude)
     : base(parent, phasorDefinition, angle, magnitude)
 {
 }
示例#4
0
文件: PhasorValue.cs 项目: avs009/gsf
 /// <summary>
 /// Creates a new <see cref="PhasorValue"/> from specified parameters.
 /// </summary>
 /// <param name="parent">The <see cref="DataCell"/> parent of this <see cref="PhasorValue"/>.</param>
 /// <param name="phasorDefinition">The <see cref="PhasorDefinition"/> associated with this <see cref="PhasorValue"/>.</param>
 /// <param name="real">The real value of this <see cref="PhasorValue"/>.</param>
 /// <param name="imaginary">The imaginary value of this <see cref="PhasorValue"/>.</param>
 public PhasorValue(DataCell parent, PhasorDefinition phasorDefinition, double real, double imaginary)
     : base(parent, phasorDefinition, real, imaginary)
 {
 }
示例#5
0
 /// <summary>
 /// Creates a new <see cref="DigitalValue"/> from specified parameters.
 /// </summary>
 /// <param name="parent">The <see cref="DataCell"/> parent of this <see cref="DigitalValue"/>.</param>
 /// <param name="digitalDefinition">The <see cref="DigitalDefinition"/> associated with this <see cref="DigitalValue"/>.</param>
 /// <param name="value">The unsigned 16-bit integer value (composed of digital bits) that represents this <see cref="DigitalValue"/>.</param>
 public DigitalValue(DataCell parent, DigitalDefinition digitalDefinition, ushort value)
     : base(parent, digitalDefinition, value)
 {
 }
示例#6
0
文件: AnalogValue.cs 项目: avs009/gsf
 /// <summary>
 /// Creates a new <see cref="AnalogValue"/> from specified parameters.
 /// </summary>
 /// <param name="parent">The <see cref="DataCell"/> parent of this <see cref="AnalogValue"/>.</param>
 /// <param name="analogDefinition">The <see cref="AnalogDefinition"/> associated with this <see cref="AnalogValue"/>.</param>
 /// <param name="value">The floating point value that represents this <see cref="AnalogValue"/>.</param>
 public AnalogValue(DataCell parent, AnalogDefinition analogDefinition, double value)
     : base(parent, analogDefinition, value)
 {
 }
示例#7
0
 /// <summary>
 /// Creates a new <see cref="FrequencyValue"/> from specified parameters.
 /// </summary>
 /// <param name="parent">The <see cref="DataCell"/> parent of this <see cref="FrequencyValue"/>.</param>
 /// <param name="frequencyDefinition">The <see cref="FrequencyDefinition"/> associated with this <see cref="FrequencyValue"/>.</param>
 /// <param name="frequency">The floating point value that represents this <see cref="FrequencyValue"/>.</param>
 /// <param name="dfdt">The floating point value that represents the change in this <see cref="FrequencyValue"/> over time.</param>
 public FrequencyValue(DataCell parent, FrequencyDefinition frequencyDefinition, double frequency, double dfdt)
     : base(parent, frequencyDefinition, frequency, dfdt)
 {
 }