Beispiel #1
0
        public Keyboard(CWExpert form)
        {
            try
            {
                this.AutoScaleMode = AutoScaleMode.Inherit;
                InitializeComponent();
                rtbKeyboardText.Clear();
                rtbSentText.Clear();
                float dpi = this.CreateGraphics().DpiX;
                float ratio = dpi / 96.0f;
                string font_name = this.Font.Name;
                float size = 8.25f / ratio;
                System.Drawing.Font new_font = new System.Drawing.Font(font_name, size);
                this.Font = new_font;
                MainForm = form;
                GetOptions();
                SetWindowPos(this.Handle.ToInt32(), -1, this.Left, this.Top,
                        this.Width, this.Height, 0);  // on top others
                SetupForm = new KeyboardSetup(this);
                UpdateButtons();

                string msg = CMD1;
                msg = MacroHandler(msg);
                toolTip1.SetToolTip(btn1, msg);
                msg = CMD2;
                msg = MacroHandler(msg);
                toolTip1.SetToolTip(btn2, msg);
                msg = CMD3;
                msg = MacroHandler(msg);
                toolTip1.SetToolTip(btn3, msg);
                msg = CMD4;
                msg = MacroHandler(msg);
                toolTip1.SetToolTip(btn4, msg);
                msg = CMD5;
                msg = MacroHandler(msg);
                toolTip1.SetToolTip(btn5, msg);
                msg = CMD6;
                msg = MacroHandler(msg);
                toolTip1.SetToolTip(btn6, msg);
                msg = CMD7;
                msg = MacroHandler(msg);
                toolTip1.SetToolTip(btn7, msg);
                msg = CMD8;
                msg = MacroHandler(msg);
                toolTip1.SetToolTip(btn8, msg);
            }
            catch (Exception ex)
            {
                Debug.Write(ex.ToString());
            }
        }
Beispiel #2
0
        public LOG(CWExpert c)
        {
            this.AutoScaleMode = AutoScaleMode.Inherit;
            InitializeComponent();
            float dpi = this.CreateGraphics().DpiX;
            float ratio = dpi / 96.0f;
            string font_name = this.Font.Name;
            float size = 8.25f / ratio;
            System.Drawing.Font new_font = new System.Drawing.Font(font_name, size);
            this.Font = new_font;

            MainForm = c;
            RestoreState();
            this.Text = "LOG Book  " + DB.LOGFilePath;
        }
 public LOG_export(CWExpert form)
 {
     this.AutoScaleMode = AutoScaleMode.Inherit;
     InitializeComponent();
     float dpi = this.CreateGraphics().DpiX;
     float ratio = dpi / 96.0f;
     string font_name = this.Font.Name;
     float size = 8.25f / ratio;
     System.Drawing.Font new_font = new System.Drawing.Font(font_name, size);
     this.Font = new_font;
     comboLOGformat.SelectedIndex = 0;
     MainForm = form;
     GetOptions();
     SetWindowPos(this.Handle.ToInt32(), -1, this.Left, this.Top,
         this.Width, this.Height, 0);  // on top others
     SettingsForm = new LOGStnSettings(this);
 }
Beispiel #4
0
 public IQBalancer(CWExpert form)
 {
     makewindow(2048, ref window);
     fft = new Fourier();
     fftPtr = new ComplexF[4096];
     spectrumPtr = new float[4096];
     zero = new ComplexF[2048];
     MainForm = form;
     iqfix.phase = 0.0f;
     iqfix.gain = 1.0f;
     iqfix.mu = 0.0f;
     iqfix.leakage = 0.000000f;
     iqfix.MASK = 2047;
     iqfix.index = 0;
     iqfix.w = new ComplexF[2048];
     iqfix.b = new ComplexF[2048];
     iqfix.y = new ComplexF[2048];
     iqfix.del = new ComplexF[2048];
     Reset(FFTBins);
 }
        public DXClusterClient(CWExpert ptr, string host, string call, string name, string qth)
        {
            MainWindow = ptr;
            this.AutoScaleMode = AutoScaleMode.Inherit;
            InitializeComponent();
            float dpi = this.CreateGraphics().DpiX;
            float ratio = dpi / 96.0f;
            string font_name = this.Font.Name;
            float size = 8.25f / ratio;
            System.Drawing.Font new_font = new System.Drawing.Font(font_name, size);
            this.Font = new_font;

            telnet_client = new TelnetClient(this);
            CALL = call;
            HOST = host;
            NAME = name;
            QTH = qth;
            GetOptions();
            ClusterSetupForm = new ClusterSetup(this);

            if (comboDXCluster.Items.Count > 0)
                comboDXCluster.SelectedIndex = 0;
        }
