Major upgrade
This commit is contained in:
164
Source/Program/TestStand/TestStand.SetupManager.cs
Normal file
164
Source/Program/TestStand/TestStand.SetupManager.cs
Normal file
@@ -0,0 +1,164 @@
|
||||
/*-------------------------------------------------------------------------
|
||||
// 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 System;
|
||||
|
||||
namespace TestStand
|
||||
{
|
||||
/// <summary>
|
||||
/// Provide wrapper functions to initialize instruments, measurements, gui, support threads, etc
|
||||
/// All methods defined in this class must be called from TestStand.
|
||||
/// No other code should be calling these methods outside of TestStand.
|
||||
/// </summary>
|
||||
public static class SetupManager
|
||||
{
|
||||
/// <summary>
|
||||
/// Initialize power supply measurement manager
|
||||
/// </summary>
|
||||
/// <param name=""></param>
|
||||
/// <returns></returns>
|
||||
public static void InitializePowerSupplyMeasurementManager()
|
||||
{
|
||||
try
|
||||
{
|
||||
ProgramLib.Program.Instance().InitializePowerSupplyMeasurementManager();
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
// DO NOT THROW in this block
|
||||
// this function will handle the error accordingly since we could be calling this from third-party test executive like TestStand
|
||||
ProgramManager.TerminateTestOnMainThreadError(ex);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Initialize DIO measurement manager
|
||||
/// </summary>
|
||||
/// <param name=""></param>
|
||||
/// <returns></returns>
|
||||
public static void InitializeDioMeasurementManager()
|
||||
{
|
||||
try
|
||||
{
|
||||
ProgramLib.Program.Instance().InitializeDioMeasurementManager();
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
// DO NOT THROW in this block
|
||||
// this function will handle the error accordingly since we could be calling this from third-party test executive like TestStand
|
||||
ProgramManager.TerminateTestOnMainThreadError(ex);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Initialize switch measurement manager
|
||||
/// </summary>
|
||||
/// <param name=""></param>
|
||||
/// <returns></returns>
|
||||
public static void InitializeSwitchMeasurementManager()
|
||||
{
|
||||
try
|
||||
{
|
||||
ProgramLib.Program.Instance().InitializeSwitchMeasurementManager();
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
// DO NOT THROW in this block
|
||||
// this function will handle the error accordingly since we could be calling this from third-party test executive like TestStand
|
||||
ProgramManager.TerminateTestOnMainThreadError(ex);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Initialize switch measurement manager
|
||||
/// </summary>
|
||||
/// <param name=""></param>
|
||||
/// <returns></returns>
|
||||
public static void InitializeCoeMeasurementManager()
|
||||
{
|
||||
try
|
||||
{
|
||||
ProgramLib.Program.Instance().InitializeCoeMeasurementManager();
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
// DO NOT THROW in this block
|
||||
// this function will handle the error accordingly since we could be calling this from third-party test executive like TestStand
|
||||
ProgramManager.TerminateTestOnMainThreadError(ex);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Initialize serial devices
|
||||
/// </summary>
|
||||
/// <param name=""></param>
|
||||
/// <returns></returns>
|
||||
public static void InitializeSerialDevices()
|
||||
{
|
||||
try
|
||||
{
|
||||
ProgramLib.Program.Instance().InitializeSerialDevices();
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
// DO NOT THROW in this block
|
||||
// this function will handle the error accordingly since we could be calling this from third-party test executive like TestStand
|
||||
ProgramManager.TerminateTestOnMainThreadError(ex);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Initialize GUI manager
|
||||
/// </summary>
|
||||
/// <param name=""></param>
|
||||
/// <returns></returns>
|
||||
public static void InitializeGuiManager()
|
||||
{
|
||||
try
|
||||
{
|
||||
ProgramLib.Program.Instance().InitializeGuiManager();
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
// DO NOT THROW in this block
|
||||
// this function will handle the error accordingly since we could be calling this from third-party test executive like TestStand
|
||||
ProgramManager.TerminateTestOnMainThreadError(ex);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Start all the monitor/read threads here
|
||||
/// Call this only after ProgramGuiManager and PowerSupplyManager has been initialized since these threads could be
|
||||
/// accessing those objects
|
||||
/// </summary>
|
||||
/// <param name=""></param>
|
||||
/// <returns></returns>
|
||||
public static void InitializeSupportThreads()
|
||||
{
|
||||
try
|
||||
{
|
||||
ProgramLib.Program.Instance().InitializeSupportThreads();
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
// DO NOT THROW in this block
|
||||
// this function will handle the error accordingly since we could be calling this from third-party test executive like TestStand
|
||||
ProgramManager.TerminateTestOnMainThreadError(ex);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user