Even more correctly load and save positive/negative return loss setting.

Allow more decimals when setting min/max values for charts.
pull/89/head
Rune Broberg 2019-11-05 15:29:04 +01:00
rodzic 09ea2cc798
commit 021f4720b8
2 zmienionych plików z 14 dodań i 8 usunięć

Wyświetl plik

@ -418,7 +418,8 @@ class FrequencyChart(Chart):
def setMinimumValue(self): def setMinimumValue(self):
min_val, selected = QtWidgets.QInputDialog.getDouble(self, "Minimum value", min_val, selected = QtWidgets.QInputDialog.getDouble(self, "Minimum value",
"Set minimum value", value=self.minDisplayValue) "Set minimum value", value=self.minDisplayValue,
decimals=3)
if not selected: if not selected:
return return
if not (self.fixedValues and min_val >= self.maxDisplayValue): if not (self.fixedValues and min_val >= self.maxDisplayValue):
@ -428,7 +429,8 @@ class FrequencyChart(Chart):
def setMaximumValue(self): def setMaximumValue(self):
max_val, selected = QtWidgets.QInputDialog.getDouble(self, "Maximum value", max_val, selected = QtWidgets.QInputDialog.getDouble(self, "Maximum value",
"Set maximum value", value=self.maxDisplayValue) "Set maximum value", value=self.maxDisplayValue,
decimals=3)
if not selected: if not selected:
return return
if not (self.fixedValues and max_val <= self.minDisplayValue): if not (self.fixedValues and max_val <= self.minDisplayValue):
@ -2438,7 +2440,8 @@ class RealImaginaryChart(FrequencyChart):
def setMinimumRealValue(self): def setMinimumRealValue(self):
min_val, selected = QtWidgets.QInputDialog.getDouble(self, "Minimum real value", min_val, selected = QtWidgets.QInputDialog.getDouble(self, "Minimum real value",
"Set minimum real value", value=self.minDisplayReal) "Set minimum real value", value=self.minDisplayReal,
decimals=2)
if not selected: if not selected:
return return
if not (self.fixedValues and min_val >= self.maxDisplayReal): if not (self.fixedValues and min_val >= self.maxDisplayReal):
@ -2448,7 +2451,8 @@ class RealImaginaryChart(FrequencyChart):
def setMaximumRealValue(self): def setMaximumRealValue(self):
max_val, selected = QtWidgets.QInputDialog.getDouble(self, "Maximum real value", max_val, selected = QtWidgets.QInputDialog.getDouble(self, "Maximum real value",
"Set maximum real value", value=self.maxDisplayReal) "Set maximum real value", value=self.maxDisplayReal,
decimals=2)
if not selected: if not selected:
return return
if not (self.fixedValues and max_val <= self.minDisplayReal): if not (self.fixedValues and max_val <= self.minDisplayReal):
@ -2458,7 +2462,8 @@ class RealImaginaryChart(FrequencyChart):
def setMinimumImagValue(self): def setMinimumImagValue(self):
min_val, selected = QtWidgets.QInputDialog.getDouble(self, "Minimum imaginary value", min_val, selected = QtWidgets.QInputDialog.getDouble(self, "Minimum imaginary value",
"Set minimum imaginary value", value=self.minDisplayImag) "Set minimum imaginary value", value=self.minDisplayImag,
decimals=2)
if not selected: if not selected:
return return
if not (self.fixedValues and min_val >= self.maxDisplayImag): if not (self.fixedValues and min_val >= self.maxDisplayImag):
@ -2468,7 +2473,8 @@ class RealImaginaryChart(FrequencyChart):
def setMaximumImagValue(self): def setMaximumImagValue(self):
max_val, selected = QtWidgets.QInputDialog.getDouble(self, "Maximum imaginary value", max_val, selected = QtWidgets.QInputDialog.getDouble(self, "Maximum imaginary value",
"Set maximum imaginary value", value=self.maxDisplayImag) "Set maximum imaginary value", value=self.maxDisplayImag,
decimals=2)
if not selected: if not selected:
return return
if not (self.fixedValues and max_val <= self.minDisplayImag): if not (self.fixedValues and max_val <= self.minDisplayImag):

Wyświetl plik

@ -1002,9 +1002,9 @@ class DisplaySettingsWindow(QtWidgets.QWidget):
display_options_layout.addRow("", self.returnloss_is_positive) display_options_layout.addRow("", self.returnloss_is_positive)
if self.app.settings.value("ReturnLossPositive", False, bool): if self.app.settings.value("ReturnLossPositive", False, bool):
self.returnloss_is_negative.setChecked(True)
else:
self.returnloss_is_positive.setChecked(True) self.returnloss_is_positive.setChecked(True)
else:
self.returnloss_is_negative.setChecked(True)
self.returnloss_is_positive.toggled.connect(self.changeReturnLoss) self.returnloss_is_positive.toggled.connect(self.changeReturnLoss)
self.changeReturnLoss() self.changeReturnLoss()