001// Copyright (c) FIRST and other WPILib contributors. 002// Open Source Software; you can modify and/or share it under the terms of 003// the WPILib BSD license file in the root directory of this project. 004 005// THIS FILE WAS AUTO-GENERATED BY ./wpilibj/generate_hids.py. DO NOT MODIFY 006 007package edu.wpi.first.wpilibj.simulation; 008 009import edu.wpi.first.wpilibj.StadiaController; 010 011/** Class to control a simulated Stadia controller. */ 012public class StadiaControllerSim extends GenericHIDSim { 013 /** 014 * Constructs from a StadiaController object. 015 * 016 * @param joystick controller to simulate 017 */ 018 @SuppressWarnings("this-escape") 019 public StadiaControllerSim(StadiaController joystick) { 020 super(joystick); 021 setAxisCount(4); 022 setButtonCount(15); 023 setPOVCount(1); 024 } 025 026 /** 027 * Constructs from a joystick port number. 028 * 029 * @param port port number 030 */ 031 @SuppressWarnings("this-escape") 032 public StadiaControllerSim(int port) { 033 super(port); 034 setAxisCount(4); 035 setButtonCount(15); 036 setPOVCount(1); 037 } 038 039 /** 040 * Change the left X value of the controller's joystick. 041 * 042 * @param value the new value 043 */ 044 public void setLeftX(double value) { 045 setRawAxis(StadiaController.Axis.kLeftX.value, value); 046 } 047 048 /** 049 * Change the right X value of the controller's joystick. 050 * 051 * @param value the new value 052 */ 053 public void setRightX(double value) { 054 setRawAxis(StadiaController.Axis.kRightX.value, value); 055 } 056 057 /** 058 * Change the left Y value of the controller's joystick. 059 * 060 * @param value the new value 061 */ 062 public void setLeftY(double value) { 063 setRawAxis(StadiaController.Axis.kLeftY.value, value); 064 } 065 066 /** 067 * Change the right Y value of the controller's joystick. 068 * 069 * @param value the new value 070 */ 071 public void setRightY(double value) { 072 setRawAxis(StadiaController.Axis.kRightY.value, value); 073 } 074 075 /** 076 * Change the value of the A button on the controller. 077 * 078 * @param value the new value 079 */ 080 public void setAButton(boolean value) { 081 setRawButton(StadiaController.Button.kA.value, value); 082 } 083 084 /** 085 * Change the value of the B button on the controller. 086 * 087 * @param value the new value 088 */ 089 public void setBButton(boolean value) { 090 setRawButton(StadiaController.Button.kB.value, value); 091 } 092 093 /** 094 * Change the value of the X button on the controller. 095 * 096 * @param value the new value 097 */ 098 public void setXButton(boolean value) { 099 setRawButton(StadiaController.Button.kX.value, value); 100 } 101 102 /** 103 * Change the value of the Y button on the controller. 104 * 105 * @param value the new value 106 */ 107 public void setYButton(boolean value) { 108 setRawButton(StadiaController.Button.kY.value, value); 109 } 110 111 /** 112 * Change the value of the left bumper button on the controller. 113 * 114 * @param value the new value 115 */ 116 public void setLeftBumperButton(boolean value) { 117 setRawButton(StadiaController.Button.kLeftBumper.value, value); 118 } 119 120 /** 121 * Change the value of the right bumper button on the controller. 122 * 123 * @param value the new value 124 */ 125 public void setRightBumperButton(boolean value) { 126 setRawButton(StadiaController.Button.kRightBumper.value, value); 127 } 128 129 /** 130 * Change the value of the left stick button on the controller. 131 * 132 * @param value the new value 133 */ 134 public void setLeftStickButton(boolean value) { 135 setRawButton(StadiaController.Button.kLeftStick.value, value); 136 } 137 138 /** 139 * Change the value of the right stick button on the controller. 140 * 141 * @param value the new value 142 */ 143 public void setRightStickButton(boolean value) { 144 setRawButton(StadiaController.Button.kRightStick.value, value); 145 } 146 147 /** 148 * Change the value of the ellipses button on the controller. 149 * 150 * @param value the new value 151 */ 152 public void setEllipsesButton(boolean value) { 153 setRawButton(StadiaController.Button.kEllipses.value, value); 154 } 155 156 /** 157 * Change the value of the hamburger button on the controller. 158 * 159 * @param value the new value 160 */ 161 public void setHamburgerButton(boolean value) { 162 setRawButton(StadiaController.Button.kHamburger.value, value); 163 } 164 165 /** 166 * Change the value of the stadia button on the controller. 167 * 168 * @param value the new value 169 */ 170 public void setStadiaButton(boolean value) { 171 setRawButton(StadiaController.Button.kStadia.value, value); 172 } 173 174 /** 175 * Change the value of the right trigger button on the controller. 176 * 177 * @param value the new value 178 */ 179 public void setRightTriggerButton(boolean value) { 180 setRawButton(StadiaController.Button.kRightTrigger.value, value); 181 } 182 183 /** 184 * Change the value of the left trigger button on the controller. 185 * 186 * @param value the new value 187 */ 188 public void setLeftTriggerButton(boolean value) { 189 setRawButton(StadiaController.Button.kLeftTrigger.value, value); 190 } 191 192 /** 193 * Change the value of the google button on the controller. 194 * 195 * @param value the new value 196 */ 197 public void setGoogleButton(boolean value) { 198 setRawButton(StadiaController.Button.kGoogle.value, value); 199 } 200 201 /** 202 * Change the value of the frame button on the controller. 203 * 204 * @param value the new value 205 */ 206 public void setFrameButton(boolean value) { 207 setRawButton(StadiaController.Button.kFrame.value, value); 208 } 209}