Skip to content

Commit

Permalink
Merge pull request #68 from FRIBDAQ/qtpyDev
Browse files Browse the repository at this point in the history
qtpy - fixed several issues #51 #50 #48 #45 #44 #40 #37 #36
  • Loading branch information
giraudsimon authored Oct 18, 2023
2 parents 1ed5bd8 + 4af1ee7 commit 74f4779
Show file tree
Hide file tree
Showing 13 changed files with 1,936 additions and 1,309 deletions.
140 changes: 72 additions & 68 deletions main/PyQtGUI/gui/ConfigGUI.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,48 +9,50 @@
from PyQt5.QtWidgets import *
import CPyConverter as cpy

class Configuration(QWidget):
class Configuration(QGridLayout):
def __init__(self, *args, **kwargs):
super(Configuration, self).__init__(*args, **kwargs)


self.oldrow = 0
self.oldcol = 0

self.isDrag = False
self.isEdit = False

self.histo_list_label = QLabel("Spectrum")
self.histo_list_label.setFixedWidth(60)
self.histo_list_label = QLabel(" Spectrum")
self.histo_list_label.setFixedWidth(70)
self.histo_list = QComboBox()
self.histo_list.setFixedWidth(200)

self.histo_geo_label = QLabel("Geometry")
self.histo_geo_label.setFixedWidth(60)
self.histo_geo_label.setFixedWidth(63)
self.histo_geo_row = QComboBox()
self.histo_geo_row.setFixedWidth(50)
self.histo_geo_col = QComboBox()
self.histo_geo_add = QPushButton("Add", self)
self.histo_geo_col.setFixedWidth(50)

self.histo_geo_add = QPushButton("Add")
self.histo_geo_add.setFixedWidth(100)
self.histo_geo_add.setStyleSheet("background-color:#bcee68;")
self.histo_geo_update = QPushButton("Update", self)

self.histo_geo_update = QPushButton("Update")
self.histo_geo_update.setFixedWidth(100)
self.histo_geo_update.setStyleSheet("background-color:#bcee68;")
self.histo_geo_delete = QPushButton("Clear", self)
self.histo_geo_delete.setStyleSheet("background-color:#bcee68;")
#self.histo_geo_all = QCheckBox("All",self)
#self.histo_geo_all.setFixedWidth(35)
self.listParams_label = []
self.listParams = []
for i in range(2):
self.listParams_label.append(QLabel("Parameter"))
self.listParams.append(QComboBox())
self.listParams_label[0].setFixedWidth(65)
self.listParams_label[1].setFixedWidth(65)

self.button1D = QRadioButton("1D")
self.button1D.setFixedWidth(40)
# self.button1D.setFixedWidth(40)
self.button2D = QRadioButton("2D")
self.button2D.setFixedWidth(40)
# self.button2D.setFixedWidth(40)
self.button2D_option = QComboBox()
self.button2D_option.addItem("Light")
self.button2D_option.addItem("Dark")
self.gate_list_label = QLabel("Gate")
self.gate_list_label.setFixedWidth(30)

#Gate menu
self.gate_list_label = QLabel(" Gate")
self.gate_list_label.setFixedWidth(40)
self.listGate = QComboBox()
self.listGate.setFixedWidth(125)
self.listGate_type = QComboBox()
self.listGate_type.setFixedWidth(50)
self.listGate_type.addItem("s")
Expand All @@ -60,26 +62,27 @@ def __init__(self, *args, **kwargs):
self.listGate_type.addItem("gc")
self.listGate_type.addItem("gb")
self.listGate_type.setCurrentIndex(-1)
self.createGate = QPushButton("Create", self)

self.createGate = QPushButton("Create")
self.createGate.setFixedWidth(100)
self.createGate.setStyleSheet("background-color:#ffc7fd;")
self.editGate = QPushButton("Modify", self)

self.editGate = QPushButton("Modify")
self.editGate.setFixedWidth(100)
self.menu = QMenu()
self.menu.addAction('Drag', self.drag)
self.menu.addAction('Edit', self.edit)
self.editGate.setMenu(self.menu)
self.editGate.setStyleSheet("background-color:#ffc7fd;")

