[3] | 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: 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 |
|
---|
| 28 | namespace flair
|
---|
| 29 | {
|
---|
| 30 | namespace sensor
|
---|
| 31 | {
|
---|
| 32 |
|
---|
| 33 | VrpnClient::VrpnClient(const FrameworkManager* parent,string name,string address,uint16_t us_period,uint8_t priority): Thread(parent,name,priority)
|
---|
| 34 | {
|
---|
| 35 | pimpl_=new VrpnClient_impl(this,name,address,us_period);
|
---|
| 36 | }
|
---|
| 37 |
|
---|
| 38 | VrpnClient::VrpnClient(const FrameworkManager* parent,string name,SerialPort* serialport,uint16_t us_period,uint8_t priority): Thread(parent,name,priority)
|
---|
| 39 | {
|
---|
| 40 | pimpl_=new VrpnClient_impl(this,name,serialport,us_period);
|
---|
| 41 | }
|
---|
| 42 |
|
---|
| 43 | VrpnClient::~VrpnClient()
|
---|
| 44 | {
|
---|
| 45 | SafeStop();
|
---|
| 46 | Join();
|
---|
| 47 |
|
---|
| 48 | delete pimpl_;
|
---|
| 49 | }
|
---|
| 50 |
|
---|
| 51 | Layout* VrpnClient::GetLayout(void) const
|
---|
| 52 | {
|
---|
| 53 | return (Layout*)(pimpl_->setup_tab);
|
---|
| 54 | }
|
---|
| 55 |
|
---|
| 56 | TabWidget* VrpnClient::GetTabWidget(void) const
|
---|
| 57 | {
|
---|
| 58 | return pimpl_->tab;
|
---|
| 59 | }
|
---|
| 60 |
|
---|
| 61 | bool VrpnClient::UseXbee(void) const
|
---|
| 62 | {
|
---|
| 63 | return pimpl_->UseXbee();
|
---|
| 64 | }
|
---|
| 65 |
|
---|
| 66 | void VrpnClient::Run(void)
|
---|
| 67 | {
|
---|
| 68 | pimpl_->Run();
|
---|
| 69 | }
|
---|
| 70 |
|
---|
| 71 | } // end namespace sensor
|
---|
| 72 | } // end namespace flair
|
---|