[10] | 1 | // %flair:license{
|
---|
[15] | 2 | // This file is part of the Flair framework distributed under the
|
---|
| 3 | // CECILL-C License, Version 1.0.
|
---|
[10] | 4 | // %flair:license}
|
---|
[7] | 5 | // created: 2013/12/10
|
---|
| 6 | // filename: ButterworthLowPass.cpp
|
---|
| 7 | //
|
---|
| 8 | // author: Guillaume Sanahuja
|
---|
| 9 | // Copyright Heudiasyc UMR UTC/CNRS 7253
|
---|
| 10 | //
|
---|
| 11 | // version: $Id: $
|
---|
| 12 | //
|
---|
| 13 | // purpose: Class defining a Butterworth low pass filter
|
---|
| 14 | //
|
---|
| 15 | //
|
---|
| 16 | /*********************************************************************/
|
---|
| 17 |
|
---|
| 18 | #include "ButterworthLowPass.h"
|
---|
| 19 | #include "ButterworthLowPass_impl.h"
|
---|
[214] | 20 | #include <Matrix.h>
|
---|
[7] | 21 | #include <Layout.h>
|
---|
| 22 | #include <LayoutPosition.h>
|
---|
| 23 |
|
---|
| 24 | using std::string;
|
---|
| 25 | using namespace flair::core;
|
---|
| 26 | using namespace flair::gui;
|
---|
| 27 |
|
---|
[15] | 28 | namespace flair {
|
---|
| 29 | namespace filter {
|
---|
[7] | 30 |
|
---|
[15] | 31 | ButterworthLowPass::ButterworthLowPass(const IODevice *parent,
|
---|
| 32 | const LayoutPosition *position,
|
---|
[162] | 33 | string name, uint32_t order,uint32_t nbRow,uint32_t nbCol)
|
---|
[15] | 34 | : IODevice(parent, name) {
|
---|
[162] | 35 | pimpl_ = new ButterworthLowPass_impl(this, position, name, order,nbRow,nbCol);
|
---|
[15] | 36 | AddDataToLog(pimpl_->output);
|
---|
[157] | 37 |
|
---|
| 38 | SetIsReady(true);
|
---|
[7] | 39 | }
|
---|
| 40 |
|
---|
[15] | 41 | ButterworthLowPass::ButterworthLowPass(const gui::LayoutPosition *position,
|
---|
[162] | 42 | string name, uint32_t order,uint32_t nbRow,uint32_t nbCol)
|
---|
[15] | 43 | : IODevice(position->getLayout(), name) {
|
---|
[162] | 44 | pimpl_ = new ButterworthLowPass_impl(this, position, name, order,nbRow,nbCol);
|
---|
[15] | 45 | AddDataToLog(pimpl_->output);
|
---|
[7] | 46 | }
|
---|
| 47 |
|
---|
[15] | 48 | ButterworthLowPass::~ButterworthLowPass() { delete pimpl_; }
|
---|
[7] | 49 |
|
---|
[214] | 50 | Matrix *ButterworthLowPass::GetMatrix(void) const { return pimpl_->output; }
|
---|
[7] | 51 |
|
---|
[15] | 52 | float ButterworthLowPass::Output(void) const {
|
---|
| 53 | return pimpl_->output->Value(0, 0);
|
---|
[7] | 54 | }
|
---|
| 55 |
|
---|
[15] | 56 | void ButterworthLowPass::UpdateFrom(const io_data *data) {
|
---|
| 57 | pimpl_->UpdateFrom(data);
|
---|
| 58 | ProcessUpdate(pimpl_->output);
|
---|
[7] | 59 | }
|
---|
| 60 |
|
---|
| 61 | } // end namespace filter
|
---|
| 62 | } // end namespace flair
|
---|