bhmotorext.h

Go to the documentation of this file.
00001 // ***************************************************************************
00002 //                           bhmotorext.h
00003 //
00004 //    copyright            : (C) 2004 by tbaier
00005 //    email                : tbaier@informatik.uni-hamburg.de
00006 // ***************************************************************************
00007 #ifndef BHMOTOREXT_H
00008 #define BHMOTOREXT_H
00009 
00010 #include "bhcontroller.h"
00011 #include "bhandext.h"
00012 #include "bhmotor.h"
00013 
00024 class BHMotorExt : public BHMotor
00025 {
00026  public:
00027 
00032    BHMotorExt(){};
00033 
00038   BHMotorExt(MotorFeedback *mf);
00039 
00046   BHMotorExt(MotorFeedback *mf, int speed);
00047 
00055   int getAbsPos() const;
00056 
00063   int getDeltaPos() const;
00064 
00067   void resetDeltaPos();
00068 
00069 #if 0
00070   int getDeltaPosS();
00071   void resetDeltaPosS();
00072   void resetDeltaPosS(const int value) ;
00073 #endif
00074 
00081     int getStrain() const;
00082 
00093   int getFeedbackVel() const;
00094 
00101   int posError() const;
00102 
00103  protected:
00104 
00107   MotorFeedback *FeedBack;
00108   
00109   int OldPos;
00110 
00111 
00112 };
00113 
00114 // ****************************
00115 // **                        **
00116 // ****************************
00117 inline BHMotorExt::BHMotorExt(MotorFeedback *mf) :
00118   BHMotor()
00119 {
00120   FeedBack = mf;
00121 }
00122 
00123 // ****************************
00124 // **                        **
00125 // ****************************
00126 inline BHMotorExt::BHMotorExt(MotorFeedback *mf, int speed) :
00127   BHMotor(speed)
00128 {
00129   FeedBack = mf;
00130 }
00131 
00132 // ****************************
00133 // **                        **
00134 // ****************************
00135 inline int BHMotorExt::getAbsPos() const
00136 {
00137   return int(FeedBack->loopFeedbackAbsPos);
00138 }
00139 
00140 // ****************************
00141 // **                        **
00142 // ****************************
00143 inline int BHMotorExt::getDeltaPos() const
00144 {
00145   return int(FeedBack->loopFeedbackDeltaPos);
00146 }
00147 
00148 
00149 // ****************************
00150 // **                        **
00151 // ****************************
00152 inline void BHMotorExt::resetDeltaPos() 
00153 {
00154   FeedBack->loopFeedbackDeltaPos = 0;
00155 }
00156 
00157 #if 0
00158 // ****************************
00159 // **                        **
00160 // ****************************
00161 inline int BHMotorExt::getDeltaPosS()
00162 {
00163   int result  = OldPos - int(FeedBack->loopFeedbackAbsPos);
00164   OldPos =  int(FeedBack->loopFeedbackAbsPos);
00165 
00166   return result;
00167 }
00168 
00169 
00170 // ****************************
00171 // **                        **
00172 // ****************************
00173 inline void BHMotorExt::resetDeltaPosS() 
00174 {
00175   OldPos =  int(FeedBack->loopFeedbackAbsPos);
00176 }
00177 
00178 
00179 // ****************************
00180 // **                        **
00181 // ****************************
00182 inline void BHMotorExt::resetDeltaPosS(const int value) 
00183 {
00184   OldPos =  value;
00185 }
00186 #endif
00187 
00188 
00189 // ****************************
00190 // **                        **
00191 // ****************************
00192 inline int BHMotorExt::getFeedbackVel() const
00193 {
00194   return int(FeedBack->loopFeedbackVel);
00195 }
00196 
00197 // ****************************
00198 // **                        **
00199 // ****************************
00200 inline int BHMotorExt::getStrain() const
00201 {
00202   return int(FeedBack->loopFeedbackStrain);
00203 }
00204 
00205 // ****************************
00206 // **                        **
00207 // ****************************
00208 inline int BHMotorExt::posError() const
00209 {
00210   return (DPos - (int)FeedBack->loopFeedbackAbsPos);
00211 }
00212 
00213 
00214 #endif //BHMOTOREXT_H


tams Tim Baier bhandlib v0.25
Generated Wed Aug 16 14:57:09 2006 by doxygen 1.4.7