GSF.PhasorProtocols.BPAPDCstream.FrequencyValue.CalculateBinaryLength C# (CSharp) Méthode

CalculateBinaryLength() static private méthode

static private CalculateBinaryLength ( IFrequencyDefinition definition ) : uint
definition IFrequencyDefinition
Résultat uint
        internal static uint CalculateBinaryLength(IFrequencyDefinition definition)
        {
            // The frequency definition will determine the binary length based on data format
            return (uint)(new FrequencyValue(null, definition)).BinaryLength;
        }

Usage Example

Exemple #1
0
        // RowLength property calculates cell offsets - so it must be called before
        // accessing cell offsets - this happens automatically since HeaderImage is
        // called before base class BodyImage which just gets Cells.BinaryImage
        internal uint RowLength(bool recalculate)
        {
            if (m_rowLength == 0 || recalculate)
            {
                m_rowLength = 0;

                for (int x = 0; x < Cells.Count; x++)
                {
                    ConfigurationCell cell = Cells[x];

                    cell.Offset = unchecked ((ushort)m_rowLength);

                    m_rowLength += (8 + FrequencyValue.CalculateBinaryLength(cell.FrequencyDefinition));

                    for (int y = 0; y < cell.PhasorDefinitions.Count; y++)
                    {
                        m_rowLength += PhasorValue.CalculateBinaryLength(cell.PhasorDefinitions[y]);
                    }
                }
            }

            return(m_rowLength);
        }