Files
allwpilib/hal/src/main/native/sim/mockdata/EncoderDataInternal.h
Thad House 221011494d Update for C++17 and fix MSVC warnings (#1694)
* Update MSVC arguments
* Fix json allocator
* Fix simulation diamond
* Bump gtest
* Remove empty varargs in unit tests
* Replace test case with test suite
* Remove deprecation warning in optional
* Remove need for NOMIXMAX to be defined in wpilib headers
2019-05-31 15:43:32 -05:00

46 lines
1.8 KiB
C++

/*----------------------------------------------------------------------------*/
/* Copyright (c) 2017-2019 FIRST. All Rights Reserved. */
/* Open Source Software - may be modified and shared by FRC teams. The code */
/* must be accompanied by the FIRST BSD license file in the root directory of */
/* the project. */
/*----------------------------------------------------------------------------*/
#pragma once
#include <atomic>
#include <limits>
#include "mockdata/EncoderData.h"
#include "mockdata/SimDataValue.h"
namespace hal {
class EncoderData {
HAL_SIMDATAVALUE_DEFINE_NAME(Initialized)
HAL_SIMDATAVALUE_DEFINE_NAME(Count)
HAL_SIMDATAVALUE_DEFINE_NAME(Period)
HAL_SIMDATAVALUE_DEFINE_NAME(Reset)
HAL_SIMDATAVALUE_DEFINE_NAME(MaxPeriod)
HAL_SIMDATAVALUE_DEFINE_NAME(Direction)
HAL_SIMDATAVALUE_DEFINE_NAME(ReverseDirection)
HAL_SIMDATAVALUE_DEFINE_NAME(SamplesToAverage)
HAL_SIMDATAVALUE_DEFINE_NAME(DistancePerPulse)
public:
std::atomic<int16_t> digitalChannelA{0};
SimDataValue<HAL_Bool, MakeBoolean, GetInitializedName> initialized{false};
SimDataValue<int32_t, MakeInt, GetCountName> count{0};
SimDataValue<double, MakeDouble, GetPeriodName> period{
(std::numeric_limits<double>::max)()};
SimDataValue<HAL_Bool, MakeBoolean, GetResetName> reset{false};
SimDataValue<double, MakeDouble, GetMaxPeriodName> maxPeriod{0};
SimDataValue<HAL_Bool, MakeBoolean, GetDirectionName> direction{false};
SimDataValue<HAL_Bool, MakeBoolean, GetReverseDirectionName> reverseDirection{
false};
SimDataValue<int32_t, MakeInt, GetSamplesToAverageName> samplesToAverage{0};
SimDataValue<double, MakeDouble, GetDistancePerPulseName> distancePerPulse{1};
virtual void ResetData();
};
extern EncoderData* SimEncoderData;
} // namespace hal