#pragma once
#include <string>
#include <hal/SimDevice.h>
#include "rev/DetachedEncoder.h"
namespace rev::detached {
class DetachedEncoderSim {
public:
explicit DetachedEncoderSim(DetachedEncoder* encoder);
void SetPosition(double position);
double GetPosition() const;
void SetVelocity(double velocity);
double GetVelocity() const;
void SetAngle(double angle);
double GetAngle() const;
void SetRawAngle(double rawAngle);
double GetRawAngle() const;
void SetInverted(bool inverted);
bool GetInverted() const;
void SetZeroOffset(double zeroOffset);
double GetZeroOffset() const;
double GetPositionConversionFactor() const;
double GetVelocityConversionFactor() const;
void iterate(double velocity, double dt);
private:
hal::SimDouble m_position;
hal::SimDouble m_velocity;
hal::SimDouble m_angle;
hal::SimDouble m_rawAngle;
hal::SimBoolean m_isInverted;
hal::SimDouble m_zeroOffset;
hal::SimDouble m_positionConversionFactor;
hal::SimDouble m_velocityConversionFactor;
DetachedEncoder* m_encoder;
std::string simDeviceName;
};
}