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
f68e1c13
Commit
f68e1c13
authored
12 years ago
by
Christophe Geuzaine
Browse files
Options
Downloads
Patches
Plain Diff
save/load db
parent
226f3d9a
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
Fltk/onelabWindow.cpp
+24
-16
24 additions, 16 deletions
Fltk/onelabWindow.cpp
with
24 additions
and
16 deletions
Fltk/onelabWindow.cpp
+
24
−
16
View file @
f68e1c13
...
@@ -411,30 +411,38 @@ void onelab_cb(Fl_Widget *w, void *data)
...
@@ -411,30 +411,38 @@ void onelab_cb(Fl_Widget *w, void *data)
return
;
return
;
}
}
if
(
action
==
"
dump
"
){
if
(
action
==
"
save
"
){
std
::
vector
<
std
::
string
>
db
=
onelab
::
server
::
instance
()
->
toChar
();
std
::
vector
<
std
::
string
>
db
=
onelab
::
server
::
instance
()
->
toChar
();
Msg
::
Direct
(
"OneLab database
dump
:"
);
Msg
::
Direct
(
"OneLab database:"
);
for
(
unsigned
int
i
=
0
;
i
<
db
.
size
();
i
++
){
for
(
unsigned
int
i
=
0
;
i
<
db
.
size
();
i
++
){
for
(
unsigned
int
j
=
0
;
j
<
db
[
i
].
size
();
j
++
)
for
(
unsigned
int
j
=
0
;
j
<
db
[
i
].
size
();
j
++
)
if
(
db
[
i
][
j
]
==
onelab
::
parameter
::
charSep
())
db
[
i
][
j
]
=
'|'
;
if
(
db
[
i
][
j
]
==
onelab
::
parameter
::
charSep
())
db
[
i
][
j
]
=
'|'
;
Msg
::
Direct
(
"%s"
,
db
[
i
].
c_str
());
Msg
::
Direct
(
"%s"
,
db
[
i
].
c_str
());
}
}
std
::
string
name
=
"onelab.db"
;
std
::
string
path
=
SplitFileName
(
GModel
::
current
()
->
getFileName
())[
0
];
Msg
::
StatusBar
(
2
,
true
,
"Writing database '%s'..."
,
name
.
c_str
());
if
(
fileChooser
(
FILE_CHOOSER_CREATE
,
"Save"
,
"*.db"
,
if
(
onelab
::
server
::
instance
()
->
toFile
(
name
))
(
path
+
"onelab.db"
).
c_str
())){
Msg
::
StatusBar
(
2
,
true
,
"Done writing database '%s'"
,
name
.
c_str
());
std
::
string
name
=
fileChooserGetName
(
1
);
else
Msg
::
StatusBar
(
2
,
true
,
"Writing database '%s'..."
,
name
.
c_str
());
Msg
::
Error
(
"Could not write database '%s'"
,
name
.
c_str
());
if
(
onelab
::
server
::
instance
()
->
toFile
(
name
))
Msg
::
StatusBar
(
2
,
true
,
"Done writing database '%s'"
,
name
.
c_str
());
else
Msg
::
Error
(
"Could not write database '%s'"
,
name
.
c_str
());
}
return
;
return
;
}
}
if
(
action
==
"load"
){
if
(
action
==
"load"
){
std
::
string
name
=
"onelab.db"
;
std
::
string
path
=
SplitFileName
(
GModel
::
current
()
->
getFileName
())[
0
];
Msg
::
StatusBar
(
2
,
true
,
"Loading database '%s'..."
,
name
.
c_str
());
if
(
fileChooser
(
FILE_CHOOSER_SINGLE
,
"Load"
,
"*.db"
,
if
(
onelab
::
server
::
instance
()
->
fromFile
(
name
))
(
path
+
"onelab.db"
).
c_str
()))
{
Msg
::
StatusBar
(
2
,
true
,
"Done loading database '%s'"
,
name
.
c_str
());
std
::
string
name
=
fileChooserGetName
(
1
);
else
Msg
::
StatusBar
(
2
,
true
,
"Loading database '%s'..."
,
name
.
c_str
());
Msg
::
Error
(
"Could not load database '%s'"
,
name
.
c_str
());
if
(
onelab
::
server
::
instance
()
->
fromFile
(
name
))
Msg
::
StatusBar
(
2
,
true
,
"Done loading database '%s'"
,
name
.
c_str
());
else
Msg
::
Error
(
"Could not load database '%s'"
,
name
.
c_str
());
}
action
=
"check"
;
action
=
"check"
;
}
}
...
@@ -582,8 +590,8 @@ onelabWindow::onelabWindow(int deltaFontSize)
...
@@ -582,8 +590,8 @@ onelabWindow::onelabWindow(int deltaFontSize)
(
_butt
[
0
]
->
x
()
-
WB
-
BB
/
2
,
_butt
[
0
]
->
y
(),
BB
/
2
,
BH
,
"@-1gmsh_gear"
);
(
_butt
[
0
]
->
x
()
-
WB
-
BB
/
2
,
_butt
[
0
]
->
y
(),
BB
/
2
,
BH
,
"@-1gmsh_gear"
);
_gear
->
align
(
FL_ALIGN_CENTER
|
FL_ALIGN_INSIDE
);
_gear
->
align
(
FL_ALIGN_CENTER
|
FL_ALIGN_INSIDE
);
_gear
->
add
(
"Reset database"
,
0
,
onelab_cb
,
(
void
*
)
"reset"
);
_gear
->
add
(
"Reset database"
,
0
,
onelab_cb
,
(
void
*
)
"reset"
);
_gear
->
add
(
"Save database"
,
0
,
onelab_cb
,
(
void
*
)
"
dump
"
);
_gear
->
add
(
"Save database
...
"
,
0
,
onelab_cb
,
(
void
*
)
"
save
"
);
_gear
->
add
(
"_Load database"
,
0
,
onelab_cb
,
(
void
*
)
"load"
);
_gear
->
add
(
"_Load database
...
"
,
0
,
onelab_cb
,
(
void
*
)
"load"
);
_gear
->
add
(
"Remesh automatically"
,
0
,
0
,
0
,
FL_MENU_TOGGLE
);
_gear
->
add
(
"Remesh automatically"
,
0
,
0
,
0
,
FL_MENU_TOGGLE
);
_gear
->
add
(
"Merge results automatically"
,
0
,
0
,
0
,
FL_MENU_TOGGLE
);
_gear
->
add
(
"Merge results automatically"
,
0
,
0
,
0
,
FL_MENU_TOGGLE
);
_gear
->
add
(
"Hide new views"
,
0
,
0
,
0
,
FL_MENU_TOGGLE
);
_gear
->
add
(
"Hide new views"
,
0
,
0
,
0
,
FL_MENU_TOGGLE
);
...
...
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