From 1b298e9086a02d7c353f00fef4252c3c002a1b21 Mon Sep 17 00:00:00 2001 From: Christophe Geuzaine <cgeuzaine@ulg.ac.be> Date: Mon, 5 May 2014 14:54:08 +0000 Subject: [PATCH] fix add_param for new onelab syntax --- Fltk/contextWindow.cpp | 2 +- Geo/GeoStringInterface.cpp | 13 ++++++++++--- 2 files changed, 11 insertions(+), 4 deletions(-) diff --git a/Fltk/contextWindow.cpp b/Fltk/contextWindow.cpp index 24893d81f3..deff8252b1 100644 --- a/Fltk/contextWindow.cpp +++ b/Fltk/contextWindow.cpp @@ -67,7 +67,7 @@ geometryContextWindow::geometryContextWindow(int deltaFontSize) input[24] = new Fl_Input(2 * WB, 2 * WB + 3 * BH, IW, BH, "Label"); input[24]->value(""); input[25] = new Fl_Input(2 * WB, 2 * WB + 4 * BH, IW, BH, "Path"); - input[25]->value("Gmsh/Parameters"); + input[25]->value("Parameters"); for(int i = 0; i < 2; i++) input[i]->align(FL_ALIGN_RIGHT); for(int i = 24; i < 26; i++) input[i]->align(FL_ALIGN_RIGHT); { diff --git a/Geo/GeoStringInterface.cpp b/Geo/GeoStringInterface.cpp index 8913de0964..68e7fef955 100644 --- a/Geo/GeoStringInterface.cpp +++ b/Geo/GeoStringInterface.cpp @@ -241,9 +241,16 @@ void add_param(std::string par, std::string value, std::string label, { std::ostringstream sstream; sstream << "DefineConstant[ " << par << " = { " << value; - if(label.size()) sstream << ", Label \"" << label << "\""; - if(path.size()) sstream << ", Path \"" << path << "\""; - sstream << "}];"; + sstream << ", Name \""; + if(path.size() && label.size()) + sstream << path << "/" << label; + else if(path.size()) + sstream << path << "/" << par; + else if(label.size()) + sstream << label; + else + sstream << par; + sstream << "\"}];"; add_infile(sstream.str(), fileName); } -- GitLab