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

Last change on this file since 317 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
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: 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
[15]25namespace flair {
26namespace filter {
[7]27
[137]28X4X8Multiplex::X4X8Multiplex(std::string name,UavType_t type)
29 : UavMultiplex( name) {
[15]30 int nb_mot;
[7]31
[15]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 }
[7]43
[15]44 pimpl_ = new X4X8Multiplex_impl(this, nb_mot);
[7]45
[15]46 for (int i = 0; i < nb_mot; i++) {
47 SetMultiplexComboBox(pimpl_->MotorName(i), i);
48 }
[157]49
50 SetIsReady(true);
[7]51}
52
[15]53X4X8Multiplex::~X4X8Multiplex(void) { delete pimpl_; }
[7]54
[15]55uint8_t X4X8Multiplex::MotorsCount(void) const { return pimpl_->nb_mot; }
[7]56
[15]57void X4X8Multiplex::UseDefaultPlot(void) { pimpl_->UseDefaultPlot(); }
[7]58
[15]59void X4X8Multiplex::UpdateFrom(const io_data *data) {
60 pimpl_->UpdateFrom(data);
[7]61}
62
63} // end namespace filter
64} // end namespace flair
Note: See TracBrowser for help on using the repository browser.