diff --git a/Fltk/onelabGroup.cpp b/Fltk/onelabGroup.cpp index 5c9c2aa7cfec7bd8abbc9bef428e54ab846f2547..ee5dd436b9181f53008cdbeb940025e43c2ba54f 100644 --- a/Fltk/onelabGroup.cpp +++ b/Fltk/onelabGroup.cpp @@ -395,8 +395,16 @@ bool gmshLocalNetworkClient::receiveMessage(gmshLocalNetworkClient *master) master->addClient(subClient); } } - else - Msg::Error("Redefinition of existing client <%s>",clientName.c_str()); + else{ + std::string reply = ""; + for(onelab::server::citer it = onelab::server::instance()->firstClient(); + it != onelab::server::instance()->lastClient(); it++){ + reply.append(it->second->getName() + " "); + } + Msg::Error("Skipping already existing client < %s> - Registered clients are <%s>",clientName.c_str(),reply.c_str()); + getGmshServer()->SendMessage + (GmshSocket::GMSH_STOP, reply.size(), &reply[0]); // reply is dummy + } } break; case GmshSocket::GMSH_OLPARSE: @@ -411,8 +419,9 @@ bool gmshLocalNetworkClient::receiveMessage(gmshLocalNetworkClient *master) Msg::Info("Preprocess file <%s> done", fullName.c_str()); reply = onelab::server::instance()->getChanged(clientName) ? "true" : "false"; } - else - Msg::Error("Redefinition of existing client <%s>",clientName.c_str()); + else{ + Msg::Error("Skipping client with already existing name <%s>",clientName.c_str()); + } #endif getGmshServer()->SendMessage (GmshSocket::GMSH_OLPARSE, reply.size(), &reply[0]); @@ -422,12 +431,11 @@ bool gmshLocalNetworkClient::receiveMessage(gmshLocalNetworkClient *master) { std::string::size_type first = 0; std::string command = onelab::parameter::getNextToken(message, first); - std::string name = onelab::parameter::getNextToken(message, first); - if(command == "get"){ - std::string reply = onelab::server::instance()->getChanged(name) ? - "true" : "false"; - getGmshServer()->SendMessage - (GmshSocket::GMSH_CLIENT_CHANGED, reply.size(), &reply[0]); + std::string name = onelab::parameter::getNextToken(message, first); + if(command == "get"){ + std::string reply = onelab::server::instance()->getChanged(name) ? "true" : "false"; + getGmshServer()->SendMessage + (GmshSocket::GMSH_CLIENT_CHANGED, reply.size(), &reply[0]); } else if(command == "set"){ std::string changed = onelab::parameter::getNextToken(message, first); diff --git a/contrib/onelab/python/onelab.py b/contrib/onelab/python/onelab.py index 79f8dffb1dd87cb716f43f6a8e1d3e781ea44de4..35891cd6093c1c9150aaf4aeea87c1da37c55b81 100755 --- a/contrib/onelab/python/onelab.py +++ b/contrib/onelab/python/onelab.py @@ -39,7 +39,7 @@ def file_exist(filename): def path(dirname, inp): # dirname is a directory, can be empty - # inp is an aptional file or subdirectory name + # inp is an optional file or subdirectory name # returns the path to 'inp' in the same directory as 'ref' if not inp: return dirname diff --git a/utils/solvers/python/pend.py b/utils/solvers/python/pend.py index b4d5ba2c0f0b2f2d5a736b51c550cb941441135e..34c9d9eaa65db0155ed3f5a985451fd9da437490 100755 --- a/utils/solvers/python/pend.py +++ b/utils/solvers/python/pend.py @@ -10,14 +10,14 @@ import math, os c = onelab.client(__file__) def exportMsh(le1,le2): - mshFile = open(c.cpath("pend.msh"),'w') + mshFile = open(c.checkPath("pend.msh"), 'w') mshFile.write('$MeshFormat\n2.2 0 8\n$EndMeshFormat\n') mshFile.write('$Nodes\n3\n1 0 0 0\n2 0 %s 0\n3 0 %s 0\n$EndNodes\n' %(-le1, -le1-le2)) mshFile.write('$Elements\n3\n1 1 2 0 1 1 2\n2 1 2 0 1 2 3\n3 15 2 0 2 3\n$EndElements\n') mshFile.close() def exportMshOpt(): - optFile = open(c.cpath("pend.msh.opt"),'w') + optFile = open(c.checkPath("pend.msh.opt"),'w') optFile.write('n = PostProcessing.NbViews - 1;\n') optFile.write('If(n >= 0)\nView[n].ShowScale = 0;\nView[n].VectorType = 5;\n') optFile.write('View[n].ExternalView = 0;\nView[n].DisplacementFactor = 1 ;\n') @@ -26,7 +26,7 @@ def exportMshOpt(): optFile.close() def exportIter(iter,t,x1,y1,x2,y2): - mshFile = open(c.cpath("pend.msh"),'a') + mshFile = open(c.checkPath("pend.msh"),'a') mshFile.write('$NodeData\n1\n"motion"\n1\n\t%f\n3\n\t%d\n3\n' % (t, iter)) mshFile.write('\t3\n\t1 0 0 0\n\t2 %f %f 0\n\t3 %f %f 0\n$EndNodeData\n' %(x1,y1,x2,y2)) mshFile.close() @@ -114,7 +114,7 @@ while (time < tmax): exportMsh(l1, l2) exportIter(iter, time, x1, y1+l1, x2, y2+l1+l2) - c.mergeFile(c.cpath('pend.msh')) + c.mergeFile(c.checkPath('pend.msh')) iter += 1 c.setNumber(c.name + '/Progress', value=0)