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

Last change on this file since 411 was 214, checked in by Sanahuja Guillaume, 6 years ago

matrix

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