I'm trying to create data field for my forerunner 920XT with settings that can be changed via Garmin Express or via Garmin Connect app.
I'm using SDK 1.2.4, I updated the Eclipse plugin to the latest and on the simulator when I do Edit Object Store I do see all properties.
In the App itself I also manage to retrieve them (using getProperty) but never see the option to change the settings (neither in Garmin Express nor in Garmin connect app).
Following is the App and the View, what do I miss?
Thanks,
Daniel
class TRIMPv2App extends App.AppBase {
function initialize() {
AppBase.initialize();
}
//! onStart() is called on application start up
function onStart() {
}
//! onStop() is called when your application is exiting
function onStop() {
}
//! Return the initial view of your application here
function getInitialView() {
var app = App.getApp();
var minHrr = app.getProperty("minHeartRate");
var maxHrr = app.getProperty("maxHeartRate");
return [ new TRIMPv2View(minHrr, maxHrr) ];
}
}
class TRIMPv2View extends Ui.SimpleDataField {
hidden var minHeartRate;
hidden var maxHeartRate;
hidden var HeartRateReserve;
//! Set the label of the data field here.
function initialize(minHrr, maxHrr) {
SimpleDataField.initialize();
label = "%Hrr";
minHeartRate = minHrr.toFloat();
maxHeartRate = maxHrr.toFloat();
HeartRateReserve = (maxHrr - minHrr).toFloat();
}
//! The given info object contains all the current workout
//! information. Calculate a value and return it in this method.
function compute(info) {
// See Activity.Info in the documentation for available information.
if (info.elapsedTime == null) {
return ("---");
}
if (info.currentHeartRate == null) {
return ("No HR");
}
if (info.currentHeartRate < minHeartRate) {
return ("HR too low");
}
var pHRr = (info.currentHeartRate.toFloat() - minHeartRate)/HeartRateReserve;
return (pHRr);
}
}