source: flair-src/trunk/lib/FlairFilter/src/Pid.cpp @ 7

Last change on this file since 7 was 7, checked in by Sanahuja Guillaume, 5 years ago

filter and meta

File size: 1.1 KB
Line 
1//  created:    2011/05/01
2//  filename:   Pid.cpp
3//
4//  author:     Guillaume Sanahuja
5//              Copyright Heudiasyc UMR UTC/CNRS 7253
6//
7//  version:    $Id: $
8//
9//  purpose:    Class defining a PID
10//
11//
12/*********************************************************************/
13
14#include "Pid.h"
15#include "Pid_impl.h"
16#include <cvmatrix.h>
17#include <Layout.h>
18#include <LayoutPosition.h>
19
20using std::string;
21using namespace flair::core;
22using namespace flair::gui;
23
24namespace flair { namespace filter {
25
26Pid::Pid(const LayoutPosition* position,string name) : ControlLaw(position->getLayout(),name) {
27    pimpl_=new Pid_impl(this,position,name);
28}
29
30Pid::~Pid(void) {
31    delete pimpl_;
32}
33
34void Pid::UseDefaultPlot(const gui::LayoutPosition* position) {
35    pimpl_->UseDefaultPlot(position);
36}
37
38void Pid::Reset(void) {
39    pimpl_->i=0;
40    pimpl_->first_update=true;
41}
42
43void Pid::UpdateFrom(const io_data *data) {
44    pimpl_->UpdateFrom(data);
45    ProcessUpdate(output);
46}
47
48void Pid::SetValues(float p,float d) {
49    input->SetValue(0,0,p);
50    input->SetValue(1,0,d);
51}
52
53
54} // end namespace filter
55} // end namespace flair
Note: See TracBrowser for help on using the repository browser.