danielhrisca / asammdf

Fast Python reader and editor for ASAM MDF / MF4 (Measurement Data Format) files
GNU Lesser General Public License v3.0
648 stars 226 forks source link

GUI #64

Closed danielhrisca closed 6 years ago

danielhrisca commented 6 years ago

Python version

asammdf 3.3.2

Description

Starting with 3.3.2 there will be a graphical user interface to handle

image

Any help is appreciated:

JulienGrv commented 6 years ago

Hi Daniel,

I think it is a very nice feature to have!

One concern I have: since the gui and asammdf will be in the same source code, I am afraid one will have to install the gui and its dependencies even if only asammdf is desired, isn't it?

I would suggest keeping them separated if possible

EDIT: I saw PyQt5 is an extra dependency in setup.py so my comment is not relevant anymore

JulienGrv commented 6 years ago

2 ideas that come into my mind:

danielhrisca commented 6 years ago

Hello Julien,

thank you for the input.

I was thinking of a progress bar as well. This will need some hints from asammdf to show the real progress, otherwise there would only some kind of busy indicator.

The signal search filed did not cross my mind. Cycling through occurrences would probably be easier/better performing to implement than actually filtering the signal list and showing only the matches.

danielhrisca commented 6 years ago

I've added search fields for the channels tab and filter tab.

JulienGrv commented 6 years ago

It's getting nicer!

I got the issue import resource_rc not found when trying to start the gui in module mode python -m asammdfgui.gui, not sure how to fix this though since the files are auto-generated. But it works with python asammdfgui/gui.py

By the way, there is a typo error in function new_search_result: search_filed -> search_field

You might want to have a look at this project: https://github.com/pyqtgraph/pyqtgraph

danielhrisca commented 6 years ago

When you install asammdf you will get a new script in the _python_exefolder\Scripts called asammdf.exe

If you have that path set in the PATH environement variable you can run asammdf straight from the command line.

JulienGrv commented 6 years ago

I did a test by installing the development branch and running asammdf:

$ pip install git+https://github.com/danielhrisca/asammdf.git@development
Collecting git+https://github.com/danielhrisca/asammdf.git@development
  Cloning https://github.com/danielhrisca/asammdf.git (to revision development) to c:\users\xxx\appdata\local\temp\pip-req-build-lzt59g1f
Requirement already satisfied: numpy>=1.13.1 in c:\users\xxx\appdata\local\continuum\miniconda3\lib\site-packages (from asammdf==3.3.2.dev0) (1.14.2)
Requirement already satisfied: pandas in c:\users\xxx\appdata\local\continuum\miniconda3\lib\site-packages (from asammdf==3.3.2.dev0) (0.22.0)
Requirement already satisfied: numexpr in c:\users\xxx\appdata\local\continuum\miniconda3\lib\site-packages (from asammdf==3.3.2.dev0) (2.6.4)
Requirement already satisfied: matplotlib in c:\users\xxx\appdata\local\continuum\miniconda3\lib\site-packages (from asammdf==3.3.2.dev0) (2.2.2)
Requirement already satisfied: wheel in c:\users\xxx\appdata\local\continuum\miniconda3\lib\site-packages (from asammdf==3.3.2.dev0) (0.31.0)
Requirement already satisfied: canmatrix in c:\users\xxx\appdata\local\continuum\miniconda3\lib\site-packages\canmatrix-0.6-py3.6.egg (from asammdf==3.3.2.dev0) (0.6)
Requirement already satisfied: python-dateutil>=2 in c:\users\xxx\appdata\local\continuum\miniconda3\lib\site-packages (from pandas->asammdf==3.3.2.dev0) (2.7.2)
Requirement already satisfied: pytz>=2011k in c:\users\xxx\appdata\local\continuum\miniconda3\lib\site-packages (from pandas->asammdf==3.3.2.dev0) (2018.4)
Requirement already satisfied: six>=1.10 in c:\users\xxx\appdata\local\continuum\miniconda3\lib\site-packages (from matplotlib->asammdf==3.3.2.dev0) (1.11.0)
Requirement already satisfied: kiwisolver>=1.0.1 in c:\users\xxx\appdata\local\continuum\miniconda3\lib\site-packages (from matplotlib->asammdf==3.3.2.dev0) (1.0.1)
Requirement already satisfied: pyparsing!=2.0.4,!=2.1.2,!=2.1.6,>=2.0.1 in c:\users\xxx\appdata\local\continuum\miniconda3\lib\site-packages (from matplotlib->asammdf==3.3.2.dev0) (2.2.0)
Requirement already satisfied: cycler>=0.10 in c:\users\xxx\appdata\local\continuum\miniconda3\lib\site-packages (from matplotlib->asammdf==3.3.2.dev0) (0.10.0)
Requirement already satisfied: future in c:\users\xxx\appdata\local\continuum\miniconda3\lib\site-packages (from canmatrix->asammdf==3.3.2.dev0) (0.16.0)
Requirement already satisfied: setuptools in c:\users\xxx\appdata\local\continuum\miniconda3\lib\site-packages (from kiwisolver>=1.0.1->matplotlib->asammdf==3.3.2.dev0) (39.0.1)
Building wheels for collected packages: asammdf
  Running setup.py bdist_wheel for asammdf ... done
  Stored in directory: C:\Users\xxx\AppData\Local\Temp\pip-ephem-wheel-cache-gw6ug7ht\wheels\01\1d\73\678737efedf8faba61f013695839fed92fbfed3e30ba90cbee
