boris-behav-obs 8.27.10__py2.py3-none-any.whl → 9.0.2__py2.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.
- boris/about.py +7 -5
- boris/add_modifier.py +35 -35
- boris/add_modifier_ui.py +229 -129
- boris/advanced_event_filtering.py +3 -3
- boris/analysis_plugins/__init__.py +0 -0
- boris/analysis_plugins/number_of_occurences.py +60 -0
- boris/analysis_plugins/number_of_occurences_by_independent_variable.py +72 -0
- boris/analysis_plugins/time_budget.py +95 -0
- boris/behav_coding_map_creator.py +103 -108
- boris/behavior_binary_table.py +1 -1
- boris/behaviors_coding_map.py +8 -8
- boris/coding_pad.py +6 -6
- boris/config.py +6 -0
- boris/config_file.py +1 -1
- boris/connections.py +4 -2
- boris/converters.py +2 -3
- boris/converters_ui.py +187 -110
- boris/cooccurence.py +2 -2
- boris/core.py +341 -94
- boris/core_qrc.py +16088 -13246
- boris/core_ui.py +922 -812
- boris/dialog.py +14 -13
- boris/duration_widget.py +5 -5
- boris/edit_event.py +1 -1
- boris/edit_event_ui.py +162 -88
- boris/event_operations.py +4 -25
- boris/events_cursor.py +17 -9
- boris/events_snapshots.py +5 -5
- boris/exclusion_matrix.py +1 -1
- boris/export_events.py +38 -28
- boris/export_observation.py +1 -1
- boris/external_processes.py +3 -5
- boris/geometric_measurement.py +49 -26
- boris/gui_utilities.py +31 -30
- boris/import_observations.py +2 -4
- boris/irr.py +1 -1
- boris/latency.py +1 -1
- boris/map_creator.py +77 -89
- boris/measurement_widget.py +4 -4
- boris/media_file.py +2 -4
- boris/menu_options.py +1 -3
- boris/modifiers_coding_map.py +4 -4
- boris/mpv2.py +0 -2
- boris/observation.py +124 -29
- boris/observation_operations.py +18 -40
- boris/observation_ui.py +566 -374
- boris/observations_list.py +6 -6
- boris/param_panel.py +2 -2
- boris/param_panel_ui.py +246 -141
- boris/player_dock_widget.py +16 -21
- boris/plot_data_module.py +6 -6
- boris/plot_events_rt.py +7 -8
- boris/plot_spectrogram_rt.py +7 -8
- boris/plot_waveform_rt.py +6 -7
- boris/plugins.py +79 -0
- boris/preferences.py +127 -17
- boris/preferences_ui.py +464 -240
- boris/project.py +69 -72
- boris/project_functions.py +233 -31
- boris/project_import_export.py +59 -67
- boris/project_ui.py +672 -440
- boris/qrc_boris.py +6 -3
- boris/qrc_boris5.py +6 -3
- boris/select_modifiers.py +2 -2
- boris/select_observations.py +2 -2
- boris/select_subj_behav.py +3 -3
- boris/state_events.py +1 -1
- boris/subjects_pad.py +5 -5
- boris/synthetic_time_budget.py +2 -2
- boris/time_budget_functions.py +15 -0
- boris/time_budget_widget.py +4 -4
- boris/transitions.py +34 -25
- boris/utilities.py +96 -3
- boris/version.py +2 -2
- boris/video_equalizer.py +4 -4
- boris/video_equalizer_ui.py +199 -130
- boris/video_operations.py +1 -1
- boris/view_df.py +106 -0
- boris/view_df_ui.py +75 -0
- boris/write_event.py +9 -1
- {boris_behav_obs-8.27.10.dist-info → boris_behav_obs-9.0.2.dist-info}/METADATA +5 -5
- boris_behav_obs-9.0.2.dist-info/RECORD +103 -0
- {boris_behav_obs-8.27.10.dist-info → boris_behav_obs-9.0.2.dist-info}/WHEEL +1 -1
- boris/qdarkstyle/__init__.py +0 -479
- boris/qdarkstyle/__main__.py +0 -66
- boris/qdarkstyle/colorsystem.py +0 -38
- boris/qdarkstyle/dark/__init__.py +0 -1
- boris/qdarkstyle/dark/darkstyle_rc.py +0 -11379
- boris/qdarkstyle/dark/palette.py +0 -38
- boris/qdarkstyle/example/__init__.py +0 -4
- boris/qdarkstyle/example/__main__.py +0 -386
- boris/qdarkstyle/example/ui/__init__.py +0 -4
- boris/qdarkstyle/light/__init__.py +0 -1
- boris/qdarkstyle/light/lightstyle_rc.py +0 -11305
- boris/qdarkstyle/light/palette.py +0 -37
- boris/qdarkstyle/palette.py +0 -102
- boris/qdarkstyle/utils/__init__.py +0 -73
- boris/qdarkstyle/utils/__main__.py +0 -96
- boris/qdarkstyle/utils/images.py +0 -449
- boris/qdarkstyle/utils/scss.py +0 -318
- boris/vlc_local.py +0 -83
- boris_behav_obs-8.27.10.dist-info/RECORD +0 -114
- {boris_behav_obs-8.27.10.dist-info → boris_behav_obs-9.0.2.dist-info}/LICENSE.TXT +0 -0
- {boris_behav_obs-8.27.10.dist-info → boris_behav_obs-9.0.2.dist-info}/entry_points.txt +0 -0
- {boris_behav_obs-8.27.10.dist-info → boris_behav_obs-9.0.2.dist-info}/top_level.txt +0 -0
boris/dialog.py
CHANGED
|
@@ -30,8 +30,8 @@ import subprocess
|
|
|
30
30
|
from decimal import Decimal as dec
|
|
31
31
|
from typing import Union
|
|
32
32
|
|
|
33
|
-
from
|
|
34
|
-
from
|
|
33
|
+
from PySide6.QtCore import Qt, Signal, qVersion, QRect, QTime, QDateTime, QSize
|
|
34
|
+
from PySide6.QtWidgets import (
|
|
35
35
|
QApplication,
|
|
36
36
|
QAbstractItemView,
|
|
37
37
|
QCheckBox,
|
|
@@ -61,7 +61,7 @@ from PyQt5.QtWidgets import (
|
|
|
61
61
|
QStackedWidget,
|
|
62
62
|
QFrame,
|
|
63
63
|
)
|
|
64
|
-
from
|
|
64
|
+
from PySide6.QtGui import QFont, QTextCursor
|
|
65
65
|
|
|
66
66
|
from . import config as cfg
|
|
67
67
|
from . import version
|
|
@@ -92,13 +92,14 @@ def global_error_message(exception_type, exception_value, traceback_object):
|
|
|
92
92
|
Global error management
|
|
93
93
|
save error using loggin.critical and stdout
|
|
94
94
|
"""
|
|
95
|
+
import PySide6
|
|
95
96
|
|
|
96
97
|
error_text: str = (
|
|
97
98
|
f"BORIS version: {version.__version__}\n"
|
|
98
99
|
f"OS: {platform.uname().system} {platform.uname().release} {platform.uname().version}\n"
|
|
99
100
|
f"CPU: {platform.uname().machine} {platform.uname().processor}\n"
|
|
100
101
|
f"Python {platform.python_version()} ({'64-bit' if sys.maxsize > 2**32 else '32-bit'})\n"
|
|
101
|
-
f"Qt {
|
|
102
|
+
f"Qt {qVersion()} - PySide {PySide6.__version__}\n"
|
|
102
103
|
f"MPV library version: {util.mpv_lib_version()[0]}\n"
|
|
103
104
|
f"MPV API version: {util.mpv_lib_version()[2]}\n"
|
|
104
105
|
f"MPV library file path: {util.mpv_lib_version()[1]}\n\n"
|
|
@@ -129,8 +130,8 @@ def global_error_message(exception_type, exception_value, traceback_object):
|
|
|
129
130
|
|
|
130
131
|
# copy to clipboard
|
|
131
132
|
cb = QApplication.clipboard()
|
|
132
|
-
cb.clear(
|
|
133
|
-
cb.setText(error_text
|
|
133
|
+
cb.clear()
|
|
134
|
+
cb.setText(error_text)
|
|
134
135
|
|
|
135
136
|
text: str = (
|
|
136
137
|
f"An error has occured!\n\n"
|
|
@@ -693,8 +694,7 @@ class Video_overlay_dialog(QDialog):
|
|
|
693
694
|
self.setLayout(vlayout)
|
|
694
695
|
|
|
695
696
|
def browse(self):
|
|
696
|
-
|
|
697
|
-
file_name = fn[0] if type(fn) is tuple else fn
|
|
697
|
+
file_name, _ = QFileDialog.getOpenFileName(self, "Choose an image file", "", "PNG files (*.png);;All files (*)")
|
|
698
698
|
if file_name:
|
|
699
699
|
self.le_file_path.setText(file_name)
|
|
700
700
|
|
|
@@ -814,6 +814,8 @@ class Input_dialog(QDialog):
|
|
|
814
814
|
|
|
815
815
|
hbox2 = QHBoxLayout()
|
|
816
816
|
|
|
817
|
+
hbox2.addItem(QSpacerItem(40, 20, QSizePolicy.Policy.Expanding, QSizePolicy.Policy.Minimum))
|
|
818
|
+
|
|
817
819
|
self.pbCancel = QPushButton(cfg.CANCEL)
|
|
818
820
|
self.pbCancel.clicked.connect(self.reject)
|
|
819
821
|
hbox2.addWidget(self.pbCancel)
|
|
@@ -981,7 +983,7 @@ class FindInEvents(QWidget):
|
|
|
981
983
|
"find in events" dialog box
|
|
982
984
|
"""
|
|
983
985
|
|
|
984
|
-
clickSignal =
|
|
986
|
+
clickSignal = Signal(str)
|
|
985
987
|
|
|
986
988
|
currentIdx: int = -1
|
|
987
989
|
|
|
@@ -1045,7 +1047,7 @@ class FindReplaceEvents(QWidget):
|
|
|
1045
1047
|
"find replace events" dialog box
|
|
1046
1048
|
"""
|
|
1047
1049
|
|
|
1048
|
-
clickSignal =
|
|
1050
|
+
clickSignal = Signal(str)
|
|
1049
1051
|
|
|
1050
1052
|
def __init__(self):
|
|
1051
1053
|
super().__init__()
|
|
@@ -1216,8 +1218,7 @@ class Results_dialog(QDialog):
|
|
|
1216
1218
|
"""
|
|
1217
1219
|
|
|
1218
1220
|
if not self.dataset:
|
|
1219
|
-
|
|
1220
|
-
file_name = fn[0] if type(fn) is tuple else fn
|
|
1221
|
+
file_name, _ = QFileDialog().getSaveFileName(self, "Save results", "", "Text files (*.txt *.tsv);;All files (*)")
|
|
1221
1222
|
|
|
1222
1223
|
if not file_name:
|
|
1223
1224
|
return
|
|
@@ -1287,7 +1288,7 @@ class View_explore_project_results(QWidget):
|
|
|
1287
1288
|
widget for visualizing results of explore project
|
|
1288
1289
|
"""
|
|
1289
1290
|
|
|
1290
|
-
double_click_signal =
|
|
1291
|
+
double_click_signal = Signal(str, int)
|
|
1291
1292
|
|
|
1292
1293
|
def __init__(self):
|
|
1293
1294
|
super().__init__()
|
boris/duration_widget.py
CHANGED
|
@@ -2,12 +2,12 @@
|
|
|
2
2
|
|
|
3
3
|
widget to edit duration > 24 h or < 0
|
|
4
4
|
|
|
5
|
-
https://stackoverflow.com/questions/44380202/creating-a-custom-widget-in-
|
|
5
|
+
https://stackoverflow.com/questions/44380202/creating-a-custom-widget-in-PySide6
|
|
6
6
|
"""
|
|
7
7
|
|
|
8
8
|
from decimal import Decimal as dec
|
|
9
9
|
|
|
10
|
-
from
|
|
10
|
+
from PySide6.QtWidgets import (
|
|
11
11
|
QWidget,
|
|
12
12
|
QHBoxLayout,
|
|
13
13
|
QPushButton,
|
|
@@ -20,13 +20,13 @@ from PyQt5.QtWidgets import (
|
|
|
20
20
|
QRadioButton,
|
|
21
21
|
)
|
|
22
22
|
|
|
23
|
-
from
|
|
23
|
+
from PySide6.QtCore import Signal
|
|
24
24
|
|
|
25
25
|
from . import config as cfg
|
|
26
26
|
|
|
27
27
|
|
|
28
28
|
class Widget_hhmmss(QWidget):
|
|
29
|
-
time_changed_signal =
|
|
29
|
+
time_changed_signal = Signal(float)
|
|
30
30
|
|
|
31
31
|
def __init__(self, parent=None):
|
|
32
32
|
QWidget.__init__(self, parent=parent)
|
|
@@ -117,7 +117,7 @@ class Widget_hhmmss(QWidget):
|
|
|
117
117
|
|
|
118
118
|
|
|
119
119
|
class Widget_seconds(QWidget):
|
|
120
|
-
time_changed_signal =
|
|
120
|
+
time_changed_signal = Signal(float)
|
|
121
121
|
|
|
122
122
|
def __init__(self, parent=None):
|
|
123
123
|
QWidget.__init__(self, parent=parent)
|
boris/edit_event.py
CHANGED
boris/edit_event_ui.py
CHANGED
|
@@ -1,126 +1,200 @@
|
|
|
1
1
|
# -*- coding: utf-8 -*-
|
|
2
2
|
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
from PyQt5 import QtCore, QtGui, QtWidgets
|
|
3
|
+
################################################################################
|
|
4
|
+
## Form generated from reading UI file 'edit_event.ui'
|
|
5
|
+
##
|
|
6
|
+
## Created by: Qt User Interface Compiler version 6.8.0
|
|
7
|
+
##
|
|
8
|
+
## WARNING! All changes made in this file will be lost when recompiling UI file!
|
|
9
|
+
################################################################################
|
|
12
10
|
|
|
11
|
+
from PySide6.QtCore import (QCoreApplication, QDate, QDateTime, QLocale,
|
|
12
|
+
QMetaObject, QObject, QPoint, QRect,
|
|
13
|
+
QSize, QTime, QUrl, Qt)
|
|
14
|
+
from PySide6.QtGui import (QBrush, QColor, QConicalGradient, QCursor,
|
|
15
|
+
QFont, QFontDatabase, QGradient, QIcon,
|
|
16
|
+
QImage, QKeySequence, QLinearGradient, QPainter,
|
|
17
|
+
QPalette, QPixmap, QRadialGradient, QTransform)
|
|
18
|
+
from PySide6.QtWidgets import (QApplication, QCheckBox, QComboBox, QHBoxLayout,
|
|
19
|
+
QLabel, QPlainTextEdit, QPushButton, QSizePolicy,
|
|
20
|
+
QSpacerItem, QSpinBox, QVBoxLayout, QWidget)
|
|
13
21
|
|
|
14
22
|
class Ui_Form(object):
|
|
15
23
|
def setupUi(self, Form):
|
|
16
|
-
Form.
|
|
24
|
+
if not Form.objectName():
|
|
25
|
+
Form.setObjectName(u"Form")
|
|
17
26
|
Form.resize(413, 488)
|
|
18
|
-
self.verticalLayout =
|
|
19
|
-
self.verticalLayout.setObjectName("verticalLayout")
|
|
20
|
-
self.horizontalLayout_3 =
|
|
21
|
-
self.horizontalLayout_3.setObjectName("horizontalLayout_3")
|
|
22
|
-
self.label =
|
|
23
|
-
self.label.setObjectName("label")
|
|
27
|
+
self.verticalLayout = QVBoxLayout(Form)
|
|
28
|
+
self.verticalLayout.setObjectName(u"verticalLayout")
|
|
29
|
+
self.horizontalLayout_3 = QHBoxLayout()
|
|
30
|
+
self.horizontalLayout_3.setObjectName(u"horizontalLayout_3")
|
|
31
|
+
self.label = QLabel(Form)
|
|
32
|
+
self.label.setObjectName(u"label")
|
|
33
|
+
|
|
24
34
|
self.horizontalLayout_3.addWidget(self.label)
|
|
25
|
-
|
|
26
|
-
self.horizontalLayout_2
|
|
27
|
-
self.
|
|
28
|
-
self.pb_set_to_current_time
|
|
35
|
+
|
|
36
|
+
self.horizontalLayout_2 = QHBoxLayout()
|
|
37
|
+
self.horizontalLayout_2.setObjectName(u"horizontalLayout_2")
|
|
38
|
+
self.pb_set_to_current_time = QPushButton(Form)
|
|
39
|
+
self.pb_set_to_current_time.setObjectName(u"pb_set_to_current_time")
|
|
40
|
+
|
|
29
41
|
self.horizontalLayout_2.addWidget(self.pb_set_to_current_time)
|
|
30
|
-
|
|
31
|
-
self.cb_set_time_na
|
|
42
|
+
|
|
43
|
+
self.cb_set_time_na = QCheckBox(Form)
|
|
44
|
+
self.cb_set_time_na.setObjectName(u"cb_set_time_na")
|
|
45
|
+
|
|
32
46
|
self.horizontalLayout_2.addWidget(self.cb_set_time_na)
|
|
33
|
-
|
|
34
|
-
self.
|
|
47
|
+
|
|
48
|
+
self.horizontalSpacer = QSpacerItem(40, 20, QSizePolicy.Policy.Expanding, QSizePolicy.Policy.Minimum)
|
|
49
|
+
|
|
50
|
+
self.horizontalLayout_2.addItem(self.horizontalSpacer)
|
|
51
|
+
|
|
52
|
+
|
|
35
53
|
self.horizontalLayout_3.addLayout(self.horizontalLayout_2)
|
|
54
|
+
|
|
55
|
+
|
|
36
56
|
self.verticalLayout.addLayout(self.horizontalLayout_3)
|
|
37
|
-
|
|
38
|
-
self.horizontalLayout_7
|
|
39
|
-
self.
|
|
40
|
-
self.lb_image_idx
|
|
57
|
+
|
|
58
|
+
self.horizontalLayout_7 = QHBoxLayout()
|
|
59
|
+
self.horizontalLayout_7.setObjectName(u"horizontalLayout_7")
|
|
60
|
+
self.lb_image_idx = QLabel(Form)
|
|
61
|
+
self.lb_image_idx.setObjectName(u"lb_image_idx")
|
|
62
|
+
|
|
41
63
|
self.horizontalLayout_7.addWidget(self.lb_image_idx)
|
|
42
|
-
|
|
64
|
+
|
|
65
|
+
self.sb_image_idx = QSpinBox(Form)
|
|
66
|
+
self.sb_image_idx.setObjectName(u"sb_image_idx")
|
|
43
67
|
self.sb_image_idx.setMaximum(10000000)
|
|
44
|
-
|
|
68
|
+
|
|
45
69
|
self.horizontalLayout_7.addWidget(self.sb_image_idx)
|
|
46
|
-
|
|
47
|
-
self.pb_set_to_current_image_index
|
|
70
|
+
|
|
71
|
+
self.pb_set_to_current_image_index = QPushButton(Form)
|
|
72
|
+
self.pb_set_to_current_image_index.setObjectName(u"pb_set_to_current_image_index")
|
|
73
|
+
|
|
48
74
|
self.horizontalLayout_7.addWidget(self.pb_set_to_current_image_index)
|
|
49
|
-
|
|
50
|
-
self.
|
|
75
|
+
|
|
76
|
+
self.horizontalSpacer_6 = QSpacerItem(40, 20, QSizePolicy.Policy.Expanding, QSizePolicy.Policy.Minimum)
|
|
77
|
+
|
|
78
|
+
self.horizontalLayout_7.addItem(self.horizontalSpacer_6)
|
|
79
|
+
|
|
80
|
+
|
|
51
81
|
self.verticalLayout.addLayout(self.horizontalLayout_7)
|
|
52
|
-
|
|
53
|
-
self.horizontalLayout_4
|
|
54
|
-
self.
|
|
55
|
-
self.lbSubject
|
|
82
|
+
|
|
83
|
+
self.horizontalLayout_4 = QHBoxLayout()
|
|
84
|
+
self.horizontalLayout_4.setObjectName(u"horizontalLayout_4")
|
|
85
|
+
self.lbSubject = QLabel(Form)
|
|
86
|
+
self.lbSubject.setObjectName(u"lbSubject")
|
|
87
|
+
|
|
56
88
|
self.horizontalLayout_4.addWidget(self.lbSubject)
|
|
57
|
-
|
|
58
|
-
self.cobSubject
|
|
89
|
+
|
|
90
|
+
self.cobSubject = QComboBox(Form)
|
|
91
|
+
self.cobSubject.setObjectName(u"cobSubject")
|
|
92
|
+
|
|
59
93
|
self.horizontalLayout_4.addWidget(self.cobSubject)
|
|
60
|
-
|
|
61
|
-
self.
|
|
94
|
+
|
|
95
|
+
self.horizontalSpacer_2 = QSpacerItem(40, 20, QSizePolicy.Policy.Expanding, QSizePolicy.Policy.Minimum)
|
|
96
|
+
|
|
97
|
+
self.horizontalLayout_4.addItem(self.horizontalSpacer_2)
|
|
98
|
+
|
|
99
|
+
|
|
62
100
|
self.verticalLayout.addLayout(self.horizontalLayout_4)
|
|
63
|
-
|
|
64
|
-
self.horizontalLayout_5
|
|
65
|
-
self.
|
|
66
|
-
self.label_2
|
|
101
|
+
|
|
102
|
+
self.horizontalLayout_5 = QHBoxLayout()
|
|
103
|
+
self.horizontalLayout_5.setObjectName(u"horizontalLayout_5")
|
|
104
|
+
self.label_2 = QLabel(Form)
|
|
105
|
+
self.label_2.setObjectName(u"label_2")
|
|
106
|
+
|
|
67
107
|
self.horizontalLayout_5.addWidget(self.label_2)
|
|
68
|
-
|
|
69
|
-
self.cobCode
|
|
108
|
+
|
|
109
|
+
self.cobCode = QComboBox(Form)
|
|
110
|
+
self.cobCode.setObjectName(u"cobCode")
|
|
111
|
+
|
|
70
112
|
self.horizontalLayout_5.addWidget(self.cobCode)
|
|
71
|
-
|
|
72
|
-
self.
|
|
113
|
+
|
|
114
|
+
self.horizontalSpacer_3 = QSpacerItem(40, 20, QSizePolicy.Policy.Expanding, QSizePolicy.Policy.Minimum)
|
|
115
|
+
|
|
116
|
+
self.horizontalLayout_5.addItem(self.horizontalSpacer_3)
|
|
117
|
+
|
|
118
|
+
|
|
73
119
|
self.verticalLayout.addLayout(self.horizontalLayout_5)
|
|
74
|
-
|
|
75
|
-
self.horizontalLayout_6
|
|
76
|
-
self.
|
|
77
|
-
self.lb_frame_idx
|
|
120
|
+
|
|
121
|
+
self.horizontalLayout_6 = QHBoxLayout()
|
|
122
|
+
self.horizontalLayout_6.setObjectName(u"horizontalLayout_6")
|
|
123
|
+
self.lb_frame_idx = QLabel(Form)
|
|
124
|
+
self.lb_frame_idx.setObjectName(u"lb_frame_idx")
|
|
125
|
+
|
|
78
126
|
self.horizontalLayout_6.addWidget(self.lb_frame_idx)
|
|
79
|
-
|
|
127
|
+
|
|
128
|
+
self.sb_frame_idx = QSpinBox(Form)
|
|
129
|
+
self.sb_frame_idx.setObjectName(u"sb_frame_idx")
|
|
80
130
|
self.sb_frame_idx.setMinimum(0)
|
|
81
131
|
self.sb_frame_idx.setMaximum(100000000)
|
|
82
|
-
|
|
132
|
+
|
|
83
133
|
self.horizontalLayout_6.addWidget(self.sb_frame_idx)
|
|
84
|
-
|
|
85
|
-
self.cb_set_frame_idx_na
|
|
134
|
+
|
|
135
|
+
self.cb_set_frame_idx_na = QCheckBox(Form)
|
|
136
|
+
self.cb_set_frame_idx_na.setObjectName(u"cb_set_frame_idx_na")
|
|
137
|
+
|
|
86
138
|
self.horizontalLayout_6.addWidget(self.cb_set_frame_idx_na)
|
|
87
|
-
|
|
88
|
-
self.
|
|
139
|
+
|
|
140
|
+
self.horizontalSpacer_5 = QSpacerItem(40, 20, QSizePolicy.Policy.Expanding, QSizePolicy.Policy.Minimum)
|
|
141
|
+
|
|
142
|
+
self.horizontalLayout_6.addItem(self.horizontalSpacer_5)
|
|
143
|
+
|
|
144
|
+
|
|
89
145
|
self.verticalLayout.addLayout(self.horizontalLayout_6)
|
|
90
|
-
|
|
91
|
-
self.label_4
|
|
146
|
+
|
|
147
|
+
self.label_4 = QLabel(Form)
|
|
148
|
+
self.label_4.setObjectName(u"label_4")
|
|
149
|
+
|
|
92
150
|
self.verticalLayout.addWidget(self.label_4)
|
|
93
|
-
|
|
94
|
-
self.leComment
|
|
151
|
+
|
|
152
|
+
self.leComment = QPlainTextEdit(Form)
|
|
153
|
+
self.leComment.setObjectName(u"leComment")
|
|
154
|
+
|
|
95
155
|
self.verticalLayout.addWidget(self.leComment)
|
|
96
|
-
|
|
97
|
-
self.horizontalLayout
|
|
98
|
-
|
|
99
|
-
self.
|
|
100
|
-
|
|
101
|
-
self.
|
|
156
|
+
|
|
157
|
+
self.horizontalLayout = QHBoxLayout()
|
|
158
|
+
self.horizontalLayout.setObjectName(u"horizontalLayout")
|
|
159
|
+
self.horizontalSpacer_4 = QSpacerItem(40, 20, QSizePolicy.Policy.Expanding, QSizePolicy.Policy.Minimum)
|
|
160
|
+
|
|
161
|
+
self.horizontalLayout.addItem(self.horizontalSpacer_4)
|
|
162
|
+
|
|
163
|
+
self.pbCancel = QPushButton(Form)
|
|
164
|
+
self.pbCancel.setObjectName(u"pbCancel")
|
|
165
|
+
|
|
102
166
|
self.horizontalLayout.addWidget(self.pbCancel)
|
|
103
|
-
|
|
104
|
-
self.pbOK
|
|
105
|
-
self.pbOK.setObjectName("pbOK")
|
|
167
|
+
|
|
168
|
+
self.pbOK = QPushButton(Form)
|
|
169
|
+
self.pbOK.setObjectName(u"pbOK")
|
|
170
|
+
|
|
106
171
|
self.horizontalLayout.addWidget(self.pbOK)
|
|
172
|
+
|
|
173
|
+
|
|
107
174
|
self.verticalLayout.addLayout(self.horizontalLayout)
|
|
108
175
|
|
|
176
|
+
|
|
109
177
|
self.retranslateUi(Form)
|
|
110
|
-
|
|
178
|
+
|
|
179
|
+
self.pbOK.setDefault(True)
|
|
180
|
+
|
|
181
|
+
|
|
182
|
+
QMetaObject.connectSlotsByName(Form)
|
|
183
|
+
# setupUi
|
|
111
184
|
|
|
112
185
|
def retranslateUi(self, Form):
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
self.
|
|
116
|
-
self.
|
|
117
|
-
self.
|
|
118
|
-
self.
|
|
119
|
-
self.
|
|
120
|
-
self.
|
|
121
|
-
self.
|
|
122
|
-
self.
|
|
123
|
-
self.
|
|
124
|
-
self.
|
|
125
|
-
self.
|
|
126
|
-
|
|
186
|
+
Form.setWindowTitle(QCoreApplication.translate("Form", u"Edit event", None))
|
|
187
|
+
self.label.setText(QCoreApplication.translate("Form", u"Time", None))
|
|
188
|
+
self.pb_set_to_current_time.setText(QCoreApplication.translate("Form", u"Set to current time", None))
|
|
189
|
+
self.cb_set_time_na.setText(QCoreApplication.translate("Form", u"Set NA", None))
|
|
190
|
+
self.lb_image_idx.setText(QCoreApplication.translate("Form", u"Image index", None))
|
|
191
|
+
self.pb_set_to_current_image_index.setText(QCoreApplication.translate("Form", u"Set to current image index", None))
|
|
192
|
+
self.lbSubject.setText(QCoreApplication.translate("Form", u"Subject", None))
|
|
193
|
+
self.label_2.setText(QCoreApplication.translate("Form", u"Code", None))
|
|
194
|
+
self.lb_frame_idx.setText(QCoreApplication.translate("Form", u"Frame index", None))
|
|
195
|
+
self.cb_set_frame_idx_na.setText(QCoreApplication.translate("Form", u"Set NA", None))
|
|
196
|
+
self.label_4.setText(QCoreApplication.translate("Form", u"Comment", None))
|
|
197
|
+
self.pbCancel.setText(QCoreApplication.translate("Form", u"Cancel", None))
|
|
198
|
+
self.pbOK.setText(QCoreApplication.translate("Form", u"OK", None))
|
|
199
|
+
# retranslateUi
|
|
200
|
+
|
boris/event_operations.py
CHANGED
|
@@ -38,8 +38,8 @@ from . import select_modifiers
|
|
|
38
38
|
from . import write_event
|
|
39
39
|
from .edit_event import DlgEditEvent, EditSelectedEvents
|
|
40
40
|
|
|
41
|
-
from
|
|
42
|
-
from
|
|
41
|
+
from PySide6.QtWidgets import QMessageBox, QInputDialog, QLineEdit, QAbstractItemView, QApplication
|
|
42
|
+
from PySide6.QtCore import QTime, Qt
|
|
43
43
|
|
|
44
44
|
|
|
45
45
|
def add_event(self):
|
|
@@ -320,7 +320,7 @@ def delete_all_events(self):
|
|
|
320
320
|
if (
|
|
321
321
|
dialog.MessageDialog(
|
|
322
322
|
cfg.programName,
|
|
323
|
-
("Confirm the deletion of all (filtered) events in the current observation?<br>
|
|
323
|
+
("Confirm the deletion of all (filtered) events in the current observation?<br>Filters do not apply!"),
|
|
324
324
|
[cfg.YES, cfg.NO],
|
|
325
325
|
)
|
|
326
326
|
== cfg.YES
|
|
@@ -762,29 +762,8 @@ def edit_event(self):
|
|
|
762
762
|
cfg.IMAGE_PATH,
|
|
763
763
|
)
|
|
764
764
|
|
|
765
|
-
"""
|
|
766
|
-
try:
|
|
767
|
-
event[cfg.IMAGE_PATH] = self.images_list[new_index]
|
|
768
|
-
except IndexError:
|
|
769
|
-
event[cfg.IMAGE_PATH] = ""
|
|
770
|
-
"""
|
|
771
765
|
event[cfg.IMAGE_INDEX] = new_index
|
|
772
766
|
|
|
773
|
-
"""
|
|
774
|
-
time_ = dec("NaN")
|
|
775
|
-
if (
|
|
776
|
-
self.playerType != cfg.VIEWER_IMAGES
|
|
777
|
-
and self.pj[cfg.OBSERVATIONS][self.observationId].get(cfg.USE_EXIF_DATE, False)
|
|
778
|
-
and self.extract_exif_DateTimeOriginal(self.images_list[new_index]) != -1
|
|
779
|
-
):
|
|
780
|
-
time_ = (
|
|
781
|
-
self.extract_exif_DateTimeOriginal(self.images_list[new_index]) - self.image_time_ref
|
|
782
|
-
)
|
|
783
|
-
|
|
784
|
-
elif self.pj[cfg.OBSERVATIONS][self.observationId].get(cfg.TIME_LAPSE, 0):
|
|
785
|
-
time_ = new_index * self.pj[cfg.OBSERVATIONS][self.observationId].get(cfg.TIME_LAPSE, 0)
|
|
786
|
-
"""
|
|
787
|
-
|
|
788
767
|
r = write_event.write_event(self, event, event[cfg.TIME].quantize(dec("0.001"), rounding=ROUND_DOWN))
|
|
789
768
|
if r == 1: # same event already present
|
|
790
769
|
continue
|
|
@@ -834,7 +813,7 @@ def edit_time_selected_events(self):
|
|
|
834
813
|
if (
|
|
835
814
|
dialog.MessageDialog(
|
|
836
815
|
cfg.programName,
|
|
837
|
-
(f"Confirm the {'addition' if d > 0 else 'subtraction'} of {smart_d}
|
|
816
|
+
(f"Confirm the {'addition' if d > 0 else 'subtraction'} of {smart_d} to all selected events in the current observation?"),
|
|
838
817
|
[cfg.YES, cfg.NO],
|
|
839
818
|
)
|
|
840
819
|
== cfg.NO
|
boris/events_cursor.py
CHANGED
|
@@ -21,9 +21,9 @@ Copyright 2012-2024 Olivier Friard
|
|
|
21
21
|
|
|
22
22
|
"""
|
|
23
23
|
|
|
24
|
-
from
|
|
25
|
-
from
|
|
26
|
-
from
|
|
24
|
+
from PySide6.QtCore import QPoint, Qt
|
|
25
|
+
from PySide6.QtGui import QPolygon, QPen, QColor, QBrush, QPainter
|
|
26
|
+
from PySide6.QtWidgets import QStyledItemDelegate
|
|
27
27
|
|
|
28
28
|
|
|
29
29
|
class StyledItemDelegateTriangle(QStyledItemDelegate):
|
|
@@ -36,18 +36,26 @@ class StyledItemDelegateTriangle(QStyledItemDelegate):
|
|
|
36
36
|
self.row = row
|
|
37
37
|
|
|
38
38
|
def paint(self, painter, option, index):
|
|
39
|
+
"""
|
|
40
|
+
draw a red triangle on ceel corresponfing to current event
|
|
41
|
+
"""
|
|
42
|
+
|
|
39
43
|
super(StyledItemDelegateTriangle, self).paint(painter, option, index)
|
|
40
44
|
|
|
41
45
|
if self.row == -1:
|
|
42
46
|
return
|
|
43
47
|
if index.row() == self.row:
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
+
triangle = QPolygon(
|
|
49
|
+
[
|
|
50
|
+
QPoint(option.rect.x() + 15, option.rect.y()),
|
|
51
|
+
QPoint(option.rect.x(), option.rect.y() - 5),
|
|
52
|
+
QPoint(option.rect.x(), option.rect.y() + 5),
|
|
53
|
+
]
|
|
54
|
+
)
|
|
55
|
+
|
|
48
56
|
painter.save()
|
|
49
|
-
painter.setRenderHint(
|
|
57
|
+
painter.setRenderHint(QPainter.RenderHint.Antialiasing)
|
|
50
58
|
painter.setBrush(QBrush(QColor(Qt.red)))
|
|
51
59
|
painter.setPen(QPen(QColor(Qt.red)))
|
|
52
|
-
painter.drawPolygon(
|
|
60
|
+
painter.drawPolygon(triangle)
|
|
53
61
|
painter.restore()
|
boris/events_snapshots.py
CHANGED
|
@@ -27,7 +27,7 @@ import pathlib as pl
|
|
|
27
27
|
import subprocess
|
|
28
28
|
from decimal import Decimal as dec
|
|
29
29
|
|
|
30
|
-
from
|
|
30
|
+
from PySide6.QtWidgets import QApplication, QFileDialog, QInputDialog, QMessageBox
|
|
31
31
|
|
|
32
32
|
from . import config as cfg
|
|
33
33
|
from . import db_functions, dialog, project_functions, select_observations, select_subj_behav
|
|
@@ -109,11 +109,11 @@ def events_snapshots(self):
|
|
|
109
109
|
return
|
|
110
110
|
|
|
111
111
|
# directory for saving frames
|
|
112
|
-
export_dir = QFileDialog
|
|
112
|
+
export_dir = QFileDialog.getExistingDirectory(
|
|
113
113
|
self,
|
|
114
114
|
"Choose a directory to extract events",
|
|
115
115
|
os.path.expanduser("~"),
|
|
116
|
-
options=QFileDialog
|
|
116
|
+
options=QFileDialog.ShowDirsOnly,
|
|
117
117
|
)
|
|
118
118
|
if not export_dir:
|
|
119
119
|
return
|
|
@@ -373,11 +373,11 @@ def extract_events(self):
|
|
|
373
373
|
if not ok:
|
|
374
374
|
return
|
|
375
375
|
|
|
376
|
-
export_dir = QFileDialog
|
|
376
|
+
export_dir = QFileDialog.getExistingDirectory(
|
|
377
377
|
self,
|
|
378
378
|
"Choose a directory to extract events",
|
|
379
379
|
os.path.expanduser("~"),
|
|
380
|
-
options=QFileDialog
|
|
380
|
+
options=QFileDialog.ShowDirsOnly,
|
|
381
381
|
)
|
|
382
382
|
if not export_dir:
|
|
383
383
|
return
|