Exemplo n.º 1
0
        public CWKeyer2(Console c)
        {
            console = c;
            hw = console.Hdw;
            siolisten = console.Siolisten;
            Thread.Sleep(50);
            DttSP.NewKeyer(600.0f, true, 0.0f, 3.0f, 25.0f, (float)Audio.SampleRate1);
            RadioDSP.KeyerIambicMode = 0;
            Thread.Sleep(50);

            CWTone = new Thread(new ThreadStart(DttSP.KeyerSoundThread));
            CWTone.Name = "CW Sound Thread";
            CWTone.Priority = ThreadPriority.Highest;
            CWTone.IsBackground = true;

            CWTone.Start();

            Keyer  = new Thread(new ThreadStart(KeyThread));
            Keyer.Name = "CW KeyThread";
            Keyer.Priority = ThreadPriority.Highest;
            Keyer.IsBackground = true;
            Keyer.Start();

            timer = new HiPerfTimer();
        }
Exemplo n.º 2
0
        public CWKeyer2(Console c)
        {
            console = c;
            if (console.CurrentModel == Model.SDR1000)
            {
                hw = console.Hdw;
            }
            siolisten = console.Siolisten;
            Thread.Sleep(50);
            DttSP.NewKeyer(600.0f, true, 0.0f, 3.0f, 25.0f, (float)Audio.SampleRate1);
            RadioDSP.KeyerIambicMode = 0;
            Thread.Sleep(50);

            threads_running = true;

            cw_tone_thread              = new Thread(new ThreadStart(DttSP.KeyerSoundThread));
            cw_tone_thread.Name         = "CW Sound Thread";
            cw_tone_thread.Priority     = ThreadPriority.Highest;
            cw_tone_thread.IsBackground = true;

            cw_tone_thread.Start();


            keyer_thread              = new Thread(new ThreadStart(KeyThread));
            keyer_thread.Name         = "CW KeyThread";
            keyer_thread.Priority     = ThreadPriority.Highest;
            keyer_thread.IsBackground = true;
            keyer_thread.Start();

            timer = new HiPerfTimer();
        }
Exemplo n.º 3
0
        public static byte SendCommand(HW hw, byte cmd)
        {
            for (int i = 0; i < 8; i++)
            {
#if (DEBUG_VERBOSE)
                Debug.WriteLine("Sending Bit " + (7 - i));
#endif
                if (!SendBit(hw, (cmd >> (7 - i)) & 1))
                {
                    return(0x55);
                }
            }

            byte retval = 0xFF;

            if (cmd == (byte)CMD.READ_STATUS)
            {
                retval = 0;

                for (int i = 0; i < 8; i++)
                {
#if (DEBUG_VERBOSE)
                    Debug.WriteLine("Receiving Bit " + (7 - i));
#endif
                    byte b = ReceiveBit(hw);
                    if (b > 1)
                    {
                        return(0x55);
                    }
                    retval = (byte)((retval << 1) + b);
                }
            }

            return(retval);
        }
Exemplo n.º 4
0
        public CWKeyer2(Console c)
        {
            console   = c;
            hw        = console.Hdw;
            siolisten = console.Siolisten;
            Thread.Sleep(50);
            DttSP.NewKeyer(600.0f, true, 0.0f, 3.0f, 25.0f, (float)Audio.SampleRate1);
            RadioDSP.KeyerIambicMode = 0;
            Thread.Sleep(50);


            CWTone              = new Thread(new ThreadStart(DttSP.KeyerSoundThread));
            CWTone.Name         = "CW Sound Thread";
            CWTone.Priority     = ThreadPriority.Highest;
            CWTone.IsBackground = true;

            CWTone.Start();


            Keyer              = new Thread(new ThreadStart(KeyThread));
            Keyer.Name         = "CW KeyThread";
            Keyer.Priority     = ThreadPriority.Highest;
            Keyer.IsBackground = true;
            Keyer.Start();

            timer = new HiPerfTimer();
        }
