Improve const correctness.

See https://usfirst.collab.net/sf/tracker/do/viewArtifact/projects.wpilib/tracker.4_defects/artf4148

Change-Id: I47b0d5a91fd49e47e2c7348b0705e998ec815682
This commit is contained in:
Tyler Veness
2015-06-19 17:23:54 -07:00
parent c6b790cadd
commit 5598445a67
172 changed files with 1165 additions and 1140 deletions

View File

@@ -257,7 +257,7 @@ void PIDController::SetPID(float p, float i, float d, float f)
* Get the Proportional coefficient
* @return proportional coefficient
*/
float PIDController::GetP()
float PIDController::GetP() const
{
CRITICAL_REGION(m_semaphore)
{
@@ -270,7 +270,7 @@ float PIDController::GetP()
* Get the Integral coefficient
* @return integral coefficient
*/
float PIDController::GetI()
float PIDController::GetI() const
{
CRITICAL_REGION(m_semaphore)
{
@@ -283,7 +283,7 @@ float PIDController::GetI()
* Get the Differential coefficient
* @return differential coefficient
*/
float PIDController::GetD()
float PIDController::GetD() const
{
CRITICAL_REGION(m_semaphore)
{
@@ -296,7 +296,7 @@ float PIDController::GetD()
* Get the Feed forward coefficient
* @return Feed forward coefficient
*/
float PIDController::GetF()
float PIDController::GetF() const
{
CRITICAL_REGION(m_semaphore)
{
@@ -310,7 +310,7 @@ float PIDController::GetF()
* This is always centered on zero and constrained the the max and min outs
* @return the latest calculated output
*/
float PIDController::Get()
float PIDController::Get() const
{
float result;
CRITICAL_REGION(m_semaphore)
@@ -404,7 +404,7 @@ void PIDController::SetSetpoint(float setpoint)
* Returns the current setpoint of the PIDController
* @return the current setpoint
*/
float PIDController::GetSetpoint()
float PIDController::GetSetpoint() const
{
float setpoint;
CRITICAL_REGION(m_semaphore)
@@ -419,7 +419,7 @@ float PIDController::GetSetpoint()
* Retruns the current difference of the input from the setpoint
* @return the current error
*/
float PIDController::GetError()
float PIDController::GetError() const
{
float error;
double pidInput;
@@ -484,7 +484,7 @@ void PIDController::SetAbsoluteTolerance(float absTolerance)
* Currently this just reports on target as the actual value passes through the setpoint.
* Ideally it should be based on being within the tolerance for some period of time.
*/
bool PIDController::OnTarget()
bool PIDController::OnTarget() const
{
bool temp;
double error = GetError();
@@ -542,7 +542,7 @@ void PIDController::Disable()
/**
* Return true if PIDController is enabled.
*/
bool PIDController::IsEnabled()
bool PIDController::IsEnabled() const
{
bool enabled;
CRITICAL_REGION(m_semaphore)
@@ -569,7 +569,7 @@ void PIDController::Reset()
END_REGION;
}
std::string PIDController::GetSmartDashboardType(){
std::string PIDController::GetSmartDashboardType() const {
return "PIDController";
}
@@ -588,7 +588,7 @@ void PIDController::InitTable(ITable* table){
}
}
ITable* PIDController::GetTable(){
ITable* PIDController::GetTable() const {
return m_table;
}