biosignal-device-interface 0.1.32a1__py3-none-any.whl → 0.2.1__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- biosignal_device_interface/constants/devices/__init__.py +3 -3
- biosignal_device_interface/constants/devices/core/base_device_constants.py +61 -61
- biosignal_device_interface/constants/devices/otb/otb_muovi_constants.py +129 -129
- biosignal_device_interface/constants/devices/otb/otb_quattrocento_constants.py +313 -313
- biosignal_device_interface/constants/devices/otb/otb_quattrocento_light_constants.py +59 -59
- biosignal_device_interface/constants/devices/otb/otb_syncstation_constants.py +233 -233
- biosignal_device_interface/constants/plots/color_palette.py +59 -59
- biosignal_device_interface/devices/__init__.py +17 -17
- biosignal_device_interface/devices/core/base_device.py +424 -412
- biosignal_device_interface/devices/otb/__init__.py +29 -29
- biosignal_device_interface/devices/otb/otb_muovi.py +290 -290
- biosignal_device_interface/devices/otb/otb_quattrocento.py +332 -332
- biosignal_device_interface/devices/otb/otb_quattrocento_light.py +210 -210
- biosignal_device_interface/devices/otb/otb_syncstation.py +407 -407
- biosignal_device_interface/gui/device_template_widgets/all_devices_widget.py +51 -51
- biosignal_device_interface/gui/device_template_widgets/core/base_device_widget.py +130 -130
- biosignal_device_interface/gui/device_template_widgets/core/base_multiple_devices_widget.py +108 -108
- biosignal_device_interface/gui/device_template_widgets/otb/otb_devices_widget.py +44 -44
- biosignal_device_interface/gui/device_template_widgets/otb/otb_muovi_plus_widget.py +158 -158
- biosignal_device_interface/gui/device_template_widgets/otb/otb_muovi_widget.py +158 -158
- biosignal_device_interface/gui/device_template_widgets/otb/otb_quattrocento_light_widget.py +174 -174
- biosignal_device_interface/gui/device_template_widgets/otb/otb_quattrocento_widget.py +260 -260
- biosignal_device_interface/gui/device_template_widgets/otb/otb_syncstation_widget.py +262 -262
- biosignal_device_interface/gui/plot_widgets/biosignal_plot_widget.py +500 -501
- biosignal_device_interface/gui/ui/devices_template_widget.ui +38 -38
- biosignal_device_interface/gui/ui/otb_muovi_plus_template_widget.ui +171 -171
- biosignal_device_interface/gui/ui/otb_muovi_template_widget.ui +171 -171
- biosignal_device_interface/gui/ui/otb_quattrocento_light_template_widget.ui +266 -266
- biosignal_device_interface/gui/ui/otb_quattrocento_template_widget.ui +415 -415
- biosignal_device_interface/gui/ui/otb_syncstation_template_widget.ui +732 -732
- biosignal_device_interface/gui/ui_compiled/devices_template_widget.py +56 -56
- biosignal_device_interface/gui/ui_compiled/otb_muovi_plus_template_widget.py +153 -153
- biosignal_device_interface/gui/ui_compiled/otb_muovi_template_widget.py +153 -153
- biosignal_device_interface/gui/ui_compiled/otb_quattrocento_light_template_widget.py +217 -217
- biosignal_device_interface/gui/ui_compiled/otb_quattrocento_template_widget.py +318 -318
- biosignal_device_interface/gui/ui_compiled/otb_syncstation_template_widget.py +495 -495
- {biosignal_device_interface-0.1.32a1.dist-info → biosignal_device_interface-0.2.1.dist-info}/LICENSE +675 -675
- {biosignal_device_interface-0.1.32a1.dist-info → biosignal_device_interface-0.2.1.dist-info}/METADATA +2 -2
- biosignal_device_interface-0.2.1.dist-info/RECORD +46 -0
- {biosignal_device_interface-0.1.32a1.dist-info → biosignal_device_interface-0.2.1.dist-info}/WHEEL +1 -1
- biosignal_device_interface-0.1.32a1.dist-info/RECORD +0 -46
|
@@ -1,260 +1,260 @@
|
|
|
1
|
-
"""
|
|
2
|
-
Quattrocento Widget class for GUI configuration
|
|
3
|
-
of the Quattrocento from OT Bioelettronica.
|
|
4
|
-
|
|
5
|
-
Developer: Dominik I. Braun
|
|
6
|
-
Contact: dome.braun@fau.de
|
|
7
|
-
Last Update: 2025-01-15
|
|
8
|
-
"""
|
|
9
|
-
|
|
10
|
-
from __future__ import annotations
|
|
11
|
-
from functools import partial
|
|
12
|
-
from typing import TYPE_CHECKING
|
|
13
|
-
|
|
14
|
-
from biosignal_device_interface.gui.device_template_widgets.core.base_device_widget import (
|
|
15
|
-
BaseDeviceWidget,
|
|
16
|
-
)
|
|
17
|
-
from biosignal_device_interface.gui.ui_compiled.otb_quattrocento_template_widget import (
|
|
18
|
-
Ui_QuattrocentoForm,
|
|
19
|
-
)
|
|
20
|
-
from biosignal_device_interface.devices.otb.otb_quattrocento import (
|
|
21
|
-
OTBQuattrocento,
|
|
22
|
-
)
|
|
23
|
-
|
|
24
|
-
# Constants
|
|
25
|
-
from biosignal_device_interface.constants.devices.otb.otb_quattrocento_constants import (
|
|
26
|
-
QuattrocentoAcqSettByte,
|
|
27
|
-
QuattrocentoAcquisitionMode,
|
|
28
|
-
QuattrocentoDecimMode,
|
|
29
|
-
QuattrocentoINXConf2Byte,
|
|
30
|
-
QuattrocentoRecordingMode,
|
|
31
|
-
QuattrocentoSamplingFrequencyMode,
|
|
32
|
-
QuattrocentoNumberOfChannelsMode,
|
|
33
|
-
QuattrocentoLowPassFilterMode,
|
|
34
|
-
QuattrocentoHighPassFilterMode,
|
|
35
|
-
QuattrocentoDetectionMode,
|
|
36
|
-
)
|
|
37
|
-
|
|
38
|
-
if TYPE_CHECKING:
|
|
39
|
-
from PySide6.QtWidgets import (
|
|
40
|
-
QMainWindow,
|
|
41
|
-
QWidget,
|
|
42
|
-
QGroupBox,
|
|
43
|
-
QPushButton,
|
|
44
|
-
QCheckBox,
|
|
45
|
-
QComboBox,
|
|
46
|
-
QLabel,
|
|
47
|
-
QLineEdit,
|
|
48
|
-
)
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
class OTBQuattrocentoWidget(BaseDeviceWidget):
|
|
52
|
-
def __init__(self, parent: QWidget | QMainWindow | None = None):
|
|
53
|
-
super().__init__(parent)
|
|
54
|
-
self._set_device(OTBQuattrocento(self))
|
|
55
|
-
|
|
56
|
-
def _toggle_connection(self):
|
|
57
|
-
if not self._device.is_connected:
|
|
58
|
-
self._connect_push_button.setEnabled(False)
|
|
59
|
-
|
|
60
|
-
self._device.toggle_connection(
|
|
61
|
-
(
|
|
62
|
-
self._connection_ip_line_edit.text(),
|
|
63
|
-
int(self._connection_port_line_edit.text()),
|
|
64
|
-
),
|
|
65
|
-
)
|
|
66
|
-
|
|
67
|
-
def _connection_toggled(self, is_connected: bool) -> None:
|
|
68
|
-
self._connect_push_button.setEnabled(True)
|
|
69
|
-
if is_connected:
|
|
70
|
-
self._connect_push_button.setText("Disconnect")
|
|
71
|
-
self._connect_push_button.setChecked(True)
|
|
72
|
-
self._configure_push_button.setEnabled(True)
|
|
73
|
-
self._connection_group_box.setEnabled(False)
|
|
74
|
-
else:
|
|
75
|
-
self._connect_push_button.setText("Connect")
|
|
76
|
-
self._connect_push_button.setChecked(False)
|
|
77
|
-
self._configure_push_button.setEnabled(False)
|
|
78
|
-
self._stream_push_button.setEnabled(False)
|
|
79
|
-
self._connection_group_box.setEnabled(True)
|
|
80
|
-
|
|
81
|
-
self.connect_toggled.emit(is_connected)
|
|
82
|
-
|
|
83
|
-
def _toggle_configuration(self):
|
|
84
|
-
self._device_params["grids"] = [
|
|
85
|
-
i
|
|
86
|
-
for i, check_box in enumerate(self._grid_selection_check_box_list)
|
|
87
|
-
if check_box.isChecked()
|
|
88
|
-
]
|
|
89
|
-
|
|
90
|
-
# Acquisition settings
|
|
91
|
-
acq_sett_configuration = QuattrocentoAcqSettByte()
|
|
92
|
-
acq_sett_configuration.update(
|
|
93
|
-
decimation_mode=QuattrocentoDecimMode(
|
|
94
|
-
int(self._acquisition_decimator_check_box.isChecked()) + 1
|
|
95
|
-
),
|
|
96
|
-
recording_mode=QuattrocentoRecordingMode(
|
|
97
|
-
int(self._acquisition_recording_check_box.isChecked()) + 1
|
|
98
|
-
),
|
|
99
|
-
sampling_frequency_mode=QuattrocentoSamplingFrequencyMode(
|
|
100
|
-
self._acquisition_sampling_frequency_combo_box.currentIndex() + 1
|
|
101
|
-
),
|
|
102
|
-
number_of_channels_mode=QuattrocentoNumberOfChannelsMode(
|
|
103
|
-
self._acquisition_number_of_channels_combo_box.currentIndex() + 1
|
|
104
|
-
),
|
|
105
|
-
)
|
|
106
|
-
self._device_params["acq_sett_configuration"] = acq_sett_configuration
|
|
107
|
-
|
|
108
|
-
# Input settings
|
|
109
|
-
inx_configuration = QuattrocentoINXConf2Byte()
|
|
110
|
-
inx_configuration.update(
|
|
111
|
-
high_pass_filter=QuattrocentoHighPassFilterMode(
|
|
112
|
-
self._input_high_pass_filter_combo_box.currentIndex() + 1
|
|
113
|
-
),
|
|
114
|
-
low_pass_filter=QuattrocentoLowPassFilterMode(
|
|
115
|
-
self._input_low_pass_filter_combo_box.currentIndex() + 1
|
|
116
|
-
),
|
|
117
|
-
detection_mode=QuattrocentoDetectionMode(
|
|
118
|
-
self._input_detection_mode_combo_box.currentIndex() + 1
|
|
119
|
-
),
|
|
120
|
-
)
|
|
121
|
-
|
|
122
|
-
self._device_params["input_top_left_configuration"] = inx_configuration
|
|
123
|
-
self._device_params["input_top_right_configuration"] = inx_configuration
|
|
124
|
-
self._device_params["multiple_input_one_configuration"] = inx_configuration
|
|
125
|
-
self._device_params["multiple_input_two_configuration"] = inx_configuration
|
|
126
|
-
self._device_params["multiple_input_three_configuration"] = inx_configuration
|
|
127
|
-
self._device_params["multiple_input_four_configuration"] = inx_configuration
|
|
128
|
-
|
|
129
|
-
self._device.configure_device(self._device_params)
|
|
130
|
-
|
|
131
|
-
def _configuration_toggled(self, is_configured: bool) -> None:
|
|
132
|
-
if is_configured:
|
|
133
|
-
self._stream_push_button.setEnabled(True)
|
|
134
|
-
|
|
135
|
-
self.configure_toggled.emit(is_configured)
|
|
136
|
-
|
|
137
|
-
def _toggle_stream(self) -> None:
|
|
138
|
-
self._stream_push_button.setEnabled(False)
|
|
139
|
-
self._device.toggle_streaming()
|
|
140
|
-
|
|
141
|
-
def _toggle_configuration_group_boxes(self, state: bool) -> None:
|
|
142
|
-
for group_box in self._configuration_group_boxes:
|
|
143
|
-
group_box.setEnabled(state)
|
|
144
|
-
|
|
145
|
-
def _stream_toggled(self, is_streaming):
|
|
146
|
-
self._stream_push_button.setEnabled(True)
|
|
147
|
-
if is_streaming:
|
|
148
|
-
self._stream_push_button.setText("Stop Streaming")
|
|
149
|
-
self._stream_push_button.setChecked(True)
|
|
150
|
-
self._configure_push_button.setEnabled(False)
|
|
151
|
-
self._toggle_configuration_group_boxes(False)
|
|
152
|
-
else:
|
|
153
|
-
self._stream_push_button.setText("Start Streaming")
|
|
154
|
-
self._stream_push_button.setChecked(False)
|
|
155
|
-
self._configure_push_button.setEnabled(True)
|
|
156
|
-
self._toggle_configuration_group_boxes(True)
|
|
157
|
-
|
|
158
|
-
def _initialize_device_params(self):
|
|
159
|
-
self._device_params: dict = {
|
|
160
|
-
"grids": [],
|
|
161
|
-
"acq_sett_configuration": QuattrocentoAcqSettByte(),
|
|
162
|
-
"input_top_left_configuration": QuattrocentoINXConf2Byte(),
|
|
163
|
-
"input_top_right_configuration": QuattrocentoINXConf2Byte(),
|
|
164
|
-
"multiple_input_one_configuration": QuattrocentoINXConf2Byte(),
|
|
165
|
-
"multiple_input_two_configuration": QuattrocentoINXConf2Byte(),
|
|
166
|
-
"multiple_input_three_configuration": QuattrocentoINXConf2Byte(),
|
|
167
|
-
"multiple_input_four_configuration": QuattrocentoINXConf2Byte(),
|
|
168
|
-
}
|
|
169
|
-
|
|
170
|
-
def _initialize_ui(self):
|
|
171
|
-
self.ui = Ui_QuattrocentoForm()
|
|
172
|
-
self.ui.setupUi(self)
|
|
173
|
-
|
|
174
|
-
# Command Push Buttons
|
|
175
|
-
self._connect_push_button: QPushButton = self.ui.commandConnectionPushButton
|
|
176
|
-
self._connect_push_button.clicked.connect(self._toggle_connection)
|
|
177
|
-
self._device.connect_toggled.connect(self._connection_toggled)
|
|
178
|
-
|
|
179
|
-
self._configure_push_button: QPushButton = (
|
|
180
|
-
self.ui.commandConfigurationPushButton
|
|
181
|
-
)
|
|
182
|
-
self._configure_push_button.clicked.connect(self._toggle_configuration)
|
|
183
|
-
self._configure_push_button.setEnabled(False)
|
|
184
|
-
self._device.configure_toggled.connect(self._configuration_toggled)
|
|
185
|
-
|
|
186
|
-
self._stream_push_button: QPushButton = self.ui.commandStreamPushButton
|
|
187
|
-
self._stream_push_button.clicked.connect(self._toggle_stream)
|
|
188
|
-
self._stream_push_button.setEnabled(False)
|
|
189
|
-
self._device.stream_toggled.connect(self._stream_toggled)
|
|
190
|
-
|
|
191
|
-
# Connection parameters
|
|
192
|
-
self._connection_group_box: QGroupBox = self.ui.connectionGroupBox
|
|
193
|
-
self._connection_ip_line_edit: QLineEdit = self.ui.connectionIPLineEdit
|
|
194
|
-
self._default_connection_ip: str = self._connection_ip_line_edit.text()
|
|
195
|
-
self._connection_ip_line_edit.editingFinished.connect(
|
|
196
|
-
partial(
|
|
197
|
-
self._check_ip_input,
|
|
198
|
-
self._connection_ip_line_edit,
|
|
199
|
-
self._default_connection_ip,
|
|
200
|
-
)
|
|
201
|
-
)
|
|
202
|
-
self._connection_port_line_edit: QLineEdit = self.ui.connectionPortLineEdit
|
|
203
|
-
self._default_connection_port: str = self._connection_port_line_edit.text()
|
|
204
|
-
self._connection_port_line_edit.editingFinished.connect(
|
|
205
|
-
partial(
|
|
206
|
-
self._check_port_input,
|
|
207
|
-
self._connection_port_line_edit,
|
|
208
|
-
self._default_connection_port,
|
|
209
|
-
)
|
|
210
|
-
)
|
|
211
|
-
|
|
212
|
-
# Acquisition parameters
|
|
213
|
-
self._acquisition_group_box: QGroupBox = self.ui.acquisitionGroupBox
|
|
214
|
-
self._acquisition_sampling_frequency_combo_box: QComboBox = (
|
|
215
|
-
self.ui.acquisitionSamplingFrequencyComboBox
|
|
216
|
-
)
|
|
217
|
-
self._acquisition_number_of_channels_combo_box: QComboBox = (
|
|
218
|
-
self.ui.acquisitionNumberOfChannelsComboBox
|
|
219
|
-
)
|
|
220
|
-
self._acquisition_decimator_check_box: QCheckBox = (
|
|
221
|
-
self.ui.acquisitionDecimatorCheckBox
|
|
222
|
-
)
|
|
223
|
-
self._acquisition_recording_check_box: QCheckBox = (
|
|
224
|
-
self.ui.acquisitionRecordingCheckBox
|
|
225
|
-
)
|
|
226
|
-
|
|
227
|
-
# Grid selection
|
|
228
|
-
self._grid_selection_group_box: QGroupBox = self.ui.gridSelectionGroupBox
|
|
229
|
-
self._grid_selection_check_box_list: list[QCheckBox] = [
|
|
230
|
-
self.ui.gridOneCheckBox,
|
|
231
|
-
self.ui.gridTwoCheckBox,
|
|
232
|
-
self.ui.gridThreeCheckBox,
|
|
233
|
-
self.ui.gridFourCheckBox,
|
|
234
|
-
self.ui.gridFiveCheckBox,
|
|
235
|
-
self.ui.gridSixCheckBox,
|
|
236
|
-
]
|
|
237
|
-
|
|
238
|
-
[
|
|
239
|
-
check_box.setChecked(False)
|
|
240
|
-
for check_box in self._grid_selection_check_box_list
|
|
241
|
-
]
|
|
242
|
-
|
|
243
|
-
# Input parameters
|
|
244
|
-
self._input_group_box: QGroupBox = self.ui.inputGroupBox
|
|
245
|
-
self._input_channel_combo_box: QComboBox = self.ui.inputChannelComboBox
|
|
246
|
-
self._input_low_pass_filter_combo_box: QComboBox = self.ui.inputLowPassComboBox
|
|
247
|
-
self._input_low_pass_default = self.ui.inputLowPassComboBox.currentIndex()
|
|
248
|
-
self._input_high_pass_filter_combo_box: QComboBox = (
|
|
249
|
-
self.ui.inputHighPassComboBox
|
|
250
|
-
)
|
|
251
|
-
self._input_high_pass_default = self.ui.inputHighPassComboBox.currentIndex()
|
|
252
|
-
self._input_detection_mode_combo_box: QComboBox = (
|
|
253
|
-
self.ui.inputDetectionModeComboBox
|
|
254
|
-
)
|
|
255
|
-
|
|
256
|
-
self._configuration_group_boxes: list[QGroupBox] = [
|
|
257
|
-
self._acquisition_group_box,
|
|
258
|
-
self._grid_selection_group_box,
|
|
259
|
-
self._input_group_box,
|
|
260
|
-
]
|
|
1
|
+
"""
|
|
2
|
+
Quattrocento Widget class for GUI configuration
|
|
3
|
+
of the Quattrocento from OT Bioelettronica.
|
|
4
|
+
|
|
5
|
+
Developer: Dominik I. Braun
|
|
6
|
+
Contact: dome.braun@fau.de
|
|
7
|
+
Last Update: 2025-01-15
|
|
8
|
+
"""
|
|
9
|
+
|
|
10
|
+
from __future__ import annotations
|
|
11
|
+
from functools import partial
|
|
12
|
+
from typing import TYPE_CHECKING
|
|
13
|
+
|
|
14
|
+
from biosignal_device_interface.gui.device_template_widgets.core.base_device_widget import (
|
|
15
|
+
BaseDeviceWidget,
|
|
16
|
+
)
|
|
17
|
+
from biosignal_device_interface.gui.ui_compiled.otb_quattrocento_template_widget import (
|
|
18
|
+
Ui_QuattrocentoForm,
|
|
19
|
+
)
|
|
20
|
+
from biosignal_device_interface.devices.otb.otb_quattrocento import (
|
|
21
|
+
OTBQuattrocento,
|
|
22
|
+
)
|
|
23
|
+
|
|
24
|
+
# Constants
|
|
25
|
+
from biosignal_device_interface.constants.devices.otb.otb_quattrocento_constants import (
|
|
26
|
+
QuattrocentoAcqSettByte,
|
|
27
|
+
QuattrocentoAcquisitionMode,
|
|
28
|
+
QuattrocentoDecimMode,
|
|
29
|
+
QuattrocentoINXConf2Byte,
|
|
30
|
+
QuattrocentoRecordingMode,
|
|
31
|
+
QuattrocentoSamplingFrequencyMode,
|
|
32
|
+
QuattrocentoNumberOfChannelsMode,
|
|
33
|
+
QuattrocentoLowPassFilterMode,
|
|
34
|
+
QuattrocentoHighPassFilterMode,
|
|
35
|
+
QuattrocentoDetectionMode,
|
|
36
|
+
)
|
|
37
|
+
|
|
38
|
+
if TYPE_CHECKING:
|
|
39
|
+
from PySide6.QtWidgets import (
|
|
40
|
+
QMainWindow,
|
|
41
|
+
QWidget,
|
|
42
|
+
QGroupBox,
|
|
43
|
+
QPushButton,
|
|
44
|
+
QCheckBox,
|
|
45
|
+
QComboBox,
|
|
46
|
+
QLabel,
|
|
47
|
+
QLineEdit,
|
|
48
|
+
)
|
|
49
|
+
|
|
50
|
+
|
|
51
|
+
class OTBQuattrocentoWidget(BaseDeviceWidget):
|
|
52
|
+
def __init__(self, parent: QWidget | QMainWindow | None = None):
|
|
53
|
+
super().__init__(parent)
|
|
54
|
+
self._set_device(OTBQuattrocento(self))
|
|
55
|
+
|
|
56
|
+
def _toggle_connection(self):
|
|
57
|
+
if not self._device.is_connected:
|
|
58
|
+
self._connect_push_button.setEnabled(False)
|
|
59
|
+
|
|
60
|
+
self._device.toggle_connection(
|
|
61
|
+
(
|
|
62
|
+
self._connection_ip_line_edit.text(),
|
|
63
|
+
int(self._connection_port_line_edit.text()),
|
|
64
|
+
),
|
|
65
|
+
)
|
|
66
|
+
|
|
67
|
+
def _connection_toggled(self, is_connected: bool) -> None:
|
|
68
|
+
self._connect_push_button.setEnabled(True)
|
|
69
|
+
if is_connected:
|
|
70
|
+
self._connect_push_button.setText("Disconnect")
|
|
71
|
+
self._connect_push_button.setChecked(True)
|
|
72
|
+
self._configure_push_button.setEnabled(True)
|
|
73
|
+
self._connection_group_box.setEnabled(False)
|
|
74
|
+
else:
|
|
75
|
+
self._connect_push_button.setText("Connect")
|
|
76
|
+
self._connect_push_button.setChecked(False)
|
|
77
|
+
self._configure_push_button.setEnabled(False)
|
|
78
|
+
self._stream_push_button.setEnabled(False)
|
|
79
|
+
self._connection_group_box.setEnabled(True)
|
|
80
|
+
|
|
81
|
+
self.connect_toggled.emit(is_connected)
|
|
82
|
+
|
|
83
|
+
def _toggle_configuration(self):
|
|
84
|
+
self._device_params["grids"] = [
|
|
85
|
+
i
|
|
86
|
+
for i, check_box in enumerate(self._grid_selection_check_box_list)
|
|
87
|
+
if check_box.isChecked()
|
|
88
|
+
]
|
|
89
|
+
|
|
90
|
+
# Acquisition settings
|
|
91
|
+
acq_sett_configuration = QuattrocentoAcqSettByte()
|
|
92
|
+
acq_sett_configuration.update(
|
|
93
|
+
decimation_mode=QuattrocentoDecimMode(
|
|
94
|
+
int(self._acquisition_decimator_check_box.isChecked()) + 1
|
|
95
|
+
),
|
|
96
|
+
recording_mode=QuattrocentoRecordingMode(
|
|
97
|
+
int(self._acquisition_recording_check_box.isChecked()) + 1
|
|
98
|
+
),
|
|
99
|
+
sampling_frequency_mode=QuattrocentoSamplingFrequencyMode(
|
|
100
|
+
self._acquisition_sampling_frequency_combo_box.currentIndex() + 1
|
|
101
|
+
),
|
|
102
|
+
number_of_channels_mode=QuattrocentoNumberOfChannelsMode(
|
|
103
|
+
self._acquisition_number_of_channels_combo_box.currentIndex() + 1
|
|
104
|
+
),
|
|
105
|
+
)
|
|
106
|
+
self._device_params["acq_sett_configuration"] = acq_sett_configuration
|
|
107
|
+
|
|
108
|
+
# Input settings
|
|
109
|
+
inx_configuration = QuattrocentoINXConf2Byte()
|
|
110
|
+
inx_configuration.update(
|
|
111
|
+
high_pass_filter=QuattrocentoHighPassFilterMode(
|
|
112
|
+
self._input_high_pass_filter_combo_box.currentIndex() + 1
|
|
113
|
+
),
|
|
114
|
+
low_pass_filter=QuattrocentoLowPassFilterMode(
|
|
115
|
+
self._input_low_pass_filter_combo_box.currentIndex() + 1
|
|
116
|
+
),
|
|
117
|
+
detection_mode=QuattrocentoDetectionMode(
|
|
118
|
+
self._input_detection_mode_combo_box.currentIndex() + 1
|
|
119
|
+
),
|
|
120
|
+
)
|
|
121
|
+
|
|
122
|
+
self._device_params["input_top_left_configuration"] = inx_configuration
|
|
123
|
+
self._device_params["input_top_right_configuration"] = inx_configuration
|
|
124
|
+
self._device_params["multiple_input_one_configuration"] = inx_configuration
|
|
125
|
+
self._device_params["multiple_input_two_configuration"] = inx_configuration
|
|
126
|
+
self._device_params["multiple_input_three_configuration"] = inx_configuration
|
|
127
|
+
self._device_params["multiple_input_four_configuration"] = inx_configuration
|
|
128
|
+
|
|
129
|
+
self._device.configure_device(self._device_params)
|
|
130
|
+
|
|
131
|
+
def _configuration_toggled(self, is_configured: bool) -> None:
|
|
132
|
+
if is_configured:
|
|
133
|
+
self._stream_push_button.setEnabled(True)
|
|
134
|
+
|
|
135
|
+
self.configure_toggled.emit(is_configured)
|
|
136
|
+
|
|
137
|
+
def _toggle_stream(self) -> None:
|
|
138
|
+
self._stream_push_button.setEnabled(False)
|
|
139
|
+
self._device.toggle_streaming()
|
|
140
|
+
|
|
141
|
+
def _toggle_configuration_group_boxes(self, state: bool) -> None:
|
|
142
|
+
for group_box in self._configuration_group_boxes:
|
|
143
|
+
group_box.setEnabled(state)
|
|
144
|
+
|
|
145
|
+
def _stream_toggled(self, is_streaming):
|
|
146
|
+
self._stream_push_button.setEnabled(True)
|
|
147
|
+
if is_streaming:
|
|
148
|
+
self._stream_push_button.setText("Stop Streaming")
|
|
149
|
+
self._stream_push_button.setChecked(True)
|
|
150
|
+
self._configure_push_button.setEnabled(False)
|
|
151
|
+
self._toggle_configuration_group_boxes(False)
|
|
152
|
+
else:
|
|
153
|
+
self._stream_push_button.setText("Start Streaming")
|
|
154
|
+
self._stream_push_button.setChecked(False)
|
|
155
|
+
self._configure_push_button.setEnabled(True)
|
|
156
|
+
self._toggle_configuration_group_boxes(True)
|
|
157
|
+
|
|
158
|
+
def _initialize_device_params(self):
|
|
159
|
+
self._device_params: dict = {
|
|
160
|
+
"grids": [],
|
|
161
|
+
"acq_sett_configuration": QuattrocentoAcqSettByte(),
|
|
162
|
+
"input_top_left_configuration": QuattrocentoINXConf2Byte(),
|
|
163
|
+
"input_top_right_configuration": QuattrocentoINXConf2Byte(),
|
|
164
|
+
"multiple_input_one_configuration": QuattrocentoINXConf2Byte(),
|
|
165
|
+
"multiple_input_two_configuration": QuattrocentoINXConf2Byte(),
|
|
166
|
+
"multiple_input_three_configuration": QuattrocentoINXConf2Byte(),
|
|
167
|
+
"multiple_input_four_configuration": QuattrocentoINXConf2Byte(),
|
|
168
|
+
}
|
|
169
|
+
|
|
170
|
+
def _initialize_ui(self):
|
|
171
|
+
self.ui = Ui_QuattrocentoForm()
|
|
172
|
+
self.ui.setupUi(self)
|
|
173
|
+
|
|
174
|
+
# Command Push Buttons
|
|
175
|
+
self._connect_push_button: QPushButton = self.ui.commandConnectionPushButton
|
|
176
|
+
self._connect_push_button.clicked.connect(self._toggle_connection)
|
|
177
|
+
self._device.connect_toggled.connect(self._connection_toggled)
|
|
178
|
+
|
|
179
|
+
self._configure_push_button: QPushButton = (
|
|
180
|
+
self.ui.commandConfigurationPushButton
|
|
181
|
+
)
|
|
182
|
+
self._configure_push_button.clicked.connect(self._toggle_configuration)
|
|
183
|
+
self._configure_push_button.setEnabled(False)
|
|
184
|
+
self._device.configure_toggled.connect(self._configuration_toggled)
|
|
185
|
+
|
|
186
|
+
self._stream_push_button: QPushButton = self.ui.commandStreamPushButton
|
|
187
|
+
self._stream_push_button.clicked.connect(self._toggle_stream)
|
|
188
|
+
self._stream_push_button.setEnabled(False)
|
|
189
|
+
self._device.stream_toggled.connect(self._stream_toggled)
|
|
190
|
+
|
|
191
|
+
# Connection parameters
|
|
192
|
+
self._connection_group_box: QGroupBox = self.ui.connectionGroupBox
|
|
193
|
+
self._connection_ip_line_edit: QLineEdit = self.ui.connectionIPLineEdit
|
|
194
|
+
self._default_connection_ip: str = self._connection_ip_line_edit.text()
|
|
195
|
+
self._connection_ip_line_edit.editingFinished.connect(
|
|
196
|
+
partial(
|
|
197
|
+
self._check_ip_input,
|
|
198
|
+
self._connection_ip_line_edit,
|
|
199
|
+
self._default_connection_ip,
|
|
200
|
+
)
|
|
201
|
+
)
|
|
202
|
+
self._connection_port_line_edit: QLineEdit = self.ui.connectionPortLineEdit
|
|
203
|
+
self._default_connection_port: str = self._connection_port_line_edit.text()
|
|
204
|
+
self._connection_port_line_edit.editingFinished.connect(
|
|
205
|
+
partial(
|
|
206
|
+
self._check_port_input,
|
|
207
|
+
self._connection_port_line_edit,
|
|
208
|
+
self._default_connection_port,
|
|
209
|
+
)
|
|
210
|
+
)
|
|
211
|
+
|
|
212
|
+
# Acquisition parameters
|
|
213
|
+
self._acquisition_group_box: QGroupBox = self.ui.acquisitionGroupBox
|
|
214
|
+
self._acquisition_sampling_frequency_combo_box: QComboBox = (
|
|
215
|
+
self.ui.acquisitionSamplingFrequencyComboBox
|
|
216
|
+
)
|
|
217
|
+
self._acquisition_number_of_channels_combo_box: QComboBox = (
|
|
218
|
+
self.ui.acquisitionNumberOfChannelsComboBox
|
|
219
|
+
)
|
|
220
|
+
self._acquisition_decimator_check_box: QCheckBox = (
|
|
221
|
+
self.ui.acquisitionDecimatorCheckBox
|
|
222
|
+
)
|
|
223
|
+
self._acquisition_recording_check_box: QCheckBox = (
|
|
224
|
+
self.ui.acquisitionRecordingCheckBox
|
|
225
|
+
)
|
|
226
|
+
|
|
227
|
+
# Grid selection
|
|
228
|
+
self._grid_selection_group_box: QGroupBox = self.ui.gridSelectionGroupBox
|
|
229
|
+
self._grid_selection_check_box_list: list[QCheckBox] = [
|
|
230
|
+
self.ui.gridOneCheckBox,
|
|
231
|
+
self.ui.gridTwoCheckBox,
|
|
232
|
+
self.ui.gridThreeCheckBox,
|
|
233
|
+
self.ui.gridFourCheckBox,
|
|
234
|
+
self.ui.gridFiveCheckBox,
|
|
235
|
+
self.ui.gridSixCheckBox,
|
|
236
|
+
]
|
|
237
|
+
|
|
238
|
+
[
|
|
239
|
+
check_box.setChecked(False)
|
|
240
|
+
for check_box in self._grid_selection_check_box_list
|
|
241
|
+
]
|
|
242
|
+
|
|
243
|
+
# Input parameters
|
|
244
|
+
self._input_group_box: QGroupBox = self.ui.inputGroupBox
|
|
245
|
+
self._input_channel_combo_box: QComboBox = self.ui.inputChannelComboBox
|
|
246
|
+
self._input_low_pass_filter_combo_box: QComboBox = self.ui.inputLowPassComboBox
|
|
247
|
+
self._input_low_pass_default = self.ui.inputLowPassComboBox.currentIndex()
|
|
248
|
+
self._input_high_pass_filter_combo_box: QComboBox = (
|
|
249
|
+
self.ui.inputHighPassComboBox
|
|
250
|
+
)
|
|
251
|
+
self._input_high_pass_default = self.ui.inputHighPassComboBox.currentIndex()
|
|
252
|
+
self._input_detection_mode_combo_box: QComboBox = (
|
|
253
|
+
self.ui.inputDetectionModeComboBox
|
|
254
|
+
)
|
|
255
|
+
|
|
256
|
+
self._configuration_group_boxes: list[QGroupBox] = [
|
|
257
|
+
self._acquisition_group_box,
|
|
258
|
+
self._grid_selection_group_box,
|
|
259
|
+
self._input_group_box,
|
|
260
|
+
]
|