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