示例#1
0
        public DataGroupBlock(Mdf mdf)
            : base(mdf)
        {
            byte[] data = new byte[Size - 4];
            int    read = Mdf.Data.Read(data, 0, data.Length);

            if (read != data.Length)
            {
                throw new FormatException();
            }

            m_Next        = null;
            ChannelGroups = null;
            Trigger       = null;
            Reserved      = 0;

            m_ptrNextDataGroup          = BitConverter.ToUInt32(data, 0);
            m_ptrFirstChannelGroupBlock = BitConverter.ToUInt32(data, 4);
            m_ptrTriggerBlock           = BitConverter.ToUInt32(data, 8);
            m_ptrDataBlock   = BitConverter.ToUInt32(data, 12);
            NumChannelGroups = BitConverter.ToUInt16(data, 16);
            NumRecordIds     = BitConverter.ToUInt16(data, 18);

            if (data.Length >= 24)
            {
                Reserved = BitConverter.ToUInt32(data, 20);
            }

            Mdf.Data.Position = m_ptrFirstChannelGroupBlock;
            ChannelGroups     = new ChannelGroupCollection(mdf, new ChannelGroupBlock(mdf));

            /// TODO: Call Trigger Blocks
            //if (m_ptrTriggerBlock != 0)
            //{
            //    Mdf.Data.Position = m_ptrTriggerBlock;
            //    Trigger = new TriggerBlock(mdf);
            //}

            /// TODO: Call ProgramsBlock ?
            //if (ptrProgramBlock != 0)
            //{
            //    Mdf.Data.Position = ptrProgramBlock;
            //    ProgramBlock = new ProgramBlock(mdf);
            //}
        }
示例#2
0
 private DataGroupBlock(Mdf mdf) : base(mdf)
 {
     ChannelGroups = new ChannelGroupCollection(mdf, this);
 }