[sim] Add initialized flag for all solenoids on a PCM (#2897)

This allows much easier/faster checking for whether any solenoid has been
initialized on a particular PCM.
This commit is contained in:
Peter Johnson
2020-11-30 19:20:16 -08:00
committed by GitHub
parent bdf5ba91a4
commit f5a6fc0703
4 changed files with 24 additions and 1 deletions

View File

@@ -15,6 +15,7 @@ namespace hal {
class PCMData {
HAL_SIMDATAVALUE_DEFINE_NAME(SolenoidInitialized)
HAL_SIMDATAVALUE_DEFINE_NAME(SolenoidOutput)
HAL_SIMDATAVALUE_DEFINE_NAME(AnySolenoidInitialized)
HAL_SIMDATAVALUE_DEFINE_NAME(CompressorInitialized)
HAL_SIMDATAVALUE_DEFINE_NAME(CompressorOn)
HAL_SIMDATAVALUE_DEFINE_NAME(ClosedLoopEnabled)
@@ -37,6 +38,8 @@ class PCMData {
SimDataValue<HAL_Bool, HAL_MakeBoolean, GetSolenoidOutputName,
GetSolenoidOutputDefault>
solenoidOutput[kNumSolenoidChannels];
SimDataValue<HAL_Bool, HAL_MakeBoolean, GetAnySolenoidInitializedName>
anySolenoidInitialized{false};
SimDataValue<HAL_Bool, HAL_MakeBoolean, GetCompressorInitializedName>
compressorInitialized{false};
SimDataValue<HAL_Bool, HAL_MakeBoolean, GetCompressorOnName> compressorOn{