[3] | 1 | // %flair:license{
|
---|
[15] | 2 | // This file is part of the Flair framework distributed under the
|
---|
| 3 | // CECILL-C License, Version 1.0.
|
---|
[3] | 4 | // %flair:license}
|
---|
| 5 | // created: 2013/04/03
|
---|
| 6 | // filename: VrpnClient.cpp
|
---|
| 7 | //
|
---|
| 8 | // author: César Richard, Guillaume Sanahuja
|
---|
| 9 | // Copyright Heudiasyc UMR UTC/CNRS 7253
|
---|
| 10 | //
|
---|
| 11 | // version: $Id: $
|
---|
| 12 | //
|
---|
| 13 | // purpose: Class to connect to a Vrpn server
|
---|
| 14 | //
|
---|
| 15 | /*********************************************************************/
|
---|
| 16 |
|
---|
| 17 | #include "VrpnClient.h"
|
---|
| 18 | #include "VrpnClient_impl.h"
|
---|
| 19 | #include <FrameworkManager.h>
|
---|
| 20 | #include <TabWidget.h>
|
---|
| 21 | #include <Layout.h>
|
---|
| 22 | #include <string.h>
|
---|
| 23 |
|
---|
| 24 | using std::string;
|
---|
| 25 | using namespace flair::core;
|
---|
| 26 | using namespace flair::gui;
|
---|
| 27 |
|
---|
[15] | 28 | namespace flair {
|
---|
| 29 | namespace sensor {
|
---|
[3] | 30 |
|
---|
[15] | 31 | VrpnClient::VrpnClient(const FrameworkManager *parent, string name,
|
---|
| 32 | string address, uint16_t us_period, uint8_t priority)
|
---|
| 33 | : Thread(parent, name, priority) {
|
---|
| 34 | pimpl_ = new VrpnClient_impl(this, name, address, us_period);
|
---|
[3] | 35 | }
|
---|
| 36 |
|
---|
[15] | 37 | VrpnClient::VrpnClient(const FrameworkManager *parent, string name,
|
---|
| 38 | SerialPort *serialport, uint16_t us_period,
|
---|
| 39 | uint8_t priority)
|
---|
| 40 | : Thread(parent, name, priority) {
|
---|
| 41 | pimpl_ = new VrpnClient_impl(this, name, serialport, us_period);
|
---|
[3] | 42 | }
|
---|
| 43 |
|
---|
[15] | 44 | VrpnClient::~VrpnClient() {
|
---|
| 45 | SafeStop();
|
---|
| 46 | Join();
|
---|
[3] | 47 |
|
---|
[15] | 48 | delete pimpl_;
|
---|
[3] | 49 | }
|
---|
| 50 |
|
---|
[15] | 51 | Layout *VrpnClient::GetLayout(void) const {
|
---|
| 52 | return (Layout *)(pimpl_->setup_tab);
|
---|
[3] | 53 | }
|
---|
| 54 |
|
---|
[15] | 55 | TabWidget *VrpnClient::GetTabWidget(void) const { return pimpl_->tab; }
|
---|
[3] | 56 |
|
---|
[15] | 57 | bool VrpnClient::UseXbee(void) const { return pimpl_->UseXbee(); }
|
---|
[3] | 58 |
|
---|
[15] | 59 | void VrpnClient::Run(void) { pimpl_->Run(); }
|
---|
[3] | 60 |
|
---|
| 61 | } // end namespace sensor
|
---|
| 62 | } // end namespace flair
|
---|