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