示例#1
0
        public void TestSetRelativePhaseOfPi()
        {
            // Set both channels to 100 MHz and a relative phase zero since
            // there is an additional phase shift of pi on the board
            Message setChannelsCall = new Message();

            setChannelsCall.Add(setTwoLevel);        // Set modulation levels to two
            setChannelsCall.Add(selectBothChannels); // Select both channels
            setChannelsCall.Add(setSingleTone);      // Set singletone mode
            setChannelsCall.Add(selectChannelZero);  // Select channel 0
            setChannelsCall.Add(setFreqTo100MHz);    // Set freq to 100MHz
            setChannelsCall.Add(setPhaseToZero);     // Set phase to zero (always as reference)
            setChannelsCall.Add(selectChannelOne);   // Select channel 1
            setChannelsCall.Add(setFreqTo100MHz);    // Set freq to 100 Mhz
            setChannelsCall.Add(setPhaseToZero);     // Set phase to zero (since there is a phase shift of pi on the pcb)

            using (mocks.Ordered)
            {
                Expect.Once.On(mockDevice).Method("SendDataToEP1").With(fullDDSReset.ToArray());
                Expect.Once.On(mockDevice).Method("SendDataToEP2").With(initialization.ToArray());
                Expect.Once.On(mockDevice).Method("SendDataToEP2").With(setChannelsCall.ToArray());
            }

            dds.SetTwoChannelRelativePhase(100e6, 180);

            mocks.VerifyAllExpectationsHaveBeenMet();
        }
示例#2
0
文件: MainGUI.cs 项目: labJunky/DDS
 private void setChannel(AD9958 dds, ChannelSetting Setting)
 {
     if (Setting.Channel == 2)
     {
         dds.SetTwoChannelRelativePhase(Setting.Frequency, Setting.Phase);
     }
     else
     {
         dds.SetFrequency(Setting.Channel, Setting.Frequency);
     }
 }