asammdf icon indicating copy to clipboard operation
asammdf copied to clipboard

When entering the gps window for the second time, the map does not work

Open xukegithub opened this issue 3 years ago • 10 comments

Python version

('python=3.10.7 (tags/v3.10.7:6cc6b13, Sep 5 2022, 14:08:36) [MSC v.1933 64 ' 'bit (AMD64)]') 'os=Windows-10-10.0.19044-SP0' 'numpy=1.23.3' 'asammdf=7.1.1'

Code

MDF version

v4.11

Description

When entering the gps window for the second time, the map does not work

Then before "self.map = L.map(self.mapWidget)",
add this line "pyqtlet2.leaflet.core.Evented.mapWidget = None" it's ok

xukegithub avatar Sep 28 '22 03:09 xukegithub

@xukegithub Is it correctly understood that you're able to resolve the plot issue by adding the extra line in the code? If so, that would be a really nice update to resolve this issue.

MatinF avatar Sep 28 '22 08:09 MatinF

@MatinF Yes, adding this line of code can solve it. You can try

xukegithub avatar Sep 28 '22 09:09 xukegithub

Then before "self.map = L.map(self.mapWidget)", add this line "pyqtlet2.leaflet.core.Evented.mapWidget = None"

It does not run on my side. I get an exception


File "D:\02__PythonWorkspace\asammdf\asammdf\gui\widgets\file.py", line 1481, in _create_window
    self.add_window((window_type, signals))
  File "D:\02__PythonWorkspace\asammdf\asammdf\gui\widgets\mdi_area.py", line 964, in add_window
    return self._add_gps_window(names)
  File "D:\02__PythonWorkspace\asammdf\asammdf\gui\widgets\mdi_area.py", line 1457, in _add_gps_window
    gps = GPS(latitude_channel, longitude_channel)
  File "D:\02__PythonWorkspace\asammdf\asammdf\gui\widgets\gps.py", line 65, in __init__
    self.map.setView([50.1364092, 8.5991296], zoom)
  File "D:\02__PythonWorkspace\__venvs\daxil\lib\site-packages\pyqtlet2\leaflet\map\map.py", line 104, in setView
    self.runJavaScript(js)
  File "D:\02__PythonWorkspace\__venvs\daxil\lib\site-packages\pyqtlet2\leaflet\core\evented.py", line 78, in runJavaScript
    self.mapWidget.page.runJavaScript(js)

danielhrisca avatar Sep 29 '22 10:09 danielhrisca

my code pyqtlet2.leaflet.core.Evented.mapWidget = None self.map = L.map(self.mapWidget) self.map.setView([self.latitude, self.longitude], zoom) Exception is the first time you enter this interface or the second time it happens?

xukegithub avatar Sep 29 '22 12:09 xukegithub

@xukegithub @MatinF the development branch code works now with multiple GPS windows

danielhrisca avatar Sep 30 '22 05:09 danielhrisca

@danielhrisca

Sorry, I forgot to say that the environment is development branch

xukegithub avatar Sep 30 '22 06:09 xukegithub

Great, I think this works! (my maps are grey due to a separate dependency issue as discussed previously)

Will be great to have this included in the next release!

One minor observation: If creating multiple plots, the lower bar time sync seems to work, but the plot marker is not actually synced between the two plots. I think this is such a minor issue that I wouldn't bother too much with it. I'm probably one of the only people who is actively recording multiple GNSS position plots in the same MF4 log files (as part of some GNSS antenna evaluation tests) :-)

image

MatinF avatar Sep 30 '22 06:09 MatinF

With the fix it is still not possible to have two GPS windows active at the same time.

However you can close a GPS window and create a new working GPS windows; previously any other GPS window created after the first one would have been greyed out..

danielhrisca avatar Sep 30 '22 12:09 danielhrisca

In my tests it's working fine with multiple GPS windows open simultaneously image

MatinF avatar Sep 30 '22 13:09 MatinF

“ However you can close a GPS window and create a new working GPS windows; previously any other GPS window created after the first one would have been greyed out..” Yes, I'm just trying to solve the problem above. Two gps windows at the same time, I have not tested If you want to solve this problem, you will probably have to modify "pyqtlet2"

xukegithub avatar Sep 30 '22 13:09 xukegithub

This has been resolved in the latest version from what I can see, suggest closing

MatinF avatar Dec 27 '22 14:12 MatinF