From 9e45373a74f3ca3d771d5b37f441dce66bc299ca Mon Sep 17 00:00:00 2001 From: Tyler Veness Date: Mon, 10 Jun 2019 22:03:15 -0700 Subject: [PATCH] Remove functions and classes deprecated for 2018 season (#1059) --- .../src/main/native/cpp/ControllerPower.cpp | 115 ------------ wpilibc/src/main/native/cpp/DriverStation.cpp | 16 +- wpilibc/src/main/native/cpp/GamepadBase.cpp | 12 -- wpilibc/src/main/native/cpp/Joystick.cpp | 40 +---- wpilibc/src/main/native/cpp/JoystickBase.cpp | 12 -- wpilibc/src/main/native/cpp/Timer.cpp | 4 +- wpilibc/src/main/native/cpp/Utility.cpp | 32 +--- .../cpp/livewindow/LiveWindowSendable.cpp | 24 --- .../cpp/smartdashboard/NamedSendable.cpp | 18 -- .../src/main/native/include/ControllerPower.h | 19 -- wpilibc/src/main/native/include/GamepadBase.h | 19 -- .../src/main/native/include/JoystickBase.h | 19 -- .../include/LiveWindow/LiveWindowSendable.h | 19 -- .../include/SmartDashboard/NamedSendable.h | 19 -- .../main/native/include/frc/ControllerPower.h | 152 ---------------- .../main/native/include/frc/DriverStation.h | 23 +-- .../src/main/native/include/frc/GamepadBase.h | 32 ---- .../src/main/native/include/frc/Joystick.h | 38 +--- .../main/native/include/frc/JoystickBase.h | 33 ---- wpilibc/src/main/native/include/frc/Timer.h | 12 +- wpilibc/src/main/native/include/frc/Utility.h | 45 +---- wpilibc/src/main/native/include/frc/WPILib.h | 3 +- .../frc/livewindow/LiveWindowSendable.h | 52 ------ .../frc/smartdashboard/NamedSendable.h | 34 ---- .../cpp/{RobotDriveTest.cpp => DriveTest.cpp} | 16 +- .../wpi/first/wpilibj/ControllerPower.java | 163 ------------------ .../edu/wpi/first/wpilibj/DriverStation.java | 37 +--- .../edu/wpi/first/wpilibj/GamepadBase.java | 70 -------- .../java/edu/wpi/first/wpilibj/Joystick.java | 68 +------- .../edu/wpi/first/wpilibj/JoystickBase.java | 46 ----- .../edu/wpi/first/wpilibj/NamedSendable.java | 43 ----- .../java/edu/wpi/first/wpilibj/Utility.java | 69 -------- .../first/wpilibj/livewindow/LiveWindow.java | 86 +-------- .../livewindow/LiveWindowSendable.java | 57 ------ .../smartdashboard/SmartDashboard.java | 5 +- .../wpilibj/AnalogPotentiometerTest.java | 4 +- .../{RobotDriveTest.java => DriveTest.java} | 8 +- .../wpi/first/wpilibj/WpiLibJTestSuite.java | 12 +- .../src/main/native/include/wpi/jni_util.h | 9 - 39 files changed, 34 insertions(+), 1451 deletions(-) delete mode 100644 wpilibc/src/main/native/cpp/ControllerPower.cpp delete mode 100644 wpilibc/src/main/native/cpp/GamepadBase.cpp delete mode 100644 wpilibc/src/main/native/cpp/JoystickBase.cpp delete mode 100644 wpilibc/src/main/native/cpp/livewindow/LiveWindowSendable.cpp delete mode 100644 wpilibc/src/main/native/cpp/smartdashboard/NamedSendable.cpp delete mode 100644 wpilibc/src/main/native/include/ControllerPower.h delete mode 100644 wpilibc/src/main/native/include/GamepadBase.h delete mode 100644 wpilibc/src/main/native/include/JoystickBase.h delete mode 100644 wpilibc/src/main/native/include/LiveWindow/LiveWindowSendable.h delete mode 100644 wpilibc/src/main/native/include/SmartDashboard/NamedSendable.h delete mode 100644 wpilibc/src/main/native/include/frc/ControllerPower.h delete mode 100644 wpilibc/src/main/native/include/frc/GamepadBase.h delete mode 100644 wpilibc/src/main/native/include/frc/JoystickBase.h delete mode 100644 wpilibc/src/main/native/include/frc/livewindow/LiveWindowSendable.h delete mode 100644 wpilibc/src/main/native/include/frc/smartdashboard/NamedSendable.h rename wpilibc/src/test/native/cpp/{RobotDriveTest.cpp => DriveTest.cpp} (95%) delete mode 100644 wpilibj/src/main/java/edu/wpi/first/wpilibj/ControllerPower.java delete mode 100644 wpilibj/src/main/java/edu/wpi/first/wpilibj/GamepadBase.java delete mode 100644 wpilibj/src/main/java/edu/wpi/first/wpilibj/JoystickBase.java delete mode 100644 wpilibj/src/main/java/edu/wpi/first/wpilibj/NamedSendable.java delete mode 100644 wpilibj/src/main/java/edu/wpi/first/wpilibj/Utility.java delete mode 100644 wpilibj/src/main/java/edu/wpi/first/wpilibj/livewindow/LiveWindowSendable.java rename wpilibjIntegrationTests/src/main/java/edu/wpi/first/wpilibj/{RobotDriveTest.java => DriveTest.java} (96%) diff --git a/wpilibc/src/main/native/cpp/ControllerPower.cpp b/wpilibc/src/main/native/cpp/ControllerPower.cpp deleted file mode 100644 index d3012eaeff..0000000000 --- a/wpilibc/src/main/native/cpp/ControllerPower.cpp +++ /dev/null @@ -1,115 +0,0 @@ -/*----------------------------------------------------------------------------*/ -/* Copyright (c) 2011-2018 FIRST. All Rights Reserved. */ -/* Open Source Software - may be modified and shared by FRC teams. The code */ -/* must be accompanied by the FIRST BSD license file in the root directory of */ -/* the project. */ -/*----------------------------------------------------------------------------*/ - -#include "frc/ControllerPower.h" - -#include - -#include -#include - -#include "frc/ErrorBase.h" - -using namespace frc; - -double ControllerPower::GetInputVoltage() { - int32_t status = 0; - double retVal = HAL_GetVinVoltage(&status); - wpi_setGlobalErrorWithContext(status, HAL_GetErrorMessage(status)); - return retVal; -} - -double ControllerPower::GetInputCurrent() { - int32_t status = 0; - double retVal = HAL_GetVinCurrent(&status); - wpi_setGlobalErrorWithContext(status, HAL_GetErrorMessage(status)); - return retVal; -} - -double ControllerPower::GetVoltage3V3() { - int32_t status = 0; - double retVal = HAL_GetUserVoltage3V3(&status); - wpi_setGlobalErrorWithContext(status, HAL_GetErrorMessage(status)); - return retVal; -} - -double ControllerPower::GetCurrent3V3() { - int32_t status = 0; - double retVal = HAL_GetUserCurrent3V3(&status); - wpi_setGlobalErrorWithContext(status, HAL_GetErrorMessage(status)); - return retVal; -} - -bool ControllerPower::GetEnabled3V3() { - int32_t status = 0; - bool retVal = HAL_GetUserActive3V3(&status); - wpi_setGlobalErrorWithContext(status, HAL_GetErrorMessage(status)); - return retVal; -} - -int ControllerPower::GetFaultCount3V3() { - int32_t status = 0; - int retVal = HAL_GetUserCurrentFaults3V3(&status); - wpi_setGlobalErrorWithContext(status, HAL_GetErrorMessage(status)); - return retVal; -} - -double ControllerPower::GetVoltage5V() { - int32_t status = 0; - double retVal = HAL_GetUserVoltage5V(&status); - wpi_setGlobalErrorWithContext(status, HAL_GetErrorMessage(status)); - return retVal; -} - -double ControllerPower::GetCurrent5V() { - int32_t status = 0; - double retVal = HAL_GetUserCurrent5V(&status); - wpi_setGlobalErrorWithContext(status, HAL_GetErrorMessage(status)); - return retVal; -} - -bool ControllerPower::GetEnabled5V() { - int32_t status = 0; - bool retVal = HAL_GetUserActive5V(&status); - wpi_setGlobalErrorWithContext(status, HAL_GetErrorMessage(status)); - return retVal; -} - -int ControllerPower::GetFaultCount5V() { - int32_t status = 0; - int retVal = HAL_GetUserCurrentFaults5V(&status); - wpi_setGlobalErrorWithContext(status, HAL_GetErrorMessage(status)); - return retVal; -} - -double ControllerPower::GetVoltage6V() { - int32_t status = 0; - double retVal = HAL_GetUserVoltage6V(&status); - wpi_setGlobalErrorWithContext(status, HAL_GetErrorMessage(status)); - return retVal; -} - -double ControllerPower::GetCurrent6V() { - int32_t status = 0; - double retVal = HAL_GetUserCurrent6V(&status); - wpi_setGlobalErrorWithContext(status, HAL_GetErrorMessage(status)); - return retVal; -} - -bool ControllerPower::GetEnabled6V() { - int32_t status = 0; - bool retVal = HAL_GetUserActive6V(&status); - wpi_setGlobalErrorWithContext(status, HAL_GetErrorMessage(status)); - return retVal; -} - -int ControllerPower::GetFaultCount6V() { - int32_t status = 0; - int retVal = HAL_GetUserCurrentFaults6V(&status); - wpi_setGlobalErrorWithContext(status, HAL_GetErrorMessage(status)); - return retVal; -} diff --git a/wpilibc/src/main/native/cpp/DriverStation.cpp b/wpilibc/src/main/native/cpp/DriverStation.cpp index 3c274c6ef0..1565653a1b 100644 --- a/wpilibc/src/main/native/cpp/DriverStation.cpp +++ b/wpilibc/src/main/native/cpp/DriverStation.cpp @@ -1,5 +1,5 @@ /*----------------------------------------------------------------------------*/ -/* Copyright (c) 2008-2018 FIRST. All Rights Reserved. */ +/* Copyright (c) 2008-2019 FIRST. All Rights Reserved. */ /* Open Source Software - may be modified and shared by FRC teams. The code */ /* must be accompanied by the FIRST BSD license file in the root directory of */ /* the project. */ @@ -368,20 +368,6 @@ bool DriverStation::IsFMSAttached() const { return controlWord.fmsAttached; } -bool DriverStation::IsSysActive() const { - int32_t status = 0; - bool retVal = HAL_GetSystemActive(&status); - wpi_setErrorWithContext(status, HAL_GetErrorMessage(status)); - return retVal; -} - -bool DriverStation::IsBrownedOut() const { - int32_t status = 0; - bool retVal = HAL_GetBrownedOut(&status); - wpi_setErrorWithContext(status, HAL_GetErrorMessage(status)); - return retVal; -} - std::string DriverStation::GetGameSpecificMessage() const { HAL_MatchInfo info; HAL_GetMatchInfo(&info); diff --git a/wpilibc/src/main/native/cpp/GamepadBase.cpp b/wpilibc/src/main/native/cpp/GamepadBase.cpp deleted file mode 100644 index 4eeb7442b2..0000000000 --- a/wpilibc/src/main/native/cpp/GamepadBase.cpp +++ /dev/null @@ -1,12 +0,0 @@ -/*----------------------------------------------------------------------------*/ -/* Copyright (c) 2016-2018 FIRST. All Rights Reserved. */ -/* Open Source Software - may be modified and shared by FRC teams. The code */ -/* must be accompanied by the FIRST BSD license file in the root directory of */ -/* the project. */ -/*----------------------------------------------------------------------------*/ - -#include "frc/GamepadBase.h" - -using namespace frc; - -GamepadBase::GamepadBase(int port) : GenericHID(port) {} diff --git a/wpilibc/src/main/native/cpp/Joystick.cpp b/wpilibc/src/main/native/cpp/Joystick.cpp index da77d94657..7c95a05803 100644 --- a/wpilibc/src/main/native/cpp/Joystick.cpp +++ b/wpilibc/src/main/native/cpp/Joystick.cpp @@ -1,5 +1,5 @@ /*----------------------------------------------------------------------------*/ -/* Copyright (c) 2008-2018 FIRST. All Rights Reserved. */ +/* Copyright (c) 2008-2019 FIRST. All Rights Reserved. */ /* Open Source Software - may be modified and shared by FRC teams. The code */ /* must be accompanied by the FIRST BSD license file in the root directory of */ /* the project. */ @@ -40,10 +40,6 @@ void Joystick::SetThrottleChannel(int channel) { m_axes[Axis::kThrottle] = channel; } -void Joystick::SetAxisChannel(AxisType axis, int channel) { - m_axes[axis] = channel; -} - int Joystick::GetXChannel() const { return m_axes[Axis::kX]; } int Joystick::GetYChannel() const { return m_axes[Axis::kY]; } @@ -70,24 +66,6 @@ double Joystick::GetThrottle() const { return GetRawAxis(m_axes[Axis::kThrottle]); } -double Joystick::GetAxis(AxisType axis) const { - switch (axis) { - case kXAxis: - return GetX(); - case kYAxis: - return GetY(); - case kZAxis: - return GetZ(); - case kTwistAxis: - return GetTwist(); - case kThrottleAxis: - return GetThrottle(); - default: - wpi_setWPIError(BadJoystickAxis); - return 0.0; - } -} - bool Joystick::GetTrigger() const { return GetRawButton(Button::kTrigger); } bool Joystick::GetTriggerPressed() { @@ -104,22 +82,6 @@ bool Joystick::GetTopPressed() { return GetRawButtonPressed(Button::kTop); } bool Joystick::GetTopReleased() { return GetRawButtonReleased(Button::kTop); } -Joystick* Joystick::GetStickForPort(int port) { - static std::array, DriverStation::kJoystickPorts> - joysticks{}; - auto stick = joysticks[port].get(); - if (stick == nullptr) { - joysticks[port] = std::make_unique(port); - stick = joysticks[port].get(); - } - return stick; -} - -bool Joystick::GetButton(ButtonType button) const { - int temp = button; - return GetRawButton(static_cast