Ignore:
Timestamp:
02/14/17 17:02:06 (7 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/VrpnClient_impl.cpp

    r136 r139  
    215215      }
    216216    } else {//!UseXbee()
    217                         if(connection->connected()==vrpn_true && !isConnected) {
    218                                 isConnected=true;
    219                                 Printf("VRPN connected\n");
    220                         }
    221                         if(connection->connected()==vrpn_false && isConnected) {
    222                                 isConnected=false;
    223                                 Printf("VRPN disconnected\n");
    224                         }
    225                        
    226                         //timeout in mainloop is not well handled if not connected...
    227                         if(isConnected) {
    228                                 //this is when trackables callbacks are called:
    229                                 if(connection->mainloop(&timeout)!=0) {
    230                                         self->Warn("connection dropped\n");
    231                                 }
    232                                 //printf("%lld\n",GetTime()/(1000*1000));
    233                                 mutex->GetMutex();
    234                                 for (unsigned int i = 0; i < trackables.size(); i++)
    235                                         trackables.at(i)->mainloop();
    236                                 mutex->ReleaseMutex();
    237                         } else {
    238                                 connection->mainloop();
    239                                 self->SleepMS(10);
    240                         }
     217        if(connection->connected()==vrpn_true && !isConnected) {
     218            isConnected=true;
     219            Printf("VRPN connected\n");
     220        }
     221        if(connection->connected()==vrpn_false && isConnected) {
     222            isConnected=false;
     223            Printf("VRPN disconnected\n");
     224        }
     225        //timeout in mainloop is not well handled if not connected...
     226        if(isConnected) {
     227            //this is when trackables callbacks are called:
     228            if(connection->mainloop(&timeout)!=0) {
     229                self->Warn("connection dropped\n");
     230            }
     231            //printf("%lld\n",GetTime()/(1000*1000));
     232            mutex->GetMutex();
     233            for (unsigned int i = 0; i < trackables.size(); i++)
     234                trackables.at(i)->mainloop();
     235            mutex->ReleaseMutex();
     236        } else {
     237            connection->mainloop();
     238            self->SleepMS(10);
     239        }
    241240    }
    242241  }
Note: See TracChangeset for help on using the changeset viewer.