diff --git a/CHANGELOG.md b/CHANGELOG.md index c8bd480..621b48f 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -11,6 +11,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - General: Gecko Exporter for GaN-Transistors: mirror 1. quadrant forward characteristic to 3rd quadrant - GUI: Add options to display virtual and original datasheet for selected transistor - #90: Add email-workflow to add new transistor to the transistordatabase file exchange (TDB-FE) +- Add log(x), log(y) for adding/viewing plots ### Fixed - Fix PDF preview not working due to a workaround diff --git a/transistordatabase/gui/CurveCheckerWindow.ui b/transistordatabase/gui/CurveCheckerWindow.ui index a40f77a..2ad469c 100644 --- a/transistordatabase/gui/CurveCheckerWindow.ui +++ b/transistordatabase/gui/CurveCheckerWindow.ui @@ -31,18 +31,11 @@ 0 0 - 780 - 539 + 784 + 525 - - - - scale logarithmic - - - @@ -62,6 +55,22 @@ + + + + + 0 + 35 + + + + + 16777215 + 35 + + + + @@ -81,8 +90,40 @@ - - + + + + + + Linear scale + + + + + + + log(x) + + + + + + + log(y) + + + + + + + log(x), log(y) + + + + + + + 0 @@ -96,7 +137,7 @@ - mirror_xy_data + first_xy_to_00 @@ -110,8 +151,8 @@ - - + + 0 @@ -125,12 +166,12 @@ - first_xy_to_00 + second_y_to_0 - - + + 0 @@ -144,23 +185,7 @@ - second_y_to_0 - - - - - - - - 0 - 35 - - - - - 16777215 - 35 - + mirror_xy_data @@ -176,7 +201,7 @@ 0 0 800 - 21 + 32 diff --git a/transistordatabase/gui/ViewCurveWindow.ui b/transistordatabase/gui/ViewCurveWindow.ui index 6b265f5..e6e4884 100644 --- a/transistordatabase/gui/ViewCurveWindow.ui +++ b/transistordatabase/gui/ViewCurveWindow.ui @@ -31,19 +31,12 @@ 0 0 - 780 - 539 + 784 + 525 - - - - scale logarithmic - - - - + @@ -75,6 +68,38 @@ + + + + + + Linear Scale + + + + + + + log(x) + + + + + + + log(y) + + + + + + + log(x), log(y) + + + + + @@ -87,7 +112,7 @@ 0 0 800 - 21 + 32 diff --git a/transistordatabase/gui/gui.py b/transistordatabase/gui/gui.py index b4c1e88..3394266 100644 --- a/transistordatabase/gui/gui.py +++ b/transistordatabase/gui/gui.py @@ -5573,7 +5573,10 @@ def __init__(self): self.checkBox_second_y_to_0.stateChanged.connect(self.update_curve) self.checkBox_first_x_to_0.stateChanged.connect(self.update_curve) self.checkBox_mirror_xy_data.stateChanged.connect(self.update_curve) - self.checkBox_logarithmic.stateChanged.connect(self.update_curve) + self.radioButton_scale_linear.toggled.connect(self.update_curve) + self.radioButton_scale_log_x.toggled.connect(self.update_curve) + self.radioButton_scale_log_y.toggled.connect(self.update_curve) + self.radioButton_scale_log_xy.toggled.connect(self.update_curve) self.button_save_curve.clicked.connect(self.save_curve) @@ -5659,11 +5662,14 @@ def update_curve(self): curve_label = self.comboBox_data.currentText() self.matplotlibwidget.axis.clear() - - if self.checkBox_logarithmic.isChecked() == True: + if self.radioButton_scale_log_xy.isChecked() == True: self.matplotlibwidget.axis.loglog(graph[0], graph[1], label=curve_label) - elif self.checkBox_logarithmic.isChecked() == False: + elif self.radioButton_scale_linear.isChecked() == True: self.matplotlibwidget.axis.plot(graph[0], graph[1], label=curve_label) + elif self.radioButton_scale_log_x.isChecked() == True: + self.matplotlibwidget.axis.semilogx(graph[0], graph[1], label=curve_label) + elif self.radioButton_scale_log_y.isChecked() == True: + self.matplotlibwidget.axis.semilogy(graph[0], graph[1], label=curve_label) self.matplotlibwidget.axis.grid() self.matplotlibwidget.axis.set(xlabel=xlabel, @@ -5700,6 +5706,9 @@ def run_curve_checker(self, comboBox, xlabel, ylabel, curve_title): self.matplotlibwidget.axis.set(xlabel=xlabel, ylabel=ylabel, title=curve_title) + + self.radioButton_scale_linear.setChecked(True) + self.update_curve() self.show() @@ -5780,12 +5789,14 @@ def __init__(self): self.matplotlibwidget = MatplotlibWidget() self.matplotlibwidget.axis_cm.remove() - self.checkBox_logarithmic.stateChanged.connect(self.update_curve) - + self.radioButton_scale_linear.toggled.connect(self.update_curve) + self.radioButton_scale_log_x.toggled.connect(self.update_curve) + self.radioButton_scale_log_y.toggled.connect(self.update_curve) + self.radioButton_scale_log_xy.toggled.connect(self.update_curve) def update_curve(self): """ - Updates the scaling of the curve when the checkBox to scale logarithmic is pressed + Updates the scaling of the curve when the radio buttons to scale linear/log(x)/log(y)/log(x,y) is pressed :return: None """ @@ -5797,11 +5808,14 @@ def update_curve(self): curve_label = self.comboBox_data.currentText() self.matplotlibwidget.axis.clear() - if self.checkBox_logarithmic.isChecked() == True: + if self.radioButton_scale_log_xy.isChecked() == True: self.matplotlibwidget.axis.loglog(graph[0], graph[1], label=curve_label) - elif self.checkBox_logarithmic.isChecked() == False: + elif self.radioButton_scale_linear.isChecked() == True: self.matplotlibwidget.axis.plot(graph[0], graph[1], label=curve_label) - + elif self.radioButton_scale_log_x.isChecked() == True: + self.matplotlibwidget.axis.semilogx(graph[0], graph[1], label=curve_label) + elif self.radioButton_scale_log_y.isChecked() == True: + self.matplotlibwidget.axis.semilogy(graph[0], graph[1], label=curve_label) self.matplotlibwidget.axis.set(xlabel=xlabel, ylabel=ylabel, @@ -5841,6 +5855,8 @@ def view_curve(self, comboBox, curve_title, xlabel, ylabel): self.matplotlibwidget.axis.set(xlabel=xlabel, ylabel=ylabel, title=curve_title) + # set linear scale as default + self.radioButton_scale_linear.setChecked(True) self.update_curve() self.show()