source: flair-src/tags/latest/lib/FlairFilter/src/X4X8Multiplex.cpp@ 28

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

sources reformatted with flair-format-dir script

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(const FrameworkManager *parent, std::string name,
29 UavType_t type)
30 : UavMultiplex(parent, name) {
31 int nb_mot;
32
33 switch (type) {
34 case X4:
35 nb_mot = 4;
36 break;
37 case X8:
38 nb_mot = 8;
39 break;
40 default:
41 Err("uav type not supported\n");
42 break;
43 }
44
45 pimpl_ = new X4X8Multiplex_impl(this, nb_mot);
46
47 for (int i = 0; i < nb_mot; i++) {
48 SetMultiplexComboBox(pimpl_->MotorName(i), i);
49 }
50}
51
52X4X8Multiplex::~X4X8Multiplex(void) { delete pimpl_; }
53
54uint8_t X4X8Multiplex::MotorsCount(void) const { return pimpl_->nb_mot; }
55
56void X4X8Multiplex::UseDefaultPlot(void) { pimpl_->UseDefaultPlot(); }
57
58void X4X8Multiplex::UpdateFrom(const io_data *data) {
59 pimpl_->UpdateFrom(data);
60}
61
62} // end namespace filter
63} // end namespace flair
Note: See TracBrowser for help on using the repository browser.