Major upgrade
This commit is contained in:
64
Source/Program/TestStand/Util.cs
Normal file
64
Source/Program/TestStand/Util.cs
Normal file
@@ -0,0 +1,64 @@
|
||||
/*-------------------------------------------------------------------------
|
||||
// UNCLASSIFIED
|
||||
/*-------------------------------------------------------------------------
|
||||
RAYTHEON PROPRIETARY: THIS DOCUMENT CONTAINS DATA OR INFORMATION
|
||||
PROPRIETARY TO RAYTHEON COMPANY AND IS RESTRICTED TO USE ONLY BY PERSONS
|
||||
AUTHORIZED BY RAYTHEON COMPANY IN WRITING TO USE IT. DISCLOSURE TO
|
||||
UNAUTHORIZED PERSONS WOULD LIKELY CAUSE SUBSTANTIAL COMPETITIVE HARM TO
|
||||
RAYTHEON COMPANY'S BUSINESS POSITION. NEITHER SAID DOCUMENT NOR ITS
|
||||
CONTENTS SHALL BE FURNISHED OR DISCLOSED TO OR COPIED OR USED BY PERSONS
|
||||
OUTSIDE RAYTHEON COMPANY WITHOUT THE EXPRESS WRITTEN APPROVAL OF RAYTHEON
|
||||
COMPANY.
|
||||
|
||||
THIS PROPRIETARY NOTICE IS NOT APPLICABLE IF DELIVERED TO THE U.S.
|
||||
GOVERNMENT.
|
||||
|
||||
UNPUBLISHED WORK - COPYRIGHT RAYTHEON COMPANY.
|
||||
-------------------------------------------------------------------------*/
|
||||
using NationalInstruments.TestStand.Interop.API;
|
||||
|
||||
namespace TestStand
|
||||
{
|
||||
/// <summary>
|
||||
/// TestStand utility functions
|
||||
/// </summary>
|
||||
internal static class Util
|
||||
{
|
||||
/// <summary>
|
||||
/// Break out of while, do and for loop
|
||||
/// </summary>
|
||||
/// <param name=""></param>
|
||||
/// <returns></returns>
|
||||
public static void BreakOutOfLoop(string endStepComment)
|
||||
{
|
||||
if (ProgramLib.Program.TestStandSeqContext != null)
|
||||
{
|
||||
int numSteps = ProgramLib.Program.TestStandSeqContext.Sequence.GetNumSteps(ProgramLib.Program.TestStandSeqContext.Step.StepGroup);
|
||||
int currentStepIndex = ProgramLib.Program.TestStandSeqContext.Step.StepIndex;
|
||||
|
||||
while (++currentStepIndex < numSteps)
|
||||
{
|
||||
Step step = ProgramLib.Program.TestStandSeqContext.Sequence.GetStep(currentStepIndex, ProgramLib.Program.TestStandSeqContext.Step.StepGroup);
|
||||
|
||||
if (string.Equals(step.AsPropertyObject().Comment, endStepComment, System.StringComparison.OrdinalIgnoreCase))
|
||||
{
|
||||
// we at the end of the Main group
|
||||
if (currentStepIndex == numSteps - 1)
|
||||
{
|
||||
// tells TestStand to go to clean up
|
||||
ProgramLib.Program.TestStandSeqContext.StepGroup = StepGroups.StepGroup_Cleanup;
|
||||
ProgramLib.Program.TestStandSeqContext.NextStepIndex = 0;
|
||||
}
|
||||
else
|
||||
{
|
||||
ProgramLib.Program.TestStandSeqContext.NextStepIndex = ++currentStepIndex;
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user