From 5a094879b6c03bdb32debd3e9fc88d5d4f409a0d Mon Sep 17 00:00:00 2001 From: Kevin O'Connor Date: Tue, 2 Jun 2015 10:00:34 -0400 Subject: [PATCH] Add DisabledInit to C++ Command Based template. Move and modify comment on Java version. Fixes artf3840 Change-Id: I2371fc9cf64588e38f35b17715773604df6c2392 --- .../resources/templates/command-based/Robot.cpp | 9 +++++++++ .../templates/command-based/Robot.java | 17 +++++++++-------- 2 files changed, 18 insertions(+), 8 deletions(-) diff --git a/eclipse-plugins/edu.wpi.first.wpilib.plugins.cpp/resources/templates/command-based/Robot.cpp b/eclipse-plugins/edu.wpi.first.wpilib.plugins.cpp/resources/templates/command-based/Robot.cpp index 9fdbad39aa..04cfc17f3a 100644 --- a/eclipse-plugins/edu.wpi.first.wpilib.plugins.cpp/resources/templates/command-based/Robot.cpp +++ b/eclipse-plugins/edu.wpi.first.wpilib.plugins.cpp/resources/templates/command-based/Robot.cpp @@ -16,6 +16,15 @@ private: lw = LiveWindow::GetInstance(); } + /** + * This function is called once each time the robot enters Disabled mode. + * You can use it to reset any subsystem information you want to clear when + * the robot is disabled. + */ + void DisabledInit() + { + } + void DisabledPeriodic() { Scheduler::GetInstance()->Run(); diff --git a/eclipse-plugins/edu.wpi.first.wpilib.plugins.java/resources/templates/command-based/Robot.java b/eclipse-plugins/edu.wpi.first.wpilib.plugins.java/resources/templates/command-based/Robot.java index 28fe393c54..6073cf4d5d 100644 --- a/eclipse-plugins/edu.wpi.first.wpilib.plugins.java/resources/templates/command-based/Robot.java +++ b/eclipse-plugins/edu.wpi.first.wpilib.plugins.java/resources/templates/command-based/Robot.java @@ -30,6 +30,15 @@ public class Robot extends IterativeRobot { oi = new OI(); // instantiate the command used for the autonomous period autonomousCommand = new ExampleCommand(); + } + + /** + * This function is called once each time the robot enters Disabled mode. + * You can use it to reset any subsystem information you want to clear when + * the robot is disabled. + */ + public void disabledInit(){ + } public void disabledPeriodic() { @@ -56,14 +65,6 @@ public class Robot extends IterativeRobot { if (autonomousCommand != null) autonomousCommand.cancel(); } - /** - * This function is called when the disabled button is hit. - * You can use it to reset subsystems before shutting down. - */ - public void disabledInit(){ - - } - /** * This function is called periodically during operator control */