Go to Post Learn the theory in the classroom and pick up the practical through clubs (FIRST, mini Baja, SAE)... you really need the scale balanced in the middle - Greg Needel [more]
Home
Go Back   Chief Delphi > Technical > Programming
CD-Media   CD-Spy  
portal register members calendar search Today's Posts Mark Forums Read FAQ rules

 
Reply
Thread Tools Rate Thread Display Modes
  #1   Spotlight this post!  
Unread 08-01-2017, 22:13
tomy tomy is offline
Registered User
FRC #3038 (I.C.E. Robotics)
Team Role: Mentor
 
Join Date: Jan 2009
Rookie Year: 2009
Location: Stacy, Minnesota
Posts: 503
tomy has a spectacular aura abouttomy has a spectacular aura about
RobotBuilder Deleting Code

I am using robot builder to learn command based programming but whenever I regenerate code it deletes all the code I have written. I am writing code outside of the autogenerated code area. Any suggestions?
Reply With Quote
  #2   Spotlight this post!  
Unread 08-01-2017, 22:16
engunneer's Avatar
engunneer engunneer is offline
Alumni turned Mentor
AKA: Branden Gunn
FRC #4761
Team Role: Mentor
 
Join Date: Jan 2007
Rookie Year: 1996
Location: Reading, MA
Posts: 868
engunneer has a reputation beyond reputeengunneer has a reputation beyond reputeengunneer has a reputation beyond reputeengunneer has a reputation beyond reputeengunneer has a reputation beyond reputeengunneer has a reputation beyond reputeengunneer has a reputation beyond reputeengunneer has a reputation beyond reputeengunneer has a reputation beyond reputeengunneer has a reputation beyond reputeengunneer has a reputation beyond repute
Re: RobotBuilder Deleting Code

is there an option in robotbuilder to build fresh vs doing an update? does it overwrite your code in all files or just some?
__________________
Student FRC23 (1996-1999), Mentor FRC246 (2000), Mentor FRC1318 (2007-2009), Mentor FRC93 (2011), Mentor FRC2151 (2012), Mentor FRC23 (2013), Mentor FRC4761 (2014-2017)
1998 - National Chairman's Award and Woodie Flowers Award (FRC23, Mike Bastoni ) | 2007 - PNW SF (488, 1595) | 2008 - Oregon RCA - Seattle #2 Seed, SF (488, 1696) | 2009 - Oregon #1 Seed, Winners (1983, 2635) - Seattle SF (945, 2865) - Galileo #2 Seed, SF (973, 25) | 2012 Midwest F (111, 71) | 2014 RIDE Winners (78, 125), Inspector - NEU #24, QF (3479, 3958) - NECMP #35 | 2015 Reading #11, SF (1058, 190), Inspector - RIDE #17, QF(4055, 5494), Inspector - NECMP #57 | 2016 Reading #4, SF (133, 4474), DCA, Inspector - Ride #22, SF (1735, 2067), Creativity, Inspector - NECMP #48, RCA - Archimedes
Reply With Quote
  #3   Spotlight this post!  
Unread 08-01-2017, 22:20
tomy tomy is offline
Registered User
FRC #3038 (I.C.E. Robotics)
Team Role: Mentor
 
Join Date: Jan 2009
Rookie Year: 2009
Location: Stacy, Minnesota
Posts: 503
tomy has a spectacular aura abouttomy has a spectacular aura about
Re: RobotBuilder Deleting Code

There aren't any settings in roboBuilder that I can find. It only overwrites the code that it generates. So if it generates a command "Open Gripper" and I put custom code in it then regenerate it, it wipes the code.
Reply With Quote
  #4   Spotlight this post!  
Unread 08-01-2017, 22:23
SamCarlberg's Avatar
SamCarlberg SamCarlberg is offline
GRIP, WPILib. 2084 alum
FRC #2084
Team Role: Mentor
 
