Skip to content

Commit 614690e

Browse files
authored
Merge pull request #85 from introlab/dev
Main merge for 1.1.3 release
2 parents bbd2d0e + de38adb commit 614690e

20 files changed

+191
-114
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,3 +20,4 @@ python-3.10
2020
*.dmg
2121
python-3.11
2222
build
23+
python-3.12

CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ PROJECT (OpenIMU)
33
set(CMAKE_VERBOSE_MAKEFILE ON)
44

55
#Look for minimum cmake version
6-
cmake_minimum_required(VERSION 3.0.2)
6+
cmake_minimum_required(VERSION 3.21)
77

88
#Python
99
add_subdirectory(python)

python/CMakeLists.txt

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
#TODO MAKE THIS GENERIC
2-
set (PYTHON_VERSION 3.11)
2+
set (PYTHON_VERSION 3.12)
33
add_subdirectory(env)
44

55
set(PYTHON_ENV_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/env/python-${PYTHON_VERSION})
@@ -113,6 +113,7 @@ message(STATUS ${python_files})
113113
# PyInstaller
114114
set (installer_args
115115
--hidden-import logging.config
116+
--hidden-import scipy._lib.array_api_compat.numpy.fft
116117
--clean
117118
-y
118119
--windowed # If windowed, no console is displayed

python/OpenIMU.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ def except_hook(cls, exception, traceback):
4242
app = OpenIMUApp()
4343

4444
# Route errors to error dialog
45-
sys.excepthook = except_hook
45+
# sys.excepthook = except_hook
4646

4747
# Set current directory to home path
4848
QDir.setCurrent(QDir.homePath())

python/env/requirements.txt

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
pypiwin32==223; sys_platform == 'win32'
2-
PySide6==6.6.3
3-
cython==3.0.10
4-
numpy==1.26.4
5-
scipy==1.11.4
6-
sqlalchemy==2.0.29
7-
alembic==1.13.1
2+
PySide6==6.8.1.1
3+
cython==3.0.11
4+
numpy==2.2.2
5+
scipy==1.15.1
6+
sqlalchemy==2.0.37
7+
alembic==1.14.1
88
pyinstaller==5.13.2

python/libopenimu/db/DBManager.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -255,15 +255,16 @@ def delete_participant(self, part):
255255

256256
#
257257
def add_sensor(self, _id_sensor_type, _name, _hw_name, _location, _sampling_rate, _data_rate,
258-
_settings: str | None = None):
258+
_settings: str | None = None, _hw_id: str | None = None):
259259
# Check if that sensor is already present in the database
260260
query = self.session.query(Sensor).filter((Sensor.id_sensor_type == _id_sensor_type) &
261261
(Sensor.location == _location) &
262262
(Sensor.name == _name) &
263263
(Sensor.hw_name == _hw_name) &
264264
(Sensor.sampling_rate == _sampling_rate) &
265265
(Sensor.data_rate == _data_rate) &
266-
(Sensor.settings == _settings))
266+
(Sensor.settings == _settings) &
267+
(Sensor.hw_id == _hw_id))
267268

268269
if query.first():
269270
# print("Sensor " + _name + " already present in DB!")
@@ -274,6 +275,7 @@ def add_sensor(self, _id_sensor_type, _name, _hw_name, _location, _sampling_rate
274275
id_sensor_type=_id_sensor_type,
275276
name=_name,
276277
hw_name=_hw_name,
278+
hw_id=_hw_id,
277279
location=_location,
278280
sampling_rate=_sampling_rate,
279281
data_rate=_data_rate,

python/libopenimu/importers/AppleWatchImporter.py

Lines changed: 51 additions & 37 deletions
Large diffs are not rendered by default.

python/libopenimu/importers/BaseImporter.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -87,8 +87,8 @@ def add_recordset_to_db(self, name, start_timestamp, stop_timestamp):
8787
return recordset
8888

8989
def add_sensor_to_db(self, sensor_type, name, hw_name, location, sampling_rate, data_rate,
90-
settings: str | None = None):
91-
sensor = self.db.add_sensor(sensor_type, name, hw_name, location, sampling_rate, data_rate, settings)
90+
settings: str | None = None, hw_id: str | None = None):
91+
sensor = self.db.add_sensor(sensor_type, name, hw_name, location, sampling_rate, data_rate, settings, hw_id)
9292
return sensor
9393

