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 |
|
---|
21 | using std::string;
|
---|
22 | using namespace flair::core;
|
---|
23 | using namespace flair::gui;
|
---|
24 |
|
---|
25 | namespace flair
|
---|
26 | {
|
---|
27 | namespace filter
|
---|
28 | {
|
---|
29 |
|
---|
30 | X4X8Multiplex::X4X8Multiplex(const FrameworkManager* parent,std::string name,UavType_t type) : UavMultiplex(parent,name)
|
---|
31 | {
|
---|
32 | int nb_mot;
|
---|
33 |
|
---|
34 | switch(type)
|
---|
35 | {
|
---|
36 | case X4:
|
---|
37 | nb_mot=4;
|
---|
38 | break;
|
---|
39 | case X8:
|
---|
40 | nb_mot=8;
|
---|
41 | break;
|
---|
42 | default:
|
---|
43 | Err("uav type not supported\n");
|
---|
44 | break;
|
---|
45 | }
|
---|
46 |
|
---|
47 | pimpl_=new X4X8Multiplex_impl(this,nb_mot);
|
---|
48 |
|
---|
49 | for(int i=0;i<nb_mot;i++)
|
---|
50 | {
|
---|
51 | SetMultiplexComboBox(pimpl_->MotorName(i),i);
|
---|
52 | }
|
---|
53 | }
|
---|
54 |
|
---|
55 | X4X8Multiplex::~X4X8Multiplex(void)
|
---|
56 | {
|
---|
57 | delete pimpl_;
|
---|
58 | }
|
---|
59 |
|
---|
60 | uint8_t X4X8Multiplex::MotorsCount(void) const
|
---|
61 | {
|
---|
62 | return pimpl_->nb_mot;
|
---|
63 | }
|
---|
64 |
|
---|
65 | void X4X8Multiplex::UseDefaultPlot(void)
|
---|
66 | {
|
---|
67 | pimpl_->UseDefaultPlot();
|
---|
68 | }
|
---|
69 |
|
---|
70 | void X4X8Multiplex::UpdateFrom(const io_data *data)
|
---|
71 | {
|
---|
72 | pimpl_->UpdateFrom(data);
|
---|
73 | }
|
---|
74 |
|
---|
75 | } // end namespace filter
|
---|
76 | } // end namespace flair
|
---|