var myInfo = Activity.getActivityInfo();
var mDIST_M = 0.0; if (myInfo has :elapsedDistance) { if (myInfo.elapsedDistance != null) { mDIST_M = myInfo.elapsedDistance; } }
System.println("Distance: " + mDIST_M);
var myInfo = Activity.getActivityInfo();
var mDIST_M = 0.0; if (myInfo has :elapsedDistance) { if (myInfo.elapsedDistance != null) { mDIST_M = myInfo.elapsedDistance; } }
System.println("Distance: " + mDIST_M);
1) What simulated device are you using?
2) What operating system are you using (Windows or Mac)? (I assume Windows)
3) What kind of CIQ app type are you testing: data field, device app, or watchface?
4) How are you generating the distance data for testing: simulated data or FIT file playback?
5) Are your device definitions up to date? If you are having a problem that affects multiple SDK releases, one common factor is they would all be using the same device definition.
I just tried the following without any problems:
- SDK 7.3.1, Windows
- Simple data field that returns info.elapsedDistance from compute(). (info is the first argument to compute() and is ofc typed as Activity.Info.)
- Both data simulation and FIT file playback
- Both fr955 and edge1050 devices
EDGE 1050, Windows 11, VSC (latest), simulated (not playback). The field works fine in the wild, not not in VSC. It sounds like somehow my VSC install got corrupted. But other simulated sensors are working. Weird.
It sounds like somehow my VSC install got corrupted.
That seems like the least likely possibility to me, considering that it's possible to launch and run an app in the sim without using VS Code (and the Monkey C extension) at all, unless the Monkey C extension is adding a special "please break distance simulation" flag to the simulator command line.
Have you tried playing back a FIT file instead? How about non-Edge devices?
Either way, I would file (another) bug report for this.