Changeset 15 in flair-src for trunk/lib/FlairFilter/src/TrajectoryGenerator1D.cpp
- Timestamp:
- Apr 8, 2016, 3:40:57 PM (9 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/lib/FlairFilter/src/TrajectoryGenerator1D.cpp
r10 r15 26 26 using namespace flair::gui; 27 27 28 namespace flair { namespace filter { 28 namespace flair { 29 namespace filter { 29 30 30 TrajectoryGenerator1D::TrajectoryGenerator1D(const LayoutPosition* position,string name,string unit) : IODevice(position->getLayout(),name) { 31 pimpl_=new TrajectoryGenerator1D_impl(this,position,name,unit); 32 AddDataToLog(pimpl_->output); 31 TrajectoryGenerator1D::TrajectoryGenerator1D(const LayoutPosition *position, 32 string name, string unit) 33 : IODevice(position->getLayout(), name) { 34 pimpl_ = new TrajectoryGenerator1D_impl(this, position, name, unit); 35 AddDataToLog(pimpl_->output); 33 36 } 34 37 35 TrajectoryGenerator1D::~TrajectoryGenerator1D() { 36 delete pimpl_; 38 TrajectoryGenerator1D::~TrajectoryGenerator1D() { delete pimpl_; } 39 40 cvmatrix *TrajectoryGenerator1D::Matrix(void) const { return pimpl_->output; } 41 42 void TrajectoryGenerator1D::StartTraj(float start_pos, float end_pos) { 43 pimpl_->StartTraj(start_pos, end_pos); 37 44 } 38 45 39 cvmatrix *TrajectoryGenerator1D::Matrix(void) const { 40 return pimpl_->output; 41 } 42 43 void TrajectoryGenerator1D::StartTraj(float start_pos,float end_pos) { 44 pimpl_->StartTraj(start_pos,end_pos); 45 } 46 47 //revoir l'interet du stop? 48 void TrajectoryGenerator1D::StopTraj(void) { 49 pimpl_->StopTraj(); 50 } 46 // revoir l'interet du stop? 47 void TrajectoryGenerator1D::StopTraj(void) { pimpl_->StopTraj(); } 51 48 52 49 bool TrajectoryGenerator1D::IsRunning(void) const { 53 if(pimpl_->is_started==true) { 54 if(pimpl_->is_finished==true) { 55 return false; 56 } else { 57 return true; 58 } 50 if (pimpl_->is_started == true) { 51 if (pimpl_->is_finished == true) { 52 return false; 59 53 } else { 60 return false;54 return true; 61 55 } 56 } else { 57 return false; 58 } 62 59 } 63 60 64 61 float TrajectoryGenerator1D::Position(void) const { 65 return pimpl_->output->Value(0,0);62 return pimpl_->output->Value(0, 0); 66 63 } 67 64 68 65 void TrajectoryGenerator1D::Reset(void) { 69 if(IsRunning()==false) {70 71 72 73 66 if (IsRunning() == false) { 67 pimpl_->Reset(); 68 } else { 69 Err("impossible while running\n"); 70 } 74 71 } 75 72 76 73 void TrajectoryGenerator1D::SetPositionOffset(float value) { 77 pimpl_->pos_off=value;74 pimpl_->pos_off = value; 78 75 } 79 76 80 77 float TrajectoryGenerator1D::Speed(void) const { 81 return pimpl_->output->Value(1,0);78 return pimpl_->output->Value(1, 0); 82 79 } 83 80 84 81 void TrajectoryGenerator1D::SetSpeedOffset(float value) { 85 pimpl_->vel_off=value;82 pimpl_->vel_off = value; 86 83 } 87 84 88 85 void TrajectoryGenerator1D::Update(Time time) { 89 90 86 pimpl_->Update(time); 87 ProcessUpdate(pimpl_->output); 91 88 } 92 89
Note:
See TracChangeset
for help on using the changeset viewer.