def build_mainwin_rawSignalPanel(self): self.layout_mainwin_rawSignalPanel_SsPeak = QVBoxLayout() self.layout_mainwin_rawSignalPanel_SsPeak_Thresh = QHBoxLayout() self.layout_mainwin_rawSignalPanel_CsPeak = QVBoxLayout() self.layout_mainwin_rawSignalPanel_CsPeak_Thresh = QHBoxLayout() # rawSignal plot self.plot_mainwin_rawSignalPanel_rawSignal = pg.PlotWidget() lib.set_plotWidget(self.plot_mainwin_rawSignalPanel_rawSignal) self.plot_mainwin_rawSignalPanel_rawSignal.setTitle( "Y: Raw_Signal(uV) | X: Time(s)") # SsPeak Panel, containing SsHistogram and SsThresh self.widget_mainwin_rawSignalPanel_SsPeakPanel = QWidget() self.widget_mainwin_rawSignalPanel_SsPeakPanel.setAutoFillBackground( True) palette = self.widget_mainwin_rawSignalPanel_SsPeakPanel.palette() palette.setColor(QtGui.QPalette.Window, QtGui.QColor(0, 0, 255, 30)) self.widget_mainwin_rawSignalPanel_SsPeakPanel.setPalette(palette) self.widget_mainwin_rawSignalPanel_SsPeakPanel.\ setLayout(self.layout_mainwin_rawSignalPanel_SsPeak) self.plot_mainwin_rawSignalPanel_SsPeak = pg.PlotWidget() lib.set_plotWidget(self.plot_mainwin_rawSignalPanel_SsPeak) self.plot_mainwin_rawSignalPanel_SsPeak.setTitle( "X: SS_Peak_Dist(uV) | Y: Count(#)") self.txtlabel_mainwin_rawSignalPanel_SsThresh = QLabel("SS Threshold") lib.setFont(self.txtlabel_mainwin_rawSignalPanel_SsThresh, color="blue") self.txtedit_mainwin_rawSignalPanel_SsThresh = QDoubleSpinBox() self.txtedit_mainwin_rawSignalPanel_SsThresh.setKeyboardTracking(True) self.txtedit_mainwin_rawSignalPanel_SsThresh.setMinimum(1.0) self.txtedit_mainwin_rawSignalPanel_SsThresh.setMaximum(15000.0) self.txtedit_mainwin_rawSignalPanel_SsThresh.setDecimals(0) lib.setFont(self.txtedit_mainwin_rawSignalPanel_SsThresh, color="blue") self.txtedit_mainwin_rawSignalPanel_SsThresh.setValue(300.0) self.line_mainwin_rawSignalPanel_SsL1 = QtGui.QFrame() self.line_mainwin_rawSignalPanel_SsL1.setFrameShape(QFrame.VLine) self.line_mainwin_rawSignalPanel_SsL1.setFrameShadow(QFrame.Sunken) self.line_mainwin_rawSignalPanel_SsL2 = QtGui.QFrame() self.line_mainwin_rawSignalPanel_SsL2.setFrameShape(QFrame.VLine) self.line_mainwin_rawSignalPanel_SsL2.setFrameShadow(QFrame.Sunken) self.pushBtn_mainwin_rawSignalPanel_SsAutoThresh = QPushButton("Auto") lib.setFont(self.pushBtn_mainwin_rawSignalPanel_SsAutoThresh, color="blue") self.layout_mainwin_rawSignalPanel_SsPeak_Thresh.\ addWidget(self.txtlabel_mainwin_rawSignalPanel_SsThresh) self.layout_mainwin_rawSignalPanel_SsPeak_Thresh.\ addWidget(self.txtedit_mainwin_rawSignalPanel_SsThresh) self.layout_mainwin_rawSignalPanel_SsPeak_Thresh.\ addWidget(self.line_mainwin_rawSignalPanel_SsL1) self.layout_mainwin_rawSignalPanel_SsPeak_Thresh.\ addStretch() self.layout_mainwin_rawSignalPanel_SsPeak_Thresh.\ addWidget(self.line_mainwin_rawSignalPanel_SsL2) self.layout_mainwin_rawSignalPanel_SsPeak_Thresh.\ addWidget(self.pushBtn_mainwin_rawSignalPanel_SsAutoThresh) self.layout_mainwin_rawSignalPanel_SsPeak_Thresh.setSpacing(1) self.layout_mainwin_rawSignalPanel_SsPeak_Thresh.setContentsMargins( 1, 1, 1, 1) self.layout_mainwin_rawSignalPanel_SsPeak.\ addLayout(self.layout_mainwin_rawSignalPanel_SsPeak_Thresh) self.layout_mainwin_rawSignalPanel_SsPeak.\ addWidget(self.plot_mainwin_rawSignalPanel_SsPeak) self.layout_mainwin_rawSignalPanel_SsPeak.setStretch(0, 0) self.layout_mainwin_rawSignalPanel_SsPeak.setStretch(1, 1) self.layout_mainwin_rawSignalPanel_SsPeak.setSpacing(1) self.layout_mainwin_rawSignalPanel_SsPeak.setContentsMargins( 1, 1, 1, 1) # CsPeak Panel, containing CsHistogram and CsThresh self.widget_mainwin_rawSignalPanel_CsPeakPanel = QWidget() self.widget_mainwin_rawSignalPanel_CsPeakPanel.setAutoFillBackground( True) palette = self.widget_mainwin_rawSignalPanel_CsPeakPanel.palette() palette.setColor(QtGui.QPalette.Window, QtGui.QColor(255, 0, 0, 30)) self.widget_mainwin_rawSignalPanel_CsPeakPanel.setPalette(palette) self.widget_mainwin_rawSignalPanel_CsPeakPanel.\ setLayout(self.layout_mainwin_rawSignalPanel_CsPeak) self.plot_mainwin_rawSignalPanel_CsPeak = pg.PlotWidget() lib.set_plotWidget(self.plot_mainwin_rawSignalPanel_CsPeak) self.plot_mainwin_rawSignalPanel_CsPeak.setTitle( "X: CS_Peak_Dist(uV) | Y: Count(#)") self.txtlabel_mainwin_rawSignalPanel_CsThresh = QLabel("CS Threshold") lib.setFont(self.txtlabel_mainwin_rawSignalPanel_CsThresh, color="red") self.txtedit_mainwin_rawSignalPanel_CsThresh = QDoubleSpinBox() self.txtedit_mainwin_rawSignalPanel_CsThresh.setKeyboardTracking(True) self.txtedit_mainwin_rawSignalPanel_CsThresh.setMinimum(1.0) self.txtedit_mainwin_rawSignalPanel_CsThresh.setMaximum(15000.0) self.txtedit_mainwin_rawSignalPanel_CsThresh.setDecimals(0) lib.setFont(self.txtedit_mainwin_rawSignalPanel_CsThresh, color="red") self.txtedit_mainwin_rawSignalPanel_CsThresh.setValue(300.0) self.line_mainwin_rawSignalPanel_CsL1 = QtGui.QFrame() self.line_mainwin_rawSignalPanel_CsL1.setFrameShape(QFrame.VLine) self.line_mainwin_rawSignalPanel_CsL1.setFrameShadow(QFrame.Sunken) self.line_mainwin_rawSignalPanel_CsL2 = QtGui.QFrame() self.line_mainwin_rawSignalPanel_CsL2.setFrameShape(QFrame.VLine) self.line_mainwin_rawSignalPanel_CsL2.setFrameShadow(QFrame.Sunken) self.pushBtn_mainwin_rawSignalPanel_CsAutoThresh = QPushButton("Auto") lib.setFont(self.pushBtn_mainwin_rawSignalPanel_CsAutoThresh, color="red") self.layout_mainwin_rawSignalPanel_CsPeak_Thresh.\ addWidget(self.txtlabel_mainwin_rawSignalPanel_CsThresh) self.layout_mainwin_rawSignalPanel_CsPeak_Thresh.\ addWidget(self.txtedit_mainwin_rawSignalPanel_CsThresh) self.layout_mainwin_rawSignalPanel_CsPeak_Thresh.\ addWidget(self.line_mainwin_rawSignalPanel_CsL1) self.layout_mainwin_rawSignalPanel_CsPeak_Thresh.\ addStretch() self.layout_mainwin_rawSignalPanel_CsPeak_Thresh.\ addWidget(self.line_mainwin_rawSignalPanel_CsL2) self.layout_mainwin_rawSignalPanel_CsPeak_Thresh.\ addWidget(self.pushBtn_mainwin_rawSignalPanel_CsAutoThresh) self.layout_mainwin_rawSignalPanel_CsPeak_Thresh.setSpacing(1) self.layout_mainwin_rawSignalPanel_CsPeak_Thresh.setContentsMargins( 1, 1, 1, 1) self.layout_mainwin_rawSignalPanel_CsPeak.\ addLayout(self.layout_mainwin_rawSignalPanel_CsPeak_Thresh) self.layout_mainwin_rawSignalPanel_CsPeak.\ addWidget(self.plot_mainwin_rawSignalPanel_CsPeak) self.layout_mainwin_rawSignalPanel_CsPeak.setStretch(0, 0) self.layout_mainwin_rawSignalPanel_CsPeak.setStretch(1, 1) self.layout_mainwin_rawSignalPanel_CsPeak.setSpacing(1) self.layout_mainwin_rawSignalPanel_CsPeak.setContentsMargins( 1, 1, 1, 1) # rawSignal plot is x3 while the SsPeak and CsPeak are x1 self.layout_mainwin_rawSignalPanel.\ addWidget(self.plot_mainwin_rawSignalPanel_rawSignal) self.layout_mainwin_rawSignalPanel.\ addWidget(self.widget_mainwin_rawSignalPanel_SsPeakPanel) self.layout_mainwin_rawSignalPanel.\ addWidget(self.widget_mainwin_rawSignalPanel_CsPeakPanel) self.layout_mainwin_rawSignalPanel.setStretch(0, 3) self.layout_mainwin_rawSignalPanel.setStretch(1, 1) self.layout_mainwin_rawSignalPanel.setStretch(2, 1) self.layout_mainwin_rawSignalPanel.setSpacing(1) self.layout_mainwin_rawSignalPanel.setContentsMargins(1, 1, 1, 1) return 0
def build_mainwin_CsPanel(self): self.layout_mainwin_CsPanel_plots = QGridLayout() self.layout_mainwin_CsPanel_buttons = QHBoxLayout() self.layout_mainwin_CsPanel_plots_CsWaveBtn = QHBoxLayout() self.layout_mainwin_CsPanel_plots_CsPcaBtn = QHBoxLayout() self.pushBtn_mainwin_CsPanel_plots_CsWaveBtn_waveDissect = QPushButton( "Dissect") lib.setFont(self.pushBtn_mainwin_CsPanel_plots_CsWaveBtn_waveDissect, color="red") self.pushBtn_mainwin_CsPanel_plots_CsWaveBtn_selectWave = QPushButton( "Select") lib.setFont(self.pushBtn_mainwin_CsPanel_plots_CsWaveBtn_selectWave, color="red") self.pushBtn_mainwin_CsPanel_plots_CsWaveBtn_learnWaveform = QPushButton( "Learn Template") lib.setFont(self.pushBtn_mainwin_CsPanel_plots_CsWaveBtn_learnWaveform, color="red") self.pushBtn_mainwin_CsPanel_plots_CsWaveBtn_learnWaveform.setCheckable( True) self.layout_mainwin_CsPanel_plots_CsWaveBtn.\ addWidget(self.pushBtn_mainwin_CsPanel_plots_CsWaveBtn_waveDissect) self.layout_mainwin_CsPanel_plots_CsWaveBtn.\ addWidget(self.pushBtn_mainwin_CsPanel_plots_CsWaveBtn_selectWave) self.layout_mainwin_CsPanel_plots_CsWaveBtn.\ addWidget(self.pushBtn_mainwin_CsPanel_plots_CsWaveBtn_learnWaveform) self.layout_mainwin_CsPanel_plots_CsWaveBtn.setSpacing(1) self.layout_mainwin_CsPanel_plots_CsWaveBtn.setContentsMargins( 1, 1, 1, 1) self.pushBtn_mainwin_CsPanel_plots_CsPcaBtn_waveClust = QPushButton( "Cluster") lib.setFont(self.pushBtn_mainwin_CsPanel_plots_CsPcaBtn_waveClust, color="red") self.pushBtn_mainwin_CsPanel_plots_CsPcaBtn_selectPcaData = QPushButton( "Select") lib.setFont(self.pushBtn_mainwin_CsPanel_plots_CsPcaBtn_selectPcaData, color="red") self.comboBx_mainwin_CsPanel_plots_CsPcaBtn_selectPcaCombo = QComboBox( ) self.comboBx_mainwin_CsPanel_plots_CsPcaBtn_selectPcaCombo.addItems( ["Manual", "GMM-2D"]) self.comboBx_mainwin_CsPanel_plots_CsPcaBtn_selectPcaCombo.setCurrentIndex( 0) lib.setFont(self.comboBx_mainwin_CsPanel_plots_CsPcaBtn_selectPcaCombo, color="red") self.layout_mainwin_CsPanel_plots_CsPcaBtn.\ addWidget(self.pushBtn_mainwin_CsPanel_plots_CsPcaBtn_waveClust) self.layout_mainwin_CsPanel_plots_CsPcaBtn.\ addWidget(self.pushBtn_mainwin_CsPanel_plots_CsPcaBtn_selectPcaData) self.layout_mainwin_CsPanel_plots_CsPcaBtn.\ addWidget(self.comboBx_mainwin_CsPanel_plots_CsPcaBtn_selectPcaCombo) self.layout_mainwin_CsPanel_plots_CsPcaBtn.setSpacing(1) self.layout_mainwin_CsPanel_plots_CsPcaBtn.setContentsMargins( 1, 1, 1, 1) self.txtlabel_mainwin_CsPanel_plots_CsFiring = QLabel( "CS Firing: 0.00Hz") lib.setFont(self.txtlabel_mainwin_CsPanel_plots_CsFiring, color="red") self.txtlabel_mainwin_CsPanel_plots_CsFiring.\ setAlignment(QtCore.Qt.AlignCenter) self.plot_mainwin_CsPanel_plots_CsWave = pg.PlotWidget() lib.set_plotWidget(self.plot_mainwin_CsPanel_plots_CsWave) self.plot_mainwin_CsPanel_plots_CsWave.setTitle( "Y: CS_Waveform(uV) | X: Time(ms)") self.plot_mainwin_CsPanel_plots_CsIfr = pg.PlotWidget() lib.set_plotWidget(self.plot_mainwin_CsPanel_plots_CsIfr) self.plot_mainwin_CsPanel_plots_CsIfr.setTitle( "Y: CS_IFR(#) | X: Freq(Hz)") self.plot_mainwin_CsPanel_plots_CsPca = pg.PlotWidget() lib.set_plotWidget(self.plot_mainwin_CsPanel_plots_CsPca) self.plot_mainwin_CsPanel_plots_CsPca.setTitle(None) self.plot_mainwin_CsPanel_plots_CsXProb = pg.PlotWidget() lib.set_plotWidget(self.plot_mainwin_CsPanel_plots_CsXProb) self.plot_mainwin_CsPanel_plots_CsXProb.setTitle( "Y: CSxSS_XProb(1) | X: Time(ms)") self.layout_mainwin_CsPanel_plots_CsPcaPlot = QVBoxLayout() self.layout_mainwin_CsPanel_plots_CsPcaPlot_PcaNum = QHBoxLayout() self.widget_mainwin_CsPanel_plots_CsPcaPlot_PcaNum = QWidget() self.widget_mainwin_CsPanel_plots_CsPcaPlot_PcaNum.setAutoFillBackground( True) palette = self.widget_mainwin_CsPanel_plots_CsPcaPlot_PcaNum.palette() palette.setColor(QtGui.QPalette.Window, QtGui.QColor(255, 255, 255, 255)) self.widget_mainwin_CsPanel_plots_CsPcaPlot_PcaNum.setPalette(palette) self.widget_mainwin_CsPanel_plots_CsPcaPlot_PcaNum.\ setLayout(self.layout_mainwin_CsPanel_plots_CsPcaPlot_PcaNum) self.comboBx_mainwin_CsPanel_plots_CsPcaPlot_PcaNum1 = QComboBox() self.comboBx_mainwin_CsPanel_plots_CsPcaPlot_PcaNum1.addItems( ['pca1', 'pca2']) lib.setFont(self.comboBx_mainwin_CsPanel_plots_CsPcaPlot_PcaNum1, color="red") self.comboBx_mainwin_CsPanel_plots_CsPcaPlot_PcaNum1.setCurrentIndex(0) self.comboBx_mainwin_CsPanel_plots_CsPcaPlot_PcaNum2 = QComboBox() self.comboBx_mainwin_CsPanel_plots_CsPcaPlot_PcaNum2.addItems( ['pca1', 'pca2']) lib.setFont(self.comboBx_mainwin_CsPanel_plots_CsPcaPlot_PcaNum2, color="red") self.comboBx_mainwin_CsPanel_plots_CsPcaPlot_PcaNum2.setCurrentIndex(1) self.txtlabel_mainwin_CsPanel_plots_CsPcaPlot_PcaNum1 = QLabel( "| X: CS_ ") lib.setFont(self.txtlabel_mainwin_CsPanel_plots_CsPcaPlot_PcaNum1, color="red") self.txtlabel_mainwin_CsPanel_plots_CsPcaPlot_PcaNum2 = QLabel( " Y: CS_ ") lib.setFont(self.txtlabel_mainwin_CsPanel_plots_CsPcaPlot_PcaNum2, color="red") self.layout_mainwin_CsPanel_plots_CsPcaPlot_PcaNum.\ addWidget(self.txtlabel_mainwin_CsPanel_plots_CsPcaPlot_PcaNum2) self.layout_mainwin_CsPanel_plots_CsPcaPlot_PcaNum.\ addWidget(self.comboBx_mainwin_CsPanel_plots_CsPcaPlot_PcaNum2) self.layout_mainwin_CsPanel_plots_CsPcaPlot_PcaNum.\ addWidget(self.txtlabel_mainwin_CsPanel_plots_CsPcaPlot_PcaNum1) self.layout_mainwin_CsPanel_plots_CsPcaPlot_PcaNum.\ addWidget(self.comboBx_mainwin_CsPanel_plots_CsPcaPlot_PcaNum1) self.layout_mainwin_CsPanel_plots_CsPcaPlot_PcaNum.setStretch(0, 0) self.layout_mainwin_CsPanel_plots_CsPcaPlot_PcaNum.setStretch(1, 1) self.layout_mainwin_CsPanel_plots_CsPcaPlot_PcaNum.setStretch(2, 0) self.layout_mainwin_CsPanel_plots_CsPcaPlot_PcaNum.setStretch(3, 1) self.layout_mainwin_CsPanel_plots_CsPcaPlot_PcaNum.setSpacing(1) self.layout_mainwin_CsPanel_plots_CsPcaPlot_PcaNum.setContentsMargins( 1, 1, 1, 1) self.layout_mainwin_CsPanel_plots_CsPcaPlot.\ addWidget(self.widget_mainwin_CsPanel_plots_CsPcaPlot_PcaNum) self.layout_mainwin_CsPanel_plots_CsPcaPlot.\ addWidget(self.plot_mainwin_CsPanel_plots_CsPca) self.layout_mainwin_CsPanel_plots_CsPcaPlot.setSpacing(1) self.layout_mainwin_CsPanel_plots_CsPcaPlot.setContentsMargins( 1, 1, 1, 1) self.layout_mainwin_CsPanel_plots.\ addLayout(self.layout_mainwin_CsPanel_plots_CsWaveBtn, 0, 0) self.layout_mainwin_CsPanel_plots.\ addWidget(self.txtlabel_mainwin_CsPanel_plots_CsFiring, 0, 1) self.layout_mainwin_CsPanel_plots.\ addWidget(self.plot_mainwin_CsPanel_plots_CsWave, 1, 0) self.layout_mainwin_CsPanel_plots.\ addWidget(self.plot_mainwin_CsPanel_plots_CsIfr, 1, 1) self.layout_mainwin_CsPanel_plots.\ addLayout(self.layout_mainwin_CsPanel_plots_CsPcaBtn, 2, 0) self.layout_mainwin_CsPanel_plots.\ addLayout(self.layout_mainwin_CsPanel_plots_CsPcaPlot, 3, 0) self.layout_mainwin_CsPanel_plots.\ addWidget(self.plot_mainwin_CsPanel_plots_CsXProb, 3, 1) self.layout_mainwin_CsPanel_plots.setRowStretch(0, 0) self.layout_mainwin_CsPanel_plots.setRowStretch(1, 1) self.layout_mainwin_CsPanel_plots.setRowStretch(2, 0) self.layout_mainwin_CsPanel_plots.setRowStretch(3, 1) self.layout_mainwin_CsPanel_plots.setSpacing(1) self.layout_mainwin_CsPanel_plots.setContentsMargins(1, 1, 1, 1) self.pushBtn_mainwin_CsPanel_buttons_CsDelete = QPushButton("Delete") lib.setFont(self.pushBtn_mainwin_CsPanel_buttons_CsDelete, color="red") self.pushBtn_mainwin_CsPanel_buttons_CsDelete.\ setIcon(QtGui.QIcon(os.path.join(lib.PROJECT_FOLDER, 'icons', '067-trash-red.png'))) self.pushBtn_mainwin_CsPanel_buttons_CsKeep = QPushButton("Keep") lib.setFont(self.pushBtn_mainwin_CsPanel_buttons_CsKeep, color="red") self.pushBtn_mainwin_CsPanel_buttons_CsKeep.\ setIcon(QtGui.QIcon(os.path.join(lib.PROJECT_FOLDER, 'icons', '023-download-red.png'))) self.pushBtn_mainwin_CsPanel_buttons_CsMoveToSs = QPushButton( "Move to SS") lib.setFont(self.pushBtn_mainwin_CsPanel_buttons_CsMoveToSs, color="red") self.pushBtn_mainwin_CsPanel_buttons_CsMoveToSs.\ setIcon(QtGui.QIcon(os.path.join(lib.PROJECT_FOLDER, 'icons', '084-shuffle-left-red.png'))) self.pushBtn_mainwin_CsPanel_buttons_CsDeselect = QPushButton( "Unselect") lib.setFont(self.pushBtn_mainwin_CsPanel_buttons_CsDeselect, color="red") self.pushBtn_mainwin_CsPanel_buttons_CsDeselect.\ setIcon(QtGui.QIcon(os.path.join(lib.PROJECT_FOLDER, 'icons', '030-forbidden-red.png'))) self.layout_mainwin_CsPanel_buttons.\ addWidget(self.pushBtn_mainwin_CsPanel_buttons_CsDelete) self.layout_mainwin_CsPanel_buttons.\ addWidget(self.pushBtn_mainwin_CsPanel_buttons_CsKeep) self.layout_mainwin_CsPanel_buttons.\ addWidget(self.pushBtn_mainwin_CsPanel_buttons_CsMoveToSs) self.layout_mainwin_CsPanel_buttons.\ addWidget(self.pushBtn_mainwin_CsPanel_buttons_CsDeselect) self.layout_mainwin_CsPanel_buttons.setSpacing(1) self.layout_mainwin_CsPanel_buttons.setContentsMargins(1, 1, 1, 1) self.layout_mainwin_CsPanel.\ addLayout(self.layout_mainwin_CsPanel_plots) self.layout_mainwin_CsPanel.\ addLayout(self.layout_mainwin_CsPanel_buttons) self.layout_mainwin_CsPanel.setStretch(0, 1) self.layout_mainwin_CsPanel.setStretch(1, 0) self.layout_mainwin_CsPanel.setSpacing(1) self.layout_mainwin_CsPanel.setContentsMargins(1, 1, 1, 1) return 0
def build_mainwin_filterPanel(self): self.comboBx_mainwin_filterPanel_CsAlign = QComboBox() self.comboBx_mainwin_filterPanel_CsAlign.\ addItems(["Align CS wrt 'SS Index'", \ "Align CS wrt 'SS Template'", \ "Align CS wrt 'CS Template'"]) lib.setFont(self.comboBx_mainwin_filterPanel_CsAlign, color="red") self.comboBx_mainwin_filterPanel_CsSlow = QComboBox() self.comboBx_mainwin_filterPanel_CsSlow.addItems(["Pos(+) CS Filter Peak", \ "Neg(-) CS Filter Peak"]) lib.setFont(self.comboBx_mainwin_filterPanel_CsSlow, color="red") self.comboBx_mainwin_filterPanel_SsFast = QComboBox() self.comboBx_mainwin_filterPanel_SsFast.addItems(["Neg(-) SS Filter Peak", \ "Pos(+) SS Filter Peak"]) lib.setFont(self.comboBx_mainwin_filterPanel_SsFast, color="blue") self.line_mainwin_filterPanel_l1 = QtWidgets.QFrame() self.line_mainwin_filterPanel_l1.setFrameShape(QFrame.VLine) self.line_mainwin_filterPanel_l1.setFrameShadow(QFrame.Sunken) self.line_mainwin_filterPanel_l2 = QtWidgets.QFrame() self.line_mainwin_filterPanel_l2.setFrameShape(QFrame.VLine) self.line_mainwin_filterPanel_l2.setFrameShadow(QFrame.Sunken) self.txtlabel_mainwin_filterPanel_csFilter = QLabel("CS Filter (Hz):") lib.setFont(self.txtlabel_mainwin_filterPanel_csFilter, color="red") self.txtlabel_mainwin_filterPanel_csFilter_dash = QLabel("-") lib.setFont(self.txtlabel_mainwin_filterPanel_csFilter_dash, color="red") self.txtedit_mainwin_filterPanel_csFilter_min = QDoubleSpinBox() self.txtedit_mainwin_filterPanel_csFilter_min.setKeyboardTracking(True) self.txtedit_mainwin_filterPanel_csFilter_min.setMinimum(1.0) self.txtedit_mainwin_filterPanel_csFilter_min.setMaximum(15000.0) self.txtedit_mainwin_filterPanel_csFilter_min.setDecimals(0) lib.setFont(self.txtedit_mainwin_filterPanel_csFilter_min, color="red") self.txtedit_mainwin_filterPanel_csFilter_min.setValue(10.0) self.txtedit_mainwin_filterPanel_csFilter_max = QDoubleSpinBox() self.txtedit_mainwin_filterPanel_csFilter_max.setKeyboardTracking(True) self.txtedit_mainwin_filterPanel_csFilter_max.setMinimum(1.0) self.txtedit_mainwin_filterPanel_csFilter_max.setMaximum(15000.0) self.txtedit_mainwin_filterPanel_csFilter_max.setDecimals(0) lib.setFont(self.txtedit_mainwin_filterPanel_csFilter_max, color="red") self.txtedit_mainwin_filterPanel_csFilter_max.setValue(200.0) self.line_mainwin_filterPanel_l3 = QtWidgets.QFrame() self.line_mainwin_filterPanel_l3.setFrameShape(QFrame.VLine) self.line_mainwin_filterPanel_l3.setFrameShadow(QFrame.Sunken) self.txtlabel_mainwin_filterPanel_ssFilter = QLabel("SS Filter (Hz):") lib.setFont(self.txtlabel_mainwin_filterPanel_ssFilter, color="blue") self.txtlabel_mainwin_filterPanel_ssFilter_dash = QLabel("-") lib.setFont(self.txtlabel_mainwin_filterPanel_ssFilter_dash, color="blue") self.txtedit_mainwin_filterPanel_ssFilter_min = QDoubleSpinBox() self.txtedit_mainwin_filterPanel_ssFilter_min.setKeyboardTracking(True) self.txtedit_mainwin_filterPanel_ssFilter_min.setMinimum(1.0) self.txtedit_mainwin_filterPanel_ssFilter_min.setMaximum(15000.0) self.txtedit_mainwin_filterPanel_ssFilter_min.setDecimals(0) lib.setFont(self.txtedit_mainwin_filterPanel_ssFilter_min, color="blue") self.txtedit_mainwin_filterPanel_ssFilter_min.setValue(50.0) self.txtedit_mainwin_filterPanel_ssFilter_max = QDoubleSpinBox() self.txtedit_mainwin_filterPanel_ssFilter_max.setKeyboardTracking(True) self.txtedit_mainwin_filterPanel_ssFilter_max.setMinimum(1.0) self.txtedit_mainwin_filterPanel_ssFilter_max.setMaximum(15000.0) self.txtedit_mainwin_filterPanel_ssFilter_max.setDecimals(0) lib.setFont(self.txtedit_mainwin_filterPanel_ssFilter_max, color="blue") self.txtedit_mainwin_filterPanel_ssFilter_max.setValue(5000.0) # Add to layout self.layout_mainwin_filterPanel.\ addWidget(self.comboBx_mainwin_filterPanel_SsFast) self.layout_mainwin_filterPanel.\ addWidget(self.comboBx_mainwin_filterPanel_CsSlow) self.layout_mainwin_filterPanel.\ addWidget(self.comboBx_mainwin_filterPanel_CsAlign) self.layout_mainwin_filterPanel.\ addWidget(self.line_mainwin_filterPanel_l1) self.layout_mainwin_filterPanel.\ addStretch() self.layout_mainwin_filterPanel.\ addWidget(self.line_mainwin_filterPanel_l2) self.layout_mainwin_filterPanel.\ addWidget(self.txtlabel_mainwin_filterPanel_ssFilter) self.layout_mainwin_filterPanel.\ addWidget(self.txtedit_mainwin_filterPanel_ssFilter_min) self.layout_mainwin_filterPanel.\ addWidget(self.txtlabel_mainwin_filterPanel_ssFilter_dash) self.layout_mainwin_filterPanel.\ addWidget(self.txtedit_mainwin_filterPanel_ssFilter_max) self.layout_mainwin_filterPanel.\ addWidget(self.line_mainwin_filterPanel_l3) self.layout_mainwin_filterPanel.\ addWidget(self.txtlabel_mainwin_filterPanel_csFilter) self.layout_mainwin_filterPanel.\ addWidget(self.txtedit_mainwin_filterPanel_csFilter_min) self.layout_mainwin_filterPanel.\ addWidget(self.txtlabel_mainwin_filterPanel_csFilter_dash) self.layout_mainwin_filterPanel.\ addWidget(self.txtedit_mainwin_filterPanel_csFilter_max) self.layout_mainwin_filterPanel.setSpacing(5) self.layout_mainwin_filterPanel.setContentsMargins(1, 1, 1, 1) return 0
def build_slotBoundary_Widget(self): self.layout_slotBoundary = QVBoxLayout() self.layout_slotBoundary_OkCancel = QHBoxLayout() self.layout_slotBoundary_toolbar = QHBoxLayout() # Cancel push button for closing the window and terminating the process self.pushBtn_slotBoundary_cancel = QPushButton("Cancel") lib.setFont(self.pushBtn_slotBoundary_cancel) self.pushBtn_slotBoundary_ok = QPushButton("OK") lib.setFont(self.pushBtn_slotBoundary_ok) self.layout_slotBoundary_OkCancel.addWidget(self.pushBtn_slotBoundary_cancel) self.layout_slotBoundary_OkCancel.addWidget(self.pushBtn_slotBoundary_ok) # separator line self.line_slotBoundary_h0 = QtWidgets.QFrame() self.line_slotBoundary_h0.setFrameShape(QFrame.HLine) self.line_slotBoundary_h0.setFrameShadow(QFrame.Sunken) self.line_slotBoundary_h1 = QtWidgets.QFrame() self.line_slotBoundary_h1.setFrameShape(QFrame.HLine) self.line_slotBoundary_h1.setFrameShadow(QFrame.Sunken) self.line_slotBoundary_v0 = QtWidgets.QFrame() self.line_slotBoundary_v0.setFrameShape(QFrame.VLine) self.line_slotBoundary_v0.setFrameShadow(QFrame.Sunken) self.line_slotBoundary_v1 = QtWidgets.QFrame() self.line_slotBoundary_v1.setFrameShape(QFrame.VLine) self.line_slotBoundary_v1.setFrameShadow(QFrame.Sunken) self.line_slotBoundary_v2 = QtWidgets.QFrame() self.line_slotBoundary_v2.setFrameShape(QFrame.VLine) self.line_slotBoundary_v2.setFrameShadow(QFrame.Sunken) self.line_slotBoundary_v3 = QtWidgets.QFrame() self.line_slotBoundary_v3.setFrameShape(QFrame.VLine) self.line_slotBoundary_v3.setFrameShadow(QFrame.Sunken) self.line_slotBoundary_v4 = QtWidgets.QFrame() self.line_slotBoundary_v4.setFrameShape(QFrame.VLine) self.line_slotBoundary_v4.setFrameShadow(QFrame.Sunken) # toolbar self.label_slotBoundary_numSlots = QLabel("Number of slots:") lib.setFont(self.label_slotBoundary_numSlots) self.spinBx_slotBoundary_numSlots = QSpinBox() self.spinBx_slotBoundary_numSlots.setKeyboardTracking(False) self.spinBx_slotBoundary_numSlots.setMinimum(1) self.spinBx_slotBoundary_numSlots.setMaximum(120) self.spinBx_slotBoundary_numSlots.setValue(30) lib.setFont(self.spinBx_slotBoundary_numSlots) self.pushBtn_slotBoundary_addSlot = QPushButton("Add line at click") lib.setFont(self.pushBtn_slotBoundary_addSlot) self.pushBtn_slotBoundary_addSlot.setCheckable(True) self.pushBtn_slotBoundary_addSlot.setIcon(QtGui.QIcon(os.path.join(lib.PROJECT_FOLDER, 'icons', 'crosshair.png'))) self.label_slotBoundary_description = QLabel("Drag line out of boundries to delete.") lib.setFont(self.label_slotBoundary_description) self.label_slotBoundary_resetModeDescription = QLabel("Restart mode: ") lib.setFont(self.label_slotBoundary_resetModeDescription) self.comboBx_slotBoundary_restartMode = QComboBox() self.comboBx_slotBoundary_restartMode.addItems(["Hard restart","Soft restart"]) lib.setFont(self.comboBx_slotBoundary_restartMode) self.label_slotBoundary_duration = QLabel(f"Avg slot duration: {10}s.") lib.setFont(self.label_slotBoundary_duration) self.layout_slotBoundary_toolbar.addWidget(self.label_slotBoundary_numSlots) self.layout_slotBoundary_toolbar.addWidget(self.spinBx_slotBoundary_numSlots) self.layout_slotBoundary_toolbar.addWidget(self.line_slotBoundary_v0) self.layout_slotBoundary_toolbar.addWidget(self.pushBtn_slotBoundary_addSlot) self.layout_slotBoundary_toolbar.addWidget(self.line_slotBoundary_v1) self.layout_slotBoundary_toolbar.addWidget(self.label_slotBoundary_description) self.layout_slotBoundary_toolbar.addWidget(self.line_slotBoundary_v2) self.layout_slotBoundary_toolbar.addStretch() self.layout_slotBoundary_toolbar.addWidget(self.line_slotBoundary_v3) self.layout_slotBoundary_toolbar.addWidget(self.label_slotBoundary_resetModeDescription) self.layout_slotBoundary_toolbar.addWidget(self.comboBx_slotBoundary_restartMode) self.layout_slotBoundary_toolbar.addWidget(self.line_slotBoundary_v4) self.layout_slotBoundary_toolbar.addWidget(self.label_slotBoundary_duration) self.layout_slotBoundary_toolbar.setSpacing(1) self.layout_slotBoundary_toolbar.setContentsMargins(1,1,1,1) # plot self.plot_slotBoundary_mainPlot = pg.PlotWidget() lib.set_plotWidget(self.plot_slotBoundary_mainPlot) # add widgets to the layout self.layout_slotBoundary.addLayout(self.layout_slotBoundary_OkCancel) self.layout_slotBoundary.addWidget(self.line_slotBoundary_h0) self.layout_slotBoundary.addLayout(self.layout_slotBoundary_toolbar) self.layout_slotBoundary.addWidget(self.line_slotBoundary_h1) self.layout_slotBoundary.addWidget(self.plot_slotBoundary_mainPlot) self.layout_slotBoundary.setSpacing(1) self.layout_slotBoundary.setContentsMargins(1,1,1,1) self.setLayout(self.layout_slotBoundary) return 0