mirror of
https://github.com/wpilibsuite/allwpilib
synced 2026-06-21 01:01:43 +00:00
[wpilib,commands] Use Jinja to generate HID classes (#6274)
This commit is contained in:
89
wpilibc/src/generated/main/native/cpp/simulation/XboxControllerSim.cpp
generated
Normal file
89
wpilibc/src/generated/main/native/cpp/simulation/XboxControllerSim.cpp
generated
Normal file
@@ -0,0 +1,89 @@
|
||||
// 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 "frc/simulation/XboxControllerSim.h"
|
||||
|
||||
#include "frc/XboxController.h"
|
||||
|
||||
using namespace frc;
|
||||
using namespace frc::sim;
|
||||
|
||||
XboxControllerSim::XboxControllerSim(const XboxController& joystick)
|
||||
: GenericHIDSim{joystick} {
|
||||
SetAxisCount(6);
|
||||
SetButtonCount(10);
|
||||
SetPOVCount(1);
|
||||
}
|
||||
|
||||
XboxControllerSim::XboxControllerSim(int port) : GenericHIDSim{port} {
|
||||
SetAxisCount(6);
|
||||
SetButtonCount(10);
|
||||
SetPOVCount(1);
|
||||
}
|
||||
|
||||
void XboxControllerSim::SetLeftX(double value) {
|
||||
SetRawAxis(XboxController::Axis::kLeftX, value);
|
||||
}
|
||||
|
||||
void XboxControllerSim::SetRightX(double value) {
|
||||
SetRawAxis(XboxController::Axis::kRightX, value);
|
||||
}
|
||||
|
||||
void XboxControllerSim::SetLeftY(double value) {
|
||||
SetRawAxis(XboxController::Axis::kLeftY, value);
|
||||
}
|
||||
|
||||
void XboxControllerSim::SetRightY(double value) {
|
||||
SetRawAxis(XboxController::Axis::kRightY, value);
|
||||
}
|
||||
|
||||
void XboxControllerSim::SetLeftTriggerAxis(double value) {
|
||||
SetRawAxis(XboxController::Axis::kLeftTrigger, value);
|
||||
}
|
||||
|
||||
void XboxControllerSim::SetRightTriggerAxis(double value) {
|
||||
SetRawAxis(XboxController::Axis::kRightTrigger, value);
|
||||
}
|
||||
|
||||
void XboxControllerSim::SetAButton(bool value) {
|
||||
SetRawButton(XboxController::Button::kA, value);
|
||||
}
|
||||
|
||||
void XboxControllerSim::SetBButton(bool value) {
|
||||
SetRawButton(XboxController::Button::kB, value);
|
||||
}
|
||||
|
||||
void XboxControllerSim::SetXButton(bool value) {
|
||||
SetRawButton(XboxController::Button::kX, value);
|
||||
}
|
||||
|
||||
void XboxControllerSim::SetYButton(bool value) {
|
||||
SetRawButton(XboxController::Button::kY, value);
|
||||
}
|
||||
|
||||
void XboxControllerSim::SetLeftBumperButton(bool value) {
|
||||
SetRawButton(XboxController::Button::kLeftBumper, value);
|
||||
}
|
||||
|
||||
void XboxControllerSim::SetRightBumperButton(bool value) {
|
||||
SetRawButton(XboxController::Button::kRightBumper, value);
|
||||
}
|
||||
|
||||
void XboxControllerSim::SetBackButton(bool value) {
|
||||
SetRawButton(XboxController::Button::kBack, value);
|
||||
}
|
||||
|
||||
void XboxControllerSim::SetStartButton(bool value) {
|
||||
SetRawButton(XboxController::Button::kStart, value);
|
||||
}
|
||||
|
||||
void XboxControllerSim::SetLeftStickButton(bool value) {
|
||||
SetRawButton(XboxController::Button::kLeftStick, value);
|
||||
}
|
||||
|
||||
void XboxControllerSim::SetRightStickButton(bool value) {
|
||||
SetRawButton(XboxController::Button::kRightStick, value);
|
||||
}
|
||||
Reference in New Issue
Block a user