Pat-I / OpenGrade3D

3D grade control
GNU General Public License v3.0
6 stars 5 forks source link

Crash in simulator mode #3

Open jkonno opened 4 years ago

jkonno commented 4 years ago

Something funny happens when switching from simulator mode and the COM is still connected to GPS. Gives a complaint that the length parameter is out of bounds. I guess it's related to the NMEA feed disappearing from the box.

Pat-I commented 4 years ago

A complaint, you mean the crash window? Can you reproduce the crash? Do you have lines of code related? Longitude from Gps and simulator? It's with the integred ntrip? So far I had never this kind of issue, I think AOG restart when switching from simulator?

jkonno commented 4 years ago

I try to reproduce today, it gives a runtime error but if you click continue it doesn't crash but the error keeps on popping up. I try to see what is causing it.

Pat-I commented 4 years ago

I was able to reproduce it, it's related to GGA on line 200 in CNMEA.cs To make it appear you have to activate gps, ntrip and simulator. After when closing the gps port the runtime error will appear. It seem that NTRIP don't stop when GPS port close? There should also be something that close Gps port when simulator is activated and vs-versa.

Pat-I commented 4 years ago

I added a 0 more to the longitude in simulator GGA string when between 9 and -9. Also add some line to avoid sim and port open the same time. Same for ntrip should now work only when gps port is open. Still a weird longitude when simulator is near 0 but no error so far.