Exemplo n.º 5
0
        private static byte ReceiveBit(HW hw)
        {
            int count = 0;

            // take X2-5 high
            hw.X2 |= 1 << 4;

            // wait for pin 12 to go high
            while ((hw.StatusPort() & (byte)StatusPin.PIN_12) == 0)
            {
                if (count++ > TIME_OUT_COUNT)
                {
                    MessageBox.Show("Error receiving bit from UCB.",
                                    "UCB Error",
                                    MessageBoxButtons.OK,
                                    MessageBoxIcon.Error);
                    return(2);
                }
                Thread.Sleep(1);
            }

            // set X2-5 low
            hw.X2 &= 0xEF;
            Thread.Sleep(new TimeSpan(receive_bit_delay1));

            byte retval = 0;

            if ((hw.StatusPort() & (byte)StatusPin.PIN_12) != 0)
            {
                retval = 1;
            }

            Thread.Sleep(receive_bit_delay2);
            return(retval);
        }
Exemplo n.º 6
0
        /// <summary>
        /// Sends a single bit to the UCB
        /// </summary>
        /// <param name="hw">A hardware control object.</param>
        /// <param name="val">An integer representing a 0 or a 1.
        /// (Anything other than 0 is considered a 1)</param>
        private static bool SendBit(HW hw, int val)
        {
            int count = 0;

            // take X2-5 high
            hw.X2 |= 0x10;

            // wait for pin 12 to go high
            while ((hw.StatusPort() & (byte)StatusPin.PIN_12) == 0)
            {
                if (count++ > TIME_OUT_COUNT)
                {
                    MessageBox.Show("Error sending bit to UCB (1).",
                                    "UCB Error",
                                    MessageBoxButtons.OK,
                                    MessageBoxIcon.Error);
                    return(false);
                }
                Thread.Sleep(1);
            }

            // set X2-5 for data bit
            if (val == 0)
            {
                hw.X2 &= 0xEF;
            }
            count = 0;
            if ((hw.StatusPort() & (byte)StatusPin.PIN_12) == 0)
            {
                MessageBox.Show("Error sending bit to UCB (2).",
                                "UCB Error",
                                MessageBoxButtons.OK,
                                MessageBoxIcon.Error);
                return(false);
            }

            // wait until pin 12 goes back low
            count = 0;
            while ((hw.StatusPort() & (byte)StatusPin.PIN_12) != 0)
            {
                if (count++ > TIME_OUT_COUNT)
                {
                    MessageBox.Show("Error sending bit to UCB (3).",
                                    "UCB Error",
                                    MessageBoxButtons.OK,
                                    MessageBoxIcon.Error);
                    return(false);
                }
                Thread.Sleep(1);
            }
            //Thread.Sleep(new TimeSpan(send_bit_delay1));

            // set X2-5 back low
            hw.X2 &= 0xEF;

            Thread.Sleep(new TimeSpan(send_bit_delay2));
            return(true);
        }
Exemplo n.º 7
0
 public static void WriteReg(HW hw, byte reg, int val)
 {
     if (SendCommand(hw, (byte)(0xA0 + (0x0F & reg))) == 0x55)
     {
         return;
     }
     if (SendCommand(hw, (byte)(val >> 8)) == 0x55)
     {
         return;
     }
     if (SendCommand(hw, (byte)(val & 0x00FF)) == 0x55)
     {
         return;
     }
     ;
 }
