예제 #1
0
파일: Form1.cs 프로젝트: szchuchai/JLab
        private void metroButtonOpen_Click(object sender, EventArgs e)
        {
            var fileBrowser = new OpenFileDialog {
                Filter = @"(*.bin)|*.bin"
            };

            if (fileBrowser.ShowDialog() != DialogResult.OK)
            {
                return;
            }

            streamingInfo = new StreamingInfo();
            playback.OpenFile(fileBrowser.FileName, ref streamingInfo);
            metroTextBox_totalSamples.Text = streamingInfo.SamplesPerChannel.ToString();
            channels     = streamingInfo.Channels;
            channelCount = channels.Length;
            string fmt = "采样率:{0}   流盘总时间:{1}ms    流盘文件时间长度:{2}ms";

            metroLabelStripStatus.Text = string.Format(fmt, streamingInfo.SampleRate,
                                                       TimeSpan.FromMilliseconds(streamingInfo.StreamingTime), TimeSpan.FromMilliseconds(streamingInfo.AcquisitionTime));

            playback.FrameLength = int.Parse(metroTextBox_frameLength.Text);
            playbackBuffer       = new double[channelCount, playback.FrameLength];
            measurementBuffer    = new double[playback.FrameLength];

            metroButton_stopPlay.Enabled     = true;
            metroButton_startPlay.Enabled    = true;
            metroButton_open.Enabled         = false;
            trackBar1.Enabled                = true;
            metroTextBox_frameLength.Enabled = false;

            //设置tarckBar最大值为文件长度总时间,以毫秒为单位
            trackBar1.Maximum = streamingInfo.AcquisitionTime;
            trackBar1.Value   = 0;
            metroLabel_frameTimeStamp.Text = @"00:00:00:000000";

            if (aitask == null)
            {
                aitask = new JYPXIE69848HAITask(0);
            }
            dataGridView1.Columns.Clear();
            dataGridView1.Rows.Clear();
            timer2FistRun = true;
            rowNumber     = 0;
        }
예제 #2
0
 public JYPXIE69848H(int boardNum)
 {
     aitask        = new JYPXIE69848HAITask(boardNum);
     NumOfChannels = 2;
 }