mirror of
https://github.com/wpilibsuite/allwpilib
synced 2026-06-19 00:41:43 +00:00
Store DriverStation-owned GenericHID and Gamepad instances in Java and C++, and expose the cached objects to Python bindings. Move hand-written command gamepad and joystick wrappers to compose cached CommandGenericHID instances plus typed HID wrappers, including a Python CommandGamepad. This will let us remove UserControls, while helping ensure that we don't have state smashing between GenericHID objects. Another bonus is without inheritance, intellisense will no longer show a bunch of annoying methods, and instead just what actually exists. --------- Co-authored-by: Peter Johnson <johnson.peter@gmail.com>
102 lines
3.1 KiB
C++
Generated
102 lines
3.1 KiB
C++
Generated
// Copyright (c) FIRST and other WPILib contributors.
|
|
// Open Source Software; you can modify and/or share it under the terms of
|
|
// the WPILib BSD license file in the root directory of this project.
|
|
|
|
// THIS FILE WAS AUTO-GENERATED BY ./wpilibc/generate_hids.py. DO NOT MODIFY
|
|
|
|
#include "wpi/simulation/NiDsStadiaControllerSim.hpp"
|
|
|
|
#include "wpi/driverstation/NiDsStadiaController.hpp"
|
|
|
|
using namespace wpi;
|
|
using namespace wpi::sim;
|
|
|
|
NiDsStadiaControllerSim::NiDsStadiaControllerSim(const NiDsStadiaController& joystick)
|
|
: GenericHIDSim{joystick.GetHID()} {
|
|
SetAxesMaximumIndex(4);
|
|
SetButtonsMaximumIndex(15);
|
|
SetPOVsMaximumIndex(1);
|
|
}
|
|
|
|
NiDsStadiaControllerSim::NiDsStadiaControllerSim(int port) : GenericHIDSim{port} {
|
|
SetAxesMaximumIndex(4);
|
|
SetButtonsMaximumIndex(15);
|
|
SetPOVsMaximumIndex(1);
|
|
}
|
|
|
|
void NiDsStadiaControllerSim::SetLeftX(double value) {
|
|
SetRawAxis(NiDsStadiaController::Axis::kLeftX, value);
|
|
}
|
|
|
|
void NiDsStadiaControllerSim::SetRightX(double value) {
|
|
SetRawAxis(NiDsStadiaController::Axis::kRightX, value);
|
|
}
|
|
|
|
void NiDsStadiaControllerSim::SetLeftY(double value) {
|
|
SetRawAxis(NiDsStadiaController::Axis::kLeftY, value);
|
|
}
|
|
|
|
void NiDsStadiaControllerSim::SetRightY(double value) {
|
|
SetRawAxis(NiDsStadiaController::Axis::kRightY, value);
|
|
}
|
|
|
|
void NiDsStadiaControllerSim::SetAButton(bool value) {
|
|
SetRawButton(NiDsStadiaController::Button::kA, value);
|
|
}
|
|
|
|
void NiDsStadiaControllerSim::SetBButton(bool value) {
|
|
SetRawButton(NiDsStadiaController::Button::kB, value);
|
|
}
|
|
|
|
void NiDsStadiaControllerSim::SetXButton(bool value) {
|
|
SetRawButton(NiDsStadiaController::Button::kX, value);
|
|
}
|
|
|
|
void NiDsStadiaControllerSim::SetYButton(bool value) {
|
|
SetRawButton(NiDsStadiaController::Button::kY, value);
|
|
}
|
|
|
|
void NiDsStadiaControllerSim::SetLeftBumperButton(bool value) {
|
|
SetRawButton(NiDsStadiaController::Button::kLeftBumper, value);
|
|
}
|
|
|
|
void NiDsStadiaControllerSim::SetRightBumperButton(bool value) {
|
|
SetRawButton(NiDsStadiaController::Button::kRightBumper, value);
|
|
}
|
|
|
|
void NiDsStadiaControllerSim::SetLeftStickButton(bool value) {
|
|
SetRawButton(NiDsStadiaController::Button::kLeftStick, value);
|
|
}
|
|
|
|
void NiDsStadiaControllerSim::SetRightStickButton(bool value) {
|
|
SetRawButton(NiDsStadiaController::Button::kRightStick, value);
|
|
}
|
|
|
|
void NiDsStadiaControllerSim::SetEllipsesButton(bool value) {
|
|
SetRawButton(NiDsStadiaController::Button::kEllipses, value);
|
|
}
|
|
|
|
void NiDsStadiaControllerSim::SetHamburgerButton(bool value) {
|
|
SetRawButton(NiDsStadiaController::Button::kHamburger, value);
|
|
}
|
|
|
|
void NiDsStadiaControllerSim::SetStadiaButton(bool value) {
|
|
SetRawButton(NiDsStadiaController::Button::kStadia, value);
|
|
}
|
|
|
|
void NiDsStadiaControllerSim::SetRightTriggerButton(bool value) {
|
|
SetRawButton(NiDsStadiaController::Button::kRightTrigger, value);
|
|
}
|
|
|
|
void NiDsStadiaControllerSim::SetLeftTriggerButton(bool value) {
|
|
SetRawButton(NiDsStadiaController::Button::kLeftTrigger, value);
|
|
}
|
|
|
|
void NiDsStadiaControllerSim::SetGoogleButton(bool value) {
|
|
SetRawButton(NiDsStadiaController::Button::kGoogle, value);
|
|
}
|
|
|
|
void NiDsStadiaControllerSim::SetFrameButton(bool value) {
|
|
SetRawButton(NiDsStadiaController::Button::kFrame, value);
|
|
}
|