-
Notifications
You must be signed in to change notification settings - Fork 26
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
Annotation load not working #283
Comments
Hi, I'm also having this issue on Ubuntu 22.04.5 LTS. The double coursers I added are not showing up. When I open Widgets > Notes I get an empty window, but I added some description of the signals when I saved the measurement. I also get a lot of exceptions when I open a file with annotations:
So I had a look at the file using
This looks to me like the annotations are still there. So I decided to see if I can recover the information, assuming it's still there. So I wrote the following code: import pyjls as jls
# Relative path to directory containing water measurements
water_dir = 'led_vsly5850_pt_1540052na3090/water'
# File names
jsl_file = 'vce_5v_if_100ua_dark_to_on_24mm.jls'
anno_file = 'vce_5v_if_100ua_dark_to_on_24mm.anno.jls'
def user_data_cbk(chunk_meta_u16, data) -> bool:
"""Callback function for pyjls.Reader.user_data method."""
print('chunk_meta_u16:', chunk_meta_u16)
print('data:')
print(data)
return False
def annotation_cbk(timestamp, y, annotation_type, group_id, data) -> bool:
"""Callback function for pyjls.Reader.annotations method."""
print('timestamp:', timestamp)
print('y:', y)
print('annotation_type:', annotation_type)
print('group_id:', group_id)
print('data:', data)
return False
def jls_file_info(file_path: str) -> None:
"""Prints Joulescope file infos.
Args:
file_path (str): Path to Joulescope file.
"""
print(file_path + ':')
print('='*(len(file_path) + 1))
with jls.Reader(file_path) as r:
# Print the signals
print('\nSignals:')
print('--------')
for k, v in r.signals.items():
print(f'{k}: {v}')
# Print the sources
print('\nSources:')
print('--------')
for k, v in r.sources.items():
print(f'{k}: {v}')
# Print the user data
print('\nUser data:')
print('----------')
r.user_data(user_data_cbk)
# Print annotations
print('\nAnnotations:')
print('------------')
for k in r.signals:
r.annotations(k, 0, annotation_cbk)
# Print file infos
jls_file_info(water_dir + '/' + jsl_file)
print('\n\n')
jls_file_info(water_dir + '/' + anno_file) I ran the script and got the following output:
So the information is definitly still there (though I did not check if the courser location (timestamp) is correct). Hope this helps a little. Regards, Immanuel |
Also fixed duplicate annotation load for JLS files when toggling views.
Joulescope model
JS220
UI version
1.1.9
What OS are you seeing the problem on?
Windows 11
What happened?
I saved annotations alongside a JLS file. When I reload the JLS file, only the text annotations load.
What was expected?
The x-axis markers should also load.
How to reproduce?
See GIF above.
Extra information
No response
The text was updated successfully, but these errors were encountered: