Ignore:
Timestamp:
Feb 14, 2017, 5:02:06 PM (5 years ago)
Author:
Sanahuja Guillaume
Message:

warn message if vrpnobject is added on running client

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/lib/FlairSensorActuator/src/VrpnObject_impl.cpp

    r135 r139  
    5656  }
    5757
    58   if (parent->UseXbee()) {
    59     parent->pimpl_->AddTrackable(this, id);
    60     tracker = NULL;
    61   } else {
    62     parent->pimpl_->AddTrackable(self);
    63     tracker = new vrpn_Tracker_Remote(name.c_str(), parent->pimpl_->connection);
    64     tracker->register_change_handler(this, handle_pos);
    65     tracker->shutup = true;
    66   }
    67 
    6858  // state
    6959  cvmatrix_descriptor *desc = new cvmatrix_descriptor(7, 1);
     
    9181  z_plot = new DataPlot1D(plot_tab->LastRowLastCol(), "z", -2, 0);
    9282  z_plot->AddCurve(output->Element(6));
     83 
     84  if(parent->IsRunning()) {
     85    self->Warn("adding VrpnObject on running VrpnClient can crash\n");
     86  }
     87 
     88  if (parent->UseXbee()) {
     89    tracker = NULL;
     90    parent->pimpl_->AddTrackable(this, id);
     91  } else {
     92    tracker = new vrpn_Tracker_Remote(name.c_str(), parent->pimpl_->connection);
     93    tracker->register_change_handler(this, handle_pos);
     94    tracker->shutup = true;
     95    parent->pimpl_->AddTrackable(self);
     96  }
    9397}
    9498
     
    106110}
    107111
    108 void VrpnObject_impl::mainloop(void) { tracker->mainloop(); }
     112void VrpnObject_impl::mainloop(void) {
     113     tracker->mainloop();
     114}
    109115
    110116bool VrpnObject_impl::IsTracked(unsigned int timeout_ms) {
Note: See TracChangeset for help on using the changeset viewer.