Major upgrade
This commit is contained in:
@@ -15,294 +15,261 @@ GOVERNMENT.
|
||||
UNPUBLISHED WORK - COPYRIGHT RAYTHEON COMPANY.
|
||||
-------------------------------------------------------------------------*/
|
||||
|
||||
using System;
|
||||
using FpgaMeasurementInstrumentsLib;
|
||||
using NLog;
|
||||
using Raytheon.Common;
|
||||
using System;
|
||||
|
||||
namespace Raytheon.Instruments
|
||||
{
|
||||
/// <summary>
|
||||
/// A class that implements the Teradyne HSS Sub System Card
|
||||
/// </summary>
|
||||
public class CommFpgaHssubCardSs : IFpgaComm
|
||||
{
|
||||
#region PrivateClassMembers
|
||||
private readonly string _name;
|
||||
private readonly string _cardAddress;
|
||||
private readonly uint _startingOffset;
|
||||
private readonly string _firmware;
|
||||
private readonly string _memMap;
|
||||
private uint _cardHandle;
|
||||
private SelfTestResult _selfTestResult;
|
||||
/// <summary>
|
||||
/// A class that implements the Teradyne HSS Sub System Card
|
||||
/// </summary>
|
||||
public class CommFpgaHssubCardSs : IFpgaComm
|
||||
{
|
||||
#region PrivateClassMembers
|
||||
private readonly string _name;
|
||||
private readonly string _cardAddress;
|
||||
private readonly uint _startingOffset;
|
||||
private readonly string _firmware;
|
||||
private readonly string _memMap;
|
||||
private uint _cardHandle;
|
||||
private SelfTestResult _selfTestResult;
|
||||
|
||||
/// <summary>
|
||||
/// NLog logger
|
||||
/// </summary>
|
||||
private readonly ILogger _logger;
|
||||
/// <summary>
|
||||
/// Raytheon configuration
|
||||
/// </summary>
|
||||
private readonly IConfigurationManager _configurationManager;
|
||||
private readonly IConfiguration _configuration;
|
||||
private readonly ILogger _logger;
|
||||
|
||||
public string DetailedStatus => throw new NotImplementedException();
|
||||
private readonly IConfigurationManager _configurationManager;
|
||||
private readonly IConfiguration _configuration;
|
||||
|
||||
public bool DisplayEnabled { get => throw new NotImplementedException(); set => throw new NotImplementedException(); }
|
||||
public bool FrontPanelEnabled { get => throw new NotImplementedException(); set => throw new NotImplementedException(); }
|
||||
public string DetailedStatus => throw new NotImplementedException();
|
||||
|
||||
public InstrumentMetadata Info => throw new NotImplementedException();
|
||||
public bool DisplayEnabled { get => throw new NotImplementedException(); set => throw new NotImplementedException(); }
|
||||
public bool FrontPanelEnabled { get => throw new NotImplementedException(); set => throw new NotImplementedException(); }
|
||||
|
||||
public string Name { get; set; }
|
||||
public InstrumentMetadata Info => throw new NotImplementedException();
|
||||
|
||||
public SelfTestResult SelfTestResult => throw new NotImplementedException();
|
||||
public string Name { get; set; }
|
||||
|
||||
public State Status => throw new NotImplementedException();
|
||||
public SelfTestResult SelfTestResult => throw new NotImplementedException();
|
||||
|
||||
#endregion
|
||||
public State Status => throw new NotImplementedException();
|
||||
|
||||
#region PrivateFunctions
|
||||
#endregion
|
||||
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
/// <param name="disposing"></param>
|
||||
protected virtual void Dispose(bool disposing)
|
||||
{
|
||||
try
|
||||
{
|
||||
if (disposing)
|
||||
{
|
||||
int ret = HssubNativeMethods.terHsi_close(_cardHandle);
|
||||
}
|
||||
}
|
||||
catch (Exception err)
|
||||
{
|
||||
try
|
||||
{
|
||||
ErrorLogger.Instance().Write(err.Message + "\r\n" + err.StackTrace);
|
||||
}
|
||||
catch (Exception)
|
||||
{
|
||||
//Do not rethrow. Exception from error logger that has already been garbage collected
|
||||
}
|
||||
}
|
||||
}
|
||||
#region PrivateFunctions
|
||||
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
public void LoadFirmware()
|
||||
{
|
||||
ushort customerId = 0;
|
||||
ushort appId = 0;
|
||||
uint revId = 0;
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
/// <param name="disposing"></param>
|
||||
protected virtual void Dispose(bool disposing)
|
||||
{
|
||||
if (disposing)
|
||||
{
|
||||
HssubNativeMethods.terHsi_close(_cardHandle);
|
||||
}
|
||||
}
|
||||
|
||||
int ret = HssubNativeMethods.terHsi_Firmware_Load(_cardHandle, HssubNativeMethods.TERHSI_FPGA_TEST_DEFINED, _firmware, ref customerId, ref appId, ref revId);
|
||||
if (ret != 0)
|
||||
{
|
||||
string errorStr = HssUtilSs.BuildErrorString(_cardHandle, ret, _name);
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
public void LoadFirmware()
|
||||
{
|
||||
ushort customerId = 0;
|
||||
ushort appId = 0;
|
||||
uint revId = 0;
|
||||
|
||||
throw new Exception("terHsi_Firmware_Load() returned an error(" + ret + ")" + ": " + errorStr);
|
||||
}
|
||||
}
|
||||
int ret = HssubNativeMethods.terHsi_Firmware_Load(_cardHandle, HssubNativeMethods.TERHSI_FPGA_TEST_DEFINED, _firmware, ref customerId, ref appId, ref revId);
|
||||
if (ret != 0)
|
||||
{
|
||||
string errorStr = HssUtilSs.BuildErrorString(_cardHandle, ret, _name);
|
||||
|
||||
#endregion
|
||||
throw new Exception("terHsi_Firmware_Load() returned an error(" + ret + ")" + ": " + errorStr);
|
||||
}
|
||||
}
|
||||
|
||||
#region PublicFuctions
|
||||
#endregion
|
||||
|
||||
/// <summary>
|
||||
/// CommFpgaHssubCardSs factory constructor
|
||||
/// </summary>
|
||||
/// <param name="deviceName"></param>
|
||||
/// <param name="configurationManager"></param>
|
||||
public CommFpgaHssubCardSs(string deviceName, IConfigurationManager configurationManager, ILogger logger)
|
||||
{
|
||||
Name = deviceName;
|
||||
#region PublicFuctions
|
||||
|
||||
_logger = logger;
|
||||
/// <summary>
|
||||
/// CommFpgaHssubCardSs factory constructor
|
||||
/// </summary>
|
||||
/// <param name="deviceName"></param>
|
||||
/// <param name="configurationManager"></param>
|
||||
public CommFpgaHssubCardSs(string deviceName, IConfigurationManager configurationManager)
|
||||
{
|
||||
Name = deviceName;
|
||||
|
||||
_configurationManager = configurationManager;
|
||||
_configuration = _configurationManager.GetConfiguration(Name);
|
||||
_logger = LogManager.GetLogger($"{this.GetType().Name} - {deviceName}");
|
||||
|
||||
_cardAddress = _configuration.GetConfigurationValue("CommFpgaHssubCardSs", "CardAddress", "127.0.0.1");
|
||||
_startingOffset = _configuration.GetConfigurationValue<uint>("CommFpgaHssubCardSs", "StartingOffset", 0);
|
||||
_firmware = _configuration.GetConfigurationValue("CommFpgaHssubCardSs", "Firmware", "");
|
||||
_memMap = _configuration.GetConfigurationValue("CommFpgaHssubCardSs", "MemMap", "");
|
||||
_cardHandle = 0;
|
||||
_configurationManager = configurationManager;
|
||||
_configuration = _configurationManager.GetConfiguration(Name);
|
||||
|
||||
LoadFirmware();
|
||||
}
|
||||
_cardAddress = _configuration.GetConfigurationValue("CommFpgaHssubCardSs", "CardAddress", "127.0.0.1");
|
||||
_startingOffset = _configuration.GetConfigurationValue<uint>("CommFpgaHssubCardSs", "StartingOffset", 0);
|
||||
_firmware = _configuration.GetConfigurationValue("CommFpgaHssubCardSs", "Firmware", "");
|
||||
_memMap = _configuration.GetConfigurationValue("CommFpgaHssubCardSs", "MemMap", "");
|
||||
_cardHandle = 0;
|
||||
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
/// <param name="name"></param>
|
||||
/// <param name="cardAddress"></param>
|
||||
/// <param name="startingOffset"></param>
|
||||
/// <param name="firmware"></param>
|
||||
/// <param name="memMap"></param>
|
||||
public CommFpgaHssubCardSs(string name, string cardAddress, int startingOffset, string firmware, string memMap)
|
||||
{
|
||||
// hold onto args
|
||||
_name = name;
|
||||
_logger = LogManager.GetCurrentClassLogger();
|
||||
_cardAddress = cardAddress;
|
||||
_startingOffset = (uint)startingOffset;
|
||||
_firmware = firmware;
|
||||
_memMap = memMap;
|
||||
_cardHandle = 0;
|
||||
LoadFirmware();
|
||||
}
|
||||
|
||||
LoadFirmware();
|
||||
}
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
/// <param name="deviceName"></param>
|
||||
/// <param name="cardAddress"></param>
|
||||
/// <param name="startingOffset"></param>
|
||||
/// <param name="firmware"></param>
|
||||
/// <param name="memMap"></param>
|
||||
public CommFpgaHssubCardSs(string deviceName, string cardAddress, int startingOffset, string firmware, string memMap)
|
||||
{
|
||||
// hold onto args
|
||||
_name = deviceName;
|
||||
_logger = LogManager.GetLogger($"{this.GetType().Name} - {deviceName}");
|
||||
_cardAddress = cardAddress;
|
||||
_startingOffset = (uint)startingOffset;
|
||||
_firmware = firmware;
|
||||
_memMap = memMap;
|
||||
_cardHandle = 0;
|
||||
|
||||
/// <summary>
|
||||
/// The finalizer.
|
||||
/// </summary>
|
||||
~CommFpgaHssubCardSs()
|
||||
{
|
||||
Dispose(false);
|
||||
}
|
||||
LoadFirmware();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
public void Dispose()
|
||||
{
|
||||
try
|
||||
{
|
||||
Dispose(true);
|
||||
/// <summary>
|
||||
/// The finalizer.
|
||||
/// </summary>
|
||||
~CommFpgaHssubCardSs()
|
||||
{
|
||||
Dispose(false);
|
||||
}
|
||||
|
||||
GC.SuppressFinalize(this);
|
||||
}
|
||||
catch (Exception err)
|
||||
{
|
||||
try
|
||||
{
|
||||
ErrorLogger.Instance().Write(err.Message + "\r\n" + err.StackTrace);
|
||||
}
|
||||
catch (Exception)
|
||||
{
|
||||
//Do not rethrow. Exception from error logger that has already been garbage collected
|
||||
}
|
||||
}
|
||||
}
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
public void Dispose()
|
||||
{
|
||||
Dispose(true);
|
||||
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
public string GetMemMap()
|
||||
{
|
||||
return _memMap;
|
||||
}
|
||||
GC.SuppressFinalize(this);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// reads FPGA value from address
|
||||
/// </summary>
|
||||
/// <param name="fpgaName"></param>
|
||||
/// <param name="address"></param>
|
||||
/// <returns></returns>
|
||||
/// <exception cref="Exception"></exception>
|
||||
public uint Read(string fpgaName, uint address)
|
||||
{
|
||||
uint dataRead = 0;
|
||||
int ret = HssubNativeMethods.terHsi_LB_Read32(_cardHandle, _startingOffset + address, ref dataRead);
|
||||
if (ret != 0)
|
||||
{
|
||||
string errorStr = HssUtilSs.BuildErrorString(_cardHandle, ret, _name);
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
public string GetMemMap()
|
||||
{
|
||||
return _memMap;
|
||||
}
|
||||
|
||||
throw new Exception("terHsi_LB_Read32() returned an error(" + ret + ")" + ": " + errorStr);
|
||||
}
|
||||
/// <summary>
|
||||
/// reads FPGA value from address
|
||||
/// </summary>
|
||||
/// <param name="fpgaName"></param>
|
||||
/// <param name="address"></param>
|
||||
/// <returns></returns>
|
||||
/// <exception cref="Exception"></exception>
|
||||
public uint Read(string fpgaName, uint address)
|
||||
{
|
||||
uint dataRead = 0;
|
||||
int ret = HssubNativeMethods.terHsi_LB_Read32(_cardHandle, _startingOffset + address, ref dataRead);
|
||||
if (ret != 0)
|
||||
{
|
||||
string errorStr = HssUtilSs.BuildErrorString(_cardHandle, ret, _name);
|
||||
|
||||
return dataRead;
|
||||
}
|
||||
throw new Exception("terHsi_LB_Read32() returned an error(" + ret + ")" + ": " + errorStr);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// reads block
|
||||
/// </summary>
|
||||
/// <param name="address"></param>
|
||||
/// <param name="numberOfWordsToRead"></param>
|
||||
/// <param name="shallWeIncrementAddress"></param>
|
||||
/// <param name="dataRead"></param>
|
||||
public void ReadBlock(string fpgaName, uint address, uint numberOfWordsToRead, bool shallWeIncrementAddress, ref uint[] dataRead)
|
||||
{
|
||||
throw new NotImplementedException();
|
||||
}
|
||||
return dataRead;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// writes value to fpga address
|
||||
/// </summary>
|
||||
/// <param name="address"></param>
|
||||
/// <param name="value"></param>
|
||||
public void Write(string fpgaName, uint address, uint value)
|
||||
{
|
||||
int ret = HssubNativeMethods.terHsi_LB_Write32(_cardHandle, _startingOffset + address, value);
|
||||
if (ret != 0)
|
||||
{
|
||||
string errorStr = HssUtilSs.BuildErrorString(_cardHandle, ret, _name);
|
||||
/// <summary>
|
||||
/// reads block
|
||||
/// </summary>
|
||||
/// <param name="address"></param>
|
||||
/// <param name="numberOfWordsToRead"></param>
|
||||
/// <param name="shallWeIncrementAddress"></param>
|
||||
/// <param name="dataRead"></param>
|
||||
public void ReadBlock(string fpgaName, uint address, uint numberOfWordsToRead, bool shallWeIncrementAddress, ref uint[] dataRead)
|
||||
{
|
||||
throw new NotImplementedException();
|
||||
}
|
||||
|
||||
throw new Exception("terHsi_LB_Write32() returned an error(" + ret + ")" + ": " + errorStr);
|
||||
}
|
||||
}
|
||||
/// <summary>
|
||||
/// writes value to fpga address
|
||||
/// </summary>
|
||||
/// <param name="address"></param>
|
||||
/// <param name="value"></param>
|
||||
public void Write(string fpgaName, uint address, uint value)
|
||||
{
|
||||
int ret = HssubNativeMethods.terHsi_LB_Write32(_cardHandle, _startingOffset + address, value);
|
||||
if (ret != 0)
|
||||
{
|
||||
string errorStr = HssUtilSs.BuildErrorString(_cardHandle, ret, _name);
|
||||
|
||||
/// <summary>
|
||||
/// writes block
|
||||
/// </summary>
|
||||
/// <param name="address"></param>
|
||||
/// <param name="numberOfWordsToWrite"></param>
|
||||
/// <param name="data"></param>
|
||||
/// <param name="shallWeIncrementAddress"></param>
|
||||
public void WriteBlock(string fpgaName, uint address, uint numberOfWordsToWrite, uint[] data, bool shallWeIncrementAddress)
|
||||
{
|
||||
throw new Exception("Not Implemented");
|
||||
}
|
||||
throw new Exception("terHsi_LB_Write32() returned an error(" + ret + ")" + ": " + errorStr);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// initialize fpga
|
||||
/// </summary>
|
||||
/// <param name="fpgaName"></param>
|
||||
public void Initialize(string fpgaName)
|
||||
{
|
||||
Initialize();
|
||||
}
|
||||
/// <summary>
|
||||
/// writes block
|
||||
/// </summary>
|
||||
/// <param name="address"></param>
|
||||
/// <param name="numberOfWordsToWrite"></param>
|
||||
/// <param name="data"></param>
|
||||
/// <param name="shallWeIncrementAddress"></param>
|
||||
public void WriteBlock(string fpgaName, uint address, uint numberOfWordsToWrite, uint[] data, bool shallWeIncrementAddress)
|
||||
{
|
||||
throw new Exception("Not Implemented");
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Loads firmware
|
||||
/// </summary>
|
||||
/// <param name="fpgaName"></param>
|
||||
public void LoadFirmware(string fpgaName)
|
||||
{
|
||||
Initialize(fpgaName);
|
||||
}
|
||||
/// <summary>
|
||||
/// initialize fpga
|
||||
/// </summary>
|
||||
/// <param name="fpgaName"></param>
|
||||
public void Initialize(string fpgaName)
|
||||
{
|
||||
Initialize();
|
||||
}
|
||||
|
||||
public bool ClearErrors()
|
||||
{
|
||||
return false;
|
||||
}
|
||||
/// <summary>
|
||||
/// Loads firmware
|
||||
/// </summary>
|
||||
/// <param name="fpgaName"></param>
|
||||
public void LoadFirmware(string fpgaName)
|
||||
{
|
||||
Initialize(fpgaName);
|
||||
}
|
||||
|
||||
public void Initialize()
|
||||
{
|
||||
LoadFirmware();
|
||||
}
|
||||
public bool ClearErrors()
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
public SelfTestResult PerformSelfTest()
|
||||
{
|
||||
_selfTestResult = SelfTestResult.Unknown;
|
||||
return _selfTestResult;
|
||||
}
|
||||
public void Initialize()
|
||||
{
|
||||
LoadFirmware();
|
||||
}
|
||||
|
||||
public void Reset()
|
||||
{
|
||||
Shutdown();
|
||||
public SelfTestResult PerformSelfTest()
|
||||
{
|
||||
_selfTestResult = SelfTestResult.Unknown;
|
||||
return _selfTestResult;
|
||||
}
|
||||
|
||||
Initialize();
|
||||
}
|
||||
public void Reset()
|
||||
{
|
||||
Shutdown();
|
||||
|
||||
public void Shutdown()
|
||||
{
|
||||
Dispose();
|
||||
}
|
||||
#endregion
|
||||
}
|
||||
Initialize();
|
||||
}
|
||||
|
||||
public void Shutdown()
|
||||
{
|
||||
Dispose();
|
||||
}
|
||||
#endregion
|
||||
}
|
||||
}
|
||||
|
||||
@@ -30,71 +30,64 @@
|
||||
// DISTRIBUTION/DISSEMINATION CONTROL: F
|
||||
// POC: Alex Kravchenko (1118268)
|
||||
// **********************************************************************************************************
|
||||
using NLog;
|
||||
using Raytheon.Common;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.ComponentModel.Composition;
|
||||
using System.IO;
|
||||
using System.Reflection;
|
||||
using NLog;
|
||||
using Raytheon.Common;
|
||||
|
||||
namespace Raytheon.Instruments
|
||||
{
|
||||
[ExportInstrumentFactory(ModelNumber = "CommFpgaHssubCardSsFactory")]
|
||||
public class CommFpgaHssubCardSsFactory : IInstrumentFactory
|
||||
{
|
||||
/// <summary>
|
||||
/// The supported interfaces
|
||||
/// </summary>
|
||||
private readonly List<Type> _supportedInterfaces = new List<Type>();
|
||||
private ILogger _logger;
|
||||
private readonly IConfigurationManager _configurationManager;
|
||||
private const string DefaultConfigPath = @"C:\ProgramData\Raytheon\InstrumentManagerService";
|
||||
private static string DefaultPath;
|
||||
[ExportInstrumentFactory(ModelNumber = "CommFpgaHssubCardSsFactory")]
|
||||
public class CommFpgaHssubCardSsFactory : IInstrumentFactory
|
||||
{
|
||||
private readonly List<Type> _supportedInterfaces = new List<Type>();
|
||||
|
||||
public CommFpgaHssubCardSsFactory(string defaultConfigPath = DefaultConfigPath)
|
||||
: this(null, defaultConfigPath)
|
||||
{
|
||||
}
|
||||
private readonly IConfigurationManager _configurationManager;
|
||||
private const string DefaultConfigPath = @"C:\ProgramData\Raytheon\InstrumentManagerService";
|
||||
private static string DefaultPath;
|
||||
|
||||
/// <summary>
|
||||
/// COECommDeviceInstrumentFactory injection constructor
|
||||
/// </summary>
|
||||
/// <param name="configManager"></param>
|
||||
/// <param name="simEngine"></param>
|
||||
/// <param name="logger"></param>
|
||||
[ImportingConstructor]
|
||||
public CommFpgaHssubCardSsFactory([Import(AllowDefault = false)] IConfigurationManager configManager,
|
||||
[Import(AllowDefault = true)] string defaultConfigPath = null)
|
||||
{
|
||||
DefaultPath = defaultConfigPath;
|
||||
public CommFpgaHssubCardSsFactory(string defaultConfigPath = DefaultConfigPath)
|
||||
: this(null, defaultConfigPath)
|
||||
{
|
||||
}
|
||||
|
||||
if (LogManager.Configuration == null)
|
||||
{
|
||||
var assemblyFolder = Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location);
|
||||
LogManager.Configuration = new NLog.Config.XmlLoggingConfiguration(assemblyFolder + "\\nlog.config");
|
||||
}
|
||||
/// <summary>
|
||||
/// CommFpgaHssubCardSsFactory injection constructor
|
||||
/// </summary>
|
||||
[ImportingConstructor]
|
||||
public CommFpgaHssubCardSsFactory([Import(AllowDefault = false)] IConfigurationManager configManager,
|
||||
[Import(AllowDefault = true)] string defaultConfigPath = null)
|
||||
{
|
||||
DefaultPath = defaultConfigPath;
|
||||
|
||||
_configurationManager = configManager ?? GetConfigurationManager();
|
||||
_supportedInterfaces.Add(typeof(IFpgaComm));
|
||||
}
|
||||
/// <summary>
|
||||
/// Gets the instrument
|
||||
/// </summary>
|
||||
/// <param name="name"></param>
|
||||
/// <returns></returns>
|
||||
public IInstrument GetInstrument(string name)
|
||||
{
|
||||
try
|
||||
{
|
||||
_logger = LogManager.GetLogger(name);
|
||||
return new CommFpgaHssubCardSs(name, _configurationManager, _logger);
|
||||
}
|
||||
catch (Exception)
|
||||
{
|
||||
throw;
|
||||
}
|
||||
}
|
||||
if (LogManager.Configuration == null)
|
||||
{
|
||||
var assemblyFolder = Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location);
|
||||
LogManager.Configuration = new NLog.Config.XmlLoggingConfiguration(assemblyFolder + "\\nlog.config");
|
||||
}
|
||||
|
||||
_configurationManager = configManager ?? GetConfigurationManager();
|
||||
_supportedInterfaces.Add(typeof(IFpgaComm));
|
||||
}
|
||||
/// <summary>
|
||||
/// Gets the instrument
|
||||
/// </summary>
|
||||
/// <param name="name"></param>
|
||||
/// <returns></returns>
|
||||
public IInstrument GetInstrument(string name)
|
||||
{
|
||||
try
|
||||
{
|
||||
return new CommFpgaHssubCardSs(name, _configurationManager);
|
||||
}
|
||||
catch (Exception)
|
||||
{
|
||||
throw;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Gets the instrument
|
||||
@@ -105,12 +98,10 @@ namespace Raytheon.Instruments
|
||||
{
|
||||
try
|
||||
{
|
||||
_logger = LogManager.GetLogger(name);
|
||||
|
||||
if (simulateHw)
|
||||
return new CommFpgaSim(name, _configurationManager, _logger);
|
||||
return new CommFpgaSim(name, _configurationManager);
|
||||
else
|
||||
return new CommFpgaHssubCardSs(name, _configurationManager, _logger);
|
||||
return new CommFpgaHssubCardSs(name, _configurationManager);
|
||||
}
|
||||
catch (Exception)
|
||||
{
|
||||
@@ -123,17 +114,17 @@ namespace Raytheon.Instruments
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
public ICollection<Type> GetSupportedInterfaces()
|
||||
{
|
||||
return _supportedInterfaces.ToArray();
|
||||
}
|
||||
{
|
||||
return _supportedInterfaces.ToArray();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// returns configuration based on the predefined path or default path c:/ProgramData/Raytheon/InstrumentManagerService
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
private static IConfigurationManager GetConfigurationManager()
|
||||
{
|
||||
return string.IsNullOrEmpty(DefaultPath) ? new RaytheonConfigurationManager() : new RaytheonConfigurationManager(DefaultPath);
|
||||
}
|
||||
}
|
||||
/// <summary>
|
||||
/// returns configuration based on the predefined path or default path c:/ProgramData/Raytheon/InstrumentManagerService
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
private static IConfigurationManager GetConfigurationManager()
|
||||
{
|
||||
return string.IsNullOrEmpty(DefaultPath) ? new RaytheonConfigurationManager() : new RaytheonConfigurationManager(DefaultPath);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user