Example #1
0
 public EDFFile()
 {
     //initialize EDFHeader as part of constructor
     _header = new EDFHeader();
     //initialize EDFDataRecord List as part of constructor
     _dataRecords = new List <EDFDataRecord>();
 }
Example #2
0
        private void parseHeaderStream(StreamReader sr)
        {
            //parse the header to get the number of Signals (size of the Singal Header)
            char[] header = new char[256];
            sr.ReadBlock(header, 0, 256);
            this._header = new EDFHeader(header);

            //parse the signals within the header
            char[] signals = new char[this.Header.NumberOfSignalsInDataRecord * 256];
            sr.ReadBlock(signals, 0, this.Header.NumberOfSignalsInDataRecord * 256);
            this.Header.parseSignals(signals);
        }
Example #3
0
        public EDFFile()
        {
            //initialize EDFHeader as part of constructor
            _header = new EDFHeader();
            //initialize EDFDataRecord List as part of constructor
            _dataRecords = new List <EDFDataRecord>();

            //解析自定义格式数据时用到  --by zt
            _mydataRecords = new List <MyEDFDataRecord>();

            //保存数据时用到  --by zt
            _dataHex = new StringBuilder();
        }
Example #4
0
        /// <summary>
        /// 解析文件头
        /// </summary>
        private void parseHeader(FileStream fs, Encoding encoding)
        {
            // 读取文件头
            var buffer = new byte[HEADER_LENGTH];


            fs.Read(buffer, 0, buffer.Length);
            String str = "";
            int    i   = 0;

            foreach (byte b in buffer)
            {
                i++;
                str += b.ToString() + "  ";
                if (i % 16 == 0)
                {
                    str += "\n";
                }
            }
            Debug.WriteLine(str);

            // 解析文件头
            this._header = new EDFHeader(buffer, encoding);
        }