Ejemplo n.º 1
0
        public void SetMeasureFormat(AgNAMeasurementFormatEnum measureFormat, CHANNEL channel, MEASUREMENT measurement)
        {
            IAgNAMeasurement chMeasurement;

            if (measurement != MEASUREMENT.LIKE_CHANNEL)
            {
                chMeasurement = agNAChannel[(int)channel - 1].Measurements.get_Item("Measurement" + (int)measurement);
            }
            else
            {
                chMeasurement = agNAChannel[(int)channel - 1].Measurements.get_Item("Measurement" + (int)channel);
            }

            chMeasurement.Format = measureFormat;
        }
Ejemplo n.º 2
0
        private void connectToolStripMenuItem_Click(object sender, EventArgs e)
        {
            if (m_vna == null)
            {
                this.Cursor = Cursors.WaitCursor;
                if (AppSettings.Instance.Config.visaName == string.Empty || AppSettings.Instance.Config.visaName == null)
                {
                    MessageBox.Show("Visa name not provided");
                    return;
                }
                m_vna = new P937XA(AppSettings.Instance.Config.visaName);
                if (m_vna.Initialize(out string outMessage,
                                     false,
                                     false,
                                     "",
                                     out P937XADriverStatistics stat, false) == true)
                {
                    this.Text = "P9374A Tester App - " + stat.SerialNumber;

                    m_vna.CreateChannel(SPARAMS.S21,
                                        CHANNEL.CHANNEL1,
                                        WINDOW.WINDOW0,
                                        MEASUREMENT.LIKE_CHANNEL);

                    m_vna.TriggerSource = AgNATriggerSourceEnum.AgNATriggerSourceInternal;
                    m_vna.SetTriggerMode(AgNATriggerModeEnum.AgNATriggerModeContinuous, CHANNEL.CHANNEL1);
                    //m_vna.MeasureFormat(AgNAMeasurementFormatEnum.AgNAMeasurementLogMag, CHANNEL.CHANNEL1);

                    double startFreq = m_vna.GetStartFrequency(CHANNEL.CHANNEL1);
                    txtStartFrequency.Text = startFreq.ToString();

                    double stopFreq = m_vna.GetStopFrequency(CHANNEL.CHANNEL1);
                    txtStopFrequency.Text = stopFreq.ToString();

                    double centerFreq = m_vna.GetCenterFrequency(CHANNEL.CHANNEL1);
                    txtCenterFrequency.Text = centerFreq.ToString();

                    double spanFreq = m_vna.GetSpanFrequency(CHANNEL.CHANNEL1);
                    txtSpanFrequency.Text = spanFreq.ToString();

                    int numberOfPoints = m_vna.GetNumberOfPoints(CHANNEL.CHANNEL1);
                    txtNumberOfPoints.Text = numberOfPoints.ToString();

                    AgNAMeasurementFormatEnum mf = m_vna.GetMeasureFormat(CHANNEL.CHANNEL1, MEASUREMENT.LIKE_CHANNEL);
                    cmbFormat.SelectedIndex        = (int)mf;
                    cmbTriggerMode.SelectedIndex   = (int)m_vna.GetTriggerMode(CHANNEL.CHANNEL1);
                    cmbTriggerSource.SelectedIndex = (int)m_vna.TriggerSource;

                    m_vna.RecallState(txtVnaState.Text);

                    /*
                     * m_vna.CreateChannel(SPARAMS.S21,
                     *                 CHANNEL.CHANNEL2,
                     *                 WINDOW.WINDOW1,
                     *                 MEASUREMENT.LIKE_CHANNEL);
                     */

                    this.Cursor = Cursors.Default;
                }
                else
                {
                    this.Cursor = Cursors.Default;
                    MessageBox.Show(outMessage);
                }
            }