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

@@ -39,120 +39,122 @@ using System.Diagnostics.CodeAnalysis;
namespace Raytheon.Instruments
{
/// <summary>
/// Instrument manager interface.
/// </summary>
/// <remarks>
/// An instrument manager is responsible for loading all of the instrument plugins and providing an interface for retrieving those instruments.
/// </remarks>
[UmsContract]
public interface IInstrumentManager
{
/// <summary>
/// Gets an instrument by name.
/// </summary>
/// <param name="name">The name.</param>
/// <returns>The instrument</returns>
/// <remarks>This function cannot be named the same as the Generic method GetInstrument/<T/>
/// because certain test executives do not support generics, and will throw an AmbiguousMatchException.</remarks>
IInstrument GetGenericInstrument(string name);
/// <summary>
/// Instrument manager interface.
/// </summary>
/// <remarks>
/// An instrument manager is responsible for loading all of the instrument plugins and providing an interface for retrieving those instruments.
/// </remarks>
[UmsContract]
public interface IInstrumentManager
{
/// <summary>
/// Gets an instrument by name.
/// </summary>
/// <param name="name">The name.</param>
/// <returns>The instrument</returns>
/// <remarks>This function cannot be named the same as the Generic method GetInstrument/<T/>
/// because certain test executives do not support generics, and will throw an AmbiguousMatchException.</remarks>
IInstrument GetGenericInstrument(string name);
/// <summary>
/// Gets an instrument by name.
/// </summary>
/// <param name="name">The name.</param>
/// <returns>The instrument</returns>
T GetInstrument<T>(string name) where T : class;
/// <summary>
/// Gets an instrument by name.
/// </summary>
/// <param name="name">The name.</param>
/// <returns>The instrument</returns>
T GetInstrument<T>(string name) where T : class;
/// <summary>
/// Gets all instruments currently loaded.
/// </summary>
/// <returns>collection of all known instruments</returns>
ICollection<object> GetInstruments();
/// <summary>
/// Gets all instruments currently loaded.
/// </summary>
/// <returns>collection of all known instruments</returns>
ICollection<object> GetInstruments();
/// <summary>
/// Gets all instruments currently loaded.
/// </summary>
/// <returns>array of all known instruments</returns>
[UmsCommand("IInstrumentManager.GetInstrumentsArray")]
object[] GetInstrumentsArray();
/// <summary>
/// Gets all instruments currently loaded.
/// </summary>
/// <returns>array of all known instruments</returns>
[UmsCommand("IInstrumentManager.GetInstrumentsArray")]
object[] GetInstrumentsArray();
/// <summary>
/// Gets the instruments of the given type.
/// </summary>
/// <param name="type">The type.</param>
/// <returns>all known instruments of a certain type</returns>
ICollection<object> GetInstruments(Type type);
/// <summary>
/// Gets the instruments of the given type.
/// </summary>
/// <param name="type">The type.</param>
/// <returns>all known instruments of a certain type</returns>
ICollection<object> GetInstruments(Type type);
/// <summary>
/// Gets the instruments of the given type.
/// </summary>
/// <param name="type">The type.</param>
/// <returns>array of instruments of the specified type</returns>
object[] GetInstrumentsArray(Type type);
/// <summary>
/// Gets the instruments of the given type.
/// </summary>
/// <param name="type">The type.</param>
/// <returns>array of instruments of the specified type</returns>
object[] GetInstrumentsArray(Type type);
/// <summary>
/// Initializes the instrument manager
/// </summary>
[UmsCommand("IInstrumentManager.Initialize")]
void Initialize();
/// <summary>
/// Initializes the instrument manager
/// </summary>
[UmsCommand("IInstrumentManager.Initialize")]
void Initialize();
/// <summary>
/// Sets/Gets the part location
/// Added Dec 2013 to better clarify where the part locations are loading from
/// and to be able to set it before initialization
/// </summary>
string _partsLocation
{
get;
set;
}
/// <summary>
/// Sets/Gets the part location
/// Added Dec 2013 to better clarify where the part locations are loading from
/// and to be able to set it before initialization
/// </summary>
string _partsLocation { get; set; }
/// <summary>
/// Closes the instrument manager
/// </summary>
void Shutdown();
/// <summary>
/// ConfigLocation - where the configuration manager stores config files
/// specifically Instruments.xml
/// </summary>
string _configLocation { get; set; }
/// <summary>
/// Returns a collection of instrument names loaded.
/// </summary>
/// <returns>all the known instrument's unique name</returns>
[SuppressMessage("Microsoft.Design", "CA1024:UsePropertiesWhereAppropriate")]
[UmsCommand("IInstrumentManager.GetInstrumentNames")]
ICollection<string> GetInstrumentNames();
/// <summary>
/// Closes the instrument manager
/// </summary>
void Shutdown();
/// <summary>
/// Returns a collection of instrument names loaded.
/// </summary>
/// <returns>all the known instrument names in array form</returns>
[UmsCommand("IInstrumentManager.GetInstrumentNamesArray")]
string[] GetInstrumentNamesArray();
/// <summary>
/// Returns a collection of instrument names loaded.
/// </summary>
/// <returns>all the known instrument's unique name</returns>
[SuppressMessage("Microsoft.Design", "CA1024:UsePropertiesWhereAppropriate")]
[UmsCommand("IInstrumentManager.GetInstrumentNames")]
ICollection<string> GetInstrumentNames();
/// <summary>
/// Initializes all of the instruments.
/// </summary>
[UmsCommand("IInstrumentManager.InitializeInstruments")]
void InitializeInstruments();
/// <summary>
/// Returns a collection of instrument names loaded.
/// </summary>
/// <returns>all the known instrument names in array form</returns>
[UmsCommand("IInstrumentManager.GetInstrumentNamesArray")]
string[] GetInstrumentNamesArray();
/// <summary>
/// Initializes the instrument.
/// </summary>
/// <param name="instName">Name of the inst.</param>
[UmsCommand("IInstrumentManager.InitializeInstrument")]
void InitializeInstrument(string instName);
/// <summary>
/// Initializes all of the instruments.
/// </summary>
[UmsCommand("IInstrumentManager.InitializeInstruments")]
void InitializeInstruments();
/// <summary>
/// Shuts down all of the instruments.
/// </summary>
[UmsCommand("IInstrumentManager.ShutdownInstruments")]
void ShutdownInstruments();
/// <summary>
/// Initializes the instrument.
/// </summary>
/// <param name="instName">Name of the inst.</param>
[UmsCommand("IInstrumentManager.InitializeInstrument")]
void InitializeInstrument(string instName);
/// <summary>
/// Shutdowns the instrument.
/// </summary>
/// <param name="instName">Name of the inst.</param>
[UmsCommand("IInstrumentManager.ShutdownInstrument")]
void ShutdownInstrument(string instName);
/// <summary>
/// Shuts down all of the instruments.
/// </summary>
[UmsCommand("IInstrumentManager.ShutdownInstruments")]
void ShutdownInstruments();
}
/// <summary>
/// Shutdowns the instrument.
/// </summary>
/// <param name="instName">Name of the inst.</param>
[UmsCommand("IInstrumentManager.ShutdownInstrument")]
void ShutdownInstrument(string instName);
}
}

