private void FileOpen_Click(object sender, RoutedEventArgs e) { WF.OpenFileDialog openFile = new WF.OpenFileDialog(); openFile.Filter = @"CSV文件(*.csv)|*.csv"; if (openFile.ShowDialog() == WF.DialogResult.OK) { pressureInfo = new PressureInfo(openFile.FileName); pressureInfo.GetPressure(); pressureInfo.GetMaxValue(out mArea, out mPressure, out mMaxPressure); label1.Content = "帧数:" + pressureInfo.allFrames.Count.ToString() + ",步数:" + pressureInfo.backFrames.Count.ToString(); canvas1.Children.Clear(); canvas3.Children.Clear(); canvas4.Children.Clear(); UnFillPixelGrid(); timer.Stop(); currentFrame = 0; int frameCount = pressureInfo.allFrames.Count - 1; axisWidth = ((frameCount % 5 == 0) ? frameCount : ((frameCount / 5 + 1) * 5)) * 6; DrawAxis(axisWidth); //DrawPixelGrid(); FillPixelGrid(0); DrawPressureCurve(type); } }