Beispiel #1
0
        public CWExpert()
        {
            booting = true;
            InitializeComponent();
            float dpi = this.CreateGraphics().DpiX;
            this.AutoScaleMode = AutoScaleMode.Dpi;
            SizeF d = this.AutoScaleDimensions;
            d.Height = dpi;
            d.Width = dpi;
            this.AutoScaleDimensions = d;
            float ratio = dpi / 96.0f;
            string font_name = this.Font.Name;
            float size = (float)(8.25 / ratio);
            System.Drawing.Font new_font = new System.Drawing.Font(font_name, size);
            this.Font = new_font;
            font_name = txtVFOA.Font.Name;
            size = 14.25f / ratio;
            new_font = new System.Drawing.Font(font_name, size);
            txtVFOA.Font = new_font;
            size = 9.75f / ratio;
            new_font = new System.Drawing.Font(font_name, size);
            txtVFOB.Font = new_font;
            txtLosc.Font = new_font;
            font_name = this.menuStrip1.Font.Name;
            this.menuStrip1.Font = new System.Drawing.Font(font_name, size);
            this.menuStrip1.Size = new Size(this.menuStrip1.Width, (int)(25 / ratio));
            this.PerformAutoScale();
            this.PerformLayout();

            SetStyle(ControlStyles.UserPaint |
                ControlStyles.AllPaintingInWmPaint |
                ControlStyles.OptimizedDoubleBuffer, true);
            UpdateStyles();
            this.Text = programVersion;
            tx_image_phase_table = new float[(int)Band.LAST];
            tx_image_gain_table = new float[(int)Band.LAST];
            rx_image_phase_table = new float[(int)Band.LAST];
            rx_image_gain_table = new float[(int)Band.LAST];
            msg = new MessageHelper();
            edits = new TextEdit[3];
            DB.AppDataPath = Application.StartupPath;
            DB.Init();
            Audio.MainForm = this;
            PA19.PA_Initialize();
            #if DirectX
            DX.MainForm = this;
            #endif
            Display_GDI.MainForm = this;
            SetupForm = new Setup(this);
            booting = false;
            DXClusterForm = new DXClusterClient(this, SetupForm.txtTelnetHostAddress.Text.ToString(),
                SetupForm.txtStnCALL.Text.ToString(), SetupForm.txtStnName.Text.ToString(),
                SetupForm.txtStnQTH.Text.ToString());
            SetupForm.chkIPV6_CheckedChanged(this, EventArgs.Empty);
            display_event = new AutoResetEvent(false);
            output_ring_buf = new RingBuffer(32768);
            mon_ring_buf = new RingBuffer(32768);
            tbFilterWidth.Visible = false;
            picMonitor_bmp = new Bitmap(picMonitor.Width, picMonitor.Height,
                System.Drawing.Imaging.PixelFormat.Format24bppRgb);

            #if(DirectX)
            if (VideoDriver == DisplayDriver.DIRECTX)
            {
                DirectXInit();
            }
            else
            #endif
            {
                SMeter.displayEngine = AnalogGAuge.AGauge.DisplayDriver.GDI;
                Display_GDI.Target = picPanadapter;
                Display_GDI.Init(this);

                if (File.Exists(".\\picDisplay.png"))
                {
                    picPanadapter.BackgroundImage = Image.FromFile(".\\picDisplay.png");
                    picWaterfall.BackgroundImage = Image.FromFile(".\\picDisplay.png");
                }
            }

            display_buffer = new float[4096];
            AlwaysOnTop = always_on_top;
            txtFilterWidth.Visible = false;
            tbFilterWidth.Visible = false;
            lblFilterwidth.Visible = false;
            menuStrip1.BackColor = Color.Black;
            menuStrip1.ForeColor = Color.White;
            tbAFGain_Scroll(this, EventArgs.Empty);
            genesis = new G59(this.Handle);
            btnCH1.BackColor = Color.LimeGreen;
            btnCH2.BackColor = Color.WhiteSmoke;

            if (Audio.SDRmode)
            {
                genesis.booting = false;
                G59Init();
                genesis.si570_i2c_address = 170;
                genesis.si570_fxtal = 114272200.0;
                genesis.HSDiv = 11;
                bool conn = genesis.Connected;

                if (conn)
                {
                    lblUSB.BackColor = Color.Green;
                }
                else
                {
                    lblUSB.BackColor = Color.Red;
                }
            }

            cwDecoder = new CWDecode(this);
            cwEncoder = new CWEncode(this);
            rtty = new RTTY(this);
            psk = new PSK(this);
            cwEncoder.CWSpedd = (int)SetupForm.udCWSpeed.Value;
            cwDecoder.rx_only = SetupForm.chkRXOnly.Checked;
            cwEncoder.TXPhase = (float)SetupForm.udTXPhase.Value;
            cwEncoder.TXGain = (float)SetupForm.udTXGain.Value;
            cwEncoder.TXIfShift = (float)SetupForm.udTXIfShift.Value;
            cwEncoder.TXOffDelay = (int)SetupForm.udTXOffDelay.Value;
            cwEncoder.SetKeyerSpeed((float)SetupForm.udCWSpeed.Value);
            cwEncoder.SetKeyerWeight((int)SetupForm.udCWWeight.Value);
            cwEncoder.SetKeyerIambic(SetupForm.chkG59Iambic.Checked);
            chkAFC_CheckedChanged(this, EventArgs.Empty);
            psk.TXPreamble = psk_preamble;

            if (SetupForm.chkG59IambicBmode.Checked)
                cwEncoder.SetKeyerMode(1);
            else
                cwEncoder.SetKeyerMode(0);

            rtty.TXPhase = (float)SetupForm.udTXPhase.Value;
            rtty.TXGain = (float)SetupForm.udTXGain.Value;

            if (!once)
            {
                SetupSDR(Application.StartupPath.ToString() + "\\wisdom");
                ReleaseUpdate();
                SetSampleRate(Audio.SampleRate);
                ResizeSDR(0, 4096);
                SetAGC(agc_mode);

                ProcessSampleThreadController[] pstc = new ProcessSampleThreadController[1];
                audio_process_thread = new Thread[1];

                for (uint proc_thread = 0; proc_thread < 1; 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();
                }

                once = true;
            }

            get_state = true;
            GetState();
            get_state = false;
            DB.LOGFilePath = log_file_path;
            DB.LOG_Init();
            InitLOG();
            keyboard = new Keyboard(this);
            recorder = new Recorder(this);

            double vfoa_freq, vfob_freq, losc_freq;
            int filter_vfoA, filter_vfoB, zoom, pan;
            DB.GetBandStack(current_band.ToString(), out vfoa_freq, out vfob_freq, out losc_freq, out filter_vfoA,
                out filter_vfoB, out zoom, out pan);
            LOSC = losc_freq;
            VFOA = vfoa_freq;
            VFOB = vfob_freq;
            FilterWidthVFOA = filter_vfoA;
            FilterWidthVFOB = filter_vfoB;
            tbZoom.Value = zoom;
            tbPan.Value = pan;
            lblPan_Click(null, null);

            switch (op_mode_vfoA)
            {
                case Mode.BPSK31:
                case Mode.BPSK63:
                case Mode.BPSK125:
                case Mode.BPSK250:
                case Mode.QPSK31:
                case Mode.QPSK63:
                case Mode.QPSK125:
                case Mode.QPSK250:
                    this.grpChannels.Text = "VFOA " + op_mode_vfoA.ToString() + "     VFOB " +
                    op_mode_vfoB.ToString() + "     ";
                    grpMonitor.Text = "Mode PSK";
                    break;
            }

            if (iq_correction == IQ_correction.FIXED)
            {
                SetRXIQGainPhase(1, rx_image_gain_table[(int)current_band],
                    rx_image_phase_table[(int)current_band]);
                RX_phase_gain();
            }
            else if (iq_correction == IQ_correction.WBIR)
            {
                SetRXIQGainPhase(2, 0.0f, 0.0f);
                RX_phase_gain();
            }

            dxcc = new DXCC();
            dxcc.Init(SetupForm.txtStnLOC.Text.ToString());

            try
            {
                if (use_telnet)
                    telnet_server = new TelnetServer(SetupForm.txtTelnetHostAddress.Text.ToString(),
                        (int)SetupForm.udTelnetServerPort.Value, SetupForm.chkIPV6.Checked);

                SetupForm.chkIPV6_CheckedChanged(this, EventArgs.Empty);
            }
            catch (Exception ex)
            {
                Debug.Write(ex.ToString());
            }
        }
