2015-01-11 16:02:49 -05:00
|
|
|
#include "OI.h"
|
2015-01-17 12:21:16 -05:00
|
|
|
#include "Commands/Lower.h"
|
|
|
|
#include "Commands/Raise.h"
|
2015-02-02 12:14:27 -05:00
|
|
|
#include "Commands/OpenCollector.h"
|
|
|
|
#include "Commands/CloseCollector.h"
|
|
|
|
#include "Commands/CollectTote.h"
|
|
|
|
#include "Commands/ReleaseTote.h"
|
2015-01-29 14:53:11 -05:00
|
|
|
#include "Commands/Compressor/StartCompressing.h"
|
|
|
|
#include "Commands/Compressor/StopCompressing.h"
|
2015-01-11 16:02:49 -05:00
|
|
|
|
|
|
|
OI::OI() {
|
2015-01-17 12:21:16 -05:00
|
|
|
leftStick=new Joystick(0);
|
|
|
|
rightStick=new Joystick(1);
|
2015-02-02 12:14:27 -05:00
|
|
|
//TODO name these buttons to their functions rather to their number
|
|
|
|
JoystickButton *right1=new JoystickButton(rightStick, 1);
|
|
|
|
JoystickButton *right2=new JoystickButton(rightStick, 2);
|
|
|
|
JoystickButton *right3=new JoystickButton(rightStick, 3);
|
|
|
|
JoystickButton *right4=new JoystickButton(rightStick, 4);
|
2015-02-02 20:43:22 -05:00
|
|
|
JoystickButton *right5=new JoystickButton(rightStick, 5);
|
|
|
|
JoystickButton *right6=new JoystickButton(rightStick, 6);
|
2015-02-03 15:20:10 -05:00
|
|
|
JoystickButton *right7=new JoystickButton(rightStick, 7);
|
|
|
|
JoystickButton *right8=new JoystickButton(rightStick, 8);
|
2015-02-02 12:14:27 -05:00
|
|
|
right1->WhenPressed(new OpenCollector());
|
|
|
|
right2->WhenPressed(new CloseCollector());
|
|
|
|
right3->WhenPressed(new CollectTote());
|
|
|
|
right4->WhenPressed(new ReleaseTote());
|
2015-02-02 20:43:22 -05:00
|
|
|
right5->WhenPressed(new StartCompressing());
|
|
|
|
right6->WhenPressed(new StopCompressing());
|
2015-02-03 15:20:10 -05:00
|
|
|
right7->WhenPressed(new Raise());
|
|
|
|
right8->WhenPressed(new Lower());
|
2015-01-17 12:21:16 -05:00
|
|
|
}
|
|
|
|
Joystick* OI::GetRightStick(){
|
|
|
|
return rightStick;
|
|
|
|
}
|
|
|
|
Joystick* OI::GetLeftStick(){
|
|
|
|
return leftStick;
|
2015-01-11 16:02:49 -05:00
|
|
|
}
|