2020-12-26 14:12:05 -08:00
|
|
|
// Copyright (c) FIRST and other WPILib contributors.
|
|
|
|
|
// Open Source Software; you can modify and/or share it under the terms of
|
|
|
|
|
// the WPILib BSD license file in the root directory of this project.
|
2017-08-18 21:35:53 -07:00
|
|
|
|
|
|
|
|
#pragma once
|
|
|
|
|
|
|
|
|
|
#include "../PortsInternal.h"
|
2021-08-04 20:31:17 -07:00
|
|
|
#include "hal/simulation/PowerDistributionData.h"
|
2020-06-27 22:11:24 -07:00
|
|
|
#include "hal/simulation/SimDataValue.h"
|
2017-08-18 21:35:53 -07:00
|
|
|
|
|
|
|
|
namespace hal {
|
2021-08-14 11:44:56 -07:00
|
|
|
|
2021-08-04 20:31:17 -07:00
|
|
|
class PowerDistributionData {
|
2018-09-03 16:08:07 -07:00
|
|
|
HAL_SIMDATAVALUE_DEFINE_NAME(Initialized)
|
|
|
|
|
HAL_SIMDATAVALUE_DEFINE_NAME(Temperature)
|
|
|
|
|
HAL_SIMDATAVALUE_DEFINE_NAME(Voltage)
|
|
|
|
|
HAL_SIMDATAVALUE_DEFINE_NAME(Current)
|
2017-08-18 21:35:53 -07:00
|
|
|
|
2018-09-03 16:08:07 -07:00
|
|
|
static LLVM_ATTRIBUTE_ALWAYS_INLINE constexpr double GetCurrentDefault() {
|
|
|
|
|
return 0.0;
|
|
|
|
|
}
|
2017-08-18 21:35:53 -07:00
|
|
|
|
2018-09-03 16:08:07 -07:00
|
|
|
public:
|
2019-09-23 23:28:49 -07:00
|
|
|
SimDataValue<HAL_Bool, HAL_MakeBoolean, GetInitializedName> initialized{
|
|
|
|
|
false};
|
|
|
|
|
SimDataValue<double, HAL_MakeDouble, GetTemperatureName> temperature{0.0};
|
|
|
|
|
SimDataValue<double, HAL_MakeDouble, GetVoltageName> voltage{12.0};
|
|
|
|
|
SimDataValue<double, HAL_MakeDouble, GetCurrentName, GetCurrentDefault>
|
2021-08-14 11:44:56 -07:00
|
|
|
current[kNumPDSimChannels];
|
2017-08-18 21:35:53 -07:00
|
|
|
|
|
|
|
|
virtual void ResetData();
|
|
|
|
|
};
|
2021-08-04 20:31:17 -07:00
|
|
|
extern PowerDistributionData* SimPowerDistributionData;
|
2017-08-18 21:35:53 -07:00
|
|
|
} // namespace hal
|