qFuzzyCompare
is a Qt function that checks if two numbers are equivalent (same as the ==
operator in Python). In the set_range
function, it’s being used to check if the new commanded range is the same as the existing stored range, and if so returning early (there’s not much value in commanding a settings change without actually changing any settings).
I’ve raised an issue for us to add an implementation of it in the library (because I think it would be a useful addition), but I don’t know what kind of timeline that will have. I’m not aware of any existing Python implementations.
What help are you after, specifically? The thread I linked you to covers the parameters that determine the range (sample_period
and number_of_sampes
), as well as the equation that relates them. The Ping Viewer implementation that’s linked to covers the actual set_range
functionality, which calculates the sample period (calculateSamplePeriod
) from the currently specified sound speed and number of samples, and updates the transmit duration (adjustTransmitDuration
) to stay within reasonable limits for the sensor.
The Ping1D firmware stores a speed of sound internally, and supports directly setting the range with a message.
As in the thread I linked you to:
Basically, the Ping360 firmware provides more direct access to the device itself, and additional abstraction needs to be implemented by the code that’s communicating with it. Our libraries currently only implement the ping-protocol and what’s required to make a connection (e.g. serial / udp connection functions), which provides access to everything the devices themselves can do.
Additional abstract functionality could definitely be useful, but interface and accessibility improvements are frequently prioritised below fixing or implementing critical functionality elsewhere. Our software team is small, and time is unfortunately a limited resource.