Beispiel #2
0
        private void InitConsole()      // changes yt7pwr
        {
            this.Text = this.Text + GSDR_version + GSDR_revision;
            WinVer = WindowsVersion.WindowsXP;      // default
            OSInfo = System.Environment.OSVersion;
            Mixer.console = this;

            switch (OSInfo.Version.Major)
            {
                case 5:
                    {
                        switch (OSInfo.Version.Minor)
                        {
                            case 0:
                                WinVer = WindowsVersion.Windows2000;
                                break;
                            case 1:
                                WinVer = WindowsVersion.WindowsXP;
                                break;
                        }
                    }
                    break;
                case 6:
                    {
                        switch (OSInfo.Version.Minor)
                        {
                            case 0:
                                WinVer = WindowsVersion.WindowsVista;
                                break;
                            case 1:
                                WinVer = WindowsVersion.Windows7;
                                break;
                            case 2:
                                WinVer = WindowsVersion.Windows8;
                                break;
                            case 3:
                                WinVer = WindowsVersion.Windows8;
                                break;
                            default:
                                WinVer = WindowsVersion.WindowsVista;
                                break;
                        }
                    }
                    break;
                default:
                    WinVer = WindowsVersion.WindowsXP;
                    break;
            }

            booting = true;
            skin = new Skin(this);
            VoiceMsgForm = new VoiceMessages(this);
            g59 = new GenesisG59.G59(Handle);
            g59.booting = true;
            g11 = new GenesisG11.G11(Handle);
            g11.booting = true;
            g6 = new GenesisG6.G6(Handle);
            g6.booting = true;
            g6.SetCallback(GenesisG6CommandCallback);
            g6.SetIQCallback(Audio.G6AudioCallback);
            //g6.SetIQCallback(Audio.G6ADCaudioCallback);
            //g6.SetDACcallback(Audio.G6DACaudioCallback);
            net_device = new GenesisNetBox.NetBox(Handle);
            net_device.booting = true;
            qrp2000 = new QRP2000(this);
            AnalogSignalGauge = new AGauge(this);
            NewVFOSignalGauge = new AGauge(this);

            try
            {
                ServerSocket = new ServerSendData(this);    // error!
                ClientSocket = new ClientRecvData(this);
            }
            catch (Exception ex)
            {
                MessageBox.Show("Error1 in network configuration!\nCheck your network settings!\n" +
                    ex.ToString());
            }

            try
            {
                CAT_server_socket = new CAToverEthernetServer(this);
                CAT_client_socket = new CAToverEthernetClient(this);
            }
            catch (Exception ex)
            {
                Debug.Write("Error while creating network CAT!\n" +
                    ex.ToString());
            }

            try
            {
                MultiPSKServer = new MultiPSKEthernetServer(this);
            }
            catch (Exception ex)
            {
                Debug.Write("Error in MultiPSK network configuration!\nCheck your network settings!\n" +
                    ex.ToString());
            }

            UpdateBandStackRegisters();

            Audio.console = this;
            chkDSPNB2.Enabled = true;
            Display_GDI.console = this;     // for GDI+
#if(DirectX)
            try
            {
                Display_DirectX.console = this; // for DirectX
            }
            catch (Exception ex)
            {
                MessageBox.Show("DirectX general fault!\n" + ex.ToString());
            }
#endif

            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 "--debug-enable":
                            debug_enabled = true;
                            debug = new DebugForm(this, true);
                            debug.StartPosition = FormStartPosition.Manual;
                            debug.Show();
                            debug.Focus();
                            Win32.SetWindowPos(debug.Handle.ToInt32(),
                                -1, this.Left, this.Top, debug.Width, debug.Height, 0);
                            this.Text = this.Text + " Debug enabled!";
                            break;
                    }
                }
            }

            losc_hover_digit = -1;
            vfoA_hover_digit = -1;
            vfoB_hover_digit = -1;
            run_setup_wizard = true;

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

            last_band = "";						// initialize bandstack

            wheel_tune_list = new double[15];		// 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] = 0.250000;
            wheel_tune_list[12] = 0.500000;
            wheel_tune_list[13] = 1.000000;
            wheel_tune_list[14] = 10.000000;
            wheel_tune_index = 6;
            wheel_tune_index_subRX = 6;

            meter_text_history = new float[multimeter_text_peak_samples];
            current_meter_data = -200.0f;
            this.ActiveControl = chkPower;		// Power has focus initially

            Display_GDI.Target = picDisplay;
            Display_GDI.Init();					// Initialize Display variables
            InitDisplayModes();					// Initialize Display Modes
            InitAGCModes();						// Initialize AGC Modes
            InitMultiMeterModes();				// Initialize MultiMeter Modes

            ProcessSampleThreadController[] pstc = new ProcessSampleThreadController[1];
            audio_process_thread = new Thread[1];

            for (uint proc_thread = 0; proc_thread < 1; 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();
            }

            siolisten = new SIOListenerII(this);

            Keyer = new CWKeyer2(this);			// create new Keyer
            CWXForm = new CWX(this);            // create CWX form
            CWXForm.stopButton_Click(null, null);
            EQForm = new EQForm();
            XTRVForm = new XTRV(this);
            UpdateBandStackRegisters();

            InitFilterPresets(ref filter_presets, ref filter_presets_subRX);					// Initialize filter values

            SI570 = new ExtIO_si570_usb(this);
            RTL_SDR = new ExtIO_RTL(this);

            ir_remote = new WinLIRC(this);

            rx_image_real_table = new float[(int)Band.LAST + 1];
            rx_image_imag_table = new float[(int)Band.LAST + 1];
            tx_image_phase_table = new float[(int)Band.LAST + 1];
            tx_image_gain_table = new float[(int)Band.LAST + 1];
            rx_image_phase_table = new float[(int)Band.LAST + 1];
            rx_image_gain_table = new float[(int)Band.LAST + 1];

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

            SetupForm.GetTxProfiles();
            UpdateTXProfile();

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

            CurrentAGCMode = AGCMode.MED;				// Initialize front panel controls
            vfob_dsp_mode = DSPMode.LSB;
            vfob_filter = Filter.F3;
            comboDisplayMode.Text = "Panafall";
            comboMeterRXMode.SelectedIndex = 0;
            ptbPWR.Value = 10;

            CurrentDSPMode = DSPMode.CWU;
            CurrentDSPModeSubRX = DSPMode.CWU;
            old_dsp_mode = DSPMode.CWU;
            old_dsp_mode_subRX = DSPMode.CWU;
            Splash.SetStatus("Restore Console state...");
            GetState();							// recall saved state

            if (current_dsp_mode == DSPMode.FIRST || current_dsp_mode == DSPMode.LAST)
                radModeLSB.Checked = true;
            if (current_dsp_mode_subRX == DSPMode.FIRST || current_dsp_mode == DSPMode.LAST)
                radSUBRxModeLSB.Checked = true;
            if (current_filter == Filter.FIRST || current_filter == Filter.LAST ||
                (current_filter == Filter.NONE && current_dsp_mode != DSPMode.DRM && current_dsp_mode != DSPMode.SPEC))
                radFilter3.Checked = true;
            if (current_filter_subRX == Filter.FIRST || current_filter_subRX == Filter.LAST ||
                (current_filter_subRX == Filter.NONE && current_dsp_mode_subRX != DSPMode.DRM &&
                current_dsp_mode_subRX != DSPMode.SPEC))
                radSubRXFilter3.Checked = true;

            booting = false;
            EQForm.Init();                  // set EQU parameter
            SetupForm.DSPBufferSize = 0;    // force refresh
            VFOAFreq = vfoAFreq;
            VFOBFreq = vfoBFreq;
            LOSCFreq = loscFreq;
            PWR_ValueChanged();
            udMIC_ValueChanged(this, EventArgs.Empty);
            tbRX0Gain_Scroll(this, EventArgs.Empty);
            tbRX1Gain_Scroll(this, EventArgs.Empty);
            tbPanMainRX_Scroll(this, EventArgs.Empty);
            tbPanSubRX_Scroll(this, EventArgs.Empty);
            ptbPanMainRX.Value = pan_main_rx;
            ptbPanSubRX.Value = pan_sub_rx;
            ptbDisplayZoom.Value = 4;
            CalcDisplayFreq();

            wheel_tune_index--;					// Setup wheel tuning
            wheel_tune_index_subRX--;
            ChangeWheelTuneLeft();
            ChangeWheelTuneLeftSubRX();

            SetupForm.initCATandPTTprops();   // wjt added -- get console props setup for cat and ptt 

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

            CheckSkins();

