biosignal-device-interface 0.2.1a1__py3-none-any.whl → 0.2.2__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.2.1a1.dist-info → biosignal_device_interface-0.2.2.dist-info}/METADATA +3 -2
- biosignal_device_interface-0.2.2.dist-info/RECORD +46 -0
- {biosignal_device_interface-0.2.1a1.dist-info → biosignal_device_interface-0.2.2.dist-info}/WHEEL +1 -1
- {biosignal_device_interface-0.2.1a1.dist-info → biosignal_device_interface-0.2.2.dist-info/licenses}/LICENSE +675 -675
- biosignal_device_interface-0.2.1a1.dist-info/RECORD +0 -46
|
@@ -1,174 +1,174 @@
|
|
|
1
|
-
from __future__ import annotations
|
|
2
|
-
from typing import TYPE_CHECKING
|
|
3
|
-
|
|
4
|
-
from biosignal_device_interface.gui.device_template_widgets.core.base_device_widget import (
|
|
5
|
-
BaseDeviceWidget,
|
|
6
|
-
)
|
|
7
|
-
from biosignal_device_interface.gui.ui_compiled.otb_quattrocento_light_template_widget import (
|
|
8
|
-
Ui_QuattrocentoLightForm,
|
|
9
|
-
)
|
|
10
|
-
from biosignal_device_interface.devices.otb.otb_quattrocento_light import (
|
|
11
|
-
OTBQuattrocentoLight,
|
|
12
|
-
)
|
|
13
|
-
|
|
14
|
-
# Constants
|
|
15
|
-
from biosignal_device_interface.constants.devices.otb.otb_quattrocento_light_constants import (
|
|
16
|
-
QuattrocentoLightSamplingFrequency,
|
|
17
|
-
QuattrocentoLightStreamingFrequency,
|
|
18
|
-
)
|
|
19
|
-
|
|
20
|
-
if TYPE_CHECKING:
|
|
21
|
-
from PySide6.QtWidgets import (
|
|
22
|
-
QMainWindow,
|
|
23
|
-
QWidget,
|
|
24
|
-
QGroupBox,
|
|
25
|
-
QPushButton,
|
|
26
|
-
QCheckBox,
|
|
27
|
-
QComboBox,
|
|
28
|
-
QLabel,
|
|
29
|
-
)
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
class OTBQuattrocentoLightWidget(BaseDeviceWidget):
|
|
33
|
-
def __init__(self, parent: QWidget | QMainWindow | None = None):
|
|
34
|
-
super().__init__(parent)
|
|
35
|
-
self._set_device(OTBQuattrocentoLight(self))
|
|
36
|
-
|
|
37
|
-
def _toggle_connection(self) -> None:
|
|
38
|
-
if not self._device.is_connected:
|
|
39
|
-
self._connect_push_button.setEnabled(False)
|
|
40
|
-
|
|
41
|
-
self._device.toggle_connection(
|
|
42
|
-
(self._connection_ip_label.text(), int(self._connection_port_label.text())),
|
|
43
|
-
)
|
|
44
|
-
|
|
45
|
-
def _connection_toggled(self, is_connected: bool) -> None:
|
|
46
|
-
self._connect_push_button.setEnabled(True)
|
|
47
|
-
if is_connected:
|
|
48
|
-
self._connect_push_button.setText("Disconnect")
|
|
49
|
-
self._connect_push_button.setChecked(True)
|
|
50
|
-
self._configure_push_button.setEnabled(True)
|
|
51
|
-
self._connection_group_box.setEnabled(False)
|
|
52
|
-
else:
|
|
53
|
-
self._connect_push_button.setText("Connect")
|
|
54
|
-
self._connect_push_button.setChecked(False)
|
|
55
|
-
self._configure_push_button.setEnabled(False)
|
|
56
|
-
self._stream_push_button.setEnabled(False)
|
|
57
|
-
self._connection_group_box.setEnabled(True)
|
|
58
|
-
|
|
59
|
-
self.connect_toggled.emit(is_connected)
|
|
60
|
-
|
|
61
|
-
def _toggle_configuration(self) -> None:
|
|
62
|
-
self._device_params["grids"] = [
|
|
63
|
-
i
|
|
64
|
-
for i, check_box in enumerate(self._grid_selection_check_box_list)
|
|
65
|
-
if check_box.isChecked()
|
|
66
|
-
]
|
|
67
|
-
|
|
68
|
-
self._device_params["streaming_frequency_mode"] = (
|
|
69
|
-
QuattrocentoLightStreamingFrequency(
|
|
70
|
-
self._acquisition_streaming_frequency_combo_box.currentIndex() + 1
|
|
71
|
-
)
|
|
72
|
-
)
|
|
73
|
-
self._device_params["sampling_frequency_mode"] = (
|
|
74
|
-
QuattrocentoLightSamplingFrequency(
|
|
75
|
-
self._acquisition_sampling_frequency_combo_box.currentIndex() + 1
|
|
76
|
-
)
|
|
77
|
-
)
|
|
78
|
-
|
|
79
|
-
self._device.configure_device(self._device_params)
|
|
80
|
-
|
|
81
|
-
def _configuration_toggled(self, is_configured: bool) -> None:
|
|
82
|
-
if is_configured:
|
|
83
|
-
self._stream_push_button.setEnabled(True)
|
|
84
|
-
|
|
85
|
-
self.configure_toggled.emit(is_configured)
|
|
86
|
-
|
|
87
|
-
def _toggle_configuration_group_boxes(self) -> None:
|
|
88
|
-
for group_box in self._configuration_group_boxes:
|
|
89
|
-
group_box.setEnabled(not group_box.isEnabled())
|
|
90
|
-
|
|
91
|
-
def _toggle_stream(self) -> None:
|
|
92
|
-
self._stream_push_button.setEnabled(False)
|
|
93
|
-
self._device.toggle_streaming()
|
|
94
|
-
|
|
95
|
-
def _stream_toggled(self, is_streaming: bool) -> None:
|
|
96
|
-
self._stream_push_button.setEnabled(True)
|
|
97
|
-
if is_streaming:
|
|
98
|
-
self._stream_push_button.setText("Stop Streaming")
|
|
99
|
-
self._stream_push_button.setChecked(True)
|
|
100
|
-
self._configure_push_button.setEnabled(False)
|
|
101
|
-
self._toggle_configuration_group_boxes()
|
|
102
|
-
else:
|
|
103
|
-
self._stream_push_button.setText("Stream")
|
|
104
|
-
self._stream_push_button.setChecked(False)
|
|
105
|
-
self._configure_push_button.setEnabled(True)
|
|
106
|
-
self._toggle_configuration_group_boxes()
|
|
107
|
-
|
|
108
|
-
self.stream_toggled.emit(is_streaming)
|
|
109
|
-
|
|
110
|
-
def _initialize_device_params(self) -> None:
|
|
111
|
-
self._device_params = {
|
|
112
|
-
"grids": [2, 3],
|
|
113
|
-
"streaming_frequency_mode": QuattrocentoLightStreamingFrequency.THIRTYTWO,
|
|
114
|
-
"sampling_frequency_mode": QuattrocentoLightSamplingFrequency.MEDIUM,
|
|
115
|
-
}
|
|
116
|
-
|
|
117
|
-
def _initialize_ui(self) -> None:
|
|
118
|
-
self.ui = Ui_QuattrocentoLightForm()
|
|
119
|
-
self.ui.setupUi(self)
|
|
120
|
-
|
|
121
|
-
# Command Push Buttons
|
|
122
|
-
self._connect_push_button: QPushButton = self.ui.commandConnectionPushButton
|
|
123
|
-
self._connect_push_button.clicked.connect(self._toggle_connection)
|
|
124
|
-
self._device.connect_toggled.connect(self._connection_toggled)
|
|
125
|
-
|
|
126
|
-
self._configure_push_button: QPushButton = (
|
|
127
|
-
self.ui.commandConfigurationPushButton
|
|
128
|
-
)
|
|
129
|
-
self._configure_push_button.clicked.connect(self._toggle_configuration)
|
|
130
|
-
self._configure_push_button.setEnabled(False)
|
|
131
|
-
self._device.configure_toggled.connect(self._configuration_toggled)
|
|
132
|
-
|
|
133
|
-
self._stream_push_button: QPushButton = self.ui.commandStreamPushButton
|
|
134
|
-
self._stream_push_button.clicked.connect(self._toggle_stream)
|
|
135
|
-
self._stream_push_button.setEnabled(False)
|
|
136
|
-
self._device.stream_toggled.connect(self._stream_toggled)
|
|
137
|
-
|
|
138
|
-
# Connection parameters
|
|
139
|
-
self._connection_group_box: QGroupBox = self.ui.connectionGroupBox
|
|
140
|
-
self._connection_ip_label: QLabel = self.ui.connectionIPLabel
|
|
141
|
-
self._connection_port_label: QLabel = self.ui.connectionPortLabel
|
|
142
|
-
|
|
143
|
-
# Acquisition parameters
|
|
144
|
-
self._acquisition_group_box: QGroupBox = self.ui.acquisitionGroupBox
|
|
145
|
-
self._acquisition_sampling_frequency_combo_box: QComboBox = (
|
|
146
|
-
self.ui.acquisitionSamplingFrequencyComboBox
|
|
147
|
-
)
|
|
148
|
-
self._acquisition_streaming_frequency_combo_box: QComboBox = (
|
|
149
|
-
self.ui.acquisitionStreamingFrequencyComboBox
|
|
150
|
-
)
|
|
151
|
-
|
|
152
|
-
# Grid parameters
|
|
153
|
-
self._grid_selection_group_box: QGroupBox = self.ui.gridSelectionGroupBox
|
|
154
|
-
self._grid_selection_check_box_list: list[QCheckBox] = [
|
|
155
|
-
self.ui.gridOneCheckBox,
|
|
156
|
-
self.ui.gridTwoCheckBox,
|
|
157
|
-
self.ui.gridThreeCheckBox,
|
|
158
|
-
self.ui.gridFourCheckBox,
|
|
159
|
-
self.ui.gridFiveCheckBox,
|
|
160
|
-
self.ui.gridSixCheckBox,
|
|
161
|
-
]
|
|
162
|
-
|
|
163
|
-
[
|
|
164
|
-
check_box.setChecked(False)
|
|
165
|
-
for check_box in self._grid_selection_check_box_list
|
|
166
|
-
]
|
|
167
|
-
self._grid_selection_check_box_list[2].setChecked(True)
|
|
168
|
-
self._grid_selection_check_box_list[3].setChecked(True)
|
|
169
|
-
|
|
170
|
-
# Configuration parameters
|
|
171
|
-
self._configuration_group_boxes: list[QGroupBox] = [
|
|
172
|
-
self._acquisition_group_box,
|
|
173
|
-
self._grid_selection_group_box,
|
|
174
|
-
]
|
|
1
|
+
from __future__ import annotations
|
|
2
|
+
from typing import TYPE_CHECKING
|
|
3
|
+
|
|
4
|
+
from biosignal_device_interface.gui.device_template_widgets.core.base_device_widget import (
|
|
5
|
+
BaseDeviceWidget,
|
|
6
|
+
)
|
|
7
|
+
from biosignal_device_interface.gui.ui_compiled.otb_quattrocento_light_template_widget import (
|
|
8
|
+
Ui_QuattrocentoLightForm,
|
|
9
|
+
)
|
|
10
|
+
from biosignal_device_interface.devices.otb.otb_quattrocento_light import (
|
|
11
|
+
OTBQuattrocentoLight,
|
|
12
|
+
)
|
|
13
|
+
|
|
14
|
+
# Constants
|
|
15
|
+
from biosignal_device_interface.constants.devices.otb.otb_quattrocento_light_constants import (
|
|
16
|
+
QuattrocentoLightSamplingFrequency,
|
|
17
|
+
QuattrocentoLightStreamingFrequency,
|
|
18
|
+
)
|
|
19
|
+
|
|
20
|
+
if TYPE_CHECKING:
|
|
21
|
+
from PySide6.QtWidgets import (
|
|
22
|
+
QMainWindow,
|
|
23
|
+
QWidget,
|
|
24
|
+
QGroupBox,
|
|
25
|
+
QPushButton,
|
|
26
|
+
QCheckBox,
|
|
27
|
+
QComboBox,
|
|
28
|
+
QLabel,
|
|
29
|
+
)
|
|
30
|
+
|
|
31
|
+
|
|
32
|
+
class OTBQuattrocentoLightWidget(BaseDeviceWidget):
|
|
33
|
+
def __init__(self, parent: QWidget | QMainWindow | None = None):
|
|
34
|
+
super().__init__(parent)
|
|
35
|
+
self._set_device(OTBQuattrocentoLight(self))
|
|
36
|
+
|
|
37
|
+
def _toggle_connection(self) -> None:
|
|
38
|
+
if not self._device.is_connected:
|
|
39
|
+
self._connect_push_button.setEnabled(False)
|
|
40
|
+
|
|
41
|
+
self._device.toggle_connection(
|
|
42
|
+
(self._connection_ip_label.text(), int(self._connection_port_label.text())),
|
|
43
|
+
)
|
|
44
|
+
|
|
45
|
+
def _connection_toggled(self, is_connected: bool) -> None:
|
|
46
|
+
self._connect_push_button.setEnabled(True)
|
|
47
|
+
if is_connected:
|
|
48
|
+
self._connect_push_button.setText("Disconnect")
|
|
49
|
+
self._connect_push_button.setChecked(True)
|
|
50
|
+
self._configure_push_button.setEnabled(True)
|
|
51
|
+
self._connection_group_box.setEnabled(False)
|
|
52
|
+
else:
|
|
53
|
+
self._connect_push_button.setText("Connect")
|
|
54
|
+
self._connect_push_button.setChecked(False)
|
|
55
|
+
self._configure_push_button.setEnabled(False)
|
|
56
|
+
self._stream_push_button.setEnabled(False)
|
|
57
|
+
self._connection_group_box.setEnabled(True)
|
|
58
|
+
|
|
59
|
+
self.connect_toggled.emit(is_connected)
|
|
60
|
+
|
|
61
|
+
def _toggle_configuration(self) -> None:
|
|
62
|
+
self._device_params["grids"] = [
|
|
63
|
+
i
|
|
64
|
+
for i, check_box in enumerate(self._grid_selection_check_box_list)
|
|
65
|
+
if check_box.isChecked()
|
|
66
|
+
]
|
|
67
|
+
|
|
68
|
+
self._device_params["streaming_frequency_mode"] = (
|
|
69
|
+
QuattrocentoLightStreamingFrequency(
|
|
70
|
+
self._acquisition_streaming_frequency_combo_box.currentIndex() + 1
|
|
71
|
+
)
|
|
72
|
+
)
|
|
73
|
+
self._device_params["sampling_frequency_mode"] = (
|
|
74
|
+
QuattrocentoLightSamplingFrequency(
|
|
75
|
+
self._acquisition_sampling_frequency_combo_box.currentIndex() + 1
|
|
76
|
+
)
|
|
77
|
+
)
|
|
78
|
+
|
|
79
|
+
self._device.configure_device(self._device_params)
|
|
80
|
+
|
|
81
|
+
def _configuration_toggled(self, is_configured: bool) -> None:
|
|
82
|
+
if is_configured:
|
|
83
|
+
self._stream_push_button.setEnabled(True)
|
|
84
|
+
|
|
85
|
+
self.configure_toggled.emit(is_configured)
|
|
86
|
+
|
|
87
|
+
def _toggle_configuration_group_boxes(self) -> None:
|
|
88
|
+
for group_box in self._configuration_group_boxes:
|
|
89
|
+
group_box.setEnabled(not group_box.isEnabled())
|
|
90
|
+
|
|
91
|
+
def _toggle_stream(self) -> None:
|
|
92
|
+
self._stream_push_button.setEnabled(False)
|
|
93
|
+
self._device.toggle_streaming()
|
|
94
|
+
|
|
95
|
+
def _stream_toggled(self, is_streaming: bool) -> None:
|
|
96
|
+
self._stream_push_button.setEnabled(True)
|
|
97
|
+
if is_streaming:
|
|
98
|
+
self._stream_push_button.setText("Stop Streaming")
|
|
99
|
+
self._stream_push_button.setChecked(True)
|
|
100
|
+
self._configure_push_button.setEnabled(False)
|
|
101
|
+
self._toggle_configuration_group_boxes()
|
|
102
|
+
else:
|
|
103
|
+
self._stream_push_button.setText("Stream")
|
|
104
|
+
self._stream_push_button.setChecked(False)
|
|
105
|
+
self._configure_push_button.setEnabled(True)
|
|
106
|
+
self._toggle_configuration_group_boxes()
|
|
107
|
+
|
|
108
|
+
self.stream_toggled.emit(is_streaming)
|
|
109
|
+
|
|
110
|
+
def _initialize_device_params(self) -> None:
|
|
111
|
+
self._device_params = {
|
|
112
|
+
"grids": [2, 3],
|
|
113
|
+
"streaming_frequency_mode": QuattrocentoLightStreamingFrequency.THIRTYTWO,
|
|
114
|
+
"sampling_frequency_mode": QuattrocentoLightSamplingFrequency.MEDIUM,
|
|
115
|
+
}
|
|
116
|
+
|
|
117
|
+
def _initialize_ui(self) -> None:
|
|
118
|
+
self.ui = Ui_QuattrocentoLightForm()
|
|
119
|
+
self.ui.setupUi(self)
|
|
120
|
+
|
|
121
|
+
# Command Push Buttons
|
|
122
|
+
self._connect_push_button: QPushButton = self.ui.commandConnectionPushButton
|
|
123
|
+
self._connect_push_button.clicked.connect(self._toggle_connection)
|
|
124
|
+
self._device.connect_toggled.connect(self._connection_toggled)
|
|
125
|
+
|
|
126
|
+
self._configure_push_button: QPushButton = (
|
|
127
|
+
self.ui.commandConfigurationPushButton
|
|
128
|
+
)
|
|
129
|
+
self._configure_push_button.clicked.connect(self._toggle_configuration)
|
|
130
|
+
self._configure_push_button.setEnabled(False)
|
|
131
|
+
self._device.configure_toggled.connect(self._configuration_toggled)
|
|
132
|
+
|
|
133
|
+
self._stream_push_button: QPushButton = self.ui.commandStreamPushButton
|
|
134
|
+
self._stream_push_button.clicked.connect(self._toggle_stream)
|
|
135
|
+
self._stream_push_button.setEnabled(False)
|
|
136
|
+
self._device.stream_toggled.connect(self._stream_toggled)
|
|
137
|
+
|
|
138
|
+
# Connection parameters
|
|
139
|
+
self._connection_group_box: QGroupBox = self.ui.connectionGroupBox
|
|
140
|
+
self._connection_ip_label: QLabel = self.ui.connectionIPLabel
|
|
141
|
+
self._connection_port_label: QLabel = self.ui.connectionPortLabel
|
|
142
|
+
|
|
143
|
+
# Acquisition parameters
|
|
144
|
+
self._acquisition_group_box: QGroupBox = self.ui.acquisitionGroupBox
|
|
145
|
+
self._acquisition_sampling_frequency_combo_box: QComboBox = (
|
|
146
|
+
self.ui.acquisitionSamplingFrequencyComboBox
|
|
147
|
+
)
|
|
148
|
+
self._acquisition_streaming_frequency_combo_box: QComboBox = (
|
|
149
|
+
self.ui.acquisitionStreamingFrequencyComboBox
|
|
150
|
+
)
|
|
151
|
+
|
|
152
|
+
# Grid parameters
|
|
153
|
+
self._grid_selection_group_box: QGroupBox = self.ui.gridSelectionGroupBox
|
|
154
|
+
self._grid_selection_check_box_list: list[QCheckBox] = [
|
|
155
|
+
self.ui.gridOneCheckBox,
|
|
156
|
+
self.ui.gridTwoCheckBox,
|
|
157
|
+
self.ui.gridThreeCheckBox,
|
|
158
|
+
self.ui.gridFourCheckBox,
|
|
159
|
+
self.ui.gridFiveCheckBox,
|
|
160
|
+
self.ui.gridSixCheckBox,
|
|
161
|
+
]
|
|
162
|
+
|
|
163
|
+
[
|
|
164
|
+
check_box.setChecked(False)
|
|
165
|
+
for check_box in self._grid_selection_check_box_list
|
|
166
|
+
]
|
|
167
|
+
self._grid_selection_check_box_list[2].setChecked(True)
|
|
168
|
+
self._grid_selection_check_box_list[3].setChecked(True)
|
|
169
|
+
|
|
170
|
+
# Configuration parameters
|
|
171
|
+
self._configuration_group_boxes: list[QGroupBox] = [
|
|
172
|
+
self._acquisition_group_box,
|
|
173
|
+
self._grid_selection_group_box,
|
|
174
|
+
]
|