Exemplo n.º 8
0
		/// <summary>
		/// Sends a single bit to the UCB
		/// </summary>
		/// <param name="hw">A hardware control object.</param>
		/// <param name="val">An integer representing a 0 or a 1.
		/// (Anything other than 0 is considered a 1)</param>
		private static bool SendBit(HW hw, int val)
		{
			int count = 0;

			// take X2-5 high
			hw.X2 |= 0x10;
	
			// wait for pin 12 to go high
			while((hw.StatusPort() & (byte)StatusPin.PIN_12) == 0)
			{
				if(count++ > TIME_OUT_COUNT)
				{
					MessageBox.Show("Error sending bit to UCB (1).",
						"UCB Error",
						MessageBoxButtons.OK,
						MessageBoxIcon.Error);
					return false;
				}
				Thread.Sleep(1);				
			}

			// set X2-5 for data bit
			if(val == 0) hw.X2 &= 0xEF;
			count = 0;
			if((hw.StatusPort() & (byte)StatusPin.PIN_12) == 0)
			{
				MessageBox.Show("Error sending bit to UCB (2).",
					"UCB Error",
					MessageBoxButtons.OK,
					MessageBoxIcon.Error);
				return false;
			}

			// wait until pin 12 goes back low
			count = 0;
			while((hw.StatusPort() & (byte)StatusPin.PIN_12) != 0)
			{
				if(count++ > TIME_OUT_COUNT)
				{
					MessageBox.Show("Error sending bit to UCB (3).",
						"UCB Error",
						MessageBoxButtons.OK,
						MessageBoxIcon.Error);
					return false;
				}
				Thread.Sleep(1);
			}
			//Thread.Sleep(new TimeSpan(send_bit_delay1));

			// set X2-5 back low
			hw.X2 &= 0xEF;

			Thread.Sleep(new TimeSpan(send_bit_delay2));
			return true;
		}
Exemplo n.º 9
0
		public static void WriteReg(HW hw, byte reg, int val)
		{
			if(SendCommand(hw, (byte)(0xA0 + (0x0F&reg))) == 0x55) return;
			if(SendCommand(hw, (byte)(val >> 8)) == 0x55) return;
			if(SendCommand(hw, (byte)(val & 0x00FF)) == 0x55) return;;
		}
Exemplo n.º 10
0
 public static byte SendCommand(HW hw, CMD cmd)
 {
     return(SendCommand(hw, (byte)cmd));
 }
Exemplo n.º 11
0
		public UCBForm(Console c)
		{
			//
			// Required for Windows Form Designer support
			//
			InitializeComponent();
			console = c;
			hw = console.Hdw;
			comboDelay.SelectedIndex = 0;
			Common.RestoreForm(this, "UCB", false);

			switch(console.CurrentModel)
			{
				case Model.FLEX3000:
				case Model.FLEX5000:
                case Model.FLEX1500:
                    btnEnable.Visible = false;
                    btnDisable.Visible = false;
                    lblDelay.Visible = false;
                    comboDelay.Visible = false;
                    btnSetDelay.Visible = false;
                    btnDisableClear.Visible = false;
                    btnWriteAll.Visible = false;
                    btnWriteLine0.Visible = false;
                    btnWriteLine1.Visible = false;
                    btnWriteLine2.Visible = false;
                    btnWriteLine3.Visible = false;
                    btnWriteLine4.Visible = false;
                    btnWriteLine5.Visible = false;
                    btnWriteLine6.Visible = false;
                    btnWriteLine7.Visible = false;
                    btnWriteLine8.Visible = false;
                    btnWriteLine9.Visible = false;
                    btnWriteLine10.Visible = false;
                    btnWriteLine11.Visible = false;
                    btnWriteLine12.Visible = false;
                    btnWriteLine13.Visible = false;
                    btnWriteLine14.Visible = false;
                    btnWriteLine15.Visible = false;
					break;
				default:
					chkFlexWire.Visible = false;
					break;
			}

//			Thread t = new Thread(new ThreadStart(KeepAlive));
//			t.IsBackground = true;
//			t.Name = "UCB KeepAlive Thread";
//			t.Priority = ThreadPriority.Lowest;
//			t.Start();
		}
Exemplo n.º 12
0
		public static byte SendCommand(HW hw, CMD cmd)
		{
			return SendCommand(hw, (byte)cmd);
		}
Exemplo n.º 13
0
		public CWKeyer2(Console c)
		{
			console = c;
			if(console.CurrentModel == Model.SDR1000)
                hw = console.Hdw;
			siolisten = console.Siolisten;
			Thread.Sleep(50);
			DttSP.NewKeyer(600.0f, true, 0.0f, 3.0f, 25.0f, (float)Audio.SampleRate1);
			RadioDSP.KeyerIambicMode = 0;
			Thread.Sleep(50);

            threads_running = true;

			cw_tone_thread = new Thread(new ThreadStart(DttSP.KeyerSoundThread));
            cw_tone_thread.Name = "CW Sound Thread";
            cw_tone_thread.Priority = ThreadPriority.Highest;
            cw_tone_thread.IsBackground = true;

            cw_tone_thread.Start();
			
			
			keyer_thread  = new Thread(new ThreadStart(KeyThread));
            keyer_thread.Name = "CW KeyThread";
            keyer_thread.Priority = ThreadPriority.Highest;
            keyer_thread.IsBackground = true;
            keyer_thread.Start();

			timer = new HiPerfTimer();			
		}
