Initial check-in

This commit is contained in:
Duc
2025-01-03 09:50:39 -07:00
parent 45596e360d
commit 1d8f6e4c96
143 changed files with 9835 additions and 0 deletions

View File

@@ -0,0 +1,13 @@
using CommunityToolkit.Mvvm.ComponentModel;
namespace ProgramGui.Model
{
public partial class ImpedanceDataModel : ObservableObject
{
[ObservableProperty]
private string passFailImagePath;
[ObservableProperty]
private string description;
}
}

View File

@@ -0,0 +1,76 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace ProgramGui.Model
{
public 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" },
};
}
}

View 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 ProgramGui.Model
{
public 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;
}
}
}

View File

@@ -0,0 +1,17 @@
using CommunityToolkit.Mvvm.ComponentModel;
namespace ProgramGui.Model
{
public partial class PowerModuleDataModel : ObservableObject
{
[ObservableProperty]
private string expectedVoltage;
[ObservableProperty]
private string actualVoltage;
[ObservableProperty]
private string expectedCurrent;
[ObservableProperty]
private string actualCurrent;
}
}