Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Development #782

Merged
merged 160 commits into from
Dec 5, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
160 commits
Select commit Hold shift + click to select a range
76c1327
* signal cutting and intep preserves the dtype, so casting to native …
danielhrisca Aug 4, 2022
53ca8c2
fixes #743
danielhrisca Aug 5, 2022
ef4762a
fixes #741
danielhrisca Aug 5, 2022
0d5b44e
fixes #744
danielhrisca Aug 8, 2022
46be36f
allow the user to configure the cursor
danielhrisca Aug 9, 2022
de2bb17
Fixed Typo
david32 Aug 23, 2022
868b0a6
Merge pull request #755 from david32/typo_754
danielhrisca Aug 25, 2022
65517de
fixes #753
danielhrisca Aug 25, 2022
f83dbb0
Merge branch 'development' of https://github.com/danielhrisca/asammdf…
danielhrisca Aug 25, 2022
8e3669e
missing columns for LIN and FlexRay
danielhrisca Aug 25, 2022
32a05be
fixes #758
danielhrisca Aug 29, 2022
5b8c1d9
black
danielhrisca Aug 29, 2022
34e3e56
fixes #752
danielhrisca Aug 29, 2022
1d6178c
fixes #759
danielhrisca Aug 29, 2022
d403e56
fixes #697
danielhrisca Aug 30, 2022
a73ce21
set #e69138 as default cursor color
danielhrisca Aug 30, 2022
36c586a
plot methods
danielhrisca Sep 5, 2022
5187aa6
fixes #753: Error: <class 'TypeError'> unsupported operand type(s) fo…
danielhrisca Sep 5, 2022
b6f0e19
add plot signal conversion editor
danielhrisca Sep 6, 2022
fca7a64
apply user defined conversions when loading a display file
danielhrisca Sep 7, 2022
5b0c6e6
visual improvements
danielhrisca Sep 7, 2022
a9a14a1
debug print
danielhrisca Sep 7, 2022
92ff430
debug 2
danielhrisca Sep 7, 2022
9708fb9
fixes the tests
danielhrisca Sep 7, 2022
807ec35
black
danielhrisca Sep 7, 2022
9ea24fc
fixes master channel stored as non-standard size integer
danielhrisca Sep 7, 2022
079c81f
handle duplicated timestamps in the CAN and LIN traces
danielhrisca Sep 7, 2022
64c22da
fix monospace font in the tabular windows
danielhrisca Sep 7, 2022
34f2c59
add missing CAN trace columns
danielhrisca Sep 7, 2022
26ed88a
show LIN checksum data bytes in the trace
danielhrisca Sep 7, 2022
810a3e0
better channel group name display
danielhrisca Sep 12, 2022
a290241
convert(): removed sharp clips in string parameter
woodpy Sep 13, 2022
7d6ca57
Merge pull request #766 from woodpy/patch-1
danielhrisca Sep 13, 2022
6c694a7
consolas font
danielhrisca Sep 13, 2022
c3ee0e5
Merge branch 'development' of https://github.com/danielhrisca/asammdf…
danielhrisca Sep 13, 2022
3ba9d89
use UTC time stamps in the FileHistory and HeaderBlock
danielhrisca Sep 14, 2022
c915abd
set the time zone
danielhrisca Sep 14, 2022
c04aa02
fixes #756
danielhrisca Sep 14, 2022
e9dba37
localize the timestamps in the tabular windows
danielhrisca Sep 15, 2022
8c4ab0d
file history start time fix
danielhrisca Sep 15, 2022
a49c8a9
black
danielhrisca Sep 15, 2022
1e7ac3c
make sure locked range is painted correct
danielhrisca Sep 15, 2022
702d426
remove prints
danielhrisca Sep 15, 2022
b47ec16
temporary fix for mismatch between Cursor mouse cursor and hover event
danielhrisca Sep 16, 2022
d7d741c
always ignore invalid J1939 signals
danielhrisca Sep 16, 2022
f41d643
pin pyside
danielhrisca Sep 20, 2022
d1831b4
use pyinstaller 5.2
danielhrisca Sep 20, 2022
8927696
show DataBytes signals using the DataLength field in the Tabular window
danielhrisca Sep 20, 2022
d29b33a
install libopengl0 for the linux build
danielhrisca Sep 20, 2022
4d09dc0
minimum version for pyinstaller 6.2.2
danielhrisca Sep 20, 2022
d8d3f32
pyopengl ??
danielhrisca Sep 20, 2022
3f6c52f
wrong imports
danielhrisca Sep 21, 2022
ac25856
fire the signal after the window is closed
danielhrisca Sep 23, 2022
e608ab5
fix using dsp files in the filter tab
danielhrisca Sep 26, 2022
0b034c8
fixes #769
danielhrisca Sep 26, 2022
dc38683
Fix for issue #770. Try to convert to float first, and if that fails …
eblis Sep 27, 2022
7e6908e
Fix for issue #741.
eblis Sep 27, 2022
f240b63
fix initial display of file channels list
danielhrisca Sep 29, 2022
b8804ae
fixes empty GPS window when openeniong multiple windows
danielhrisca Sep 29, 2022
a6d94db
fixes exception if a CAN bus logging file contains unknown CAN IDs an…
danielhrisca Sep 30, 2022
8be76db
fixes batch processing exception if a CAN bus logging file contains u…
danielhrisca Sep 30, 2022
f3817c6
build with pyinstaller 4.10
danielhrisca Sep 30, 2022
6dfeff8
do not create one file, this way the application starts faster
danielhrisca Sep 30, 2022
5d71b35
pin requirements
danielhrisca Sep 30, 2022
1b514b3
Merge branch 'development' into feature/load-progress
eblis Oct 6, 2022
6986b2f
improve sorting speed for large channel group counts
danielhrisca Oct 7, 2022
3cc926a
Reformatted mdf_v4 so black likes it
eblis Oct 7, 2022
abf904b
Merge pull request #772 from eblis/feature/load-progress
danielhrisca Oct 7, 2022
13d8ca7
ranges fixes
danielhrisca Oct 11, 2022
00433a3
Merge branch 'development' of https://github.com/danielhrisca/asammdf…
danielhrisca Oct 11, 2022
9b7d59f
fixed channel search wildcard casing issue
Oct 11, 2022
e8e6e9f
black
Oct 11, 2022
b3860b1
Merge pull request #771 from eblis/master
danielhrisca Oct 12, 2022
6735f5c
Merge pull request #777 from timohencken/bug/search_channels_wildcard…
danielhrisca Oct 12, 2022
3d5bf85
ranges transfer between window types
danielhrisca Oct 12, 2022
3cda02f
fix ranges for loading numeric window
danielhrisca Oct 12, 2022
d981831
show signal statistic directly when enabling it with M key
danielhrisca Oct 12, 2022
e553d2c
add support for user defined signal comment
danielhrisca Oct 12, 2022
1fec541
_load_window functions should always return a (window, pattern) tuple
danielhrisca Oct 18, 2022
58f69de
shift + click for selecting a curve in the plot
danielhrisca Oct 18, 2022
ce5305d
drag and drop between plots in the comparison view
danielhrisca Oct 18, 2022
ace86b6
fix numeric window loading
danielhrisca Oct 18, 2022
cc54c26
add honeywell zoom option for Plot
danielhrisca Oct 19, 2022
12abf44
use seconds/cm instead of seconds/pixel for Honeywell
danielhrisca Oct 19, 2022
315937a
I and O zooming doubles or halves the visible time range
danielhrisca Oct 20, 2022
212f4ab
store integer format for pattern based plots
danielhrisca Oct 20, 2022
f78cfd3
apply integer format for channel groups
danielhrisca Oct 21, 2022
e24a433
use python functions for computed channels
danielhrisca Oct 21, 2022
73a15b1
convert all computed channel type to python function
danielhrisca Oct 21, 2022
e47766e
select curves in Plot using double click
danielhrisca Oct 24, 2022
71ff8a3
choose triggering type for computed channels
danielhrisca Oct 25, 2022
1b24e6c
triggering info for dsp virtual channels
danielhrisca Oct 26, 2022
5be1d8d
add get_data utility function for computed channels
danielhrisca Oct 31, 2022
dc6cf47
fix grid error with disabled axes
danielhrisca Nov 1, 2022
027700d
convert string channels to str object in the CSV export
danielhrisca Nov 1, 2022
4f642d0
start function manager implementation
danielhrisca Nov 2, 2022
1685090
add simple search for function manager
danielhrisca Nov 2, 2022
57db034
use function manager in defining new channels in plot
danielhrisca Nov 2, 2022
ca5d5b2
export/import functions definitions
danielhrisca Nov 2, 2022
10c3680
introduce custom flags attribute in the Signal class
danielhrisca Nov 2, 2022
1b5820b
more flags and fixes
danielhrisca Nov 2, 2022
81cc6d2
fixes
danielhrisca Nov 3, 2022
83e200f
fix
danielhrisca Nov 3, 2022
1597375
let the user define e complete python function
danielhrisca Nov 3, 2022
6b74df3
simplify the functions manager
danielhrisca Nov 3, 2022
a8efb09
make sure that the last argument is t=0
danielhrisca Nov 3, 2022
8aa2208
fixes for new pure python functions
danielhrisca Nov 4, 2022
ff4aa17
remove all _fill_0_for_missing_computation_channels
danielhrisca Nov 4, 2022
e293c81
remove all _fill_0_for_missing_computation_channels (again)
danielhrisca Nov 4, 2022
663d067
fixes
danielhrisca Nov 4, 2022
930edbd
use globals so that generated functions can call each other
danielhrisca Nov 6, 2022
7b054f9
fixes for computed channels
danielhrisca Nov 6, 2022
4cd39a1
update all computed channels when a function is changed or added
danielhrisca Nov 6, 2022
97d6a1c
add syntax highlighter for the user defined Python functions used in …
danielhrisca Nov 6, 2022
9a1b725
hopefully easier to find by people using search engines and github se…
danielhrisca Nov 6, 2022
502ea46
better colors for the syntax highlighter
danielhrisca Nov 6, 2022
42e8fcb
all function must have default values
danielhrisca Nov 7, 2022
647faa4
replace tabs with 4 spaces
danielhrisca Nov 7, 2022
357826a
fix dsp loaded virtual channels and name copy on channel groups
danielhrisca Nov 7, 2022
6491a02
fix renaming computed channels
danielhrisca Nov 7, 2022
cfd27d9
* fix disabled icon for channel groups in the plot selection
danielhrisca Nov 8, 2022
23664ee
fix highlighter
danielhrisca Nov 8, 2022
b065c89
show the functions manager maximized
danielhrisca Nov 9, 2022
f3ea8f9
default escape char " for CSV export
danielhrisca Nov 11, 2022
43f1557
update channel value in the channel selection after editing the conve…
danielhrisca Nov 11, 2022
da74f53
fix python highlighter for Python < 3.9
danielhrisca Nov 11, 2022
9bf6da0
remove second menu entry
danielhrisca Nov 11, 2022
6c81035
fix measurement bookmarks
danielhrisca Nov 14, 2022
93ba024
move check at the beginning of the function
danielhrisca Nov 14, 2022
cc84646
6 digits for conversion dialog
danielhrisca Nov 14, 2022
b6e4637
update teh plot and signal value after changing the conversion
danielhrisca Nov 14, 2022
488172f
use width function for axis
danielhrisca Nov 14, 2022
5e3ac51
update selected channels in the batch widget
danielhrisca Nov 15, 2022
ba4841b
add bookmarks to measurement
danielhrisca Nov 15, 2022
97d6d76
editable user bookmarks
danielhrisca Nov 15, 2022
5e92368
bump version
danielhrisca Nov 15, 2022
0c99316
better colors for the bookmarks
danielhrisca Nov 15, 2022
84b836b
linux qsettings sotres strings
danielhrisca Nov 16, 2022
d725def
use type in the qsettings
danielhrisca Nov 16, 2022
4fd0f23
black isort
danielhrisca Nov 16, 2022
e10b0a6
fix Esc key on progress dialog
danielhrisca Nov 16, 2022
6aec85e
do not waste bookmarks space
danielhrisca Nov 17, 2022
b79f37e
fixes #779
danielhrisca Nov 17, 2022
0ad3ed1
check if the signal has enough dimensions when trying to extract the …
danielhrisca Nov 18, 2022
3978f63
fix scrolling individual axis
danielhrisca Nov 21, 2022
b1512a4
do not allow Y axis changes when the plot is locked
danielhrisca Nov 21, 2022
caa8c16
fix wrong initial X zoom when the timestamps are higher than 1
danielhrisca Nov 22, 2022
2e33e73
set Y range when adding a computed channel
danielhrisca Nov 23, 2022
daec6bb
Merge branch 'development' of https://github.com/danielhrisca/asammdf…
danielhrisca Nov 23, 2022
2190124
fixes for PySide 6.4
danielhrisca Nov 24, 2022
e92f9b9
qkeycombination is immutable
danielhrisca Nov 25, 2022
8d924d9
fix computation when now alternative channel is found
danielhrisca Nov 25, 2022
6c8d2c1
QCombnation parameters were interchanged
danielhrisca Nov 28, 2022
8a63b50
add new icon
danielhrisca Nov 28, 2022
b6b15e9
set originla_name when loading a CSV file
danielhrisca Nov 28, 2022
899285d
store settings for plot quick commands
danielhrisca Nov 29, 2022
35955df
apply plot quick commands state from the dspf file
danielhrisca Nov 29, 2022
994a079
set the precision in the channels stats widget
danielhrisca Dec 5, 2022
5a0254f
raise error if the user calls MDF2, MDF3 or MDF4
danielhrisca Dec 5, 2022
5df8fb2
fix bookmarks toggle button
danielhrisca Dec 5, 2022
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -44,9 +44,9 @@ jobs:
pip install cmerg
if [ "$RUNNER_OS" == "Linux" ]; then
sudo apt update
sudo apt install libegl1
sudo apt install libegl1 libopengl0
fi
pyinstaller asammdf.spec --distpath dist/${RUNNER_OS} --noconfirm --clean --onefile
pyinstaller asammdf.spec --distpath dist/${RUNNER_OS} --noconfirm --clean

