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

@@ -0,0 +1,28 @@
// 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.
-------------------------------------------------------------------------*/
namespace Raytheon.Instruments.PowerSupply
{
/// <summary>
/// A spot to hold application constants
/// </summary>
public static class Constants
{
public const string PowerSupplySystemDefFilename = "POWER_SUPPLY_SYSTEMS.ini";
}
}

View File

@@ -0,0 +1,243 @@
// ******************************************************************************************
// ** **
// ** 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. **
// ** **
// ** WARNING: THIS DOCUMENT CONTAINS TECHNICAL DATA AND / OR TECHNOLOGY WHOSE **
// ** EXPORT OR DISCLOSURE TO NON-U.S.PERSONS, WHEREVER LOCATED, IS RESTRICTED **
// ** BY THE INTERNATIONAL TRAFFIC IN ARMS REGULATIONS (ITAR) (22 C.F.R.SECTION **
// ** 120-130) OR THE EXPORT ADMINISTRATION REGULATIONS(EAR) (15 C.F.R.SECTION **
// ** 730-774). THIS DOCUMENT CANNOT BE EXPORTED(E.G., PROVIDED TO A SUPPLIER **
// ** OUTSIDE OF THE UNITED STATES) OR DISCLOSED TO A NON-U.S.PERSON, WHEREVER **
// ** LOCATED, UNTIL A FINAL JURISDICTION AND CLASSIFICATION DETERMINATION HAS **
// ** BEEN COMPLETED AND APPROVED BY RAYTHEON, AND ANY REQUIRED U.S.GOVERNMENT **
// ** APPROVALS HAVE BEEN OBTAINED. VIOLATIONS ARE SUBJECT TO SEVERE CRIMINAL **
// ** PENALTIES. **
// ** **
// ** CAPITAL EQUIPMENT/SOFTWARE: THIS TECHNICAL DATA WAS DEVELOPED OR ACQUIRED **
// ** EXCLUSIVELY AT CONTRACTOR EXPENSE AND IS INTENDED FOR USE ON MULTIPLE **
// ** PROJECTS/PROGRAMS. **
// ** **
// *******************************************************************************************
using Raytheon.Communication;
using Raytheon.Instruments.PowerSupply;
using System.Collections.Generic;
namespace Raytheon.Instruments
{
/// <summary>
/// An interface for power systems to implement.
/// </summary>
[UmsContract]
public interface IPowerSupplySystem : IInstrument
{
/// <summary>
/// Get the power system error register
/// </summary>
/// <param name="errorCode">The register value</param>
/// <returns></returns>
[UmsCommand( "IPowerSupplySystem.GetErrorCode" )]
string GetErrorCode( out int errorCode );
/// <summary>
/// Get a list of modules that belong to this power system
/// </summary>
/// <returns>A list of modules belonging to this system</returns>
[UmsCommand( "IPowerSupplySystem.GetModuleNames" )]
List<string> GetModuleNames( );
/// <summary>
/// Get the dictionary that contains configuration information for each module
/// </summary>
/// <returns></returns>
Dictionary<string, PowerSupplyModuleInfo> GetPowerSupplyModuleInfoDict(string powerSystem);
/// <summary>
/// Retrieve the programmed OCP value of a module
/// </summary>
/// <param name="moduleName">The module to query</param>
/// <returns>The programmed setting</returns>
[UmsCommand( "IPowerSupplySystem.GetOverCurrentSetting" )]
double GetOverCurrentSetting( string moduleName );
/// <summary>
/// Retrieve the programmed OVP value of a module
/// </summary>
/// <param name="moduleName">The module to query</param>
/// <returns>The programmed setting</returns>
[UmsCommand( "IPowerSupplySystem.GetOverVoltageSetting" )]
double GetOverVoltageSetting( string moduleName );
/// <summary>
/// Retrieve the programmed slew value of a module
/// </summary>
/// <param name="moduleName">The module to query</param>
/// <returns>The programmed setting</returns>
[UmsCommand( "IPowerSupplySystem.GetSlewRate" )]
double GetSlewRate( string name );
/// <summary>
/// returns back system name
/// </summary>
/// <returns></returns>
[UmsCommand( "IPowerSupplySystem.GetSystemName" )]
string GetSystemName( );
/// <summary>
/// Retrieve the programmed voltage setpoint value of a module
/// </summary>
/// <param name="moduleName">The module to query</param>
/// <returns>The programmed setting</returns>
[UmsCommand( "IPowerSupplySystem.GetVoltageSetting" )]
double GetVoltageSetting( string moduleName );
/// <summary>
/// Query a supple to see if output is enabled
/// </summary>
/// <param name="moduleName">The module to query</param>
/// <returns>true if output is on, false if it is off</returns>
[UmsCommand( "IPowerSupplySystem.IsOutputOn" )]
bool IsOutputOn( string moduleName );
/// <summary>
/// Measure the current of a module
/// </summary>
/// <param name="moduleName">The module to query</param>
/// <returns>The measured current</returns>
[UmsCommand( "IPowerSupplySystem.MeasureCurrent" )]
double MeasureCurrent( string moduleName );
/// <summary>
/// Measure the voltage of a module
/// </summary>
/// <param name="moduleName">The module to query</param>
/// <returns>The measured current</returns>
[UmsCommand( "IPowerSupplySystem.MeasureVoltage" )]
double MeasureVoltage( string moduleName );
/// <summary>
/// Turn off a module output
/// </summary>
/// <param name="moduleName">The module to turn off</param>
[UmsCommand( "IPowerSupplySystem.Off" )]
void Off( string moduleName );
/// <summary>
/// Turn on a module output
/// </summary>
/// <param name="moduleName">The module to turn on</param>
[UmsCommand( "IPowerSupplySystem.On" )]
void On( string moduleName );
/// <summary>
/// Read the protection status register
/// </summary>
/// <param name="moduleName">The module to read</param>
/// <returns>The register value</returns>
[UmsCommand( "IPowerSupplySystem.ReadProtectionStatus" )]
int ReadProtectionStatus( string moduleName );
/// <summary>
/// Read the power data for a module
/// </summary>
/// <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 );
/// <summary>
/// Set the slew rate
/// </summary>
/// <param name="moduleName">The module to set</param>
/// <param name="commandedSlew">The slew rate</param>
[UmsCommand( "IPowerSupplySystem.SetSlewRate" )]
void SetSlewRate( string moduleName, double commandedSlew );
/// <summary>
/// Resets the setpoint voltage to that which was passed into the constructor
/// </summary>
/// <param name="moduleName">The module to reset</param>
[UmsCommand( "IPowerSupplySystem.SetInitialVoltage" )]
void SetInitialVoltage( string moduleName );
/// <summary>
/// Set the voltage setpoint. Use this if you want to change the setpoint to a value that is different than what the module was initialized with
/// </summary>
/// <param name="moduleName">The module to set</param>
/// <param name="ocpValue">The value to set it to</param>
[UmsCommand( "IPowerSupplySystem.SetVoltageSetpoint" )]
void SetVoltageSetpoint( string moduleName, double volts );
/// <summary>
/// Disable the system watchdog
/// </summary>
[UmsCommand( "IPowerSupplySystem.WatchdogDisable" )]
void WatchdogDisable( );
/// <summary>
/// Enable the system watchdog
/// </summary>
/// <param name="timeInSeconds">The time in seconds which the app must communicate with the power system before the system get inhibited</param>
[UmsCommand( "IPowerSupplySystem.WatchdogEnable" )]
void WatchdogEnable( uint time );
/// <summary>
/// Set the OCP. Use this if you want to change OCP to a value that is different than what the module was initialized with
/// </summary>
/// <param name="moduleName">The module to set</param>
/// <param name="ocpValue">The value to set it to</param>
[UmsCommand( "IPowerSupplySystem.SetOverCurrentProtection" )]
void SetOverCurrentProtection( string moduleName, double ocpValue );
/// <summary>
/// Set the OVP. Use this if you want to change OVP to a value that is different than what the module was initialized with
/// </summary>
/// <param name="moduleName">The module to set</param>
/// <param name="ocpValue">The value to set it to</param>
[UmsCommand( "IPowerSupplySystem.SetOverVoltageProtection" )]
void SetOverVoltageProtection( string moduleName, double ovpValue );
/// <summary>
/// Send a command and return the response
/// </summary>
/// <param name="commandString"></param>
/// <returns></returns>
[UmsCommand( "IPowerSupplySystem.IOQuery" )]
string IOQuery( string command );
/// <summary>
/// Send a command
/// </summary>
/// <param name="commandString"></param>
[UmsCommand( "IPowerSupplySystem.IOWrite" )]
void IOWrite( string command );
/// <summary>
/// Read the power data for a module
/// </summary>
/// <param name="moduleName">The module to read</param>
/// <returns>THe Power Data</returns>
[UmsCommand( "IPowerSupplySystem.ReadPowerData" )]
PowerData ReadPowerData( string moduleName );
/// <summary>
/// Control the power supply internal mechanical relay state
/// </summary>
/// <param name="moduleName">The module to act on</param>
/// <param name="shallWeConnect">True to connect, false to disconnect</param>
[UmsCommand( "IPowerSupplySystem.MechanicalRelayOutputControl" )]
void MechanicalRelayOutputControl( string moduleName, bool shallWeConnect );
}
}

