function reload() {
    settings = require("Storage").readJSON("gpsrec.json",1)||{};
    settings.period = settings.period||10;
    settings.file |= 0;

    Bangle.removeListener('GPS',onGPS);
    var gOn = false;
    if (settings.recording) {
      WIDGETS["gpsrec"].width = 24;
      Bangle.on('GPS', onGPS);
      var n = settings.file.toString(36);
      gpsTrack = require("Storage").open(".gpsrc"+n,"a");
      gOn = true;
    } else {
      WIDGETS["gpsrec"].width = 0;
      gpsTrack = undefined;
    }
    if (gOn != gpsOn) {
      Bangle.setGPSPower(gOn,"gpsrec");
      gpsOn = gOn;
    }
  }
// Called by the GPS app to reload settings and decide what to do
Called by the GPS app to reload settings and decide what to do
Called by the GPS app to reload settings and decide what to do
function reload() {
    settings = require("Storage").readJSON("gpsrec.json",1)||{};
    settings.period = settings.period||10;
    settings.file |= 0;
    Bangle.removeListener('GPS',onGPS);
    var gOn = false;
    if (settings.recording) {
      WIDGETS["gpsrec"].width = 24;
      Bangle.on('GPS', onGPS);
      var n = settings.file.toString(36);
      gpsTrack = require("Storage").open(".gpsrc"+n,"a");
      gOn = true;
    } else {
      WIDGETS["gpsrec"].width = 0;
      gpsTrack = undefined;
    }
    if (gOn != gpsOn) {
      Bangle.setGPSPower(gOn,"gpsrec");
      gpsOn = gOn;
    }
  }
function reload ( ) { settings = require ( "Storage" ) . readJSON ( "gpsrec.json" , 1 ) || { } ; settings . period = settings . period || 10 ; settings . file |= 0 ; Bangle . removeListener ( 'GPS' , onGPS ) ; var gOn = false ; if ( settings . recording ) { WIDGETS [ "gpsrec" ] . width = 24 ; Bangle . on ( 'GPS' , onGPS ) ; var n = settings . file . toString ( 36 ) ; gpsTrack = require ( "Storage" ) . open ( ".gpsrc" + n , "a" ) ; gOn = true ; } else { WIDGETS [ "gpsrec" ] . width = 0 ; gpsTrack = undefined ; } if ( gOn != gpsOn ) { Bangle . setGPSPower ( gOn , "gpsrec" ) ; gpsOn = gOn ; } }
Called by the GPS app to reload settings and decide what to do
Called by the GPS app to reload settings and decide what to do