#if(DirectX)
            if (CurrentDisplayEngine == DisplayEngine.DIRECT_X)
            {
                CurrentDisplayEngine = current_display_engine;
            }
#endif

            // yt7pwr
            if (!skins_enabled)
            {
                radDisplayZoom1x.BackColor = button_selected_color;
                radDisplayZoom2x.BackColor = SystemColors.Control;
                radDisplayZoom4x.BackColor = SystemColors.Control;
                radDisplayZoom8x.BackColor = SystemColors.Control;
            }
            else
                radDisplayZoom1x.Checked = true;

            Splash.SetStatus("Initializing Genesis radio communication");	// Set progress point
            g59.booting = false;
            g11.booting = false;
            g6.booting = false;
            net_device.booting = false;
            g59.si570_i2c_address = (int)SetupForm.udSi570_address.Value;
            g59.si570_fxtal = (int)SetupForm.udSi570_xtal1.Value;
            g59.HSDiv = (int)SetupForm.udSi570_divisor.Value;
            g11.si570_i2c_address = (int)SetupForm.udSi570_address.Value;
            g11.si570_fxtal = (int)SetupForm.udSi570_xtal1.Value;
            g11.HSDiv = (int)SetupForm.udSi570_divisor.Value;
            g6.si570_i2c_address = (int)SetupForm.udSi570_address.Value;
            g6.si570_fxtal = (int)SetupForm.udSi570_xtal1.Value;
            g6.HSDiv = (int)SetupForm.udSi570_divisor.Value;
            net_device.si570_i2c_address = (int)SetupForm.udSi570_address.Value;
            net_device.si570_fxtal = (int)SetupForm.udSi570_xtal1.Value;
            net_device.si570_div = (int)SetupForm.udSi570_divisor.Value;

            if (CurrentModel == Model.GENESIS_G59USB)
            {
                bool conn = false;
                g59.USB_Serial = SetupForm.USB_serial_No;
                conn = g59.Connect();

                if (conn)
                {
                    G59Init();
                    btnUSB.BackColor = Color.Green;
                }
                else
                {
                    btnUSB.BackColor = Color.Red;
                }
            }
            else if (CurrentModel == Model.GENESIS_G11)
            {
                bool conn = false;
                g11.USB_Serial = SetupForm.USB_serial_No;
                conn = g11.Connect();

                if (conn)
                {
                    G11Init();
                    btnUSB.BackColor = Color.Green;
                }
                else
                {
                    btnUSB.BackColor = Color.Red;
                }
            }
            else if (CurrentModel == Model.GENESIS_G6)
            {
                bool conn = false;
                g6.USB_Serial = SetupForm.USB_serial_No;
                conn = g6.Connect();

                if (conn)
                {
                    G11Init();
                    btnUSB.BackColor = Color.Green;
                }
                else
                {
                    btnUSB.BackColor = Color.Red;
                }
            }
            else if (current_model == Model.QRP2000)
            {
                ReInit_USB();
            }
            else if (current_model == Model.RTL_SDR)
            {
                bool result = RTL_SDR.InitUSB();

                if (result)
                {
                    btnUSB.Visible = true;
                    btnUSB.BackColor = Color.Green;
                }
                else
                {
                    btnUSB.BackColor = Color.Red;
                }
            }
            else if (SetupForm.chkGeneralUSBPresent.Checked)
            {
                bool result = SI570.Init_USB();

                if (result)
                {
                    btnUSB.Visible = true;
                    btnUSB.BackColor = Color.Green;
                }
                else
                {
                    btnUSB.BackColor = Color.Red;
                }
            }

            txtMemory_fill();
            txtFMmemory_fill();

            SetTXOscFreqs(false, false);

            btnG3020_X1.Text = G3020Xtal1.ToString();
            btnG3020_X2.Text = G3020Xtal2.ToString();
            btnG3020_X3.Text = G3020Xtal3.ToString();
            btnG3020_X4.Text = G3020Xtal4.ToString();
            btnG160_X1.Text = G160Xtal1.ToString();
            btnG160_X2.Text = G160Xtal2.ToString();
            btnG80_X1.Text = G80Xtal1.ToString();
            btnG80_X2.Text = G80Xtal2.ToString();
            btnG80_X3.Text = G80Xtal3.ToString();
            btnG80_X4.Text = G80Xtal4.ToString();
            btnG40_X1.Text = G40Xtal1.ToString();
            btnG137_X1.Text = G137Xtal1.ToString();
            btnG500_X1.Text = G500Xtal1.ToString();

            txtVFOAMSD.Font = vfo_large_font;
            txtVFOBMSD.Font = vfo_large_font;
            txtLOSCMSD.Font = (vfo_large_font);
            txtVFOAFreq.Font = vfo_large_font;
            txtVFOBFreq.Font = vfo_large_font;
            txtLOSCFreq.Font = vfo_large_font;
            txtVFOALSD.Font = vfo_small_font;
            txtVFOBLSD.Font = vfo_small_font;
            txtLOSCLSD.Font = vfo_small_font;
            NewVFOLargeFont = new_vfo_large_font;     // refresh
            NewVFOSmallFont = new_vfo_small_font;
            VFOLargeFont = vfo_large_font;
            VFOSmallFont = vfo_small_font;
            network_event = new AutoResetEvent(false);
            sMeterDigital2.MeterForeColor = vfo_text_dark_color;
            sMeterDigital1.MeterForeColor = vfo_text_dark_color;

            try
            {
                eventWatcher = new ManagementEventWatcher("root\\wmi", "SELECT * FROM MSNdis_StatusMediaDisconnect");
                eventWatcher.EventArrived += new
                EventArrivedEventHandler(eventWatcher_EventArrived);
                eventWatcher.Start();
            }
            catch (Exception ex)
            {
                //MessageBox.Show("Error starting Network watcher!\nCheck you network settings!\n" +
                    //ex.ToString());
            }

            if (current_model == Model.GENESIS_G59NET)
                NetworkThreadRunning = true;

            SetupForm.StartEthernetCATServer();       // try ethernet CAT 
            SetupForm.StartEthernetCATClient();
            SetupForm.StartMultiPSKServer();

            InitSMeterModes();

            if (File.Exists(SetupForm.txtLoopDll.Text + "\\loop.dll") &&
                SetupForm.chkAudioEnableVAC.Checked &&
                SetupForm.comboAudioInputVAC.Text == "loop.dll" &&
                SetupForm.comboAudioOutputVAC.Text == "loop.dll")
            {
                loopDLL = new LoopDLL(this);
                Audio.loopDLL_enabled = true;
            }
            else
                Audio.loopDLL_enabled = false;

            chkVFOSplit.Enabled = false;

            switch (current_model)
            {
                case Model.GENESIS_G59NET:
                case Model.GENESIS_G59USB:
                    if (SetupForm.chkG59RX2.Checked)
                        lblRX2.BackColor = Color.Red;
                    else
                        lblRX2.BackColor = NewBackgroundVFOColor;
                    break;

                case Model.GENESIS_G11:
                    if (SetupForm.chkG11RX2.Checked)
                        lblRX2.BackColor = Color.Red;
                    else
                        lblRX2.BackColor = NewBackgroundVFOColor;
                    break;
            }

            EQForm.RestoreSettings();
            band_button_height = radMoreBands.Height;
            band_button_width = radMoreBands.Width;
            AF_ValueChanged();
            SetupForm.MultimeterCalOffset = multimeter_cal_offset;
            SetupForm.DisplayCalOffset = display_cal_offset;
            FilterUpdate();
            PWR_ValueChanged();

            if (radMoreBands.Checked)
            {
                radMoreBands_Click(this, EventArgs.Empty);
            }

            IR_Remote_enabled = ir_remote_enabled;      // try WinLIRC
            SetTXOscFreqs(true, true);
            SetTXOscFreqs(false, true);

            SetupForm.ForceAllEvents();
        }