# see: https://docs.github.com/en/actions/advanced-guides/storing-workflow-data-as-artifacts
- name: Archive dist artifacts
Expand Down
92 changes: 24 additions & 68 deletions asammdf.spec
Original file line number Diff line number Diff line change
Expand Up @@ -7,33 +7,6 @@ import sys
asammdf_path = Path.cwd() / "asammdf" / "gui" / "asammdfgui.py"


def _cmd_line_parser():
parser = argparse.ArgumentParser()

parser.add_argument(
"spec",
help="specfile",
)

parser.add_argument(
"--console",
action="store_true",
help="show console, default False",
)

parser.add_argument(
"--onefile",
action="store_true",
help="create single file, default False",
)

return parser


parser = _cmd_line_parser()
args, unknown = parser.parse_known_args(sys.argv[1:])


block_cipher = None
added_files = []

Expand Down Expand Up @@ -74,49 +47,32 @@ a = Analysis(
win_no_prefer_redirects=False,
win_private_assemblies=False,
cipher=block_cipher,
noarchive=not args.onefile,
noarchive=False,
)

if args.onefile:
pyz = PYZ(a.pure, a.zipped_data, cipher=block_cipher)

exe = EXE(
pyz,
a.scripts,
a.binaries,
a.zipfiles,
a.datas,
Tree(asammdf_path.parent),
name="asammdfgui",
debug=False,
strip=False,
upx=True,
console=args.console,
icon="asammdf.ico",
)
else:
pyz = PYZ(a.pure, a.zipped_data, cipher=block_cipher)
pyz = PYZ(a.pure, a.zipped_data, cipher=block_cipher)

