Skip to content
GitLab
Menu
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
d0625ddc
Commit
d0625ddc
authored
Aug 10, 2021
by
Julia Garriga Ferrer
Browse files
[gui][grainplot] Disable button to export maps until maps are computed
parent
ff56272f
Pipeline
#52377
passed with stage
in 5 minutes and 59 seconds
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
darfix/gui/grainPlotWidget.py
View file @
d0625ddc
...
@@ -91,7 +91,8 @@ class GrainPlotWidget(qt.QMainWindow):
...
@@ -91,7 +91,8 @@ class GrainPlotWidget(qt.QMainWindow):
levelsLayout
.
addWidget
(
self
.
_contoursPlot
,
2
,
0
,
1
,
3
)
levelsLayout
.
addWidget
(
self
.
_contoursPlot
,
2
,
0
,
1
,
3
)
self
.
_levelsWidget
.
setLayout
(
levelsLayout
)
self
.
_levelsWidget
.
setLayout
(
levelsLayout
)
self
.
_mosaicityPlot
=
Plot2D
(
parent
=
self
)
self
.
_mosaicityPlot
=
Plot2D
(
parent
=
self
)
self
.
_exportButton
=
qt
.
QPushButton
(
"Export"
)
self
.
_exportButton
=
qt
.
QPushButton
(
"Export maps"
)
self
.
_exportButton
.
setEnabled
(
False
)
self
.
_exportButton
.
clicked
.
connect
(
self
.
exportMaps
)
self
.
_exportButton
.
clicked
.
connect
(
self
.
exportMaps
)
layout
.
addWidget
(
self
.
_methodCB
)
layout
.
addWidget
(
self
.
_methodCB
)
layout
.
addWidget
(
self
.
_levelsWidget
)
layout
.
addWidget
(
self
.
_levelsWidget
)
...
@@ -126,6 +127,7 @@ class GrainPlotWidget(qt.QMainWindow):
...
@@ -126,6 +127,7 @@ class GrainPlotWidget(qt.QMainWindow):
self
.
origin
=
(
px
,
py
)
self
.
origin
=
(
px
,
py
)
self
.
scale
=
(
xscale
,
yscale
)
self
.
scale
=
(
xscale
,
yscale
)
if
self
.
dataset
.
dims
.
ndim
>
1
:
if
self
.
dataset
.
dims
.
ndim
>
1
:
self
.
_curves
=
{}
self
.
ori_dist
,
self
.
hsv_key
=
self
.
dataset
.
compute_mosaicity_colorkey
()
self
.
ori_dist
,
self
.
hsv_key
=
self
.
dataset
.
compute_mosaicity_colorkey
()
xdim
=
self
.
dataset
.
dims
.
get
(
1
)
xdim
=
self
.
dataset
.
dims
.
get
(
1
)
ydim
=
self
.
dataset
.
dims
.
get
(
0
)
ydim
=
self
.
dataset
.
dims
.
get
(
0
)
...
@@ -167,6 +169,7 @@ class GrainPlotWidget(qt.QMainWindow):
...
@@ -167,6 +169,7 @@ class GrainPlotWidget(qt.QMainWindow):
for
i
in
range
(
rg
):
for
i
in
range
(
rg
):
self
.
_methodCB
.
model
().
item
(
i
).
setEnabled
(
True
)
self
.
_methodCB
.
model
().
item
(
i
).
setEnabled
(
True
)
self
.
_methodCB
.
setCurrentIndex
(
0
)
self
.
_methodCB
.
setCurrentIndex
(
0
)
self
.
_exportButton
.
setEnabled
(
True
)
else
:
else
:
print
(
"
\n
Computation aborted"
)
print
(
"
\n
Computation aborted"
)
...
@@ -286,7 +289,7 @@ class GrainPlotWidget(qt.QMainWindow):
...
@@ -286,7 +289,7 @@ class GrainPlotWidget(qt.QMainWindow):
def
exportMaps
(
self
):
def
exportMaps
(
self
):
"""
"""
Loads the file from a FileDialog.
Creates dictionay with maps information and exports it to a nexus file
"""
"""
if
self
.
dataset
and
self
.
dataset
.
dims
.
ndim
>
1
:
if
self
.
dataset
and
self
.
dataset
.
dims
.
ndim
>
1
:
nx
=
{
nx
=
{
...
@@ -327,7 +330,6 @@ class GrainPlotWidget(qt.QMainWindow):
...
@@ -327,7 +330,6 @@ class GrainPlotWidget(qt.QMainWindow):
Method
.
KURTOSIS
.
name
:
self
.
_moments
[
axis
][
3
]
Method
.
KURTOSIS
.
name
:
self
.
_moments
[
axis
][
3
]
}
}
)
)
else
:
else
:
nx
=
{
nx
=
{
"entry"
:
{
"entry"
:
{
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a 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