Exemplo n.º 14
0
        public UCBForm(Console c)
        {
            //
            // Required for Windows Form Designer support
            //
            InitializeComponent();
            console = c;
            hw = console.Hdw;
            comboDelay.SelectedIndex = 0;
            Common.RestoreForm(this, "UCB", false);

            //			Thread t = new Thread(new ThreadStart(KeepAlive));
            //			t.IsBackground = true;
            //			t.Name = "UCB KeepAlive Thread";
            //			t.Priority = ThreadPriority.Lowest;
            //			t.Start();
        }
Exemplo n.º 15
0
		public UCBForm(Console c)
		{
			//
			// Required for Windows Form Designer support
			//
			InitializeComponent();
			console = c;
			hw = console.Hdw;
			comboDelay.SelectedIndex = 0;
			Common.RestoreForm(this, "UCB", false);

			switch(console.CurrentModel)
			{
				case Model.FLEX3000:
				case Model.FLEX5000:
					break;
				default:
					chkFlexWire.Visible = false;
					break;
			}

//			Thread t = new Thread(new ThreadStart(KeepAlive));
//			t.IsBackground = true;
//			t.Name = "UCB KeepAlive Thread";
//			t.Priority = ThreadPriority.Lowest;
//			t.Start();
		}
Exemplo n.º 16
0
		private static byte ReceiveBit(HW hw)
		{
			int count = 0;

			// take X2-5 high
			hw.X2 |= 1<<4;

			// wait for pin 12 to go high
			while((hw.StatusPort() & (byte)StatusPin.PIN_12) == 0)
			{
				if(count++ > TIME_OUT_COUNT)
				{
					MessageBox.Show("Error receiving bit from UCB.",
						"UCB Error",
						MessageBoxButtons.OK,
						MessageBoxIcon.Error);
					return 2;
				}
				Thread.Sleep(1);
			}

			// set X2-5 low
			hw.X2 &= 0xEF;
			Thread.Sleep(new TimeSpan(receive_bit_delay1));

			byte retval = 0;
			if((hw.StatusPort() & (byte)StatusPin.PIN_12) != 0)
				retval = 1;

			Thread.Sleep(receive_bit_delay2);
			return retval;
		}
Exemplo n.º 17
0
		public static void KeepAlive(HW hw)
		{
			SendBit(hw, 0);
		}
Exemplo n.º 18
0
 public static void KeepAlive(HW hw)
 {
     SendBit(hw, 0);
 }
Exemplo n.º 19
0
		public static byte SendCommand(HW hw, byte cmd)
		{
			for(int i=0; i<8; i++)
			{
#if(DEBUG_VERBOSE)
				Debug.WriteLine("Sending Bit "+(7-i));
#endif
				if(!SendBit(hw, (cmd >> (7-i)) & 1))
					return 0x55;
			}

			byte retval = 0xFF;

			if(cmd == (byte)CMD.READ_STATUS)
			{
				retval = 0;

				for(int i=0; i<8; i++)
				{
#if(DEBUG_VERBOSE)
					Debug.WriteLine("Receiving Bit "+(7-i));
#endif				
					byte b = ReceiveBit(hw);
					if(b > 1) return 0x55;
					retval = (byte)((retval << 1) + b);
				}
			}

			return retval;
		}