exe = EXE(
pyz,
a.scripts,
[],
name="asammdfgui",
exclude_binaries=True,
bootloader_ignore_signals=False,
debug=False,
strip=False,
console=args.console,
icon="asammdf.ico",
)
exe = EXE(
pyz,
a.scripts,
[],
name="asammdfgui",
exclude_binaries=True,
bootloader_ignore_signals=False,
debug=False,
strip=False,
console=False,
icon="asammdf.ico",
)

coll = COLLECT(
exe,
a.binaries,
a.zipfiles,
a.datas,
Tree(asammdf_path.parent),
upx=False,
upx_exclude=[],
name="asammdfgui",
)
coll = COLLECT(
exe,
a.binaries,
a.zipfiles,
a.datas,
Tree(asammdf_path.parent),
upx=False,
upx_exclude=[],
name="asammdfgui",
)
97 changes: 96 additions & 1 deletion asammdf/blocks/conversion_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

from __future__ import annotations

from typing import Any
from typing import Any, Union

from . import v2_v3_blocks as v3b
from . import v2_v3_constants as v3c
Expand Down Expand Up @@ -392,3 +392,98 @@ def from_dict(conversion: dict[str, Any]) -> v4b.ChannelConversion:
conversion = v4b.ChannelConversion(conversion_type=v4c.CONVERSION_TYPE_NON)