Successfully built asammdf
Installing collected packages: asammdf
  Found existing installation: asammdf 3.3.1
    Uninstalling asammdf-3.3.1:
      Successfully uninstalled asammdf-3.3.1
Successfully installed asammdf-3.3.2.dev0

$ asammdf
Traceback (most recent call last):
  File "c:\users\xxx\appdata\local\continuum\miniconda3\lib\runpy.py", line 193, in _run_module_as_main
    "__main__", mod_spec)
  File "c:\users\xxx\appdata\local\continuum\miniconda3\lib\runpy.py", line 85, in _run_code
    exec(code, run_globals)
  File "C:\Users\xxx\AppData\Local\Continuum\miniconda3\Scripts\asammdf.exe\__main__.py", line 5, in <module>
  File "c:\users\xxx\appdata\local\continuum\miniconda3\lib\site-packages\asammdfgui\gui.py", line 30, in <module>
    import asammdfgui.main_window as main_window
  File "c:\users\xxx\appdata\local\continuum\miniconda3\lib\site-packages\asammdfgui\main_window.py", line 157, in <module>
    import resource_rc
ModuleNotFoundError: No module named 'resource_rc'

Run with: Python 3.6.5 |Anaconda, Inc.| (default, Mar 29 2018, 13:32:41) [MSC v.1900 64 bit (AMD64)] on win32

danielhrisca commented 6 years ago

You are right, for the moment please change the line to

from asammdf import resource_rc

and please try again with the latest code

danielhrisca commented 6 years ago

I've switched to using pyqtgraph for plotting. Looks much better with multiple channels selected.

JulienGrv commented 6 years ago

It works now.

EDIT: here is this thing from pyqtgraph I was talking about http://pyqtgraph.org/documentation/parametertree/index.html but it might be overkill for just displaying properties

danielhrisca commented 6 years ago

Regarding the list of channels, names are too long to be visible. A horizontal scroll bar is required there

The window is split now so you can adjust the channel list and graph area size as needed.

It would be super nice to be able to do a right click on a signal and see its property, like in MDFValidator or CANape. Have a look at the pyqtgraph examples, I think there is already something to display a list of value/property.

The aim is not to overlap too much with MDFValidator which is excellent at what is does. I've added a popup window if you double-click a channel name in the list; it will display the channel, conversion and source fields.

I got an error when closing the gui clicking on X

It should be fixed now.

JulienGrv commented 6 years ago

I think for the search field that the completer should show only a limited amount of matches for performance with big measurement. I don't know if it is possible to do that though.

danielhrisca commented 6 years ago

Please have a try with the latest code. Hopefully it performs better with large channel count.

dapperfu commented 6 years ago

V3 files created with asammdf seem to fail with KeyErrors: logging_channels.

I just tested random files with .mdf extension generated with: https://github.com/jed-frey/python_MDF_Indexer/blob/sprint/2018-Apr/01_MakeMDF-Data.py

All .mf4 files works fine.

danielhrisca commented 6 years ago

The release 3.4.0 contains the first GUI implementation.

Feel free to re-open this issue if needed.

kozmers commented 6 years ago

I got 'No module named 'resource_rc'' error from version 3.4.2, installed by 'pip install asammdf' command. `Successfully installed asammdf-3.4.2

C:\Users\xxx>asammdf Traceback (most recent call last): File "c:\program files\python365\lib\runpy.py", line 193, in _run_module_as_main "main", od_spec) File "c:\program files\python365\lib\runpy.py", line 85, in _run_codeexec(code, run_globals) File "C:\Program Files\Python365\Scripts\asammdf.exe__main__.py", line 5, in File "c:\program files\python365\lib\site-packages\asammdfgui\gui.py", line 25, in import asammdfgui.search_dialog as search_dialog File "c:\program files\python365\lib\site-packages\asammdfgui\search_dialog.py", line 65, in import resource_rc ModuleNotFoundError: No module named 'resource_rc' `

danielhrisca commented 6 years ago

Hello @kozmers ,

you are right. I've fixed this and made a new release https://github.com/danielhrisca/asammdf/releases/tag/3.4.3. Please install again the new version

kozmers commented 6 years ago

Thanks Daniel. I've just updated to 3.4.3 by 'pip install -U asammdf', GUI runs well now.