private void ButtonCalc_Click(object sender, RoutedEventArgs e)
        {
            CalculationResult result = c.calculate(state.F1, state.GetPrescaler(), state.Delta, state.DeltaWidth);

            DataGridElement.applyResult(result);
            state.CalculationChanged();
        }
Exemple #2
0
        public void Draw()
        {
            width  = canvas.ActualWidth;
            height = canvas.ActualHeight;

            periodsCount = state.GetPrescaler();
            if (periodsCount > 16)
            {
                periodsToDraw = 16;
            }
            else
            {
                periodsToDraw = periodsCount;
            }

            f1Width     = width / periodsToDraw;
            heightList  = new int[(int)width + 1];
            axisXOffset = (height - sawHeight) / 2;

            canvas.Children.Clear();

            drawBackground();

            drawSaw();

            drawSineF2();

            drawSineF1();


            lineBreak.Stroke          = Brushes.Red;
            lineBreak.StrokeThickness = 2;
            lineBreak.Y1 = 0;
            lineBreak.Y2 = height;

            canvas.Children.Add(lineBreak);
        }