return conversion


def to_dict(conversion: ChannelConversionType) -> Union[dict, None]:
if not conversion:
return None

if isinstance(conversion, v3b.ChannelConversion):
conversion = conversion_transfer(conversion, version=4)

conversion_type = conversion.conversion_type

conversion_dict = {
"name": conversion.name,
"unit": conversion.unit,
"comment": conversion.comment,
}

if conversion_type == v4c.CONVERSION_TYPE_LIN:
conversion_dict["a"] = conversion.a
conversion_dict["b"] = conversion.b
conversion_dict["conversion_type"] = conversion_type

elif conversion_type == v4c.CONVERSION_TYPE_ALG:
conversion_dict["formula"] = conversion["formula"]
conversion_dict["conversion_type"] = conversion_type

elif conversion_type == v4c.CONVERSION_TYPE_RAT:
conversion_dict.update(
{key: conversion[key] for key in [f"P{i}" for i in range(1, 7)]}
)
conversion_dict["conversion_type"] = conversion_type

elif conversion_type in (v4c.CONVERSION_TYPE_TAB, v4c.CONVERSION_TYPE_TABI):
params = conversion["val_param_nr"] // 2
conversion_dict.update(
{key: conversion[key] for key in [f"phys_{nr}" for nr in range(params)]}
)
conversion_dict.update(
{key: conversion[key] for key in [f"raw_{nr}" for nr in range(params)]}
)
conversion_dict["conversion_type"] = conversion_type

