Hi, NF:
I’m not sure if you mean:
a) How to load your Lunacy code into WRW so you can work on it, download, etc.
b) You have the Lunacy code in WRW and are working on it, but WRW isn’t finding the right *.out file with which to download.
I’ll go through both these as we’ve got a lot of hits on this ChiefDelphi thread.
First of all, please backup your hard-earned Auton code we’ve all been working on. There’s a good way to do this, please get into the habit:
In WRW, click on your Auton project in the upper left Project Explorer panel, then do Project => Build Project. This will write any modified files to disc. Then, Project => Clean, “Clean Projects Selected Below”, and check your project, leave “Start a new build immediately” off, OK. This will remove some temp files you don’t care about.
Exit WRW.
Go to My Computer => C:\WindRiver\workspace. You should see a directory (folder) with the name of your project. If in doubt, click on one, open the *.cpp file with Notepad, and satisfy yourself that it’s the project in question.
In C:\WindRiver\workspace, right-click on that folder and select “Send to compressed (zipped) folder”. You’ll get a .zip folder as a result. Click on it and rename it something meaningful. Mine is “BuiltinDefaultCode.zip” and I’ll rename it “BuiltinDefaultCode20090910AutonWorks.zip”.
Right-click on that renamed .zip, Properties, Read-only, OK.
Plug in a USB drive and right-click on that .zip, Send to => Removable Disc. Or, burn it on a CD. Or, email it to your gmail. Somehow, MOVE A COPY OFF YOUR COMPUTER. Now, no matter how bad it gets, you have a copy of that project.
Now, I’m going to assume your Lunacy code is a whole folder like we worked on above. If not, skip down after the following prose.
If WRW is running, exit it.
Put the Lunacy code folder under that same folder, C:\WindRiver\workspace. Maybe it’s the same name as an existing folder, rename it to “Lunacy” or something else meaningful.
Start WRW. File => Import => Existing Projects Into Workspace, Next. Select Root Directory, Browse, find that folder, OK, Finish.
Now in the upper left WRW “Project Explorer” panel you should see that new project. Click on it and in the center panel, click on the .cpp tab and you should see the Lunacy source code. Project => Build Project and see if it compiles.
(If you have just the Lunacy .cpp file, with WRW not running go to the
workspace\ folder, copy and paste an existing project folder. Rename it to Lunacy, open it, and replace the .cpp file with your Lunacy cpp file. (This is hacky but I don’t know a better way to do it, does anyone else?) Then, start WRW and go to the Import step above and see if you get your Lunacy cpp file. If not, let us know. Sneaking files around this way isn’t the best way to do it.)
But, we’re not done, and we’re on to b), telling WRW which file to download to the 'bot. WRW doesn’t seem to understand it should find this file automatically, maybe the 2010 season version will. In WRW, click on your Lunacy project in the project-explorer panel, and do a build. Make sure it compiles cleanly because that’s the only way to get a .out file.
In WRW: Window => Preferences => First Downloader Preferences. First of all, make sure your team number is correct. Now, you have to find the location of the .out file. Mine is (ready?):
C:\WindRiver\workspace\BuiltinDefaultCode\PPC603gnu\BuiltinDefaultCode\Debug\BuiltinDefaultCode.out
Find the corresponding .out file that matches your project, OK.
If you aren’t sure or it doesn’t work, do this:
My Computer => C:\WindRiver and right-click the workspace folder => Search. Say:
*.out
in the “All or Part of the Filename” box, Search. (wait). You should have list with one or more files. Click on the Date Modified heading and it will sort it by age. Find the one with the timestamp that matches the WRW build you did. In the WRW First Downloader Preferences window, browse to that file, OK.
After all this, WRW FIRST => Download and it should download because you already have this working. Now, you’re in business.
As long as you (and everybody lurking) are still reading, please do this as a good practice. At the very bottom of your new source code, after the
START_ROBOT_CLASS(); call, paste in this paragraph:
#if 0
2009 09 10 Nightfighter
Imported the Lunacy code from 2009 season. Compiles and downloads.
TO DO:
Learn C++.
Wait for Kickoff.
Build the robot.
Win the Chairman's award.
#endif
This is a region where you can enter free-form text, I don’t want to explain the #if 0 stuff now. At the end of the day, or after making major code changes, WHICHEVER COMES FIRST, do the Project => Build Project, Project => Clean, exit WRW, zip, rename, read-only, and write it it to your USB drive or get it off that computer somehow. If it’s the end of the day and you have 89 syntax errors, just say you have 89 syntax errors in that text, Project => Clean, and do the rest. If you’ve made lots of changes but they’re not tested yet, or you’ve found bugs, write in the TO DO section something meaningful to this effect.
If you have a bad day and stuff that used to work doesn’t, you can go back to one of the .zip folders and just start from there, it may be simpler than trying to figure out what went wrong and try to back all the changes out.
These good practices, like the backups, using #defines, and adding comments, will save you time in the long run and especially if more than one programmer is working on the source. Please get in the habit now.
Gary