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

Last change on this file since 13 was 10, checked in by Sanahuja Guillaume, 9 years ago

lic

File size: 2.0 KB
RevLine 
[10]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}
[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
37namespace flair { namespace meta
38{
39
40MetaUsRangeFinder::MetaUsRangeFinder(UsRangeFinder* us): Object(us,us->ObjectName()) {
41 this->us=us;
42 pbas_z=new ButterworthLowPass(us,us->GetLayout()->NewRow(),"Passe bas",3);
43 vz_euler=new EulerDerivative(pbas_z,us->GetLayout()->NewRow(),"Vz");
44 pbas_vz=new ButterworthLowPass(vz_euler,us->GetLayout()->NewRow(),"Passe bas v",3);
45
46}
47
48MetaUsRangeFinder::~MetaUsRangeFinder() {
49
50}
51
52void MetaUsRangeFinder::UseDefaultPlot(void) {
53 us->UseDefaultPlot();
54
55 us->GetPlot()->AddCurve(pbas_z->Matrix()->Element(0),DataPlot::Blue);
56
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);
60}
61
62gui::DataPlot1D *MetaUsRangeFinder::GetZPlot() {
63 return us->GetPlot();
64}
65
66gui::DataPlot1D *MetaUsRangeFinder::GetVzPlot() {
67 return vz_plot;
68}
69
70float MetaUsRangeFinder::z(void) const {
71 return pbas_z->Output();
72}
73
74float MetaUsRangeFinder::Vz(void) const {
75 return pbas_vz->Output();
76}
77
78} // end namespace sensor
79} // end namespace framewor
Note: See TracBrowser for help on using the repository browser.