View File

@@ -0,0 +1,18 @@
<Project Sdk="Microsoft.NET.Sdk">
<Import Project="$(SolutionDir)Solution.props" />
<PropertyGroup>
<TargetFramework>net472</TargetFramework>
<AssemblyName>Raytheon.Instruments.PowerSupplySystem.Contracts</AssemblyName>
<Description>IPowerSupplySystem Instrument Interface</Description>
<Product>HAL</Product>
<!-- Static versioning (Suitable for Development) -->
<!-- Disable the line below for dynamic versioning -->
<Version>1.3.0.0</Version>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Raytheon.Instruments.Contracts" Version="1.6.0" />
</ItemGroup>
</Project>

View File

@@ -0,0 +1,95 @@
// 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.Runtime.Serialization;
namespace Raytheon.Instruments.PowerSupply
{
/// <summary>
/// A container for holding power supply data
/// </summary>
[Serializable]
[DataContract]
public class PowerData
{
/// <summary>
/// The constructor
/// </summary>
/// <param name="voltage"></param>
/// <param name="voltageSetpoint"></param>
/// <param name="overVoltageProtection"></param>
/// <param name="current"></param>
/// <param name="overCurrentProtection"></param>
/// <param name="outputStatus"></param>
/// <param name="faultStatus"></param>
public PowerData(double voltage, double voltageSetpoint, double overVoltageProtection, double current, double overCurrentProtection, bool outputStatus, int faultStatus)
{
Voltage = voltage;
VoltageSetpoint = voltageSetpoint;
OverVoltageProtection = overVoltageProtection;
Current = current;
OverCurrentProtection = overCurrentProtection;
OutputStatus = outputStatus;
FaultStatus = faultStatus;
}
/// <summary>
/// Getter for the Current
/// </summary>
[DataMember]
public double Current { get; set; }
/// <summary>
/// Getter for the fault status
/// </summary>
[DataMember]
public int FaultStatus { get; set; }
/// <summary>
/// Getter for the output status
/// </summary>
[DataMember]
public bool OutputStatus { get; set; }
/// <summary>
/// Getter for OCP value
/// </summary>
[DataMember]
public double OverCurrentProtection { get; set; }
/// <summary>
/// Getter for OVP value
/// </summary>
[DataMember]
public double OverVoltageProtection { get; set; }
/// <summary>
/// Getter for the voltage measurement
/// </summary>
[DataMember]
public double Voltage { get; set; }
/// <summary>
/// Getter for voltage setpoint
/// </summary>
[DataMember]
public double VoltageSetpoint { get; set; }
}
}