Exemplo n.º 20
0
        private void InitConsole()
        {
            #if(DEBUG)
            mnuUCB.Visible = true;
            button1.Visible = true;
            #endif
            Thread.Sleep(100);
            UpdateBandStackRegisters();

            Audio.console = this;
            FWCMidi.console = this;
            Display.console = this;

            chkDSPNB2.Enabled = true;

            vfoa_hover_digit = -1;
            vfob_hover_digit = -1;

            rx1_ant_by_band = new FWCAnt[(int)Band.LAST];
            for(int i=0; i<(int)Band.LAST; i++) rx1_ant_by_band[i] = FWCAnt.ANT1;
            rx2_ant_by_band = new FWCAnt[(int)Band.LAST];
            for(int i=0; i<(int)Band.LAST; i++) rx2_ant_by_band[i] = FWCAnt.RX2IN;
            tx_ant_by_band = new FWCAnt[(int)Band.LAST];
            for(int i=0; i<(int)Band.LAST; i++) tx_ant_by_band[i] = FWCAnt.ANT1;
            rx1_loop_by_band = new bool[(int)Band.LAST];
            rx1_preamp_by_band = new PreampMode[(int)Band.LAST];
            for(int i=0; i<(int)Band.LAST; i++) rx1_preamp_by_band[i] = PreampMode.HIGH;
            rx2_preamp_by_band = new PreampMode[(int)Band.LAST];
            for(int i=0; i<(int)Band.LAST; i++) rx2_preamp_by_band[i] = PreampMode.HIGH;
            power_by_band = new int[(int)Band.LAST];
            for(int i=0; i<(int)Band.LAST; i++) power_by_band[i] = 50;
            rx1_agct_by_band = new int[(int)Band.LAST];
            for(int i=0; i<(int)Band.LAST; i++) rx1_agct_by_band[i] = 90;
            rx2_agct_by_band = new int[(int)Band.LAST];
            for(int i=0; i<(int)Band.LAST; i++) rx2_agct_by_band[i] = 90;
            tx1_by_band = new bool[(int)Band.LAST];
            tx2_by_band = new bool[(int)Band.LAST];
            tx3_by_band = new bool[(int)Band.LAST];

            for(int i=0; i<(int)Band.LAST; i++)
                tx1_by_band[i] = tx2_by_band[i] = tx3_by_band[i] = true;

            vhf_text = new ButtonTS[15];
            vhf_text[0] = btnBandVHF0;
            vhf_text[1] = btnBandVHF1;
            vhf_text[2] = btnBandVHF2;
            vhf_text[3] = btnBandVHF3;
            vhf_text[4] = btnBandVHF4;
            vhf_text[5] = btnBandVHF5;
            vhf_text[6] = btnBandVHF6;
            vhf_text[7] = btnBandVHF7;
            vhf_text[8] = btnBandVHF8;
            vhf_text[9] = btnBandVHF9;
            vhf_text[10] = btnBandVHF10;
            vhf_text[11] = btnBandVHF11;
            vhf_text[12] = btnBandVHF12;
            vhf_text[13] = btnBandVHF13;

            power_table = new float[(int)Band.LAST][];
            for(int i=0; i<(int)Band.LAST; i++)
                power_table[i] = new float[13];

            rx1_image_gain_table = new float[(int)Band.LAST];
            rx1_image_phase_table = new float[(int)Band.LAST];
            rx2_image_gain_table = new float[(int)Band.LAST];
            rx2_image_phase_table = new float[(int)Band.LAST];
            tx_image_gain_table = new float[(int)Band.LAST];
            tx_image_phase_table = new float[(int)Band.LAST];

            tx_carrier_table = new int[(int)Band.LAST][];
            for(int i=0; i<(int)Band.LAST; i++)
            {
                tx_carrier_table[i] = new int[4];
                for(int j=0; j<4; j++)
                    tx_carrier_table[i][j] = 128;
            }

            pa_bias_table = new int[4][]; // 4 groups of 8 pot settings
            for(int i=0; i<4; i++)
            {
                pa_bias_table[i] = new int[8];
                for(int j=0; j<8; j++)
                    pa_bias_table[i][j] = 0;
            }

            rx1_level_table = new float[(int)Band.LAST][]; // 3 settings per band (display_offset, preamp, multimeter offset)
            for(int i=0; i<(int)Band.LAST; i++)
            {
                rx1_level_table[i] = new float[3];
                rx1_level_table[i][0] = -59.2f;	// setup defaults;
                rx1_level_table[i][1] = -13.5f;
                rx1_level_table[i][2] = -32.0f;
            }

            rx2_level_table = new float[(int)Band.LAST][]; // 3 settings per band (display_offset, preamp, multimeter offset)
            for(int i=0; i<(int)Band.LAST; i++)
            {
                rx2_level_table[i] = new float[3];
                rx2_level_table[i][0] = -59.2f;	// setup defaults;
                rx2_level_table[i][1] = -13.5f;
                rx2_level_table[i][2] = -32.0f;
            }

            pa_bridge_table = new float[(int)Band.LAST][];
            for(int i=0; i<(int)Band.LAST; i++)
            {
                pa_bridge_table[i] = new float[6]; // 1, 2, 5, 10, 20, 90
                for(int j=0; j<6; j++)
                    pa_bridge_table[i][j] = 0.0f;
            }

            swr_table = new float[(int)Band.LAST];
            for(int i=0; i<(int)Band.LAST; i++)
                swr_table[i] = 1.0f;

            atu_tuning = false;
            tune_power = 10;
            calibrating = false;
            run_setup_wizard = true;

            // get culture specific decimal separator
            separator = CultureInfo.CurrentCulture.NumberFormat.NumberDecimalSeparator;

            last_band = "";						// initialize bandstack

            wheel_tune_list = new double[13];		// initialize wheel tuning list array
            wheel_tune_list[0]  =  0.000001;
            wheel_tune_list[1]  =  0.000010;
            wheel_tune_list[2]  =  0.000050;
            wheel_tune_list[3]  =  0.000100;
            wheel_tune_list[4]  =  0.000250;
            wheel_tune_list[5]  =  0.000500;
            wheel_tune_list[6]  =  0.001000;
            wheel_tune_list[7]  =  0.005000;
            wheel_tune_list[8]  =  0.009000;
            wheel_tune_list[9]  =  0.010000;
            wheel_tune_list[10] =  0.100000;
            wheel_tune_list[11] =  1.000000;
            wheel_tune_list[12] = 10.000000;
            wheel_tune_index = 6;

            meter_text_history = new float[multimeter_text_peak_samples];

            current_meter_data = -200.0f;

            rx1_preamp_offset = new float[4];
            rx1_preamp_offset[(int)PreampMode.OFF] = 10.0f;
            rx1_preamp_offset[(int)PreampMode.LOW] = 0.0f;
            rx1_preamp_offset[(int)PreampMode.MED] = -16.0f;
            rx1_preamp_offset[(int)PreampMode.HIGH] = -26.0f;

            rx2_preamp_offset = new float[4];
            rx2_preamp_offset[(int)PreampMode.OFF] = 0.0f;
            rx2_preamp_offset[(int)PreampMode.HIGH] = 14.0f;

            this.ActiveControl = chkPower;		// Power has focus initially

            Display.Target = picDisplay;
            Display.Init();						// Initialize Display variables
            InitDisplayModes();					// Initialize Display Modes
            InitAGCModes();						// Initialize AGC Modes
            InitMultiMeterModes();				// Initialize MultiMeter Modes
            ProcessSampleThreadController[] pstc = new ProcessSampleThreadController[3];
            audio_process_thread = new Thread[3];
            for (uint proc_thread=0;proc_thread<3;proc_thread++)
            {
                pstc[proc_thread] = new ProcessSampleThreadController(proc_thread);
                audio_process_thread[proc_thread] = new Thread( new ThreadStart(pstc[proc_thread].ProcessSampleThread));
                audio_process_thread[proc_thread].Name = "Audio Process Thread "+proc_thread.ToString();
                audio_process_thread[proc_thread].Priority = ThreadPriority.Highest;
                audio_process_thread[proc_thread].IsBackground = true;
                audio_process_thread[proc_thread].Start();

                /*				DttSP.SetThreadCom(proc_thread);

                                audio_process_thread = new Thread(	// create audio process thread
                                    new ThreadStart(DttSP.ProcessSamplesThread));
                                audio_process_thread.Name = "Audio Process Thread ";
                                audio_process_thread.Priority = ThreadPriority.Highest;
                                audio_process_thread.IsBackground = true;
                                audio_process_thread.Start();
                */
            }

            hw = new HW(0x378);					// create hardware object

            siolisten = new SIOListenerII(this);

            Keyer = new CWKeyer2(this);			// create new Keyer
            //			Keyer.sp.BaudRate = 4800;	//[patch_15]
            EQForm = new EQForm(this);

            InitFilterPresets();					// Initialize filter values

            SetupForm = new Setup(this);		// create Setup form
            SetupForm.StartPosition = FormStartPosition.Manual;

            switch(current_model)
            {
                case Model.SDR1000:
                    Hdw.Init();							// Power down hardware
                    Hdw.StandBy();						// initialize hardware device
                    break;
                    /*case Model.SDRX:
                        if(fwc_init)
                        {
                            byte mask;
                            FWC.GetRXPresentMask(out mask);
                            for(int i=0; i<8; i++)
                            {
                                if((mask>>i & 1) == 1)
                                {
                                    fwc_index = i;
                                    break;
                                }
                            }
                        }
                        break;*/
                case Model.FLEX5000:
                    if(fwc_init)
                        fwcMixForm = new FWCMixForm(this);
                    break;
            }

            //SetupForm.GetTxProfiles();
            UpdateTXProfile(SetupForm.TXProfile);

            Common.RestoreForm(EQForm, "EQForm", false);

            XVTRForm = new XVTRForm(this);

            MemForm = new Memory(this);			// create Memory form
            MemForm.StartPosition = FormStartPosition.Manual;

            WaveForm = new WaveControl(this);	// create Wave form
            WaveForm.StartPosition = FormStartPosition.Manual;

            //rx1_filter = Filter.F2600;

            //RX1AGCMode = AGCMode.MED;				// Initialize front panel controls
            comboPreamp.Text = "High";
            chkRX1Preamp.Checked = true;
            vfob_dsp_mode = DSPMode.LSB;
            vfob_filter = Filter.F3;
            comboDisplayMode.Text = "Panadapter";
            comboRX2DisplayMode.Text = "Panadapter";
            comboMeterRXMode.SelectedIndex = 0;
            comboRX2MeterMode.SelectedIndex = 0;
            comboTuneMode.SelectedIndex = 0;
            quick_save_filter = Filter.F3;
            quick_save_mode = DSPMode.LSB;
            udPWR.Value = 50;
            btnDisplayPanCenter_Click(this, EventArgs.Empty);
            comboTXProfile.Text = SetupForm.TXProfile;
            comboDigTXProfile.Text = SetupForm.TXProfile;

            GetState();							// recall saved state

            chkFullDuplex.Checked = false;
            if(rx1_dsp_mode == DSPMode.FIRST || rx1_dsp_mode == DSPMode.LAST)
                radModeLSB.Checked = true;
            if(rx2_dsp_mode == DSPMode.FIRST || rx2_dsp_mode == DSPMode.LAST)
                radRX2ModeLSB.Checked = true;
            if(rx1_filter == Filter.FIRST || rx1_filter == Filter.LAST ||
                (rx1_filter == Filter.NONE && rx1_dsp_mode != DSPMode.DRM && rx1_dsp_mode != DSPMode.SPEC))
                radFilter3.Checked = true;
            if(rx2_filter == Filter.FIRST || rx2_filter == Filter.LAST ||
                (rx2_filter == Filter.NONE && rx2_dsp_mode != DSPMode.DRM && rx2_dsp_mode != DSPMode.SPEC))
                radRX2Filter3.Checked = true;

            txtVFOAFreq_LostFocus(this, EventArgs.Empty);

            /*			if(fwc_init && current_model == Model.FLEX5000 && !run_setup_wizard)
            {
                CheckFLEX5000CalData();
                if(fwcAntForm != null && !fwcAntForm.IsDisposed)
                {
                    fwcAntForm.SetBand(rx1_band);
                    fwcAntForm.CurrentAntMode = current_ant_mode;
                    fwcAntForm.RX1Ant = rx1_ant;
                    fwcAntForm.RX1Loop = rx1_loop;
                    fwcAntForm.RX2Ant = rx2_ant;
                    fwcAntForm.TXAnt = tx_ant;
                }
                CheckRX2CalData();
                RX1Ant = rx1_ant;
                if(FWCEEPROM.RX2OK) RX2Ant = rx2_ant;
            }
            else PAPresent = pa_present;
            */
            PAPresent = pa_present;
            if(comboAGC.SelectedIndex < 0)
                RX1AGCMode = AGCMode.MED;
            if(comboRX2AGC.SelectedIndex < 0)
                comboRX2AGC.Text = "Med";
            txtVFOBFreq_LostFocus(this, EventArgs.Empty);
            txtVFOAFreq_LostFocus(this, EventArgs.Empty);
            udPWR_ValueChanged(this, EventArgs.Empty);
            udAF_ValueChanged(this, EventArgs.Empty);
            udMIC_ValueChanged(this, EventArgs.Empty);
            RX1PreampMode = rx1_preamp_mode;
            RX2PreampMode = rx2_preamp_mode;
            tbDisplayZoom_Scroll(this, EventArgs.Empty);
            tbRX0Gain_Scroll(this, EventArgs.Empty);
            tbRX1Gain_Scroll(this, EventArgs.Empty);
            tbPanMainRX_Scroll(this, EventArgs.Empty);
            tbPanSubRX_Scroll(this, EventArgs.Empty);
            CalcDisplayFreq();

            wheel_tune_index--;					// Setup wheel tuning
            ChangeWheelTuneLeft();
            UpdateDisplayOffsets();

            SetupForm.initCATandPTTprops();   // wjt added -- get console props setup for cat and ptt
            if ( CmdLineArgs != null )
            {
                for ( int i = 0; i < CmdLineArgs.Length; i++ )
                {
                    switch(CmdLineArgs[i])
                    {
                        case "--disable-swr-prot-at-my-risk":
                            DisableSWRProtection = true;
                            this.Text = this.Text + "  *** SWR Protection Disabled! ***";
                            break;
                        case "--high-pwr-am":
                            Audio.high_pwr_am = true;
                            MessageBox.Show("high power am");
                            break;

                        case "--ignore-pp-ptt":  // ignore parallel port ptt -- simple testing w/o hardware attached
                            Hdw.ignorePTT(true);
                            this.Text = this.Text + " *** PP PTT disabled ***";
                            break;

                            // the next 4 opts are for various experimental HPSDR xmit and receive options

                        case "--force-16bit-IQ":
                            Force16bitIQ = true;
                            this.Text = this.Text + " *** 16 bit IQ ***";
                            break;

                        case "--mercury-xmit-hack":
                            DttSP.SetMercuryXmit(true);
                            this.Text = this.Text + " *** MercXmit ***";
                            break;

                        case "--eer-xmit-hack":
                            DttSP.SetEerXmit(true);
                            this.Text = this.Text + " *** EerXmit ***";
                            break;

                        case "--no-send-to-Janus":
                            NoJanusSend = true;
                            this.Text = this.Text + "*** NoJanusSend ***";
                            break;
                    }
                }
            }

            if(comboMeterTXMode.Items.Count > 0 && comboMeterTXMode.SelectedIndex < 0)
                comboMeterTXMode.SelectedIndex = 0;
            chkMOX.Enabled = false;

            RadioDSP.SyncStatic();

            for(int i=0; i<2; i++)
            {
                for(int j=0; j<2; j++)
                {
                    RadioDSPRX dsp_rx = radio.GetDSPRX(i, j);
                    dsp_rx.Force = true;
                    dsp_rx.Update = true;
                    dsp_rx.Force = false;
                }
            }

            for(int i=0; i<1; i++)
            {
                RadioDSPTX dsp_tx = radio.GetDSPTX(i);
                dsp_tx.Force = true;
                dsp_tx.Update = true;
                dsp_tx.Force = false;
            }

            if(this.SetupForm.FlexProfilerInstalled)
                mnuProfiles.Visible = true;
        }