bluerobotics / ping-viewer

Ping Viewer is an open-source application to view and record data from the Blue Robotics Ping Echosounder and Ping360 Scanning Sonar.
https://docs.bluerobotics.com/ping-viewer/
GNU General Public License v3.0
40 stars 38 forks source link

Make Connecting Smarter #1034

Open ES-Alexander opened 2 years ago

ES-Alexander commented 2 years ago

Summary

Additional information

If user changed the IP subnet last time they used Ping Viewer, they quite likely want to keep that subnet next time. (I'm a bit confused here, I thought Ping Viewer searched for devices on the current computer's subnet rather than a hardcoded one, but maybe not - may need confirmation)

Current manual connection default configuration is set to 192.168.2.2:1234, which is the default Companion IP (reasonable expectation) and the dev port (less desirable). Current implementation uses the same Entry widget, and hence same value regardless of device type, but ideally specifying a different device type would also change the default connection info, since different devices have different default ports.

Relevant forum comment: You could do a dropdown list on the port section: Ping1D (9090), Ping360 (9092), Custom. I don’t know how many of us change the IP address of the ROV but even if the PingView does not check the local address mask (in my example 192.168.4.x), it would be great if it instead of always starting in search mode, connects to the last successful connection. -Grega (@tunadiver)

patrickelectric commented 2 years ago

@ES-Alexander I'm not sure if I follow correctly, ping-viewer saves all previous manual connections to run on the search loop. Or: If a user add a manual connection and close ping-viewer, the next time ping-viewer will use the previous manual connection configuration on the search loop and it should appears as a valid result.

ES-Alexander commented 2 years ago

@patrickelectric

ping-viewer saves all previous manual connections to run on the search loop.

Are you saying that already happens, or asking if that's the desired behaviour? If it doesn't already happen, that's the desired behaviour. The second option doesn't make much sense (to me at least) - you can't pretend something is a valid result if it's actually not, right?

patrickelectric commented 2 years ago

That already happend, it also saves the previous connection to try it.

patrickelectric commented 2 years ago

https://github.com/bluerobotics/ping-viewer/blob/master/src/devicemanager/devicemanager.cpp#L121 https://github.com/bluerobotics/ping-viewer/blob/master/src/sensor/protocoldetector.cpp#L49