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

Last change on this file since 121 was 45, checked in by Sanahuja Guillaume, 8 years ago

added compile info

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