|
anyKode Marilou
|
Attends le démarrage complet du moteur de simulation (Exec) durant au moins le temps spécifié en paramètre.
static bool WaitMODAServerIsRunningOnLocalhost(DWORD dwWaitTimeOut);
|
Parameters |
Description |
|
DWORD dwWaitTimeOut |
[in] Durée d'attente du démarrage d'Exec, en milli secondes. |
true si le démarrage complet de Exec a été constaté, false sinon.
L'attente est faite en 2 étapes:
Cette méthode fonctionne uniquement si le programme appelant et Exec sont exécutés sur le même ordinateur (localhost)
//Shows how to wait complete exec startup before connecting to MODA server
#include "Modacpp.h"
#include "conio.h"
#define MODASERVER "localhost"
#define MYROBOTNAME "/"
int main(int argc, TCHAR* argv[])
{
ModaCPP::Connection *connection=new ModaCPP::Connection(true);
if(connection->WaitMODAServerIsRunningOnLocalhost(5000))
{
//exec is running and all servers are running
if(connection->Connect(MODASERVER))
{
_cprintf("Connection ok to moda server\r\n");
ModaCPP::RobotPHX *robot=connection->QueryRobotPHX(MYROBOTNAME);
if(robot)
{
_cprintf("robot found\r\n");
// ... your program here
delete robot;
}
else
{
_cprintf("robot not found\r\n");
}
}
else
{
_cprintf("Unable to connect to moda server\r\n");
}
}
else
{
_cprintf("Exec is not running ...\r\n");
}
connection->Disconnect();
delete connection;
return 0;
}|
Documentation v4.7 (18/01/2015), Copyright (c) 2015 anyKode. All rights reserved.
|
|
What do you think about this topic? Send feedback!
|