/*-------------------------------------------------------------------------
// 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 Raytheon;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Raytheon.Instruments;
using Raytheon.Common;
using NLog;
using System.Windows.Interop;
using ProgramLib;
using NationalInstruments.TestStand.Interop.API;
using System.Runtime.ExceptionServices;
using MeasurementManagerLib;
namespace ProgramLib
{
///
/// Initialization of measurement managers and get methods
///
public partial class Program
{
private ProgramGuiManager _guiManager = null;
internal bool _isUutPwrOn = false;
internal PowerSupplySharedData _powerSupplySharedData = new PowerSupplySharedData();
///
/// Initialize power supply measurement manager
///
///
///
public void InitializePowerSupplyMeasurementManager()
{
try
{
MalMeasurementLibManager.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
TerminateTestOnMainThreadError(ex);
}
}
///
/// Initialize DIO measurement manager
///
///
///
public void InitializeDioMeasurementManager()
{
try
{
MalMeasurementLibManager.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
TerminateTestOnMainThreadError(ex);
}
}
///
/// Initialize switch measurement manager
///
///
///
public void InitializeSwitchMeasurementManager()
{
try
{
MalMeasurementLibManager.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
TerminateTestOnMainThreadError(ex);
}
}
///
/// Initialize GUI manager
///
///
///
public void InitializeGuiManager()
{
try
{
_guiManager = new ProgramGuiManager();
_guiManager.Initialize();
}
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
TerminateTestOnMainThreadError(ex);
}
}
///
/// 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
///
///
///
public void InitializeSupportThreads()
{
try
{
if (_threadList.Count() == 0)
{
_threadList.Add(new FailureMonitorThread());
_threadList.Last().Start();
ICollection