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; }
// 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); }