Example #1
0
        private void Initialization()
        {
            if (!Properties.Settings.Default.UserSaved)
            {
                SetColorScheme(0);
            }
            else
            {
                SetColorScheme(2);
            }

            Oscill = new OscillDev();
            for (int i = 0; i < 256; i++)
            {
                Oscill.DoneArray[i] = (byte)i;
            }

            GetSensCaption(trc_Sens.Value);
            GetTimescaleInfo(trc_TimeScale.Value);
            CalculateCursorData();

            tmr_Oscill_Poll.Enabled  = false;
            tmr_DrawSpectrum.Enabled = false;
            tmr_DrawImage.Enabled    = true;

            cmb_AnalyticMode.SelectedIndex = 0;
            cmb_WindowType.SelectedIndex   = 0;

            SetModeVisibility();
        }
Example #2
0
        private void btnStart_CheckedChanged(object sender, EventArgs e)
        {
            if (!btnStart.Checked)
            {
                tmr_Oscill_Poll.Enabled = false;
                Oscill.Dispose();
                btnPause.Enabled = false;
                btnPause.Checked = false;
                btnPause.Text    = "Пауза";
                btnStart.Text    = "Старт";
                mem_Log.AppendText("Device stopped" + Environment.NewLine);
            }
            else
            {
                if (Oscill == null)
                {
                    Oscill = new OscillDev();
                }

                mem_Log.AppendText("Searching" + Environment.NewLine);
                mem_Log.AppendText("VID:" + Oscill.Konstants.MY_VID + Environment.NewLine);
                mem_Log.AppendText("PID:" + Oscill.Konstants.MY_PID + Environment.NewLine);
                if (!Oscill.ConnectToOscill())
                {
                    mem_Log.AppendText("Device not found" + Environment.NewLine);
                    btnStart.Checked = false;
                    return;
                }
                mem_Log.AppendText("Connected!" + Environment.NewLine);
                mem_Log.AppendText("Firmware Version: " + Oscill.Konstants.FirmwareVersion + Environment.NewLine);
                if (Oscill.Konstants.FirmwareVersion == "V1.03")
                {
                    Init_103();
                }
                else
                {
                    Init_102();
                }

                tmr_Oscill_Poll.Enabled = true;

                btnPause.Enabled = true;
                btnStart.Text    = "Стоп";
            }
        }