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

@@ -15,15 +15,17 @@ GOVERNMENT.
UNPUBLISHED WORK - COPYRIGHT RAYTHEON COMPANY.
-------------------------------------------------------------------------*/
using NationalInstruments.TestStand.Interop.API;
using NLog;
using Raytheon.Instruments;
using System;
using System.IO;
using System.Reflection;
using System.Collections.Generic;
using System.Linq;
using NationalInstruments.TestStand.Interop.API;
using NLog;
using Raytheon.Instruments;
using Raytheon.Common;
using MeasurementManagerLib;
namespace ProgramLib
{
@@ -31,7 +33,6 @@ namespace ProgramLib
/// Class for interfacing with any Test Executive such as third party test executive such as Test Stand
/// DO NOT implement IDisposable interface for this class. If there are unmanaged resources that need to be freed,
/// do it in the destructor.
///
/// </summary>
public partial class Program
{
@@ -65,15 +66,19 @@ namespace ProgramLib
internal EventManager _eventManager = new EventManager();
internal FileAndFolderManager _fileAndFolderManager;
internal IConfigurationFile _programConfig { get; private set; }
internal MalMeasurementLibManager MalMeasurementLibManager { get; private set; }
internal string _testMethodConfigFilePath;
internal bool SttoSuccess { get; set; }
/// <summary>
/// Create an instance of this class. Only one instance is allowed
/// </summary>
/// <param name="partNumber">The UUT part number</param>
/// <param name="serialNumber">The UUT serial number</param>
/// <param name="isThereHardware">false for simulation</param>
/// <returns></returns>
public static Program Instance(string partNumber = "", string serialNumber = "", bool isThereHardware = true, object testStandSeqContext = null)
/// Create an instance of this class. Only one instance is allowed
/// </summary>
/// <param name="partNumber">The UUT part number</param>
/// <param name="serialNumber">The UUT serial number</param>
/// <param name="isThereHardware">false for simulation</param>
/// <returns></returns>
public static Program Instance(string partNumber = "", string serialNumber = "", bool isThereHardware = true, object testStandSeqContext = null)
{
if (_program == null)
{
@@ -130,6 +135,8 @@ namespace ProgramLib
string assemblyFolder = Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location);
_programConfig = new ConfigurationFile(Path.Combine(assemblyFolder, GeneralConstants.ProgramConfigFilename));
_testMethodConfigFilePath = Path.Combine(assemblyFolder, GeneralConstants.TestMethodConfigFolderName, GeneralConstants.TestMethodConfigFileName);
_fileAndFolderManager = new FileAndFolderManager(_programConfig);
if (testStandSeqContext != null)
@@ -152,17 +159,22 @@ namespace ProgramLib
_serialNumber = serialNumber;
_isThereHardware = isThereHardware;
SttoSuccess = false;
// Initialze all other configuration that the program needs
_uutInfo = new UutInfo(_partNumber, _serialNumber);
try
{
var configFolder = Path.Combine(assemblyFolder, Raytheon.Common.GeneralConstants.InstrumentConfigFolder);
var configFolder = Path.Combine(assemblyFolder, Raytheon.Common.Constants.InstrumentConfigFolder);
_instrumentManager = new GeneralInstrumentManager(assemblyFolder, configFolder, _isThereHardware);
_instrumentManager.Initialize();
MalMeasurementLibManager = new MalMeasurementLibManager(_instrumentManager);
}
catch (Exception)
{
throw;
}
}
@@ -211,6 +223,8 @@ namespace ProgramLib
{
if (_testStandSeqContext != null)
{
_logger.Error(ex.Message + "\n" + ex.StackTrace);
lock (_terminateTestSyncObj)
{
if (!_terminateTestInitiated)