Beispiel #1
0
        private void Ok_Click(object sender, RoutedEventArgs e)
        {
            switch (circuitType)
            {
            case CircuitTypes.Parallel:
                ParallelCircuitWindow ParallelMainWindow = (ParallelCircuitWindow)this.Owner;
                SetParameters(ParallelMainWindow);
                this.Close();
                break;

            case CircuitTypes.Series:
                SeriesCircuitWindow seriesMainWindow = (SeriesCircuitWindow)this.Owner;
                SetParameters(seriesMainWindow);
                this.Close();
                break;

            case CircuitTypes.Custom:
                CustomCircuit customMainWindow = (CustomCircuit)this.Owner;
                SetParameters(customMainWindow);
                if (isCorrectAmplitude && isCorrectFrequency && isCorrectPhase)
                {
                    customMainWindow.circuit.power         = voltage;
                    customMainWindow.voltage_label.Content = voltage.getValue();
                    this.Close();
                }
                else
                {
                    if (!isCorrectAmplitude)
                    {
                        error_amplitude.Text = "Неккооректное значение";
                    }
                    if (!isCorrectFrequency)
                    {
                        error_frequency.Text = "Неккооректное значение";
                    }
                    if (!isCorrectPhase)
                    {
                        error_phase.Text = "Неккооректное значение";
                    }
                }
                this.Close();
                break;
            }
        }
Beispiel #2
0
 private void SetParameters(SeriesCircuitWindow mainWindow)
 {
 }