Ambit App Compiler

/***HEADER***/ print = 0 myCounter = 0 estimateScreen = 0 /***ENDHEADER***/ /* While in sport mode do this once per second*/ /* Make user run 1 km before any estimation is given, show the duration to estimate*/ if((SUUNTO_DISTANCE < 1) && (estimateScreen == 0)){ print = ((1-SUUNTO_DISTANCE)*1000)/(SUUNTO_AVG_SPD*1000/3600); prefix = "Run"; postfix = "h"; } if ((SUUNTO_DISTANCE >= 1) && (estimateScreen == 0)){ estimateScreen = 1; myCounter = 0; } /*Now when user have ran more than 1km*/ /*Scroll through the different time estimation screens*/ if ((estimateScreen == 1) && (myCounter >= 2)){ print = SUUNTO_DURATION * Suunto.pow((5000/(SUUNTO_DISTANCE*1000)), 1.06); prefix = "5K"; myCounter = 0; estimateScreen = 2; } if ((estimateScreen == 2) && (myCounter >=2)){ print = SUUNTO_DURATION * Suunto.pow((10000/(SUUNTO_DISTANCE*1000)), 1.06); prefix = "10K"; myCounter = 0; estimateScreen = 3; } if ((estimateScreen == 3) && (myCounter >=2)){ print = SUUNTO_DURATION * Suunto.pow((21097/(SUUNTO_DISTANCE*1000)), 1.06); prefix = "1/2 M"; myCounter = 0; estimateScreen = 4; } if ((estimateScreen == 4) && (myCounter >=2)){ print = SUUNTO_DURATION * Suunto.pow((42195/(SUUNTO_DISTANCE*1000)), 1.06); prefix = "Mara"; myCounter = 0; estimateScreen = 1; } myCounter = myCounter+1; RESULT = print;