Fix bug where multiple threads modify same variable at the same time. Perform some refactoring

This commit is contained in:
Duc
2025-03-13 14:40:58 -07:00
parent ffa9905494
commit 492cbb9cd9
10 changed files with 84 additions and 102 deletions

View File

@@ -1,28 +1,23 @@
using Raytheon.Instruments.PowerSupply;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace ProgramLib
{
{
/// <summary>
/// Stores voltage and current reading
/// </summary>
internal class PowerSupplyData
{
public double _voltage;
public double _current;
public PowerSupplyModuleInfo _powerSupplyModuleInfo;
public bool _initialized;
public double Voltage { get; set; }
public double Current { get; set; }
public PowerSupplyModuleInfo PowerSupplyModuleInfo { get; set; }
public bool Initialized { get; set; }
/// <summary>
/// Set data to unitialized
/// </summary>
public void Reset()
{
_initialized = false;
Initialized = false;
}
}
}