source: flair-src/trunk/lib/FlairMeta/src/MetaUsRangeFinder.cpp@ 38

Last change on this file since 38 was 15, checked in by Bayard Gildas, 8 years ago

sources reformatted with flair-format-dir script

File size: 2.1 KB
RevLine 
[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/04/08
6// filename: MetaUsRangeFinder.cpp
7//
8// author: Guillaume Sanahuja
9// Copyright Heudiasyc UMR UTC/CNRS 7253
10//
11// version: $Id: $
12//
13// purpose: objet integrant une dérivée
14// d'euler, un passe bas et un generateur de consigne
15// -> adapté pour un capteur d'altitude
16//
17//
18/*********************************************************************/
19
20#include "MetaUsRangeFinder.h"
21#include "UsRangeFinder.h"
22#include <LowPassFilter.h>
23#include <ButterworthLowPass.h>
24#include <Layout.h>
25#include <DataPlot1D.h>
26#include <Tab.h>
27#include <EulerDerivative.h>
28#include <GroupBox.h>
29#include <cvmatrix.h>
30
31using std::string;
32using namespace flair::core;
33using namespace flair::gui;
34using namespace flair::filter;
35using namespace flair::sensor;
36
[15]37namespace flair {
38namespace meta {
[7]39
[15]40MetaUsRangeFinder::MetaUsRangeFinder(UsRangeFinder *us)
41 : Object(us, us->ObjectName()) {
42 this->us = us;
43 pbas_z =
44 new ButterworthLowPass(us, us->GetLayout()->NewRow(), "Passe bas", 3);
45 vz_euler = new EulerDerivative(pbas_z, us->GetLayout()->NewRow(), "Vz");
46 pbas_vz = new ButterworthLowPass(vz_euler, us->GetLayout()->NewRow(),
47 "Passe bas v", 3);
[7]48}
49
[15]50MetaUsRangeFinder::~MetaUsRangeFinder() {}
[7]51
52void MetaUsRangeFinder::UseDefaultPlot(void) {
[15]53 us->UseDefaultPlot();
[7]54
[15]55 us->GetPlot()->AddCurve(pbas_z->Matrix()->Element(0), DataPlot::Blue);
[7]56
[15]57 vz_plot = new DataPlot1D(us->GetPlotTab()->LastRowLastCol(), "vz", -2, 2);
58 vz_plot->AddCurve(vz_euler->Matrix()->Element(0));
59 vz_plot->AddCurve(pbas_vz->Matrix()->Element(0), DataPlot::Blue);
[7]60}
61
[15]62gui::DataPlot1D *MetaUsRangeFinder::GetZPlot() { return us->GetPlot(); }
[7]63
[15]64gui::DataPlot1D *MetaUsRangeFinder::GetVzPlot() { return vz_plot; }
[7]65
[15]66float MetaUsRangeFinder::z(void) const { return pbas_z->Output(); }
[7]67
[15]68float MetaUsRangeFinder::Vz(void) const { return pbas_vz->Output(); }
[7]69
70} // end namespace sensor
71} // end namespace framewor
Note: See TracBrowser for help on using the repository browser.