elif conversion_type == v4c.CONVERSION_TYPE_RTAB:
params = (conversion["val_param_nr"] - 1) // 3
conversion_dict.update(
{key: conversion[key] for key in [f"lower_{nr}" for nr in range(params)]}
)
conversion_dict.update(
{key: conversion[key] for key in [f"upper_{nr}" for nr in range(params)]}
)
conversion_dict.update(
{key: conversion[key] for key in [f"phys_{nr}" for nr in range(params)]}
)
conversion_dict["conversion_type"] = conversion_type
conversion_dict["default"] = conversion.default

elif conversion_type == v4c.CONVERSION_TYPE_TABX:
nr = conversion.ref_param_nr - 1

conversion_dict["conversion_type"] = conversion_type

for key, val in conversion.referenced_blocks.items():

if isinstance(val, str):
conversion_dict[key] = val
elif isinstance(val, v4b.ChannelConversion):
conversion_dict[key] = to_dict(val)
else:
conversion_dict[key] = val.decode("utf-8", errors="replace")

for i in range(nr):
conversion_dict[f"val_{i}"] = conversion[f"val_{i}"]

elif conversion_type == v4c.CONVERSION_TYPE_RTABX:
nr = conversion.ref_param_nr - 1

conversion_dict["conversion_type"] = conversion_type

for key, val in conversion.referenced_blocks.items():

