Chief Delphi

Chief Delphi (http://www.chiefdelphi.com/forums/index.php)
-   Java (http://www.chiefdelphi.com/forums/forumdisplay.php?f=184)
-   -   RobotBuilder overwriting Java Commands (http://www.chiefdelphi.com/forums/showthread.php?t=143819)

Ben Wolsieffer 13-02-2016 20:14

RobotBuilder overwriting Java Commands
 
I updated the wpilib plugins, and the latest update seems to have introduced a major bug into RobotBuilder. If I modify the "extends Command" part of the class declaration for Commands, RobotBuilder overwrites the entire file. This bug is not triggered by adding comments to the beginning of the line, or by changing the visibility of the class. It only occurs when the base class is changed, or the class implements an interface.

I use a ParameterCommand base class for many of our commands, which allows me to set parameters from the SmartDashboard, so this bug is a very big problem for me. All the classes that extend ParameterCommand were overwritten the first time I regenerated the code after updating the Eclipse plugins.

There is also the possibility that this is not a new bug, because I may have not previously regenerated the code after adding the ParameterCommand
code.

Does anyone where I can get the earlier plugins, because the old versions are immediately removed from the update site when an update is released?

EDIT: This bug was not introduced in the latest update, it has been around for a while.

tcjinaz 18-02-2016 22:17

Re: RobotBuilder overwriting Java Commands
 
Quote:

Originally Posted by lopsided98 (Post 1539866)
I updated the wpilib plugins, and the latest update seems to have introduced a major bug into RobotBuilder. If I modify the "extends Command" part of the class declaration for Commands, RobotBuilder overwrites the entire file. This bug is not triggered by adding comments to the beginning of the line, or by changing the visibility of the class. It only occurs when the base class is changed, or the class implements an interface.

I use a ParameterCommand base class for many of our commands, which allows me to set parameters from the SmartDashboard, so this bug is a very big problem for me. All the classes that extend ParameterCommand were overwritten the first time I regenerated the code after updating the Eclipse plugins.

There is also the possibility that this is not a new bug, because I may have not previously regenerated the code after adding the ParameterCommand
code.

Does anyone where I can get the earlier plugins, because the old versions are immediately removed from the update site when an update is released?

EDIT: This bug was not introduced in the latest update, it has been around for a while.

Are you sure you are getting a proper save of the changes you made? We have found that if we do not force saves efore updating from RB, that we can lose changes we made in eclipse.

Tim

SamCarlberg 19-02-2016 12:57

Re: RobotBuilder overwriting Java Commands
 
This is intentional.

RobotBuilder sees that the type of the command is not what the program exported (i.e. you changed 'SomeCommand extends Command' to 'SomeCommand extends ParameterCommand') and overwrites it. If you're using custom command types, you should make a custom RobotBuilder extension for them instead of changing the type after the fact.

Joe Ross 22-02-2016 00:07

Re: RobotBuilder overwriting Java Commands
 
We ran into this today also. We just added an implements to a subsystem (keeping the same extends) and the subsystem was overwritten.

Sam, can you do an extension for a Command or Subsystem? When I was looking through the code, it didn't seem like you could.

SamCarlberg 22-02-2016 20:27

Re: RobotBuilder overwriting Java Commands
 
Quote:

Originally Posted by Joe Ross (Post 1544055)
We ran into this today also. We just added an implements to a subsystem (keeping the same extends) and the subsystem was overwritten.

Ah. Time to change a regex (or three)

Quote:

Originally Posted by Joe Ross (Post 1544055)
Sam, can you do an extension for a Command or Subsystem? When I was looking through the code, it didn't seem like you could.

You can make a custom component for any section. Check the documentation on extensions for details


All times are GMT -5. The time now is 17:31.

Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
Copyright © Chief Delphi