summaryrefslogtreecommitdiff
path: root/src/ui_table.py
diff options
context:
space:
mode:
authorPaweł Redman <pawel.redman@gmail.com>2019-05-03 20:22:46 +0200
committerPaweł Redman <pawel.redman@gmail.com>2019-05-03 20:26:15 +0200
commitd10f88b9e6119d223b6712eb0eb4f1365cf6c66d (patch)
tree641d25b5bc59de8df54e10e68cf06604bb50c260 /src/ui_table.py
parentca5b42577795d63e6e59bde31698edb5443b85e8 (diff)
Stokes parameters
Diffstat (limited to 'src/ui_table.py')
-rw-r--r--src/ui_table.py56
1 files changed, 42 insertions, 14 deletions
diff --git a/src/ui_table.py b/src/ui_table.py
index 8286f5e..52a4171 100644
--- a/src/ui_table.py
+++ b/src/ui_table.py
@@ -147,7 +147,7 @@ class OptBox(QVBoxLayout):
def change_enable(self):
self.row.pol.enable = self.enable.isChecked()
- update()
+ GUI.do_update()
@@ -161,22 +161,49 @@ class SystemTableRow:
self.delta = pol.delta
self.ref = pol.ref
+ # Option box (column 1)
self.optbox = OptBox(self, pol)
parent.setCellWidget(row_number, 0, LayoutWrapper(self.optbox))
+ # Ellipse diagram (column 2)
self.ellipse = EllipseWidget(pol)
parent.setCellWidget(row_number, 1, self.ellipse)
- self.info = QVBoxLayout()
- self.info_angle = MeinLabel()
- self.info_angle.setAlignment(Qt.AlignLeft)
- self.info.addWidget(self.info_angle)
- self.info.addWidget(QLabel("Polarization state"))
- self.info_jones = MeinLabel()
- self.info_jones.setAlignment(Qt.AlignLeft)
- self.info.addWidget(self.info_jones)
- self.info.addItem(ExpandingSpacer())
- parent.setCellWidget(row_number, 2, LayoutWrapper(self.info))
+ # Jones vector (column 3)
+ box = QVBoxLayout()
+ parent.setCellWidget(row_number, 2, LayoutWrapper(box))
+
+ grid = QGridLayout()
+ grid.setColumnStretch(2, 10)
+ box.addLayout(grid)
+ box.addItem(ExpandingSpacer())
+
+ for i, label in enumerate(["|Ex|", "arg Ex", "|Ey|", "arg Ey", "δ"]):
+ grid.addWidget(QLabel(label), 1 + i, 1)
+
+ self.jones = list()
+ for i in range(5):
+ label = MeinLabel("-")
+ grid.addWidget(label, 1 + i, 2)
+ self.jones.append(label)
+
+ # Stokes parameters (column 4)
+ box = QVBoxLayout()
+ parent.setCellWidget(row_number, 3, LayoutWrapper(box))
+
+ grid = QGridLayout()
+ grid.setColumnStretch(2, 10)
+ box.addLayout(grid)
+ box.addItem(ExpandingSpacer())
+
+ for i, label in enumerate(["I", "Q", "U", "V", "α", "θ"]):
+ grid.addWidget(QLabel(label), 1 + i, 1)
+
+ self.stokes = list()
+ for i in range(6):
+ label = MeinLabel("-")
+ grid.addWidget(label, 1 + i, 2)
+ self.stokes.append(label)
def angle_change(self):
self.angle = self.optbox.angle.angle / 180 * np.pi
@@ -190,14 +217,15 @@ class SystemTable(QTableWidget):
super().__init__()
self.rows = list()
- self.setColumnCount(3) # this won't change
+ self.setColumnCount(4) # this won't change
self.hh = self.horizontalHeader()
self.hh.setSectionResizeMode(0, QHeaderView.ResizeToContents)
- self.hh.resizeSection(1, 170)
+ self.hh.resizeSection(1, 150)
+ self.hh.resizeSection(2, 150)
self.hh.setStretchLastSection(True)
self.setHorizontalHeaderLabels([
- "Settings", "Ellipse", "State"
+ "Settings", "Diagram", "State", "Stokes"
])
self.vh = self.verticalHeader()