public void WhenIGetTheAWGInstrumentCoupleSource(string awgNumber)
        {
            IAWG awg = AwgSetupSteps.GetAWG(awgNumber);

            _awgInstrumentGroup.GetTheAwgInstrumentCoupleSource(awg);
        }
示例#2
0
 /// <summary>
 /// Test the event status enable register
 /// </summary>
 /// <param name="awg"></param>
 /// <param name="expected_value"></param>
 public void EventStatusEnableRegisterShouldBe(IAWG awg, string expected_value)
 {
     Assert.AreEqual(expected_value, awg.EventStatusEnableReg);
 }
示例#3
0
 /// <summary>
 /// Compare Status Operation NTransition Register against expected
 /// </summary>
 /// <param name="awg"></param>
 /// <param name="expected_value"></param>
 public void StatusOperationNTransitionRegisterShouldBe(IAWG awg, string expected_value)
 {
     Assert.AreEqual(expected_value, awg.StatusOperationNtransitionReg);
 }
 public void QueryResponseShouldBe(IAWG awg, string expectedValue)
 {
     Assert.AreEqual(expectedValue, awg.ReadResponse, "Expected response " + expectedValue + " did not match actual value " + awg.ReadResponse);
 }
示例#5
0
 //glennj 06/06/2013
 /// <summary>
 /// Sets the value in the event status enable register to setValue variable
 /// </summary>
 /// <param name="awg">AWG object</param>
 /// <param name="setValue">Desired value for event status enable register</param>
 public void SetEventStatusEnableRegister(IAWG awg, string setValue)
 {
     awg.SetESE(setValue);
 }
 /// kaylak 11/14/2014
 /// <summary>
 /// Using OUTPut[n]:ATTenuator:A1 sets the step value setting for A1 attenuator of a channel in units of dB.
 /// This is a blocking
 /// </summary>
 /// <param name="awg"></param>
 /// <param name="outputIndex">Index of output</param>
 /// <param name="filterStepValue">step increment value</param>
 public void SetOutputFilterAttenuatorA1Step(IAWG awg, string outputIndex, string filterStepValue)
 {
     awg.SetOutputFilterAttenuatorA1Step(outputIndex, filterStepValue);
 }
 public void WriteCommandToAwg(IAWG awg, string command)
 {
     awg.VisaSessionWrite(command);
 }
        //glennj 1/7/2014
        /// <summary>
        /// Set the output "off" state for the AWG
        /// </summary>
        /// <param name="awg">Object</param>
        /// <param name="enable">state</param>
        public void SetOutputOffMode(IAWG awg, OutputOffStateMode enable)
        {
            string mode = (enable == OutputOffStateMode.On) ? SyntaxForOutputStateOn : SyntaxForOutputStateOff;

            awg.SetOutputOff(mode);
        }
 //glennj 1/7/2014
 /// <summary>
 /// Force the AWG to update it's output "off" state.
 /// </summary>
 /// <param name="awg"></param>
 public void GetOutputOffMode(IAWG awg)
 {
     awg.GetOutputOff();
 }
 /// kaylak 11/14/2014
 /// <summary>
 /// Using OUTPut[n]:FILTer:BPASs:RANGe? gets the band pass filter range
 /// </summary>
 /// <param name="awg"></param>
 /// <param name="outputIndex">Index of output</param>
 /// <returns>Type of Filter Path</returns>
 public void GetOutputFilterBandPassRange(IAWG awg, string outputIndex)
 {
     awg.GetOutputFilterBandPassRange(outputIndex);
 }
 //jmanning 09/22/2014
 /// <summary>
 /// Using OUTPut[n]:MODE? gets the signal path [DIRect|AC]
 /// </summary>
 /// <param name="awg">Object</param>
 /// <param name="outputIndex">Index of output</param>
 /// <returns> Signal Path Type of Filter [DIRect|AC]</returns>
 public void GetOutputMode(IAWG awg, string outputIndex)
 {
     awg.GetOutputMode(outputIndex);
 }
        public void SetOutputFilterBandPassRangeR10to14GHz(IAWG awg, string outputIndex, OutputFilterBandPassRange filterRange)
        {
            string expectedSyntax = "R10to14GHz";

            awg.SetOutputFilterBandPassRangeR10to14GHz(outputIndex, expectedSyntax);
        }
 //jmanning 09/22/2014
 /// <summary>
 /// Using OUTPut[n]:FILTer? gets the filter type of the of the selected signal path
 /// </summary>
 /// <param name="awg"></param>
 /// <param name="outputIndex">Index of output</param>
 /// <returns> Type of Filter [NONE|BPASs|LPASs]</returns>
 public void GetOutputFilter(IAWG awg, string outputIndex)
 {
     awg.GetOutputFilter(outputIndex);
 }
        public void ThenTheAWGInstrumentCoupleSourceShouldBeOn(string awgNumber)
        {
            IAWG awg = AwgSetupSteps.GetAWG(awgNumber);

            _awgInstrumentGroup.AwgInstrumentCoupleSourceShouldBe(awg, AwgInstrumentGroup.InstrumentCoupleSource.On);
        }
 //glennj 1/8/2014
 /// <summary>
 /// Force the AWG to update it's copy of the wait state for a channel
 /// </summary>
 /// <param name="awg"></param>
 /// <param name="logicalChannel"></param>
 public void GetOutputTriggerAnalogState(IAWG awg, string logicalChannel)
 {
     awg.GetOutputWValueAnalogState(logicalChannel);
 }
        //glennj 1/7/2014
        /// <summary>
        /// Set the output state for a channel for an AWG
        /// </summary>
        /// <param name="awg"></param>
        /// <param name="channel"></param>
        /// <param name="stateChange"></param>
        public void SetOutputState(IAWG awg, string channel, OutputStateMode stateChange)
        {
            string newState = stateChange == OutputStateMode.On ? SyntaxForOutputStateOn : SyntaxForOutputStateOff;

            awg.SetOutputState(channel, newState);
        }
 //glennj 1/8/2014
 /// <summary>
 /// Force the AWG to update it's copy for the marker wait state for a channel
 /// </summary>
 /// <param name="awg"></param>
 /// <param name="channel"></param>
 /// <param name="marker"></param>
 public void GetOutputWaitForTriggerMarkerState(IAWG awg, string channel, string marker)
 {
     awg.GetOutputTriggerMarkerState(channel, marker);
 }
 //glennj 1/7/2014
 /// <summary>
 /// Force the AWG to update it's channel output state for an AWG
 /// </summary>
 /// <param name="awg"></param>
 /// <param name="channel"></param>
 public void GetOutputState(IAWG awg, string channel)
 {
     awg.GetOutputState(channel);
 }
 /// kaylak 11/14/2014
 /// <summary>
 /// Using OUTPut[n]:ATTenuator:A1? gets the step value setting for A1attenuator of a channel in units of dB.
 /// This is a blocking
 /// </summary>
 /// <param name="awg"></param>
 /// <param name="outputIndex">Index of output</param>
 /// <returns>step increment value</returns>
 public void GetOutputFilterAttenuatorA1Step(IAWG awg, string outputIndex)
 {
     awg.GetOutputFilterAttenuatorA1Step(outputIndex);
 }
        //glennj 1/8/2014
        /// <summary>
        /// Set the Stop Value for analog for a channel for an AWG
        /// </summary>
        /// <param name="awg">AWG object</param>
        /// <param name="logicalChannel">logical channel e.g. 1</param>
        /// <param name="state">OutputAnalogStopMode</param>
        public void SetOutputStopAnalogState(IAWG awg, string logicalChannel, OutputAnalogStopMode state)
        {
            string value = (state == OutputAnalogStopMode.Off) ? SyntaxForReturnedOutputStopValueAnalogOff : SyntaxForReturnedOutputStopValueAnalogZero;

            awg.SetOutputStopAnalogState(logicalChannel, value);
        }
 public void QueryTheAwg(IAWG awg, string command)
 {
     awg.VisaSessionQuery(command);
 }
 //glennj 1/8/2014
 /// <summary>
 /// Force the AWG to update it's copy of the Stop Value for a channel and awg
 /// </summary>
 /// <param name="awg">AWG object</param>
 /// <param name="logicalChannel">logical channel e.g. 1</param>
 public void GetOutputStopAnalogState(IAWG awg, string logicalChannel)
 {
     awg.GetOutputStopAnalogState(logicalChannel);
 }
        /// <summary>
        /// The Gherkin language does not support dynamic ranges such as Channels.<para>
        /// Depending on the AWG it could have 1, 2 or 4 channels.  Our software</para><para>
        /// now needs to do it's own verification for correct channel count.</para>
        /// </summary>
        /// <param name="awg"></param>
        /// <param name="logicalChannel"></param>
        /// <param name="logicalMarker"></param>
        /// <param name="logicalClock"></param>
        public void VerifyChannelMarkerClockParameters(IAWG awg, string logicalChannel, string logicalMarker = null,
                                                       string logicalClock = null)
        {
            if (awg.ModelNumber.StartsWith("7"))
            {
                if (logicalChannel != null)
                {
                    int    logCh       = Convert.ToInt32(logicalChannel);
                    string errorString = "Channel " + logicalChannel + " doesn't exist for " + awg.FamilyType;
                    if (awg.FamilyType.EndsWith("1"))
                    {
                        if (logCh != 1)
                        {
                            Assert.Fail(errorString);
                        }
                    }
                    else
                    {
                        if ((logCh < 1) || (logCh > 2))
                        {
                            Assert.Fail(errorString);
                        }
                    }
                }

                if (logicalMarker != null)
                {
                    int    logMk       = Convert.ToInt32(logicalMarker);
                    string errorString = "Marker " + logicalMarker + " doesn't exist for " + awg.FamilyType;
                    if ((logMk < 1) || (logMk > 2))
                    {
                        Assert.Fail(errorString);
                    }
                }

                if (logicalClock != null)
                {
                    int    logClk      = Convert.ToInt32(logicalClock);
                    string errorString = "Clock " + logicalClock + " doesn't exist for " + awg.FamilyType;
                    if (logClk != 1)
                    {
                        Assert.Fail(errorString);
                    }
                }
            }
            else
            {
                if (logicalChannel != null)
                {
                    int    logCh       = Convert.ToInt32(logicalChannel);
                    string errorString = "Channel " + logicalChannel + " doesn't exist for " + awg.FamilyType;
                    if (awg.FamilyType.EndsWith("1"))
                    {
                        if (logCh != 1)
                        {
                            Assert.Fail(errorString);
                        }
                    }
                    else if (awg.FamilyType.EndsWith("2"))
                    {
                        if ((logCh < 1) || (logCh > 2))
                        {
                            Assert.Fail(errorString);
                        }
                    }
                    else
                    {
                        if ((logCh < 1) || (logCh > 4))
                        {
                            Assert.Fail(errorString);
                        }
                    }
                }

                if (logicalMarker != null)
                {
                    int    logMk       = Convert.ToInt32(logicalMarker);
                    string errorString = "Marker " + logicalMarker + " doesn't exist for " + awg.FamilyType;
                    if ((logMk < 1) || (logMk > 4))
                    {
                        Assert.Fail(errorString);
                    }
                }

                if (logicalClock != null)
                {
                    int    logClk      = Convert.ToInt32(logicalClock);
                    string errorString = "Clock " + logicalClock + " doesn't exist for " + awg.FamilyType;
                    if (logClk != 1)
                    {
                        Assert.Fail(errorString);
                    }
                }
            }
        }
        //glennj 1/8/2014
        /// <summary>
        /// Set the Output Stop state for a marker and for an AWG
        /// </summary>
        /// <param name="awg"></param>
        /// <param name="channel"></param>
        /// <param name="marker"></param>
        /// <param name="condition"></param>
        public void SetOutputStopMarkerState(IAWG awg, string channel, string marker, OutputMarkerStopMode condition)
        {
            var setCondition = (condition == OutputMarkerStopMode.Off) ? SyntaxForOutputStopValueMarkerOff : SyntaxForOutputStopValueMarkerLow;

            awg.SetOutputStopMarkerState(channel, marker, setCondition);
        }
