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

Last change on this file since 137 was 137, checked in by Sanahuja Guillaume, 5 years ago

singleton manager

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