Skip to content

Commit ffb1a7b

Browse files
committed
add log(x), log(y) to read/view curve
1 parent c1bb98b commit ffb1a7b

4 files changed

Lines changed: 123 additions & 56 deletions

File tree

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
1111
- General: Gecko Exporter for GaN-Transistors: mirror 1. quadrant forward characteristic to 3rd quadrant
1212
- GUI: Add options to display virtual and original datasheet for selected transistor
1313
- #90: Add email-workflow to add new transistor to the transistordatabase file exchange (TDB-FE)
14+
- Add log(x), log(y) for adding/viewing plots
1415

1516
### Fixed
1617
- Fix PDF preview not working due to a workaround

transistordatabase/gui/CurveCheckerWindow.ui

Lines changed: 60 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -31,18 +31,11 @@
3131
<rect>
3232
<x>0</x>
3333
<y>0</y>
34-
<width>780</width>
35-
<height>539</height>
34+
<width>784</width>
35+
<height>525</height>
3636
</rect>
3737
</property>
3838
<layout class="QGridLayout" name="gridLayout_2">
39-
<item row="4" column="1">
40-
<widget class="QCheckBox" name="checkBox_logarithmic">
41-
<property name="text">
42-
<string>scale logarithmic</string>
43-
</property>
44-
</widget>
45-
</item>
4639
<item row="5" column="0">
4740
<widget class="QPushButton" name="button_save_curve">
4841
<property name="sizePolicy">
@@ -62,6 +55,22 @@
6255
</property>
6356
</widget>
6457
</item>
58+
<item row="5" column="1">
59+
<widget class="QComboBox" name="comboBox_data">
60+
<property name="minimumSize">
61+
<size>
62+
<width>0</width>
63+
<height>35</height>
64+
</size>
65+
</property>
66+
<property name="maximumSize">
67+
<size>
68+
<width>16777215</width>
69+
<height>35</height>
70+
</size>
71+
</property>
72+
</widget>
73+
</item>
6574
<item row="2" column="0">
6675
<widget class="QCheckBox" name="checkBox_first_x_to_0">
6776
<property name="sizePolicy">
@@ -81,8 +90,40 @@
8190
</property>
8291
</widget>
8392
</item>
84-
<item row="3" column="0">
85-
<widget class="QCheckBox" name="checkBox_mirror_xy_data">
93+
<item row="4" column="1">
94+
<layout class="QHBoxLayout" name="horizontalLayout">
95+
<item>
96+
<widget class="QRadioButton" name="radioButton_scale_linear">
97+
<property name="text">
98+
<string>Linear scale</string>
99+
</property>
100+
</widget>
101+
</item>
102+
<item>
103+
<widget class="QRadioButton" name="radioButton_scale_log_x">
104+
<property name="text">
105+
<string>log(x)</string>
106+
</property>
107+
</widget>
108+
</item>
109+
<item>
110+
<widget class="QRadioButton" name="radioButton_scale_log_y">
111+
<property name="text">
112+
<string>log(y)</string>
113+
</property>
114+
</widget>
115+
</item>
116+
<item>
117+
<widget class="QRadioButton" name="radioButton_scale_log_xy">
118+
<property name="text">
119+
<string>log(x), log(y)</string>
120+
</property>
121+
</widget>
122+
</item>
123+
</layout>
124+
</item>
125+
<item row="0" column="0">
126+
<widget class="QCheckBox" name="checkBox_first_xy_to_00">
86127
<property name="sizePolicy">
87128
<sizepolicy hsizetype="Expanding" vsizetype="Expanding">
88129
<horstretch>0</horstretch>
@@ -96,7 +137,7 @@
96137
</size>
97138
</property>
98139
<property name="text">
99-
<string>mirror_xy_data</string>
140+
<string>first_xy_to_00</string>
100141
</property>
101142
</widget>
102143
</item>
@@ -110,8 +151,8 @@
110151
</property>
111152
</widget>
112153
</item>
113-
<item row="0" column="0">
114-
<widget class="QCheckBox" name="checkBox_first_xy_to_00">
154+
<item row="1" column="0">
155+
<widget class="QCheckBox" name="checkBox_second_y_to_0">
115156
<property name="sizePolicy">
116157
<sizepolicy hsizetype="Expanding" vsizetype="Expanding">
117158
<horstretch>0</horstretch>
@@ -125,12 +166,12 @@
125166
</size>
126167
</property>
127168
<property name="text">
128-
<string>first_xy_to_00</string>
169+
<string>second_y_to_0</string>
129170
</property>
130171
</widget>
131172
</item>
132-
<item row="1" column="0">
133-
<widget class="QCheckBox" name="checkBox_second_y_to_0">
173+
<item row="3" column="0">
174+
<widget class="QCheckBox" name="checkBox_mirror_xy_data">
134175
<property name="sizePolicy">
135176
<sizepolicy hsizetype="Expanding" vsizetype="Expanding">
136177
<horstretch>0</horstretch>
@@ -144,23 +185,7 @@
144185
</size>
145186
</property>
146187
<property name="text">
147-
<string>second_y_to_0</string>
148-
</property>
149-
</widget>
150-
</item>
151-
<item row="5" column="1">
152-
<widget class="QComboBox" name="comboBox_data">
153-
<property name="minimumSize">
154-
<size>
155-
<width>0</width>
156-
<height>35</height>
157-
</size>
158-
</property>
159-
<property name="maximumSize">
160-
<size>
161-
<width>16777215</width>
162-
<height>35</height>
163-
</size>
188+
<string>mirror_xy_data</string>
164189
</property>
165190
</widget>
166191
</item>
@@ -176,7 +201,7 @@
176201
<x>0</x>
177202
<y>0</y>
178203
<width>800</width>
179-
<height>21</height>
204+
<height>32</height>
180205
</rect>
181206
</property>
182207
</widget>

transistordatabase/gui/ViewCurveWindow.ui

Lines changed: 36 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -31,19 +31,12 @@
3131
<rect>
3232
<x>0</x>
3333
<y>0</y>
34-
<width>780</width>
35-
<height>539</height>
34+
<width>784</width>
35+
<height>525</height>
3636
</rect>
3737
</property>
3838
<layout class="QGridLayout" name="gridLayout_2">
39-
<item row="1" column="0">
40-
<widget class="QCheckBox" name="checkBox_logarithmic">
41-
<property name="text">
42-
<string>scale logarithmic</string>
43-
</property>
44-
</widget>
45-
</item>
46-
<item row="2" column="0">
39+
<item row="4" column="0">
4740
<widget class="QComboBox" name="comboBox_data">
4841
<property name="sizePolicy">
4942
<sizepolicy hsizetype="Expanding" vsizetype="Expanding">
@@ -75,6 +68,38 @@
7568
</property>
7669
</widget>
7770
</item>
71+
<item row="2" column="0">
72+
<layout class="QHBoxLayout" name="horizontalLayout">
73+
<item>
74+
<widget class="QRadioButton" name="radioButton_scale_linear">
75+
<property name="text">
76+
<string>Linear Scale</string>
77+
</property>
78+
</widget>
79+
</item>
80+
<item>
81+
<widget class="QRadioButton" name="radioButton_scale_log_x">
82+
<property name="text">
83+
<string>log(x)</string>
84+
</property>
85+
</widget>
86+
</item>
87+
<item>
88+
<widget class="QRadioButton" name="radioButton_scale_log_y">
89+
<property name="text">
90+
<string>log(y)</string>
91+
</property>
92+
</widget>
93+
</item>
94+
<item>
95+
<widget class="QRadioButton" name="radioButton_scale_log_xy">
96+
<property name="text">
97+
<string>log(x), log(y)</string>
98+
</property>
99+
</widget>
100+
</item>
101+
</layout>
102+
</item>
78103
</layout>
79104
</widget>
80105
</widget>
@@ -87,7 +112,7 @@
87112
<x>0</x>
88113
<y>0</y>
89114
<width>800</width>
90-
<height>21</height>
115+
<height>32</height>
91116
</rect>
92117
</property>
93118
</widget>

transistordatabase/gui/gui.py

Lines changed: 26 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -5573,7 +5573,10 @@ def __init__(self):
55735573
self.checkBox_second_y_to_0.stateChanged.connect(self.update_curve)
55745574
self.checkBox_first_x_to_0.stateChanged.connect(self.update_curve)
55755575
self.checkBox_mirror_xy_data.stateChanged.connect(self.update_curve)
5576-
self.checkBox_logarithmic.stateChanged.connect(self.update_curve)
5576+
self.radioButton_scale_linear.toggled.connect(self.update_curve)
5577+
self.radioButton_scale_log_x.toggled.connect(self.update_curve)
5578+
self.radioButton_scale_log_y.toggled.connect(self.update_curve)
5579+
self.radioButton_scale_log_xy.toggled.connect(self.update_curve)
55775580

