Go to Post The ever popular Safety Tip Of The Day: Do Not Lick Wheel While In Motion The other popular one was: Remember Stupid Hurts - Joe J. [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

 
 
 
Thread Tools Rate Thread Display Modes
Prev Previous Post   Next Post Next
  #6   Spotlight this post!  
Unread 23-01-2011, 10:11
jwakeman jwakeman is offline
Registered User
FRC #0063 (Red Barons)
Team Role: Mentor
 
Join Date: Jan 2011
Rookie Year: 2010
Location: 16510
Posts: 182
jwakeman is just really nicejwakeman is just really nicejwakeman is just really nicejwakeman is just really nicejwakeman is just really nice
Re: Encoder as PIDSource

Thanks for the help everyone. I put together the subclass that Alexander described and will post it here in case it helps anyone else. It does compile but hasn't been tested in any way.

PIDEncoder.h

Code:
#include "Encoder.h"
#include "PIDSource.h"

class PIDEncoder : public Encoder, PIDSource
{
public:
	//constructor
	PIDEncoder(UINT32 aSlot, UINT32 aChannel,
			UINT32 bSlot, UINT32 bChannel,
			bool reverseDirection, EncodingType encodingType);
	
	//destructor
	~PIDEncoder();
	
	//virtual from PIDSource
	double PIDGet();
	
private:
	
};

PIDEncoder.cpp

Code:
#include "PIDEncoder.h"

//constructor
PIDEncoder::PIDEncoder(UINT32 aSlot, UINT32 aChannel,
		UINT32 bSlot, UINT32 bChannel,
		bool reverseDirection, EncodingType encodingType) : Encoder(aSlot,aChannel,bSlot,bChannel,reverseDirection,encodingType)
{

}
	
//destructor
PIDEncoder::~PIDEncoder()
{
	
}
	
//virtual from PIDSource
double PIDEncoder::PIDGet()
{
	return this->GetDistance();
}
Reply With Quote
 


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 18:07.

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