From f71320949da56fe0d935f3c3c26a27aee4e0ca99 Mon Sep 17 00:00:00 2001 From: Austen Adler Date: Mon, 9 Mar 2015 07:25:11 -0400 Subject: [PATCH] More formatting improvements --- CommandBase.cpp | 4 ++-- Commands/Autonomous/AutoDrive.cpp | 2 +- Commands/Autonomous/Turn.cpp | 2 +- Commands/BinElevator/BinCloseArms.cpp | 2 +- Commands/BinElevator/BinLower.cpp | 4 ++-- Commands/BinElevator/BinOpenArms.cpp | 2 +- Commands/BinElevator/BinRaise.cpp | 4 ++-- Commands/Collector/RollIn.cpp | 2 +- Commands/Collector/RollOut.cpp | 4 ++-- Commands/Drivetrain/Drive.cpp | 6 +++--- Commands/Elevator/Lower.cpp | 4 ++-- Commands/Elevator/Raise.cpp | 8 ++++---- Commands/Test/CheckDrive.cpp | 2 +- DentRobot.cpp | 4 ++-- OI.cpp | 2 +- Subsystems/Collector.cpp | 2 +- Subsystems/Drivetrain.cpp | 4 ++-- Subsystems/Pneumatics.cpp | 2 +- 18 files changed, 30 insertions(+), 30 deletions(-) diff --git a/CommandBase.cpp b/CommandBase.cpp index bb92223..72a2ffc 100644 --- a/CommandBase.cpp +++ b/CommandBase.cpp @@ -10,9 +10,9 @@ Elevator* CommandBase::elevator = NULL; BinElevator* CommandBase::binElevator = NULL; Pneumatics* CommandBase::pneumatics=NULL; OI* CommandBase::oi = NULL; -CommandBase::CommandBase(char const *name) : Command(name){ +CommandBase::CommandBase(char const *name): Command(name){ } -CommandBase::CommandBase() : Command(){ +CommandBase::CommandBase(): Command(){ } void CommandBase::init(){ drivetrain = new Drivetrain(); diff --git a/Commands/Autonomous/AutoDrive.cpp b/Commands/Autonomous/AutoDrive.cpp index 4f8dea5..2525eb8 100644 --- a/Commands/Autonomous/AutoDrive.cpp +++ b/Commands/Autonomous/AutoDrive.cpp @@ -1,7 +1,7 @@ #include "AutoDrive.h" #include "../../DentRobot.h" // Drive for a short while then stop. Just for testing -AutoDrive::AutoDrive(double duration, double xtmp, double ytmp) : Command("AutoDrive"){ +AutoDrive::AutoDrive(double duration, double xtmp, double ytmp): Command("AutoDrive"){ Requires(DentRobot::drivetrain); SetTimeout(duration); x=xtmp; diff --git a/Commands/Autonomous/Turn.cpp b/Commands/Autonomous/Turn.cpp index d9a68d7..b44dab9 100644 --- a/Commands/Autonomous/Turn.cpp +++ b/Commands/Autonomous/Turn.cpp @@ -1,6 +1,6 @@ #include "Turn.h" #include "../../DentRobot.h" -Turn::Turn(double timeout) : Command("Turn"){ +Turn::Turn(double timeout): Command("Turn"){ Requires(DentRobot::drivetrain); SetTimeout(timeout); } diff --git a/Commands/BinElevator/BinCloseArms.cpp b/Commands/BinElevator/BinCloseArms.cpp index f16cab0..45cd81b 100644 --- a/Commands/BinElevator/BinCloseArms.cpp +++ b/Commands/BinElevator/BinCloseArms.cpp @@ -1,7 +1,7 @@ #include "BinCloseArms.h" #include "../../DentRobot.h" #include "../../OI.h" -BinCloseArms::BinCloseArms(double timeout) : Command("BinCloseArms"){ +BinCloseArms::BinCloseArms(double timeout): Command("BinCloseArms"){ SetTimeout(timeout); } void BinCloseArms::Initialize(){ diff --git a/Commands/BinElevator/BinLower.cpp b/Commands/BinElevator/BinLower.cpp index fe781ed..e8373bd 100644 --- a/Commands/BinElevator/BinLower.cpp +++ b/Commands/BinElevator/BinLower.cpp @@ -1,7 +1,7 @@ #include "BinLower.h" #include "../../DentRobot.h" #include "../../OI.h" -BinLower::BinLower(float timeout) : Command("BinLower"){ +BinLower::BinLower(float timeout): Command("BinLower"){ SetTimeout(timeout); } void BinLower::Initialize(){ @@ -10,7 +10,7 @@ void BinLower::Execute(){ DentRobot::binElevator->Run(-1.0); } bool BinLower::IsFinished(){ - if (/*!DentRobot::binElevator->GetElevatorBottom()||*/IsTimedOut()){ + if(/*!DentRobot::binElevator->GetElevatorBottom()||*/IsTimedOut()){ printf("Robot stoped BinLowering. Sensor based? %d\n", !DentRobot::binElevator->GetElevatorBottom()); return true; }else{ diff --git a/Commands/BinElevator/BinOpenArms.cpp b/Commands/BinElevator/BinOpenArms.cpp index 694f357..91f9bb1 100644 --- a/Commands/BinElevator/BinOpenArms.cpp +++ b/Commands/BinElevator/BinOpenArms.cpp @@ -1,7 +1,7 @@ #include "BinOpenArms.h" #include "../../DentRobot.h" #include "../../OI.h" -BinOpenArms::BinOpenArms(double timeout) : Command("BinOpenArms"){ +BinOpenArms::BinOpenArms(double timeout): Command("BinOpenArms"){ SetTimeout(timeout); } void BinOpenArms::Initialize(){ diff --git a/Commands/BinElevator/BinRaise.cpp b/Commands/BinElevator/BinRaise.cpp index 8ac189f..0f89c78 100644 --- a/Commands/BinElevator/BinRaise.cpp +++ b/Commands/BinElevator/BinRaise.cpp @@ -1,7 +1,7 @@ #include "BinRaise.h" #include "../../DentRobot.h" #include "../../OI.h" -BinRaise::BinRaise(double timeout) : Command("BinRaise"){ +BinRaise::BinRaise(double timeout): Command("BinRaise"){ SetTimeout(timeout); } void BinRaise::Initialize(){ @@ -10,7 +10,7 @@ void BinRaise::Execute(){ DentRobot::binElevator->Run(1.0); } bool BinRaise::IsFinished(){ - if (/*!DentRobot::binElevator->GetElevatorTop()||*/IsTimedOut()){ + if(/*!DentRobot::binElevator->GetElevatorTop()||*/IsTimedOut()){ printf("Robot stoped raising. Sensor based? %d\n", !DentRobot::binElevator->GetElevatorTop()); return true; }else{ diff --git a/Commands/Collector/RollIn.cpp b/Commands/Collector/RollIn.cpp index 87ec0f9..f87de00 100644 --- a/Commands/Collector/RollIn.cpp +++ b/Commands/Collector/RollIn.cpp @@ -1,5 +1,5 @@ #include "RollIn.h" -RollIn::RollIn(double speed) : Command("RollIn"){ +RollIn::RollIn(double speed): Command("RollIn"){ rawSpeed=speed; } void RollIn::Initialize(){ diff --git a/Commands/Collector/RollOut.cpp b/Commands/Collector/RollOut.cpp index eb07ad6..d9a696a 100644 --- a/Commands/Collector/RollOut.cpp +++ b/Commands/Collector/RollOut.cpp @@ -1,5 +1,5 @@ #include "RollOut.h" -RollOut::RollOut(double timeout) : Command("RollOut"){ +RollOut::RollOut(double timeout): Command("RollOut"){ Requires(DentRobot::collector); SetTimeout(timeout); } @@ -9,7 +9,7 @@ void RollOut::Execute(){ //TODO check this value to move the motors in the right direction // Devide by 2 twice because this speed should be half the collector speed DentRobot::collector->MoveRollers(-DentRobot::oi->GetLeftThrottle() * 0.8); - SmartDashboard::PutNumber("DriveThrottle",-DentRobot::oi->GetLeftThrottle()); + SmartDashboard::PutNumber("DriveThrottle", -DentRobot::oi->GetLeftThrottle()); } bool RollOut::IsFinished(){ return IsTimedOut(); diff --git a/Commands/Drivetrain/Drive.cpp b/Commands/Drivetrain/Drive.cpp index 4354717..71470eb 100644 --- a/Commands/Drivetrain/Drive.cpp +++ b/Commands/Drivetrain/Drive.cpp @@ -1,6 +1,6 @@ #include "Drive.h" #include "../../DentRobot.h" -Drive::Drive() : Command("Drive"){ +Drive::Drive(): Command("Drive"){ Requires(DentRobot::drivetrain); } void Drive::Initialize(){ @@ -11,10 +11,10 @@ void Drive::Execute(){ y = -DentRobot::oi->GetLeftStick()->GetRawAxis(1); z = DentRobot::oi->GetLeftStick()->GetRawAxis(2); // Lock the x axis when not holding button 1 - //if (DentRobot::oi->GetLeftStick()->GetRawButton(1)){ + //if(DentRobot::oi->GetLeftStick()->GetRawButton(1)){ // x=0; //} - //if (DentRobot::oi->GetLeftStick()->GetRawButton(2)){ + //if(DentRobot::oi->GetLeftStick()->GetRawButton(2)){ // y=0; //} //X axis, Y axis, Z axis, sensitivity, speed threshold (usually throttle), gyro diff --git a/Commands/Elevator/Lower.cpp b/Commands/Elevator/Lower.cpp index 3b11e4f..54f26f2 100644 --- a/Commands/Elevator/Lower.cpp +++ b/Commands/Elevator/Lower.cpp @@ -1,7 +1,7 @@ #include "Lower.h" #include "../../DentRobot.h" #include "../../OI.h" -Lower::Lower(double timeout) : Command("Lower"){ +Lower::Lower(double timeout): Command("Lower"){ SetTimeout(timeout); } void Lower::Initialize(){ @@ -10,7 +10,7 @@ void Lower::Execute(){ DentRobot::elevator->Run(-1.0); } bool Lower::IsFinished(){ - if (!DentRobot::elevator->GetElevatorBottom()||IsTimedOut()){ + if(!DentRobot::elevator->GetElevatorBottom()||IsTimedOut()){ printf("Robot stoped lowering. Sensor based? %d\n", !DentRobot::elevator->GetElevatorBottom()); return true; }else{ diff --git a/Commands/Elevator/Raise.cpp b/Commands/Elevator/Raise.cpp index 48286c7..feaa933 100644 --- a/Commands/Elevator/Raise.cpp +++ b/Commands/Elevator/Raise.cpp @@ -1,7 +1,7 @@ #include "Raise.h" #include "../../DentRobot.h" #include "../../OI.h" -Raise::Raise(double timeout) : Command("Raise"){ +Raise::Raise(double timeout): Command("Raise"){ SetTimeout(timeout); } void Raise::Initialize(){ @@ -13,12 +13,12 @@ bool Raise::IsFinished(){ //if(!DentRobot::elevator->GetElevatorMiddle()){ // DentRobot::elevator->stoppedAtSensor=true; //} - //if ((DentRobot::elevator->stoppedAtSensor)){ + //if((DentRobot::elevator->stoppedAtSensor)){ // printf("Stopped at the middle sensor\n"); // DentRobot::elevator->stoppedAtSensor=false; // return true; - //}else if (!DentRobot::elevator->GetElevatorTop()) { - if (!DentRobot::elevator->GetElevatorTop()||!DentRobot::elevator->GetElevatorMiddle()||IsTimedOut()){ + //}else if(!DentRobot::elevator->GetElevatorTop()){ + if(!DentRobot::elevator->GetElevatorTop()||!DentRobot::elevator->GetElevatorMiddle()||IsTimedOut()){ printf("Robot stopped raising. Sensor based? %d\n", !DentRobot::elevator->GetElevatorTop()||!DentRobot::elevator->GetElevatorMiddle()); return true; }else{ diff --git a/Commands/Test/CheckDrive.cpp b/Commands/Test/CheckDrive.cpp index 8ce3b65..8a114b7 100644 --- a/Commands/Test/CheckDrive.cpp +++ b/Commands/Test/CheckDrive.cpp @@ -3,7 +3,7 @@ #include "Commands/CommandGroup.h" #include "../../DentRobot.h" #include "../../RobotMap.h" -CheckDrive::CheckDrive(int motorID) : CommandGroup("CheckDrive"){ +CheckDrive::CheckDrive(int motorID): CommandGroup("CheckDrive"){ Requires(DentRobot::drivetrain); motor = motorID; } diff --git a/DentRobot.cpp b/DentRobot.cpp index 5bdb235..be86154 100644 --- a/DentRobot.cpp +++ b/DentRobot.cpp @@ -43,7 +43,7 @@ void DentRobot::RobotInit(){ SmartDashboard::PutBoolean("Elevator Bottom", false); SmartDashboard::PutBoolean("Elevator Top", false); //Drive speed - SmartDashboard::PutNumber("DriveSpeedReductionThresh",2); + SmartDashboard::PutNumber("DriveSpeedReductionThresh", 2); } void DentRobot::DisabledPeriodic(){ Scheduler::GetInstance()->Run(); @@ -60,7 +60,7 @@ void DentRobot::AutonomousPeriodic(){ Scheduler::GetInstance()->Run(); } void DentRobot::TeleopInit(){ - if (aut != NULL){ + if(aut != NULL){ aut->Cancel(); } } diff --git a/OI.cpp b/OI.cpp index 3bea98f..f3d07f9 100644 --- a/OI.cpp +++ b/OI.cpp @@ -10,7 +10,7 @@ #include "Commands/Autonomous/CollectTote.h" #include "Commands/Autonomous/ReleaseTote.h" #include "Commands/Test/CheckRobot.h" -OI::OI() { +OI::OI(){ // Joysticks leftStick=new Joystick(0); rightStick=new Joystick(1); diff --git a/Subsystems/Collector.cpp b/Subsystems/Collector.cpp index 7e5296a..ddae882 100644 --- a/Subsystems/Collector.cpp +++ b/Subsystems/Collector.cpp @@ -1,7 +1,7 @@ #include "Collector.h" #include "../RobotMap.h" -Collector::Collector() : Subsystem("Collector"){ +Collector::Collector(): Subsystem("Collector"){ collectorMotorLeft=new CANTalon(COLLECTOR_LEFT_CAN); collectorMotorBottom=new CANTalon(COLLECTOR_BOTTOM_CAN); collectorMotorRamp=new CANTalon(COLLECTOR_RAMP_CAN); diff --git a/Subsystems/Drivetrain.cpp b/Subsystems/Drivetrain.cpp index 2eff667..fa546b7 100644 --- a/Subsystems/Drivetrain.cpp +++ b/Subsystems/Drivetrain.cpp @@ -2,7 +2,7 @@ #include "../RobotMap.h" #include "../Commands/Drivetrain/Drive.h" -Drivetrain::Drivetrain() : Subsystem("Drivetrain"){ +Drivetrain::Drivetrain(): Subsystem("Drivetrain"){ rightFront = new CANTalon(DRIVE_FRONT_RIGHT_CAN); leftFront = new CANTalon(DRIVE_FRONT_LEFT_CAN); rightRear = new CANTalon(DRIVE_BACK_RIGHT_CAN); @@ -15,7 +15,7 @@ void Drivetrain::DriveMecanum(double x, double y, double z, double sensitivity, double correctX = -(sensitivity*(pow(x, 3))+(1-sensitivity)*x); double correctY = -(sensitivity*(pow(y, 3))+(1-sensitivity)*y); double correctZ = -z * 0.5; - if (DentRobot::oi->GetLeftStick()->GetRawButton(9)){ + if(DentRobot::oi->GetLeftStick()->GetRawButton(9)){ correctY /= SmartDashboard::GetNumber("DriveSpeedReductionThresh"); } rightFront->Set((-correctX + correctY - correctZ)); diff --git a/Subsystems/Pneumatics.cpp b/Subsystems/Pneumatics.cpp index 93dab86..ef040af 100644 --- a/Subsystems/Pneumatics.cpp +++ b/Subsystems/Pneumatics.cpp @@ -1,7 +1,7 @@ #include "Pneumatics.h" #include "../RobotMap.h" -Pneumatics::Pneumatics() : Subsystem("Pneumatics"){ +Pneumatics::Pneumatics(): Subsystem("Pneumatics"){ solenoid1 = new Solenoid(BINELEVATOR_SOLDENOID_ONE); solenoid2 = new Solenoid(BINELEVATOR_SOLDENOID_TWO); }