Beispiel #6
0
 public Recorder(CWExpert form)
 {
     try
     {
         this.AutoScaleMode = AutoScaleMode.Inherit;
         InitializeComponent();
         float dpi = this.CreateGraphics().DpiX;
         float ratio = dpi / 96.0f;
         string font_name = this.Font.Name;
         float size = 8.25f / ratio;
         System.Drawing.Font new_font = new System.Drawing.Font(font_name, size);
         this.Font = new_font;
         MainForm = form;
         GetOptions();
         SetWindowPos(this.Handle.ToInt32(), -1, this.Left, this.Top,
                 this.Width, this.Height, 0);  // on top others
         RecorderSetupForm = new RecorderSetup(this);
     }
     catch (Exception ex)
     {
         Debug.Write(ex.ToString());
     }
 }
Beispiel #7
0
        public CWEncode(CWExpert main_form)
        {
            MainForm = main_form;
            KeyerInit(MainForm.SetupForm.chkG59Iambic.Checked, (float)MainForm.SetupForm.udCWSpeed.Value);
            //TONE_SIZE = 48 * TONE_DELAY * Audio.SampleRate / 48000;
            time_base = 1200;
            wpm = cw_speed;
            ctime = time_base / wpm;                // dit time
            dottime = ctime / TONE_DELAY;
            dashtime = dottime * 3;
            Transmiter.osc.gen.Frequency = 0.0;
            Transmiter.cwt.osc.phase = 0.0;
            Transmiter.cwt.mon_osc.phase = 0.0;
            Transmiter.cwt.sr = Audio.SampleRate;
            Transmiter.cwt.osc.gen.Frequency = (TWOPI * tx_if_shift) / Transmiter.cwt.sr;
            Transmiter.cwt.mon_osc.gen.Frequency = (TWOPI * mon_frequency) / Transmiter.cwt.sr;
            MainForm.output_ring_buf.Restart();
            MainForm.mon_ring_buf.Restart();
            Transmiter = new tx();
            CreateTransmiter();
            zero_buffer = new ComplexF[2048];
            iq_buffer = new ComplexF[2048];
            mon_iq_buffer = new ComplexF[2048];
            cs_audio = (void*)0x0;
            cs_audio = NewCriticalSection();

            if (InitializeCriticalSectionAndSpinCount(cs_audio, 0x00000080) == 0)
            {
                MessageBox.Show("CriticalSection Failed", "Error!");
            }
        }
Beispiel #8
0
 public CWDecode(CWExpert mainForm)
 {
     try
     {
         MainForm = mainForm;
         display_timer = new HiPerfTimer();
         audio_buffer_l = new float[2048];
         audio_buffer_r = new float[2048];
         fft_buff_ch5 = new float[2048];
         fft_buff_ch6 = new float[2048];
         AudioEvent1 = new AutoResetEvent(false);
         AudioEvent2 = new AutoResetEvent(false);
         once = true;
         audio_buffer = new float[2048];
     }
     catch (Exception ex)
     {
         MessageBox.Show(ex.ToString());
     }
 }
Beispiel #9
0
        public RTTY(CWExpert form)
        {
            MainForm = form;
            output_ch1 = new string(' ', 1);
            output_ch2 = new string(' ', 1);
            AudioEventRX1 = new AutoResetEvent(false);
            AudioEventRX2 = new AutoResetEvent(false);
            iq_buffer = new ComplexF[2048];
            ch1_buffer = new float[2048];
            ch2_buffer = new float[2048];
            ch3_buffer = new float[2048];
            ch4_buffer = new float[2048];
            ch1_buf = new float[2048];
            ch2_buf = new float[2048];
            ch3_buf = new float[2048];
            ch4_buf = new float[2048];
            Mag_mark = new float[2, 2048];
            Mag_space = new float[2, 2048];
            display_timer = new HiPerfTimer();
            trx = new TRX();
            trx.modem = new rtty[MODEM_NR];

            cs_audio = (void*)0x0;
            cs_audio = NewCriticalSection();

            if (InitializeCriticalSectionAndSpinCount(cs_audio, 0x00000080) == 0)
            {
                MessageBox.Show("CriticalSection Failed", "Error!");
            }

            for (int i = 0; i < 2048; i++)
            {
                zero_buffer[i].Re = 0.0f;
                zero_buffer[i].Im = 0.0f;
            }
        }
