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
016fe8f6
Commit
016fe8f6
authored
15 years ago
by
Christophe Geuzaine
Browse files
Options
Downloads
Patches
Plain Diff
simplify logic
parent
585b29bd
Branches
Branches containing commit
Tags
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
Fltk/solverWindow.cpp
+77
-77
77 additions, 77 deletions
Fltk/solverWindow.cpp
with
77 additions
and
77 deletions
Fltk/solverWindow.cpp
+
77
−
77
View file @
016fe8f6
...
@@ -156,88 +156,88 @@ void GmshRemote::run(std::string args)
...
@@ -156,88 +156,88 @@ void GmshRemote::run(std::string args)
break
;
break
;
int
type
,
length
;
int
type
,
length
;
if
(
server
->
ReceiveHeader
(
&
type
,
&
length
)){
if
(
!
server
->
ReceiveHeader
(
&
type
,
&
length
)){
double
timer
=
GetTimeInSeconds
();
Msg
::
Error
(
"Did not receive message header: stopping server"
);
char
*
message
=
new
char
[
length
+
1
];
break
;
if
(
server
->
ReceiveString
(
length
,
message
)){
}
switch
(
type
)
{
case
GmshSocket
::
GMSH_START
:
double
timer
=
GetTimeInSeconds
();
_pid
=
atoi
(
message
);
_server
=
server
;
char
*
message
=
new
char
[
length
+
1
];
break
;
if
(
!
server
->
ReceiveString
(
length
,
message
)){
case
GmshSocket
::
GMSH_STOP
:
Msg
::
Error
(
"Did not receive message body: stopping server"
);
_pid
=
-
1
;
delete
[]
message
;
_server
=
0
;
break
;
break
;
}
case
GmshSocket
::
GMSH_PROGRESS
:
Msg
::
StatusBar
(
2
,
false
,
"%s %s"
,
name
.
c_str
(),
message
);
switch
(
type
)
{
break
;
case
GmshSocket
::
GMSH_START
:
case
GmshSocket
::
GMSH_OPTION_1
:
_pid
=
atoi
(
message
);
case
GmshSocket
::
GMSH_OPTION_2
:
_server
=
server
;
case
GmshSocket
::
GMSH_OPTION_3
:
break
;
case
GmshSocket
::
GMSH_OPTION_4
:
case
GmshSocket
::
GMSH_STOP
:
case
GmshSocket
::
GMSH_OPTION_5
:
_pid
=
-
1
;
{
_server
=
0
;
int
i
=
(
int
)
type
-
(
int
)
GmshSocket
::
GMSH_OPTION_1
;
break
;
if
(
initOption
[
i
]){
case
GmshSocket
::
GMSH_PROGRESS
:
optionValue
[
i
].
clear
();
Msg
::
StatusBar
(
2
,
false
,
"%s %s"
,
name
.
c_str
(),
message
);
initOption
[
i
]
=
false
;
break
;
}
case
GmshSocket
::
GMSH_OPTION_1
:
optionValue
[
i
].
push_back
(
message
);
case
GmshSocket
::
GMSH_OPTION_2
:
}
case
GmshSocket
::
GMSH_OPTION_3
:
break
;
case
GmshSocket
::
GMSH_OPTION_4
:
case
GmshSocket
::
GMSH_MERGE_FILE
:
case
GmshSocket
::
GMSH_OPTION_5
:
if
(
mergeViews
)
{
{
int
n
=
PView
::
list
.
size
();
int
i
=
(
int
)
type
-
(
int
)
GmshSocket
::
GMSH_OPTION_1
;
MergeFile
(
message
);
if
(
initOption
[
i
]){
drawContext
::
global
()
->
draw
();
optionValue
[
i
].
clear
();
if
(
n
!=
(
int
)
PView
::
list
.
size
())
initOption
[
i
]
=
false
;
FlGui
::
instance
()
->
menu
->
setContext
(
menu_post
,
0
);
}
break
;
case
GmshSocket
::
GMSH_PARSE_STRING
:
ParseString
(
message
);
drawContext
::
global
()
->
draw
();
break
;
case
GmshSocket
::
GMSH_INFO
:
Msg
::
Direct
(
"%-8.8s: %s"
,
name
.
c_str
(),
message
);
break
;
case
GmshSocket
::
GMSH_WARNING
:
Msg
::
Direct
(
2
,
"%-8.8s: %s"
,
name
.
c_str
(),
message
);
break
;
case
GmshSocket
::
GMSH_ERROR
:
Msg
::
Direct
(
1
,
"%-8.8s: %s"
,
name
.
c_str
(),
message
);
break
;
case
GmshSocket
::
GMSH_SPEED_TEST
:
Msg
::
Info
(
"got %d Mb message in %g seconds"
,
strlen
(
message
)
/
1024
/
1024
,
GetTimeInSeconds
()
-
timer
);
break
;
case
GmshSocket
::
GMSH_VERTEX_ARRAY
:
{
int
n
=
PView
::
list
.
size
();
PView
::
fillVertexArray
(
this
,
length
,
message
);
drawContext
::
global
()
->
draw
();
if
(
n
!=
(
int
)
PView
::
list
.
size
())
FlGui
::
instance
()
->
updateViews
();
}
break
;
default
:
Msg
::
Warning
(
"Unknown message type"
);
Msg
::
Direct
(
"%-8.8s: %s"
,
name
.
c_str
(),
message
);
break
;
}
}
FlGui
::
instance
()
->
check
(
);
optionValue
[
i
].
push_back
(
message
);
}
}
else
{
break
;
Msg
::
Warning
(
"Failed to receive message body on socket: aborting"
);
case
GmshSocket
::
GMSH_MERGE_FILE
:
break
;
if
(
mergeViews
)
{
int
n
=
PView
::
list
.
size
();
MergeFile
(
message
);
drawContext
::
global
()
->
draw
();
if
(
n
!=
(
int
)
PView
::
list
.
size
())
FlGui
::
instance
()
->
menu
->
setContext
(
menu_post
,
0
);
}
}
delete
[]
message
;
break
;
}
case
GmshSocket
::
GMSH_PARSE_STRING
:
else
{
ParseString
(
message
);
// didn't get any header, just abort
drawContext
::
global
()
->
draw
();
break
;
case
GmshSocket
::
GMSH_INFO
:
Msg
::
Direct
(
"%-8.8s: %s"
,
name
.
c_str
(),
message
);
break
;
case
GmshSocket
::
GMSH_WARNING
:
Msg
::
Direct
(
2
,
"%-8.8s: %s"
,
name
.
c_str
(),
message
);
break
;
case
GmshSocket
::
GMSH_ERROR
:
Msg
::
Direct
(
1
,
"%-8.8s: %s"
,
name
.
c_str
(),
message
);
break
;
case
GmshSocket
::
GMSH_SPEED_TEST
:
Msg
::
Info
(
"got %d Mb message in %g seconds"
,
length
/
1024
/
1024
,
GetTimeInSeconds
()
-
timer
);
break
;
case
GmshSocket
::
GMSH_VERTEX_ARRAY
:
{
int
n
=
PView
::
list
.
size
();
PView
::
fillVertexArray
(
this
,
length
,
message
);
drawContext
::
global
()
->
draw
();
if
(
n
!=
(
int
)
PView
::
list
.
size
())
FlGui
::
instance
()
->
updateViews
();
}
break
;
default
:
Msg
::
Warning
(
"Received unknown message type (%d)"
,
type
);
break
;
break
;
}
}
delete
[]
message
;
FlGui
::
instance
()
->
check
();
}
}
if
(
window
){
if
(
window
){
...
...
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