source: flair-src/trunk/lib/FlairFilter/src/UavMultiplex.cpp @ 15

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

sources reformatted with flair-format-dir script

File size: 2.2 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/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
25using std::string;
26using namespace flair::core;
27using namespace flair::gui;
28
29namespace flair {
30namespace filter {
31
32UavMultiplex::UavMultiplex(const core::FrameworkManager *parent,
33                           std::string name)
34    : IODevice(parent, name) {
35  pimpl_ = new UavMultiplex_impl(parent, this, name);
36}
37
38UavMultiplex::~UavMultiplex(void) { delete pimpl_; }
39
40void UavMultiplex::Update(core::Time time) {
41  pimpl_->input->SetDataTime(time);
42  UpdateFrom(pimpl_->input);
43}
44
45void UavMultiplex::SetMultiplexComboBox(string name, int index) {
46  pimpl_->SetMultiplexComboBox(name, index);
47}
48
49int UavMultiplex::MultiplexValue(int index) const {
50  return pimpl_->MultiplexValue(index);
51}
52
53TabWidget *UavMultiplex::GetTabWidget(void) const { return pimpl_->tabwidget; }
54
55Layout *UavMultiplex::GetLayout(void) const { return pimpl_->setup_tab; }
56
57void UavMultiplex::LockUserInterface(void) const {
58  pimpl_->setup_tab->setEnabled(false);
59}
60
61void UavMultiplex::UnlockUserInterface(void) const {
62  pimpl_->setup_tab->setEnabled(true);
63}
64
65void UavMultiplex::SetRoll(float value) {
66  pimpl_->input->SetValue(0, 0, value);
67}
68
69void UavMultiplex::SetPitch(float value) {
70  pimpl_->input->SetValue(1, 0, value);
71}
72
73void UavMultiplex::SetYaw(float value) { pimpl_->input->SetValue(2, 0, value); }
74
75void UavMultiplex::SetThrust(float value) {
76  pimpl_->input->SetValue(3, 0, value);
77}
78
79void UavMultiplex::SetRollTrim(float value) {
80  pimpl_->input->SetValue(4, 0, value);
81}
82
83void UavMultiplex::SetPitchTrim(float value) {
84  pimpl_->input->SetValue(5, 0, value);
85}
86
87void UavMultiplex::SetYawTrim(float value) {
88  pimpl_->input->SetValue(6, 0, value);
89}
90
91} // end namespace filter
92} // end namespace flair
Note: See TracBrowser for help on using the repository browser.