Beispiel #10
0
        public static bool Init(CWExpert form)
        {
            try
            {
                MainForm = form;
                IsInitialized = false;
                Audio.ScopeDisplayWidth = W;

                if (waterfall_bmp != null)
                    waterfall_bmp.Dispose();

                waterfall_bmp = new Bitmap(W, H, PixelFormat.Format24bppRgb);	// initialize waterfall display
                average_buffer = new float[BUFFER_SIZE];	// initialize averaging buffer array
                average_buffer[0] = CLEAR_FLAG;		// set the clear flag
                average_waterfall_buffer = new float[BUFFER_SIZE];	// initialize averaging buffer array
                average_waterfall_buffer[0] = CLEAR_FLAG;		// set the clear flag
                new_display_data = new float[BUFFER_SIZE];
                new_waterfall_data = new float[BUFFER_SIZE];
                current_display_data = new float[BUFFER_SIZE];
                current_waterfall_data = new float[BUFFER_SIZE];
                waterfall_display_data = new float[BUFFER_SIZE];
                scope_min = new float[W];
                scope_max = new float[W];

                for (int i = 0; i < BUFFER_SIZE; i++)
                {
                    new_display_data[i] = -200.0f;
                    new_waterfall_data[i] = -200.0f;
                    current_display_data[i] = -200.0f;
                    current_waterfall_data[i] = -200.0f;
                    waterfall_display_data[i] = -200.0f;
                }

                IsInitialized = true;
                return true;
            }
            catch (Exception ex)
            {
                Debug.Write(ex.ToString());
                IsInitialized = false;
                return false;
            }
        }
Beispiel #11
0
        public Setup(CWExpert main_form)
        {
            this.AutoScaleMode = AutoScaleMode.Inherit;
            InitializeComponent();
            float dpi = this.CreateGraphics().DpiX;
            float ratio = dpi / 96.0f;
            string font_name = this.Font.Name;
            float size = 8.25f / ratio;
            System.Drawing.Font new_font = new System.Drawing.Font(font_name, size);
            this.Font = new_font;
            tbRTTYCarrierShift.Enabled = false;
            lblRTTYshift.Enabled = false;
            MainForm = main_form;
            MainForm.VideoDriver = DisplayDriver.GDI;
            comboRadioModel.Text = "Genesis G59";
            InitAudio();
            GetOptions();

            EventArgs e = EventArgs.Empty;

            chkSDRmode_CheckedChanged(this, e);
            chkRX2_CheckedChanged(this, e);
            chkPTTinv_CheckedChanged(this, e);
            chkRXOnly_CheckedChanged(this, e);
            chkPA10_CheckedChanged(this, e);
            udDisplayCalOffset_ValueChanged(this, e);
            udSmeterCalOffset_ValueChanged(this, e);
            udRTTYTXPreamble_ValueChanged(this, e);
            comboRTTYBaudRate_SelectedIndexChanged(this, e);
            comboRTTYBits_SelectedIndexChanged(this, e);
            comboRTTYParity_SelectedIndexChanged(this, e);
            comboRTTYStopBits_SelectedIndexChanged(this, e);
            udRTTYCarrierShift_SelectedIndexChanged(this, e);
            chkRX2_CheckedChanged(this, e);
            chkWaterfallReverse_CheckedChanged(this, EventArgs.Empty);
            radIQFixed_CheckedChanged(this, EventArgs.Empty);
            radIQBalanced_CheckedChanged(this, EventArgs.Empty);

            #if(DirectX)
            DX.WaterfallHighThreshold = (int)udDisplayHigh.Value;
            DX.WaterfallLowThreshold = (int)udDisplayLow.Value;
            #endif
            Display_GDI.WaterfallHighThreshold = (int)udDisplayHigh.Value;
            Display_GDI.WaterfallLowThreshold = (int)udDisplayLow.Value;

            int samples = (int)((double)udScopeTime.Value * Audio.SampleRate / 10000.0);
            Audio.ScopeSamplesPerPixel = samples;
        }
Beispiel #12
0
        public PSK(CWExpert form)
        {
            MainForm = form;
            AudioEvent1 = new AutoResetEvent(false);
            AudioEvent2 = new AutoResetEvent(false);
            iq_buffer = new ComplexF[2048];
            ch1_buffer = new float[2048];
            ch2_buffer = new float[2048];
            buffer_ch1 = new float[2048];
            buffer_ch2 = new float[2048];
            display_timer = new HiPerfTimer();
            trx = new TRX();
            trx.modem = new psk[MODEM_NR];
            trx.outbuf = new ComplexF[819];
            trx.outbuf1 = new ComplexF[8192];
            trx.mon_outbuf = new ComplexF[8192];
            iq_balancer = new IQBalancer(form);

            cs_audio = (void*)0x0;
            cs_audio = NewCriticalSection();

            if (InitializeCriticalSectionAndSpinCount(cs_audio, 0x00000080) == 0)
            {
                Debug.WriteLine("CriticalSection Failed");
            }

            fft = new Fourier();
        }