mirror of
https://github.com/wpilibsuite/allwpilib
synced 2026-06-23 01:21:42 +00:00
Fixes warnings thrown by cpplint.py (#154)
* Fixed cpplint.py [runtime/int] warnings * Fixed cpplint.py [readability/casting] warnings * Fixed cpplint.py [readability/namespace] warnings * Fixed cpplint.py [readability/braces] warnings * Fixed cpplint.py [whitespace/braces] warnings * Fixed cpplint.py [runtime/explicit] warnings * Fixed cpplint.py [runtime/printf] warnings * Fixed cpplint.py [readability/inheritance] warnings * Fixed cpplint.py [whitespace/tab] warnings * Fixed cpplint.py [build/storage_class] warnings * Fixed cpplint.py [readability/multiline_comment] warnings * Fixed cpplint.py [whitespace/semicolon] warnings * Fixed cpplint.py [readability/check] warnings * Fixed cpplint.py [runtime/arrays] warnings * Ran format.py
This commit is contained in:
committed by
Peter Johnson
parent
e44a6e227a
commit
0cb288ffba
@@ -14,15 +14,13 @@
|
||||
#include "Buttons/ToggleButtonScheduler.h"
|
||||
|
||||
bool Trigger::Grab() {
|
||||
if (Get())
|
||||
if (Get()) {
|
||||
return true;
|
||||
else if (m_table != nullptr) {
|
||||
// if (m_table->isConnected())//TODO is connected on button?
|
||||
} else if (m_table != nullptr) {
|
||||
return m_table->GetBoolean("pressed", false);
|
||||
/*else
|
||||
return false;*/
|
||||
} else
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
void Trigger::WhenActive(Command* command) {
|
||||
@@ -52,8 +50,8 @@ void Trigger::ToggleWhenActive(Command* command) {
|
||||
|
||||
std::string Trigger::GetSmartDashboardType() const { return "Button"; }
|
||||
|
||||
void Trigger::InitTable(std::shared_ptr<ITable> table) {
|
||||
m_table = table;
|
||||
void Trigger::InitTable(std::shared_ptr<ITable> subtable) {
|
||||
m_table = subtable;
|
||||
if (m_table != nullptr) {
|
||||
m_table->PutBoolean("pressed", Get());
|
||||
}
|
||||
|
||||
@@ -392,9 +392,9 @@ std::string Command::GetName() const { return m_name; }
|
||||
|
||||
std::string Command::GetSmartDashboardType() const { return "Command"; }
|
||||
|
||||
void Command::InitTable(std::shared_ptr<ITable> table) {
|
||||
void Command::InitTable(std::shared_ptr<ITable> subtable) {
|
||||
if (m_table != nullptr) m_table->RemoveTableListener(this);
|
||||
m_table = table;
|
||||
m_table = subtable;
|
||||
if (m_table != nullptr) {
|
||||
m_table->PutString(kName, GetName());
|
||||
m_table->PutBoolean(kRunning, IsRunning());
|
||||
|
||||
@@ -66,7 +66,8 @@ double PIDCommand::GetSetpoint() const { return m_controller->GetSetpoint(); }
|
||||
double PIDCommand::GetPosition() { return ReturnPIDInput(); }
|
||||
|
||||
std::string PIDCommand::GetSmartDashboardType() const { return "PIDCommand"; }
|
||||
void PIDCommand::InitTable(std::shared_ptr<ITable> table) {
|
||||
m_controller->InitTable(table);
|
||||
Command::InitTable(table);
|
||||
|
||||
void PIDCommand::InitTable(std::shared_ptr<ITable> subtable) {
|
||||
m_controller->InitTable(subtable);
|
||||
Command::InitTable(subtable);
|
||||
}
|
||||
|
||||
@@ -239,7 +239,8 @@ void PIDSubsystem::PIDWrite(float output) { UsePIDOutput(output); }
|
||||
double PIDSubsystem::PIDGet() { return ReturnPIDInput(); }
|
||||
|
||||
std::string PIDSubsystem::GetSmartDashboardType() const { return "PIDCommand"; }
|
||||
void PIDSubsystem::InitTable(std::shared_ptr<ITable> table) {
|
||||
m_controller->InitTable(table);
|
||||
Subsystem::InitTable(table);
|
||||
|
||||
void PIDSubsystem::InitTable(std::shared_ptr<ITable> subtable) {
|
||||
m_controller->InitTable(subtable);
|
||||
Subsystem::InitTable(subtable);
|
||||
}
|
||||
|
||||
@@ -225,7 +225,7 @@ void Scheduler::UpdateTable() {
|
||||
toCancel = new_toCancel->GetDoubleArray();
|
||||
else
|
||||
toCancel.resize(0);
|
||||
// m_table->RetrieveValue("Ids", *ids);
|
||||
// m_table->RetrieveValue("Ids", *ids);
|
||||
|
||||
// cancel commands that have had the cancel buttons pressed
|
||||
// on the SmartDashboad
|
||||
|
||||
@@ -129,8 +129,8 @@ std::string Subsystem::GetName() const { return m_name; }
|
||||
|
||||
std::string Subsystem::GetSmartDashboardType() const { return "Subsystem"; }
|
||||
|
||||
void Subsystem::InitTable(std::shared_ptr<ITable> table) {
|
||||
m_table = table;
|
||||
void Subsystem::InitTable(std::shared_ptr<ITable> subtable) {
|
||||
m_table = subtable;
|
||||
if (m_table != nullptr) {
|
||||
if (m_defaultCommand != nullptr) {
|
||||
m_table->PutBoolean("hasDefault", true);
|
||||
|
||||
Reference in New Issue
Block a user