|
|
|
![]() |
|
|||||||
|
||||||||
![]() |
| Thread Tools | Rate Thread | Display Modes |
|
#1
|
||||
|
||||
|
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 |
|
#2
|
||||
|
||||
|
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 |
|
#3
|
||||
|
||||
|
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~ |
|
#4
|
|||
|
|||
|
Re: Modifying .CPP files
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.
|
|
#5
|
||||
|
||||
|
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)
|
|
#6
|
|||||
|
|||||
|
Re: Modifying .CPP files
That is a perfect situation for creating a new class that inherits from RobotDrive.
|
|
#7
|
||||
|
||||
|
Re: Modifying .CPP files
I would create a class like such:
Code:
class OurRobotDrive:private RobotDrive
{
public:
void ourFunction(int speed)
{
...
}
}
|
|
#8
|
|||
|
|||
|
Re: Modifying .CPP files
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.
|
|
#9
|
||||
|
||||
|
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 |
|
#10
|
||||
|
||||
|
Re: Modifying .CPP files
i fixed it, i had placed a simi colon after my function declaration, a rookie mistake
![]() |
![]() |
| Thread Tools | |
| Display Modes | Rate This Thread |
|
|
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 |