コード例 #1
0
ファイル: FilterForm.cs プロジェクト: Dfinitski/genesisradio
        public FilterForm(Console c, DSPMode mode, Filter filter, bool subrx)
        {
            //
            // Required for Windows Form Designer support
            //
            console = c;

            if (subrx)
                show_subRX = true;

            this.AutoScaleMode = AutoScaleMode.Inherit;
            // used to initialize all the filter variables
            for (int m = (int)DSPMode.FIRST + 1; m < (int)DSPMode.LAST; m++)
            {
                filter_presets[m] = new FilterPreset();
                filter_presets_subrx[m] = new FilterPreset();

                for (Filter f = Filter.F1; f != Filter.LAST; f++)
                {
                    filter_presets[m].CopyFilter(f, console.filter_presets[m].GetLow(f),
                        console.filter_presets[m].GetHigh(f), console.filter_presets[m].LastFilter,
                        console.filter_presets[m].GetName(f));

                    filter_presets_subrx[m].CopyFilter(f, console.filter_presets_subRX[m].GetLow(f),
                        console.filter_presets_subRX[m].GetHigh(f), console.filter_presets_subRX[m].LastFilter,
                        console.filter_presets_subRX[m].GetName(f));
                }
            }

            InitializeComponent();
            int dpi = (int)this.CreateGraphics().DpiX;

            if (dpi > 96)
            {
                string font_name = this.Font.Name;
                System.Drawing.Font new_font = new System.Drawing.Font(font_name, 6.5f);
                this.Font = new_font;
            }

            if(show_subRX)
                this.Text += " VFOB";
            else
                this.Text += " VFOA";

            Win32.SetWindowPos(this.Handle.ToInt32(),
                -1, this.Left, this.Top, this.Width, this.Height, 0);

            CurrentDSPMode = mode;
            CurrentFilter = filter;
            comboDSPMode.SelectedIndex = 0;
            radFilter1.Checked = true;
        }
コード例 #2
0
ファイル: FilterForm.cs プロジェクト: wa1gon/PowerSDR
		public FilterForm(Console c, FilterPreset[] fp, bool _rx2)
		{
			//
			// Required for Windows Form Designer support
			//
			console = c;
			preset = fp;
			InitializeComponent();
			comboDSPMode.SelectedIndex = 0;	
			radFilter1.Checked = true;
			rx2 = _rx2;
			if(rx2)
			{
				radFilter8.Enabled = false;
				radFilter9.Enabled = false;
				radFilter10.Enabled = false;
			}
            Common.RestoreForm(this, "FilterForm", false);
		}
