Commit d0625ddc authored by Julia Garriga Ferrer's avatar 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
......@@ -91,7 +91,8 @@ 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 = qt.QPushButton("Export maps")
self._exportButton.setEnabled(False)
self._exportButton.clicked.connect(self.exportMaps)
layout.addWidget(self._methodCB)
layout.addWidget(self._levelsWidget)
......@@ -126,6 +127,7 @@ class GrainPlotWidget(qt.QMainWindow):
self.origin = (px, py)
self.scale = (xscale, yscale)
if self.dataset.dims.ndim > 1:
self._curves = {}
self.ori_dist, self.hsv_key = self.dataset.compute_mosaicity_colorkey()
xdim = self.dataset.dims.get(1)
ydim = self.dataset.dims.get(0)
......@@ -167,6 +169,7 @@ class GrainPlotWidget(qt.QMainWindow):
for i in range(rg):
self._methodCB.model().item(i).setEnabled(True)
self._methodCB.setCurrentIndex(0)
self._exportButton.setEnabled(True)
else:
print("\nComputation aborted")
......@@ -286,7 +289,7 @@ class GrainPlotWidget(qt.QMainWindow):
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:
nx = {
......@@ -327,7 +330,6 @@ class GrainPlotWidget(qt.QMainWindow):
Method.KURTOSIS.name: self._moments[axis][3]
}
)
else:
nx = {
"entry": {
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment