Big changes
@@ -15,22 +15,13 @@ GOVERNMENT.
|
||||
|
||||
UNPUBLISHED WORK - COPYRIGHT RAYTHEON COMPANY.
|
||||
-------------------------------------------------------------------------*/
|
||||
using ProgramLib;
|
||||
using NLog;
|
||||
using Raytheon.Common;
|
||||
using Raytheon.Instruments;
|
||||
using ProgramLib.GUI.Model;
|
||||
using ProgramLib.GUI.View;
|
||||
using ProgramLib.GUI.ViewModel;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading;
|
||||
using System.Threading.Tasks;
|
||||
using ProgramGui;
|
||||
using ProgramGui.Model;
|
||||
using ProgramGui.View;
|
||||
using ProgramGui.ViewModel;
|
||||
using System.Windows;
|
||||
using Raytheon;
|
||||
|
||||
namespace ProgramLib
|
||||
{
|
||||
@@ -72,13 +63,13 @@ namespace ProgramLib
|
||||
|
||||
if (Program.Instance()._isUutPwrOn)
|
||||
{
|
||||
Program.Instance().GetPowerSupplyMeasurementManager()[PowerSupplyConstants.POWER_DEVICE.STE_POWER_SUPPLY_SYSTEM].OutputDisable(ProgramLib.PowerSupplyConstants.POWER_DEVICE.STE_PVM_5V);
|
||||
Program.Instance().MalMeasurementLibManager.PowerSupplyMeasurementManager.OutputDisable("STE_PVM_5V");
|
||||
// enable front panel
|
||||
Program.Instance().GetPowerSupplyMeasurementManager()[PowerSupplyConstants.POWER_DEVICE.STE_POWER_SUPPLY_SYSTEM].FrontPanelEnabled = true;
|
||||
Program.Instance().MalMeasurementLibManager.PowerSupplyMeasurementManager.DisplayEnable("STE_POWER_SUPPLY_SYSTEM");
|
||||
|
||||
ProgramLib.Program.Instance().GetGuiManager()[ProgramGuiManager.WINDOWS.MAIN].Dispatcher.Invoke((Action)delegate
|
||||
ProgramLib.Program.Instance().GetGuiManager()[ProgramGuiManager.WINDOWS.LIVE_DATA].Dispatcher.Invoke((Action)delegate
|
||||
{
|
||||
ProgramLib.Program.Instance().GetGuiManager()[ProgramGuiManager.WINDOWS.MAIN].Hide();
|
||||
ProgramLib.Program.Instance().GetGuiManager()[ProgramGuiManager.WINDOWS.LIVE_DATA].Hide();
|
||||
});
|
||||
|
||||
Program.Instance()._eventManager[EventManager.Events.UUT_POWER_ON].Reset();
|
||||
@@ -112,7 +103,7 @@ namespace ProgramLib
|
||||
Task.Factory.StartNew(() => PerformSttoTask());
|
||||
ProgramLib.Program.Instance().GetGuiManager()[ProgramGuiManager.WINDOWS.IMPEDANCE_CHECK].Dispatcher.Invoke((Action)delegate
|
||||
{
|
||||
ProgramLib.Program.Instance().GetGuiManager()[ProgramGuiManager.WINDOWS.MAIN].Hide();
|
||||
ProgramLib.Program.Instance().GetGuiManager()[ProgramGuiManager.WINDOWS.LIVE_DATA].Hide();
|
||||
|
||||
ProgramLib.Program.Instance().GetGuiManager()[ProgramGuiManager.WINDOWS.IMPEDANCE_CHECK].ShowDialog();
|
||||
});
|
||||
@@ -123,13 +114,13 @@ namespace ProgramLib
|
||||
|
||||
ProgramLib.Program.Instance().GetGuiManager()[ProgramGuiManager.WINDOWS.IMPEDANCE_CHECK].Dispatcher.Invoke((Action)delegate
|
||||
{
|
||||
ProgramLib.Program.Instance().GetGuiManager()[ProgramGuiManager.WINDOWS.MAIN].Show();
|
||||
ProgramLib.Program.Instance().GetGuiManager()[ProgramGuiManager.WINDOWS.LIVE_DATA].Show();
|
||||
});
|
||||
|
||||
Program.Instance().GetPowerSupplyMeasurementManager()[PowerSupplyConstants.POWER_DEVICE.STE_POWER_SUPPLY_SYSTEM].OutputEnable(ProgramLib.PowerSupplyConstants.POWER_DEVICE.STE_PVM_5V);
|
||||
Program.Instance().MalMeasurementLibManager.PowerSupplyMeasurementManager.OutputEnable("STE_PVM_5V");
|
||||
|
||||
// disable front panel
|
||||
Program.Instance().GetPowerSupplyMeasurementManager()[PowerSupplyConstants.POWER_DEVICE.STE_POWER_SUPPLY_SYSTEM].FrontPanelEnabled = false;
|
||||
Program.Instance().MalMeasurementLibManager.PowerSupplyMeasurementManager.DisplayDisable("STE_POWER_SUPPLY_SYSTEM");
|
||||
|
||||
Program.Instance()._eventManager[EventManager.Events.UUT_POWER_OFF].Reset();
|
||||
Program.Instance()._eventManager[EventManager.Events.UUT_POWER_ON].Set();
|
||||
@@ -166,7 +157,7 @@ namespace ProgramLib
|
||||
string measurementStatus = "PASSED";
|
||||
|
||||
ImpedanceCheckWindowViewModel.Images passFailImage = ImpedanceCheckWindowViewModel.Images.PASS_CHECK;
|
||||
impedanceCheckWindow._viewModel.ClearData();
|
||||
impedanceCheckWindow.ViewModel.ClearData();
|
||||
int MAX_ITERATION = 15;
|
||||
int cableNum = 17;
|
||||
int cablePin1 = 5;
|
||||
@@ -184,7 +175,7 @@ namespace ProgramLib
|
||||
_sttoSuccess = false;
|
||||
}
|
||||
|
||||
impedanceDataModel.PassFailImagePath = impedanceCheckWindow._viewModel._imageToResourcePathDict[passFailImage];
|
||||
impedanceDataModel.PassFailImagePath = impedanceCheckWindow.ViewModel.ImageToResourcePathDict[passFailImage];
|
||||
impedanceDataModel.Description = $"{measurementName} Measured {measurement} Range [0,50]";
|
||||
|
||||
if (Program.Instance()._testStandSeqContext != null)
|
||||
@@ -192,7 +183,7 @@ namespace ProgramLib
|
||||
Program.Instance()._testStandSeqContext.Step.AdditionalResults.CustomResults.Insert($"\"{measurementName}\"", $"\"Measured: {measurement++} Range [0,50] - {measurementStatus}\"");
|
||||
}
|
||||
|
||||
impedanceCheckWindow._viewModel.AddData(impedanceDataModel);
|
||||
impedanceCheckWindow.ViewModel.AddData(impedanceDataModel);
|
||||
|
||||
if (!_sttoSuccess)
|
||||
{
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
/*-------------------------------------------------------------------------
|
||||
/*-------------------------------------------------------------------------
|
||||
// UNCLASSIFIED
|
||||
/*-------------------------------------------------------------------------
|
||||
RAYTHEON PROPRIETARY: THIS DOCUMENT CONTAINS DATA OR INFORMATION
|
||||
@@ -15,28 +15,23 @@ GOVERNMENT.
|
||||
|
||||
UNPUBLISHED WORK - COPYRIGHT RAYTHEON COMPANY.
|
||||
-------------------------------------------------------------------------*/
|
||||
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using ProgramLib;
|
||||
using Raytheon.Common;
|
||||
|
||||
namespace ProgramLib
|
||||
{
|
||||
/// <summary>
|
||||
/// Power supply constants
|
||||
/// </summary>
|
||||
internal static class PowerSupplyConstants
|
||||
internal abstract class BasicTest
|
||||
{
|
||||
public enum POWER_DEVICE
|
||||
{
|
||||
STE_POWER_SUPPLY_SYSTEM,
|
||||
protected abstract void CheckPrerequisite();
|
||||
|
||||
// Power modules
|
||||
UUT_REF_3_3V,
|
||||
STE_PVM_5V,
|
||||
STE_GU_INTERFACE_RELAYS_25V,
|
||||
STE_GU_INTERFACE_RF_INTERFACE_5V,
|
||||
protected abstract void ExecuteTest();
|
||||
|
||||
public void RunTest()
|
||||
{
|
||||
CheckPrerequisite();
|
||||
ExecuteTest();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -29,6 +29,7 @@ namespace ProgramLib
|
||||
internal static class GeneralConstants
|
||||
{
|
||||
public const string ProgramConfigFilename = "config.ini";
|
||||
public const string DefaultConfigValue = "NOTSET";
|
||||
public const string TestMethodConfigFolderName = "TestMethodConfig";
|
||||
public const string TestMethodConfigFileName = "Test_Method_Configuration.ini";
|
||||
}
|
||||
}
|
||||
@@ -1,4 +1,5 @@
|
||||
using System;
|
||||
using Raytheon.Instruments.PowerSupply;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
@@ -13,7 +14,7 @@ namespace ProgramLib
|
||||
{
|
||||
public double _voltage;
|
||||
public double _current;
|
||||
public Raytheon.Instruments.PowerSupplies.PowerSupplyModuleInfo _powerSupplyModuleInfo;
|
||||
public PowerSupplyModuleInfo _powerSupplyModuleInfo;
|
||||
public bool _initialized;
|
||||
|
||||
/// <summary>
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
using System;
|
||||
using Raytheon.Instruments.PowerSupply;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
@@ -18,7 +19,7 @@ namespace ProgramLib
|
||||
/// <summary>
|
||||
/// Set data for a power supply module
|
||||
/// </summary>
|
||||
public void SetData(string moduleName, double voltage, double current, Raytheon.Instruments.PowerSupplies.PowerSupplyModuleInfo powerSupplyModuleInfo)
|
||||
public void SetData(string moduleName, double voltage, double current, PowerSupplyModuleInfo powerSupplyModuleInfo)
|
||||
{
|
||||
lock (syncObj)
|
||||
{
|
||||
@@ -28,7 +29,7 @@ namespace ProgramLib
|
||||
syncObjDict[moduleName] = new object();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
lock (syncObjDict[moduleName])
|
||||
{
|
||||
if (!_powerSupplyDataDict.ContainsKey(moduleName))
|
||||
|
||||
206
Source/Program/FunctionalTests/GMA_ATP_001_UUT_STTO.cs
Normal file
@@ -0,0 +1,206 @@
|
||||
/*-------------------------------------------------------------------------
|
||||
// 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 NLog;
|
||||
using ProgramLib.GUI.Model;
|
||||
using ProgramLib.GUI.View;
|
||||
using ProgramLib.GUI.ViewModel;
|
||||
using Raytheon.Common;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Threading.Tasks;
|
||||
using System.Windows;
|
||||
using static MeasurementManagerLib.SwitchMeasurementManager;
|
||||
|
||||
namespace ProgramLib
|
||||
{
|
||||
/// <summary>
|
||||
/// GMA/AUR TRD GMA_ATP_001 - UUT STTO
|
||||
/// </summary>
|
||||
internal class GMA_ATP_001_UUT_STTO : BasicTest
|
||||
{
|
||||
private readonly Dictionary<string, DMMResistanceMeasurementFields> _dmmResistanceMeasurements = new Dictionary<string, DMMResistanceMeasurementFields>(StringComparer.InvariantCultureIgnoreCase);
|
||||
private List<string> _relayExclusionList;
|
||||
private static NLog.ILogger _logger;
|
||||
|
||||
private bool _sttoSuccess = false;
|
||||
private string fatalErrorMsg;
|
||||
|
||||
public GMA_ATP_001_UUT_STTO()
|
||||
{
|
||||
_logger = LogManager.GetCurrentClassLogger();
|
||||
ParseMeasurementDef();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Execute Test
|
||||
/// </summary>
|
||||
protected override void ExecuteTest()
|
||||
{
|
||||
Task.Factory.StartNew(() => PerformSttoTask());
|
||||
ProgramLib.Program.Instance().GetGuiManager()[ProgramGuiManager.WINDOWS.IMPEDANCE_CHECK].Dispatcher.Invoke((Action)delegate
|
||||
{
|
||||
ProgramLib.Program.Instance().GetGuiManager()[ProgramGuiManager.WINDOWS.LIVE_DATA].Hide();
|
||||
|
||||
ProgramLib.Program.Instance().GetGuiManager()[ProgramGuiManager.WINDOWS.IMPEDANCE_CHECK].ShowDialog();
|
||||
});
|
||||
|
||||
Program.Instance().SttoSuccess = _sttoSuccess;
|
||||
|
||||
if (!_sttoSuccess)
|
||||
{
|
||||
throw new Exception(fatalErrorMsg);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Check Pre Conditions
|
||||
/// </summary>
|
||||
protected override void CheckPrerequisite()
|
||||
{
|
||||
// add pre req checks as needed
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Perform Safe-to-turn-on checks
|
||||
/// </summary>
|
||||
private void PerformSttoTask()
|
||||
{
|
||||
ImpedanceDataModel impedanceDataModel;
|
||||
ImpedanceCheckWindow impedanceCheckWindow = (ImpedanceCheckWindow)ProgramLib.Program.Instance().GetGuiManager()[ProgramGuiManager.WINDOWS.IMPEDANCE_CHECK];
|
||||
|
||||
try
|
||||
{
|
||||
_logger?.Debug($"{this.GetType().Name}::PerformSttoTask() running...");
|
||||
|
||||
_sttoSuccess = true;
|
||||
string measurementStatus = "PASSED";
|
||||
|
||||
ImpedanceCheckWindowViewModel.Images passFailImage = ImpedanceCheckWindowViewModel.Images.PASS_CHECK;
|
||||
impedanceCheckWindow.ViewModel.ClearData();
|
||||
|
||||
foreach (KeyValuePair<string, DMMResistanceMeasurementFields> measurement in _dmmResistanceMeasurements)
|
||||
{
|
||||
impedanceDataModel = new ImpedanceDataModel();
|
||||
double testResult = Program.Instance().MalMeasurementLibManager.SwitchMeasurementManager.DmmReadResistance(measurement.Key);
|
||||
|
||||
if (testResult < measurement.Value._lowerLimit || testResult > measurement.Value._upperLimit)
|
||||
{
|
||||
passFailImage = ImpedanceCheckWindowViewModel.Images.FAIL_CHECK;
|
||||
measurementStatus = "FAILED";
|
||||
_sttoSuccess = false;
|
||||
}
|
||||
|
||||
impedanceDataModel.PassFailImagePath = impedanceCheckWindow.ViewModel.ImageToResourcePathDict[passFailImage];
|
||||
impedanceDataModel.Description = $"{measurement.Value._cableAndPinId} Measured {testResult.ToString("0.00")} Range [{measurement.Value._lowerLimit},{measurement.Value._upperLimit}]";
|
||||
|
||||
if (Program.Instance()._testStandSeqContext != null)
|
||||
{
|
||||
Program.Instance()._testStandSeqContext.Step.AdditionalResults.CustomResults.Insert($"\"{measurement.Value._cableAndPinId}\"", $"\"Measured: {testResult.ToString("0.00")} Range [{measurement.Value._lowerLimit},{measurement.Value._upperLimit}] - {measurementStatus}\"");
|
||||
}
|
||||
|
||||
impedanceCheckWindow.ViewModel.AddData(impedanceDataModel);
|
||||
|
||||
if (!_sttoSuccess)
|
||||
{
|
||||
fatalErrorMsg = impedanceDataModel.Description;
|
||||
}
|
||||
}
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
_logger.Error(ex.Message + "\n" + ex.StackTrace);
|
||||
}
|
||||
finally
|
||||
{
|
||||
if (!_sttoSuccess)
|
||||
{
|
||||
impedanceCheckWindow.Dispatcher.Invoke((Action)delegate
|
||||
{
|
||||
impedanceCheckWindow.btnClose.Visibility = Visibility.Visible;
|
||||
});
|
||||
}
|
||||
else
|
||||
{
|
||||
impedanceCheckWindow.Dispatcher.Invoke((Action)delegate
|
||||
{
|
||||
impedanceCheckWindow.Hide();
|
||||
});
|
||||
}
|
||||
|
||||
_logger?.Debug($"{this.GetType().Name}::PerformSttoTask() exiting...");
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Parses the ini file for measurement definitions
|
||||
/// Populates the Dictionaries with the enum names and ini file data
|
||||
/// </summary>
|
||||
private void ParseMeasurementDef()
|
||||
{
|
||||
const string MAIN_SECTION_NAME = "GMA_ATP_001_UUT_STTO";
|
||||
const string DMM_RESISTANCE_SECTION_NAME = $"{MAIN_SECTION_NAME}.DMM_RESISTANCE_MEASUREMENTS";
|
||||
const string RELAY_EXCLUSION_SECTION_NAME = $"{MAIN_SECTION_NAME}.RELAY_EXCLUSION_LIST";
|
||||
|
||||
const string EXCLUSION_LIST_KEY = "EXCLUSION_LIST";
|
||||
ConfigurationFile configurationFile = new ConfigurationFile(Program.Instance()._testMethodConfigFilePath);
|
||||
|
||||
const char COMMA_DELIM = ',';
|
||||
|
||||
// read in relay exclusion list
|
||||
string relayExclusions = configurationFile.ReadValue<string>(RELAY_EXCLUSION_SECTION_NAME, EXCLUSION_LIST_KEY);
|
||||
_relayExclusionList = relayExclusions.Split(COMMA_DELIM).ToList();
|
||||
|
||||
for (int i = 0; i < _relayExclusionList.Count; ++i)
|
||||
{
|
||||
_relayExclusionList[i] = _relayExclusionList[i].TrimEnd(' ');
|
||||
_relayExclusionList[i] = _relayExclusionList[i].TrimStart(' ');
|
||||
}
|
||||
|
||||
List<string> keys = configurationFile.ReadAllKeys(DMM_RESISTANCE_SECTION_NAME);
|
||||
foreach (string key in keys)
|
||||
{
|
||||
List<string> valueList = configurationFile.ReadList<string>(DMM_RESISTANCE_SECTION_NAME, key);
|
||||
|
||||
int index = 0;
|
||||
string pcode = valueList[index++];
|
||||
double range = Convert.ToDouble(valueList[index++]);
|
||||
double res = Convert.ToDouble(valueList[index++]);
|
||||
int delay = Convert.ToInt32(valueList[index++]);
|
||||
double scaleFactor = Convert.ToDouble(valueList[index++]);
|
||||
|
||||
List<string> relayList = valueList[index++].Split(COMMA_DELIM).ToList();
|
||||
for (int i = 0; i < relayList.Count; ++i)
|
||||
{
|
||||
relayList[i] = relayList[i].Trim();
|
||||
}
|
||||
|
||||
string resistanceTypeStr = valueList[index++].Trim();
|
||||
DMMResistanceType type = (DMMResistanceType)Enum.Parse(typeof(DMMResistanceType), resistanceTypeStr, true);
|
||||
string cableAndPinId = valueList[index++];
|
||||
double lowerLimit = Convert.ToDouble(valueList[index++]);
|
||||
double upperLimit = Convert.ToDouble(valueList[index++]);
|
||||
|
||||
_dmmResistanceMeasurements.Add(key.ToUpper(), new DMMResistanceMeasurementFields(pcode, range, res, delay, scaleFactor, relayList, type, cableAndPinId, lowerLimit, upperLimit));
|
||||
}
|
||||
|
||||
Program.Instance().MalMeasurementLibManager.SwitchMeasurementManager.DmmResistanceMeasurements = _dmmResistanceMeasurements;
|
||||
Program.Instance().MalMeasurementLibManager.SwitchMeasurementManager.RelayExclusionList = _relayExclusionList;
|
||||
}
|
||||
}
|
||||
}
|
||||
13
Source/Program/GUI/Model/ImpedanceDataModel.cs
Normal file
@@ -0,0 +1,13 @@
|
||||
using CommunityToolkit.Mvvm.ComponentModel;
|
||||
|
||||
namespace ProgramLib.GUI.Model
|
||||
{
|
||||
internal partial class ImpedanceDataModel : ObservableObject
|
||||
{
|
||||
[ObservableProperty]
|
||||
private string passFailImagePath;
|
||||
|
||||
[ObservableProperty]
|
||||
private string description;
|
||||
}
|
||||
}
|
||||
76
Source/Program/GUI/Model/PassthroughData.Types.cs
Normal file
@@ -0,0 +1,76 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace ProgramLib.GUI.Model
|
||||
{
|
||||
internal partial class PassthroughData
|
||||
{
|
||||
private struct VariableInfo
|
||||
{
|
||||
// index into where the item is located in the dictionary
|
||||
public int passthroughDataModelDictIndex { get; set; }
|
||||
// index into where the item is located in the data model
|
||||
// the data model contains more than one item
|
||||
public int passthroughDataModelItemIndex { get; set; }
|
||||
}
|
||||
public enum Variables
|
||||
{
|
||||
VAR1,
|
||||
VAR2,
|
||||
VAR3,
|
||||
VAR4,
|
||||
VAR5,
|
||||
VAR6,
|
||||
VAR7,
|
||||
VAR8,
|
||||
VAR9,
|
||||
VAR10,
|
||||
VAR11,
|
||||
VAR12,
|
||||
VAR13,
|
||||
VAR14,
|
||||
VAR15,
|
||||
VAR16,
|
||||
VAR17,
|
||||
VAR18,
|
||||
VAR19,
|
||||
VAR20,
|
||||
VAR21,
|
||||
VAR22,
|
||||
VAR23,
|
||||
VAR24,
|
||||
VAR25,
|
||||
VAR26,
|
||||
VAR27,
|
||||
VAR28,
|
||||
VAR29,
|
||||
VAR30,
|
||||
VAR31,
|
||||
VAR32,
|
||||
VAR33,
|
||||
VAR34,
|
||||
VAR35,
|
||||
VAR36,
|
||||
VAR37,
|
||||
VAR38,
|
||||
VAR39,
|
||||
VAR40,
|
||||
VAR41,
|
||||
VAR42,
|
||||
};
|
||||
|
||||
private Dictionary<Variables, string> _variableEnumToDescriptionDict = new Dictionary<Variables, string>
|
||||
{
|
||||
{ Variables.VAR1, "IDA Temp" },
|
||||
{ Variables.VAR2, "FPGA Temp" },
|
||||
{ Variables.VAR3, "IDA Bias" },
|
||||
{ Variables.VAR4, "TINT" },
|
||||
{ Variables.VAR5, "Pitch" },
|
||||
{ Variables.VAR6, "Yaw" },
|
||||
{ Variables.VAR7, "Roll" },
|
||||
};
|
||||
}
|
||||
}
|
||||
63
Source/Program/GUI/Model/PassthroughData.cs
Normal file
@@ -0,0 +1,63 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Collections.ObjectModel;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using System.Windows;
|
||||
|
||||
namespace ProgramLib.GUI.Model
|
||||
{
|
||||
internal partial class PassthroughData
|
||||
{
|
||||
private int _datagridColumnCount = 0;
|
||||
// this dictionary stores variable and the info needed to locate it in the passthroughdatamodel dictionary which contains a 2-d array
|
||||
private Dictionary<Variables, VariableInfo> _variableEnumToVariableInfoDict = new Dictionary<Variables, VariableInfo>();
|
||||
|
||||
// this dictionary stores variable and its corresponding data model
|
||||
private Dictionary<int, ObservableCollection<string>> _rowNumberToPassthroughDataDict = new Dictionary<int, ObservableCollection<string>>();
|
||||
|
||||
public PassthroughData(int datagridColumnCount)
|
||||
{
|
||||
_datagridColumnCount = datagridColumnCount;
|
||||
VariableInfo variableInfo = new VariableInfo();
|
||||
|
||||
int dictIndex = 0;
|
||||
int colIndex = 0;
|
||||
// contruct a 2-d array of strings based on the list of Variables
|
||||
foreach (Variables enumVar in Enum.GetValues(typeof(Variables)))
|
||||
{
|
||||
if (_rowNumberToPassthroughDataDict.Count == 0 || colIndex == _datagridColumnCount)
|
||||
{
|
||||
dictIndex++;
|
||||
_rowNumberToPassthroughDataDict[dictIndex] = new ObservableCollection<string>(new string[_datagridColumnCount]);
|
||||
colIndex = 0;
|
||||
}
|
||||
|
||||
// name of the variable
|
||||
_rowNumberToPassthroughDataDict[dictIndex][colIndex] = String.Empty;
|
||||
variableInfo.passthroughDataModelItemIndex = colIndex++;
|
||||
|
||||
// value of the variable
|
||||
_rowNumberToPassthroughDataDict[dictIndex][colIndex++] = String.Empty;
|
||||
|
||||
// save the row index so we can refer to this item
|
||||
variableInfo.passthroughDataModelDictIndex = dictIndex;
|
||||
|
||||
// save the column index of this item so we can refer to this item
|
||||
_variableEnumToVariableInfoDict[enumVar] = variableInfo;
|
||||
}
|
||||
}
|
||||
|
||||
public Dictionary<int, ObservableCollection<string>> GetPassthroughDataModelDict()
|
||||
{
|
||||
return _rowNumberToPassthroughDataDict;
|
||||
}
|
||||
|
||||
public void SetValue(Variables variableName, string val)
|
||||
{
|
||||
_rowNumberToPassthroughDataDict[_variableEnumToVariableInfoDict[variableName].passthroughDataModelDictIndex][_variableEnumToVariableInfoDict[variableName].passthroughDataModelItemIndex] = _variableEnumToDescriptionDict[variableName];
|
||||
_rowNumberToPassthroughDataDict[_variableEnumToVariableInfoDict[variableName].passthroughDataModelDictIndex][_variableEnumToVariableInfoDict[variableName].passthroughDataModelItemIndex + 1] = val;
|
||||
}
|
||||
}
|
||||
}
|
||||
14
Source/Program/GUI/Model/PowerModuleDataModel.cs
Normal file
@@ -0,0 +1,14 @@
|
||||
using CommunityToolkit.Mvvm.ComponentModel;
|
||||
|
||||
namespace ProgramLib.GUI.Model
|
||||
{
|
||||
internal partial class PowerModuleDataModel : ObservableObject
|
||||
{
|
||||
[ObservableProperty]
|
||||
private string expectedVoltage;
|
||||
[ObservableProperty]
|
||||
private string actualVoltage;
|
||||
[ObservableProperty]
|
||||
private string actualCurrent;
|
||||
}
|
||||
}
|
||||
112
Source/Program/GUI/ProgramGuiManager.cs
Normal file
@@ -0,0 +1,112 @@
|
||||
using NLog;
|
||||
using ProgramLib.GUI.View;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Threading;
|
||||
using System.Windows;
|
||||
using System.Windows.Threading;
|
||||
|
||||
namespace ProgramLib
|
||||
{
|
||||
internal class ProgramGuiManager : IDisposable
|
||||
{
|
||||
#region Private Members
|
||||
private Thread _guiManagerThread;
|
||||
private static NLog.ILogger _logger;
|
||||
private Dictionary<WINDOWS, Window> _windowDict = new Dictionary<WINDOWS, Window>();
|
||||
private ManualResetEvent _allGuiInitializedEvent = new ManualResetEvent(false);
|
||||
private bool _isDisposed = false;
|
||||
#endregion
|
||||
|
||||
#region Public Members
|
||||
public enum WINDOWS
|
||||
{
|
||||
LIVE_DATA,
|
||||
IMPEDANCE_CHECK
|
||||
}
|
||||
#endregion
|
||||
|
||||
/// <summary>
|
||||
/// constructor
|
||||
/// </summary>
|
||||
public ProgramGuiManager()
|
||||
{
|
||||
_logger = LogManager.GetCurrentClassLogger();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// The Finalizer
|
||||
/// Do not call Dispose() in here
|
||||
/// </summary>
|
||||
~ProgramGuiManager()
|
||||
{
|
||||
_logger?.Debug($"Entering {this.GetType().Name}::{System.Reflection.MethodBase.GetCurrentMethod().Name}() ...");
|
||||
}
|
||||
|
||||
public Window this[WINDOWS window]
|
||||
{
|
||||
get { return _windowDict[window]; }
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Initialize all the GUIs
|
||||
/// </summary>
|
||||
public void Initialize()
|
||||
{
|
||||
_guiManagerThread = new Thread(new ThreadStart(GuiManagerThread));
|
||||
_guiManagerThread.SetApartmentState(ApartmentState.STA);
|
||||
_guiManagerThread.Start();
|
||||
|
||||
_allGuiInitializedEvent.WaitOne();
|
||||
}
|
||||
|
||||
private void GuiManagerThread()
|
||||
{
|
||||
_logger?.Debug($"{this.GetType().Name}::{System.Reflection.MethodBase.GetCurrentMethod().Name}() is running...");
|
||||
|
||||
// instantiate all the windows here
|
||||
_windowDict[WINDOWS.LIVE_DATA] = new LiveDataWindow();
|
||||
_windowDict[WINDOWS.IMPEDANCE_CHECK] = new ImpedanceCheckWindow();
|
||||
|
||||
_allGuiInitializedEvent.Set();
|
||||
|
||||
// Enter the event queue
|
||||
Dispatcher.Run();
|
||||
|
||||
_logger?.Debug($"{this.GetType().Name}::{System.Reflection.MethodBase.GetCurrentMethod().Name}() is exiting...");
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Dispose of this object.
|
||||
/// </summary>
|
||||
public void Dispose()
|
||||
{
|
||||
_logger?.Debug($"Entering {this.GetType().Name}::{System.Reflection.MethodBase.GetCurrentMethod().Name}() ...");
|
||||
|
||||
try
|
||||
{
|
||||
if (!_isDisposed)
|
||||
{
|
||||
_logger?.Debug($"{this.GetType().Name}::{System.Reflection.MethodBase.GetCurrentMethod().Name}() disposing");
|
||||
|
||||
_windowDict?.First().Value.Dispatcher.Invoke((Action)delegate
|
||||
{
|
||||
// shut down all windows
|
||||
foreach (var entry in _windowDict)
|
||||
{
|
||||
entry.Value.Close();
|
||||
}
|
||||
// kill the GuiManagerthread
|
||||
Dispatcher.CurrentDispatcher.InvokeShutdown();
|
||||
});
|
||||
|
||||
_isDisposed = true;
|
||||
}
|
||||
}
|
||||
catch (Exception)
|
||||
{
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
84
Source/Program/GUI/View/ImpedanceCheckWindow.xaml
Normal file
@@ -0,0 +1,84 @@
|
||||
<Window x:Class="ProgramLib.GUI.View.ImpedanceCheckWindow"
|
||||
x:ClassModifier="internal"
|
||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
||||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
||||
xmlns:local="clr-namespace:ProgramLib.GUI.View"
|
||||
mc:Ignorable="d"
|
||||
Title="Impedance Check"
|
||||
WindowStyle="None"
|
||||
MouseLeftButtonDown="Window_MouseLeftButtonDown"
|
||||
Height="300"
|
||||
Width="400">
|
||||
<WindowChrome.WindowChrome>
|
||||
<WindowChrome GlassFrameThickness="0" CornerRadius="0" CaptionHeight="0"/>
|
||||
</WindowChrome.WindowChrome>
|
||||
<Window.Resources>
|
||||
<!-- Style for the close button -->
|
||||
<Style x:Key="TitleBarCloseButtonStyle" TargetType="{x:Type Button}">
|
||||
<Setter Property="Template">
|
||||
<Setter.Value>
|
||||
<ControlTemplate TargetType="{x:Type Button}">
|
||||
<Border x:Name="bdr_main" BorderThickness="1" BorderBrush="Transparent" Background="Transparent">
|
||||
<ContentPresenter x:Name="bdr_main2" VerticalAlignment="Center" HorizontalAlignment="Center" ContentSource="Content"/>
|
||||
</Border>
|
||||
<ControlTemplate.Triggers>
|
||||
<Trigger Property="IsMouseOver" Value="True">
|
||||
<Setter TargetName="bdr_main" Property="Background" Value="#e94856"/>
|
||||
<Setter TargetName="bdr_main" Property="BorderBrush" Value="#ba1245"/>
|
||||
<Setter TargetName="bdr_main2" Property="Content">
|
||||
<Setter.Value>
|
||||
<Image Source="pack://application:,,,/Program;component/Resources/Images/Title_Bar_Buttons/close_white.png" Width="20" Height="20" />
|
||||
</Setter.Value>
|
||||
</Setter>
|
||||
</Trigger>
|
||||
<Trigger Property="IsPressed" Value="True">
|
||||
<Setter TargetName="bdr_main" Property="Background" Value="#ff829a"/>
|
||||
<Setter TargetName="bdr_main" Property="BorderBrush" Value="#e94856"/>
|
||||
</Trigger>
|
||||
</ControlTemplate.Triggers>
|
||||
</ControlTemplate>
|
||||
</Setter.Value>
|
||||
</Setter>
|
||||
</Style>
|
||||
</Window.Resources>
|
||||
|
||||
<!-- Main Grid that contains everything -->
|
||||
<Grid Background="#f4f6fd">
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition Height="30px"/>
|
||||
<RowDefinition Height="*"/>
|
||||
</Grid.RowDefinitions>
|
||||
|
||||
<!-- Title bar which has the app icon, app title, minimize button, maximize button and close button -->
|
||||
<Grid>
|
||||
<WrapPanel HorizontalAlignment="left" VerticalAlignment="Center">
|
||||
<Image x:Name="imgAppIcon" Source="pack://application:,,,/Program;component/Resources/Images/missile.png" Width="20" Height="20" Margin="10,0,10,0"/>
|
||||
<TextBlock x:Name="txtBlockAppTitle">Impedance Check</TextBlock>
|
||||
</WrapPanel>
|
||||
<StackPanel Orientation="Horizontal" HorizontalAlignment="Right" Grid.Row="0">
|
||||
<Button x:FieldModifier="public" Style="{StaticResource TitleBarCloseButtonStyle}" x:Name="btnClose" Width="44" Background="Transparent" BorderBrush="Transparent" Click="btnClose_Click">
|
||||
<Image Source="pack://application:,,,/Program;component/Resources/Images/Title_Bar_Buttons/close_black.png" Width="20" Height="20"/>
|
||||
</Button>
|
||||
</StackPanel>
|
||||
</Grid>
|
||||
|
||||
<ListView Grid.Row="1" x:Name="lvImpedanceCheck" ItemsSource="{Binding _listviewImpedanceDatatems}" Margin="15,5,15,15">
|
||||
<ListView.ItemContainerStyle>
|
||||
<Style TargetType="ListViewItem">
|
||||
<Setter Property="Focusable" Value="false"/>
|
||||
</Style>
|
||||
</ListView.ItemContainerStyle>
|
||||
<ListView.ItemTemplate>
|
||||
<DataTemplate>
|
||||
<StackPanel Orientation="Horizontal">
|
||||
<Image Source="{Binding PassFailImagePath}" Width="15" Height="15" />
|
||||
<TextBlock Text="{Binding Description}" Margin="5,0,0,0"/>
|
||||
</StackPanel>
|
||||
</DataTemplate>
|
||||
</ListView.ItemTemplate>
|
||||
</ListView>
|
||||
|
||||
</Grid>
|
||||
</Window>
|
||||
59
Source/Program/GUI/View/ImpedanceCheckWindow.xaml.cs
Normal file
@@ -0,0 +1,59 @@
|
||||
using ProgramLib.GUI.ViewModel;
|
||||
using System;
|
||||
using System.Collections.Specialized;
|
||||
using System.Windows;
|
||||
using System.Windows.Media.Imaging;
|
||||
|
||||
namespace ProgramLib.GUI.View
|
||||
{
|
||||
/// <summary>
|
||||
/// Interaction logic for ImpedanceCheckWindow.xaml
|
||||
/// </summary>
|
||||
internal partial class ImpedanceCheckWindow : Window
|
||||
{
|
||||
internal ImpedanceCheckWindowViewModel ViewModel { get; set; }
|
||||
|
||||
public ImpedanceCheckWindow()
|
||||
{
|
||||
InitializeComponent();
|
||||
|
||||
Uri iconUri = new Uri("pack://application:,,,/Program;component/Resources/Icons/app.ico");
|
||||
this.Icon = BitmapFrame.Create(iconUri);
|
||||
|
||||
WindowStartupLocation = System.Windows.WindowStartupLocation.CenterScreen;
|
||||
|
||||
btnClose.Visibility = Visibility.Hidden;
|
||||
|
||||
((INotifyCollectionChanged)lvImpedanceCheck.Items).CollectionChanged += ListView_CollectionChanged;
|
||||
|
||||
ViewModel = new ImpedanceCheckWindowViewModel(this);
|
||||
DataContext = ViewModel;
|
||||
}
|
||||
|
||||
protected override void OnContentRendered(EventArgs e)
|
||||
{
|
||||
base.OnContentRendered(e);
|
||||
|
||||
// call the delegate to perform STTO
|
||||
}
|
||||
|
||||
private void Window_MouseLeftButtonDown(object sender, System.Windows.Input.MouseButtonEventArgs e)
|
||||
{
|
||||
DragMove();
|
||||
}
|
||||
|
||||
private void btnClose_Click(object sender, RoutedEventArgs e)
|
||||
{
|
||||
this.Hide();
|
||||
}
|
||||
|
||||
private void ListView_CollectionChanged(object sender, NotifyCollectionChangedEventArgs e)
|
||||
{
|
||||
if (e.Action == NotifyCollectionChangedAction.Add)
|
||||
{
|
||||
// scroll the new item into view
|
||||
lvImpedanceCheck.ScrollIntoView(e.NewItems[0]);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
772
Source/Program/GUI/View/LiveDataWindow.xaml
Normal file
@@ -0,0 +1,772 @@
|
||||
<Window x:Class="ProgramLib.GUI.View.LiveDataWindow"
|
||||
x:ClassModifier="internal"
|
||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
||||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
||||
xmlns:local="clr-namespace:ProgramLib.GUI.View"
|
||||
mc:Ignorable="d"
|
||||
Title="Missile Test Set"
|
||||
WindowStyle="None"
|
||||
ResizeMode="CanResizeWithGrip"
|
||||
MouseLeftButtonDown="Window_MouseLeftButtonDown"
|
||||
Height="650"
|
||||
Width="1000">
|
||||
<WindowChrome.WindowChrome>
|
||||
<WindowChrome GlassFrameThickness="0" CornerRadius="0" CaptionHeight="0"/>
|
||||
</WindowChrome.WindowChrome>
|
||||
<Window.Resources>
|
||||
|
||||
<!-- Style for the close button -->
|
||||
<Style x:Key="TitleBarCloseButtonStyle" TargetType="{x:Type Button}">
|
||||
<Setter Property="Template">
|
||||
<Setter.Value>
|
||||
<ControlTemplate TargetType="{x:Type Button}">
|
||||
<Border x:Name="bdr_main" BorderThickness="1" BorderBrush="Transparent" Background="Transparent">
|
||||
<ContentPresenter x:Name="bdr_main2" VerticalAlignment="Center" HorizontalAlignment="Center" ContentSource="Content"/>
|
||||
</Border>
|
||||
<ControlTemplate.Triggers>
|
||||
<Trigger Property="IsMouseOver" Value="True">
|
||||
<Setter TargetName="bdr_main" Property="Background" Value="#e94856"/>
|
||||
<Setter TargetName="bdr_main" Property="BorderBrush" Value="#ba1245"/>
|
||||
<Setter TargetName="bdr_main2" Property="Content">
|
||||
<Setter.Value>
|
||||
<Image Source="pack://application:,,,/Program;component/Resources/Images/Title_Bar_Buttons/close_white.png" Width="20" Height="20" />
|
||||
</Setter.Value>
|
||||
</Setter>
|
||||
</Trigger>
|
||||
<Trigger Property="IsPressed" Value="True">
|
||||
<Setter TargetName="bdr_main" Property="Background" Value="#ff829a"/>
|
||||
<Setter TargetName="bdr_main" Property="BorderBrush" Value="#e94856"/>
|
||||
</Trigger>
|
||||
</ControlTemplate.Triggers>
|
||||
</ControlTemplate>
|
||||
</Setter.Value>
|
||||
</Setter>
|
||||
</Style>
|
||||
|
||||
<!-- Style for minimize and maximize buttons -->
|
||||
<Style x:Key="TitleBarButtonStyle" TargetType="{x:Type Button}">
|
||||
<Setter Property="Template">
|
||||
<Setter.Value>
|
||||
<ControlTemplate TargetType="{x:Type Button}">
|
||||
<Border x:Name="bdr_main" BorderThickness="1" BorderBrush="Transparent" Background="Transparent">
|
||||
<ContentPresenter x:Name="bdr_main2" VerticalAlignment="Center" HorizontalAlignment="Center" ContentSource="Content"/>
|
||||
</Border>
|
||||
<ControlTemplate.Triggers>
|
||||
<Trigger Property="IsMouseOver" Value="True">
|
||||
<Setter TargetName="bdr_main" Property="Background" Value="#bee6fd"/>
|
||||
<Setter TargetName="bdr_main" Property="BorderBrush" Value="#7fb1cd"/>
|
||||
</Trigger>
|
||||
<Trigger Property="IsPressed" Value="True">
|
||||
<Setter TargetName="bdr_main" Property="Background" Value="#a1bfd0"/>
|
||||
<Setter TargetName="bdr_main" Property="BorderBrush" Value="#4c778f"/>
|
||||
</Trigger>
|
||||
</ControlTemplate.Triggers>
|
||||
</ControlTemplate>
|
||||
</Setter.Value>
|
||||
</Setter>
|
||||
</Style>
|
||||
|
||||
<!-- Define all image paths here for images that are binded to data model -->
|
||||
<!-- Images that are binded to data models are not displayed at design time -->
|
||||
<!-- So we use these images to display at design time -->
|
||||
<BitmapImage x:Key="DesignSourceBlackLed" UriSource="pack://application:,,,/Program;component/Resources/Images/black-led.png"/>
|
||||
|
||||
<!-- Style for the Menu control -->
|
||||
<!-- There are multiple styles for the Menu control which are generated from built-in Menu style templte -->
|
||||
<!-- Only thing that was changed in the Menu template is the line below, to change the color of "Menu.Static.Background"-->
|
||||
<SolidColorBrush x:Key="Menu.Static.Background" Color="#f4f6fd"/>
|
||||
<SolidColorBrush x:Key="Menu.Static.Border" Color="#FF999999"/>
|
||||
<SolidColorBrush x:Key="Menu.Static.Foreground" Color="#FF212121"/>
|
||||
<SolidColorBrush x:Key="Menu.Static.Separator" Color="#FFD7D7D7"/>
|
||||
<SolidColorBrush x:Key="Menu.Disabled.Foreground" Color="#FF707070"/>
|
||||
<SolidColorBrush x:Key="MenuItem.Selected.Background" Color="#3D26A0DA"/>
|
||||
<SolidColorBrush x:Key="MenuItem.Selected.Border" Color="#FF26A0DA"/>
|
||||
<SolidColorBrush x:Key="MenuItem.Highlight.Background" Color="#3D26A0DA"/>
|
||||
<SolidColorBrush x:Key="MenuItem.Highlight.Border" Color="#FF26A0DA"/>
|
||||
<SolidColorBrush x:Key="MenuItem.Highlight.Disabled.Background" Color="#0A000000"/>
|
||||
<SolidColorBrush x:Key="MenuItem.Highlight.Disabled.Border" Color="#21000000"/>
|
||||
<MenuScrollingVisibilityConverter x:Key="MenuScrollingVisibilityConverter"/>
|
||||
<Geometry x:Key="DownArrow">M 0,0 L 3.5,4 L 7,0 Z</Geometry>
|
||||
<Geometry x:Key="UpArrow">M 0,4 L 3.5,0 L 7,4 Z</Geometry>
|
||||
<Geometry x:Key="RightArrow">M 0,0 L 4,3.5 L 0,7 Z</Geometry>
|
||||
<Geometry x:Key="Checkmark">F1 M 10.0,1.2 L 4.7,9.1 L 4.5,9.1 L 0,5.2 L 1.3,3.5 L 4.3,6.1L 8.3,0 L 10.0,1.2 Z</Geometry>
|
||||
<!-- Built-in style for the Menu control continued... -->
|
||||
<Style x:Key="MenuScrollButton" BasedOn="{x:Null}" TargetType="{x:Type RepeatButton}">
|
||||
<Setter Property="ClickMode" Value="Hover"/>
|
||||
<Setter Property="Template">
|
||||
<Setter.Value>
|
||||
<ControlTemplate TargetType="{x:Type RepeatButton}">
|
||||
<Border x:Name="templateRoot" Background="Transparent" BorderBrush="Transparent" BorderThickness="1" SnapsToDevicePixels="true">
|
||||
<ContentPresenter HorizontalAlignment="Center" Margin="6" VerticalAlignment="Center"/>
|
||||
</Border>
|
||||
</ControlTemplate>
|
||||
</Setter.Value>
|
||||
</Setter>
|
||||
</Style>
|
||||
<!-- Built-in style for the Menu control continued... -->
|
||||
<Style x:Key="{ComponentResourceKey ResourceId=MenuScrollViewer, TypeInTargetAssembly={x:Type FrameworkElement}}" BasedOn="{x:Null}" TargetType="{x:Type ScrollViewer}">
|
||||
<Setter Property="HorizontalScrollBarVisibility" Value="Hidden"/>
|
||||
<Setter Property="VerticalScrollBarVisibility" Value="Auto"/>
|
||||
<Setter Property="Template">
|
||||
<Setter.Value>
|
||||
<ControlTemplate TargetType="{x:Type ScrollViewer}">
|
||||
<Grid SnapsToDevicePixels="true">
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="*"/>
|
||||
</Grid.ColumnDefinitions>
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition Height="Auto"/>
|
||||
<RowDefinition Height="*"/>
|
||||
<RowDefinition Height="Auto"/>
|
||||
</Grid.RowDefinitions>
|
||||
<Border Grid.Column="0" Grid.Row="1">
|
||||
<ScrollContentPresenter CanContentScroll="{TemplateBinding CanContentScroll}" Margin="{TemplateBinding Padding}"/>
|
||||
</Border>
|
||||
<RepeatButton Command="{x:Static ScrollBar.LineUpCommand}" CommandTarget="{Binding RelativeSource={RelativeSource Mode=TemplatedParent}}" Grid.Column="0" Focusable="false" Grid.Row="0" Style="{StaticResource MenuScrollButton}">
|
||||
<RepeatButton.Visibility>
|
||||
<MultiBinding ConverterParameter="0" Converter="{StaticResource MenuScrollingVisibilityConverter}" FallbackValue="Visibility.Collapsed">
|
||||
<Binding Path="ComputedVerticalScrollBarVisibility" RelativeSource="{RelativeSource Mode=TemplatedParent}"/>
|
||||
<Binding Path="VerticalOffset" RelativeSource="{RelativeSource Mode=TemplatedParent}"/>
|
||||
<Binding Path="ExtentHeight" RelativeSource="{RelativeSource Mode=TemplatedParent}"/>
|
||||
<Binding Path="ViewportHeight" RelativeSource="{RelativeSource Mode=TemplatedParent}"/>
|
||||
</MultiBinding>
|
||||
</RepeatButton.Visibility>
|
||||
<Path Data="{StaticResource UpArrow}" Fill="{StaticResource Menu.Static.Foreground}"/>
|
||||
</RepeatButton>
|
||||
<RepeatButton Command="{x:Static ScrollBar.LineDownCommand}" CommandTarget="{Binding RelativeSource={RelativeSource Mode=TemplatedParent}}" Grid.Column="0" Focusable="false" Grid.Row="2" Style="{StaticResource MenuScrollButton}">
|
||||
<RepeatButton.Visibility>
|
||||
<MultiBinding ConverterParameter="100" Converter="{StaticResource MenuScrollingVisibilityConverter}" FallbackValue="Visibility.Collapsed">
|
||||
<Binding Path="ComputedVerticalScrollBarVisibility" RelativeSource="{RelativeSource Mode=TemplatedParent}"/>
|
||||
<Binding Path="VerticalOffset" RelativeSource="{RelativeSource Mode=TemplatedParent}"/>
|
||||
<Binding Path="ExtentHeight" RelativeSource="{RelativeSource Mode=TemplatedParent}"/>
|
||||
<Binding Path="ViewportHeight" RelativeSource="{RelativeSource Mode=TemplatedParent}"/>
|
||||
</MultiBinding>
|
||||
</RepeatButton.Visibility>
|
||||
<Path Data="{StaticResource DownArrow}" Fill="{StaticResource Menu.Static.Foreground}"/>
|
||||
</RepeatButton>
|
||||
</Grid>
|
||||
</ControlTemplate>
|
||||
</Setter.Value>
|
||||
</Setter>
|
||||
</Style>
|
||||
<!-- Built-in ControlTemplate for the Menu control continued... -->
|
||||
<ControlTemplate x:Key="{ComponentResourceKey ResourceId=TopLevelItemTemplateKey, TypeInTargetAssembly={x:Type MenuItem}}" TargetType="{x:Type MenuItem}">
|
||||
<Border x:Name="templateRoot" Background="{TemplateBinding Background}" BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="{TemplateBinding BorderThickness}" SnapsToDevicePixels="true">
|
||||
<Grid VerticalAlignment="Center">
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="Auto"/>
|
||||
<ColumnDefinition Width="Auto"/>
|
||||
</Grid.ColumnDefinitions>
|
||||
<ContentPresenter x:Name="Icon" ContentSource="Icon" HorizontalAlignment="Center" Height="16" Margin="3" SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}" VerticalAlignment="Center" Width="16"/>
|
||||
<Path x:Name="GlyphPanel" Data="{StaticResource Checkmark}" FlowDirection="LeftToRight" Fill="{StaticResource Menu.Static.Foreground}" Margin="3" VerticalAlignment="Center" Visibility="Collapsed"/>
|
||||
<ContentPresenter ContentSource="Header" Grid.Column="1" Margin="{TemplateBinding Padding}" RecognizesAccessKey="True" SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}"/>
|
||||
</Grid>
|
||||
</Border>
|
||||
<ControlTemplate.Triggers>
|
||||
<Trigger Property="Icon" Value="{x:Null}">
|
||||
<Setter Property="Visibility" TargetName="Icon" Value="Collapsed"/>
|
||||
</Trigger>
|
||||
<Trigger Property="IsChecked" Value="true">
|
||||
<Setter Property="Visibility" TargetName="GlyphPanel" Value="Visible"/>
|
||||
<Setter Property="Visibility" TargetName="Icon" Value="Collapsed"/>
|
||||
</Trigger>
|
||||
<Trigger Property="IsHighlighted" Value="True">
|
||||
<Setter Property="Background" TargetName="templateRoot" Value="{StaticResource MenuItem.Highlight.Background}"/>
|
||||
<Setter Property="BorderBrush" TargetName="templateRoot" Value="{StaticResource MenuItem.Highlight.Border}"/>
|
||||
</Trigger>
|
||||
<Trigger Property="IsEnabled" Value="False">
|
||||
<Setter Property="TextElement.Foreground" TargetName="templateRoot" Value="{StaticResource Menu.Disabled.Foreground}"/>
|
||||
<Setter Property="Fill" TargetName="GlyphPanel" Value="{StaticResource Menu.Disabled.Foreground}"/>
|
||||
</Trigger>
|
||||
<MultiTrigger>
|
||||
<MultiTrigger.Conditions>
|
||||
<Condition Property="IsHighlighted" Value="True"/>
|
||||
<Condition Property="IsEnabled" Value="False"/>
|
||||
</MultiTrigger.Conditions>
|
||||
<Setter Property="Background" TargetName="templateRoot" Value="{StaticResource MenuItem.Highlight.Disabled.Background}"/>
|
||||
<Setter Property="BorderBrush" TargetName="templateRoot" Value="{StaticResource MenuItem.Highlight.Disabled.Border}"/>
|
||||
</MultiTrigger>
|
||||
</ControlTemplate.Triggers>
|
||||
</ControlTemplate>
|
||||
<!-- Built-in ControlTemplate for the Menu control continued... -->
|
||||
<ControlTemplate x:Key="{ComponentResourceKey ResourceId=TopLevelHeaderTemplateKey, TypeInTargetAssembly={x:Type MenuItem}}" TargetType="{x:Type MenuItem}">
|
||||
<Border x:Name="templateRoot" Background="{TemplateBinding Background}" BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="{TemplateBinding BorderThickness}" SnapsToDevicePixels="true">
|
||||
<Grid VerticalAlignment="Center">
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="Auto"/>
|
||||
<ColumnDefinition Width="Auto"/>
|
||||
</Grid.ColumnDefinitions>
|
||||
<ContentPresenter x:Name="Icon" ContentSource="Icon" HorizontalAlignment="Center" Height="16" Margin="3" SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}" VerticalAlignment="Center" Width="16"/>
|
||||
<Path x:Name="GlyphPanel" Data="{StaticResource Checkmark}" FlowDirection="LeftToRight" Fill="{TemplateBinding Foreground}" Margin="3" VerticalAlignment="Center" Visibility="Collapsed"/>
|
||||
<ContentPresenter ContentSource="Header" Grid.Column="1" Margin="{TemplateBinding Padding}" RecognizesAccessKey="True" SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}"/>
|
||||
<Popup x:Name="PART_Popup" AllowsTransparency="true" Focusable="false" IsOpen="{Binding IsSubmenuOpen, RelativeSource={RelativeSource Mode=TemplatedParent}}" Placement="Bottom" PopupAnimation="{DynamicResource {x:Static SystemParameters.MenuPopupAnimationKey}}" PlacementTarget="{Binding ElementName=templateRoot}">
|
||||
<Border x:Name="SubMenuBorder" Background="{StaticResource Menu.Static.Background}" BorderBrush="{StaticResource Menu.Static.Border}" BorderThickness="1" Padding="2">
|
||||
<ScrollViewer x:Name="SubMenuScrollViewer" Style="{DynamicResource {ComponentResourceKey ResourceId=MenuScrollViewer, TypeInTargetAssembly={x:Type FrameworkElement}}}">
|
||||
<Grid RenderOptions.ClearTypeHint="Enabled">
|
||||
<Canvas HorizontalAlignment="Left" Height="0" VerticalAlignment="Top" Width="0">
|
||||
<Rectangle x:Name="OpaqueRect" Fill="{Binding Background, ElementName=SubMenuBorder}" Height="{Binding ActualHeight, ElementName=SubMenuBorder}" Width="{Binding ActualWidth, ElementName=SubMenuBorder}"/>
|
||||
</Canvas>
|
||||
<Rectangle Fill="{StaticResource Menu.Static.Separator}" HorizontalAlignment="Left" Margin="29,2,0,2" Width="1"/>
|
||||
<ItemsPresenter x:Name="ItemsPresenter" KeyboardNavigation.DirectionalNavigation="Cycle" Grid.IsSharedSizeScope="true" SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}" KeyboardNavigation.TabNavigation="Cycle"/>
|
||||
</Grid>
|
||||
</ScrollViewer>
|
||||
</Border>
|
||||
</Popup>
|
||||
</Grid>
|
||||
</Border>
|
||||
<ControlTemplate.Triggers>
|
||||
<Trigger Property="IsSuspendingPopupAnimation" Value="true">
|
||||
<Setter Property="PopupAnimation" TargetName="PART_Popup" Value="None"/>
|
||||
</Trigger>
|
||||
<Trigger Property="Icon" Value="{x:Null}">
|
||||
<Setter Property="Visibility" TargetName="Icon" Value="Collapsed"/>
|
||||
</Trigger>
|
||||
<Trigger Property="IsChecked" Value="true">
|
||||
<Setter Property="Visibility" TargetName="GlyphPanel" Value="Visible"/>
|
||||
<Setter Property="Visibility" TargetName="Icon" Value="Collapsed"/>
|
||||
</Trigger>
|
||||
<Trigger Property="IsHighlighted" Value="True">
|
||||
<Setter Property="Background" TargetName="templateRoot" Value="{StaticResource MenuItem.Highlight.Background}"/>
|
||||
<Setter Property="BorderBrush" TargetName="templateRoot" Value="{StaticResource MenuItem.Highlight.Border}"/>
|
||||
</Trigger>
|
||||
<Trigger Property="IsEnabled" Value="False">
|
||||
<Setter Property="TextElement.Foreground" TargetName="templateRoot" Value="{StaticResource Menu.Disabled.Foreground}"/>
|
||||
<Setter Property="Fill" TargetName="GlyphPanel" Value="{StaticResource Menu.Disabled.Foreground}"/>
|
||||
</Trigger>
|
||||
<Trigger Property="ScrollViewer.CanContentScroll" SourceName="SubMenuScrollViewer" Value="false">
|
||||
<Setter Property="Canvas.Top" TargetName="OpaqueRect" Value="{Binding VerticalOffset, ElementName=SubMenuScrollViewer}"/>
|
||||
<Setter Property="Canvas.Left" TargetName="OpaqueRect" Value="{Binding HorizontalOffset, ElementName=SubMenuScrollViewer}"/>
|
||||
</Trigger>
|
||||
</ControlTemplate.Triggers>
|
||||
</ControlTemplate>
|
||||
<!-- Built-in ControlTemplate for the Menu control continued... -->
|
||||
<ControlTemplate x:Key="{ComponentResourceKey ResourceId=SubmenuItemTemplateKey, TypeInTargetAssembly={x:Type MenuItem}}" TargetType="{x:Type MenuItem}">
|
||||
<Border x:Name="templateRoot" Background="{TemplateBinding Background}" BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="{TemplateBinding BorderThickness}" Height="22" SnapsToDevicePixels="true">
|
||||
<Grid Margin="-1">
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition MinWidth="22" SharedSizeGroup="MenuItemIconColumnGroup" Width="Auto"/>
|
||||
<ColumnDefinition Width="13"/>
|
||||
<ColumnDefinition Width="*"/>
|
||||
<ColumnDefinition Width="30"/>
|
||||
<ColumnDefinition SharedSizeGroup="MenuItemIGTColumnGroup" Width="Auto"/>
|
||||
<ColumnDefinition Width="20"/>
|
||||
</Grid.ColumnDefinitions>
|
||||
<ContentPresenter x:Name="Icon" ContentSource="Icon" HorizontalAlignment="Center" Height="16" Margin="3" SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}" VerticalAlignment="Center" Width="16"/>
|
||||
<Border x:Name="GlyphPanel" Background="{StaticResource MenuItem.Selected.Background}" BorderBrush="{StaticResource MenuItem.Selected.Border}" BorderThickness="1" ClipToBounds="False" HorizontalAlignment="Center" Height="22" Margin="-1,0,0,0" VerticalAlignment="Center" Visibility="Hidden" Width="22">
|
||||
<Path x:Name="Glyph" Data="{StaticResource Checkmark}" FlowDirection="LeftToRight" Fill="{StaticResource Menu.Static.Foreground}" Height="11" Width="10"/>
|
||||
</Border>
|
||||
<ContentPresenter x:Name="menuHeaderContainer" ContentSource="Header" Grid.Column="2" HorizontalAlignment="Left" Margin="{TemplateBinding Padding}" RecognizesAccessKey="True" SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}" VerticalAlignment="Center"/>
|
||||
<TextBlock x:Name="menuGestureText" Grid.Column="4" Margin="{TemplateBinding Padding}" Opacity="0.7" Text="{TemplateBinding InputGestureText}" VerticalAlignment="Center"/>
|
||||
</Grid>
|
||||
</Border>
|
||||
<ControlTemplate.Triggers>
|
||||
<Trigger Property="Icon" Value="{x:Null}">
|
||||
<Setter Property="Visibility" TargetName="Icon" Value="Collapsed"/>
|
||||
</Trigger>
|
||||
<Trigger Property="IsChecked" Value="True">
|
||||
<Setter Property="Visibility" TargetName="GlyphPanel" Value="Visible"/>
|
||||
<Setter Property="Visibility" TargetName="Icon" Value="Collapsed"/>
|
||||
</Trigger>
|
||||
<Trigger Property="IsHighlighted" Value="True">
|
||||
<Setter Property="Background" TargetName="templateRoot" Value="{StaticResource MenuItem.Highlight.Background}"/>
|
||||
<Setter Property="BorderBrush" TargetName="templateRoot" Value="{StaticResource MenuItem.Highlight.Border}"/>
|
||||
</Trigger>
|
||||
<Trigger Property="IsEnabled" Value="False">
|
||||
<Setter Property="TextElement.Foreground" TargetName="templateRoot" Value="{StaticResource Menu.Disabled.Foreground}"/>
|
||||
<Setter Property="Fill" TargetName="Glyph" Value="{StaticResource Menu.Disabled.Foreground}"/>
|
||||
</Trigger>
|
||||
<MultiTrigger>
|
||||
<MultiTrigger.Conditions>
|
||||
<Condition Property="IsHighlighted" Value="True"/>
|
||||
<Condition Property="IsEnabled" Value="False"/>
|
||||
</MultiTrigger.Conditions>
|
||||
<Setter Property="Background" TargetName="templateRoot" Value="{StaticResource MenuItem.Highlight.Disabled.Background}"/>
|
||||
<Setter Property="BorderBrush" TargetName="templateRoot" Value="{StaticResource MenuItem.Highlight.Disabled.Border}"/>
|
||||
</MultiTrigger>
|
||||
</ControlTemplate.Triggers>
|
||||
</ControlTemplate>
|
||||
<!-- Built-in ControlTemplate for the Menu control continued... -->
|
||||
<ControlTemplate x:Key="{ComponentResourceKey ResourceId=SubmenuHeaderTemplateKey, TypeInTargetAssembly={x:Type MenuItem}}" TargetType="{x:Type MenuItem}">
|
||||
<Border x:Name="templateRoot" Background="{TemplateBinding Background}" BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="{TemplateBinding BorderThickness}" Height="22" SnapsToDevicePixels="true">
|
||||
<Grid Margin="-1">
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition MinWidth="22" SharedSizeGroup="MenuItemIconColumnGroup" Width="Auto"/>
|
||||
<ColumnDefinition Width="13"/>
|
||||
<ColumnDefinition Width="*"/>
|
||||
<ColumnDefinition Width="30"/>
|
||||
<ColumnDefinition SharedSizeGroup="MenuItemIGTColumnGroup" Width="Auto"/>
|
||||
<ColumnDefinition Width="20"/>
|
||||
</Grid.ColumnDefinitions>
|
||||
<ContentPresenter x:Name="Icon" ContentSource="Icon" HorizontalAlignment="Center" Height="16" Margin="3" SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}" VerticalAlignment="Center" Width="16"/>
|
||||
<Border x:Name="GlyphPanel" Background="{StaticResource MenuItem.Highlight.Background}" BorderBrush="{StaticResource MenuItem.Highlight.Border}" BorderThickness="1" Height="22" Margin="-1,0,0,0" VerticalAlignment="Center" Visibility="Hidden" Width="22">
|
||||
<Path x:Name="Glyph" Data="{DynamicResource Checkmark}" FlowDirection="LeftToRight" Fill="{StaticResource Menu.Static.Foreground}" Height="11" Width="9"/>
|
||||
</Border>
|
||||
<ContentPresenter ContentSource="Header" Grid.Column="2" HorizontalAlignment="Left" Margin="{TemplateBinding Padding}" RecognizesAccessKey="True" SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}" VerticalAlignment="Center"/>
|
||||
<TextBlock Grid.Column="4" Margin="{TemplateBinding Padding}" Opacity="0.7" Text="{TemplateBinding InputGestureText}" VerticalAlignment="Center"/>
|
||||
<Path x:Name="RightArrow" Grid.Column="5" Data="{StaticResource RightArrow}" Fill="{StaticResource Menu.Static.Foreground}" HorizontalAlignment="Left" Margin="10,0,0,0" VerticalAlignment="Center"/>
|
||||
<Popup x:Name="PART_Popup" AllowsTransparency="true" Focusable="false" HorizontalOffset="-2" IsOpen="{Binding IsSubmenuOpen, RelativeSource={RelativeSource Mode=TemplatedParent}}" Placement="Right" PopupAnimation="{DynamicResource {x:Static SystemParameters.MenuPopupAnimationKey}}" VerticalOffset="-3">
|
||||
<Border x:Name="SubMenuBorder" Background="{StaticResource Menu.Static.Background}" BorderBrush="{StaticResource Menu.Static.Border}" BorderThickness="1" Padding="2">
|
||||
<ScrollViewer x:Name="SubMenuScrollViewer" Style="{DynamicResource {ComponentResourceKey ResourceId=MenuScrollViewer, TypeInTargetAssembly={x:Type FrameworkElement}}}">
|
||||
<Grid RenderOptions.ClearTypeHint="Enabled">
|
||||
<Canvas HorizontalAlignment="Left" Height="0" VerticalAlignment="Top" Width="0">
|
||||
<Rectangle x:Name="OpaqueRect" Fill="{Binding Background, ElementName=SubMenuBorder}" Height="{Binding ActualHeight, ElementName=SubMenuBorder}" Width="{Binding ActualWidth, ElementName=SubMenuBorder}"/>
|
||||
</Canvas>
|
||||
<Rectangle Fill="{DynamicResource {x:Static SystemColors.ControlDarkBrushKey}}" HorizontalAlignment="Left" Margin="29,2,0,2" Width="1"/>
|
||||
<ItemsPresenter x:Name="ItemsPresenter" KeyboardNavigation.DirectionalNavigation="Cycle" Grid.IsSharedSizeScope="true" SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}" KeyboardNavigation.TabNavigation="Cycle"/>
|
||||
</Grid>
|
||||
</ScrollViewer>
|
||||
</Border>
|
||||
</Popup>
|
||||
</Grid>
|
||||
</Border>
|
||||
<ControlTemplate.Triggers>
|
||||
<Trigger Property="IsSuspendingPopupAnimation" Value="true">
|
||||
<Setter Property="PopupAnimation" TargetName="PART_Popup" Value="None"/>
|
||||
</Trigger>
|
||||
<Trigger Property="Icon" Value="{x:Null}">
|
||||
<Setter Property="Visibility" TargetName="Icon" Value="Collapsed"/>
|
||||
</Trigger>
|
||||
<Trigger Property="IsChecked" Value="True">
|
||||
<Setter Property="Visibility" TargetName="GlyphPanel" Value="Visible"/>
|
||||
<Setter Property="Visibility" TargetName="Icon" Value="Collapsed"/>
|
||||
</Trigger>
|
||||
<Trigger Property="IsHighlighted" Value="True">
|
||||
<Setter Property="Background" TargetName="templateRoot" Value="Transparent"/>
|
||||
<Setter Property="BorderBrush" TargetName="templateRoot" Value="{StaticResource MenuItem.Highlight.Border}"/>
|
||||
</Trigger>
|
||||
<Trigger Property="IsEnabled" Value="False">
|
||||
<Setter Property="TextElement.Foreground" TargetName="templateRoot" Value="{StaticResource Menu.Disabled.Foreground}"/>
|
||||
<Setter Property="Fill" TargetName="Glyph" Value="{StaticResource Menu.Disabled.Foreground}"/>
|
||||
<Setter Property="Fill" TargetName="RightArrow" Value="{StaticResource Menu.Disabled.Foreground}"/>
|
||||
</Trigger>
|
||||
<Trigger Property="ScrollViewer.CanContentScroll" SourceName="SubMenuScrollViewer" Value="false">
|
||||
<Setter Property="Canvas.Top" TargetName="OpaqueRect" Value="{Binding VerticalOffset, ElementName=SubMenuScrollViewer}"/>
|
||||
<Setter Property="Canvas.Left" TargetName="OpaqueRect" Value="{Binding HorizontalOffset, ElementName=SubMenuScrollViewer}"/>
|
||||
</Trigger>
|
||||
</ControlTemplate.Triggers>
|
||||
</ControlTemplate>
|
||||
<!-- Built-in style for the Menu control continued... -->
|
||||
<Style x:Key="MenuItemStyle" TargetType="{x:Type MenuItem}">
|
||||
<Setter Property="HorizontalContentAlignment" Value="{Binding HorizontalContentAlignment, RelativeSource={RelativeSource AncestorType={x:Type ItemsControl}}}"/>
|
||||
<Setter Property="VerticalContentAlignment" Value="{Binding VerticalContentAlignment, RelativeSource={RelativeSource AncestorType={x:Type ItemsControl}}}"/>
|
||||
<Setter Property="Background" Value="Transparent"/>
|
||||
<Setter Property="BorderBrush" Value="Transparent"/>
|
||||
<Setter Property="BorderThickness" Value="1"/>
|
||||
<Setter Property="ScrollViewer.PanningMode" Value="Both"/>
|
||||
<Setter Property="Stylus.IsFlicksEnabled" Value="False"/>
|
||||
<Setter Property="Template" Value="{DynamicResource {ComponentResourceKey ResourceId=SubmenuItemTemplateKey, TypeInTargetAssembly={x:Type MenuItem}}}"/>
|
||||
<Style.Triggers>
|
||||
<Trigger Property="Role" Value="TopLevelHeader">
|
||||
<Setter Property="Background" Value="Transparent"/>
|
||||
<Setter Property="BorderBrush" Value="Transparent"/>
|
||||
<Setter Property="Foreground" Value="{StaticResource Menu.Static.Foreground}"/>
|
||||
<Setter Property="Template" Value="{DynamicResource {ComponentResourceKey ResourceId=TopLevelHeaderTemplateKey, TypeInTargetAssembly={x:Type MenuItem}}}"/>
|
||||
<Setter Property="Padding" Value="6,0"/>
|
||||
</Trigger>
|
||||
<Trigger Property="Role" Value="TopLevelItem">
|
||||
<Setter Property="Background" Value="{StaticResource Menu.Static.Background}"/>
|
||||
<Setter Property="BorderBrush" Value="{StaticResource Menu.Static.Border}"/>
|
||||
<Setter Property="Foreground" Value="{StaticResource Menu.Static.Foreground}"/>
|
||||
<Setter Property="Template" Value="{DynamicResource {ComponentResourceKey ResourceId=TopLevelItemTemplateKey, TypeInTargetAssembly={x:Type MenuItem}}}"/>
|
||||
<Setter Property="Padding" Value="6,0"/>
|
||||
</Trigger>
|
||||
<Trigger Property="Role" Value="SubmenuHeader">
|
||||
<Setter Property="Template" Value="{DynamicResource {ComponentResourceKey ResourceId=SubmenuHeaderTemplateKey, TypeInTargetAssembly={x:Type MenuItem}}}"/>
|
||||
</Trigger>
|
||||
</Style.Triggers>
|
||||
</Style>
|
||||
|
||||
</Window.Resources>
|
||||
|
||||
<!-- Main Grid that contains everything -->
|
||||
<Grid Background="#f4f6fd">
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition Height="30px"/>
|
||||
<RowDefinition Height="30px"/>
|
||||
<RowDefinition Height="*"/>
|
||||
<RowDefinition Height="28px"/>
|
||||
</Grid.RowDefinitions>
|
||||
|
||||
<!-- Title bar which has the app icon, app title, minimize button, maximize button and close button -->
|
||||
<Grid>
|
||||
<WrapPanel HorizontalAlignment="left" VerticalAlignment="Center">
|
||||
<Image x:Name="imgAppIcon" Source="pack://application:,,,/Program;component/Resources/Images/missile.png" Width="20" Height="20" Margin="10,0,10,0"/>
|
||||
<TextBlock x:Name="txtBlockAppTitle">[App Title Here]</TextBlock>
|
||||
</WrapPanel>
|
||||
<StackPanel Orientation="Horizontal" HorizontalAlignment="Right" Grid.Row="0">
|
||||
<Button Style="{StaticResource TitleBarButtonStyle}" x:Name="btnMin" Width="44" Background="Transparent" BorderBrush="Transparent" Click="btnMin_Click">
|
||||
<Image Source="pack://application:,,,/Program;component/Resources/Images/Title_Bar_Buttons/minimize.png" Width="12" Height="12"/>
|
||||
</Button>
|
||||
<Button Style="{StaticResource TitleBarButtonStyle}" x:Name="btnMax" Width="44" Background="Transparent" BorderBrush="Transparent" Click="btnMax_Click">
|
||||
<Image x:Name="imgMax" Source="pack://application:,,,/Program;component/Resources/Images/Title_Bar_Buttons/maximize.png" Width="13" Height="13"/>
|
||||
</Button>
|
||||
<Button Style="{StaticResource TitleBarCloseButtonStyle}" x:Name="btnClose" Width="44" Background="Transparent" BorderBrush="Transparent" Click="btnClose_Click">
|
||||
<Image Source="pack://application:,,,/Program;component/Resources/Images/Title_Bar_Buttons/close_black.png" Width="20" Height="20"/>
|
||||
</Button>
|
||||
</StackPanel>
|
||||
</Grid>
|
||||
|
||||
<!-- Menu bar -->
|
||||
<DockPanel Grid.Row="1" HorizontalAlignment="left" VerticalAlignment="Center">
|
||||
<Menu DockPanel.Dock="Top" Background="#f4f6fd">
|
||||
<MenuItem Style="{DynamicResource MenuItemStyle}" Header="Help" Background="Transparent">
|
||||
<MenuItem Header="Data Location"/>
|
||||
</MenuItem>
|
||||
</Menu>
|
||||
</DockPanel>
|
||||
|
||||
<!-- Body -->
|
||||
<Grid Grid.Row="2" Background="#f0f0f0">
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="6*" />
|
||||
<ColumnDefinition Width="10" />
|
||||
<ColumnDefinition Width="4*" />
|
||||
</Grid.ColumnDefinitions>
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition Height="4.1*" />
|
||||
<RowDefinition Height="5.9*" />
|
||||
</Grid.RowDefinitions>
|
||||
|
||||
<!-- Contains headers and datagrid for the power data -->
|
||||
<Grid>
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="70" />
|
||||
<ColumnDefinition Width="*" />
|
||||
</Grid.ColumnDefinitions>
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition Height="25" />
|
||||
<RowDefinition Height="4*" />
|
||||
<RowDefinition Height="6*" />
|
||||
</Grid.RowDefinitions>
|
||||
|
||||
<Label Grid.ColumnSpan="2" FontSize="14" Foreground="White" FontWeight="Bold" Content="UUT Power Supply Monitor" Padding="5,0,0,2" VerticalContentAlignment="Center" BorderThickness="0" BorderBrush="#bdbcbd">
|
||||
<Label.Background>
|
||||
<LinearGradientBrush StartPoint="0,0" EndPoint="1,1">
|
||||
<GradientStop Color="#1959b1" Offset="0.31" />
|
||||
<GradientStop Color="#1959b1" Offset="0.09" />
|
||||
<GradientStop Color="white" Offset="1.1" />
|
||||
</LinearGradientBrush>
|
||||
</Label.Background>
|
||||
</Label>
|
||||
|
||||
<StackPanel Grid.Row="1">
|
||||
<Label FontSize="13" FontWeight="Bold" VerticalContentAlignment="Center" HorizontalContentAlignment="Center" Height="42" BorderThickness="0,1,1,1" BorderBrush="#bdbcbd">PS</Label>
|
||||
<Label Height="19" FontSize="10" FontWeight="Bold" Content="UMB +20V" Padding="0" HorizontalContentAlignment="Center" VerticalContentAlignment="Center" BorderThickness="0,0,1,1" BorderBrush="#bdbcbd"/>
|
||||
<Label Height="19" FontSize="10" FontWeight="Bold" Content="-20V" Padding="0" HorizontalContentAlignment="Center" VerticalContentAlignment="Center" BorderThickness="0,0,1,1" BorderBrush="#bdbcbd"/>
|
||||
</StackPanel>
|
||||
|
||||
<Grid Grid.Row="1" Grid.Column="1">
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="1*" />
|
||||
<ColumnDefinition Width="1*" />
|
||||
<ColumnDefinition Width="1*" />
|
||||
<ColumnDefinition Width="1*" />
|
||||
</Grid.ColumnDefinitions>
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition Height="22" />
|
||||
<RowDefinition Height="20" />
|
||||
<RowDefinition Height="*" />
|
||||
</Grid.RowDefinitions>
|
||||
|
||||
<Label Grid.ColumnSpan="2" FontSize="10" FontWeight="Bold" Content="Voltage (V)" Padding="0" HorizontalContentAlignment="Center" VerticalContentAlignment="Center" BorderThickness="0,1,1,1" BorderBrush="#bdbcbd"/>
|
||||
<Label Grid.Column="2" Grid.ColumnSpan="2" FontSize="10" FontWeight="Bold" Content="Current (A)" Padding="0" HorizontalContentAlignment="Center" VerticalContentAlignment="Center" BorderThickness="0,1,1,1" BorderBrush="#bdbcbd"/>
|
||||
<Label Grid.Row="1" FontSize="10" FontWeight="Bold" Content="Expected" Padding="0" HorizontalContentAlignment="Center" VerticalContentAlignment="Center" BorderThickness="0,0,1,1" BorderBrush="#bdbcbd"/>
|
||||
<Label Grid.Row="1" Grid.Column="1" FontSize="10" FontWeight="Bold" Content="Actual" Padding="0" HorizontalContentAlignment="Center" VerticalContentAlignment="Center" BorderThickness="0,0,1,1" BorderBrush="#bdbcbd"/>
|
||||
<Label Grid.Row="1" Grid.Column="2" Grid.ColumnSpan="2" FontSize="10" FontWeight="Bold" Content="Actual" Padding="0" HorizontalContentAlignment="Center" VerticalContentAlignment="Center" BorderThickness="0,0,1,1" BorderBrush="#bdbcbd"/>
|
||||
|
||||
<!-- DataGrid for Power Data-->
|
||||
<DataGrid Grid.Row="2" Grid.ColumnSpan="4" Name="datagridPowerData" AutoGenerateColumns="False" CanUserAddRows="False" IsReadOnly="True" SelectionMode="Extended" SelectionUnit="FullRow" ItemsSource="{Binding _dataGridPowerDatatems}" Width="auto" HorizontalGridLinesBrush="#e9e9e9" VerticalGridLinesBrush="#e9e9e9" HeadersVisibility="None" BorderThickness="0">
|
||||
<DataGrid.Resources>
|
||||
<Style x:Key="CellStyle" TargetType="DataGridCell">
|
||||
<Setter Property="TextBlock.TextAlignment" Value="Center" />
|
||||
<Setter Property="Foreground" Value="Black" />
|
||||
<Style.Triggers>
|
||||
<Trigger Property="IsSelected" Value="True">
|
||||
<Setter Property="Background" Value="{x:Null}" />
|
||||
<Setter Property="BorderBrush" Value="{x:Null}" />
|
||||
</Trigger>
|
||||
</Style.Triggers>
|
||||
</Style>
|
||||
</DataGrid.Resources>
|
||||
<DataGrid.Columns>
|
||||
<DataGridTextColumn CellStyle="{StaticResource CellStyle}" Header="expectedVoltage" Width="1*" Binding="{Binding ExpectedVoltage}"/>
|
||||
<DataGridTextColumn CellStyle="{StaticResource CellStyle}" Header="actualVoltage" Width="1*" Binding="{Binding ActualVoltage}"/>
|
||||
<DataGridTextColumn CellStyle="{StaticResource CellStyle}" Header="actualCurrent" Width="2*" Binding="{Binding ActualCurrent}"/>
|
||||
</DataGrid.Columns>
|
||||
</DataGrid>
|
||||
</Grid>
|
||||
|
||||
<Grid Grid.Row="2" Grid.ColumnSpan="2">
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="4*" />
|
||||
<ColumnDefinition Width="6*" />
|
||||
</Grid.ColumnDefinitions>
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition Height="25" />
|
||||
<RowDefinition Height="*" />
|
||||
</Grid.RowDefinitions>
|
||||
|
||||
<Label Grid.ColumnSpan="2" FontSize="14" FontWeight="Bold" Foreground="White" Content="Temperature Monitor" Padding="5,0,0,2" Margin="0,5,0,0" VerticalContentAlignment="Center" BorderThickness="0" BorderBrush="#bdbcbd">
|
||||
<Label.Background>
|
||||
<LinearGradientBrush StartPoint="0,0" EndPoint="1,1">
|
||||
<GradientStop Color="#1959b1" Offset="0.31" />
|
||||
<GradientStop Color="#1959b1" Offset="0.09" />
|
||||
<GradientStop Color="white" Offset="1.1" />
|
||||
</LinearGradientBrush>
|
||||
</Label.Background>
|
||||
</Label>
|
||||
|
||||
<Border Grid.Row="1" Grid.ColumnSpan="2" BorderThickness="0,1,1,1" BorderBrush="#bdbcbd" Margin="0,0,0,5">
|
||||
<StackPanel Margin="5,5,0,0">
|
||||
<StackPanel Orientation="Horizontal">
|
||||
<StackPanel Margin="0,0,35,0">
|
||||
<Label FontSize="10" FontWeight="Bold" Padding="0" Width="20" Content="IDA" HorizontalContentAlignment="Center" BorderThickness="0" BorderBrush="#bdbcbd"/>
|
||||
<Image Source="pack://application:,,,/Program;component/Resources/Images/black-led.png" Width="15" Height="15"/>
|
||||
</StackPanel>
|
||||
<StackPanel Margin="0,0,35,0">
|
||||
<Label FontSize="10" FontWeight="Bold" Padding="0" Width="50" Content="SIC ADC" HorizontalContentAlignment="Center" BorderThickness="0" BorderBrush="#bdbcbd"/>
|
||||
<Image Source="pack://application:,,,/Program;component/Resources/Images/green-led.png" Width="15" Height="15"/>
|
||||
</StackPanel>
|
||||
<StackPanel Margin="0,0,35,0">
|
||||
<Label FontSize="10" FontWeight="Bold" Padding="0" Width="50" Content="VIP Versal" HorizontalContentAlignment="Center" BorderThickness="0" BorderBrush="#bdbcbd"/>
|
||||
<Image Source="pack://application:,,,/Program;component/Resources/Images/black-led.png" Width="15" Height="15"/>
|
||||
</StackPanel>
|
||||
<StackPanel Margin="0,0,15,0">
|
||||
<Label FontSize="10" FontWeight="Bold" Padding="0" Width="80" Content="VIP I2C Board" HorizontalContentAlignment="Center" BorderThickness="0" BorderBrush="#bdbcbd"/>
|
||||
<Image Source="pack://application:,,,/Program;component/Resources/Images/black-led.png" Width="15" Height="15"/>
|
||||
</StackPanel>
|
||||
<StackPanel Margin="0,0,15,0">
|
||||
<Label FontSize="10" FontWeight="Bold" Padding="0" Width="100" Content="VIP PolarFire FPGA" HorizontalContentAlignment="Center" BorderThickness="0" BorderBrush="#bdbcbd"/>
|
||||
<Image Source="pack://application:,,,/Program;component/Resources/Images/yellow-led.png" Width="15" Height="15"/>
|
||||
</StackPanel>
|
||||
<StackPanel Margin="0,0,15,0">
|
||||
<Label FontSize="10" FontWeight="Bold" Padding="0" Width="50" Content="MCC DSP" HorizontalContentAlignment="Center" BorderThickness="0" BorderBrush="#bdbcbd"/>
|
||||
<Image Source="pack://application:,,,/Program;component/Resources/Images/black-led.png" Width="15" Height="15"/>
|
||||
</StackPanel>
|
||||
<StackPanel>
|
||||
<Label FontSize="10" FontWeight="Bold" Padding="0" Width="80" Content="MCC Board" HorizontalContentAlignment="Center" BorderThickness="0" BorderBrush="#bdbcbd"/>
|
||||
<Image Source="pack://application:,,,/Program;component/Resources/Images/black-led.png" Width="15" Height="15"/>
|
||||
</StackPanel>
|
||||
</StackPanel>
|
||||
<StackPanel Orientation="Horizontal" Margin="0,20,0,0">
|
||||
<StackPanel Margin="0,0,15,0">
|
||||
<Label FontSize="10" FontWeight="Bold" Padding="0" Width="100" Content="CAS ACU DSP" HorizontalContentAlignment="Center" BorderThickness="0" BorderBrush="#bdbcbd"/>
|
||||
<Image Source="pack://application:,,,/Program;component/Resources/Images/red-led.png" Width="15" Height="15"/>
|
||||
</StackPanel>
|
||||
<StackPanel Margin="0,0,35,0">
|
||||
<Label FontSize="10" FontWeight="Bold" Padding="0" Width="50" Content="CAS ACU" HorizontalContentAlignment="Center" BorderThickness="0" BorderBrush="#bdbcbd"/>
|
||||
<Image Source="pack://application:,,,/Program;component/Resources/Images/green-led.png" Width="15" Height="15"/>
|
||||
</StackPanel>
|
||||
</StackPanel>
|
||||
</StackPanel>
|
||||
</Border>
|
||||
</Grid>
|
||||
</Grid>
|
||||
|
||||
<!-- Contains indicators -->
|
||||
<Grid Grid.Column="2">
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="4*" />
|
||||
<ColumnDefinition Width="6*" />
|
||||
</Grid.ColumnDefinitions>
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition Height="25" />
|
||||
<RowDefinition Height="5*" />
|
||||
<RowDefinition Height="5*" />
|
||||
</Grid.RowDefinitions>
|
||||
|
||||
<Label Grid.ColumnSpan="2" FontSize="14" FontWeight="Bold" Foreground="White" Content="Key Indicators" Padding="5,0,0,2" VerticalContentAlignment="Center" BorderThickness="0" BorderBrush="#bdbcbd">
|
||||
<Label.Background>
|
||||
<LinearGradientBrush StartPoint="0,0" EndPoint="1,1">
|
||||
<GradientStop Color="#1959b1" Offset="0.31" />
|
||||
<GradientStop Color="#1959b1" Offset="0.09" />
|
||||
<GradientStop Color="white" Offset="1.1" />
|
||||
</LinearGradientBrush>
|
||||
</Label.Background>
|
||||
</Label>
|
||||
|
||||
<Border Grid.Row="1" BorderThickness="1,0,0,1" BorderBrush="#bdbcbd" Margin="0,0,0,5">
|
||||
<StackPanel Margin="5,0,0,0">
|
||||
<StackPanel Orientation="Horizontal" Margin="0,5,0,10">
|
||||
<Label FontSize="10" FontWeight="Bold" Padding="0" Width="100" Content="TE Power" HorizontalAlignment="Left" VerticalContentAlignment="Center" BorderThickness="0" BorderBrush="#bdbcbd"/>
|
||||
<Image Source="{Binding TePowerLedImagePath, FallbackValue={StaticResource DesignSourceBlackLed}}" Width="15" Height="15"/>
|
||||
</StackPanel>
|
||||
<StackPanel Orientation="Horizontal" Margin="0,0,0,10">
|
||||
<Label FontSize="10" FontWeight="Bold" Padding="0" Width="100" Content="UUT Power" HorizontalAlignment="Left" VerticalContentAlignment="Center" BorderThickness="0" BorderBrush="#bdbcbd"/>
|
||||
<Image Source="{Binding UutPowerLedImagePath, FallbackValue={StaticResource DesignSourceBlackLed}}" Width="15" Height="15"/>
|
||||
</StackPanel>
|
||||
<StackPanel Orientation="Horizontal" Margin="0,0,0,10">
|
||||
<Label FontSize="10" FontWeight="Bold" Padding="0" Width="100" Content="Indicator 2" HorizontalAlignment="Left" VerticalContentAlignment="Center" BorderThickness="0" BorderBrush="#bdbcbd"/>
|
||||
<Image Source="pack://application:,,,/Program;component/Resources/Images/black-led.png" Width="15" Height="15"/>
|
||||
</StackPanel>
|
||||
<StackPanel Orientation="Horizontal">
|
||||
<Label FontSize="10" FontWeight="Bold" Padding="0" Width="100" Content="Indicator 3" HorizontalAlignment="Left" VerticalContentAlignment="Center" BorderThickness="0" BorderBrush="#bdbcbd"/>
|
||||
<Image Source="pack://application:,,,/Program;component/Resources/Images/black-led.png" Width="15" Height="15"/>
|
||||
</StackPanel>
|
||||
</StackPanel>
|
||||
</Border>
|
||||
|
||||
<Border Grid.Row="1" Grid.Column="1" BorderThickness="0,0,0,1" BorderBrush="#bdbcbd" Margin="0,0,0,5">
|
||||
<StackPanel>
|
||||
<StackPanel Orientation="Horizontal" Margin="0,5,0,10">
|
||||
<Label FontSize="10" FontWeight="Bold" Padding="0" Width="100" Content="Test Time" VerticalContentAlignment="Center" BorderThickness="0" BorderBrush="#bdbcbd"/>
|
||||
<Label FontSize="10" FontWeight="Bold" Padding="0" Width="100" Content="---" HorizontalContentAlignment="Center" VerticalContentAlignment="Center" BorderThickness="0" BorderBrush="#bdbcbd" Background="White"/>
|
||||
</StackPanel>
|
||||
<StackPanel Orientation="Horizontal" Margin="0,0,0,10">
|
||||
<Label FontSize="10" FontWeight="Bold" Padding="0" Width="100" Content="Coolant Flow" HorizontalAlignment="Left" VerticalContentAlignment="Center" BorderThickness="0" BorderBrush="#bdbcbd"/>
|
||||
<Label FontSize="10" FontWeight="Bold" Padding="0" Width="100" Content="---" HorizontalContentAlignment="Center" VerticalContentAlignment="Center" BorderThickness="0" BorderBrush="#bdbcbd" Background="White"/>
|
||||
</StackPanel>
|
||||
<StackPanel Orientation="Horizontal" Margin="0,0,0,10">
|
||||
<Label FontSize="10" FontWeight="Bold" Padding="0" Width="100" Content="Indicator 4" HorizontalAlignment="Left" VerticalContentAlignment="Center" BorderThickness="0" BorderBrush="#bdbcbd"/>
|
||||
<Label FontSize="10" FontWeight="Bold" Padding="0" Width="100" Content="---" HorizontalContentAlignment="Center" VerticalContentAlignment="Center" BorderThickness="0" BorderBrush="#bdbcbd" Background="White"/>
|
||||
</StackPanel>
|
||||
<StackPanel Orientation="Horizontal" Margin="0,0,0,10">
|
||||
<Label FontSize="10" FontWeight="Bold" Padding="0" Width="100" Content="Indicator 5" HorizontalAlignment="Left" VerticalContentAlignment="Center" BorderThickness="0" BorderBrush="#bdbcbd"/>
|
||||
<Label FontSize="10" FontWeight="Bold" Padding="0" Width="100" Content="---" HorizontalContentAlignment="Center" VerticalContentAlignment="Center" BorderThickness="0" BorderBrush="#bdbcbd" Background="White"/>
|
||||
</StackPanel>
|
||||
</StackPanel>
|
||||
</Border>
|
||||
|
||||
<Grid Grid.Row="2" Grid.ColumnSpan="2">
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="4*" />
|
||||
<ColumnDefinition Width="6*" />
|
||||
</Grid.ColumnDefinitions>
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition Height="25" />
|
||||
<RowDefinition Height="*" />
|
||||
</Grid.RowDefinitions>
|
||||
|
||||
<Label Grid.ColumnSpan="2" FontSize="14" FontWeight="Bold" Foreground="White" Content="Connectors" Padding="5,0,0,2" VerticalContentAlignment="Center" BorderThickness="0" BorderBrush="#bdbcbd">
|
||||
<Label.Background>
|
||||
<LinearGradientBrush StartPoint="0,0" EndPoint="1,1">
|
||||
<GradientStop Color="#1959b1" Offset="0.31" />
|
||||
<GradientStop Color="#1959b1" Offset="0.09" />
|
||||
<GradientStop Color="white" Offset="1.1" />
|
||||
</LinearGradientBrush>
|
||||
</Label.Background>
|
||||
</Label>
|
||||
|
||||
<Border Grid.Row="1" Grid.ColumnSpan="2" BorderThickness="1,0,0,1" BorderBrush="#bdbcbd" Margin="0,5,0,5">
|
||||
<StackPanel Margin="5,0,0,0" Orientation="Horizontal">
|
||||
<StackPanel Margin="0,0,15,0">
|
||||
<Label FontSize="10" FontWeight="Bold" Padding="0" Width="20" Content="J1" HorizontalContentAlignment="Center" BorderThickness="0" BorderBrush="#bdbcbd"/>
|
||||
<Image Source="pack://application:,,,/Program;component/Resources/Images/green-led.png" Width="15" Height="15"/>
|
||||
</StackPanel>
|
||||
<StackPanel Margin="0,0,15,0">
|
||||
<Label FontSize="10" FontWeight="Bold" Padding="0" Width="20" Content="J2" HorizontalContentAlignment="Center" BorderThickness="0" BorderBrush="#bdbcbd"/>
|
||||
<Image Source="pack://application:,,,/Program;component/Resources/Images/black-led.png" Width="15" Height="15"/>
|
||||
</StackPanel>
|
||||
<StackPanel Margin="0,0,15,0">
|
||||
<Label FontSize="10" FontWeight="Bold" Padding="0" Width="20" Content="J3" HorizontalContentAlignment="Center" BorderThickness="0" BorderBrush="#bdbcbd"/>
|
||||
<Image Source="pack://application:,,,/Program;component/Resources/Images/black-led.png" Width="15" Height="15"/>
|
||||
</StackPanel>
|
||||
<StackPanel Margin="0,0,15,0">
|
||||
<Label FontSize="10" FontWeight="Bold" Padding="0" Width="20" Content="J4" HorizontalContentAlignment="Center" BorderThickness="0" BorderBrush="#bdbcbd"/>
|
||||
<Image Source="pack://application:,,,/Program;component/Resources/Images/black-led.png" Width="15" Height="15"/>
|
||||
</StackPanel>
|
||||
<StackPanel Margin="0,0,15,0">
|
||||
<Label FontSize="10" FontWeight="Bold" Padding="0" Width="20" Content="J5" HorizontalContentAlignment="Center" BorderThickness="0" BorderBrush="#bdbcbd"/>
|
||||
<Image Source="pack://application:,,,/Program;component/Resources/Images/black-led.png" Width="15" Height="15"/>
|
||||
</StackPanel>
|
||||
<StackPanel Margin="0,0,15,0">
|
||||
<Label FontSize="10" FontWeight="Bold" Padding="0" Width="20" Content="J6" HorizontalContentAlignment="Center" BorderThickness="0" BorderBrush="#bdbcbd"/>
|
||||
<Image Source="pack://application:,,,/Program;component/Resources/Images/black-led.png" Width="15" Height="15"/>
|
||||
</StackPanel>
|
||||
<StackPanel Margin="0,0,15,0">
|
||||
<Label FontSize="10" FontWeight="Bold" Padding="0" Width="20" Content="J7" HorizontalContentAlignment="Center" BorderThickness="0" BorderBrush="#bdbcbd"/>
|
||||
<Image Source="pack://application:,,,/Program;component/Resources/Images/green-led.png" Width="15" Height="15"/>
|
||||
</StackPanel>
|
||||
<StackPanel Margin="0,0,15,0">
|
||||
<Label FontSize="10" FontWeight="Bold" Padding="0" Width="20" Content="J8" HorizontalContentAlignment="Center" BorderThickness="0" BorderBrush="#bdbcbd"/>
|
||||
<Image Source="pack://application:,,,/Program;component/Resources/Images/black-led.png" Width="15" Height="15"/>
|
||||
</StackPanel>
|
||||
<StackPanel Margin="0,0,15,0">
|
||||
<Label FontSize="10" FontWeight="Bold" Padding="0" Width="20" Content="J9" HorizontalContentAlignment="Center" BorderThickness="0" BorderBrush="#bdbcbd"/>
|
||||
<Image Source="pack://application:,,,/Program;component/Resources/Images/black-led.png" Width="15" Height="15"/>
|
||||
</StackPanel>
|
||||
<StackPanel Margin="0,0,15,0">
|
||||
<Label FontSize="10" FontWeight="Bold" Padding="0" Width="20" Content="J10" HorizontalContentAlignment="Center" BorderThickness="0" BorderBrush="#bdbcbd"/>
|
||||
<Image Source="pack://application:,,,/Program;component/Resources/Images/black-led.png" Width="15" Height="15"/>
|
||||
</StackPanel>
|
||||
<StackPanel>
|
||||
<Label FontSize="10" FontWeight="Bold" Padding="0" Width="20" Content="J11" HorizontalContentAlignment="Center" BorderThickness="0" BorderBrush="#bdbcbd"/>
|
||||
<Image Source="pack://application:,,,/Program;component/Resources/Images/black-led.png" Width="15" Height="15"/>
|
||||
</StackPanel>
|
||||
</StackPanel>
|
||||
</Border>
|
||||
|
||||
</Grid>
|
||||
</Grid>
|
||||
|
||||
<!-- Contains headers and datagrid for the passthrough data -->
|
||||
<Grid Grid.Row="1" Grid.ColumnSpan="3">
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="1*" />
|
||||
<ColumnDefinition Width="1*" />
|
||||
<ColumnDefinition Width="1*" />
|
||||
<ColumnDefinition Width="1*" />
|
||||
<ColumnDefinition Width="1*" />
|
||||
<ColumnDefinition Width="1*" />
|
||||
</Grid.ColumnDefinitions>
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition Height="25" />
|
||||
<RowDefinition Height="25" />
|
||||
<RowDefinition Height="*" />
|
||||
</Grid.RowDefinitions>
|
||||
|
||||
<Label Grid.ColumnSpan="6" FontSize="14" FontWeight="Bold" Foreground="White" Content="Passthrough" Padding="5,0,0,2" VerticalContentAlignment="Center" BorderThickness="0" BorderBrush="#bdbcbd">
|
||||
<Label.Background>
|
||||
<LinearGradientBrush StartPoint="0,0" EndPoint="1,1">
|
||||
<GradientStop Color="#1959b1" Offset="0.31" />
|
||||
<GradientStop Color="#1959b1" Offset="0.09" />
|
||||
<GradientStop Color="white" Offset="1.1" />
|
||||
</LinearGradientBrush>
|
||||
</Label.Background>
|
||||
</Label>
|
||||
<Label Grid.Row="1" FontSize="10" FontWeight="Bold" Content="Variable" Padding="0" HorizontalContentAlignment="Center" VerticalContentAlignment="Center" BorderThickness="0,1,1,1" BorderBrush="#bdbcbd"/>
|
||||
<Label Grid.Row="1" Grid.Column="1" FontSize="10" FontWeight="Bold" Content="Value" Padding="0" HorizontalContentAlignment="Center" VerticalContentAlignment="Center" BorderThickness="0,1,1,1" BorderBrush="#bdbcbd"/>
|
||||
<Label Grid.Row="1" Grid.Column="2" FontSize="10" FontWeight="Bold" Content="Variable" Padding="0" HorizontalContentAlignment="Center" VerticalContentAlignment="Center" BorderThickness="0,1,1,1" BorderBrush="#bdbcbd"/>
|
||||
<Label Grid.Row="1" Grid.Column="3" FontSize="10" FontWeight="Bold" Content="Value" Padding="0" HorizontalContentAlignment="Center" VerticalContentAlignment="Center" BorderThickness="0,1,1,1" BorderBrush="#bdbcbd"/>
|
||||
<Label Grid.Row="1" Grid.Column="4" FontSize="10" FontWeight="Bold" Content="Variable" Padding="0" HorizontalContentAlignment="Center" VerticalContentAlignment="Center" BorderThickness="0,1,1,1" BorderBrush="#bdbcbd"/>
|
||||
<Label Grid.Row="1" Grid.Column="5" FontSize="10" FontWeight="Bold" Content="Value" Padding="0" HorizontalContentAlignment="Center" VerticalContentAlignment="Center" BorderThickness="0,1,0,1" BorderBrush="#bdbcbd"/>
|
||||
|
||||
<!-- DataGrid for Passthrough Data -->
|
||||
<DataGrid Grid.Row="2" Grid.ColumnSpan="6" x:FieldModifier="public" Name="datagridPassthroughData" ItemsSource="{Binding _dataGridPassthroughDatatems}" AutoGenerateColumns="False" CanUserAddRows="False" IsReadOnly="True" SelectionMode="Extended" SelectionUnit="FullRow" Width="auto" HorizontalGridLinesBrush="#e9e9e9" VerticalGridLinesBrush="#e9e9e9" HeadersVisibility="None" BorderThickness="1,0,0,0" BorderBrush="#e9e9e9">
|
||||
<DataGrid.Resources>
|
||||
<Style x:Key="CellStyle" TargetType="DataGridCell">
|
||||
<Setter Property="TextBlock.TextAlignment" Value="Center" />
|
||||
<Setter Property="Foreground" Value="Black" />
|
||||
<Style.Triggers>
|
||||
<Trigger Property="IsSelected" Value="True">
|
||||
<Setter Property="Background" Value="{x:Null}" />
|
||||
<Setter Property="BorderBrush" Value="{x:Null}" />
|
||||
</Trigger>
|
||||
</Style.Triggers>
|
||||
</Style>
|
||||
</DataGrid.Resources>
|
||||
<DataGrid.Columns>
|
||||
<DataGridTextColumn CellStyle="{StaticResource CellStyle}" Header="item1Name" Width="1*" Binding="{Binding [0]}"/>
|
||||
<DataGridTextColumn CellStyle="{StaticResource CellStyle}" Header="item1Value" Width="1*" Binding="{Binding [1]}"/>
|
||||
<DataGridTextColumn CellStyle="{StaticResource CellStyle}" Header="item2Name" Width="1*" Binding="{Binding [2]}"/>
|
||||
<DataGridTextColumn CellStyle="{StaticResource CellStyle}" Header="item2Value" Width="1*" Binding="{Binding [3]}"/>
|
||||
<DataGridTextColumn CellStyle="{StaticResource CellStyle}" Header="item3Name" Width="1*" Binding="{Binding [4]}"/>
|
||||
<DataGridTextColumn CellStyle="{StaticResource CellStyle}" Header="item3Value" Width="1*" Binding="{Binding [5]}"/>
|
||||
</DataGrid.Columns>
|
||||
</DataGrid>
|
||||
</Grid>
|
||||
</Grid>
|
||||
|
||||
<StatusBar Grid.Row="3" BorderThickness="0,1,0,0" BorderBrush="#bdbcbd">
|
||||
<StatusBarItem FontSize="16">Placeholder</StatusBarItem>
|
||||
<StatusBarItem>
|
||||
<TextBlock FontSize="16">Placeholder</TextBlock>
|
||||
</StatusBarItem>
|
||||
</StatusBar>
|
||||
|
||||
</Grid>
|
||||
|
||||
|
||||
</Window>
|
||||
57
Source/Program/GUI/View/LiveDataWindow.xaml.cs
Normal file
@@ -0,0 +1,57 @@
|
||||
using ProgramLib.GUI.ViewModel;
|
||||
using System;
|
||||
using System.Windows;
|
||||
using System.Windows.Media.Imaging;
|
||||
|
||||
namespace ProgramLib.GUI.View
|
||||
{
|
||||
/// <summary>
|
||||
/// Interaction logic for MainWindow.xaml
|
||||
/// </summary>
|
||||
internal partial class LiveDataWindow : Window
|
||||
{
|
||||
internal LiveDataWindowViewModel LiveDataWindowViewModel { get; set; }
|
||||
|
||||
public LiveDataWindow()
|
||||
{
|
||||
InitializeComponent();
|
||||
|
||||
Uri iconUri = new Uri("pack://application:,,,/Program;component/Resources/Icons/app.ico");
|
||||
this.Icon = BitmapFrame.Create(iconUri);
|
||||
|
||||
WindowStartupLocation = System.Windows.WindowStartupLocation.CenterScreen;
|
||||
|
||||
LiveDataWindowViewModel = new LiveDataWindowViewModel(this);
|
||||
DataContext = LiveDataWindowViewModel;
|
||||
}
|
||||
|
||||
private void btnClose_Click(object sender, RoutedEventArgs e)
|
||||
{
|
||||
this.Hide();
|
||||
}
|
||||
|
||||
private void btnMax_Click(object sender, RoutedEventArgs e)
|
||||
{
|
||||
if (this.WindowState == WindowState.Maximized)
|
||||
{
|
||||
this.WindowState = WindowState.Normal;
|
||||
imgMax.Source = new BitmapImage(new System.Uri("pack://application:,,,/Resources/Images/Title_Bar_Buttons/maximize.png"));
|
||||
}
|
||||
else
|
||||
{
|
||||
this.WindowState = WindowState.Maximized;
|
||||
imgMax.Source = new BitmapImage(new System.Uri("pack://application:,,,/Resources/Images/Title_Bar_Buttons/restore.png"));
|
||||
}
|
||||
}
|
||||
|
||||
private void btnMin_Click(object sender, RoutedEventArgs e)
|
||||
{
|
||||
this.WindowState = WindowState.Minimized;
|
||||
}
|
||||
|
||||
private void Window_MouseLeftButtonDown(object sender, System.Windows.Input.MouseButtonEventArgs e)
|
||||
{
|
||||
DragMove();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,63 @@
|
||||
using CommunityToolkit.Mvvm.ComponentModel;
|
||||
using ProgramLib.GUI.Model;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Collections.ObjectModel;
|
||||
using System.Windows;
|
||||
using System.Windows.Threading;
|
||||
|
||||
namespace ProgramLib.GUI.ViewModel
|
||||
{
|
||||
internal class ImpedanceCheckWindowViewModel : ObservableObject
|
||||
{
|
||||
private Window _window;
|
||||
public enum Images
|
||||
{
|
||||
PASS_CHECK,
|
||||
FAIL_CHECK
|
||||
}
|
||||
|
||||
public Dictionary<Images, string> ImageToResourcePathDict
|
||||
{
|
||||
get
|
||||
{
|
||||
return _imageToResourcePathDict;
|
||||
}
|
||||
|
||||
private set { }
|
||||
}
|
||||
|
||||
private Dictionary<Images, string> _imageToResourcePathDict = new Dictionary<Images, string>()
|
||||
{
|
||||
{Images.PASS_CHECK, @"pack://application:,,,/Program;component/Resources/Images/green-check-mark.png" },
|
||||
{Images.FAIL_CHECK, @"pack://application:,,,/Program;component/Resources/Images/red-cross-mark.png" }
|
||||
};
|
||||
|
||||
#region Data Bindings
|
||||
public ObservableCollection<ImpedanceDataModel> _listviewImpedanceDatatems { get; set; }
|
||||
|
||||
#endregion Data Bindings
|
||||
|
||||
public ImpedanceCheckWindowViewModel(Window window)
|
||||
{
|
||||
_window = window;
|
||||
_listviewImpedanceDatatems = new ObservableCollection<ImpedanceDataModel>();
|
||||
}
|
||||
|
||||
public void AddData(ImpedanceDataModel item)
|
||||
{
|
||||
_window.Dispatcher.Invoke((Action)delegate
|
||||
{
|
||||
_listviewImpedanceDatatems.Add(item);
|
||||
});
|
||||
}
|
||||
|
||||
public void ClearData()
|
||||
{
|
||||
_window.Dispatcher.Invoke((Action)delegate
|
||||
{
|
||||
_listviewImpedanceDatatems.Clear();
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
84
Source/Program/GUI/ViewModel/LiveDataWindowViewModel.cs
Normal file
@@ -0,0 +1,84 @@
|
||||
using CommunityToolkit.Mvvm.ComponentModel;
|
||||
using ProgramLib.GUI.Model;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Collections.ObjectModel;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using System.Windows;
|
||||
|
||||
namespace ProgramLib.GUI.ViewModel
|
||||
{
|
||||
internal partial class LiveDataWindowViewModel : ObservableObject
|
||||
{
|
||||
public enum Images
|
||||
{
|
||||
LED_ON,
|
||||
LED_OFF
|
||||
}
|
||||
|
||||
private Window _window;
|
||||
|
||||
public Dictionary<Images, string> ImageToResourcePathDict
|
||||
{
|
||||
get
|
||||
{
|
||||
return _imageToResourcePathDict;
|
||||
}
|
||||
|
||||
private set { }
|
||||
}
|
||||
|
||||
private Dictionary<Images, string> _imageToResourcePathDict = new Dictionary<Images, string>()
|
||||
{
|
||||
{Images.LED_ON, @"pack://application:,,,/ProgramGui;component/Resources/Images/green-led.png" },
|
||||
{Images.LED_OFF, @"pack://application:,,,/ProgramGui;component/Resources/Images/black-led.png" }
|
||||
};
|
||||
|
||||
#region Data Bindings
|
||||
public ObservableCollection<PowerModuleDataModel> _dataGridPowerDatatems { get; set; }
|
||||
|
||||
// 2-dimensional data array
|
||||
// inner ObservableCollection<> is the columns
|
||||
// outer ObservableCollection is the row
|
||||
public ObservableCollection<ObservableCollection<string>> _dataGridPassthroughDatatems { get; set; }
|
||||
|
||||
[ObservableProperty]
|
||||
private string uutPowerLedImagePath;
|
||||
|
||||
[ObservableProperty]
|
||||
private string tePowerLedImagePath;
|
||||
|
||||
#endregion Data Bindings
|
||||
|
||||
public LiveDataWindowViewModel(Window window)
|
||||
{
|
||||
_window = window;
|
||||
_dataGridPowerDatatems = new ObservableCollection<PowerModuleDataModel>();
|
||||
_dataGridPassthroughDatatems = new ObservableCollection<ObservableCollection<string>>();
|
||||
|
||||
UutPowerLedImagePath = _imageToResourcePathDict[Images.LED_OFF];
|
||||
TePowerLedImagePath = _imageToResourcePathDict[Images.LED_ON];
|
||||
}
|
||||
|
||||
public void AddPowerData(Dictionary<string, PowerModuleDataModel> powerModuleToPowerDataModelDict)
|
||||
{
|
||||
foreach (var item in powerModuleToPowerDataModelDict)
|
||||
{
|
||||
_dataGridPowerDatatems.Add(item.Value);
|
||||
}
|
||||
}
|
||||
|
||||
public void AddPassthroughData(Dictionary<int, ObservableCollection<string>> rowNumberToPassthroughDataDict)
|
||||
{
|
||||
_window.Dispatcher.Invoke((Action)delegate
|
||||
{
|
||||
foreach (var item in rowNumberToPassthroughDataDict)
|
||||
{
|
||||
_dataGridPassthroughDatatems.Add(item.Value);
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,20 +0,0 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Configurations>
|
||||
<IniConfiguration>
|
||||
<section name="Parts">
|
||||
<key name="Location" value="C:\Program Files (x86)\Raytheon\RINSS\Parts" />
|
||||
</section>
|
||||
</IniConfiguration>
|
||||
<XmlConfigurations>
|
||||
<XmlConfiguration name="Instruments">
|
||||
<Instrument>
|
||||
<Name>TCP_CLIENT_1</Name>
|
||||
<Factory>EthernetSocketsTcpClientFactory</Factory>
|
||||
</Instrument>
|
||||
<Instrument>
|
||||
<Name>STE_POWER_SUPPLY_SYSTEM</Name>
|
||||
<Factory>PowerSupplyKeysightN67xxFactory</Factory>
|
||||
</Instrument>
|
||||
</XmlConfiguration>
|
||||
</XmlConfigurations>
|
||||
</Configurations>
|
||||
@@ -1,59 +0,0 @@
|
||||
[GENERAL]
|
||||
ETHERNET_ADDRESS = localhost
|
||||
ETHERNET_PORT = 5025
|
||||
MODULE_DEFINITION = UUT_REF_3_3V, STE_PVM_5V, STE_GU_INTERFACE_RELAYS_25V, STE_GU_INTERFACE_RF_INTERFACE_5V
|
||||
; 0 means no coupled modules.
|
||||
; couple means turning on/off any one of the module, turns on/off the others
|
||||
COUPLED_MODULES = STE_PVM_5V, STE_GU_INTERFACE_RELAYS_25V, STE_GU_INTERFACE_RF_INTERFACE_5V
|
||||
; 0 means no grouped modules.
|
||||
; group means turning combining 2 or more modules thus acting as one module
|
||||
GROUPED_MODULES = 0
|
||||
INTERFACE = ETHERNET
|
||||
|
||||
; GU | KW | KWSIM | SELFTEST | ZERO VOLTAGE
|
||||
[UUT_REF_3_3V]
|
||||
INDEX = 1
|
||||
OCP = 2.0
|
||||
OVP = 4.0
|
||||
VOLTAGE_SETPOINT = 3.3
|
||||
|
||||
MIN_VOLTAGE = 3.0
|
||||
MAX_VOLTAGE = 3.75
|
||||
MAX_CURRENT = 2.0
|
||||
MIN_CURRENT = -0.25
|
||||
|
||||
[STE_PVM_5V]
|
||||
INDEX = 2
|
||||
OCP = 2.0
|
||||
OVP = 8.0
|
||||
VOLTAGE_SETPOINT = 5.0
|
||||
|
||||
; STE Power (PVM and peripherals) supply settings
|
||||
MIN_VOLTAGE = 4.0
|
||||
MAX_VOLTAGE = 5.5
|
||||
MAX_CURRENT = 1.5
|
||||
MIN_CURRENT = -.25
|
||||
|
||||
[STE_GU_INTERFACE_RELAYS_25V]
|
||||
INDEX = 3
|
||||
OCP = 3.0
|
||||
OVP = 34.0
|
||||
VOLTAGE_SETPOINT = 25.0
|
||||
|
||||
; STE Power (GU interface and Relays) Supply settings
|
||||
MIN_VOLTAGE = 22.0
|
||||
MAX_VOLTAGE = 30.0
|
||||
MAX_CURRENT = 3.0
|
||||
MIN_CURRENT = -0.25
|
||||
|
||||
[STE_GU_INTERFACE_RF_INTERFACE_5V]
|
||||
INDEX = 4
|
||||
OCP = 5.0
|
||||
OVP = 6.5
|
||||
VOLTAGE_SETPOINT = 5.0
|
||||
|
||||
; STE Power (PVM and peripherals) supply settings
|
||||
MIN_VOLTAGE = 4.0
|
||||
MAX_VOLTAGE = 6.3
|
||||
MAX_CURRENT = 4.5
|
||||
MIN_CURRENT = -.25
|
||||
9
Source/Program/InstrumentConfigFiles/ADVANTECH_DIO_1.xml
Normal file
@@ -0,0 +1,9 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Configurations>
|
||||
<IniConfiguration>
|
||||
<section name="ADVANTECH_DIO_1">
|
||||
<key name="DIO_MODULE_DEF_FILEPATH" value=".\InstrumentConfig\DIO_MODULES.ini" />
|
||||
</section>
|
||||
</IniConfiguration>
|
||||
<XmlConfigurations />
|
||||
</Configurations>
|
||||
45
Source/Program/InstrumentConfigFiles/DIO_MODULES.ini
Normal file
@@ -0,0 +1,45 @@
|
||||
; ===============================================================================================================
|
||||
; This name must match the name specified in the Instrument.xml for an instrument of type DIO
|
||||
[PICKERING_DIO_1]
|
||||
PXI_CARD_SLOT_INDEX = 0
|
||||
SHALL_WE_DRIVE_OUTPUT_UPON_INITIALIZATION = false
|
||||
; number channels per port
|
||||
NUM_CHANNELS_PER_PORT=8
|
||||
; either 0 or 1 as the starting channel index
|
||||
CHANNEL_START_INDEX=0
|
||||
NUM_OUTPUT_CHANNELS = 32
|
||||
NUM_INPUT_CHANNELS = 32
|
||||
|
||||
;format is <signal_name> = <Channel Number>|<Initial State>
|
||||
;<Initial State> is either 0 or 1 or 2(Logic Z)
|
||||
[PICKERING_DIO_1.OUTPUT_SIGNALS]
|
||||
SIGNAL_1 = 0|1
|
||||
SIGNAL_2 = 1|0
|
||||
|
||||
;format is <signal_name> = <Channel Number>
|
||||
[PICKERING_DIO_1.INPUT_SIGNALS]
|
||||
SIGNAL_3 = 0
|
||||
SIGNAL_4 = 0
|
||||
|
||||
; ===============================================================================================================
|
||||
; This name must match the name specified in the Instrument.xml for an instrument of type DIO
|
||||
[ADVANTECH_DIO_1]
|
||||
DEVICE_NUMBER = 0
|
||||
SHALL_WE_DRIVE_OUTPUT_UPON_INITIALIZATION = false
|
||||
; number channels per port
|
||||
NUM_CHANNELS_PER_PORT=8
|
||||
; either 0 or 1 as the starting channel index
|
||||
CHANNEL_START_INDEX=0
|
||||
NUM_OUTPUT_CHANNELS = 32
|
||||
NUM_INPUT_CHANNELS = 32
|
||||
|
||||
;format is <signal_name> = <Channel Number>|<Initial State>
|
||||
;<Initial State> is either 0 or 1 or 2(Logic Z)
|
||||
[ADVANTECH_DIO_1.OUTPUT_SIGNALS]
|
||||
SIGNAL_5 = 0|1
|
||||
SIGNAL_6 = 1|0
|
||||
|
||||
;format is <signal_name> = <Channel Number>
|
||||
[ADVANTECH_DIO_1.INPUT_SIGNALS]
|
||||
SIGNAL_7 = 0
|
||||
SIGNAL_8 = 0
|
||||
36
Source/Program/InstrumentConfigFiles/Instruments.xml
Normal file
@@ -0,0 +1,36 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Configurations>
|
||||
<IniConfiguration>
|
||||
<section name="Parts">
|
||||
<key name="Location" value="C:\Program Files (x86)\Raytheon\RINSS\Parts" />
|
||||
</section>
|
||||
</IniConfiguration>
|
||||
<XmlConfigurations>
|
||||
<XmlConfiguration name="Instruments">
|
||||
<Instrument>
|
||||
<Name>STE_POWER_SUPPLY_SYSTEM</Name>
|
||||
<Factory>PowerSupplySystemKeysightFactory</Factory>
|
||||
</Instrument>
|
||||
<Instrument>
|
||||
<Name>UUT_POWER_SUPPLY_SYSTEM</Name>
|
||||
<Factory>PowerSupplySystemKeysightFactory</Factory>
|
||||
</Instrument>
|
||||
<Instrument>
|
||||
<Name>PICKERING_DIO_1</Name>
|
||||
<Factory>DIOPickering40xFactory</Factory>
|
||||
</Instrument>
|
||||
<Instrument>
|
||||
<Name>ADVANTECH_DIO_1</Name>
|
||||
<Factory>DIOAdvantechFactory</Factory>
|
||||
</Instrument>
|
||||
<Instrument>
|
||||
<Name>PICKERING_SWITCH_1</Name>
|
||||
<Factory>SwitchPickeringPipx40Factory</Factory>
|
||||
</Instrument>
|
||||
<Instrument>
|
||||
<Name>KEYSIGHT_DMM_1</Name>
|
||||
<Factory>DMMKeysightScpiFactory</Factory>
|
||||
</Instrument>
|
||||
</XmlConfiguration>
|
||||
</XmlConfigurations>
|
||||
</Configurations>
|
||||
9
Source/Program/InstrumentConfigFiles/KEYSIGHT_DMM_1.xml
Normal file
@@ -0,0 +1,9 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Configurations>
|
||||
<IniConfiguration>
|
||||
<section name="KEYSIGHT_DMM_1">
|
||||
|
||||
</section>
|
||||
</IniConfiguration>
|
||||
<XmlConfigurations />
|
||||
</Configurations>
|
||||
56
Source/Program/InstrumentConfigFiles/KEYSIGHT_SCPI_DEF.ini
Normal file
@@ -0,0 +1,56 @@
|
||||
[SYSTEM]
|
||||
;system commands
|
||||
CLEAR_CMD = *CLS
|
||||
RESET_CMD = *RST
|
||||
SELFTEST_CMD = *TST?
|
||||
READ_ERROR_CODE_CMD = SYST:ERR?
|
||||
REBOOT_CMD = SYST:REB
|
||||
|
||||
;panel disable/enable commands
|
||||
SET_FRONTPANEL_DISABLE_CMD = SYST:COMM:RLST RWL
|
||||
SET_FRONTPANEL_ENABLE_CMD = SYST:COMM:RLST REM
|
||||
|
||||
;watchdog commands
|
||||
SET_WATCHDOGDELAY_CMD = OUTP:PROT:WDOG:DEL
|
||||
SET_WATCHDOGON_CMD = OUTP:PROT:WDOG ON
|
||||
SET_WATCHDOGOFF_CMD = OUTP:PROT:WDOG OFF
|
||||
|
||||
;coupling commands
|
||||
SET_COUPLE_CHANNELS_CMD = OUTP:COUP:CHAN
|
||||
SET_COUPLE_ON_CMD = OUTP:COUP ON
|
||||
SET_COUPLE_OUTPUT_PROTECT_ON_CMD = OUTP:PROT:COUP ON
|
||||
QUERY_COUPLE_CHANNELS = OUTP:COUP:CHAN?
|
||||
QUERY_COUPLE_STATE = OUTP:COUP?
|
||||
|
||||
; Grouping Commands
|
||||
SET_GROUP_DEFINE_CMD = SYST:GRO:DEF
|
||||
UNGROUP_ALL_CHANNELS_CMD = SYST:GRO:DEL:ALL
|
||||
QUERY_GROUP_CHANNELS = SYST:GRO:CAT?
|
||||
|
||||
[MODULE]
|
||||
; current commands
|
||||
SET_INRUSH_DELAY_CMD = CURR:PROT:DEL
|
||||
READ_INRUSH_DELAY_CMD = CURR:PROT:DEL?
|
||||
READ_CURRENT_CMD = MEAS:CURR?
|
||||
SET_OCP_CMD = CURR:LEV
|
||||
READ_OCP_CMD = CURR:LEV?
|
||||
SET_OCP_ON_CMD = CURR:PROT:STAT ON
|
||||
|
||||
; voltage commands
|
||||
SET_OVP_CMD = VOLT:PROT
|
||||
SET_VOLTAGE_SLEW_CMD = VOLT:SLEW
|
||||
SET_VOLTAGE_SETPOINT_CMD = VOLT:LEV
|
||||
SET_CONSTANT_VOLTAGE_CMD = STAT:OPER:ENAB 1
|
||||
READ_VOLTAGE_CMD = MEAS:VOLT?
|
||||
READ_VOLTAGE_SETPOINT_CMD = VOLT?
|
||||
READ_OVP_CMD = VOLT:PROT?
|
||||
READ_VOLTAGE_SLEW_CMD = VOLT:SLEW?
|
||||
|
||||
; set output commands
|
||||
SET_OUTPUT_DISABLE_CMD = OUTP OFF
|
||||
SET_OUTPUT_ENABLE_CMD = OUTP ON
|
||||
|
||||
; query status
|
||||
READ_OUTPUT_STATUS_CMD = OUTP?
|
||||
READ_ERROR_STATUS_CMD = SYST:ERR?
|
||||
READ_PROTECTION_STATUS_CMD = STAT:QUES:COND?
|
||||
9
Source/Program/InstrumentConfigFiles/PICKERING_DIO_1.xml
Normal file
@@ -0,0 +1,9 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Configurations>
|
||||
<IniConfiguration>
|
||||
<section name="PICKERING_DIO_1">
|
||||
<key name="DIO_MODULE_DEF_FILEPATH" value=".\InstrumentConfig\DIO_MODULES.ini" />
|
||||
</section>
|
||||
</IniConfiguration>
|
||||
<XmlConfigurations />
|
||||
</Configurations>
|
||||
@@ -0,0 +1,9 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Configurations>
|
||||
<IniConfiguration>
|
||||
<section name="PICKERING_SWITCH_1">
|
||||
|
||||
</section>
|
||||
</IniConfiguration>
|
||||
<XmlConfigurations />
|
||||
</Configurations>
|
||||
@@ -0,0 +1,95 @@
|
||||
; ===============================================================================================================
|
||||
; This name must match the name specified in the Instrument.xml that is associated with the power supply system
|
||||
[STE_POWER_SUPPLY_SYSTEM]
|
||||
SCPI_DEF_FILEPATH = .\InstrumentConfig\KEYSIGHT_SCPI_DEF.ini
|
||||
ETHERNET_ADDRESS = localhost
|
||||
ETHERNET_PORT = 5025
|
||||
MODULE_DEFINITION = UUT_REF_3_3V, STE_PVM_5V, STE_GU_INTERFACE_RELAYS_25V, STE_GU_INTERFACE_RF_INTERFACE_5V
|
||||
; 0 means no coupled modules.
|
||||
; couple means turning on/off any one of the module, turns on/off the others
|
||||
COUPLED_MODULES = STE_PVM_5V, STE_GU_INTERFACE_RELAYS_25V, STE_GU_INTERFACE_RF_INTERFACE_5V
|
||||
; 0 means no grouped modules.
|
||||
; group means turning combining 2 or more modules thus acting as one module
|
||||
GROUPED_MODULES = 0
|
||||
INTERFACE = ETHERNET
|
||||
|
||||
[STE_POWER_SUPPLY_SYSTEM.UUT_REF_3_3V]
|
||||
INDEX = 1
|
||||
OCP = 2.0
|
||||
OVP = 4.0
|
||||
VOLTAGE_SETPOINT = 3.3
|
||||
|
||||
MIN_VOLTAGE = 3.0
|
||||
MAX_VOLTAGE = 3.75
|
||||
MAX_CURRENT = 2.0
|
||||
MIN_CURRENT = -0.25
|
||||
|
||||
[STE_POWER_SUPPLY_SYSTEM.STE_PVM_5V]
|
||||
INDEX = 2
|
||||
OCP = 2.0
|
||||
OVP = 8.0
|
||||
VOLTAGE_SETPOINT = 5.0
|
||||
|
||||
MIN_VOLTAGE = 4.0
|
||||
MAX_VOLTAGE = 5.5
|
||||
MAX_CURRENT = 1.5
|
||||
MIN_CURRENT = -.25
|
||||
|
||||
[STE_POWER_SUPPLY_SYSTEM.STE_GU_INTERFACE_RELAYS_25V]
|
||||
INDEX = 3
|
||||
OCP = 3.0
|
||||
OVP = 34.0
|
||||
VOLTAGE_SETPOINT = 25.0
|
||||
|
||||
MIN_VOLTAGE = 22.0
|
||||
MAX_VOLTAGE = 30.0
|
||||
MAX_CURRENT = 3.0
|
||||
MIN_CURRENT = -0.25
|
||||
|
||||
[STE_POWER_SUPPLY_SYSTEM.STE_GU_INTERFACE_RF_INTERFACE_5V]
|
||||
INDEX = 4
|
||||
OCP = 5.0
|
||||
OVP = 6.5
|
||||
VOLTAGE_SETPOINT = 5.0
|
||||
|
||||
MIN_VOLTAGE = 4.0
|
||||
MAX_VOLTAGE = 6.3
|
||||
MAX_CURRENT = 4.5
|
||||
MIN_CURRENT = -.25
|
||||
|
||||
; ===============================================================================================================
|
||||
; This name must match the name specified in the Instrument.xml that is associated with the power supply system
|
||||
[UUT_POWER_SUPPLY_SYSTEM]
|
||||
SCPI_DEF_FILEPATH = .\InstrumentConfig\KEYSIGHT_SCPI_DEF.ini
|
||||
ETHERNET_ADDRESS = localhost
|
||||
ETHERNET_PORT = 5026
|
||||
MODULE_DEFINITION = UUT_P20V, UUT_N20V
|
||||
; 0 means no coupled modules.
|
||||
; couple means turning on/off any one of the module, turns on/off the others
|
||||
COUPLED_MODULES = 0
|
||||
; 0 means no grouped modules.
|
||||
; group means turning combining 2 or more modules thus acting as one module
|
||||
GROUPED_MODULES = 0
|
||||
INTERFACE = ETHERNET
|
||||
|
||||
[UUT_POWER_SUPPLY_SYSTEM.UUT_P20V]
|
||||
INDEX = 1
|
||||
OCP = 1.5
|
||||
OVP = 22.0
|
||||
VOLTAGE_SETPOINT = 20.0
|
||||
|
||||
MIN_VOLTAGE = 19.0
|
||||
MAX_VOLTAGE = 22.75
|
||||
MAX_CURRENT = 2.3
|
||||
MIN_CURRENT = -0.25
|
||||
|
||||
[UUT_POWER_SUPPLY_SYSTEM.UUT_N20V]
|
||||
INDEX = 2
|
||||
OCP = 1.8
|
||||
OVP = 22.5
|
||||
VOLTAGE_SETPOINT = 20.0
|
||||
|
||||
MIN_VOLTAGE = 18.0
|
||||
MAX_VOLTAGE = 23.0
|
||||
MAX_CURRENT = 2.5
|
||||
MIN_CURRENT = -.25
|
||||
@@ -2,7 +2,7 @@
|
||||
<Configurations>
|
||||
<IniConfiguration>
|
||||
<section name="STE_POWER_SUPPLY_SYSTEM">
|
||||
<key name="INI_FILE_PATH" value=".\InstrumentConfig\STE_POWER_SUPPLY_SYSTEM.ini" />
|
||||
<key name="POWER_SUPPLY_SYSTEM_DEF_FILEPATH" value=".\InstrumentConfig\POWER_SUPPLY_SYSTEMS.ini" />
|
||||
</section>
|
||||
</IniConfiguration>
|
||||
<XmlConfigurations />
|
||||
@@ -0,0 +1,9 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Configurations>
|
||||
<IniConfiguration>
|
||||
<section name="UUT_POWER_SUPPLY_SYSTEM">
|
||||
<key name="POWER_SUPPLY_SYSTEM_DEF_FILEPATH" value=".\InstrumentConfig\POWER_SUPPLY_SYSTEMS.ini" />
|
||||
</section>
|
||||
</IniConfiguration>
|
||||
<XmlConfigurations />
|
||||
</Configurations>
|
||||
@@ -15,7 +15,7 @@ GOVERNMENT.
|
||||
|
||||
UNPUBLISHED WORK - COPYRIGHT RAYTHEON COMPANY.
|
||||
-------------------------------------------------------------------------*/
|
||||
using ProgramGui;
|
||||
using ProgramLib;
|
||||
using Raytheon.Instruments;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
@@ -27,13 +27,10 @@ using System.Threading.Tasks;
|
||||
namespace ProgramLib
|
||||
{
|
||||
/// <summary>
|
||||
/// Methods to call into actions
|
||||
/// </summary>
|
||||
/// Partial class that define all the actions that can be executed
|
||||
/// </summary>
|
||||
public partial class Program
|
||||
{
|
||||
/// <summary>
|
||||
/// Power on UUT
|
||||
/// </summary>
|
||||
public void UutPowerOn()
|
||||
{
|
||||
try
|
||||
@@ -47,17 +44,12 @@ namespace ProgramLib
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
_logger.Error(ex.Message + "\n" + ex.StackTrace);
|
||||
|
||||
// DO NOT THROW in this block
|
||||
// this function will handle the error accordingly since we could be calling this from third-party test executive like TestStand
|
||||
TerminateTestOnMainThreadError(ex);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Power off UUT
|
||||
/// </summary>
|
||||
public void UutPowerOff()
|
||||
{
|
||||
try
|
||||
@@ -71,8 +63,6 @@ namespace ProgramLib
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
_logger.Error(ex.Message + "\n" + ex.StackTrace);
|
||||
|
||||
// DO NOT THROW in this block
|
||||
// this function will handle the error accordingly since we could be calling this from third-party test executive like TestStand
|
||||
TerminateTestOnMainThreadError(ex);
|
||||
|
||||
46
Source/Program/Program.FunctionalTests.cs
Normal file
@@ -0,0 +1,46 @@
|
||||
/*-------------------------------------------------------------------------
|
||||
// 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;
|
||||
|
||||
namespace ProgramLib
|
||||
{
|
||||
/// <summary>
|
||||
/// Partial class that define all the Functional Tests for all the Functional Test Requirements in the TRD
|
||||
/// </summary>
|
||||
public partial class Program
|
||||
{
|
||||
/// <summary>
|
||||
/// GMA_ATP_001 - Perform UUT Safe-to-turn-on
|
||||
/// </summary>
|
||||
public void Perform_GMA_ATP_001_UUT_STTO()
|
||||
{
|
||||
try
|
||||
{
|
||||
BasicTest test = new GMA_ATP_001_UUT_STTO();
|
||||
test.RunTest();
|
||||
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
// DO NOT THROW in this block
|
||||
// this function will handle the error accordingly since we could be calling this from third-party test executive like TestStand
|
||||
TerminateTestOnMainThreadError(ex);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -26,9 +26,10 @@ using Raytheon.Instruments;
|
||||
using Raytheon.Common;
|
||||
using NLog;
|
||||
using System.Windows.Interop;
|
||||
using ProgramGui;
|
||||
using ProgramLib;
|
||||
using NationalInstruments.TestStand.Interop.API;
|
||||
using System.Runtime.ExceptionServices;
|
||||
using MeasurementManagerLib;
|
||||
|
||||
namespace ProgramLib
|
||||
{
|
||||
@@ -37,8 +38,6 @@ namespace ProgramLib
|
||||
/// </summary>
|
||||
public partial class Program
|
||||
{
|
||||
// Declare all the instrument managers here
|
||||
private PowerSupplyMeasurementManager _psManager = null;
|
||||
private ProgramGuiManager _guiManager = null;
|
||||
|
||||
internal bool _isUutPwrOn = false;
|
||||
@@ -53,13 +52,48 @@ namespace ProgramLib
|
||||
{
|
||||
try
|
||||
{
|
||||
_psManager = new PowerSupplyMeasurementManager(_instrumentManager, _fileAndFolderManager.getFile(FileAndFolderManager.Files.POWER_SUPPLY_SELF_TEST_DATETIME));
|
||||
_psManager.Initialize();
|
||||
MalMeasurementLibManager.InitializePowerSupplyMeasurementManager();
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
_logger.Error(ex.Message + "\n" + ex.StackTrace);
|
||||
// DO NOT THROW in this block
|
||||
// this function will handle the error accordingly since we could be calling this from third-party test executive like TestStand
|
||||
TerminateTestOnMainThreadError(ex);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Initialize DIO measurement manager
|
||||
/// </summary>
|
||||
/// <param name=""></param>
|
||||
/// <returns></returns>
|
||||
public void InitializeDioMeasurementManager()
|
||||
{
|
||||
try
|
||||
{
|
||||
MalMeasurementLibManager.InitializeDioMeasurementManager(); ;
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
// DO NOT THROW in this block
|
||||
// this function will handle the error accordingly since we could be calling this from third-party test executive like TestStand
|
||||
TerminateTestOnMainThreadError(ex);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Initialize switch measurement manager
|
||||
/// </summary>
|
||||
/// <param name=""></param>
|
||||
/// <returns></returns>
|
||||
public void InitializeSwitchMeasurementManager()
|
||||
{
|
||||
try
|
||||
{
|
||||
MalMeasurementLibManager.InitializeSwitchMeasurementManager();
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
// DO NOT THROW in this block
|
||||
// this function will handle the error accordingly since we could be calling this from third-party test executive like TestStand
|
||||
TerminateTestOnMainThreadError(ex);
|
||||
@@ -80,8 +114,6 @@ namespace ProgramLib
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
_logger.Error(ex.Message + "\n" + ex.StackTrace);
|
||||
|
||||
// DO NOT THROW in this block
|
||||
// this function will handle the error accordingly since we could be calling this from third-party test executive like TestStand
|
||||
TerminateTestOnMainThreadError(ex);
|
||||
@@ -104,11 +136,11 @@ namespace ProgramLib
|
||||
_threadList.Add(new FailureMonitorThread());
|
||||
_threadList.Last().Start();
|
||||
|
||||
ICollection<object> psList = _instrumentManager.GetInstruments(typeof(PowerSupply));
|
||||
ICollection<object> powerSystemList = _instrumentManager.GetInstruments(typeof(IPowerSupplySystem));
|
||||
|
||||
foreach (PowerSupply ps in psList)
|
||||
foreach (IPowerSupplySystem powerSystem in powerSystemList)
|
||||
{
|
||||
_threadList.Add(new PowerSupplyReadThread(ps.Name));
|
||||
_threadList.Add(new PowerSupplyReadThread(powerSystem.Name));
|
||||
_threadList.Last().Start();
|
||||
}
|
||||
|
||||
@@ -121,33 +153,18 @@ namespace ProgramLib
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
_logger.Error(ex.Message + "\n" + ex.StackTrace);
|
||||
|
||||
// DO NOT THROW in this block
|
||||
// this function will handle the error accordingly since we could be calling this from third-party test executive like TestStand
|
||||
TerminateTestOnMainThreadError(ex);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Get power supply manager object
|
||||
/// </summary>
|
||||
/// <param name=""></param>
|
||||
/// <returns></returns>
|
||||
public PowerSupplyMeasurementManager GetPowerSupplyMeasurementManager()
|
||||
{
|
||||
if (_psManager == null)
|
||||
InitializePowerSupplyMeasurementManager();
|
||||
|
||||
return _psManager;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Get Gui manager object
|
||||
/// </summary>
|
||||
/// <param name=""></param>
|
||||
/// <returns></returns>
|
||||
public ProgramGuiManager GetGuiManager()
|
||||
internal ProgramGuiManager GetGuiManager()
|
||||
{
|
||||
if (_guiManager == null)
|
||||
InitializeGuiManager();
|
||||
|
||||
@@ -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)
|
||||
|
||||
@@ -1,73 +1,86 @@
|
||||
<Project Sdk="Microsoft.NET.Sdk">
|
||||
<Import Project="$(SolutionDir)Program.props" />
|
||||
<PropertyGroup>
|
||||
<TargetFramework>net472</TargetFramework>
|
||||
<OutputType>Library</OutputType>
|
||||
<AssemblyName>Program</AssemblyName>
|
||||
<UseWPF>true</UseWPF>
|
||||
<Description>Program DLL serves as starting test point</Description>
|
||||
<Company>Raytheon Technologies</Company>
|
||||
<Product>NGSRI Program</Product>
|
||||
<Authors>TEEC</Authors>
|
||||
<Copyright>Copyright © Raytheon Technologies $([System.DateTime]::get_now().ToString("yyyy"))</Copyright>
|
||||
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
|
||||
<GeneratePackageOnBuild>true</GeneratePackageOnBuild>
|
||||
<AllowedOutputExtensionsInPackageBuildOutputFolder>$(AllowedOutputExtensionsInPackageBuildOutputFolder);.pdb</AllowedOutputExtensionsInPackageBuildOutputFolder>
|
||||
|
||||
<!-- Dynamic Versioning (Suitable for Release) -->
|
||||
<!-- <Version>$(Version)$(Suffix)</Version> -->
|
||||
<Import Project="$(SolutionDir)Solution.props" />
|
||||
<PropertyGroup>
|
||||
<TargetFramework>net472</TargetFramework>
|
||||
<OutputType>Library</OutputType>
|
||||
<AssemblyName>Program</AssemblyName>
|
||||
<UseWPF>true</UseWPF>
|
||||
<Description>NGSRI Program</Description>
|
||||
<Product>NGSRI Program GUI</Product>
|
||||
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
|
||||
|
||||
<!-- Static Versioning (Suitable for Development) -->
|
||||
<Version>1.0.0</Version>
|
||||
<Configurations>Debug;Release;Deploy</Configurations>
|
||||
</PropertyGroup>
|
||||
<!-- Static versioning (Suitable for Development) -->
|
||||
<!-- Disable the line below for dynamic versioning -->
|
||||
<Version>1.0.0</Version>
|
||||
<ApplicationIcon>Resources\Icons\app.ico</ApplicationIcon>
|
||||
<LangVersion>10.0</LangVersion>
|
||||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<PackageReference Include="Raytheon.Configuration" Version="*" />
|
||||
<PackageReference Include="Raytheon.Configuration.Contracts" Version="*" />
|
||||
<ItemGroup>
|
||||
<PackageReference Include="NLog" Version="5.0.0" />
|
||||
<PackageReference Include="Raytheon.Instruments.InstrumentManager.GeneralInstrumentManager" Version="1.4.1" />
|
||||
<!--
|
||||
<PackageReference Include="NGSRI" Version="1.0.0" />
|
||||
-->
|
||||
</ItemGroup>
|
||||
<PackageReference Include="CommunityToolkit.Mvvm" Version="8.3.2" />
|
||||
<PackageReference Include="Raytheon.Instruments.InstrumentManager.GeneralInstrumentManager" Version="1.5.0" />
|
||||
<PackageReference Include="Raytheon.Common" Version="1.0.0" />
|
||||
<PackageReference Include="Raytheon.Instruments.Implementation" Version="1.0.0" />
|
||||
<PackageReference Include="Raytheon.MAL" Version="1.0.0" />
|
||||
</ItemGroup>
|
||||
|
||||
<!-- Copy pdb files for DLLs in nuget packages to output directory-->
|
||||
<Target Name="IncludeSymbolFiles" AfterTargets="ResolveAssemblyReferences" Condition="@(ReferenceCopyLocalPaths) != ''">
|
||||
<ItemGroup>
|
||||
<ReferenceCopyLocalPaths Include="%(ReferenceCopyLocalPaths.RelativeDir)%(ReferenceCopyLocalPaths.Filename).pdb" />
|
||||
<ReferenceCopyLocalPaths Remove="@(ReferenceCopyLocalPaths)" Condition="!Exists('%(FullPath)')" />
|
||||
</ItemGroup>
|
||||
</Target>
|
||||
<ItemGroup>
|
||||
<ProjectReference Include="..\Instruments\PowerSupplies\Keysight67XX\KeysightN67XX.csproj" />
|
||||
<ProjectReference Include="..\MeasurementManagers\PowerSupplyMeasurementManager\PowerSupplyMeasurementManager.csproj" />
|
||||
<ProjectReference Include="..\ProgramGUI\ProgramGui.csproj" />
|
||||
<ProjectReference Include="..\Raytheon.Common\Raytheon.Common.csproj" />
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<ItemGroup>
|
||||
<Reference Include="NationalInstruments.TestStand.Interop.API">
|
||||
<HintPath>..\ProgramLib\Dependencies\NationalInstruments.TestStand.Interop.API.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="System.Windows" />
|
||||
</ItemGroup>
|
||||
<Reference Include="System.Windows" />
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<Resource Include="Resources\Icons\app.ico" />
|
||||
<Resource Include="Resources\Images\black-led.png" />
|
||||
<Resource Include="Resources\Images\green-check-mark.png" />
|
||||
<Resource Include="Resources\Images\green-led.png" />
|
||||
<Resource Include="Resources\Images\missile.png" />
|
||||
<Resource Include="Resources\Images\red-cross-mark.png" />
|
||||
<Resource Include="Resources\Images\red-led.png" />
|
||||
<Resource Include="Resources\Images\Title_Bar_Buttons\close_black.png" />
|
||||
<Resource Include="Resources\Images\Title_Bar_Buttons\close_white.png" />
|
||||
<Resource Include="Resources\Images\Title_Bar_Buttons\maximize.png" />
|
||||
<Resource Include="Resources\Images\Title_Bar_Buttons\minimize.png" />
|
||||
<Resource Include="Resources\Images\Title_Bar_Buttons\restore.png" />
|
||||
<Resource Include="Resources\Images\yellow-led.png" />
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<Compile Update="Properties\Settings.Designer.cs">
|
||||
<DesignTimeSharedInput>True</DesignTimeSharedInput>
|
||||
<AutoGen>True</AutoGen>
|
||||
<DependentUpon>Settings.settings</DependentUpon>
|
||||
</Compile>
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<None Update="Properties\Settings.settings">
|
||||
<Generator>SettingsSingleFileGenerator</Generator>
|
||||
<LastGenOutput>Settings.Designer.cs</LastGenOutput>
|
||||
</None>
|
||||
</ItemGroup>
|
||||
|
||||
<Target Name="CopyFiles" AfterTargets="AfterBuild">
|
||||
<ItemGroup>
|
||||
<FILES_1 Include="Dependencies\*.*" />
|
||||
<FILES_2 Include="InstrumentConfigFile\*.*" />
|
||||
<FILES_3 Include="Dependencies\RINSS\*.*" />
|
||||
<FILES_2 Include="InstrumentConfigFiles\*.*" />
|
||||
<FILES_3 Include="TestMethodConfigFiles\*.*" />
|
||||
<FILES_4 Include="Dependencies\RINSS\*.*" />
|
||||
</ItemGroup>
|
||||
<Copy SourceFiles="@(FILES_1)" DestinationFolder="$(OutDir)" />
|
||||
<Copy SourceFiles="@(FILES_2)" DestinationFolder="$(OutDir)InstrumentConfig" />
|
||||
<Copy SourceFiles="@(FILES_3)" DestinationFolder="$(OutDir)RINSS" />
|
||||
<Copy SourceFiles="ProgramConfigFile\config.ini" DestinationFolder="$(OutDir)" />
|
||||
<Copy SourceFiles="MiscConfigFile\NLog.config" DestinationFolder="$(OutDir)" />
|
||||
<Copy SourceFiles="@(FILES_3)" DestinationFolder="$(OutDir)TestMethodConfig" />
|
||||
<Copy SourceFiles="@(FILES_4)" DestinationFolder="$(OutDir)RINSS" />
|
||||
<Copy SourceFiles="ProgramConfigFiles\config.ini" DestinationFolder="$(OutDir)" />
|
||||
<Copy SourceFiles="MiscConfigFiles\NLog.config" DestinationFolder="$(OutDir)" />
|
||||
</Target>
|
||||
|
||||
<Target Name="ProjClean" AfterTargets="AfterClean">
|
||||
<RemoveDir Directories="$(OutDir)InstrumentConfig" />
|
||||
<RemoveDir Directories="$(OutDir)TestMethodConfig" />
|
||||
<RemoveDir Directories="$(OutDir)RINSS" />
|
||||
<Delete Files="$(OutDir)config.ini" />
|
||||
<Delete Files="$(OutDir)NLog.config" />
|
||||
|
||||
63
Source/Program/Properties/Resources.Designer.cs
generated
Normal file
@@ -0,0 +1,63 @@
|
||||
//------------------------------------------------------------------------------
|
||||
// <auto-generated>
|
||||
// This code was generated by a tool.
|
||||
// Runtime Version:4.0.30319.42000
|
||||
//
|
||||
// Changes to this file may cause incorrect behavior and will be lost if
|
||||
// the code is regenerated.
|
||||
// </auto-generated>
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
namespace ProgramLib.Properties {
|
||||
using System;
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// A strongly-typed resource class, for looking up localized strings, etc.
|
||||
/// </summary>
|
||||
// This class was auto-generated by the StronglyTypedResourceBuilder
|
||||
// class via a tool like ResGen or Visual Studio.
|
||||
// To add or remove a member, edit your .ResX file then rerun ResGen
|
||||
// with the /str option, or rebuild your VS project.
|
||||
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "17.0.0.0")]
|
||||
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
|
||||
[global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
|
||||
internal class Resources {
|
||||
|
||||
private static global::System.Resources.ResourceManager resourceMan;
|
||||
|
||||
private static global::System.Globalization.CultureInfo resourceCulture;
|
||||
|
||||
[global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")]
|
||||
internal Resources() {
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Returns the cached ResourceManager instance used by this class.
|
||||
/// </summary>
|
||||
[global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
|
||||
internal static global::System.Resources.ResourceManager ResourceManager {
|
||||
get {
|
||||
if (object.ReferenceEquals(resourceMan, null)) {
|
||||
global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("DataGrid.Properties.Resources", typeof(Resources).Assembly);
|
||||
resourceMan = temp;
|
||||
}
|
||||
return resourceMan;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Overrides the current thread's CurrentUICulture property for all
|
||||
/// resource lookups using this strongly typed resource class.
|
||||
/// </summary>
|
||||
[global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
|
||||
internal static global::System.Globalization.CultureInfo Culture {
|
||||
get {
|
||||
return resourceCulture;
|
||||
}
|
||||
set {
|
||||
resourceCulture = value;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
117
Source/Program/Properties/Resources.resx
Normal file
@@ -0,0 +1,117 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<root>
|
||||
<!--
|
||||
Microsoft ResX Schema
|
||||
|
||||
Version 2.0
|
||||
|
||||
The primary goals of this format is to allow a simple XML format
|
||||
that is mostly human readable. The generation and parsing of the
|
||||
various data types are done through the TypeConverter classes
|
||||
associated with the data types.
|
||||
|
||||
Example:
|
||||
|
||||
... ado.net/XML headers & schema ...
|
||||
<resheader name="resmimetype">text/microsoft-resx</resheader>
|
||||
<resheader name="version">2.0</resheader>
|
||||
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
|
||||
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
|
||||
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
|
||||
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
|
||||
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
|
||||
<value>[base64 mime encoded serialized .NET Framework object]</value>
|
||||
</data>
|
||||
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
|
||||
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
|
||||
<comment>This is a comment</comment>
|
||||
</data>
|
||||
|
||||
There are any number of "resheader" rows that contain simple
|
||||
name/value pairs.
|
||||
|
||||
Each data row contains a name, and value. The row also contains a
|
||||
type or mimetype. Type corresponds to a .NET class that support
|
||||
text/value conversion through the TypeConverter architecture.
|
||||
Classes that don't support this are serialized and stored with the
|
||||
mimetype set.
|
||||
|
||||
The mimetype is used for serialized objects, and tells the
|
||||
ResXResourceReader how to depersist the object. This is currently not
|
||||
extensible. For a given mimetype the value must be set accordingly:
|
||||
|
||||
Note - application/x-microsoft.net.object.binary.base64 is the format
|
||||
that the ResXResourceWriter will generate, however the reader can
|
||||
read any of the formats listed below.
|
||||
|
||||
mimetype: application/x-microsoft.net.object.binary.base64
|
||||
value : The object must be serialized with
|
||||
: System.Serialization.Formatters.Binary.BinaryFormatter
|
||||
: and then encoded with base64 encoding.
|
||||
|
||||
mimetype: application/x-microsoft.net.object.soap.base64
|
||||
value : The object must be serialized with
|
||||
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
|
||||
: and then encoded with base64 encoding.
|
||||
|
||||
mimetype: application/x-microsoft.net.object.bytearray.base64
|
||||
value : The object must be serialized into a byte array
|
||||
: using a System.ComponentModel.TypeConverter
|
||||
: and then encoded with base64 encoding.
|
||||
-->
|
||||
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
|
||||
<xsd:element name="root" msdata:IsDataSet="true">
|
||||
<xsd:complexType>
|
||||
<xsd:choice maxOccurs="unbounded">
|
||||
<xsd:element name="metadata">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" type="xsd:string" />
|
||||
<xsd:attribute name="type" type="xsd:string" />
|
||||
<xsd:attribute name="mimetype" type="xsd:string" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="assembly">
|
||||
<xsd:complexType>
|
||||
<xsd:attribute name="alias" type="xsd:string" />
|
||||
<xsd:attribute name="name" type="xsd:string" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="data">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
|
||||
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" type="xsd:string" msdata:Ordinal="1" />
|
||||
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
|
||||
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="resheader">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" type="xsd:string" use="required" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
</xsd:choice>
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
</xsd:schema>
|
||||
<resheader name="resmimetype">
|
||||
<value>text/microsoft-resx</value>
|
||||
</resheader>
|
||||
<resheader name="version">
|
||||
<value>2.0</value>
|
||||
</resheader>
|
||||
<resheader name="reader">
|
||||
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
</resheader>
|
||||
<resheader name="writer">
|
||||
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
</resheader>
|
||||
</root>
|
||||
26
Source/Program/Properties/Settings.Designer.cs
generated
Normal file
@@ -0,0 +1,26 @@
|
||||
//------------------------------------------------------------------------------
|
||||
// <auto-generated>
|
||||
// This code was generated by a tool.
|
||||
// Runtime Version:4.0.30319.42000
|
||||
//
|
||||
// Changes to this file may cause incorrect behavior and will be lost if
|
||||
// the code is regenerated.
|
||||
// </auto-generated>
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
namespace Program.Properties {
|
||||
|
||||
|
||||
[global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
|
||||
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "17.8.0.0")]
|
||||
internal sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase {
|
||||
|
||||
private static Settings defaultInstance = ((Settings)(global::System.Configuration.ApplicationSettingsBase.Synchronized(new Settings())));
|
||||
|
||||
public static Settings Default {
|
||||
get {
|
||||
return defaultInstance;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
7
Source/Program/Properties/Settings.settings
Normal file
@@ -0,0 +1,7 @@
|
||||
<?xml version='1.0' encoding='utf-8'?>
|
||||
<SettingsFile xmlns="uri:settings" CurrentProfile="(Default)">
|
||||
<Profiles>
|
||||
<Profile Name="(Default)" />
|
||||
</Profiles>
|
||||
<Settings />
|
||||
</SettingsFile>
|
||||
BIN
Source/Program/Resources/Icons/app.ico
Normal file
|
After Width: | Height: | Size: 155 KiB |
|
After Width: | Height: | Size: 371 B |
|
After Width: | Height: | Size: 1.9 KiB |
BIN
Source/Program/Resources/Images/Title_Bar_Buttons/maximize.png
Normal file
|
After Width: | Height: | Size: 125 B |
BIN
Source/Program/Resources/Images/Title_Bar_Buttons/minimize.png
Normal file
|
After Width: | Height: | Size: 100 B |
BIN
Source/Program/Resources/Images/Title_Bar_Buttons/restore.png
Normal file
|
After Width: | Height: | Size: 176 B |
BIN
Source/Program/Resources/Images/black-led.png
Normal file
|
After Width: | Height: | Size: 9.6 KiB |
BIN
Source/Program/Resources/Images/green-check-mark.png
Normal file
|
After Width: | Height: | Size: 934 B |
BIN
Source/Program/Resources/Images/green-led.png
Normal file
|
After Width: | Height: | Size: 90 KiB |
BIN
Source/Program/Resources/Images/missile.png
Normal file
|
After Width: | Height: | Size: 53 KiB |
BIN
Source/Program/Resources/Images/red-cross-mark.png
Normal file
|
After Width: | Height: | Size: 1.1 KiB |
BIN
Source/Program/Resources/Images/red-led.png
Normal file
|
After Width: | Height: | Size: 4.0 KiB |
BIN
Source/Program/Resources/Images/yellow-led.png
Normal file
|
After Width: | Height: | Size: 4.0 KiB |
@@ -0,0 +1,73 @@
|
||||
[GMA_ATP_001_UUT_STTO]
|
||||
PLACEHOLDER = PLACEHOLDER
|
||||
|
||||
;format is name = range|resolution|delay(ms)|scale factor|relays|type|cable and pin id|lower_limit|upper_limit
|
||||
;Type is TWO or FOUR for two wire and four wire measurements
|
||||
;Relay Format: [Card_Name]-[Relay_Channel#],[Card_Name]-[Relay_Channel#]-[Relay_Channel#]
|
||||
; [Card_Name] - must match the name of the switch card defined in the Instrument.xml
|
||||
;Cable and Pin Id Format: [Cable_Id]_[Pin_Id]_[Cable_Id]_[Pin_Id]
|
||||
[GMA_ATP_001_UUT_STTO.DMM_RESISTANCE_MEASUREMENTS]
|
||||
R1 = PCODE1|-1|0.001|100|1|PICKERING_SWITCH_1-56,PICKERING_SWITCH_1-57|TWO|J1_P1_J1_P2|1.0|2.0
|
||||
R2 = PCODE2|-1|0.001|100|1|PICKERING_SWITCH_1-58,PICKERING_SWITCH_1-59|TWO|J1_P3_J1_P4|1.0|2.0
|
||||
|
||||
; a list of relays that the software will reject if commanded..
|
||||
; cannot be empty, put "NONE" if there are no exclusions
|
||||
[GMA_ATP_001_UUT_STTO.RELAY_EXCLUSION_LIST]
|
||||
EXCLUSION_LIST = NONE
|
||||
|
||||
;=====================================================================================================================
|
||||
|
||||
[GMA_ATP_002_UUT_CI]
|
||||
PLACEHOLDER = PLACEHOLDER
|
||||
|
||||
;format is name = range|resolution|delay(ms)|scale factor|relays|type|cable and pin id|lower_limit|upper_limit
|
||||
;Type is TWO or FOUR for two wire and four wire measurements
|
||||
;Relay Format: [Card_Name]-[Relay_Channel#],[Card_Name]-[Relay_Channel#]-[Relay_Channel#]
|
||||
; [Card_Name] - must match the name of the switch card defined in the Instrument.xml
|
||||
;Cable and Pin Id Format: [Cable_Id]_[Pin_Id]_[Cable_Id]_[Pin_Id]
|
||||
[GMA_ATP_002_UUT_CI.DMM_RESISTANCE_MEASUREMENTS]
|
||||
R1 = PCODE1|-1|0.001|100|1|PICKERING_SWITCH_1-56,PICKERING_SWITCH_1-57|TWO|J1_P1_J1_P2|1.0|2.0
|
||||
R2 = PCODE2|-1|0.001|100|1|PICKERING_SWITCH_1-58,PICKERING_SWITCH_1-59|TWO|J1_P3_J1_P4|1.0|2.0
|
||||
|
||||
; a list of relays that the software will reject if commanded..
|
||||
; cannot be empty, put "NONE" if there are no exclusions
|
||||
[GMA_ATP_002_UUT_CI.RELAY_EXCLUSION_LIST]
|
||||
EXCLUSION_LIST = NONE
|
||||
|
||||
;=====================================================================================================================
|
||||
|
||||
[AUR_ATP_001_UUT_STTO]
|
||||
PLACEHOLDER = PLACEHOLDER
|
||||
|
||||
;format is name = range|resolution|delay(ms)|scale factor|relays|type|cable and pin id|lower_limit|upper_limit
|
||||
;Type is TWO or FOUR for two wire and four wire measurements
|
||||
;Relay Format: [Card_Name]-[Relay_Channel#],[Card_Name]-[Relay_Channel#]-[Relay_Channel#]
|
||||
; [Card_Name] - must match the name of the switch card defined in the Instrument.xml
|
||||
;Cable and Pin Id Format: [Cable_Id]_[Pin_Id]_[Cable_Id]_[Pin_Id]
|
||||
[AUR_ATP_001_UUT_STTO.DMM_RESISTANCE_MEASUREMENTS]
|
||||
R1 = PCODE1|-1|0.001|100|1|PICKERING_SWITCH_1:-56,PICKERING_SWITCH_1-57|TWO|J1_P1_J1_P2|1.0|2.0
|
||||
R2 = PCODE2|-1|0.001|100|1|PICKERING_SWITCH_1-58,PICKERING_SWITCH_1-59|TWO|J1_P3_J1_P4|1.0|2.0
|
||||
|
||||
; a list of relays that the software will reject if commanded..
|
||||
; cannot be empty, put "NONE" if there are no exclusions
|
||||
[AUR_ATP_001_UUT_STTO.RELAY_EXCLUSION_LIST]
|
||||
EXCLUSION_LIST = NONE
|
||||
|
||||
;=====================================================================================================================
|
||||
|
||||
[AUR_ATP_002_UUT_CI]
|
||||
PLACEHOLDER = PLACEHOLDER
|
||||
|
||||
;format is name = range|resolution|delay(ms)|scale factor|relays|type|cable and pin id|lower_limit|upper_limit
|
||||
;Type is TWO or FOUR for two wire and four wire measurements
|
||||
;Relay Format: [Card_Name]-[Relay_Channel#],[Card_Name]-[Relay_Channel#]-[Relay_Channel#]
|
||||
; [Card_Name] - must match the name of the switch card defined in the Instrument.xml
|
||||
;Cable and Pin Id Format: [Cable_Id]_[Pin_Id]_[Cable_Id]_[Pin_Id]
|
||||
[AUR_ATP_002_UUT_CI.DMM_RESISTANCE_MEASUREMENTS]
|
||||
R1 = PCODE1|-1|0.001|100|1|PICKERING_SWITCH_1:-56,PICKERING_SWITCH_1-57|TWO|J1_P1_J1_P2|1.0|2.0
|
||||
R2 = PCODE2|-1|0.001|100|1|PICKERING_SWITCH_1-58,PICKERING_SWITCH_1-59|TWO|J1_P3_J1_P4|1.0|2.0
|
||||
|
||||
; a list of relays that the software will reject if commanded..
|
||||
; cannot be empty, put "NONE" if there are no exclusions
|
||||
[AUR_ATP_002_UUT_CI.RELAY_EXCLUSION_LIST]
|
||||
EXCLUSION_LIST = NONE
|
||||
@@ -16,15 +16,9 @@ GOVERNMENT.
|
||||
UNPUBLISHED WORK - COPYRIGHT RAYTHEON COMPANY.
|
||||
-------------------------------------------------------------------------*/
|
||||
using NLog;
|
||||
using ProgramGui.Model;
|
||||
using ProgramGui;
|
||||
using ProgramLib;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace ProgramLib
|
||||
{
|
||||
|
||||
@@ -16,16 +16,12 @@ GOVERNMENT.
|
||||
UNPUBLISHED WORK - COPYRIGHT RAYTHEON COMPANY.
|
||||
-------------------------------------------------------------------------*/
|
||||
using NLog;
|
||||
using ProgramGui;
|
||||
using ProgramGui.Model;
|
||||
using ProgramGui.ViewModel;
|
||||
using ProgramLib;
|
||||
using ProgramLib.GUI.Model;
|
||||
using ProgramLib.GUI.View;
|
||||
using ProgramLib.GUI.ViewModel;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace ProgramLib
|
||||
{
|
||||
@@ -46,7 +42,7 @@ namespace ProgramLib
|
||||
}
|
||||
|
||||
private ILogger _logger;
|
||||
private MainWindow _mainWindow;
|
||||
private LiveDataWindow _liveDataWindow;
|
||||
private PassthroughData _passthroughData = null;
|
||||
|
||||
/// <summary>
|
||||
@@ -56,13 +52,13 @@ namespace ProgramLib
|
||||
{
|
||||
_logger = LogManager.GetCurrentClassLogger();
|
||||
|
||||
_mainWindow = (MainWindow)ProgramLib.Program.Instance().GetGuiManager()[ProgramGuiManager.WINDOWS.MAIN];
|
||||
_liveDataWindow = (LiveDataWindow)ProgramLib.Program.Instance().GetGuiManager()[ProgramGuiManager.WINDOWS.LIVE_DATA];
|
||||
|
||||
_passthroughData = new PassthroughData(_mainWindow.datagridPassthroughData.Columns.Count);
|
||||
_passthroughData = new PassthroughData(_liveDataWindow.datagridPassthroughData.Columns.Count);
|
||||
|
||||
ProgramLib.Program.Instance().GetGuiManager()[ProgramGuiManager.WINDOWS.MAIN].Dispatcher.Invoke((Action)delegate
|
||||
ProgramLib.Program.Instance().GetGuiManager()[ProgramGuiManager.WINDOWS.LIVE_DATA].Dispatcher.Invoke((Action)delegate
|
||||
{
|
||||
_mainWindow._mainWindowViewModel.AddPassthroughData(_passthroughData.GetPassthroughDataModelDict());
|
||||
_liveDataWindow.LiveDataWindowViewModel.AddPassthroughData(_passthroughData.GetPassthroughDataModelDict());
|
||||
});
|
||||
}
|
||||
|
||||
@@ -137,7 +133,7 @@ namespace ProgramLib
|
||||
if (id == Events.EVENT_TIMED_OUT)
|
||||
{
|
||||
rnd = new Random();
|
||||
_mainWindow._mainWindowViewModel.UutPowerLedImagePath = _mainWindow._mainWindowViewModel._imageToResourcePathDict[MainWindowViewModel.Images.LED_OFF];
|
||||
_liveDataWindow.LiveDataWindowViewModel.UutPowerLedImagePath = _liveDataWindow.LiveDataWindowViewModel.ImageToResourcePathDict[LiveDataWindowViewModel.Images.LED_OFF];
|
||||
|
||||
float num = 70.0f + GenerateRandomFraction();
|
||||
_passthroughData.SetValue(PassthroughData.Variables.VAR1, num.ToString("0.00"));
|
||||
@@ -152,7 +148,7 @@ namespace ProgramLib
|
||||
num = 50.0f + GenerateRandomFraction();
|
||||
_passthroughData.SetValue(PassthroughData.Variables.VAR4, num.ToString("0.00"));
|
||||
Thread.Sleep(100);
|
||||
_mainWindow._mainWindowViewModel.UutPowerLedImagePath = _mainWindow._mainWindowViewModel._imageToResourcePathDict[MainWindowViewModel.Images.LED_ON];
|
||||
_liveDataWindow.LiveDataWindowViewModel.UutPowerLedImagePath = _liveDataWindow.LiveDataWindowViewModel.ImageToResourcePathDict[LiveDataWindowViewModel.Images.LED_ON];
|
||||
num = 60.0f + GenerateRandomFraction();
|
||||
_passthroughData.SetValue(PassthroughData.Variables.VAR5, num.ToString("0.00"));
|
||||
Thread.Sleep(200);
|
||||
|
||||
@@ -20,6 +20,7 @@ using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using System.Threading;
|
||||
using NLog;
|
||||
using Raytheon.Instruments.PowerSupply;
|
||||
|
||||
namespace ProgramLib
|
||||
{
|
||||
@@ -44,7 +45,8 @@ namespace ProgramLib
|
||||
private string _powerSupplySystemName;
|
||||
|
||||
private List<string> _powerModuleNameList;
|
||||
Dictionary<string, Raytheon.Instruments.PowerSupplies.PowerSupplyModuleInfo> _powerSupplyModuleInfoDict;
|
||||
|
||||
Dictionary<string, PowerSupplyModuleInfo> _powerSupplyModuleInfoDict;
|
||||
|
||||
/// <summary>
|
||||
/// Constructor
|
||||
@@ -80,8 +82,8 @@ namespace ProgramLib
|
||||
|
||||
EventGroup<Events, EventWaitHandle> eventGroup = new EventGroup<Events, EventWaitHandle>(eventDict);
|
||||
|
||||
_powerModuleNameList = Program.Instance().GetPowerSupplyMeasurementManager()[_powerSupplySystemName].GetModuleNames();
|
||||
_powerSupplyModuleInfoDict = Program.Instance().GetPowerSupplyMeasurementManager()[_powerSupplySystemName].GetPowerSupplyModuleInfoDict();
|
||||
_powerModuleNameList = Program.Instance().MalMeasurementLibManager.PowerSupplyMeasurementManager.GetPowerSupplyList(_powerSupplySystemName);
|
||||
_powerSupplyModuleInfoDict = Program.Instance().MalMeasurementLibManager.PowerSupplyMeasurementManager.GetPowerSupplyModuleInfoDict(_powerSupplySystemName);
|
||||
|
||||
while (true)
|
||||
{
|
||||
@@ -123,12 +125,6 @@ namespace ProgramLib
|
||||
|
||||
EventGroup<Events, EventWaitHandle> eventGroup = new EventGroup<Events, EventWaitHandle>(eventDict);
|
||||
|
||||
double voltage;
|
||||
double current;
|
||||
double voltageSetPoint;
|
||||
bool isOn;
|
||||
int faultStatus;
|
||||
|
||||
while (true)
|
||||
{
|
||||
Events id = eventGroup.WaitAny(pollRateMs);
|
||||
@@ -137,22 +133,16 @@ namespace ProgramLib
|
||||
{
|
||||
foreach (string moduleName in _powerModuleNameList)
|
||||
{
|
||||
Program.Instance().GetPowerSupplyMeasurementManager()[_powerSupplySystemName].ReadPowerSupplyData(moduleName, out voltage, out current, out voltageSetPoint, out isOn, out faultStatus);
|
||||
PowerData data = Program.Instance().MalMeasurementLibManager.PowerSupplyMeasurementManager.ReadPowerData(moduleName);
|
||||
|
||||
BitArray statusReg = new BitArray(new int[] { faultStatus });
|
||||
BitArray statusReg = new BitArray(new int[] { data.FaultStatus });
|
||||
|
||||
bool ovpTriggeredInPowerSupply = statusReg[0];
|
||||
bool ocpTriggeredInPowerSupply = statusReg[1];
|
||||
|
||||
if (!ovpTriggeredInPowerSupply && !ocpTriggeredInPowerSupply)
|
||||
{
|
||||
if (IsCurrentWithinLimits(moduleName, current))
|
||||
break;
|
||||
|
||||
if (IsVoltageWithinLimits(moduleName, voltage))
|
||||
break;
|
||||
|
||||
Program.Instance()._powerSupplySharedData.SetData(moduleName, voltage, current, _powerSupplyModuleInfoDict[moduleName]);
|
||||
Program.Instance()._powerSupplySharedData.SetData(moduleName, data.Voltage, data.Current, _powerSupplyModuleInfoDict[moduleName]);
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -193,14 +183,16 @@ namespace ProgramLib
|
||||
private bool IsCurrentWithinLimits(string moduleName, double current)
|
||||
{
|
||||
bool outOfLimits = false;
|
||||
Raytheon.Instruments.PowerSupplies.PowerSupplyModuleInfo powerSupplyModuleInfo = _powerSupplyModuleInfoDict[moduleName];
|
||||
|
||||
if ((current < powerSupplyModuleInfo.currentLowerLimit_ || current > powerSupplyModuleInfo.currentUpperLimit_) && powerSupplyModuleInfo.isOn_)
|
||||
{
|
||||
outOfLimits = true;
|
||||
string errorMsg = moduleName + "'s current is out of limits (" + powerSupplyModuleInfo.currentLowerLimit_.ToString("0.00") + "," + powerSupplyModuleInfo.currentUpperLimit_.ToString("0.00") + "). Current reading: " + current.ToString("0.00");
|
||||
HandleOutOfToleranceCondition(errorMsg);
|
||||
}
|
||||
// Duc - is this function needed?
|
||||
//Raytheon.Instruments.PowerSupplies.PowerSupplyModuleInfo powerSupplyModuleInfo = _powerSupplyModuleInfoDict[moduleName];
|
||||
|
||||
//if ((current < powerSupplyModuleInfo.currentLowerLimit_ || current > powerSupplyModuleInfo.currentUpperLimit_) && powerSupplyModuleInfo.isOn_)
|
||||
//{
|
||||
// outOfLimits = true;
|
||||
// string errorMsg = moduleName + "'s current is out of limits (" + powerSupplyModuleInfo.currentLowerLimit_.ToString("0.00") + "," + powerSupplyModuleInfo.currentUpperLimit_.ToString("0.00") + "). Current reading: " + current.ToString("0.00");
|
||||
// HandleOutOfToleranceCondition(errorMsg);
|
||||
//}
|
||||
|
||||
return outOfLimits;
|
||||
}
|
||||
@@ -213,14 +205,15 @@ namespace ProgramLib
|
||||
private bool IsVoltageWithinLimits(string moduleName, double voltage)
|
||||
{
|
||||
bool outOfLimits = false;
|
||||
Raytheon.Instruments.PowerSupplies.PowerSupplyModuleInfo powerSupplyModuleInfo = _powerSupplyModuleInfoDict[moduleName];
|
||||
// Duc - is this function needed?
|
||||
//Raytheon.Instruments.PowerSupplies.PowerSupplyModuleInfo powerSupplyModuleInfo = _powerSupplyModuleInfoDict[moduleName];
|
||||
|
||||
if ((voltage < powerSupplyModuleInfo.voltageLowerLimit_ || voltage > powerSupplyModuleInfo.voltageUpperLimit_) && powerSupplyModuleInfo.isOn_)
|
||||
{
|
||||
outOfLimits = true;
|
||||
string errorMsg = moduleName + "'s voltage is out of limits (" + powerSupplyModuleInfo.voltageLowerLimit_.ToString("0.00") + "," + powerSupplyModuleInfo.voltageUpperLimit_.ToString("0.00") + "). Voltage reading: " + voltage.ToString("0.00");
|
||||
HandleOutOfToleranceCondition(errorMsg);
|
||||
}
|
||||
//if ((voltage < powerSupplyModuleInfo.voltageLowerLimit_ || voltage > powerSupplyModuleInfo.voltageUpperLimit_) && powerSupplyModuleInfo.isOn_)
|
||||
//{
|
||||
// outOfLimits = true;
|
||||
// string errorMsg = moduleName + "'s voltage is out of limits (" + powerSupplyModuleInfo.voltageLowerLimit_.ToString("0.00") + "," + powerSupplyModuleInfo.voltageUpperLimit_.ToString("0.00") + "). Voltage reading: " + voltage.ToString("0.00");
|
||||
// HandleOutOfToleranceCondition(errorMsg);
|
||||
//}
|
||||
|
||||
return outOfLimits;
|
||||
}
|
||||
|
||||
@@ -16,16 +16,11 @@ GOVERNMENT.
|
||||
UNPUBLISHED WORK - COPYRIGHT RAYTHEON COMPANY.
|
||||
-------------------------------------------------------------------------*/
|
||||
using NLog;
|
||||
using ProgramGui;
|
||||
using ProgramGui.Model;
|
||||
using ProgramGui.ViewModel;
|
||||
using ProgramLib;
|
||||
using ProgramLib.GUI.Model;
|
||||
using ProgramLib.GUI.View;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace ProgramLib
|
||||
{
|
||||
@@ -46,7 +41,7 @@ namespace ProgramLib
|
||||
}
|
||||
|
||||
private ILogger _logger;
|
||||
private MainWindow _mainWindow;
|
||||
private LiveDataWindow _mainWindow;
|
||||
|
||||
private Dictionary<string, PowerModuleDataModel> _powerModuleToPowerDataModelDict = new Dictionary<string, PowerModuleDataModel>();
|
||||
|
||||
@@ -57,14 +52,14 @@ namespace ProgramLib
|
||||
{
|
||||
_logger = LogManager.GetCurrentClassLogger();
|
||||
|
||||
_mainWindow = (MainWindow)ProgramLib.Program.Instance().GetGuiManager()[ProgramGuiManager.WINDOWS.MAIN];
|
||||
_mainWindow = (LiveDataWindow)ProgramLib.Program.Instance().GetGuiManager()[ProgramGuiManager.WINDOWS.LIVE_DATA];
|
||||
|
||||
_powerModuleToPowerDataModelDict["UUT_P20V"] = new PowerModuleDataModel();
|
||||
_powerModuleToPowerDataModelDict["UUT_N20V"] = new PowerModuleDataModel();
|
||||
|
||||
ProgramLib.Program.Instance().GetGuiManager()[ProgramGuiManager.WINDOWS.MAIN].Dispatcher.Invoke((Action)delegate
|
||||
ProgramLib.Program.Instance().GetGuiManager()[ProgramGuiManager.WINDOWS.LIVE_DATA].Dispatcher.Invoke((Action)delegate
|
||||
{
|
||||
_mainWindow._mainWindowViewModel.AddPowerData(_powerModuleToPowerDataModelDict);
|
||||
_mainWindow.LiveDataWindowViewModel.AddPowerData(_powerModuleToPowerDataModelDict);
|
||||
});
|
||||
}
|
||||
|
||||
@@ -137,7 +132,7 @@ namespace ProgramLib
|
||||
|
||||
if (id == Events.EVENT_TIMED_OUT)
|
||||
{
|
||||
PowerSupplyData data = Program.Instance()._powerSupplySharedData.GetData(PowerSupplyConstants.POWER_DEVICE.STE_PVM_5V.ToString());
|
||||
PowerSupplyData data = Program.Instance()._powerSupplySharedData.GetData("STE_PVM_5V");
|
||||
|
||||
if (data != null && data._initialized)
|
||||
{
|
||||
|
||||