source: flair-src/trunk/lib/FlairFilter/src/X4X8Multiplex.cpp@ 167

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

iadded isready to iodevice:
avoid problem of imu not ready in ardrone2

File size: 1.4 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: 2014/04/10
6// filename: X4X8Multiplex.cpp
7//
8// author: Guillaume Sanahuja
9// Copyright Heudiasyc UMR UTC/CNRS 7253
10//
11// version: $Id: $
12//
13// purpose: Class defining X4 and X8 multiplexing
14//
15//
16/*********************************************************************/
17
18#include "X4X8Multiplex.h"
19#include "X4X8Multiplex_impl.h"
20
21using std::string;
22using namespace flair::core;
23using namespace flair::gui;
24
25namespace flair {
26namespace filter {
27
28X4X8Multiplex::X4X8Multiplex(std::string name,UavType_t type)
29 : UavMultiplex( name) {
30 int nb_mot;
31
32 switch (type) {
33 case X4:
34 nb_mot = 4;
35 break;
36 case X8:
37 nb_mot = 8;
38 break;
39 default:
40 Err("uav type not supported\n");
41 break;
42 }
43
44 pimpl_ = new X4X8Multiplex_impl(this, nb_mot);
45
46 for (int i = 0; i < nb_mot; i++) {
47 SetMultiplexComboBox(pimpl_->MotorName(i), i);
48 }
49
50 SetIsReady(true);
51}
52
53X4X8Multiplex::~X4X8Multiplex(void) { delete pimpl_; }
54
55uint8_t X4X8Multiplex::MotorsCount(void) const { return pimpl_->nb_mot; }
56
57void X4X8Multiplex::UseDefaultPlot(void) { pimpl_->UseDefaultPlot(); }
58
59void X4X8Multiplex::UpdateFrom(const io_data *data) {
60 pimpl_->UpdateFrom(data);
61}
62
63} // end namespace filter
64} // end namespace flair
Note: See TracBrowser for help on using the repository browser.