Monitor power supply data for fault conditions

This commit is contained in:
Duc
2025-01-04 18:41:54 -07:00
parent 7e2a821337
commit b38765789d
14 changed files with 242 additions and 70 deletions

View File

@@ -29,6 +29,9 @@ using System.Threading.Tasks;
namespace ProgramLib
{
/// <summary>
/// Class to spawn thread to update power supply data on GUI
/// </summary>
internal class PowerSupplyGuiUpdateThread : BasicThread
{
private enum Events
@@ -47,6 +50,9 @@ namespace ProgramLib
private Dictionary<string, PowerModuleDataModel> _powerModuleToPowerDataModelDict = new Dictionary<string, PowerModuleDataModel>();
/// <summary>
/// Constructor
/// </summary>
public PowerSupplyGuiUpdateThread()
{
_logger = LogManager.GetCurrentClassLogger();
@@ -67,6 +73,11 @@ namespace ProgramLib
_logger?.Debug($"Entering {this.GetType().Name}::{System.Reflection.MethodBase.GetCurrentMethod().Name}() ...");
}
/// <summary>
/// Method that executes on the thread.
/// </summary>
/// <param name=""></param>
/// <returns></returns>
protected override void DoWork()
{
_logger?.Debug($"{this.GetType().Name}::{System.Reflection.MethodBase.GetCurrentMethod().Name}() is running...");
@@ -101,6 +112,11 @@ namespace ProgramLib
}
/// <summary>
/// Update GUI with data
/// </summary>
/// <param name=""></param>
/// <returns></returns>
private void UpdatePowerSupplyGui()
{
int pollRateMs = 1000;