View File

@@ -1,5 +1,5 @@
// **********************************************************************************************************
// IBit.cs
// CoeComm.cs
// 6/21/2022
// NGI - Next Generation Interceptor
//
@@ -30,55 +30,65 @@
// DISTRIBUTION/DISSEMINATION CONTROL: F
// POC: Alex Kravchenko (1118268)
// **********************************************************************************************************
using Raytheon.Communication;
using System.Collections.Generic;
using Raytheon.Communication;
namespace Raytheon.Instruments
{
[UmsContract]
public interface IBit : IInstrument
public interface CoeComm : IInstrument
{
/// <summary>
/// Open the communication interface
/// </summary>
[UmsCommand( "IBit.Open" )]
void Open( );
[UmsCommand("CoeComm.Open")]
void Open();
/// <summary>
/// Close the communication interface
/// </summary>
[UmsCommand( "IBit.Close" )]
void Close( );
[UmsCommand("CoeComm.Close")]
void Close();
/// <summary>
/// Starts execution of the Built In Test
/// Send a message
/// </summary>
/// <param name="messageId">could be either a label or message name</param>
/// <param name="timeoutInMs">how log to wait in milliseconds</param>
/// <param name="messageParams"></param>
/// <returns></returns>
[UmsCommand( "IBit.RunBIT" )]
bool RunBIT( string messageId, uint timeoutInMs, IEnumerable<KeyValuePair<string, string>> messageParams );
[UmsCommand("CoeComm.SendMessage")]
bool SendMessage(string messageId, IEnumerable<KeyValuePair<string, string>> messageParams);
/// <summary>
/// Starts execution of the Built In Test and waits for result
/// </summary>
/// <param name="messageIdOut">could be either a label or message name</param>
/// <param name="messageIdIn">could be either a label or message name</param>
/// <param name="timeoutInMs">how log to wait in milliseconds</param>
/// <param name="messageParams"></param>
/// <returns></returns>
[UmsCommand( "IBit.RunBITWaitForResults" )]
BitTestResults RunBITWaitForResults( string messageIdOut, string messageIdIn, uint timeoutInMs, IEnumerable<KeyValuePair<string, string>> messageParams );
/// <summary>
/// Retrieve resutls from previously started test
/// Get next response in FIFO Qeueu, meaning we are getting the oldest response
/// </summary>
/// <param name="messageId">could be either a label or message name</param>
/// <returns></returns>
[UmsCommand( "IBit.GetBITResults" )]
BitTestResults GetBITResults( string messageId );
[UmsCommand("CoeComm.GetNextResponseInQueue")]
CoeResponseMsgData GetNextResponseInQueue(string messageId);
/// <summary>
/// Clear the queue for a particular response message.
/// This is useful if we have a large size queue and we don't want to dequeue each item to get
/// to the newest item. So we clear the queue first, before trying to get the newest item in the queue
/// </summary>
/// <param name="messageId">could be either a label or message name</param>
/// <returns></returns>
[UmsCommand("CoeComm.ClearResponseMessageQeue")]
void ClearResponseMessageQueue(string messageId);
/// <summary>
/// Get XML Documents
/// </summary>
/// <returns></returns>
[UmsCommand("CoeComm.GetXmlDocs")]
object GetXmlDocs();
/// <summary>
/// Determine if we should log this message
/// </summary>
/// <returns></returns>
[UmsCommand("CoeComm.ShallLogMessage")]
bool ShallLogMessage(string messageName);
}
}

View File

@@ -2,8 +2,8 @@
<Import Project="$(SolutionDir)Solution.props" />
<PropertyGroup>
<TargetFramework>net472</TargetFramework>
<AssemblyName>Raytheon.Instruments.BIT.Contracts</AssemblyName>
<Description>nterface definition for Built In Test (BIT)</Description>
<AssemblyName>Raytheon.Instruments.CoeComm.Contracts</AssemblyName>
<Description>Interface definition for COE (Common Operator Environment) Communication</Description>
<Product>HAL</Product>
<!-- Static versioning (Suitable for Development) -->

View File

@@ -38,7 +38,7 @@ namespace Raytheon.Instruments
{
[Serializable]
[DataContract]
public class BitTestResult
public class CoeFieldData
{
[DataMember]
public string FieldArrayValue { get; set; }

View File

@@ -40,7 +40,7 @@ namespace Raytheon.Instruments
{
[Serializable]
[DataContract]
public class BitTestResults
public class CoeResponseMsgData
{
[DataMember]
public string Name { get; set; }
@@ -52,11 +52,11 @@ namespace Raytheon.Instruments
public DateTime Time { get; set; }
[DataMember]
public IList<BitTestResult> Results { get; set; }
public IList<CoeFieldData> FieldDataList { get; set; }
public BitTestResult GetResult( string fieldName )
public CoeFieldData GetFieldData( string fieldName )
{
return Results.FirstOrDefault( f => f.FieldName == fieldName );
return FieldDataList.FirstOrDefault( f => f.FieldName == fieldName );
}
}
}

View File

@@ -34,20 +34,20 @@ using System;
namespace Raytheon.Instruments.Exceptions
{
public class BitNotConnectedException : Exception
public class CoeNotConnectedException : Exception
{
public BitNotConnectedException()
: base("BIT Not Connected, please check your settings")
public CoeNotConnectedException()
: base("COE Not Connected, please check your settings")
{
}
public BitNotConnectedException(string message)
: base($"BIT Not Connected, {message}")
public CoeNotConnectedException(string message)
: base(message)
{
}
public BitNotConnectedException(string message, Exception innerException)
: base($"BIT Not Connected, {message}", innerException)
public CoeNotConnectedException(string message, Exception innerException)
: base(message, innerException)
{
}
}

View File

@@ -34,20 +34,20 @@ using System;
namespace Raytheon.Instruments.Exceptions
{
public class BitParseException : Exception
public class CoeParseException : Exception
{
public BitParseException()
: base("BIT Message Parsing Error, please check your settings")
public CoeParseException()
: base("COE Message Parsing Error, please check your settings")
{
}
public BitParseException(string message)
: base($"BIT Message Parsing Error, {message}")
public CoeParseException(string message)
: base(message)
{
}
public BitParseException(string message, Exception innerException)
: base($"BIT Message Parsing Error, {message}", innerException)
public CoeParseException(string message, Exception innerException)
: base(message, innerException)
{
}
}

View File

@@ -34,20 +34,20 @@ using System;
namespace Raytheon.Instruments.Exceptions
{
public class BitTimeoutException : Exception
public class CoeTimeoutException : Exception
{
public BitTimeoutException()
: base("BIT Timed Out, please check your settings")
public CoeTimeoutException()
: base("COE Timed Out, please check your settings")
{
}
public BitTimeoutException(string message)
: base($"BIT Timed Out, {message}")
public CoeTimeoutException(string message)
: base(message)
{
}
public BitTimeoutException(string message, Exception innerException)
: base($"BIT Timed Out, {message}", innerException)
public CoeTimeoutException(string message, Exception innerException)
: base(message, innerException)
{
}
}

View File

@@ -65,7 +65,7 @@ namespace Raytheon.Instruments
/// </summary>
/// <param name="timeout"></param>
[UmsCommand("ICommDevice.SetReadTimeout")]
void SetReadTimeout(uint timeout);
void SetReadTimeout(uint timeoutMs = 0);
/// <summary>
/// Writes data to a communication device

View File

@@ -0,0 +1,31 @@
/*-------------------------------------------------------------------------
// 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 System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace Raytheon.Instruments.Dmm
{
public enum ConfigXml
{
// list all the keys here
IP_ADDRESS
}
}

View File

@@ -37,8 +37,11 @@ namespace Raytheon.Instruments.GeneralIO
COM_PORT,
DIO_ADDRESS,
DIO_PORT,
DIO_OPTIONS,
DEVICE_NUMBER,
PXI_CARD_SLOT_INDEX
BUS_NUMBER,
LXI_IP_ADDRESS
}
}

View File

@@ -12,6 +12,7 @@ namespace Raytheon.Instruments
public struct DIOChannelInfo
{
public uint channelNumber;
public IOType ioType;
public int initialValue;
};

View File

@@ -58,13 +58,13 @@ namespace Raytheon.Instruments
IODatatypes.BitState GetBitState(string signalName);
/// <summary>
/// Get signal names
/// Get all signals
/// </summary>
/// <param></param>
/// <returns>
/// </returns>
[UmsCommand("IGeneralIO.GetSignalNames")]
List<string> GetSignalNames();
Dictionary<string,IODatatypes.DIOChannelInfo> GetAllSignals();
/// <summary>
/// Gets the number of input bits.

View File

@@ -155,7 +155,7 @@ namespace Raytheon.Instruments
/// <param name="moduleName">The module to read</param>
/// <returns>THe Power Data</returns>
[UmsCommand( "IPowerSupplySystem.ReadPowerData" )]
void ReadPowerData( string moduleName, out double voltage, out double voltageSetpoint, out double current, out bool outputStatus, out int faultStatus );
void ReadPowerData( string moduleName, out double voltage, out double voltageSetpoint, out double current, out bool isOutputOn, out int faultStatus );
/// <summary>
/// Set the slew rate

View File

@@ -37,16 +37,16 @@ namespace Raytheon.Instruments.PowerSupply
/// <param name="overVoltageProtection"></param>
/// <param name="current"></param>
/// <param name="overCurrentProtection"></param>
/// <param name="outputStatus"></param>
/// <param name="isOutputOn"></param>
/// <param name="faultStatus"></param>
public PowerData(double voltage, double voltageSetpoint, double overVoltageProtection, double current, double overCurrentProtection, bool outputStatus, int faultStatus)
public PowerData(double voltage, double voltageSetpoint, double overVoltageProtection, double current, double overCurrentProtection, bool isOutputOn, int faultStatus)
{
Voltage = voltage;
VoltageSetpoint = voltageSetpoint;
OverVoltageProtection = overVoltageProtection;
Current = current;
OverCurrentProtection = overCurrentProtection;
OutputStatus = outputStatus;
IsOutputOn = isOutputOn;
FaultStatus = faultStatus;
}
@@ -66,7 +66,7 @@ namespace Raytheon.Instruments.PowerSupply
/// Getter for the output status
/// </summary>
[DataMember]
public bool OutputStatus { get; set; }
public bool IsOutputOn { get; set; }
/// <summary>
/// Getter for OCP value

View File

@@ -0,0 +1,34 @@
/*-------------------------------------------------------------------------
// 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 System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace Raytheon.Instruments.Switch
{
public enum ConfigXml
{
// list all the keys here
LXI_IP_ADDRESS,
DEVICE_NUMBER,
BUS_NUMBER,
SUB_UNIT
}
}