Beispiel #1
0
        /// <summary>
        /// Gets the number of acquired waveforms from the CSA
        ///
        /// </summary>
        /// <param name="scope">the SCOPE object</param>
        /// <param name="time">anount of time to wait in seconds, default is 10 seconds</param>
        public void WaitSecondsForCSAScopeToShowAcquisitions(ISCOPE scope, string time = "10")
        {
            int    currentAcqCount = 0;
            double totalTime       = 0;

            UTILS.HiPerfTimer Timer1 = new UTILS.HiPerfTimer();

            // Get initial acq count from scope, initialize the time accumulator
            scope.GetCSAAcquisitionCount();
            //Error checking for a empty string otherwise, parse as normal
            int initialAcqCount = string.IsNullOrWhiteSpace(scope.CSAAquisitionCount)
                ? 0
                : int.Parse(scope.CSAAquisitionCount);

            // Start the timer, and wait up to the max number of seconds specified for acqs to appear ever 500ms
            while ((totalTime < double.Parse(time)) && (initialAcqCount == currentAcqCount))
            {
                Timer1.Start();
                scope.GetCSAAcquisitionCount();
                //Error checking for a empty string otherwise, parse as normal
                currentAcqCount = string.IsNullOrWhiteSpace(scope.CSAAquisitionCount)
                    ? 0
                    : int.Parse(scope.CSAAquisitionCount);
                Thread.Sleep(500); // Have to make sure this is between the start/stop commands
                Timer1.Stop();

                // Add the current interval to the total
                totalTime = totalTime + Timer1.Duration;
            }

            if (initialAcqCount == currentAcqCount)
            {
                Assert.Fail(totalTime + " sec. passed with no acquisitions counted on scope. Max time allowed was " +
                            time + " seconds.");
            }
        }
Beispiel #2
0
 /// <summary>
 /// Gets the number of acquired waveforms from the CSA
 ///
 /// </summary>
 /// <param name="scope">the SCOPE object</param>
 public void GetCSAAcquisitionCount(ISCOPE scope)
 {
     scope.GetCSAAcquisitionCount();
 }