9494
def add_channel_to_db(self, sensor, unit, data_format, label):

python/libopenimu/importers/wimu.py

Lines changed: 32 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -30,11 +30,13 @@ class GPSGeodetic:
3030
magnetic_variation = np.int16(0)
3131
climb_rate = np.int16(0)
3232
heading_rate = np.int16(0)
33+
accuracy = np.uint16(0)
34+
altitude_accuracy = np.int16(0)
3335
original_data = bytes()
3436
valid = False
3537

3638
def from_bytes(self, data, offset=0):
37-
if len(data) != 91:
39+
if len(data) != 91 and len(data) != 54:
3840
print('Error GPSGeo len:', len(data))
3941
self.valid = False
4042
return False
@@ -63,8 +65,9 @@ def from_bytes(self, data, offset=0):
6365
[self.magnetic_variation] = struct.unpack_from('>h', data, offset=44)
6466
[self.climb_rate] = struct.unpack_from('>h', data, offset=46)
6567
[self.heading_rate] = struct.unpack_from('>h', data, offset=48)
66-
67-
# TODO continue other fields
68+
if len(data) == 54:
69+
[self.accuracy] = struct.unpack_from('>H', data, offset=50)
70+
[self.altitude_accuracy] = struct.unpack_from('>H', data, offset=52)
6871

6972
# print('latitude', self.latitude / 1e7, 'longitude', self.longitude / 1e7)
7073

@@ -84,10 +87,32 @@ def tobytes(self):
8487
if len(self.original_data) > 0:
8588
return self.original_data
8689
else:
87-
# TODO Write all fields
88-
data = np.zeros(91, dtype=np.uint8)
89-
struct.pack_into('>i', data, 23, int(self.latitude))
90-
struct.pack_into('>i', data, 27, int(self.longitude))
90+
data = np.zeros(54, dtype=np.uint8)
91+
struct.pack_into('>B', data, 0, self.message_id)
92+
struct.pack_into('>H', data, 1, self.nav_valid)
93+
struct.pack_into('>H', data, 3, self.nav_type)
94+
struct.pack_into('>H', data, 5, self.extended_week_number)
95+
struct.pack_into('>I', data, 7, self.tow)
96+
struct.pack_into('>H', data, 11, self.year)
97+
struct.pack_into('>B', data, 13, self.month)
98+
struct.pack_into('>B', data, 14, self.day)
99+
struct.pack_into('>B', data, 15, self.hour)
100+
struct.pack_into('>B', data, 16, self.minute)
101+
struct.pack_into('>H', data, 17, self.second)
102+
struct.pack_into('>I', data, 19, self.satellite_id_list)
103+
struct.pack_into('>i', data, 23, self.latitude)
104+
struct.pack_into('>i', data, 27, self.longitude)
105+
struct.pack_into('>i', data, 31, self.altitude_ellipsoid)
106+
struct.pack_into('>i', data, 35, self.altitude_mls)
107+
struct.pack_into('>b', data, 39, self.map_datum)
108+
struct.pack_into('>H', data, 40, self.speed_over_ground)
109+
struct.pack_into('>H', data, 42, self.course_over_ground)
110+
struct.pack_into('>h', data, 44, self.magnetic_variation)
111+
struct.pack_into('>h', data, 46, self.climb_rate)
112+
struct.pack_into('>h', data, 48, self.heading_rate)
113+
struct.pack_into('>H', data, 50, self.accuracy)
114+
struct.pack_into('>H', data, 52, self.altitude_accuracy)
115+
91116
return data
92117

93118

python/libopenimu/qt/BackgroundProcess.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -157,6 +157,8 @@ def __init__(self, bg_process: BackgroundProcess, job_title: string, parent=None
157157
self.UI = Ui_ProgressDialog()
158158
self.UI.setupUi(self)
159159
self.setWindowFlags(Qt.SplashScreen)
160+
self.setWindowModality(Qt.WindowModality.ApplicationModal)
161+
self.setModal(True)
160162

161163
# self.UI.frameCancel.hide() # Hide cancel frame
162164

0 commit comments

Comments
 (0)