Go to Post I dont think it matters too much what you do, as long as you do something that lets you apply what you're learning in class. - MrForbes [more]
Home
Go Back   Chief Delphi > Technical > Programming > C/C++
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 12-02-2009, 22:28
xtreampb's Avatar
xtreampb xtreampb is offline
Lead Programmer 2642
FRC #2642 (Pitt Pirates)
Team Role: Programmer
 
Join Date: Feb 2009
Rookie Year: 2009
Location: Snow Hill
Posts: 21
xtreampb is an unknown quantity at this point
Send a message via AIM to xtreampb Send a message via Yahoo to xtreampb
Modifying .CPP files

Hey guys. I want to modify the RobotDrive.CPP file but i can't find it in the wind river directory. I found the .h File but I need to add a member function to the .CPP file. Can anyone give me the directory path please thanks

~Xtreampb~

Pitt Pirates 2642
Reply With Quote
  #2   Spotlight this post!  
Unread 12-02-2009, 22:30
wt200999's Avatar
wt200999 wt200999 is offline
Texas Instruments
AKA: Will Toth
FRC #3005 (Robochargers)
Team Role: Mentor
 
Join Date: Mar 2006
Rookie Year: 2004
Location: Dallas, Texas
Posts: 323
wt200999 has much to be proud ofwt200999 has much to be proud ofwt200999 has much to be proud ofwt200999 has much to be proud ofwt200999 has much to be proud ofwt200999 has much to be proud ofwt200999 has much to be proud ofwt200999 has much to be proud ofwt200999 has much to be proud of
Send a message via MSN to wt200999
Re: Modifying .CPP files

You have to download the library from wpi site, the source that comes with windriver is all pre compiled

http://first.wpi.edu/FRC/frcupdates.html
__________________
Programming in LabVIEW? Try VI Snippets!

FIRST LEGO League 2004 - 2005
FRC Team 870 Student 2006 - 2009
FRC Team 3005 Mentor 2013 -
Reply With Quote
  #3   Spotlight this post!  
Unread 12-02-2009, 22:36
xtreampb's Avatar
xtreampb xtreampb is offline
Lead Programmer 2642
FRC #2642 (Pitt Pirates)
Team Role: Programmer
 
Join Date: Feb 2009
Rookie Year: 2009
Location: Snow Hill
Posts: 21
xtreampb is an unknown quantity at this point
Send a message via AIM to xtreampb Send a message via Yahoo to xtreampb
Re: Modifying .CPP files

I have the updates and have downloaded the source code. Are you saying that i have to go to where i downloaded the source code, codify the .CPP and the .H files then re-install them?

Thanks

~Xtreampb~
Reply With Quote
  #4   Spotlight this post!  
Unread 12-02-2009, 23:52
TimCraig TimCraig is offline
Registered User
AKA: Tim Craig
no team
 
Join Date: Aug 2004
Rookie Year: 2003
Location: San Jose, CA
Posts: 221
TimCraig is a splendid one to beholdTimCraig is a splendid one to beholdTimCraig is a splendid one to beholdTimCraig is a splendid one to beholdTimCraig is a splendid one to beholdTimCraig is a splendid one to beholdTimCraig is a splendid one to behold
Re: Modifying .CPP files

Quote:
Originally Posted by xtreampb View Post
Hey guys. I want to modify the RobotDrive.CPP file but i can't find it in the wind river directory. I found the .h File but I need to add a member function to the .CPP file. Can anyone give me the directory path please thanks

~Xtreampb~

Pitt Pirates 2642
Depending on "how" you want to change it, a good way would be to derive your own new class from RobotDrive and either override the methods you want to behave differently and/or add new methods and data to it. This is the beauty of object oriented programming.
Reply With Quote
  #5   Spotlight this post!  
Unread 12-02-2009, 23:56
xtreampb's Avatar
xtreampb xtreampb is offline
Lead Programmer 2642
FRC #2642 (Pitt Pirates)
Team Role: Programmer
 
Join Date: Feb 2009
Rookie Year: 2009
Location: Snow Hill
Posts: 21
xtreampb is an unknown quantity at this point
Send a message via AIM to xtreampb Send a message via Yahoo to xtreampb
Re: Modifying .CPP files

I just want to add a single function to the already used RobotDrive class. I am using one of the previous functions in it, arcade drive, but i want to use a single drive function that uses a single PWM channel (we have more than we need ,24, so i was told i can use as many as i wanted) Even if i wanted to override the current one, i dont know how to do this in wind river. I can do it using Visual C++ (another question i have was could i export these libararys to VC++ libary colection but that is another topic for later)
__________________
~Xtreampb~

Pitt Pirates 2642

Lead Programmer
Reply With Quote
  #6   Spotlight this post!  
Unread 13-02-2009, 00:34
Alan Anderson's Avatar
Alan Anderson Alan Anderson is offline
Software Architect
FRC #0045 (TechnoKats)
Team Role: Mentor
 
Join Date: Feb 2004
Rookie Year: 2004
Location: Kokomo, Indiana
Posts: 9,112
Alan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond repute
Re: Modifying .CPP files

Quote:
Originally Posted by xtreampb View Post
I just want to add a single function to the already used RobotDrive class.
That is a perfect situation for creating a new class that inherits from RobotDrive.
Reply With Quote
  #7   Spotlight this post!  
Unread 13-02-2009, 15:23
byteit101's Avatar
byteit101 byteit101 is offline
WPILib maintainer (WPI)
AKA: Patrick Plenefisch
no team (The Cat Attack (Formerly))
Team Role: Programmer
 
Join Date: Jan 2009
Rookie Year: 2009
Location: Worcester
Posts: 699
byteit101 is a glorious beacon of lightbyteit101 is a glorious beacon of lightbyteit101 is a glorious beacon of lightbyteit101 is a glorious beacon of lightbyteit101 is a glorious beacon of lightbyteit101 is a glorious beacon of light
Re: Modifying .CPP files

I would create a class like such:
Code:
class OurRobotDrive:private RobotDrive
{
public:
void ourFunction(int speed)
{
...
}
}
and you can still have the other functions!
__________________
Bubble Wrap: programmers rewards
Watchdog.Kill();
printf("Watchdog is Dead, Celebrate!");
How to make a self aware robot: while (∞) cout<<(sqrt(-∞)/-0);
Previously FRC 451 (The Cat Attack)
Now part of the class of 2016 at WPI & helping on WPILib
Reply With Quote
  #8   Spotlight this post!  
Unread 15-02-2009, 00:40
TimCraig TimCraig is offline
Registered User
AKA: Tim Craig
no team
 
Join Date: Aug 2004
Rookie Year: 2003
Location: San Jose, CA
Posts: 221
TimCraig is a splendid one to beholdTimCraig is a splendid one to beholdTimCraig is a splendid one to beholdTimCraig is a splendid one to beholdTimCraig is a splendid one to beholdTimCraig is a splendid one to beholdTimCraig is a splendid one to behold
Re: Modifying .CPP files

Quote:
Originally Posted by byteit101 View Post
I would create a class like such:
Code:
class OurRobotDrive:private RobotDrive
{
public:
void ourFunction(int speed)
{
...
}
}
and you can still have the other functions!
Generally, if you want all the public members in the base class visible for the "is-a" relationship, you would use public inheritance. You don't see private inheritance used much.
Reply With Quote
  #9   Spotlight this post!  
Unread 24-02-2009, 22:24
xtreampb's Avatar
xtreampb xtreampb is offline
Lead Programmer 2642
FRC #2642 (Pitt Pirates)
Team Role: Programmer
 
Join Date: Feb 2009
Rookie Year: 2009
Location: Snow Hill
Posts: 21
xtreampb is an unknown quantity at this point
Send a message via AIM to xtreampb Send a message via Yahoo to xtreampb
Re: Modifying .CPP files

ok thanks for all of yall's help. I built my class and have implemented it into the code, unfortuanatly i wasn't able to test the code before we had to ship it off but i have ran into an error with my deconstructor

Code:
error: declaration of 'Our_Drive::~Our_Drive()' outside of class is not definition
i dont have an error about the deconstructor in my header file, just in the CPP file. how do i fix this?
__________________
~Xtreampb~

Pitt Pirates 2642

Lead Programmer
Reply With Quote
  #10   Spotlight this post!  
Unread 26-02-2009, 22:30
xtreampb's Avatar
xtreampb xtreampb is offline
Lead Programmer 2642
FRC #2642 (Pitt Pirates)
Team Role: Programmer
 
Join Date: Feb 2009
Rookie Year: 2009
Location: Snow Hill
Posts: 21
xtreampb is an unknown quantity at this point
Send a message via AIM to xtreampb Send a message via Yahoo to xtreampb
Re: Modifying .CPP files

i fixed it, i had placed a simi colon after my function declaration, a rookie mistake
__________________
~Xtreampb~

Pitt Pirates 2642

Lead Programmer
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

Similar Threads
Thread Thread Starter Forum Replies Last Post
Location of WPI Library cpp files attached to Windriver marccenter C/C++ 5 11-02-2009 12:47
Bug (?) in Target.cpp in TwoColorTrackingDemo Mike Mahar C/C++ 0 02-02-2009 09:48
Need Help Locating .h and .cpp files jkjohnson Programming 0 30-01-2009 09:00
NiVision.cpp nickmagus Programming 4 26-01-2009 08:55
CAD Help needed. Mech Desktop 6 files backwards to AutoCAD 14? (2d files) Elgin Clock Inventor 0 30-08-2004 23:06


All times are GMT -5. The time now is 02:40.

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