Field that works in the simulator but not on the watch. What can i do?

Former Member
Former Member
The field just does not work and i have tried some logging but don't get any output in the LOGS folder.

The field is available here:
https://apps.garmin.com/sv-SE/apps/5906158a-3dd9-4f7d-8a5d-cba07f8e7d45
The PRG is also attached. Source code is also attached.


Environment:
Firmware 3.0.7
ConnectiIQ SDK 1.1.0
OSX
  • You won't get any output to the LOGS folder unless you create appropriately named files in there. You need CIQ_LOG.txt for crash logs and {appname}.txt to capture the output from the Sys.println() and Sys.print() methods. Did you do this?

    Travis
  • Former Member
    Former Member over 10 years ago
    You won't get any output to the LOGS folder unless you create appropriately named files in there. You need CIQ_LOG.txt for crash logs and {appname}.txt to capture the output from the Sys.println() and Sys.print() methods. Did you do this?

    Travis


    Thanks i did that now. I get to one of the constructors but never reach the end of it. The code there is not dependent on anything from the outside.
    SuperPulseApp ## used:11077 ## free:72792: AppVersion: 1.4
    SuperPulseApp ## used:11141 ## free:77952: AppVersion: 1.4
    SuperPulseApp ## used:11297 ## free:79376: AppVersion: 1.5
    SuperPulseApp ## used:11390 ## free:72424: AppVersion: 1.5
    SuperPulseField ## used:12190 ## free:71576: initialize
    ScalableTextDrawer ## used:12758 ## free:70632: initialize
    VirtualDisplay ## used:13646 ## free:69600: initialize


    class VirtualDisplay {

    var log;
    var dim;
    var targetRect;
    var pxlDim;

    function initialize() {
    self.log = new Log("VirtualDisplay");
    self.log.log("initialize");
    self.dim = new Dimension(0, 0);
    self.targetRect = new Rectangle(0, 0, 0, 0);
    self.pxlDim = new Dimension(0, 0);
    self.log.log("initialize finished");
    }

    function update(width, height, targetBounds) {
    self.dim.set(width, height);
    self.targetRect.set(targetBounds.x, targetBounds.y, targetBounds.width, targetBounds.height);
    self.updatePixelDimensions();
    }

    function updatePixelDimensions() {

    var pixelWidth = self.targetRect.width / self.dim.width;
    var pixelHeight = self.targetRect.height / self.dim.height;

    self.pxlDim.set(pixelWidth, pixelHeight);
    }

    function getPixel(point, returnPixel) {

    var xpos = point.x * self.pxlDim.width + self.targetRect.x;
    var ypos = point.y * self.pxlDim.height + self.targetRect.y;

    returnPixel.set(xpos, ypos, self.pxlDim.width, self.pxlDim.height);
    }

    }
  • Looks like it is having trouble with the initialize() method for Rectangle or Dimension. Have you tried logging around creating those objects and in their initialize() methods?
  • Former Member
    Former Member over 10 years ago
    You won't get any output to the LOGS folder unless you create appropriately named files in there. You need CIQ_LOG.txt for crash logs and {appname}.txt to capture the output from the Sys.println() and Sys.print() methods. Did you do this?

    Travis


    Hi Travis,

    How did you learn this? I've not seen it anywhere in the documentation I have access to, so I'm hoping I didn't simply miss it and that there is a secret set of documentation with even more tips somewhere! I've been suffering while trying to diagnose differences between simulator and hardware (of which there are a surprising number) and this tip is a major step forward for me in the "retro 80s" world of println debugging/development available in ConnectIQ.

    Thanks so much for sharing it!

    Chad
  • The information was released with this post. The information has spread to a few other posts on the forums, but I haven't seen it in any official documentation. It should probably go in the programmers guide.