55785581
self.button_save_curve.clicked.connect(self.save_curve)
55795582

@@ -5659,11 +5662,14 @@ def update_curve(self):
56595662
curve_label = self.comboBox_data.currentText()
56605663
self.matplotlibwidget.axis.clear()
56615664

5662-
5663-
if self.checkBox_logarithmic.isChecked() == True:
5665+
if self.radioButton_scale_log_xy.isChecked() == True:
56645666
self.matplotlibwidget.axis.loglog(graph[0], graph[1], label=curve_label)
5665-
elif self.checkBox_logarithmic.isChecked() == False:
5667+
elif self.radioButton_scale_linear.isChecked() == True:
56665668
self.matplotlibwidget.axis.plot(graph[0], graph[1], label=curve_label)
5669+
elif self.radioButton_scale_log_x.isChecked() == True:
5670+
self.matplotlibwidget.axis.semilogx(graph[0], graph[1], label=curve_label)
5671+
elif self.radioButton_scale_log_y.isChecked() == True:
5672+
self.matplotlibwidget.axis.semilogy(graph[0], graph[1], label=curve_label)
56675673

56685674
self.matplotlibwidget.axis.grid()
56695675
self.matplotlibwidget.axis.set(xlabel=xlabel,
@@ -5700,6 +5706,9 @@ def run_curve_checker(self, comboBox, xlabel, ylabel, curve_title):
57005706
self.matplotlibwidget.axis.set(xlabel=xlabel,
57015707
ylabel=ylabel,
57025708
title=curve_title)
5709+
5710+
self.radioButton_scale_linear.setChecked(True)
5711+
57035712
self.update_curve()
57045713

57055714
self.show()
@@ -5780,12 +5789,14 @@ def __init__(self):
57805789
self.matplotlibwidget = MatplotlibWidget()
57815790
self.matplotlibwidget.axis_cm.remove()
57825791

5783-
self.checkBox_logarithmic.stateChanged.connect(self.update_curve)
5784-
5792+
self.radioButton_scale_linear.toggled.connect(self.update_curve)
5793+
self.radioButton_scale_log_x.toggled.connect(self.update_curve)
5794+
self.radioButton_scale_log_y.toggled.connect(self.update_curve)
5795+
self.radioButton_scale_log_xy.toggled.connect(self.update_curve)
57855796

57865797
def update_curve(self):
57875798
"""
5788-
Updates the scaling of the curve when the checkBox to scale logarithmic is pressed
5799+
Updates the scaling of the curve when the radio buttons to scale linear/log(x)/log(y)/log(x,y) is pressed
57895800
57905801
:return: None
57915802
"""
@@ -5797,11 +5808,14 @@ def update_curve(self):
57975808
curve_label = self.comboBox_data.currentText()
57985809
self.matplotlibwidget.axis.clear()
57995810

5800-
if self.checkBox_logarithmic.isChecked() == True:
5811+
if self.radioButton_scale_log_xy.isChecked() == True:
58015812
self.matplotlibwidget.axis.loglog(graph[0], graph[1], label=curve_label)
5802-
elif self.checkBox_logarithmic.isChecked() == False:
5813+
elif self.radioButton_scale_linear.isChecked() == True:
58035814
self.matplotlibwidget.axis.plot(graph[0], graph[1], label=curve_label)
5804-
5815+
elif self.radioButton_scale_log_x.isChecked() == True:
5816+
self.matplotlibwidget.axis.semilogx(graph[0], graph[1], label=curve_label)
5817+
elif self.radioButton_scale_log_y.isChecked() == True:
5818+
self.matplotlibwidget.axis.semilogy(graph[0], graph[1], label=curve_label)
58055819

58065820
self.matplotlibwidget.axis.set(xlabel=xlabel,
58075821
ylabel=ylabel,
@@ -5841,6 +5855,8 @@ def view_curve(self, comboBox, curve_title, xlabel, ylabel):
58415855
self.matplotlibwidget.axis.set(xlabel=xlabel,
58425856
ylabel=ylabel,
58435857
title=curve_title)
5858+
# set linear scale as default
5859+
self.radioButton_scale_linear.setChecked(True)
58445860
self.update_curve()
58455861

58465862
self.show()

0 commit comments

Comments
 (0)