/// <summary> /// Looks at the trend(stopped or increasing) of the mask waveform acquisition count for the CSA Scope. /// /// ACQuire:CURRentcount:MASKWfms? /// </summary> /// <param name="scope">the SCOPE object</param> /// <param name="trend">Mask Acquisition Count Trending[increasing|stopped]</param> public void TheCSAMaskWaveformAcquisitionCountShouldBeTrending(ISCOPE scope, string trend) { scope.GetCSACurrentMaskWfmCount(); int initialWfmCount = string.IsNullOrWhiteSpace(scope.CSACurrentMaskCount) ? 0 : int.Parse(scope.CSACurrentMaskCount); _utilitiesGroup.WaitNSeconds(3); scope.GetCSACurrentMaskWfmCount(); int latestWfmCount = string.IsNullOrWhiteSpace(scope.CSACurrentMaskCount) ? 0 : int.Parse(scope.CSACurrentMaskCount); switch (trend) { case "increasing": if (initialWfmCount >= latestWfmCount) { Assert.Fail("The acquisition counts were not increasing"); } break; case "stopped": if (initialWfmCount != latestWfmCount) { Assert.Fail("The acquisition counts were increasing when they should have been stopped"); } break; } }
/// <summary> /// Compares the CSA mask waveform acquisition value should be greater than this value. /// /// ACQuire:CURRentcount:MASKWfms? /// </summary> /// <param name="scope">the SCOPE object</param> /// <param name="time">Amount of time to wait inbetween taking counts</param> public void IWaitUntilCSAMaskShowsWfmAcquisitions(ISCOPE scope, string time) { int currentWfmAcqCount = 0; double totalTime = 0; UTILS.HiPerfTimer Timer1 = new UTILS.HiPerfTimer(); double maxTime = double.Parse(time); //Error checking for a empty string otherwise, parse as normal int initialWfmAcqCount = string.IsNullOrWhiteSpace(scope.CSACurrentMaskCount) ? 0 : int.Parse(scope.CSACurrentMaskCount); // Start the timer, and wait up to the max number of seconds specified for acqs to appear ever 500ms while ((totalTime < maxTime) && (initialWfmAcqCount == currentWfmAcqCount)) { Timer1.Start(); scope.GetCSACurrentMaskWfmCount(); //Error checking for a empty string otherwise, parse as normal currentWfmAcqCount = string.IsNullOrWhiteSpace(scope.CSACurrentMaskCount) ? 0 : int.Parse(scope.CSACurrentMaskCount); 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 (initialWfmAcqCount == currentWfmAcqCount) { Assert.Fail(totalTime + " sec. passed with no acquisitions counted on CSA scope. Max time allowed was " + maxTime + " seconds."); } }
/// <summary> /// Gets the CSA mask waveform acquisition count /// /// </summary> /// <param name="scope">the SCOPE object</param> public void GetCSACurrentMaskWfmCountQuery(ISCOPE scope) { scope.GetCSACurrentMaskWfmCount(); }