Join Date: Nov 2015
Rookie Year: 2009
Location: MA
Posts: 136
SamCarlberg is a splendid one to beholdSamCarlberg is a splendid one to beholdSamCarlberg is a splendid one to beholdSamCarlberg is a splendid one to beholdSamCarlberg is a splendid one to beholdSamCarlberg is a splendid one to beholdSamCarlberg is a splendid one to behold
Re: RobotBuilder Deleting Code

Where is your code in the file? Can you post a screenshot of the file in Eclipse before and after you generate code?
__________________
WPILib
GRIP, RobotBuilder
Reply With Quote
  #5   Spotlight this post!  
Unread 08-01-2017, 22:59
tomy tomy is offline
Registered User
FRC #3038 (I.C.E. Robotics)
Team Role: Mentor
 
Join Date: Jan 2009
Rookie Year: 2009
Location: Stacy, Minnesota
Posts: 503
tomy has a spectacular aura abouttomy has a spectacular aura about
Re: RobotBuilder Deleting Code

There are two pictures. One is before the auto gen and one is after the auto gen. The before pic has the code I added.
Attached Thumbnails
Click image for larger version

Name:	before.PNG
Views:	28
Size:	52.3 KB
ID:	21501  Click image for larger version

Name:	after.PNG
Views:	20
Size:	44.5 KB
ID:	21502  
Reply With Quote
  #6   Spotlight this post!  
Unread 08-01-2017, 23:53
cpapplefamily cpapplefamily is offline
Registered User
FRC #3244 (Granite City Gearheads)
Team Role: Mentor
 
Join Date: May 2015
Rookie Year: 2015
Location: Minnesota
Posts: 256
cpapplefamily has a spectacular aura aboutcpapplefamily has a spectacular aura about
Re: RobotBuilder Deleting Code

Quote:
Originally Posted by tomy View Post
There are two pictures. One is before the auto gen and one is after the auto gen. The before pic has the code I added.
Did you save your Eclipse project before robotbuilder generates the code? Try Ctrl-Shft-S in eclipse before going to robotbuilder. Or Ctrl-Shft-W and close all tabs and saving them if prompted before RobotBuilder.

That Step got me every time in the beginning. I now teach the new programmers this lesson but I warn them they will forget and learn the hard way. Its like saving before downloading or stepping away from the PC. The time your forget to the computer will freeze up.

I suspect RobotBuilder opens the file(currently saved on the disk) writes the changes then closes it. Eclipse now see the change and refreshes with the data on the disk that never had your edits.

Last edited by cpapplefamily : 09-01-2017 at 00:03.
Reply With Quote
  #7   Spotlight this post!  
Unread 09-01-2017, 00:15
Joe Ross's Avatar Unsung FIRST Hero
Joe Ross Joe Ross is offline
Registered User
FRC #0330 (Beachbots)
Team Role: Engineer
 
Join Date: Jun 2001
Rookie Year: 1997
Location: Los Angeles, CA
Posts: 8,590
Joe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond repute
Re: RobotBuilder Deleting Code

I can't duplicate this. Run robot builder from the command line and post the output. That would say whether RobotBuilder has incorrectly decided to overwrite the file or not.
Reply With Quote
  #8   Spotlight this post!  
Unread 09-01-2017, 08:43
Xanawatt Xanawatt is offline
Registered User
FRC #1024
 
Join Date: May 2015
Location: Indianapolis, Indiana
Posts: 24
Xanawatt is an unknown quantity at this point
Re: RobotBuilder Deleting Code

So, when you generate a project with robot builder, it should give you comments along the lines of:
Code:
//START ROBOTBUILDER
and //END ROBOTBUILDER
Anything between these two comments will be overwritten when you regenerate with Robotbuilder. If it is deleting code in other locations, then this is a bug.
Reply With Quote
Reply


Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump


All times are GMT -5. The time now is 23:54.

The Chief Delphi Forums are sponsored by Innovation First International, Inc.


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