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

onelab: "Refresh" to manually refresh the display while codes are running +...

onelab: "Refresh" to manually refresh the display while codes are running + send Action=stop to clients when a stop is requested
parent 491c2c84
Branches
Tags
No related merge requests found
......@@ -78,7 +78,7 @@ class CTX {
int sessionSave, optionsSave;
// ask confirmation when overwriting files?
int confirmOverwrite;
// forced display host:0.0 under X11
// forced display host:0.0 under X11
std::string display;
// FLTK theme
std::string guiTheme;
......@@ -103,7 +103,7 @@ class CTX {
// batch mode (-4: lua session, -3: server daemon, -2: check coherence, -1: write
// geo, 0: full gfx, 1: 1D mesh, 2: 2D mesh, 3: 3D mesh, 4: adapt
// mesh, 5: refine mesh)
int batch;
int batch;
// batch operations to apply after meshing (1: partition mesh)
int batchAfterMesh;
// initial menu (0: automatic, 1: geom, 2: mesh, 3: solver, 4: post)
......@@ -132,7 +132,7 @@ class CTX {
// double buffer/antialias/stereo graphics?
int db, antialiasing, stereo, camera;
double eye_sep_ratio,focallength_ratio,camera_aperture;
// orthogonal projection?
// orthogonal projection?
int ortho;
// draw the bounding boxes and the rot center?
int drawBBox, drawRotationCenter;
......@@ -144,7 +144,7 @@ class CTX {
int axes, axesAutoPosition, axesTics[3], axesMikado;
double axesPosition[6];
std::string axesLabel[3], axesFormat[3];
// simple dynamic lock (should be a mutex)
// simple dynamic lock (should be a mutex)
int lock;
// enable alpha blending?
int alpha;
......@@ -195,29 +195,29 @@ class CTX {
// temporary storage of rotation, translation, scale (until the GUI
// is ready)
double tmpRotation[3], tmpTranslation[3], tmpScale[3], tmpQuaternion[4];
// geometry options
// geometry options
contextGeometryOptions geom;
// mesh options
// mesh options
contextMeshOptions mesh;
// FIXME: putting these in the mesh struct (where they belong) causes
// FIXME: putting these in the mesh struct (where they belong) causes
// an LNK1179 error ("duplicate COMDAT") with MSVC...
meshPartitionOptions partitionOptions;
CGNSOptions cgnsOptions;
// post processing options
// post processing options
struct{
int draw, link, horizontalScales;
int smooth, animCycle, animStep, combineTime, combineRemoveOrig;
int fileFormat, plugins;
double animDelay;
}post;
// solver options
// solver options
struct{
int plugins, listen;
double timeout;
std::string socketName;
std::string name[5], commandLine[5];
std::string name[5], executable[5], hostname[5];
}solver;
// print options
// print options
struct{
int fileFormat, epsQuality, epsCompress, epsPS3Shading;
int epsOcclusionCulling, epsBestRoot;
......@@ -253,7 +253,7 @@ class CTX {
int unpackGreen(unsigned int X);
int unpackBlue(unsigned int X);
int unpackAlpha(unsigned int X);
};
#endif
This diff is collapsed.
This diff is collapsed.
......@@ -22,7 +22,7 @@
#define OPT_ARGS_STR int num, int action, std::string val
#define OPT_ARGS_NUM int num, int action, double val
#define OPT_ARGS_COL int num, int action, unsigned int val
// STRINGS
std::string opt_general_axes_label0(OPT_ARGS_STR);
......@@ -63,6 +63,12 @@ std::string opt_solver_executable1(OPT_ARGS_STR);
std::string opt_solver_executable2(OPT_ARGS_STR);
std::string opt_solver_executable3(OPT_ARGS_STR);
std::string opt_solver_executable4(OPT_ARGS_STR);
std::string opt_solver_hostname(OPT_ARGS_STR);
std::string opt_solver_hostname0(OPT_ARGS_STR);
std::string opt_solver_hostname1(OPT_ARGS_STR);
std::string opt_solver_hostname2(OPT_ARGS_STR);
std::string opt_solver_hostname3(OPT_ARGS_STR);
std::string opt_solver_hostname4(OPT_ARGS_STR);
std::string opt_view_name(OPT_ARGS_STR);
std::string opt_view_format(OPT_ARGS_STR);
std::string opt_view_filename(OPT_ARGS_STR);
......@@ -609,7 +615,7 @@ unsigned int opt_general_color_small_axes(OPT_ARGS_COL);
unsigned int opt_general_color_ambient_light(OPT_ARGS_COL);
unsigned int opt_general_color_diffuse_light(OPT_ARGS_COL);
unsigned int opt_general_color_specular_light(OPT_ARGS_COL);
unsigned int opt_geometry_color_points(OPT_ARGS_COL);
unsigned int opt_geometry_color_points(OPT_ARGS_COL);
unsigned int opt_geometry_color_lines(OPT_ARGS_COL);
unsigned int opt_geometry_color_surfaces(OPT_ARGS_COL);
unsigned int opt_geometry_color_volumes(OPT_ARGS_COL);
......@@ -620,9 +626,9 @@ unsigned int opt_geometry_color_highlight2(OPT_ARGS_COL);
unsigned int opt_geometry_color_tangents(OPT_ARGS_COL);
unsigned int opt_geometry_color_normals(OPT_ARGS_COL);
unsigned int opt_geometry_color_projection(OPT_ARGS_COL);
unsigned int opt_mesh_color_points(OPT_ARGS_COL);
unsigned int opt_mesh_color_points_sup(OPT_ARGS_COL);
unsigned int opt_mesh_color_lines(OPT_ARGS_COL);
unsigned int opt_mesh_color_points(OPT_ARGS_COL);
unsigned int opt_mesh_color_points_sup(OPT_ARGS_COL);
unsigned int opt_mesh_color_lines(OPT_ARGS_COL);
unsigned int opt_mesh_color_triangles(OPT_ARGS_COL);
unsigned int opt_mesh_color_quadrangles(OPT_ARGS_COL);
unsigned int opt_mesh_color_tetrahedra(OPT_ARGS_COL);
......@@ -668,7 +674,7 @@ unsigned int opt_view_color_axes(OPT_ARGS_COL);
// Data structures and global functions
typedef struct {
const char *str ;
const char *str ;
int int1, int2, int3, int4 ;
} StringX4Int;
......@@ -705,11 +711,11 @@ void ReInitOptions(int num);
void PrintOptions(int num, int level, int diff, int help, const char *filename);
void PrintOptionsDoc();
bool StringOption(int action, const char *category, int num,
bool StringOption(int action, const char *category, int num,
const char *name, std::string &val);
bool NumberOption(int action, const char *category, int num,
bool NumberOption(int action, const char *category, int num,
const char *name, double &val);
bool ColorOption(int action, const char *category, int num,
bool ColorOption(int action, const char *category, int num,
const char *name, unsigned int &val);
GmshColorTable *GetColorTable(int num);
......
......@@ -533,6 +533,13 @@ static void updateOnelabGraphs()
drawContext::global()->draw();
}
static void importPhysicalGroups(GModel *m)
{
std::map<int, std::vector<GEntity*> > groups[4];
m->getPhysicalGroups(groups);
}
static void runGmshClient(const std::string &action)
{
if(action == "initialize") return;
......@@ -557,6 +564,7 @@ static void runGmshClient(const std::string &action)
// the model name has changed
modelName = GModel::current()->getName();
geometry_reload_cb(0, 0);
importPhysicalGroups(GModel::current());
}
}
else if(action == "compute"){
......@@ -567,6 +575,7 @@ static void runGmshClient(const std::string &action)
// changed
modelName = GModel::current()->getName();
geometry_reload_cb(0, 0);
importPhysicalGroups(GModel::current());
if(FlGui::instance()->onelab->meshAuto()){
mesh_3d_cb(0, 0);
CreateOutputFile(mshFileName, CTX::instance()->mesh.fileFormat);
......@@ -588,9 +597,24 @@ void onelab_cb(Fl_Widget *w, void *data)
if(!data) return;
std::string action((const char*)data);
if(action == "refresh"){
static int recurse = false;
if(recurse) return;
recurse = true;
updateOnelabGraphs();
FlGui::instance()->onelab->rebuildTree();
recurse = false;
return;
}
if(action == "stop"){
FlGui::instance()->onelab->stop(true);
FlGui::instance()->onelab->setButtonMode("kill");
for(onelab::server::citer it = onelab::server::instance()->firstClient();
it != onelab::server::instance()->lastClient(); it++){
onelab::string o(it->second->getName() + "/Action", "stop");
onelab::server::instance()->set(o);
}
return;
}
......@@ -954,17 +978,20 @@ void onelabWindow::setButtonMode(const std::string &mode)
if(mode == "compute"){
_butt[0]->label("Compute");
_butt[0]->callback(onelab_cb, (void*)"compute");
_butt[1]->activate();
_butt[1]->label("Check");
_butt[1]->callback(onelab_cb, (void*)"check");
}
else if(mode == "stop"){
_butt[0]->label("Stop");
_butt[0]->callback(onelab_cb, (void*)"stop");
_butt[1]->deactivate();
_butt[1]->label("Refresh");
_butt[1]->callback(onelab_cb, (void*)"refresh");
}
else{
_butt[0]->label("Kill");
_butt[0]->callback(onelab_cb, (void*)"kill");
_butt[1]->deactivate();
_butt[1]->label("Refresh");
_butt[1]->callback(onelab_cb, (void*)"refresh");
}
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment