Skip to content
Snippets Groups Projects
Commit 7fd95618 authored by JOSSOUD Olivier's avatar JOSSOUD Olivier
Browse files

Explo. Remove useless columns (Step curve, Vline and cursor).

Everything is plotted as a step curve.
Correct curve color change bug.
parent dd1acda8
No related branches found
No related tags found
No related merge requests found
......@@ -59,21 +59,6 @@
<string>Variable</string>
</property>
</column>
<column>
<property name="text">
<string>Step curve</string>
</property>
</column>
<column>
<property name="text">
<string>Vertical line</string>
</property>
</column>
<column>
<property name="text">
<string>Cursor</string>
</property>
</column>
<column>
<property name="text">
<string>Color</string>
......
......@@ -25,7 +25,7 @@ class Ui_MainWindow(object):
self.explo_tablewidget_variables = QtWidgets.QTableWidget(self.tab_explo)
self.explo_tablewidget_variables.setGeometry(QtCore.QRect(20, 50, 1021, 201))
self.explo_tablewidget_variables.setObjectName("explo_tablewidget_variables")
self.explo_tablewidget_variables.setColumnCount(12)
self.explo_tablewidget_variables.setColumnCount(9)
self.explo_tablewidget_variables.setRowCount(0)
item = QtWidgets.QTableWidgetItem()
self.explo_tablewidget_variables.setHorizontalHeaderItem(0, item)
......@@ -45,12 +45,6 @@ class Ui_MainWindow(object):
self.explo_tablewidget_variables.setHorizontalHeaderItem(7, item)
item = QtWidgets.QTableWidgetItem()
self.explo_tablewidget_variables.setHorizontalHeaderItem(8, item)
item = QtWidgets.QTableWidgetItem()
self.explo_tablewidget_variables.setHorizontalHeaderItem(9, item)
item = QtWidgets.QTableWidgetItem()
self.explo_tablewidget_variables.setHorizontalHeaderItem(10, item)
item = QtWidgets.QTableWidgetItem()
self.explo_tablewidget_variables.setHorizontalHeaderItem(11, item)
self.horizontalLayoutWidget_2 = QtWidgets.QWidget(self.tab_explo)
self.horizontalLayoutWidget_2.setGeometry(QtCore.QRect(20, 10, 221, 31))
self.horizontalLayoutWidget_2.setObjectName("horizontalLayoutWidget_2")
......@@ -187,24 +181,18 @@ class Ui_MainWindow(object):
item = self.explo_tablewidget_variables.horizontalHeaderItem(1)
item.setText(_translate("MainWindow", "Variable"))
item = self.explo_tablewidget_variables.horizontalHeaderItem(2)
item.setText(_translate("MainWindow", "Step curve"))
item = self.explo_tablewidget_variables.horizontalHeaderItem(3)
item.setText(_translate("MainWindow", "Vertical line"))
item = self.explo_tablewidget_variables.horizontalHeaderItem(4)
item.setText(_translate("MainWindow", "Cursor"))
item = self.explo_tablewidget_variables.horizontalHeaderItem(5)
item.setText(_translate("MainWindow", "Color"))
item = self.explo_tablewidget_variables.horizontalHeaderItem(6)
item = self.explo_tablewidget_variables.horizontalHeaderItem(3)
item.setText(_translate("MainWindow", "Offset"))
item = self.explo_tablewidget_variables.horizontalHeaderItem(7)
item = self.explo_tablewidget_variables.horizontalHeaderItem(4)
item.setText(_translate("MainWindow", "Mult. factor"))
item = self.explo_tablewidget_variables.horizontalHeaderItem(8)
item = self.explo_tablewidget_variables.horizontalHeaderItem(5)
item.setText(_translate("MainWindow", "Time shift (s)"))
item = self.explo_tablewidget_variables.horizontalHeaderItem(9)
item = self.explo_tablewidget_variables.horizontalHeaderItem(6)
item.setText(_translate("MainWindow", "Visible"))
item = self.explo_tablewidget_variables.horizontalHeaderItem(10)
item = self.explo_tablewidget_variables.horizontalHeaderItem(7)
item.setText(_translate("MainWindow", "X (orig.)"))
item = self.explo_tablewidget_variables.horizontalHeaderItem(11)
item = self.explo_tablewidget_variables.horizontalHeaderItem(8)
item.setText(_translate("MainWindow", "Y (orig.)"))
self.explo_label_dataset.setText(_translate("MainWindow", "Dataset:"))
self.explo_pushbutton_add_row.setText(_translate("MainWindow", "+ Add Row"))
......
......@@ -19,16 +19,13 @@ class ExploUim:
# "Variables" tableWidget columns identifiers.
INSTRUMENT_COL = 0
VARIABLE_COL = 1
CURVE_COL = 2
VLINE_COL = 3
CURSOR_COL = 4
COLOR_COL = 5
OFFSET_COL = 6
MULT_COL = 7
TIMESHIFT_COL = 8
VISIBLE_COL = 9
XORIG_COL = 10
YORIG_COL = 11
COLOR_COL = 2
OFFSET_COL = 3
MULT_COL = 4
TIMESHIFT_COL = 5
VISIBLE_COL = 6
XORIG_COL = 7
YORIG_COL = 8
DEFAULT_COLORS = [QColor(255, 255, 255), # White
QColor(228, 26, 28), # Red
......@@ -80,11 +77,8 @@ class ExploUim:
"""Initialize the table containing the to-be-displayed variables"""
# Set column widths
self.main_ui.explo_tablewidget_variables.setColumnWidth(self.INSTRUMENT_COL, 110)
self.main_ui.explo_tablewidget_variables.setColumnWidth(self.VARIABLE_COL, 90)
self.main_ui.explo_tablewidget_variables.setColumnWidth(self.CURVE_COL, 85)
self.main_ui.explo_tablewidget_variables.setColumnWidth(self.VLINE_COL, 95)
self.main_ui.explo_tablewidget_variables.setColumnWidth(self.CURSOR_COL, 60)
self.main_ui.explo_tablewidget_variables.setColumnWidth(self.INSTRUMENT_COL, 130)
self.main_ui.explo_tablewidget_variables.setColumnWidth(self.VARIABLE_COL, 110)
self.main_ui.explo_tablewidget_variables.setColumnWidth(self.COLOR_COL, 55)
self.main_ui.explo_tablewidget_variables.setColumnWidth(self.OFFSET_COL, 90)
self.main_ui.explo_tablewidget_variables.setColumnWidth(self.MULT_COL, 90)
......@@ -113,18 +107,6 @@ class ExploUim:
table.cellWidget(row_id, self.VARIABLE_COL).currentTextChanged.connect(
lambda text, row_id=row_id: self.__apply_variable_change__(row_id=row_id, variable_name=text))
# Step Curve
curve_item = QCheckBox()
table.setCellWidget(row_id, self.CURVE_COL, curve_item)
# Vertical line
vline_item = QCheckBox()
table.setCellWidget(row_id, self.VLINE_COL, vline_item)
# Cursor
cursor_item = QCheckBox()
table.setCellWidget(row_id, self.CURSOR_COL, cursor_item)
# Color
color_item = QTableWidgetItem()
color_item.setBackground(self.DEFAULT_COLORS[row_id % len(self.DEFAULT_COLORS)])
......@@ -201,6 +183,7 @@ class ExploUim:
color = QColorDialog.getColor()
self.main_ui.explo_tablewidget_variables.item(row, self.COLOR_COL).setBackground(color)
self.__apply_variable_change__(row)
def __get_row_dataframe__(self, row_id: int) -> pd.DataFrame:
table = self.main_ui.explo_tablewidget_variables
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment