Changeset 59


Ignore:
Timestamp:
01/20/09 11:32:15 (3 years ago)
Author:
kriege
Message:

added vrpn client to avango-daemon, use VRPN_SUPPORT option to compile

Location:
trunk
Files:
2 added
9 edited

Legend:

Unmodified
Added
Removed
  • trunk/SConstruct

    r56 r59  
    5353    BoolOption('CONNECT_CSHARP_SUPPORT', 
    5454               'Enable C# support for the connect module', 
     55               False), 
     56    BoolOption('VRPN_SUPPORT', 
     57               'Enable VRPN support for the AvangoDaemon module', 
    5558               False), 
    5659    ) 
  • trunk/avango-build/src/avango/build/recipes.py

    r57 r59  
    7474    #add common libs (plain) 
    7575    _config_store.set('xerces', PlainConfig(libraries = ['xerces-c'])) 
    76  
     76    _config_store.set('vrpn', PlainConfig(libraries = ['vrpn'])) 
     77     
    7778    # Dummy packages 
    7879    _config_store.set('osgUtil', PlainConfig(libraries = [''])) 
  • trunk/avango-daemon/SConscript

    r1 r59  
    3333    'PREFIX': avango.build.get_prefix().abspath, 
    3434    'AVANGO_DAEMON_DEBUG': int(daemon_env['DEBUG']), 
     35    'AVANGO_DAEMON_VRPN_SUPPORT': int(daemon_env['VRPN_SUPPORT']), 
    3536    'PKG_CONFIG_REQUIRES': 'avango-core, avango-osg', 
    3637    'AVANGO_DAEMON_VERSION': '1.90.0', 
  • trunk/avango-daemon/include/avango/daemon/Config.h.in

    r1 r59  
    3838#endif 
    3939 
     40#if %(AVANGO_DAEMON_VRPN_SUPPORT)s 
     41#define VRPN_SUPPORT 1 
     42#else 
     43#undef VRPN_SUPPORT 
     44#endif 
     45 
    4046#define AVANGO_DAEMON_VERSION_MAJOR %(AVANGO_DAEMON_VERSION_MAJOR)s 
    4147#define AVANGO_DAEMON_VERSION_MINOR %(AVANGO_DAEMON_VERSION_MINOR)s 
  • trunk/avango-daemon/include/avango/daemon/SConscript

    r1 r59  
    4444    WiimoteActuator.h 
    4545    ''') 
     46  
     47if avango.build.Environment()['VRPN_SUPPORT']: 
     48    headers += Split(''' 
     49        VRPNClient.h 
     50        ''') 
    4651 
    4752Alias('install-daemon', Install(avango.build.get_include_path('avango/daemon'), headers)) 
  • trunk/avango-daemon/python/__init__.py

    r20 r59  
    5959    To communicate with a Wacom tablet. 
    6060 
     61VRPNClient 
     62    A VRPN client consisting of vrpn_Tracker, vrpn_Button and vrpn_Analog devices. 
     63    Note: This device is linked to the vrpn library. 
     64    (http://www.cs.unc.edu/Research/vrpn) 
     65 
    6166 
    6267Examples 
    6368======== 
    6469 
    65 There are some basic examples that show the configuration and usage of 
    66 these input devices in examples/daemon within your Avango NG installation. 
     70There are some basic examples within your Avango NG installation, 
     71that show the configuration and usage of these input devices. 
    6772''' 
    6873 
     
    7378from _daemon import _WiimoteHelper 
    7479from _daemon import _DTrackHelper 
     80from _daemon import _VRPNClientHelper 
    7581 
    7682import avango.nodefactory 
     
    193199 
    194200    stations = property(StationProxy) 
     201 
     202class VRPNClient(_VRPNClientHelper): 
     203    """Avango NG device for processing data sent by a VRPN server. This 
     204    client consists of vrpn_Tracker, vrpn_Button and vrpn_Analog devices.""" 
     205    def __init__(self): 
     206        super(VRPNClient, self).__init__() 
     207        self._station = None 
     208 
     209    def get_station(self): 
     210        return self._station 
     211 
     212    def set_station(self, st): 
     213        self._station = st 
     214        self.add_station(0, st.name) 
     215 
     216    station = property(get_station, set_station) 
  • trunk/avango-daemon/python/_daemon.cpp

    r20 r59  
    2424\************************************************************************/ 
    2525 
     26#include <avango/daemon/Config.h> 
    2627#include <avango/daemon/DeviceDaemon.h> 
    2728#include <avango/daemon/DeviceSensor.h> 
     
    3839#include <boost/mpl/vector.hpp> 
    3940 
     41#ifdef VRPN_SUPPORT 
     42#include <avango/daemon/VRPNClient.h> 
     43#endif 
     44 
    4045using namespace boost::python; 
    4146using namespace av::python; 
     
    7580  std::string getPortFeature(av::daemon::Device* self) { return self->queryFeature("port"); } 
    7681  std::string getToggleResetFeature(av::daemon::Device* self) { return self->queryFeature("toggle-reset"); } 
    77  
     82  std::string getServerFeature(av::daemon::Device* self) { return self->queryFeature("server"); } 
     83   
    7884  // wrapper for specialized configureFeature calls, required by .add_property 
    7985  std::string parseBoolString(std::string value) 
     
    9197  void setPortFeature(av::daemon::Device* self, std::string value) { self->configureFeature("port", value); } 
    9298  void setToggleResetFeature(av::daemon::Device* self, std::string value) { self->configureFeature("toggle-reset", parseBoolString(value)); } 
    93  
     99  void setServerFeature(av::daemon::Device* self, std::string value) { self->configureFeature("server", value); } 
     100   
    94101  // set LED states 
    95102  void setLED(av::daemon::HIDInput* self, int number, int value) 
     
    199206    ; 
    200207 
     208  // Avango NG device: VRPNClient 
     209  class_<av::daemon::VRPNClient, av::Link<av::daemon::VRPNClient>, bases<av::daemon::Device>, boost::noncopyable >("_VRPNClientHelper", 
     210    "A helper class used to construct a concrete Python VRPN client device representation.") 
     211    .add_property("server", &::getServerFeature, &::setServerFeature) 
     212    ; 
     213   
    201214  // start the daemon 
    202215  def("run", &::run); 
  • trunk/avango-daemon/src/avango/daemon/Init.cpp

    r1 r59  
    2828#include <avango/Logger.h> 
    2929 
     30#include <avango/daemon/Config.h> 
    3031#include <avango/daemon/Device.h> 
    3132#include <avango/daemon/DeviceActuator.h> 
     
    3839#include <avango/daemon/Wiimote.h> 
    3940#include <avango/daemon/WiimoteActuator.h> 
     41 
     42#ifdef VRPN_SUPPORT 
     43#include <avango/daemon/VRPNClient.h> 
     44#endif 
    4045 
    4146namespace 
     
    6267    av::daemon::WiimoteActuator::initClass(); 
    6368 
     69#ifdef VRPN_SUPPORT 
     70    av::daemon::VRPNClient::initClass(); 
     71#endif 
     72 
    6473    AV_TYPED_INIT_ABSTRACT(av::Type::badType(), "av::daemon::Init", true); 
    6574  } 
  • trunk/avango-daemon/src/avango/daemon/SConscript

    r1 r59  
    2626import avango.build 
    2727 
     28daemon_env = avango.build.Environment() 
     29 
    2830# Sources section 
    2931lib_sources = Split(''' 
     
    4648    ''') 
    4749 
     50if daemon_env['VRPN_SUPPORT']: 
     51    lib_sources += Split(''' 
     52        VRPNClient.cpp 
     53        ''') 
     54 
    4855# append external sources 
    4956lib_sources.append(Split(''' 
     
    5461 
    5562# Rules section 
    56 daemon_env = avango.build.Environment() 
    5763if 'icpc' in daemon_env['CXX']: 
    5864    daemon_env.Append(CXXFLAGS='-wd593') 
    5965avango.build.add_library(daemon_env, 'avango-core') 
    6066avango.build.add_library(daemon_env, 'avango-osg') 
     67 
     68if daemon_env['VRPN_SUPPORT']: 
     69    avango.build.add_library(daemon_env, 'vrpn') 
     70 
    6171lib = daemon_env.SharedLibrary('avangoDaemon', lib_sources) 
    6272 
Note: See TracChangeset for help on using the changeset viewer.