Skip to content
Snippets Groups Projects
Commit 24ca09ab authored by Francois Henrotte's avatar Francois Henrotte
Browse files

transfer Info and Errors to the Message console of Gmsh

parent 2e20a1eb
No related branches found
No related tags found
No related merge requests found
......@@ -115,11 +115,11 @@ std::string localNetworkSolverClient::appendArguments(){
}
else if(action == "check") {
command.assign(" " + getString("Arguments") + " " + checkCommand) ;
command.append(" " + getSocketSwitch() + " " + getName() + " %s");
command.append(" " + getSocketSwitch() + " \"" + getName() + "\" %s");
}
else if(action == "compute"){
command.assign(" " + getString("Arguments") + " " + computeCommand);
command.append(" " + getSocketSwitch() + " " + getName() + " %s");
command.append(" " + getSocketSwitch() + " \"" + getName() + "\" %s");
}
else
OLMsg::Error("appendArguments: Unknown Action <%s>", action.c_str());
......
......@@ -118,8 +118,9 @@ void OLMsg::Error(const char *fmt, ...)
vsnprintf(str, sizeof(str), fmt, args);
va_end(args);
if(_callback) (*_callback)("Error", str);
if(_client) _client->Error(str);
//if(_callback) (*_callback)("Error", str);
//if(_client) _client->Error(str);
if(_onelabClient) _onelabClient->sendError(str);
if(ALWAYS_TRUE){
if(_commSize > 1)
......@@ -142,8 +143,9 @@ void OLMsg::Warning(const char *fmt, ...)
vsnprintf(str, sizeof(str), fmt, args);
va_end(args);
if(_callback) (*_callback)("Warning", str);
if(_client) _client->Warning(str);
//if(_callback) (*_callback)("Warning", str);
//if(_client) _client->Warning(str);
if(_onelabClient) _onelabClient->sendWarning(str);
if(ALWAYS_TRUE){
fprintf(stderr, "Warning : %s\n", str);
......@@ -161,8 +163,9 @@ void OLMsg::Info(const char *fmt, ...)
vsnprintf(str, sizeof(str), fmt, args);
va_end(args);
if(_callback) (*_callback)("Info", str);
if(_client) _client->Info(str);
//if(_callback) (*_callback)("Info", str);
//if(_client) _client->Info(str);
if(_onelabClient) _onelabClient->sendInfo(str);
if(ALWAYS_TRUE){
fprintf(stdout, "Onelab : %s\n", str);
......
......@@ -105,11 +105,11 @@ class OLMsg {
static std::string GetLoaderName(){ return _loaderName; }
static void SetGuiWaitFunction(void (*fct)(double time));
static void (*GetGuiWaitFunction())(double);
static void SetOnelabClient(onelab::client *client){ _onelabClient = client;}
static void InitializeOnelab(const std::string &name);
static void FinalizeOnelab();
static void SetOnelabClient(onelab::client *client){ _onelabClient = client; }
static void SetOnelabNumber(std::string name, double val, bool visible=true);
static void GetOnelabNumber(std::string name, double *val);
static double GetOnelabNumber(std::string name);
......
......@@ -2,7 +2,7 @@
#include "metamodel.h"
void initializeMetamodel(const std::string &loaderName, onelab::client *client, void (*gui_wait_fct)(double time))
void initializeMetamodel(const std::string &loaderName, onelab::client *olclient, void (*gui_wait_fct)(double time))
{
//called by "metamodel_cb"
//copies the Msg::_onelabClient to OLMsg::_onelabClient
......@@ -11,7 +11,7 @@ void initializeMetamodel(const std::string &loaderName, onelab::client *client,
//Initilizes also the wait function the Gmsh Gui
//so that Gmsh windows may remain active during client computations.
OLMsg::SetLoaderName(loaderName);
OLMsg::SetOnelabClient(client);
OLMsg::SetOnelabClient(olclient);
OLMsg::SetGuiWaitFunction(gui_wait_fct);
}
......@@ -42,8 +42,11 @@ int metamodel(const std::string &action){
myModel->setTodo(todo);
if(OLMsg::GetOnelabNumber("LOGFILES")){
freopen("stdout.txt","w",stdout);
freopen("stderr.txt","w",stderr);
if(workingDir.size()) workingDir.append(dirSep);
std::string mystdout = workingDir + "stdout.txt";
std::string mystderr = workingDir + "stderr.txt";
freopen(mystdout.c_str(),"w",stdout);
freopen(mystderr.c_str(),"w",stderr);
}
//if not all clients have valid commandlines -> exit metamodel
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment