internal PlotWindow(WaveController c) { this.c = c; isCanal = c is CanalWaveController; viewModel = new PlotWindowModel(); if (c is CanalWaveController) { viewModel.DrawCanal(); } t = new Thread(ThreadStart); DataContext = viewModel; InitializeComponent(); drawImage.InvalidateVisual(); plot.Controller = new PlotController(); plot.Controller.UnbindMouseDown(OxyMouseButton.Left); while (!c.IsDrawingAvaliable) { } currentTime = 0; tBox.Text = "0"; }
private void LabsList_SelectionChanged(object sender, SelectionChangedEventArgs e) { if (c != null) { while (!c.IsDrawingAvaliable) { ; } } switch (labsList.SelectedIndex) { case 0: Settings.InitX0From = -10; Settings.InitX0To = 10; c = new PlaneWaveController(); kBlock.Text = "k ="; aBlock.Text = "a ="; sigmaBlock.Visibility = Visibility.Visible; sigmaBox.Visibility = Visibility.Visible; kBox.Text = Settings.k.ToString(Settings.Format); aBox.Text = Settings.a.ToString(Settings.Format); break; case 1: Settings.InitX0From = -10; Settings.InitX0To = 10; c = new ProgressiveWaveController(); kBlock.Text = "k ="; aBlock.Text = "a ="; sigmaBlock.Visibility = Visibility.Visible; sigmaBox.Visibility = Visibility.Visible; kBox.Text = Settings.k.ToString(Settings.Format); aBox.Text = Settings.a.ToString(Settings.Format); break; case 2: Settings.InitX0From = 0; Settings.InitX0To = Settings.Canal.delta; c = new CanalWaveController(); kBlock.Text = "h ="; aBlock.Text = "δ ="; sigmaBlock.Visibility = Visibility.Hidden; sigmaBox.Visibility = Visibility.Hidden; kBox.Text = Settings.Canal.h.ToString(Settings.Format); aBox.Text = Settings.Canal.delta.ToString(Settings.Format); break; case 3: Settings.InitX0From = -10; Settings.InitX0To = 10; c = new WaveGroupController(); kBlock.Text = "k ="; aBlock.Text = "a ="; sigmaBlock.Visibility = Visibility.Visible; sigmaBox.Visibility = Visibility.Visible; kBox.Text = Settings.k.ToString(Settings.Format); aBox.Text = Settings.a.ToString(Settings.Format); break; case 4: Settings.InitX0From = -20; Settings.InitX0To = 20; c = new DecayingWaveController(); kBlock.Text = "k ="; aBlock.Text = "a ="; sigmaBlock.Visibility = Visibility.Visible; sigmaBox.Visibility = Visibility.Visible; kBox.Text = Settings.k.ToString(Settings.Format); aBox.Text = Settings.a.ToString(Settings.Format); break; } datagrid.ItemsSource = c.WavePointsFixedX; }