示例#25
0
 /// <summary>
 /// Forces the AWG to update the copy of event status enable register contents
 /// </summary>
 /// <param name="awg">AWG object</param>
 /// <returns>Desired value for event status enable register</returns>
 public void GetEventStatusEnableRegister(IAWG awg)
 {
     awg.GetESE();
 }
 //glennj 1/8/2014
 /// <summary>
 /// Have the AWG update it's copy of the Output Stop state for a marker and for an AWG
 /// </summary>
 /// <param name="awg"></param>
 /// <param name="channel"></param>
 /// <param name="marker"></param>
 public void GetOutputStopMarkerState(IAWG awg, string channel, string marker)
 {
     awg.GetOutputStopMarkerState(channel, marker);
 }
示例#27
0
 /// <summary>
 /// Get the current Status Operation N Transistion Register and <para>
 /// update awg's copy</para>
 /// </summary>
 /// <param name="awg"></param>
 public void GetStatusOperationNTransitionRegister(IAWG awg)
 {
     awg.GetStatusOperationNTransitionRegister();
 }
        //glennj 1/8/2014
        /// <summary>
        /// Set the output wait (trigger) state for a channel for an AWG
        /// </summary>
        /// <param name="awg"></param>
        /// <param name="logicalChannel"></param>
        /// <param name="state"></param>
        public void SetOutputTriggerAnalogState(IAWG awg, string logicalChannel, OutputAnalogWaitMode state)
        {
            var value = (state == OutputAnalogWaitMode.First) ? SyntaxForOutputWaitValueAnalogFirst : SyntaxForOutputWaitValueAnalogZero;

            awg.SetOutputWaitForValueAnalogState(logicalChannel, value);
        }
示例#29
0
 /// <summary>
 /// Sets the value in the Status Operation PTransition register
 /// </summary>
 /// <param name="awg">AWG object</param>
 /// <param name="setValue">The value to set</param>
 public void SetStatusOperationPTransitionRegister(IAWG awg, string setValue)
 {
     awg.SetStatusOperationPTransitionRegister(setValue);
 }
        public void WhenISetTheAWGInstrumentCoupleSourceToOff(string awgNumber)
        {
            IAWG awg = AwgSetupSteps.GetAWG(awgNumber);

            _awgInstrumentGroup.SetTheAwgInstrumentCoupleSource(awg, AwgInstrumentGroup.InstrumentCoupleSource.Off);
        }