コード例 #1
0
ファイル: MainWindow.xaml.cs プロジェクト: JoostZ/ShowRow
 private void PlayButton_Click(object sender, RoutedEventArgs e)
 {
     Animator = new Animation(TheData, rower1);
     Animator.BeginAnimation(canvas1);
     Animator.SetSpeedRatio(canvas1, speedSlider.Value);
     Paused = false;
 }
コード例 #2
0
ファイル: Profiler.cs プロジェクト: JoostZ/ShowRow
        public Profiler(AllData data, Canvas canvas, Rower rower)
        {
            Canvas = canvas;
            Data = data;
            Rower = rower;

            canvas.Children.Clear();
            Animator = new Animation(Data, rower, false);

            Polyline pl;

            pl = new Polyline();
            pl.Stroke = Data.ControlParameters[0].Brush;
            canvas.Children.Add(pl);
            driveLines[0] = pl;

            pl = new Polyline();
            pl.Stroke = Data.ControlParameters[1].Brush;
            canvas.Children.Add(pl);
            driveLines[1] = pl;

            pl = new Polyline();
            pl.Stroke = Data.ControlParameters[2].Brush;
            canvas.Children.Add(pl);
            driveLines[2] = pl;

            pl = new Polyline();
            pl.Stroke = Brushes.Black;
            canvas.Children.Add(pl);
            driveLines[3] = pl;

            pl = new Polyline();
            pl.Stroke = Data.ControlParameters[0].Brush;
            canvas.Children.Add(pl);
            recoverLines[0] = pl;

            pl = new Polyline();
            pl.Stroke = Data.ControlParameters[1].Brush;
            canvas.Children.Add(pl);
            recoverLines[1] = pl;

            pl = new Polyline();
            pl.Stroke = Data.ControlParameters[2].Brush;
            canvas.Children.Add(pl);
            recoverLines[2] = pl;

            pl = new Polyline();
            pl.Stroke = Brushes.Black;
            canvas.Children.Add(pl);
            recoverLines[3] = pl;

            pl = new Polyline();
            pl.Stroke = Brushes.Black;
            pl.Points.Add(new Point(XNormalize(XMin), YNormalize(0)));
            pl.Points.Add(new Point(XNormalize(XMax), YNormalize(0)));
            canvas.Children.Add(pl);

            Animator.TimeChanged += DoFrameTick;
            Animator.BeginAnimation(Canvas);
            Animator.Pause(Canvas);
            DoFrameTick(null, null);
            Animator.Stop(Canvas);
        }