diff --git a/Common/CommandLine.cpp b/Common/CommandLine.cpp index 2620a68b484bab961f9d23ca79344b3fe4a94b33..fce0f0d3b1e878eabb5a07166e77627c327706df 100644 --- a/Common/CommandLine.cpp +++ b/Common/CommandLine.cpp @@ -149,7 +149,6 @@ void GetOptions(int argc, char *argv[]) Msg::InitializeOnelab("GmshOnelab", argv[i++]); else Msg::Fatal("Missing string"); - //CTX::instance()->batch = -4; } else if(!strcmp(argv[i] + 1, "socket")) { i++; diff --git a/Common/Gmsh.cpp b/Common/Gmsh.cpp index 844fd7a393ec664b10e75e8f3bd90640ddf92e67..2628b3d73e8a6d989f33887b27d970c19333cea4 100644 --- a/Common/Gmsh.cpp +++ b/Common/Gmsh.cpp @@ -153,10 +153,7 @@ int GmshBatch() } #endif - if(CTX::instance()->batch == -4){ - // - } - else if(CTX::instance()->batch == -3){ + if(CTX::instance()->batch == -3){ GmshRemote(); } else if(CTX::instance()->batch == -2){ diff --git a/Common/GmshSocket.h b/Common/GmshSocket.h index a2880e7c734bdced52de8016a3ab1054ea1f2a58..a7f8c582f40881b0ea15f5ab6905323cb1fa02ff 100644 --- a/Common/GmshSocket.h +++ b/Common/GmshSocket.h @@ -393,7 +393,7 @@ class GmshServer : public GmshSocket{ #if !defined(WIN32) cmd += " &"; #endif - SystemCall(cmd.c_str()); // starts the solver + SystemCall(cmd.c_str()); // start the solver } else{ timeout = 0.; // no command launched: don't set a timeout diff --git a/Common/onelab.h b/Common/onelab.h index eee6980177eaa639da7c003cab0c17eafe64852d..7a1e2631f2977a05512d205c7f0ece964664c52a 100644 --- a/Common/onelab.h +++ b/Common/onelab.h @@ -610,7 +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(); }; + int getNumClients() { return _clients.size(); }; citer findClient(const std::string &name){ return _clients.find(name); } void registerClient(client *c) { diff --git a/Fltk/onelabWindow.cpp b/Fltk/onelabWindow.cpp index b3033daaedf3f28a72bfbbfe5852a38e3004796d..0539f4a64ba7814ef1c5c036a995ec65bf08a375 100644 --- a/Fltk/onelabWindow.cpp +++ b/Fltk/onelabWindow.cpp @@ -181,12 +181,11 @@ bool onelab::localNetworkClient::run(const std::string &what) set(p); } else - Msg::Error("FIXME not done for this parameter type"); + Msg::Error("FIXME not done for this parameter type: %s", type.c_str()); } break; case GmshSocket::GMSH_PARAMETER_QUERY: { - std::cout << "FHF Message=" << message << std::endl; std::string version, type, name, reply; onelab::parameter::getInfoFromChar(message, version, type, name); if(type == "number"){ @@ -216,25 +215,28 @@ bool onelab::localNetworkClient::run(const std::string &what) onelab::parameter::getInfoFromChar(message, version, type, name); if(type == "number"){ std::vector<onelab::number> numbers; - get(numbers, ""); - for(std::vector<onelab::number>::iterator it = numbers.begin(); it != numbers.end(); it++){ + get(numbers); + for(std::vector<onelab::number>::iterator it = numbers.begin(); + it != numbers.end(); it++){ reply = (*it).toChar(); server->SendMessage(GmshSocket::GMSH_PARAM_QUERY_ALL, reply.size(), &reply[0]); } + reply = "OneLab: sent all numbers"; server->SendMessage(GmshSocket::GMSH_PARAM_QUERY_END, reply.size(), &reply[0]); } else if(type == "string"){ std::vector<onelab::string> strings; - get(strings, ""); - for(std::vector<onelab::string>::iterator it = strings.begin(); it != strings.end(); it++){ + get(strings); + for(std::vector<onelab::string>::iterator it = strings.begin(); + it != strings.end(); it++){ reply = (*it).toChar(); server->SendMessage(GmshSocket::GMSH_PARAM_QUERY_ALL, reply.size(), &reply[0]); } - reply = "ONELAB: Downloaded strings."; + reply = "OneLab: sent all strings"; server->SendMessage(GmshSocket::GMSH_PARAM_QUERY_END, reply.size(), &reply[0]); } else - Msg::Fatal("FIXME query not done for this parameter type: %s", message.c_str()); + Msg::Error("FIXME query not done for this parameter type: %s", type.c_str()); } break; case GmshSocket::GMSH_PROGRESS: @@ -653,11 +655,15 @@ void onelab_cb(Fl_Widget *w, void *data) c->getName() == "GmshRemote") // distant post-processing Gmsh client continue; std::string what = getModelName(c); + + // FIXME this should be uniformized (probably just be setting a onelab + // variable to "check" or "compute", and letting the client decide what to + // do) if(action == "check"){ if(c->getName() == "GetDP") c->run(what); else - c->run(what+" -a "); // option -a pour 'analyse only' + c->run(what + " -a "); // '-a' for 'analyse only' } else if(action == "compute"){ if(c->getName() == "GetDP"){