Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
XRD
darfix
Commits
4274e519
Commit
4274e519
authored
Jul 27, 2021
by
Julia Garriga Ferrer
Browse files
[gui][grainplot] Add export button
parent
5b945fd2
Pipeline
#51523
failed with stage
in 2 minutes and 37 seconds
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
darfix/gui/grainPlotWidget.py
View file @
4274e519
...
...
@@ -40,6 +40,7 @@ from silx.utils.enum import Enum as _Enum
import
darfix
from
.operationThread
import
OperationThread
from
darfix.io.utils
import
write_maps
class
Method
(
_Enum
):
...
...
@@ -90,10 +91,13 @@ class GrainPlotWidget(qt.QMainWindow):
levelsLayout
.
addWidget
(
self
.
_contoursPlot
,
2
,
0
,
1
,
3
)
self
.
_levelsWidget
.
setLayout
(
levelsLayout
)
self
.
_mosaicityPlot
=
Plot2D
(
parent
=
self
)
self
.
_exportButton
=
qt
.
QPushButton
(
"Export"
)
self
.
_exportButton
.
clicked
.
connect
(
self
.
_saveMaps
)
layout
.
addWidget
(
self
.
_methodCB
)
layout
.
addWidget
(
self
.
_levelsWidget
)
layout
.
addWidget
(
self
.
_plotWidget
)
layout
.
addWidget
(
self
.
_mosaicityPlot
)
layout
.
addWidget
(
self
.
_exportButton
)
self
.
_plotWidget
.
hide
()
self
.
_mosaicityPlot
.
hide
()
self
.
_mosaicityPlot
.
getColorBarWidget
().
hide
()
...
...
@@ -273,3 +277,16 @@ class GrainPlotWidget(qt.QMainWindow):
img
[
img
<
Imin
]
=
Imin
return
medfilt2d
(
img
)
def
_saveMaps
(
self
):
"""
Loads the file from a FileDialog.
"""
fileDialog
=
qt
.
QFileDialog
()
fileDialog
.
setFileMode
(
fileDialog
.
AnyFile
)
fileDialog
.
setAcceptMode
(
fileDialog
.
AcceptSave
)
fileDialog
.
setOption
(
fileDialog
.
DontUseNativeDialog
)
fileDialog
.
setDefaultSuffix
(
".h5"
)
# if fileDialog.exec_():
# write_maps(fileDialog.selectedFiles()[0], 'entry',)
\ No newline at end of file
Write
Preview
Supports
Markdown
0%
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!
Cancel
Please
register
or
sign in
to comment