asammdf
asammdf copied to clipboard
When entering the gps window for the second time, the map does not work
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 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 Yes, adding this line of code can solve it. You can try
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)
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 @MatinF the development branch code works now with multiple GPS windows
@danielhrisca
Sorry, I forgot to say that the environment is development branch
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) :-)

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..
In my tests it's working fine with multiple GPS windows open simultaneously

“ 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"
This has been resolved in the latest version from what I can see, suggest closing