Skip to content
Snippets Groups Projects
Commit 1560132f authored by Francois Henrotte's avatar Francois Henrotte
Browse files

modifs pour les metamodeles ONELAB

parent db513cbc
Branches
Tags
No related merge requests found
......@@ -149,7 +149,7 @@ void GetOptions(int argc, char *argv[])
Msg::InitializeOnelab("GmshOnelab", argv[i++]);
else
Msg::Fatal("Missing string");
CTX::instance()->batch = -4;
//CTX::instance()->batch = -4;
}
else if(!strcmp(argv[i] + 1, "socket")) {
i++;
......
......@@ -73,6 +73,8 @@ class GmshSocket{
GMSH_VERTEX_ARRAY = 22,
GMSH_PARAMETER = 23,
GMSH_PARAMETER_QUERY = 24,
GMSH_PARAM_QUERY_ALL = 25,
GMSH_PARAM_QUERY_END = 26,
GMSH_SPEED_TEST = 30,
GMSH_OPTION_1 = 100,
GMSH_OPTION_2 = 101,
......@@ -391,7 +393,7 @@ class GmshServer : public GmshSocket{
#if !defined(WIN32)
cmd += " &";
#endif
SystemCall(cmd.c_str()); // start the solver
SystemCall(cmd.c_str()); // starts the solver
}
else{
timeout = 0.; // no command launched: don't set a timeout
......
......@@ -581,7 +581,7 @@ namespace onelab{
// and interacts with onelab clients.
class server{
private:
// the unique server
// the unique server (singleton behaviour due to the "static" specifier)
static server *_server;
// the address of the server
std::string _address;
......@@ -610,6 +610,7 @@ namespace onelab{
typedef std::map<std::string, client*>::iterator citer;
citer firstClient(){ return _clients.begin(); }
citer lastClient(){ return _clients.end(); }
int nbClients() { return _clients.size(); };
citer findClient(const std::string &name){ return _clients.find(name); }
void registerClient(client *c)
{
......@@ -712,7 +713,11 @@ namespace onelab{
if(!_gmshClient) return false;
T p(name);
std::string msg = p.toChar();
_gmshClient->SendMessage(GmshSocket::GMSH_PARAMETER_QUERY, msg.size(), &msg[0]);
if (name.size())
_gmshClient->SendMessage(GmshSocket::GMSH_PARAMETER_QUERY, msg.size(), &msg[0]);
else //get all parameters
_gmshClient->SendMessage(GmshSocket::GMSH_PARAM_QUERY_ALL, msg.size(), &msg[0]);
while(1){
// stop if we have no communications for 10 secs
int ret = _gmshClient->Select(10, 0);
......@@ -740,8 +745,17 @@ namespace onelab{
ps.push_back(p);
return true;
}
if(type == GmshSocket::GMSH_PARAM_QUERY_ALL){
T p;
p.fromChar(msg);
ps.push_back(p);
// do NOT return until all parameters have been downloaded
}
else if(type == GmshSocket::GMSH_PARAM_QUERY_END){
return true;
}
else if(type == GmshSocket::GMSH_INFO){
// parameter not found
// parameter not found or all aparameters have been sent
return true;
}
else{
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment