Big changes

This commit is contained in:
Duc
2025-03-13 12:04:22 -07:00
parent c689fcb7f9
commit ffa9905494
748 changed files with 199255 additions and 3743 deletions

View File

@@ -26,9 +26,10 @@ using Raytheon.Instruments;
using Raytheon.Common;
using NLog;
using System.Windows.Interop;
using ProgramGui;
using ProgramLib;
using NationalInstruments.TestStand.Interop.API;
using System.Runtime.ExceptionServices;
using MeasurementManagerLib;
namespace ProgramLib
{
@@ -37,8 +38,6 @@ namespace ProgramLib
/// </summary>
public partial class Program
{
// Declare all the instrument managers here
private PowerSupplyMeasurementManager _psManager = null;
private ProgramGuiManager _guiManager = null;
internal bool _isUutPwrOn = false;
@@ -53,13 +52,48 @@ namespace ProgramLib
{
try
{
_psManager = new PowerSupplyMeasurementManager(_instrumentManager, _fileAndFolderManager.getFile(FileAndFolderManager.Files.POWER_SUPPLY_SELF_TEST_DATETIME));
_psManager.Initialize();
MalMeasurementLibManager.InitializePowerSupplyMeasurementManager();
}
catch (Exception ex)
{
_logger.Error(ex.Message + "\n" + ex.StackTrace);
// 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);
}
}
/// <summary>
/// Initialize DIO measurement manager
/// </summary>
/// <param name=""></param>
/// <returns></returns>
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);
}
}
/// <summary>
/// Initialize switch measurement manager
/// </summary>
/// <param name=""></param>
/// <returns></returns>
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);
@@ -80,8 +114,6 @@ namespace ProgramLib
}
catch (Exception ex)
{
_logger.Error(ex.Message + "\n" + ex.StackTrace);
// 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);
@@ -104,11 +136,11 @@ namespace ProgramLib
_threadList.Add(new FailureMonitorThread());
_threadList.Last().Start();
ICollection<object> psList = _instrumentManager.GetInstruments(typeof(PowerSupply));
ICollection<object> powerSystemList = _instrumentManager.GetInstruments(typeof(IPowerSupplySystem));
foreach (PowerSupply ps in psList)
foreach (IPowerSupplySystem powerSystem in powerSystemList)
{
_threadList.Add(new PowerSupplyReadThread(ps.Name));
_threadList.Add(new PowerSupplyReadThread(powerSystem.Name));
_threadList.Last().Start();
}
@@ -121,33 +153,18 @@ namespace ProgramLib
}
catch (Exception ex)
{
_logger.Error(ex.Message + "\n" + ex.StackTrace);
// 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);
}
}
/// <summary>
/// Get power supply manager object
/// </summary>
/// <param name=""></param>
/// <returns></returns>
public PowerSupplyMeasurementManager GetPowerSupplyMeasurementManager()
{
if (_psManager == null)
InitializePowerSupplyMeasurementManager();
return _psManager;
}
/// <summary>
/// Get Gui manager object
/// </summary>
/// <param name=""></param>
/// <returns></returns>
public ProgramGuiManager GetGuiManager()
internal ProgramGuiManager GetGuiManager()
{
if (_guiManager == null)
InitializeGuiManager();