Commit 2e588d5b authored by Josef Brandt's avatar Josef Brandt

Bugfix in custom z-level setup

parent 69ffaf01
...@@ -26,6 +26,3 @@ class InvalidParticleError(Exception): ...@@ -26,6 +26,3 @@ class InvalidParticleError(Exception):
class NotConnectedContoursError(Exception): class NotConnectedContoursError(Exception):
pass pass
class ValueNotSetError(Exception):
pass
\ No newline at end of file
...@@ -559,7 +559,11 @@ class OpticalScan(QtWidgets.QWidget): ...@@ -559,7 +559,11 @@ class OpticalScan(QtWidgets.QWidget):
softwarez = self.ramanctrl.getSoftwareZ() # get current software z softwarez = self.ramanctrl.getSoftwareZ() # get current software z
points[:,2] += softwarez-self.ramanctrl.getUserZ() points[:,2] += softwarez-self.ramanctrl.getUserZ()
try:
zrange = self.zLevelSetter.getZLevels() zrange = self.zLevelSetter.getZLevels()
except ValueError:
return
zmaxstack = max(zrange) zmaxstack = max(zrange)
if len(zrange) == 1: if len(zrange) == 1:
zmaxstack = 0.0 zmaxstack = 0.0
......
...@@ -7,7 +7,6 @@ Created on Fri Oct 25 09:39:14 2019 ...@@ -7,7 +7,6 @@ Created on Fri Oct 25 09:39:14 2019
from PyQt5 import QtWidgets, QtCore from PyQt5 import QtWidgets, QtCore
import sys import sys
import numpy as np import numpy as np
from .errors import ValueNotSetError
class ZLevelSetter(QtWidgets.QLabel): class ZLevelSetter(QtWidgets.QLabel):
...@@ -251,9 +250,9 @@ class ZLevelSetter(QtWidgets.QLabel): ...@@ -251,9 +250,9 @@ class ZLevelSetter(QtWidgets.QLabel):
elif self.customChecker.isChecked(): elif self.customChecker.isChecked():
try: try:
zLevels = self._getCustomLevels() zLevels = self._getCustomLevels()
except ValueNotSetError: except ValueError:
QtWidgets.QMessageBox.critical(self, 'Error', 'Invalid entry in custom level selection') QtWidgets.QMessageBox.critical(self, 'Error', 'Invalid entry in custom level selection')
return raise ValueError
return np.array(zLevels) return np.array(zLevels)
def _getCustomLevels(self): def _getCustomLevels(self):
...@@ -266,7 +265,7 @@ class ZLevelSetter(QtWidgets.QLabel): ...@@ -266,7 +265,7 @@ class ZLevelSetter(QtWidgets.QLabel):
try: try:
levels.append(float(lineEdit.text())) levels.append(float(lineEdit.text()))
except: except:
raise ValueNotSetError raise ValueError
return sorted(levels) return sorted(levels)
......
Markdown is supported
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