public static extern short SetSigGenBuiltIn(short handle,
                                             int offsetVoltage,
                                             uint pkTopk,
                                             WaveType waveType,
                                             float startFrequency,
                                             float stopFrequency,
                                             float increment,
                                             float dwellTime,
                                             SweepType sweepType,
                                             uint sweeps);
示例#2
0
        public static double AdjustWipe(double x, SweepType Sweep)
        {
            switch (Sweep)
            {
                case SweepType.Logarithmic: x = (Math.Exp(x) - 1.0) / (Math.E - 1.0); break;
                default: break;
            }

            // Clamp to (0, 1).
            return Math.Min(Math.Max(x, 1e-6), 1.0 - 1e-6);
        }
 public static extern short SetSigGenArbitrary(short handle,
                                               int offsetVoltage,
                                               uint pkTopk,
                                               uint startDeltaPhase,
                                               uint stopDeltaPhase,
                                               uint deltaPhaseIncrement,
                                               uint dwellCount,
                                               byte[] arbitraryWaveform,
                                               uint arbitraryWaveformSize,
                                               SweepType sweepType,
                                               uint sweeps);
示例#4
0
        public static double AdjustWipe(double x, SweepType Sweep)
        {
            switch (Sweep)
            {
            case SweepType.Logarithmic: x = (Math.Exp(x) - 1.0) / (Math.E - 1.0); break;

            default: break;
            }

            // Clamp to (0, 1).
            return(Math.Min(Math.Max(x, 1e-6), 1.0 - 1e-6));
        }
示例#5
0
 public static extern uint SetSigGenPropertiesBuiltIn(
     short handle,
     double startFrequency,
     double stopFrequency,
     double increment,
     double dwellTime,
     SweepType sweepType,
     uint shots,
     uint sweeps,
     SigGenTrigType triggerType,
     SigGenTrigSource triggerSource,
     short extInThreshold);
示例#6
0
        private void pbxFreq_MouseClick(object sender, MouseEventArgs e)
        {
            float f_value = 0.0f;

            if (!Sweeping)
            {
                sweep_or_time = SweepType.Time_Sweep;

                pbxCarrier1.Image = ImagesManage.GetImage("harmonic", "carrier1_in.gif");
                pbxCarrier2.Image = ImagesManage.GetImage("harmonic", "carrier2_in.gif");

                HarFreqForm fm = new HarFreqForm(this.settings.F);

                if (fm.ShowDialog() == DialogResult.OK)
                {
                    f_value = fm.Value;

                    if ((f_value >= App_Settings.sgn_1.Min_Freq) &&
                        (f_value <= App_Settings.sgn_1.Max_Freq))
                    {
                        settings.F = f_value;
                        lblF.Text  = "F:" + f_value.ToString("0.0") + "MHz";
                        float f = f_value * 2;
                        lblSweep.Text = "Carrier1 Time Sweep (" + f.ToString("0.#") + "MHz)";
                    }
                    else if ((f_value >= App_Settings.sgn_2.Min_Freq) &&
                             (f_value <= App_Settings.sgn_2.Max_Freq))
                    {
                        settings.F = f_value;
                        lblF.Text  = "F:" + f_value.ToString("0.0") + "MHz";
                        float f = f_value * 2;
                        lblSweep.Text = "Carrier2 Time Sweep (" + f.ToString("0.#") + "MHz)";
                    }
                    else
                    {
                        MessageBox.Show(this, "Frequency Must In [" +
                                        App_Settings.sgn_1.Min_Freq.ToString("0.0") + "~" +
                                        App_Settings.sgn_1.Max_Freq.ToString("0.0") + "]/[" +
                                        App_Settings.sgn_2.Min_Freq.ToString("0.0") + "~" +
                                        App_Settings.sgn_2.Max_Freq.ToString("0.0") + "]");
                    }
                }
                else
                {
                    float f = settings.F * 2;
                    lblSweep.Text = "Carrier2 Time Sweep (" + f.ToString("0.#") + "MHz)";
                }

                fm.Dispose();

                pltHar.SetXStartStop(0, this.settings.Time_Points);
            }
        }
示例#7
0
 public static extern uint SetSigGenPropertiesArbitrary(
     short handle,
     uint startDeltaPhase,
     uint stopDeltaPhase,
     uint deltaPhaseIncrement,
     uint dwellCount,
     SweepType sweepType,
     uint shots,
     uint sweeps,
     SigGenTrigType triggerType,
     SigGenTrigSource triggerSource,
     short extInThreshold);
示例#8
0
        private void pbxCarrier2_MouseClick(object sender, MouseEventArgs e)
        {
            if (!Sweeping)
            {
                rf_involved       = RFInvolved.Rf_2;
                sweep_or_time     = SweepType.Freq_Sweep;
                pbxCarrier1.Image = ImagesManage.GetImage("isolation", "carrier1_in.gif");
                pbxFreq.Image     = ImagesManage.GetImage("isolation", "freq_in.gif");
                lblSweep.Text     = "Carrier2 Frequncy Sweep";

                pltIso.SetXStartStop(App_Settings.sgn_2.Min_Freq, App_Settings.sgn_2.Max_Freq);
            }
        }
示例#9
0
        private void pbxCarrier1_MouseClick(object sender, MouseEventArgs e)
        {
            if (!Sweeping)
            {
                rf_involved       = RFInvolved.Rf_1;
                sweep_or_time     = SweepType.Freq_Sweep;
                pbxCarrier2.Image = ImagesManage.GetImage("harmonic", "carrier2_in.gif");
                pbxFreq.Image     = ImagesManage.GetImage("harmonic", "freq_in.gif");
                lblSweep.Text     = "Carrier1 Frequncy Sweep";

                pltHar.SetXStartStop(App_Settings.sgn_1.Min_Freq * settings.Multiplier, App_Settings.sgn_1.Max_Freq * settings.Multiplier);
            }
        }
示例#10
0
 public static extern Int16 SetSigGenBuiltIn(
     short handle,
     int offsetVoltage,
     uint pkToPk,
     WaveType waveType,
     float startFrequency,
     float stopFrequency,
     uint increment, //not double
     uint dwellTime, //not double...
     SweepType sweepType,
     ExtraOperations operation,
     uint shots,
     uint sweeps,
     SigGenTrigType triggerType,
     SigGenTrigSource triggerSource,
     short extInThreshold);
示例#11
0
        private string SweepTypeSwitch(SweepType tmpType)
        {
            string str = "TRIGgered";

            switch (tmpType)
            {
            case SweepType.Auto:
                str = "AUTO";
                break;

            default:
                str = "TRIGgered";
                break;
            }
            return(str);
        }
 public static extern UInt32 SetSigGenBuiltIn(
     short handle,
     int offsetVoltage,
     uint pkTopk,
     WaveType waveType,
     double startFrequency,
     double stopFrequency,
     double increment,
     double dwellTime,
     SweepType sweepType,
     ExtraOperations operation,
     uint shots,
     uint sweeps,
     SigGenTrigType triggerType,
     SigGenTrigSource triggerSource,
     short extInThreshold);
示例#13
0
        /// <summary>
        /// Return the Asian/American marking letter of the sweep.
        /// </summary>
        public static string GetCode(this SweepType sweep)
        {
            switch (sweep)
            {
            case SweepType.Linear:
            case SweepType.ReverseLinear:
                return("B");

            case SweepType.Logarithmic:
                return("A");

            case SweepType.ReverseLogarithmic:
                return("C");

            default:
                return("");
            }
        }
 public static extern UInt32 SetSigGenArbitrary(
     short handle,
     int offsetVoltage,
     uint pkTopk,
     uint startDeltaPhase,
     uint stopDeltaPhase,
     uint deltaPhaseIncrement,
     uint dwellCount,
     ref short arbitaryWaveform,
     int arbitaryWaveformSize,
     SweepType sweepType,
     ExtraOperations operation,
     IndexMode indexMode,
     uint shots,
     uint sweeps,
     SigGenTrigType triggerType,
     SigGenTrigSource triggerSource,
     short extInThreshold);
        public static double AdjustWipe(double x, SweepType Sweep)
        {
            x = Math.Min(Math.Max(x, 1e-3), 1.0 - 1e-3);

            // If we want the parameter to be backwards, swap it.
            if (Sweep == SweepType.ReverseLinear || Sweep == SweepType.ReverseLogarithmic)
            {
                x = 1 - x;
            }

            // If we want the parameter to be logarithmic, apply an exponential curve
            // passing through 0 and 1.
            double exp = Math.Exp(2);

            if (Sweep == SweepType.Logarithmic || Sweep == SweepType.ReverseLogarithmic)
            {
                x = (Math.Pow(exp, x) - 1.0) / (exp - 1.0);
            }

            return(x);
        }
示例#16
0
 /// <summary>
 /// Gets a hash code for this file binary header
 /// </summary>
 /// <returns></returns>
 public override int GetHashCode()
 {
     unchecked
     {
         var hashCode = JobId;
         hashCode = (hashCode * 397) ^ LineNum;
         hashCode = (hashCode * 397) ^ Reelnum;
         hashCode = (hashCode * 397) ^ DataTracesPerRecord.GetHashCode();
         hashCode = (hashCode * 397) ^ AuxTracesPerRecord.GetHashCode();
         hashCode = (hashCode * 397) ^ SampleIntervalOfFileMicrosec.GetHashCode();
         hashCode = (hashCode * 397) ^ SampleIntervalOrigRecordingMicrosec.GetHashCode();
         hashCode = (hashCode * 397) ^ SamplesPerTraceOfFile.GetHashCode();
         hashCode = (hashCode * 397) ^ SamplesPerTraceOrigRecording.GetHashCode();
         hashCode = (hashCode * 397) ^ DataSampleFormatCode.GetHashCode();
         hashCode = (hashCode * 397) ^ CdpFold.GetHashCode();
         hashCode = (hashCode * 397) ^ TraceSortingCode.GetHashCode();
         hashCode = (hashCode * 397) ^ VerticalSumCode.GetHashCode();
         hashCode = (hashCode * 397) ^ SweepFrequencyStart.GetHashCode();
         hashCode = (hashCode * 397) ^ SweepFrequencyEnd.GetHashCode();
         hashCode = (hashCode * 397) ^ SweepLengthMs.GetHashCode();
         hashCode = (hashCode * 397) ^ SweepType.GetHashCode();
         hashCode = (hashCode * 397) ^ TraceNumSweepChannel.GetHashCode();
         hashCode = (hashCode * 397) ^ SweepTraceTaperLengthStartMs.GetHashCode();
         hashCode = (hashCode * 397) ^ SweepTraceTaperLengthEndMs.GetHashCode();
         hashCode = (hashCode * 397) ^ SweepTaperType.GetHashCode();
         hashCode = (hashCode * 397) ^ CorrelatedDataTraces.GetHashCode();
         hashCode = (hashCode * 397) ^ BinaryGainRecovered.GetHashCode();
         hashCode = (hashCode * 397) ^ AplitudeRecovery.GetHashCode();
         hashCode = (hashCode * 397) ^ UnitSystem.GetHashCode();
         hashCode = (hashCode * 397) ^ ImpulseSignal.GetHashCode();
         hashCode = (hashCode * 397) ^ VibratoryPolarityCode.GetHashCode();
         hashCode = (hashCode * 397) ^ SegyFormatRevisionNum.GetHashCode();
         hashCode = (hashCode * 397) ^ FixedLengthTraceFlag.GetHashCode();
         hashCode = (hashCode * 397) ^ ExtendedTextHeadersCount.GetHashCode();
         return(hashCode);
     }
 }
示例#17
0
        public bool CheckSweep(bool isTen)
        {
            lastCheckSweepType = isTen ? SweepType.Ten : SweepType.Single;
            if (isTen)
            {
                if (!Logic.FunctionOpen.Model.FunctionOpenProxy.instance.IsFunctionOpen(FunctionOpenType.TenSweep, false))
                {
                    FunctionOpen.Model.FunctionData sweepTenOpenData = FunctionOpen.Model.FunctionData.GetFunctionDataByID((int)FunctionOpenType.TenSweep);
                    Logic.VIP.Model.VIPData         vipData          = Logic.VIP.Model.VIPData.GetVIPData(sweepTenOpenData.vip);
                    if (VIPProxy.instance.VIPLevel < sweepTenOpenData.vip)
                    {
                        string tipsString = Localization.Format("ui.dungeon_detail_view.sweep_ten_times_locked_tips", vipData.ShortName);
                        ConfirmTipsView.Open(tipsString, GoToBuyDiamond);
                        return(false);
                    }
                }
            }
            else
            {
                if (!Logic.FunctionOpen.Model.FunctionOpenProxy.instance.IsFunctionOpen(FunctionOpenType.SingleSweep, true))
                {
                    return(false);
                }
            }



            if (DungeonDetailProxy.instance.DungeonInfo.star < 3)
            {
                CommonAutoDestroyTipsView.Open(Localization.Get("ui.dungeon_detail_view.text_sweep_not_enough_star"));
                return(false);
            }
            if (GameProxy.instance.CheckPackFull())
            {
                return(false);
            }

            DungeonInfo info          = DungeonDetailProxy.instance.DungeonInfo;
            int         count         = 1;//默认等于10改为1下面判断是扫荡10次才变值
            int         countByAction = (int)(GameProxy.instance.PveAction / info.dungeonData.actionNeed);

            if (countByAction == 0)
            {
                string tipString = Localization.Get("ui.common_tips.not_enough_pve_action_and_go_to_buy");
                ConfirmTipsView.Open(tipString, GoToBuyAction);
                return(false);
            }
            int countByLimit = info.GetRemindChallengeTimes();

            if (countByLimit == 0)
            {
                CommonAutoDestroyTipsView.Open(Localization.Get("ui.dungeon_detail_view.challengeTimesNotEnoughTip"));
                return(false);
            }
            count = Mathf.Min(count, countByAction);
            count = Mathf.Min(count, countByLimit);
            if (isTen)
            {
                count = count <= 1 ? 10: count;
            }

            GameResData ticket        = GlobalData.GetGlobalData().sweepTicket;
            GameResData buyTicketCost = GlobalData.GetGlobalData().buy_sweep_cost;
            int         num           = ItemProxy.instance.GetItemCountByItemID(ticket.id);
            int         buyCount      = count;
            int         needCost      = buyTicketCost.count * buyCount;
            int         cost          = buyCount - num;

            if (cost > 0)
            {
                string tip = string.Format(Localization.Get("ui.dungeon_detail_view.text_sweep_not_enough_tip"), buyCount);
                ConfirmCostTipsView.Open(new GameResData(BaseResType.Diamond, 0, needCost, 0), tip, null, () => {
                    ItemController.instance.CLIENT2LOBBY_BuySweepCouponsReq(buyCount);
                });
                return(false);
            }
            return(true);
        }