summaryrefslogtreecommitdiff
path: root/src/ui_table.py
diff options
context:
space:
mode:
authorPaweł Redman <pawel.redman@gmail.com>2019-06-17 16:03:12 +0200
committerPaweł Redman <pawel.redman@gmail.com>2019-06-17 16:03:12 +0200
commit071ca9989afa0cdfa29b95b026170b7aa9651f3d (patch)
tree7bcf2e01d9222262e70a92e039de46dd267e6aa6 /src/ui_table.py
parent14262a97c7697a34430379ddbf1d6f5b12ef729f (diff)
Arbitrary phase retarders
Diffstat (limited to 'src/ui_table.py')
-rw-r--r--src/ui_table.py28
1 files changed, 11 insertions, 17 deletions
diff --git a/src/ui_table.py b/src/ui_table.py
index 52a4171..bd02a90 100644
--- a/src/ui_table.py
+++ b/src/ui_table.py
@@ -45,16 +45,12 @@ class ElementEditorWindow(QMainWindow):
self.name.textChanged.connect(self.change_name)
box.addWidget(self.name)
- # OPTICS
- root.addWidget(MeinGroßLabel("Optics"))
+ # PHASE RETARDATION
+ root.addWidget(MeinGroßLabel("Phase retardation"))
- # Type combo
- self.type = QComboBox()
- self.type.addItem("Linear", "linear",)
- self.type.addItem("Quarterwave plate", "quarterwave")
- self.type.setCurrentIndex(0 if self.pol.type == "linear" else 1)
- self.type.currentIndexChanged.connect(self.change_type)
- root.addWidget(self.type)
+ self.phase_retardation = AngleSlider()
+ self.phase_retardation.on_change = self.change_optics
+ root.addLayout(self.phase_retardation)
# TRANSMITTANCE
root.addWidget(MeinGroßLabel("Transmittance"))
@@ -64,10 +60,10 @@ class ElementEditorWindow(QMainWindow):
box.addWidget(QLabel("T"))
self.t1 = QLineEdit("%g" % self.pol.t1)
- self.t1.textChanged.connect(self.change_t)
+ self.t1.textChanged.connect(self.change_optics)
box.addWidget(self.t1)
self.t2 = QLineEdit("%g" % self.pol.t2)
- self.t2.textChanged.connect(self.change_t)
+ self.t2.textChanged.connect(self.change_optics)
box.addWidget(self.t2)
# ARRANGEMENT
@@ -95,10 +91,6 @@ class ElementEditorWindow(QMainWindow):
self.pol.name = self.name.text()
self.row.optbox.name.setText(self.pol.name)
- def change_type(self):
- self.pol.set_type(self.type.currentData())
- GUI.do_update()
-
def change_delta(self):
try:
self.pol.delta = self.delta.angle / 180 * np.pi
@@ -106,10 +98,12 @@ class ElementEditorWindow(QMainWindow):
except ValueError:
pass
- def change_t(self):
+ def change_optics(self):
try:
self.pol.t1 = float(self.t1.text())
self.pol.t2 = float(self.t2.text())
+ self.pol.phase_retardation = \
+ float(self.phase_retardation.angle) / 180 * np.pi
GUI.do_update()
except ValueError:
pass
@@ -294,7 +288,7 @@ class SystemTable(QTableWidget):
i = 0 if before else len(self.rows)
if pol is None:
- pol = phys.Polarizer("linear")
+ pol = phys.Polarizer()
editor = True
else:
editor = False