Major upgrade

This commit is contained in:
Duc
2025-10-24 15:18:11 -07:00
parent fd85735c93
commit ce583d1664
478 changed files with 237518 additions and 47610 deletions

View File

@@ -22,177 +22,141 @@ using Raytheon.Common;
namespace Raytheon.Instruments
{
/// <summary>
/// Flow Meter Sim Class
/// </summary>
public class FlowMeterSim : IFlowMeter
{
#region PrivateMembers
private static object _sync = new object();
/// <summary>
/// Flow Meter Sim Class
/// </summary>
public class FlowMeterSim : IFlowMeter
{
#region PrivateMembers
private static object _sync = new object();
public string DetailedStatus => throw new NotImplementedException();
public string DetailedStatus => 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 bool DisplayEnabled { get => throw new NotImplementedException(); set => throw new NotImplementedException(); }
public bool FrontPanelEnabled { get => throw new NotImplementedException(); set => throw new NotImplementedException(); }
public InstrumentMetadata Info => throw new NotImplementedException();
public InstrumentMetadata Info => throw new NotImplementedException();
public string Name { get; set; }
public string Name { get; set; }
public SelfTestResult SelfTestResult => throw new NotImplementedException();
public SelfTestResult SelfTestResult => throw new NotImplementedException();
public State Status => throw new NotImplementedException();
public State Status => throw new NotImplementedException();
/// <summary>
/// Destructor
/// </summary>
~FlowMeterSim()
{
Dispose(false);
}
/// <summary>
/// Destructor
/// </summary>
~FlowMeterSim()
{
Dispose(false);
}
/// <summary>
/// NLog logger
/// </summary>
private readonly ILogger _logger;
/// <summary>
/// Raytheon configuration
/// </summary>
private readonly IConfigurationManager _configurationManager;
private readonly IConfiguration _configuration;
private readonly ILogger _logger;
#endregion
private readonly IConfigurationManager _configurationManager;
private readonly IConfiguration _configuration;
#region PrivateFunctions
#endregion
/// <summary>
/// Dispose of this object's resources
/// </summary>
/// <param name="disposing">Currently disposing</param>
protected virtual void Dispose(bool disposing)
{
try
{
if (disposing)
{
}
}
catch (Exception)
{
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
}
}
}
#endregion
#region PrivateFunctions
#region PublicFunctions
/// <summary>
/// Dispose of this object's resources
/// </summary>
/// <param name="disposing">Currently disposing</param>
protected virtual void Dispose(bool disposing)
{
}
#endregion
/// <summary>
/// FlowMeterOmegaDPF20 factory constructor
/// </summary>
/// <param name="deviceName"></param>
/// <param name="configurationManager"></param>
public FlowMeterSim(string deviceName, IConfigurationManager configurationManager, ILogger logger)
{
Name = deviceName;
#region PublicFunctions
_logger = logger;
/// <summary>
/// FlowMeterOmegaDPF20 factory constructor
/// </summary>
/// <param name="deviceName"></param>
/// <param name="configurationManager"></param>
public FlowMeterSim(string deviceName, IConfigurationManager configurationManager)
{
Name = deviceName;
_configurationManager = configurationManager;
_configuration = _configurationManager.GetConfiguration(Name);
}
_logger = LogManager.GetLogger($"{this.GetType().Name} - {deviceName}");
/// <summary>
///
/// </summary>
/// <param name="name"></param>
public FlowMeterSim(string name)
{
Name = name;
_logger = LogManager.GetCurrentClassLogger();
}
_configurationManager = configurationManager;
_configuration = _configurationManager.GetConfiguration(Name);
}
// This code added to correctly implement the disposable pattern.
[System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Design", "CA1063:ImplementIDisposableCorrectly")]
public void Dispose()
{
try
{
lock (_sync)
{
Dispose(true);
/// <summary>
///
/// </summary>
/// <param name="name"></param>
public FlowMeterSim(string name)
{
Name = name;
_logger = LogManager.GetCurrentClassLogger();
}
GC.SuppressFinalize(this);
}
}
catch (Exception)
{
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
}
}
}
// This code added to correctly implement the disposable pattern.
[System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Design", "CA1063:ImplementIDisposableCorrectly")]
public void Dispose()
{
lock (_sync)
{
Dispose(true);
/// <summary>
/// Query the flow rate from the flow meter
/// </summary>
/// <returns>the flow rate.</returns>
public double ReadFlow()
{
lock (_sync)
{
double max = 0.15;
GC.SuppressFinalize(this);
}
}
double min = .35;
/// <summary>
/// Query the flow rate from the flow meter
/// </summary>
/// <returns>the flow rate.</returns>
public double ReadFlow()
{
lock (_sync)
{
double max = 0.15;
Random rnd = new Random();
double min = .35;
double seed = rnd.NextDouble();
Random rnd = new Random();
double dataToReturn = (seed * (max - min)) + min;
double seed = rnd.NextDouble();
Thread.Sleep(100);
double dataToReturn = (seed * (max - min)) + min;
return dataToReturn;
}
}
Thread.Sleep(100);
public bool ClearErrors()
{
throw new NotImplementedException();
}
return dataToReturn;
}
}
public void Initialize()
{
throw new NotImplementedException();
}
public bool ClearErrors()
{
throw new NotImplementedException();
}
public SelfTestResult PerformSelfTest()
{
throw new NotImplementedException();
}
public void Initialize()
{
throw new NotImplementedException();
}
public void Reset()
{
throw new NotImplementedException();
}
public SelfTestResult PerformSelfTest()
{
throw new NotImplementedException();
}
public void Shutdown()
{
throw new NotImplementedException();
}
public void Reset()
{
throw new NotImplementedException();
}
#endregion
}
public void Shutdown()
{
throw new NotImplementedException();
}
#endregion
}
}