From 1f6f1cf239a8713e48ac81bab3e6c45001b410cf Mon Sep 17 00:00:00 2001 From: Austen Adler Date: Sat, 7 Feb 2015 13:17:22 -0500 Subject: [PATCH] Removed compressor --- CommandBase.cpp | 3 --- CommandBase.h | 2 -- Commands/Autonomous/Autonomous.cpp | 1 + Commands/Compressor/StartCompressing.cpp | 18 ------------------ Commands/Compressor/StartCompressing.h | 18 ------------------ Commands/Compressor/StopCompressing.cpp | 18 ------------------ Commands/Compressor/StopCompressing.h | 18 ------------------ DentRobot.cpp | 2 -- DentRobot.h | 2 -- OI.cpp | 1 - RobotMap.h | 3 --- Subsystems/AirCompressor.cpp | 20 -------------------- Subsystems/AirCompressor.h | 15 --------------- TODO.txt | 2 -- 14 files changed, 1 insertion(+), 122 deletions(-) delete mode 100644 Commands/Compressor/StartCompressing.cpp delete mode 100644 Commands/Compressor/StartCompressing.h delete mode 100644 Commands/Compressor/StopCompressing.cpp delete mode 100644 Commands/Compressor/StopCompressing.h delete mode 100644 Subsystems/AirCompressor.cpp delete mode 100644 Subsystems/AirCompressor.h diff --git a/CommandBase.cpp b/CommandBase.cpp index dfd3a78..c09ffd6 100644 --- a/CommandBase.cpp +++ b/CommandBase.cpp @@ -2,11 +2,9 @@ #include "Subsystems/Drivetrain.h" #include "Subsystems/Collector.h" #include "Subsystems/Elevator.h" -#include "Subsystems/AirCompressor.h" Drivetrain* CommandBase::drivetrain = NULL; Collector* CommandBase::collector = NULL; Elevator* CommandBase::elevator = NULL; -AirCompressor* CommandBase::airCompressor = NULL; OI* CommandBase::oi = NULL; CommandBase::CommandBase(char const *name) : Command(name) { } @@ -16,6 +14,5 @@ void CommandBase::init(){ drivetrain = new Drivetrain(); collector = new Collector(); elevator = new Elevator(); - airCompressor = new AirCompressor(); oi = new OI(); } diff --git a/CommandBase.h b/CommandBase.h index e6891d1..a0e5d05 100644 --- a/CommandBase.h +++ b/CommandBase.h @@ -5,7 +5,6 @@ #include "Subsystems/Drivetrain.h" #include "Subsystems/Collector.h" #include "Subsystems/Elevator.h" -#include "Subsystems/AirCompressor.h" #include "OI.h" #include "WPILib.h" @@ -17,7 +16,6 @@ class CommandBase: public Command { static Drivetrain *drivetrain; static Collector *collector; static Elevator *elevator; - static AirCompressor *airCompressor; static OI *oi; }; #endif diff --git a/Commands/Autonomous/Autonomous.cpp b/Commands/Autonomous/Autonomous.cpp index 12be62e..a57859a 100644 --- a/Commands/Autonomous/Autonomous.cpp +++ b/Commands/Autonomous/Autonomous.cpp @@ -4,4 +4,5 @@ #include "../Elevator/Raise.h" Autonomous::Autonomous(){ AddSequential(new AutoDrive()); + AddSequential(new Raise()); } diff --git a/Commands/Compressor/StartCompressing.cpp b/Commands/Compressor/StartCompressing.cpp deleted file mode 100644 index 50425b5..0000000 --- a/Commands/Compressor/StartCompressing.cpp +++ /dev/null @@ -1,18 +0,0 @@ -#include "StartCompressing.h" -#include "../../DentRobot.h" -StartCompressing::StartCompressing() : Command("StartCompressing"){ - Requires(DentRobot::airCompressor); -} -void StartCompressing::Initialize(){ -} -void StartCompressing::Execute(){ - DentRobot::airCompressor->StartCompressing(); -} -bool StartCompressing::IsFinished(){ - return false; -} -void StartCompressing::End(){ -} -void StartCompressing::Interrupted(){ - End(); -} diff --git a/Commands/Compressor/StartCompressing.h b/Commands/Compressor/StartCompressing.h deleted file mode 100644 index a681bd0..0000000 --- a/Commands/Compressor/StartCompressing.h +++ /dev/null @@ -1,18 +0,0 @@ -#ifndef STARTCOMPRESSING_H -#define STARTCOMPRESSING_H - -#include "../../CommandBase.h" -#include "../../DentRobot.h" -#include "Commands/Command.h" -#include "WPILib.h" - -class StartCompressing: public Command{ - public: - StartCompressing(); - void Initialize(); - void Execute(); - bool IsFinished(); - void End(); - void Interrupted(); -}; -#endif diff --git a/Commands/Compressor/StopCompressing.cpp b/Commands/Compressor/StopCompressing.cpp deleted file mode 100644 index 4ef05fb..0000000 --- a/Commands/Compressor/StopCompressing.cpp +++ /dev/null @@ -1,18 +0,0 @@ -#include "StopCompressing.h" -#include "../../DentRobot.h" -StopCompressing::StopCompressing() : Command("StopCompressing"){ - Requires(DentRobot::airCompressor); -} -void StopCompressing::Initialize(){ -} -void StopCompressing::Execute(){ - DentRobot::airCompressor->StopCompressing(); -} -bool StopCompressing::IsFinished(){ - return false; -} -void StopCompressing::End(){ -} -void StopCompressing::Interrupted(){ - End(); -} diff --git a/Commands/Compressor/StopCompressing.h b/Commands/Compressor/StopCompressing.h deleted file mode 100644 index c723098..0000000 --- a/Commands/Compressor/StopCompressing.h +++ /dev/null @@ -1,18 +0,0 @@ -#ifndef STOPCOMPRESSING_H -#define STOPCOMPRESSING_H - -#include "../../CommandBase.h" -#include "../../DentRobot.h" -#include "Commands/Command.h" -#include "WPILib.h" - -class StopCompressing: public Command{ - public: - StopCompressing(); - void Initialize(); - void Execute(); - bool IsFinished(); - void End(); - void Interrupted(); -}; -#endif diff --git a/DentRobot.cpp b/DentRobot.cpp index 96b8fd2..14cf442 100644 --- a/DentRobot.cpp +++ b/DentRobot.cpp @@ -4,14 +4,12 @@ OI* DentRobot::oi=NULL; Collector* DentRobot::collector=NULL; Drivetrain* DentRobot::drivetrain=NULL; Elevator* DentRobot::elevator=NULL; -AirCompressor* DentRobot::airCompressor=NULL; CommandGroup* DentRobot::aut=NULL; DentRobot::DentRobot(){ oi=new OI(); collector=new Collector(); drivetrain=new Drivetrain(); elevator=new Elevator(); - airCompressor=new AirCompressor(); aut=new Autonomous(); printf("Initialized"); } diff --git a/DentRobot.h b/DentRobot.h index 9e30708..e089405 100644 --- a/DentRobot.h +++ b/DentRobot.h @@ -5,7 +5,6 @@ #include "Subsystems/Elevator.h" #include "Subsystems/Drivetrain.h" #include "Subsystems/Collector.h" -#include "Subsystems/AirCompressor.h" #include "Commands/Autonomous/Autonomous.h" class DentRobot: public IterativeRobot { private: @@ -16,7 +15,6 @@ class DentRobot: public IterativeRobot { static Collector* collector; static Drivetrain* drivetrain; static Elevator* elevator; - static AirCompressor* airCompressor; static CommandGroup* aut; void RobotInit(); void DisabledPeriodic(); diff --git a/OI.cpp b/OI.cpp index 47a0a66..e5576c9 100644 --- a/OI.cpp +++ b/OI.cpp @@ -5,7 +5,6 @@ #include "Commands/Collector/CloseCollector.h" #include "Commands/Collector/CollectTote.h" #include "Commands/Collector/ReleaseTote.h" -#include "Commands/Compressor/StartCompressing.h" OI::OI() { leftStick=new Joystick(0); diff --git a/RobotMap.h b/RobotMap.h index da8ce10..eb0a2c7 100644 --- a/RobotMap.h +++ b/RobotMap.h @@ -24,7 +24,4 @@ #define COLLECTOR_LEFT_CAN 8 #define COLLECTOR_RIGHT_CAN 9 -// Compressor -#define COMPRESSOR_CAN 10 - #endif diff --git a/Subsystems/AirCompressor.cpp b/Subsystems/AirCompressor.cpp deleted file mode 100644 index b63ff8b..0000000 --- a/Subsystems/AirCompressor.cpp +++ /dev/null @@ -1,20 +0,0 @@ -#include "AirCompressor.h" -#include "../RobotMap.h" - -AirCompressor::AirCompressor() : Subsystem("AirCompressor") { - compressor = new Compressor(COMPRESSOR_CAN); -} -void AirCompressor::InitDefaultCommand() { -} -void AirCompressor::StartCompressing() { - if(compressor->Enabled()){ - printf("Starting compressor\n"); - compressor->Start(); - } -} -void AirCompressor::StopCompressing() { - if(compressor->Enabled()){ - printf("Stopping compressor\n"); - compressor->Stop(); - } -} diff --git a/Subsystems/AirCompressor.h b/Subsystems/AirCompressor.h deleted file mode 100644 index df9ec00..0000000 --- a/Subsystems/AirCompressor.h +++ /dev/null @@ -1,15 +0,0 @@ -#ifndef AIRCOMPRESSOR_H -#define AIRCOMPRESSOR_H - -#include "WPILib.h" -class AirCompressor: public Subsystem -{ - private: - Compressor *compressor; - public: - AirCompressor(); - void InitDefaultCommand(); - void StartCompressing(); - void StopCompressing(); -}; -#endif diff --git a/TODO.txt b/TODO.txt index 0f710ce..e69de29 100644 --- a/TODO.txt +++ b/TODO.txt @@ -1,2 +0,0 @@ -Compressor isn't in use - (dos compressor on compressor start or stop)?