self.editGate.setStyleSheet("background-color:#ffc7fd;")
self.deleteGate = QPushButton("Delete", self)
self.deleteGate.setStyleSheet("background-color:#cd96cd;")
self.drawGate = QPushButton("Draw", self)
self.drawGate.setStyleSheet("background-color:#cd96cd;")
self.cleanGate = QPushButton("Clear", self)
self.cleanGate.setStyleSheet("background-color:#cd96cd;")

self.integrateGate = QPushButton("Integrate", self)
self.integrateGate = QPushButton("Integrate")
self.integrateGate.setFixedWidth(100)
self.integrateGate.setStyleSheet("background-color:#9f79ee;")
self.outputGate = QPushButton("Output", self)
self.outputGate.setStyleSheet("background-color:#9f79ee;")

self.extraButton = QPushButton("Extra")
self.extraButton.setFixedWidth(100)
self.extraButton.setStyleSheet("background-color:#eead0e;")


for i in range(1,10):
self.histo_geo_row.addItem(str(i))
Expand All @@ -89,40 +92,41 @@ def __init__(self, *args, **kwargs):
self.oldrow = self.row
self.oldcol = self.col

hlayout = QHBoxLayout()
hlayout.addWidget(self.histo_list_label)
hlayout.addWidget(self.histo_list)
hlayout.addWidget(self.histo_geo_add)
hlayout.addWidget(self.histo_geo_update)
hlayout.addWidget(self.histo_geo_delete)
#hlayout.addWidget(self.histo_geo_all)
hlayout.addWidget(self.listParams_label[0])
hlayout.addWidget(self.listParams[0])
hlayout.addWidget(self.listParams_label[1])
hlayout.addWidget(self.listParams[1])
hlayout.addWidget(self.button1D)
hlayout.addWidget(self.button2D)
hlayout.addWidget(self.button2D_option)

hlayout2 = QHBoxLayout()
hlayout2.addWidget(self.gate_list_label)
hlayout2.addWidget(self.listGate)
hlayout2.addWidget(self.listGate_type)
hlayout2.addWidget(self.createGate)
hlayout2.addWidget(self.editGate)
hlayout2.addWidget(self.drawGate)
hlayout2.addWidget(self.cleanGate)
hlayout2.addWidget(self.deleteGate)
hlayout2.addWidget(self.integrateGate)
hlayout2.addWidget(self.outputGate)
hlayout2.addWidget(self.histo_geo_label)
hlayout2.addWidget(self.histo_geo_row)
hlayout2.addWidget(self.histo_geo_col)

layout = QVBoxLayout()
layout.addLayout(hlayout)
layout.addLayout(hlayout2)
self.setLayout(layout)



#line organized in several blocks geoLayout, spectrumLayout, gateLayout, extraLayout
# configLayout = QGridLayout()
geoLayout = QHBoxLayout()
spectrumLayout = QHBoxLayout()
gateLayout = QHBoxLayout()
extraLayout = QHBoxLayout()

geoLayout.addWidget(self.histo_geo_label)
geoLayout.addWidget(self.histo_geo_row)
geoLayout.addWidget(self.histo_geo_col)

spectrumLayout.addWidget(self.histo_list_label)
spectrumLayout.addWidget(self.histo_list)
spectrumLayout.addWidget(self.histo_geo_add)
spectrumLayout.addWidget(self.histo_geo_update)

gateLayout.addWidget(self.gate_list_label)
gateLayout.addWidget(self.listGate)
gateLayout.addWidget(self.listGate_type)
gateLayout.addWidget(self.createGate)
gateLayout.addWidget(self.editGate)
gateLayout.addWidget(self.integrateGate)

extraLayout.addWidget(self.extraButton)


self.addLayout(geoLayout, 0, 1, 0, 1)
self.addLayout(spectrumLayout, 0, 2, 0, 1)
self.addLayout(gateLayout, 0, 3, 0, 1)
self.addLayout(extraLayout, 0, 4, 0, 1)



def drag(self):
self.isDrag = True
Expand Down
2 changes: 1 addition & 1 deletion main/PyQtGUI/gui/CopyPropertiesGUI.py
Original file line number Diff line number Diff line change
Expand Up @@ -90,4 +90,4 @@ def closeEvent(self, event):
self.xlim_og = []
self.ylim_og = []
self.scale_og = False
event.accept()
event.accept()
Loading

0 comments on commit 74f4779

Please sign in to comment.