View File

@@ -0,0 +1,47 @@
/*-------------------------------------------------------------------------
// 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.PowerSupply
{
public enum ConfigIni
{
// list all the keys here
SCPI_DEF_FILEPATH,
ETHERNET_ADDRESS,
ETHERNET_PORT,
ENABLE_OUTPUT_COUPLING_PROTECTION,
MODULE_DEFINITION,
COUPLED_MODULES,
GROUPED_MODULES,
INDEX,
OCP,
OVP,
VOLTAGE_SETPOINT,
VOLTAGE_SLEW_RATE,
MIN_VOLTAGE,
MAX_VOLTAGE,
MIN_CURRENT,
MAX_CURRENT,
IN_RUSH_DELAY_SECS
}
}

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.PowerSupply
{
public enum ConfigXml
{
// list all the keys here
POWER_SUPPLY_SYSTEM_DEF_FILEPATH
}
}

View File

@@ -0,0 +1,68 @@
/*-------------------------------------------------------------------------
// 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.PowerSupply
{
public class PowerSupplyModuleInfo
{
public PowerSupplyModuleInfo()
{
overCurrentProtection_ = -1.0;
overVoltageProtection_ = -1.0;
voltageSetpoint_ = -1.0;
voltageSlewRate_ = -1.0;
voltageLowerLimit_ = -1.0;
voltageUpperLimit_ = -1.0;
currentLowerLimit_ = -1.0;
currentUpperLimit_ = -1.0;
isOn_ = false;
faultStatus = -1;
}
public PowerSupplyModuleInfo(int moduleIndex, double overCurrentProtection, double overVoltageProtection, double voltageSetpoint, double voltageSlewRate, double minVoltage, double maxVoltage)
{
overCurrentProtection_ = overCurrentProtection;
overVoltageProtection_ = overVoltageProtection;
voltageSetpoint_ = voltageSetpoint;
voltageSlewRate_ = voltageSlewRate;
voltageLowerLimit_ = minVoltage;
voltageUpperLimit_ = maxVoltage;
isOn_ = false;
faultStatus = -1;
moduleNameFormat = $"(@{moduleIndex})";
}
public string moduleNameFormat;
public double overCurrentProtection_;
public double overVoltageProtection_;
public double voltageLowerLimit_;
public double voltageUpperLimit_;
public double currentLowerLimit_;
public double currentUpperLimit_;
public double voltageSetpoint_;
public double voltageSlewRate_;
public bool isOn_;
public int faultStatus;
}
}