Skip to content
Snippets Groups Projects
Commit a9922007 authored by Christophe Geuzaine's avatar Christophe Geuzaine
Browse files

fine tuning

parent 40922a3f
No related branches found
No related tags found
No related merge requests found
...@@ -96,18 +96,27 @@ static void gmsh_clscale(Fl_Color c) ...@@ -96,18 +96,27 @@ static void gmsh_clscale(Fl_Color c)
static void gmsh_gear(Fl_Color c) static void gmsh_gear(Fl_Color c)
{ {
fl_color(c); fl_color(c);
fl_line_style(FL_SOLID, 2); double w = 0.12;
fl_begin_line(); fl_arc(0.0, 0.0, 0.5, 0.0, 360.0); fl_end_line(); 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++){ for(int i = 0; i < 8; i++){
fl_rotate(i * 360./8.); fl_rotate(45);
fl_begin_complex_polygon(); fl_begin_polygon();
fl_vertex(0.5, -0.13); fl_vertex(h1, -w);
fl_vertex(1.0, -0.13); fl_vertex(h2, -w);
fl_vertex(1.0, 0.13); fl_vertex(h2, w);
fl_vertex(0.5, 0.13); fl_vertex(h1, w);
fl_end_complex_polygon(); fl_end_polygon();
} }
fl_line_style(FL_SOLID);
} }
static void gmsh_graph(Fl_Color c) static void gmsh_graph(Fl_Color c)
......
...@@ -910,7 +910,7 @@ onelabWindow::onelabWindow(int deltaFontSize) ...@@ -910,7 +910,7 @@ onelabWindow::onelabWindow(int deltaFontSize)
_butt[1]->callback(onelab_cb, (void*)"compute"); _butt[1]->callback(onelab_cb, (void*)"compute");
_gear = new Fl_Menu_Button _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->align(FL_ALIGN_LEFT | FL_ALIGN_INSIDE);
_gear->add("Reset database", 0, onelab_cb, (void*)"reset"); _gear->add("Reset database", 0, onelab_cb, (void*)"reset");
_gear->add("_Print database", 0, onelab_cb, (void*)"dump"); _gear->add("_Print database", 0, onelab_cb, (void*)"dump");
...@@ -975,6 +975,8 @@ void onelabWindow::rebuildTree() ...@@ -975,6 +975,8 @@ void onelabWindow::rebuildTree()
but->value(numbers[i].getValue()); but->value(numbers[i].getValue());
but->callback(onelab_check_button_cb, (void*)n); but->callback(onelab_check_button_cb, (void*)n);
n->widget(but); n->widget(but);
if(numbers[i].getAttribute("Highlight").size())
n->labelbgcolor(FL_YELLOW);
} }
else{ else{
inputRange *but = new inputRange inputRange *but = new inputRange
......
...@@ -87,16 +87,18 @@ class GmshSocket{ ...@@ -87,16 +87,18 @@ class GmshSocket{
// the socket name // the socket name
std::string _sockname; std::string _sockname;
// send some data over the socket // 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; const char *buf = (const char *)buffer;
int sofar = 0; int sofar = 0;
int remaining = bytes; int remaining = bytes;
do { do {
int len = send(_sock, buf + sofar, remaining, 0); int len = send(_sock, buf + sofar, remaining, 0);
if(len < 0) return -1; // error
sofar += len; sofar += len;
remaining -= len; remaining -= len;
} while(remaining > 0); } while(remaining > 0);
return bytes;
} }
// receive some data over the socket // receive some data over the socket
int _ReceiveData(void *buffer, int bytes) int _ReceiveData(void *buffer, int bytes)
...@@ -245,9 +247,6 @@ class GmshClient : public GmshSocket { ...@@ -245,9 +247,6 @@ class GmshClient : public GmshSocket {
~GmshClient(){} ~GmshClient(){}
int Connect(const char *sockname) 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(strstr(sockname, "/") || strstr(sockname, "\\") || !strstr(sockname, ":")){
#if !defined(WIN32) || defined(__CYGWIN__) #if !defined(WIN32) || defined(__CYGWIN__)
// UNIX socket (testing ":" is not enough with Windows paths) // UNIX socket (testing ":" is not enough with Windows paths)
...@@ -407,7 +406,7 @@ class GmshServer : public GmshSocket{ ...@@ -407,7 +406,7 @@ class GmshServer : public GmshSocket{
} }
// wait until we get data // wait until we get data
int ret = NonBlockingWait(tmpsock, 0.5, timeout); int ret = NonBlockingWait(tmpsock, 0.001, timeout);
if(ret){ if(ret){
CloseSocket(tmpsock); CloseSocket(tmpsock);
if(ret == 2){ if(ret == 2){
......
...@@ -233,6 +233,7 @@ namespace onelab{ ...@@ -233,6 +233,7 @@ namespace onelab{
setMax(p.getMax()); setMax(p.getMax());
setStep(p.getStep()); setStep(p.getStep());
setChoices(p.getChoices()); setChoices(p.getChoices());
setVisible(p.getVisible());// FIXME Why not?
} }
std::string toChar() const std::string toChar() const
{ {
...@@ -296,6 +297,7 @@ namespace onelab{ ...@@ -296,6 +297,7 @@ namespace onelab{
setChanged(true); setChanged(true);
} }
setChoices(p.getChoices()); setChoices(p.getChoices());
setVisible(p.getVisible());// FIXME Why not?
} }
std::string toChar() const std::string toChar() const
{ {
...@@ -743,8 +745,8 @@ namespace onelab{ ...@@ -743,8 +745,8 @@ namespace onelab{
_gmshClient->SendMessage(GmshSocket::GMSH_PARAM_QUERY_ALL, msg.size(), &msg[0]); _gmshClient->SendMessage(GmshSocket::GMSH_PARAM_QUERY_ALL, msg.size(), &msg[0]);
while(1){ while(1){
// stop if we have no communications for 10 secs // stop if we have no communications for 5 minutes
int ret = _gmshClient->Select(10, 0); int ret = _gmshClient->Select(500, 0);
if(!ret){ if(!ret){
_gmshClient->Info("Timout: aborting remote get"); _gmshClient->Info("Timout: aborting remote get");
return false; return false;
......
...@@ -8,7 +8,7 @@ ...@@ -8,7 +8,7 @@
// 2) Add it to Gmsh: // 2) Add it to Gmsh:
// - launch Gmsh and open Tools->OneLab // - launch Gmsh and open Tools->OneLab
// - In the gear menu, select "Add new client" // - 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) int main(int argc, char **argv)
{ {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment