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
9c38c59b
Commit
9c38c59b
authored
11 years ago
by
Christophe Geuzaine
Browse files
Options
Downloads
Patches
Plain Diff
fix compute command + simplify onelab_cb logic
parent
4cdd27f7
No related branches found
No related tags found
No related merge requests found
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
contrib/mobile/drawContext.cpp
+29
-44
29 additions, 44 deletions
contrib/mobile/drawContext.cpp
with
29 additions
and
44 deletions
contrib/mobile/drawContext.cpp
+
29
−
44
View file @
9c38c59b
...
...
@@ -62,6 +62,8 @@ void drawContext::load(std::string filename)
// restore default options
GmshRestoreDefaultOptions
();
// output messages on console
GmshSetOption
(
"General"
,
"Terminal"
,
1.0
);
// open the file with Gmsh
...
...
@@ -659,13 +661,12 @@ std::vector<std::string> commandToVector(const std::string cmd)
ret
.
push_back
(
cmd
.
substr
(
last
,
pos
-
1
-
last
));
last
=
pos
;
}
ret
.
push_back
(
cmd
.
substr
(
last
,
cmd
.
size
()
-
1
));
ret
.
push_back
(
cmd
.
substr
(
last
));
return
ret
;
}
int
onelab_cb
(
std
::
string
action
)
{
Msg
::
Debug
(
"Ask onlab to %s"
,
action
.
c_str
());
if
(
action
==
"stop"
){
onelab
::
string
o
(
"GetDP/Action"
,
"stop"
);
o
.
setVisible
(
false
);
...
...
@@ -674,9 +675,10 @@ int onelab_cb(std::string action)
onelabStop
=
true
;
return
0
;
}
if
(
locked
)
return
-
1
;
locked
=
true
;
int
redraw
=
0
;
if
(
action
==
"reset"
){
onelab
::
server
::
instance
()
->
clear
();
onelabUtils
::
runGmshClient
(
action
,
true
);
...
...
@@ -692,12 +694,17 @@ int onelab_cb(std::string action)
}
do
{
if
(
onelabUtils
::
runGmsh
Client
(
action
,
true
)
)
redraw
=
1
;
//
run
Gmsh
(only if necessary
)
onelabUtils
::
runGmshClient
(
action
,
true
)
;
if
(
redraw
==
0
&&
!
onelab
::
server
::
instance
()
->
getChanged
(
"GetDP"
))
continue
;
// run GetDP (always -- to not confuse the user)
onelab
::
string
o
(
"GetDP/Action"
,
action
);
o
.
setVisible
(
false
);
o
.
setNeverChanged
(
true
);
onelab
::
server
::
instance
()
->
set
(
o
);
std
::
vector
<
std
::
string
>
args
;
args
.
push_back
(
"getdp"
);
std
::
vector
<
onelab
::
string
>
ps
;
onelab
::
server
::
instance
()
->
get
(
ps
,
"GetDP/1ModelName"
);
if
(
ps
.
empty
()){
...
...
@@ -706,47 +713,25 @@ int onelab_cb(std::string action)
onelab
::
string
o
(
"GetDP/1ModelName"
,
name
,
"Model name"
);
o
.
setKind
(
"file"
);
onelab
::
server
::
instance
()
->
set
(
o
);
ps
.
push_back
(
o
);
}
onelab
::
string
o
(
"GetDP/Action"
,
action
);
o
.
setVisible
(
false
);
o
.
setNeverChanged
(
true
);
onelab
::
server
::
instance
()
->
set
(
o
);
if
(
action
==
"compute"
&&
(
onelab
::
server
::
instance
()
->
getChanged
(
"Gmsh"
)
||
onelab
::
server
::
instance
()
->
getChanged
(
"GetDP"
))){
std
::
string
filename
=
GModel
::
current
()
->
getFileName
();
std
::
vector
<
std
::
string
>
args
;
args
.
push_back
(
"getdp"
);
std
::
vector
<
onelab
::
string
>
onelabArgs
;
onelab
::
server
::
instance
()
->
get
(
onelabArgs
,
"GetDP/1ModelName"
);
args
.
push_back
((
onelabArgs
.
empty
())
?
SplitFileName
(
filename
)[
0
]
+
SplitFileName
(
filename
)[
1
]
:
onelabArgs
[
0
].
getValue
());
onelab
::
server
::
instance
()
->
get
(
onelabArgs
,
"GetDP/9ComputeCommand"
);
std
::
vector
<
std
::
string
>
compute
=
commandToVector
((
onelabArgs
.
empty
())
?
""
:
onelabArgs
[
0
].
getValue
().
c_str
());
args
.
insert
(
args
.
end
(),
compute
.
begin
(),
compute
.
end
()
);
args
.
push_back
(
"-onelab"
);
args
.
push_back
(
"GetDP"
);
GetDP
(
args
,
onelab
::
server
::
instance
());
}
if
(
action
==
"check"
&&
(
onelab
::
server
::
instance
()
->
getChanged
(
"Gmsh"
)
||
onelab
::
server
::
instance
()
->
getChanged
(
"GetDP"
))){
std
::
string
filename
=
GModel
::
current
()
->
getFileName
();
std
::
vector
<
std
::
string
>
args
;
args
.
push_back
(
"getdp"
);
std
::
vector
<
onelab
::
string
>
onelabArgs
;
args
.
push_back
(
SplitFileName
(
filename
)[
0
]
+
SplitFileName
(
filename
)[
1
]);
onelab
::
server
::
instance
()
->
get
(
onelabArgs
,
"GetDP/9CheckCommand"
);
args
.
push_back
((
onelabArgs
.
empty
())
?
""
:
onelabArgs
[
0
].
getValue
());
args
.
push_back
(
ps
[
0
].
getValue
());
if
(
action
==
"check"
)
onelab
::
server
::
instance
()
->
get
(
ps
,
"GetDP/9CheckCommand"
);
else
if
(
action
==
"compute"
)
onelab
::
server
::
instance
()
->
get
(
ps
,
"GetDP/9ComputeCommand"
);
else
ps
.
clear
();
std
::
vector
<
std
::
string
>
c
=
commandToVector
(
ps
.
empty
()
?
""
:
ps
[
0
].
getValue
().
c_str
());
args
.
insert
(
args
.
end
(),
c
.
begin
(),
c
.
end
());
args
.
push_back
(
"-onelab"
);
args
.
push_back
(
"GetDP"
);
GetDP
(
args
,
onelab
::
server
::
instance
());
}
}
while
(
action
==
"compute"
&&
!
onelabStop
&&
(
onelabUtils
::
incrementLoop
(
"3"
)
||
onelabUtils
::
incrementLoop
(
"2"
)
||
onelabUtils
::
incrementLoop
(
"1"
)));
locked
=
false
;
return
redraw
||
onelab
::
server
::
instance
()
->
getChanged
();
return
onelab
::
server
::
instance
()
->
getChanged
();
}
int
number_of_animation
()
...
...
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