Hi all,
In the Simulation environment, I am trying a create an app with simple datafields from feeds from multiple sensors - I am hoping that both fields will be displayed when I select '2 data fields' in the simulator settings. However, that doesn't appear to be the case. More specifically, my pseudo-code is shown below. The code compiles without errors, but when no UI is shown when I tried to run it (no error either). Please advise. Many thanks in advance :).
class HRField extends Ui.SimpleDataField
{
var mSensor;
function initialize(sensor) {
label = "Heart rate";
mSensor = sensor;
}
function compute() {
return mSensor.getCurrentHeartRate();
}
}
class MO2Field extends Ui.SimpleDataField
{
var mSensor;
function initialize(sensor) {
label = "MO2";
mSensor = sensor;
}
function compute() {
return mSensor.data.currentHemoPercent;
}
}
class AllFields extends App.AppBase
{
var mSensor;
var mSensorTwo;
function onStart()
{
mSensor = new HeartRateSensor();
mSensor.open();
mSensorTwo = new MO2Sensor();
mSensorTwo.open();
}
function getInitialView()
{
return [new HRField(mSensor), new MO2Field(mSensorTwo)];
}
function onStop()
{
return false;
}
}