Jun-04-2017, 07:54 PM
Some explanation on the strange behavior of the GPS thingy here.
So, as I understand it, you need:
1) a thread that read the GPS device continuously, and fast enough to avoid buffer overflows on the other size. This thread maintains a set of "latest GPS values" somewhere.
2) another thread that runs at the application-defined pace, to get the current value and store them in a file.
Looking at the OP's code: GPSPoller() is a good candidate for 1) but it doesn't store whatever it receives from the GPS device. There is a loop in the main that could be implementing 2) but instead of getting the latest value from the GPSPoller, it tries to get the value from the GPS device directly, competing with the GPSPoller which is in a tight loop.
So, as I understand it, you need:
1) a thread that read the GPS device continuously, and fast enough to avoid buffer overflows on the other size. This thread maintains a set of "latest GPS values" somewhere.
2) another thread that runs at the application-defined pace, to get the current value and store them in a file.
Looking at the OP's code: GPSPoller() is a good candidate for 1) but it doesn't store whatever it receives from the GPS device. There is a loop in the main that could be implementing 2) but instead of getting the latest value from the GPSPoller, it tries to get the value from the GPS device directly, competing with the GPSPoller which is in a tight loop.
Unless noted otherwise, code in my posts should be understood as "coding suggestions", and its use may require more neurones than the two necessary for Ctrl-C/Ctrl-V.
Your one-stop place for all your GIMP needs: gimp-forum.net
Your one-stop place for all your GIMP needs: gimp-forum.net