Esempio n. 1
0
        private void correrAlgoritmosModulation()
        {
            Graficos g = new Graficos(panelGrafismoModulation.CreateGraphics());

            panelGrafismoModulation.Refresh();

            if (textBoxCodigoBinario.TextLength <= 0)
            {
                MessageBox.Show("tens que inserir um código binário!", "Ooops!", MessageBoxButtons.OK, MessageBoxIcon.Error);
                panelGrafismoModulation.Refresh();
                g.desenharQuadro();
                return;
            }

            if (radioButtonAmplitudeShiftKeying.Checked)
            {
                Modulation.aplicarAmplitudeShiftKeying(textBoxCodigoBinario.Text, g, Convert.ToDouble(hScrollBarFrequencia.Value), Convert.ToDouble(hScrollBarAmplitude.Value), hScrollBarTempo.Value);
            }
            else if (radioButtonFrequencyShiftKeying.Checked)
            {
                Modulation.aplicarFrequencyShiftKeying(textBoxCodigoBinario.Text, g, Convert.ToDouble(hScrollBarFrequencia.Value), Convert.ToDouble(hScrollBarAmplitude.Value), hScrollBarTempo.Value, Convert.ToDouble(hScrollBarFrequencia2.Value));
            }
            else if (radioButtonPhaseShiftKeying.Checked)
            {
                Modulation.aplicarPhaseShiftKeying(textBoxCodigoBinario.Text, g, Convert.ToDouble(hScrollBarFrequencia.Value), Convert.ToDouble(hScrollBarAmplitude.Value), hScrollBarTempo.Value);
            }
        }
Esempio n. 2
0
        private void hScrollBarFrequencia2_ValueChanged(object sender, EventArgs e)
        {
            this.labelValorFrequencia2.Text = Convert.ToString(this.hScrollBarFrequencia2.Value) + " hz";

            if (radioButtonFrequencyShiftKeying.Checked)
            {
                Graficos g = new Graficos(panelGrafismoModulation.CreateGraphics());
                panelGrafismoModulation.Refresh();

                Modulation.aplicarFrequencyShiftKeying(textBoxCodigoBinario.Text, g, Convert.ToDouble(hScrollBarFrequencia.Value), Convert.ToDouble(hScrollBarAmplitude.Value), hScrollBarTempo.Value, Convert.ToDouble(hScrollBarFrequencia2.Value));
            }
        }