if isinstance(val, str):
conversion_dict[key] = val
elif isinstance(val, v4b.ChannelConversion):
conversion_dict[key] = to_dict(val)
else:
conversion_dict[key] = val.decode("utf-8", errors="replace")

for i in range(nr):
conversion_dict[f"upper_{i}"] = conversion[f"upper_{i}"]
conversion_dict[f"lower_{i}"] = conversion[f"lower_{i}"]

else:
conversion_dict = None

return conversion_dict
29 changes: 18 additions & 11 deletions asammdf/blocks/cutils.c
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
#include "numpy/ndarrayobject.h"
#include <stdio.h>
#include <stdbool.h>
#include <time.h>

#define PY_PRINTF(o) \
PyObject_Print(o, stdout, 0); printf("\n");
Expand Down Expand Up @@ -72,22 +73,28 @@ static PyObject* sort_data_block(PyObject* self, PyObject* args)
for (unsigned char i=0; i<id_size; i++, buf++) {
rec_id += (*buf) << (i <<3);
}

mlist = NULL;
for (item=head; item!=NULL; item=item->next)
{
if (item->info.id == rec_id)
{
rec_size = item->info.size;
mlist = item->info.mlist;
break;
}

key = PyLong_FromUnsignedLong(rec_id);
value = PyDict_GetItem(record_size, key);

if (!value) {
rem = PyBytes_FromStringAndSize(NULL, 0);
Py_XDECREF(key);
return rem;
}

else {
rec_size = PyLong_AsUnsignedLong(value);
}

mlist = PyDict_GetItem(partial_records, key);

if (!mlist) {
rem = PyBytes_FromStringAndSize(NULL, 0);
Py_XDECREF(key);
return rem;
}

Py_XDECREF(key);

if (rec_size)
{
Expand Down
7 changes: 6 additions & 1 deletion asammdf/blocks/mdf_v2.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@

from ..types import StrPathType
from .mdf_v3 import MDF3
from .utils import validate_version_argument
from .utils import MdfException, validate_version_argument

__all__ = ["MDF2"]

Expand All @@ -27,6 +27,11 @@ def __init__(
) -> None:
version = validate_version_argument(version, hint=2)

if not kwargs.get("__internal__", False):
raise MdfException(
"Always use the MDF class; do not use the class MDF2 directly"
)

super().__init__(name, version, **kwargs)


Expand Down
18 changes: 12 additions & 6 deletions asammdf/blocks/mdf_v3.py
Original file line number Diff line number Diff line change
Expand Up @@ -173,6 +173,11 @@ def __init__(
channels: list[str] | None = None,
**kwargs,
) -> None:
if not kwargs.get("__internal__", False):
raise MdfException(
"Always use the MDF class; do not use the class MDF3 directly"
)

self._kwargs = kwargs
self.original_name = kwargs["original_name"]
if channels is None:
Expand Down Expand Up @@ -538,15 +543,10 @@ def _prepare_record(self, group: Group) -> list:

if not new_ch.component_addr:

if not new_ch.dtype_fmt:
new_ch.dtype_fmt = dtype(
get_fmt_v3(data_type, bit_count, byte_order)
)

# adjust size to 1, 2, 4 or 8 bytes
size = bit_offset + bit_count

byte_size, rem = size // 8, size % 8
byte_size, rem = divmod(size, 8)
if rem:
byte_size += 1
bit_size = byte_size * 8
Expand All @@ -562,6 +562,11 @@ def _prepare_record(self, group: Group) -> list:
elif size > 8:
bit_offset += 16 - bit_size

if not new_ch.dtype_fmt:
new_ch.dtype_fmt = dtype(
get_fmt_v3(data_type, size, byte_order)
)

record.append(
(
new_ch.dtype_fmt,
Expand Down Expand Up @@ -3104,6 +3109,7 @@ def get(

if vals.dtype.kind == "S":
encoding = "latin-1"
vals = array([e.rsplit(b"\0")[0] for e in vals.tolist()], dtype=vals.dtype)

if samples_only:
res = vals, None
Expand Down
Loading