diff --git a/Fltk/graphicWindow.cpp b/Fltk/graphicWindow.cpp index 90f7cca754a33c1b98e2a05936ea1e1bf144e390..c0aeaab8d98e1cb8373bf7b1a655605ca02b5dc2 100644 --- a/Fltk/graphicWindow.cpp +++ b/Fltk/graphicWindow.cpp @@ -96,18 +96,27 @@ static void gmsh_clscale(Fl_Color c) static void gmsh_gear(Fl_Color c) { fl_color(c); - fl_line_style(FL_SOLID, 2); - fl_begin_line(); fl_arc(0.0, 0.0, 0.5, 0.0, 360.0); fl_end_line(); + double w = 0.12; + double h1 = 0.5; +#if defined(WIN32) + double h2 = 1.0; +#else + double h2 = 1.05; +#endif + fl_line_style(FL_SOLID, 3); + fl_begin_line(); + fl_circle(0, 0, 0.5); + fl_end_line(); + fl_line_style(FL_SOLID); for(int i = 0; i < 8; i++){ - fl_rotate(i * 360./8.); - fl_begin_complex_polygon(); - fl_vertex(0.5, -0.13); - fl_vertex(1.0, -0.13); - fl_vertex(1.0, 0.13); - fl_vertex(0.5, 0.13); - fl_end_complex_polygon(); + fl_rotate(45); + fl_begin_polygon(); + fl_vertex(h1, -w); + fl_vertex(h2, -w); + fl_vertex(h2, w); + fl_vertex(h1, w); + fl_end_polygon(); } - fl_line_style(FL_SOLID); } static void gmsh_graph(Fl_Color c) diff --git a/Fltk/onelabWindow.cpp b/Fltk/onelabWindow.cpp index 0e6271d0b605abf7058cfec2e5c5f174b1105d8e..ea5e0cb48e25cd719c1a17b70d6115db4b39923e 100644 --- a/Fltk/onelabWindow.cpp +++ b/Fltk/onelabWindow.cpp @@ -910,7 +910,7 @@ onelabWindow::onelabWindow(int deltaFontSize) _butt[1]->callback(onelab_cb, (void*)"compute"); _gear = new Fl_Menu_Button - (_butt[0]->x() - WB - BB/2, _butt[0]->y(), BB/2, BH, "@-1gmsh_gear"); + (_butt[0]->x() - WB - BB/2, _butt[0]->y(), BB/2, BH, "@gmsh_gear"); _gear->align(FL_ALIGN_LEFT | FL_ALIGN_INSIDE); _gear->add("Reset database", 0, onelab_cb, (void*)"reset"); _gear->add("_Print database", 0, onelab_cb, (void*)"dump"); @@ -975,6 +975,8 @@ void onelabWindow::rebuildTree() but->value(numbers[i].getValue()); but->callback(onelab_check_button_cb, (void*)n); n->widget(but); + if(numbers[i].getAttribute("Highlight").size()) + n->labelbgcolor(FL_YELLOW); } else{ inputRange *but = new inputRange diff --git a/utils/solvers/c++/GmshSocket.h b/utils/solvers/c++/GmshSocket.h index be235548c61b5b1d3d1b10858e7edcdc2d4508d8..32fcd79077e36a6231c7f9986e91b4d8644d037c 100644 --- a/utils/solvers/c++/GmshSocket.h +++ b/utils/solvers/c++/GmshSocket.h @@ -87,16 +87,18 @@ class GmshSocket{ // the socket name std::string _sockname; // send some data over the socket - void _SendData(const void *buffer, int bytes) + int _SendData(const void *buffer, int bytes) { const char *buf = (const char *)buffer; int sofar = 0; int remaining = bytes; do { int len = send(_sock, buf + sofar, remaining, 0); + if(len < 0) return -1; // error sofar += len; remaining -= len; } while(remaining > 0); + return bytes; } // receive some data over the socket int _ReceiveData(void *buffer, int bytes) @@ -245,9 +247,6 @@ class GmshClient : public GmshSocket { ~GmshClient(){} int Connect(const char *sockname) { - // slight delay to make sure that the socket is bound by the - // server before we attempt to connect to it - _Sleep(100); if(strstr(sockname, "/") || strstr(sockname, "\\") || !strstr(sockname, ":")){ #if !defined(WIN32) || defined(__CYGWIN__) // UNIX socket (testing ":" is not enough with Windows paths) @@ -407,7 +406,7 @@ class GmshServer : public GmshSocket{ } // wait until we get data - int ret = NonBlockingWait(tmpsock, 0.5, timeout); + int ret = NonBlockingWait(tmpsock, 0.001, timeout); if(ret){ CloseSocket(tmpsock); if(ret == 2){ diff --git a/utils/solvers/c++/onelab.h b/utils/solvers/c++/onelab.h index 47886580edf0d5fba818649591a26e3e6e40a959..8890faede0c71182964a249ae45dc767c0c8ba18 100644 --- a/utils/solvers/c++/onelab.h +++ b/utils/solvers/c++/onelab.h @@ -233,6 +233,7 @@ namespace onelab{ setMax(p.getMax()); setStep(p.getStep()); setChoices(p.getChoices()); + setVisible(p.getVisible());// FIXME Why not? } std::string toChar() const { @@ -296,6 +297,7 @@ namespace onelab{ setChanged(true); } setChoices(p.getChoices()); + setVisible(p.getVisible());// FIXME Why not? } std::string toChar() const { @@ -743,8 +745,8 @@ namespace onelab{ _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); + // stop if we have no communications for 5 minutes + int ret = _gmshClient->Select(500, 0); if(!ret){ _gmshClient->Info("Timout: aborting remote get"); return false; diff --git a/utils/solvers/c++/solver.cpp b/utils/solvers/c++/solver.cpp index 446915eeedbdf6c8689c32579fea83e0af03a7b2..725a620e406372afe63238079101d7d57b85ea26 100644 --- a/utils/solvers/c++/solver.cpp +++ b/utils/solvers/c++/solver.cpp @@ -8,7 +8,7 @@ // 2) Add it to Gmsh: // - launch Gmsh and open Tools->OneLab // - In the gear menu, select "Add new client" -// - Enter "My Solver" as client name, then choose the exe in the dialog +// - Enter a client name of your choice, then choose this exe in the dialog int main(int argc, char **argv) {