Using the SDK, it is possible to check and toggle the Replay State of the Emulator or a real sensor. This is useful when trying to download the Intensity bitmap, download the surface CSV, or replay .rec files.
First, what is the Replay state of the sensor or Emulator. From the web GUI of a sensor, you can see if a sensor is in Replay mode or if it is in Run mode by simply looking at the Replay slider shown here.
In the above image, the sensor is in Run mode, and in the below image, the sensor is in Replay mode.
You can check the current Replay state using the method call GoSensor_InputSource(). This will return that the sensor is either playing live data or recorded data.
Once you have determined the current mode, your SDK application can change that mode using the method call GoSensor_SetInputSource()
You may want to then use the method call GoSensor_Flush(sensor) in order to flush the current configuration and show the latest state. On a real sensor, this will update the web GUI to show the desired and newly configured state. When using the GoEmulator utility, you may want to open the Emulator's web port in a web browser by typing 127.0.0.1:3191 into the URL bar. This will open the Emulator's UI in a web browser. Then you can reload the web page to see the current status of the Replay.
Attached is an example of reading the current Replay state as RUN mode (a.k.a. live data), and then changing the state from Run to Replay (to replay recorded data). The output should look like this:
Please sign in to leave a comment.