source: flair-src/tags/latest/lib/FlairFilter/src/Pid.cpp@ 456

Last change on this file since 456 was 247, checked in by Sanahuja Guillaume, 6 years ago

improve gcs disconnections

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