1 | // created: 2014/04/11
|
---|
2 | // filename: UavMultiplex.cpp
|
---|
3 | //
|
---|
4 | // author: Guillaume Sanahuja
|
---|
5 | // Copyright Heudiasyc UMR UTC/CNRS 7253
|
---|
6 | //
|
---|
7 | // version: $Id: $
|
---|
8 | //
|
---|
9 | // purpose: Class defining uav multiplexing
|
---|
10 | //
|
---|
11 | //
|
---|
12 | /*********************************************************************/
|
---|
13 |
|
---|
14 | #include "UavMultiplex.h"
|
---|
15 | #include "UavMultiplex_impl.h"
|
---|
16 | #include <cvmatrix.h>
|
---|
17 | #include <FrameworkManager.h>
|
---|
18 | #include <Tab.h>
|
---|
19 | #include <GridLayout.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 | UavMultiplex::UavMultiplex(const core::FrameworkManager* parent,std::string name) : IODevice(parent,name)
|
---|
31 | {
|
---|
32 | pimpl_=new UavMultiplex_impl(parent,this,name);
|
---|
33 | }
|
---|
34 |
|
---|
35 | UavMultiplex::~UavMultiplex(void)
|
---|
36 | {
|
---|
37 | delete pimpl_;
|
---|
38 | }
|
---|
39 |
|
---|
40 | void UavMultiplex::Update(core::Time time)
|
---|
41 | {
|
---|
42 | pimpl_->input->SetDataTime(time);
|
---|
43 | UpdateFrom(pimpl_->input);
|
---|
44 | }
|
---|
45 |
|
---|
46 | void UavMultiplex::SetMultiplexComboBox(string name,int index)
|
---|
47 | {
|
---|
48 | pimpl_->SetMultiplexComboBox(name,index);
|
---|
49 | }
|
---|
50 |
|
---|
51 | int UavMultiplex::MultiplexValue(int index) const
|
---|
52 | {
|
---|
53 | return pimpl_->MultiplexValue(index);
|
---|
54 | }
|
---|
55 |
|
---|
56 | TabWidget* UavMultiplex::GetTabWidget(void) const
|
---|
57 | {
|
---|
58 | return pimpl_->tabwidget;
|
---|
59 | }
|
---|
60 |
|
---|
61 | Layout* UavMultiplex::GetLayout(void) const
|
---|
62 | {
|
---|
63 | return pimpl_->setup_tab;
|
---|
64 | }
|
---|
65 |
|
---|
66 | void UavMultiplex::LockUserInterface(void) const
|
---|
67 | {
|
---|
68 | pimpl_->setup_tab->setEnabled(false);
|
---|
69 | }
|
---|
70 |
|
---|
71 | void UavMultiplex::UnlockUserInterface(void) const
|
---|
72 | {
|
---|
73 | pimpl_->setup_tab->setEnabled(true);
|
---|
74 | }
|
---|
75 |
|
---|
76 | void UavMultiplex::SetRoll(float value)
|
---|
77 | {
|
---|
78 | pimpl_->input->SetValue(0,0,value);
|
---|
79 | }
|
---|
80 |
|
---|
81 | void UavMultiplex::SetPitch(float value)
|
---|
82 | {
|
---|
83 | pimpl_->input->SetValue(1,0,value);
|
---|
84 | }
|
---|
85 |
|
---|
86 | void UavMultiplex::SetYaw(float value)
|
---|
87 | {
|
---|
88 | pimpl_->input->SetValue(2,0,value);
|
---|
89 | }
|
---|
90 |
|
---|
91 | void UavMultiplex::SetThrust(float value)
|
---|
92 | {
|
---|
93 | pimpl_->input->SetValue(3,0,value);
|
---|
94 | }
|
---|
95 |
|
---|
96 | void UavMultiplex::SetRollTrim(float value)
|
---|
97 | {
|
---|
98 | pimpl_->input->SetValue(4,0,value);
|
---|
99 | }
|
---|
100 |
|
---|
101 | void UavMultiplex::SetPitchTrim(float value)
|
---|
102 | {
|
---|
103 | pimpl_->input->SetValue(5,0,value);
|
---|
104 | }
|
---|
105 |
|
---|
106 | void UavMultiplex::SetYawTrim(float value)
|
---|
107 | {
|
---|
108 | pimpl_->input->SetValue(6,0,value);
|
---|
109 | }
|
---|
110 |
|
---|
111 | } // end namespace filter
|
---|
112 | } // end namespace flair
|
---|