コード例 #3
0
ファイル: console.cs プロジェクト: Dfinitski/genesisradio
        public void InitFilterPresets(ref FilterPreset[] f_presets, ref FilterPreset[] f_presets_subrx)
        {
            // used to initialize all the filter variables
            for (int m = (int)DSPMode.FIRST + 1; m < (int)DSPMode.LAST; m++)
            {
                f_presets[m] = new FilterPreset();
                f_presets_subrx[m] = new FilterPreset();

                for (Filter f = Filter.F1; f != Filter.LAST; f++)
                {
                    switch (m)
                    {
                        case (int)DSPMode.LSB:
                        case (int)DSPMode.DIGL:
                            switch (f)
                            {
                                case Filter.F1:
                                    f_presets[m].SetFilter(f, -5150, -150, "5.0k");
                                    f_presets_subrx[m].SetFilter(f, -5150, -150, "5.0k");
                                    break;
                                case Filter.F2:
                                    f_presets[m].SetFilter(f, -4550, -150, "4.4k");
                                    f_presets_subrx[m].SetFilter(f, -4550, -150, "4.4k");
                                    break;
                                case Filter.F3:
                                    f_presets[m].SetFilter(f, -3950, -150, "3.8k");
                                    f_presets_subrx[m].SetFilter(f, -3950, -150, "3.8k");
                                    break;
                                case Filter.F4:
                                    f_presets[m].SetFilter(f, -3450, -150, "3.3k");
                                    f_presets_subrx[m].SetFilter(f, -3450, -150, "3.3k");
                                    break;
                                case Filter.F5:
                                    f_presets[m].SetFilter(f, -3050, -150, "2.9k");
                                    f_presets_subrx[m].SetFilter(f, -3050, -150, "2.9k");
                                    break;
                                case Filter.F6:
                                    f_presets[m].SetFilter(f, -2850, -150, "2.7k");
                                    f_presets_subrx[m].SetFilter(f, -2850, -150, "2.7k");
                                    break;
                                case Filter.F7:
                                    f_presets[m].SetFilter(f, -2550, -150, "2.4k");
                                    f_presets_subrx[m].SetFilter(f, -2550, -150, "2.4k");
                                    break;
                                case Filter.F8:
                                    f_presets[m].SetFilter(f, -2250, -150, "2.1k");
                                    f_presets_subrx[m].SetFilter(f, -2250, -150, "2.1k");
                                    break;
                                case Filter.F9:
                                    f_presets[m].SetFilter(f, -1950, -150, "1.8k");
                                    f_presets_subrx[m].SetFilter(f, -1950, -150, "1.8k");
                                    break;
                                case Filter.F10:
                                    f_presets[m].SetFilter(f, -1150, -150, "1.0k");
                                    f_presets_subrx[m].SetFilter(f, -1150, -150, "1.0k");
                                    break;
                                case Filter.VAR1:
                                    f_presets[m].SetFilter(f, -2850, -150, "Var 1");
                                    f_presets_subrx[m].SetFilter(f, -2850, -150, "Var 1");
                                    break;
                                case Filter.VAR2:
                                    f_presets[m].SetFilter(f, -2850, -150, "Var 2");
                                    f_presets_subrx[m].SetFilter(f, -2850, -150, "Var 2");
                                    break;
                            }
                            f_presets[m].LastFilter = Filter.F6;
                            f_presets_subrx[m].LastFilter = Filter.F6;
                            break;
                        case (int)DSPMode.USB:
                        case (int)DSPMode.DIGU:
                            switch (f)
                            {
                                case Filter.F1:
                                    f_presets[m].SetFilter(f, 150, 5150, "5.0k");
                                    f_presets_subrx[m].SetFilter(f, 150, 5150, "5.0k");
                                    break;
                                case Filter.F2:
                                    f_presets[m].SetFilter(f, 150, 4550, "4.4k");
                                    f_presets_subrx[m].SetFilter(f, 150, 4550, "4.4k");
                                    break;
                                case Filter.F3:
                                    f_presets[m].SetFilter(f, 150, 3950, "3.8k");
                                    f_presets_subrx[m].SetFilter(f, 150, 3950, "3.8k");
                                    break;
                                case Filter.F4:
                                    f_presets[m].SetFilter(f, 150, 3450, "3.3k");
                                    f_presets_subrx[m].SetFilter(f, 150, 3450, "3.3k");
                                    break;
                                case Filter.F5:
                                    f_presets[m].SetFilter(f, 150, 3050, "2.9k");
                                    f_presets_subrx[m].SetFilter(f, 150, 3050, "2.9k");
                                    break;
                                case Filter.F6:
                                    f_presets[m].SetFilter(f, 150, 2850, "2.7k");
                                    f_presets_subrx[m].SetFilter(f, 150, 2850, "2.7k");
                                    break;
                                case Filter.F7:
                                    f_presets[m].SetFilter(f, 150, 2550, "2.4k");
                                    f_presets_subrx[m].SetFilter(f, 150, 2550, "2.4k");
                                    break;
                                case Filter.F8:
                                    f_presets[m].SetFilter(f, 150, 2250, "2.1k");
                                    f_presets_subrx[m].SetFilter(f, 150, 2250, "2.1k");
                                    break;
                                case Filter.F9:
                                    f_presets[m].SetFilter(f, 150, 1950, "1.8k");
                                    f_presets_subrx[m].SetFilter(f, 150, 1950, "1.8k");
                                    break;
                                case Filter.F10:
                                    f_presets[m].SetFilter(f, 150, 1150, "1.0k");
                                    f_presets_subrx[m].SetFilter(f, 150, 1150, "1.0k");
                                    break;
                                case Filter.VAR1:
                                    f_presets[m].SetFilter(f, 150, 2850, "Var 1");
                                    f_presets_subrx[m].SetFilter(f, 150, 2850, "Var 1");
                                    break;
                                case Filter.VAR2:
                                    f_presets[m].SetFilter(f, 150, 2850, "Var 2");
                                    f_presets_subrx[m].SetFilter(f, 150, 2850, "Var 2");
                                    break;
                            }
                            f_presets[m].LastFilter = Filter.F6;
                            f_presets_subrx[m].LastFilter = Filter.F6;
                            break;
                        case (int)DSPMode.CWL:
                            switch (f)
                            {
                                case Filter.F1:
                                    f_presets[m].SetFilter(f, -cw_pitch - 500, -cw_pitch + 500, "1.0k");
                                    f_presets_subrx[m].SetFilter(f, -cw_pitch - 500, -cw_pitch + 500, "1.0k");
                                    break;
                                case Filter.F2:
                                    f_presets[m].SetFilter(f, -cw_pitch - 400, -cw_pitch + 400, "800");
                                    f_presets_subrx[m].SetFilter(f, -cw_pitch - 400, -cw_pitch + 400, "800");
                                    break;
                                case Filter.F3:
                                    f_presets[m].SetFilter(f, -cw_pitch - 375, -cw_pitch + 375, "750");
                                    f_presets_subrx[m].SetFilter(f, -cw_pitch - 375, -cw_pitch + 375, "750");
                                    break;
                                case Filter.F4:
                                    f_presets[m].SetFilter(f, -cw_pitch - 300, -cw_pitch + 300, "600");
                                    f_presets_subrx[m].SetFilter(f, -cw_pitch - 300, -cw_pitch + 300, "600");
                                    break;
                                case Filter.F5:
                                    f_presets[m].SetFilter(f, -cw_pitch - 250, -cw_pitch + 250, "500");
                                    f_presets_subrx[m].SetFilter(f, -cw_pitch - 250, -cw_pitch + 250, "500");
                                    break;
                                case Filter.F6:
                                    f_presets[m].SetFilter(f, -cw_pitch - 200, -cw_pitch + 200, "400");
                                    f_presets_subrx[m].SetFilter(f, -cw_pitch - 200, -cw_pitch + 200, "400");
                                    break;
                                case Filter.F7:
                                    f_presets[m].SetFilter(f, -cw_pitch - 125, -cw_pitch + 125, "250");
                                    f_presets_subrx[m].SetFilter(f, -cw_pitch - 125, -cw_pitch + 125, "250");
                                    break;
                                case Filter.F8:
                                    f_presets[m].SetFilter(f, -cw_pitch - 50, -cw_pitch + 50, "100");
                                    f_presets_subrx[m].SetFilter(f, -cw_pitch - 50, -cw_pitch + 50, "100");
                                    break;
                                case Filter.F9:
                                    f_presets[m].SetFilter(f, -cw_pitch - 25, -cw_pitch + 25, "50");
                                    f_presets_subrx[m].SetFilter(f, -cw_pitch - 25, -cw_pitch + 25, "50");
                                    break;
                                case Filter.F10:
                                    f_presets[m].SetFilter(f, -cw_pitch - 13, -cw_pitch + 13, "25");
                                    f_presets_subrx[m].SetFilter(f, -cw_pitch - 13, -cw_pitch + 13, "25");
                                    break;
                                case Filter.VAR1:
                                    f_presets[m].SetFilter(f, -cw_pitch - 250, -cw_pitch + 250, "Var 1");
                                    f_presets_subrx[m].SetFilter(f, -cw_pitch - 250, -cw_pitch + 250, "Var 1");
                                    break;
                                case Filter.VAR2:
                                    f_presets[m].SetFilter(f, -cw_pitch - 250, -cw_pitch + 250, "Var 2");
                                    f_presets_subrx[m].SetFilter(f, -cw_pitch - 250, -cw_pitch + 250, "Var 2");
                                    break;
                            }
                            f_presets[m].LastFilter = Filter.F5;
                            f_presets_subrx[m].LastFilter = Filter.F5;
                            break;
                        case (int)DSPMode.CWU:
                            switch (f)
                            {
                                case Filter.F1:
                                    f_presets[m].SetFilter(f, cw_pitch - 500, cw_pitch + 500, "1.0k");
                                    f_presets_subrx[m].SetFilter(f, cw_pitch - 500, cw_pitch + 500, "1.0k");
                                    break;
                                case Filter.F2:
                                    f_presets[m].SetFilter(f, cw_pitch - 400, cw_pitch + 400, "800");
                                    f_presets_subrx[m].SetFilter(f, cw_pitch - 400, cw_pitch + 400, "800");
                                    break;
                                case Filter.F3:
                                    f_presets[m].SetFilter(f, cw_pitch - 375, cw_pitch + 375, "750");
                                    f_presets_subrx[m].SetFilter(f, cw_pitch - 375, cw_pitch + 375, "750");
                                    break;
                                case Filter.F4:
                                    f_presets[m].SetFilter(f, cw_pitch - 300, cw_pitch + 300, "600");
                                    f_presets_subrx[m].SetFilter(f, cw_pitch - 300, cw_pitch + 300, "600");
                                    break;
                                case Filter.F5:
                                    f_presets[m].SetFilter(f, cw_pitch - 250, cw_pitch + 250, "500");
                                    f_presets_subrx[m].SetFilter(f, cw_pitch - 250, cw_pitch + 250, "500");
                                    break;
                                case Filter.F6:
                                    f_presets[m].SetFilter(f, cw_pitch - 200, cw_pitch + 200, "400");
                                    f_presets_subrx[m].SetFilter(f, cw_pitch - 200, cw_pitch + 200, "400");
                                    break;
                                case Filter.F7:
                                    f_presets[m].SetFilter(f, cw_pitch - 125, cw_pitch + 125, "250");
                                    f_presets_subrx[m].SetFilter(f, cw_pitch - 125, cw_pitch + 125, "250");
                                    break;
                                case Filter.F8:
                                    f_presets[m].SetFilter(f, cw_pitch - 50, cw_pitch + 50, "100");
                                    f_presets_subrx[m].SetFilter(f, cw_pitch - 50, cw_pitch + 50, "100");
                                    break;
                                case Filter.F9:
                                    f_presets[m].SetFilter(f, cw_pitch - 25, cw_pitch + 25, "50");
                                    f_presets_subrx[m].SetFilter(f, cw_pitch - 25, cw_pitch + 25, "50");
                                    break;
                                case Filter.F10:
                                    f_presets[m].SetFilter(f, cw_pitch - 13, cw_pitch + 13, "25");
                                    f_presets_subrx[m].SetFilter(f, cw_pitch - 13, cw_pitch + 13, "25");
                                    break;
                                case Filter.VAR1:
                                    f_presets[m].SetFilter(f, cw_pitch - 250, cw_pitch + 250, "Var 1");
                                    f_presets_subrx[m].SetFilter(f, cw_pitch - 250, cw_pitch + 250, "Var 1");
                                    break;
                                case Filter.VAR2:
                                    f_presets[m].SetFilter(f, cw_pitch - 250, cw_pitch + 250, "Var 2");
                                    f_presets_subrx[m].SetFilter(f, cw_pitch - 250, cw_pitch + 250, "Var 2");
                                    break;
                            }
                            f_presets[m].LastFilter = Filter.F5;
                            f_presets_subrx[m].LastFilter = Filter.F5;
                            break;
                        case (int)DSPMode.AM:
                        case (int)DSPMode.SAM:
                        case (int)DSPMode.FMN:
                        case (int)DSPMode.DSB:
                            switch (f)
                            {
                                case Filter.F1:
                                    f_presets[m].SetFilter(f, -8000, 8000, "16k");
                                    f_presets_subrx[m].SetFilter(f, -8000, 8000, "16k");
                                    break;
                                case Filter.F2:
                                    f_presets[m].SetFilter(f, -6000, 6000, "12k");
                                    f_presets_subrx[m].SetFilter(f, -6000, 6000, "12k");
                                    break;
                                case Filter.F3:
                                    f_presets[m].SetFilter(f, -5000, 5000, "10k");
                                    f_presets_subrx[m].SetFilter(f, -5000, 5000, "10k");
                                    break;
                                case Filter.F4:
                                    f_presets[m].SetFilter(f, -4000, 4000, "8.0k");
                                    f_presets_subrx[m].SetFilter(f, -4000, 4000, "8.0k");
                                    break;
                                case Filter.F5:
                                    f_presets[m].SetFilter(f, -3300, 3300, "6.6k");
                                    f_presets_subrx[m].SetFilter(f, -3300, 3300, "6.6k");
                                    break;
                                case Filter.F6:
                                    f_presets[m].SetFilter(f, -2600, 2600, "5.2k");
                                    f_presets_subrx[m].SetFilter(f, -2600, 2600, "5.2k");
                                    break;
                                case Filter.F7:
                                    f_presets[m].SetFilter(f, -2000, 2000, "4.0k");
                                    f_presets_subrx[m].SetFilter(f, -2000, 2000, "4.0k");
                                    break;
                                case Filter.F8:
                                    f_presets[m].SetFilter(f, -1550, 1550, "3.1k");
                                    f_presets_subrx[m].SetFilter(f, -1550, 1550, "3.1k");
                                    break;
                                case Filter.F9:
                                    f_presets[m].SetFilter(f, -1450, 1450, "2.9k");
                                    f_presets_subrx[m].SetFilter(f, -1450, 1450, "2.9k");
                                    break;
                                case Filter.F10:
                                    f_presets[m].SetFilter(f, -1200, 1200, "2.4k");
                                    f_presets_subrx[m].SetFilter(f, -1200, 1200, "2.4k");
                                    break;
                                case Filter.VAR1:
                                    f_presets[m].SetFilter(f, -3300, 3300, "Var 1");
                                    f_presets_subrx[m].SetFilter(f, -3300, 3300, "Var 1");
                                    break;
                                case Filter.VAR2:
                                    f_presets[m].SetFilter(f, -3300, 3300, "Var 2");
                                    f_presets_subrx[m].SetFilter(f, -3300, 3300, "Var 2");
                                    break;
                            }
                            f_presets[m].LastFilter = Filter.F5;
                            f_presets_subrx[m].LastFilter = Filter.F5;
                            break;
                        case (int)DSPMode.WFM:
                            switch (f)
                            {
                                case Filter.F1:
                                    f_presets[m].SetFilter(f, -90000, 90000, "180k");
                                    f_presets_subrx[m].SetFilter(f, -8000, 8000, "16k");
                                    break;
                                case Filter.F2:
                                    f_presets[m].SetFilter(f, -75000, 75000, "150k");
                                    f_presets_subrx[m].SetFilter(f, -8000, 8000, "16k");
                                    break;
                                case Filter.F3:
                                    f_presets[m].SetFilter(f, -60000, 60000, "120k");
                                    f_presets_subrx[m].SetFilter(f, -6000, 6000, "12k");
                                    break;
                                case Filter.F4:
                                    f_presets[m].SetFilter(f, -50000, 50000, "100k");
                                    f_presets_subrx[m].SetFilter(f, -5000, 5000, "10k");
                                    break;
                                case Filter.F5:
                                    f_presets[m].SetFilter(f, -40000, 40000, "80k");
                                    f_presets_subrx[m].SetFilter(f, -4000, 4000, "8.0k");
                                    break;
                                case Filter.F6:
                                    f_presets[m].SetFilter(f, -30000, 30000, "60k");
                                    f_presets_subrx[m].SetFilter(f, -3300, 3300, "6.6k");
                                    break;
                                case Filter.F7:
                                    f_presets[m].SetFilter(f, -24000, 24000, "48k");
                                    f_presets_subrx[m].SetFilter(f, -2600, 2600, "5.2k");
                                    break;
                                case Filter.F8:
                                    f_presets[m].SetFilter(f, -16000, 16000, "32k");
                                    f_presets_subrx[m].SetFilter(f, -2000, 2000, "4.0k");
                                    break;
                                case Filter.F9:
                                    f_presets[m].SetFilter(f, -12000, 12000, "24k");
                                    f_presets_subrx[m].SetFilter(f, -1550, 1550, "3.1k");
                                    break;
                                case Filter.F10:
                                    f_presets[m].SetFilter(f, -8000, 8000, "16k");
                                    f_presets_subrx[m].SetFilter(f, -1450, 1450, "2.9k");
                                    break;
                                case Filter.VAR1:
                                    f_presets[m].SetFilter(f, -3300, 3300, "Var 1");
                                    f_presets_subrx[m].SetFilter(f, -3300, 3300, "Var 1");
                                    break;
                                case Filter.VAR2:
                                    f_presets[m].SetFilter(f, -3300, 3300, "Var 2");
                                    f_presets_subrx[m].SetFilter(f, -3300, 3300, "Var 2");
                                    break;
                            }
                            f_presets[m].LastFilter = Filter.F5;
                            f_presets_subrx[m].LastFilter = Filter.F5;
                            break;
                        default:
                            f_presets[m].LastFilter = Filter.NONE;
                            f_presets_subrx[m].LastFilter = Filter.NONE;
                            break;
                    }
                }
            }
        }