Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
gmsh
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Larry Price
gmsh
Commits
5b06a8ac
Commit
5b06a8ac
authored
13 years ago
by
Christophe Geuzaine
Browse files
Options
Downloads
Patches
Plain Diff
error handling
parent
bc5df8d7
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
Common/GmshMessage.h
+1
-0
1 addition, 0 deletions
Common/GmshMessage.h
Fltk/onelabWindow.cpp
+21
-3
21 additions, 3 deletions
Fltk/onelabWindow.cpp
with
22 additions
and
3 deletions
Common/GmshMessage.h
+
1
−
0
View file @
5b06a8ac
...
...
@@ -76,6 +76,7 @@ class Msg {
static
double
&
Timer
(
std
::
string
str
){
return
_timers
[
str
];
}
static
void
PrintTimers
();
static
void
ResetErrorCounter
(){
_warningCount
=
0
;
_errorCount
=
0
;
}
static
int
GetErrorCount
(){
return
_errorCount
;
}
static
void
PrintErrorCounter
(
const
char
*
title
);
static
double
GetValue
(
const
char
*
text
,
double
defaultval
);
static
std
::
string
GetString
(
const
char
*
text
,
std
::
string
defaultval
);
...
...
This diff is collapsed.
Click to expand it.
Fltk/onelabWindow.cpp
+
21
−
3
View file @
5b06a8ac
...
...
@@ -414,6 +414,19 @@ static bool incrementLoop()
return
ret
;
}
static
bool
stopOnError
(
const
std
::
string
&
client
)
{
if
(
Msg
::
GetErrorCount
()
>
0
&&
!
CTX
::
instance
()
->
expertMode
){
Msg
::
ResetErrorCounter
();
std
::
string
msg
(
client
+
" reported an error: do you really want to continue?
\n\n
"
"(To disable this warning in the future, select `Enable expert mode'
\n
"
"in the option dialog."
);
if
(
Msg
::
GetAnswer
(
msg
.
c_str
(),
1
,
"Stop"
,
"Continue"
)
==
0
)
return
true
;
}
return
false
;
}
void
onelab_cb
(
Fl_Widget
*
w
,
void
*
data
)
{
if
(
!
data
)
return
;
...
...
@@ -442,6 +455,8 @@ void onelab_cb(Fl_Widget *w, void *data)
if
(
action
==
"compute"
)
initializeLoop
();
bool
stop
=
false
;
do
{
// enter computation loop
// the Gmsh client is special: it always gets executed first. (The
...
...
@@ -478,7 +493,6 @@ void onelab_cb(Fl_Widget *w, void *data)
geometry_reload_cb
(
0
,
0
);
if
(
FlGui
::
instance
()
->
onelab
->
meshAuto
()){
mesh_3d_cb
(
0
,
0
);
// FIXME: check if meshing succeeded
CreateOutputFile
(
mshFileName
,
CTX
::
instance
()
->
mesh
.
fileFormat
);
}
}
...
...
@@ -486,13 +500,14 @@ void onelab_cb(Fl_Widget *w, void *data)
// mesh+save if the mesh file does not exist
if
(
FlGui
::
instance
()
->
onelab
->
meshAuto
()){
mesh_3d_cb
(
0
,
0
);
// FIXME: check if meshing succeeded
CreateOutputFile
(
mshFileName
,
CTX
::
instance
()
->
mesh
.
fileFormat
);
}
}
onelab
::
server
::
instance
()
->
setChanged
(
false
,
"Gmsh"
);
}
}
stop
=
stopOnError
(
"Gmsh"
);
if
(
stop
)
break
;
// Iterate over all other clients
for
(
onelab
::
server
::
citer
it
=
onelab
::
server
::
instance
()
->
firstClient
();
...
...
@@ -516,11 +531,14 @@ void onelab_cb(Fl_Widget *w, void *data)
else
if
(
action
==
"kill"
){
c
->
kill
();
}
stop
=
stopOnError
(
c
->
getName
());
if
(
stop
)
break
;
}
FlGui
::
instance
()
->
onelab
->
rebuildTree
();
}
while
(
action
==
"compute"
&&
incrementLoop
());
}
while
(
action
==
"compute"
&&
incrementLoop
()
&&
!
stop
);
FlGui
::
instance
()
->
onelab
->
activate
();
FlGui
::
instance
()
->
onelab
->
show
();
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment