From 86d9ce5231a4bc993555624845929bb7066b29d5 Mon Sep 17 00:00:00 2001
From: Christophe Geuzaine <cgeuzaine@ulg.ac.be>
Date: Sat, 1 Oct 2011 16:13:56 +0000
Subject: [PATCH] onelab communicates :-)

---
 Common/onelab.h       | 12 ++++++++----
 Fltk/onelabWindow.cpp |  3 ++-
 2 files changed, 10 insertions(+), 5 deletions(-)

diff --git a/Common/onelab.h b/Common/onelab.h
index 431f6fb47c..2ea3992281 100644
--- a/Common/onelab.h
+++ b/Common/onelab.h
@@ -375,8 +375,8 @@ namespace onelab{
     client(const std::string &name) : _name(name){}
     virtual ~client(){}
     std::string getName(){ return _name; }
-    virtual bool run(const std::string &what) = 0;
-    virtual bool kill() = 0;
+    virtual bool run(const std::string &what){ return false; }
+    virtual bool kill(){ return false; }
   };
 
   // The onelab server: a singleton that stores the parameter space
@@ -445,8 +445,6 @@ namespace onelab{
       _server->get(parameters, name);
       return true;
     }
-    virtual bool run(const std::string &what){ return false; }
-    virtual bool kill(){ return false; }
   };
 
   class localNetworkClient : public localClient{
@@ -540,6 +538,12 @@ namespace onelab{
       }
       return true;
     }
+    void sendInfo(const std::string &msg){ _gmshClient->Info(msg.c_str()); }
+    void sendWarning(const std::string &msg){ _gmshClient->Warning(msg.c_str()); }
+    void sendError(const std::string &msg){ _gmshClient->Error(msg.c_str()); }
+    void sendProgress(const std::string &msg){ _gmshClient->Progress(msg.c_str()); }
+    void sendMergeFileRequest(const std::string &msg){ _gmshClient->MergeFile(msg.c_str()); }
+    void sendParseStringRequest(const std::string &msg){ _gmshClient->ParseString(msg.c_str()); }
   };
 
 }
diff --git a/Fltk/onelabWindow.cpp b/Fltk/onelabWindow.cpp
index 7aa28c2860..0d5991cc09 100644
--- a/Fltk/onelabWindow.cpp
+++ b/Fltk/onelabWindow.cpp
@@ -64,7 +64,7 @@ bool onelab::localNetworkClient::run(const std::string &what)
   onelabGmshServer *server = new onelabGmshServer(this);
  
   std::string sockname = "localhost:1631";
-  std::string command = "getdp -onelab -socket localhost:1631 test.pro &";
+  std::string command = _commandLine + " " + what +  " -onelab " + sockname + " &";
 
   int sock;
   try{
@@ -164,6 +164,7 @@ void onelab_cb(Fl_Widget *w, void *data)
       it != onelab::server::instance()->lastClient(); it++){
     onelab::client *c = it->second;
     printf("client name = %s\n", c->getName().c_str());
+    c->run("/Users/geuzaine/src/getdp/demos/test.pro");
   }
   FlGui::instance()->onelab->show();
 }
-- 
GitLab