|
@@ -40,7 +40,9 @@ class SingleReadWidget(kcgw.KCGWidgets):
|
|
|
self.setLayout(self.outerLayout)
|
|
|
|
|
|
# ---------[ Create Labels and corresponding Fields ]---------
|
|
|
- self.single_read_button = self.createButton(tr("Button", "Single Read"), connect=self.on_single_read)
|
|
|
+ self.single_read_button = self.createButton(tr("Button", "Single Acquisition"), connect=self.on_single_read)
|
|
|
+ self.continuous_read_button = self.createButton(tr("Button", "Continuous Acquisition"),
|
|
|
+ connect=lambda: self.on_continuous_read(True, available_boards[0]))
|
|
|
self.single_read_input = self.createInput()
|
|
|
self.interval_spinbox = self.createSpinbox(0, 100000, start_value=1000)
|
|
|
self.interval_spinbox.valueChanged.connect(self.set_interval)
|
|
@@ -62,14 +64,20 @@ class SingleReadWidget(kcgw.KCGWidgets):
|
|
|
Elements.addItem(["acquire_{}".format(board_id), "no_board_{}".format(board_id)], tick)
|
|
|
|
|
|
# --------[ Fill Grid ]----------------
|
|
|
- self.layout.addWidget(self.single_read_button, 0, 1)
|
|
|
- self.layout.addWidget(self.createLabel(tr("Label", "info:")), 1, 0)
|
|
|
- self.layout.addWidget(self.single_read_input, 1, 1)
|
|
|
- # self.layout.addWidget(self.continuous_read_button, 0, 1)
|
|
|
- self.layout.addWidget(self.createLabel(tr("Label", "Interval:") + " (ms)"), 2, 0)
|
|
|
- self.layout.addWidget(self.interval_spinbox, 2, 1)
|
|
|
+ self.layout.addWidget(self.continuous_read_button, 0, 1)
|
|
|
+ self.layout.addWidget(self.single_read_button, 1, 1)
|
|
|
+ self.layout.addWidget(self.createLabel(tr("Label", "info:")), 2, 0)
|
|
|
+ self.layout.addWidget(self.single_read_input, 2, 1)
|
|
|
+ self.layout.addWidget(self.createLabel(tr("Label", "Interval:") + " (ms)"), 3, 0)
|
|
|
+ self.layout.addWidget(self.interval_spinbox, 3, 1)
|
|
|
self.setWindowTitle(tr("Heading", "Single and Continuous Read"))
|
|
|
|
|
|
+
|
|
|
+ #01.04.2021 by Timo
|
|
|
+ #We currently only support a single board.
|
|
|
+ #However, this might change again in the future, so we only hide
|
|
|
+ #the board selection checkbox until then, to avoid confusion
|
|
|
+ '''
|
|
|
self.tickLayout = QtGui.QHBoxLayout()
|
|
|
self.tickLayout.addWidget(self.createLabel(
|
|
|
tr("Label", "Boards"), tooltip=tr("Tooltip", "Check the board you want to select for single read"))
|
|
@@ -90,8 +98,10 @@ class SingleReadWidget(kcgw.KCGWidgets):
|
|
|
self.tickLayoutContinuousRead.addWidget(tick)
|
|
|
self.outerLayout.addLayout(self.tickLayoutContinuousRead)
|
|
|
self.outerLayout.addLayout(self.tickLayout)
|
|
|
+ '''
|
|
|
+
|
|
|
+
|
|
|
self.outerLayout.addLayout(self.layout)
|
|
|
-# self.outerLayout.addStretch(1)
|
|
|
|
|
|
self.set_interval()
|
|
|
|
|
@@ -116,19 +126,26 @@ class SingleReadWidget(kcgw.KCGWidgets):
|
|
|
# if self.board_ticks_continuous_read[id].isChecked():
|
|
|
self.set_interval()
|
|
|
if state:
|
|
|
- # self.continuous_read_button.setText(tr("Button", "Stop Continuous Read"))
|
|
|
+ self.continuous_read_button.setText(tr("Button", "Stop Continuous Acquisition"))
|
|
|
+ self.continuous_read_button.clicked.connect(lambda: self.on_continuous_read(False, board_id))
|
|
|
+ self.single_read_button.setEnabled(False)
|
|
|
# self.continuous_read[id] = True
|
|
|
- self.board_ticks_continuous_read[board_id].setStyleSheet("border-color: green; border-width: 3px;")
|
|
|
+ # self.board_ticks_continuous_read[board_id].setStyleSheet("border-color: green; border-width: 3px;")
|
|
|
else:
|
|
|
+ self.continuous_read_button.setText(tr("Button", "Continuous Acquisition"))
|
|
|
+ self.continuous_read_button.clicked.connect(lambda: self.on_continuous_read(True, board_id))
|
|
|
self.board_ticks_continuous_read[board_id].setStyleSheet("")
|
|
|
+ self.single_read_button.setEnabled(True)
|
|
|
bif.bk_continuous_read(board_id) # interval=self.interval_spinbox.value())
|
|
|
|
|
|
+
|
|
|
def set_interval(self):
|
|
|
"""
|
|
|
Set the interval between reads
|
|
|
"""
|
|
|
storage.continuous_interval = self.interval_spinbox.value()
|
|
|
|
|
|
+
|
|
|
def closeEvent(self, event):
|
|
|
"""
|
|
|
Event handler to handle the event of closing this window and gracefully delete ids and such
|