From 6c1412784b99e21a35d412c28e1914496648cbf1 Mon Sep 17 00:00:00 2001 From: Henry Date: Fri, 20 May 2016 17:08:23 -0700 Subject: [PATCH] [Example] REMS heirarchy appear as links --- example/msl/src/RemsTelemetryModelProvider.js | 20 +++++++++++++------ 1 file changed, 14 insertions(+), 6 deletions(-) diff --git a/example/msl/src/RemsTelemetryModelProvider.js b/example/msl/src/RemsTelemetryModelProvider.js index cf45b22d4e..c3f6f45374 100644 --- a/example/msl/src/RemsTelemetryModelProvider.js +++ b/example/msl/src/RemsTelemetryModelProvider.js @@ -45,11 +45,12 @@ define( function buildTaxonomy(dictionary){ var models = {}; - function addMeasurement(measurement){ + function addMeasurement(measurement, parent){ var format = FORMAT_MAPPINGS[measurement.type]; models[makeId(measurement)] = { type: "msl.measurement", name: measurement.name, + location: parent, telemetry: { key: measurement.identifier, ranges: [{ @@ -62,17 +63,24 @@ define( }; } - function addInstrument(subsystem) { - var measurements = (subsystem.measurements || []); - models[makeId(subsystem)] = { + function addInstrument(subsystem, spacecraftId) { + var measurements = (subsystem.measurements || []), + instrumentId = makeId(subsystem); + + models[instrumentId] = { type: "msl.instrument", name: subsystem.name, + location: spacecraftId, composition: measurements.map(makeId) }; - measurements.forEach(addMeasurement); + measurements.forEach(function(measurement) { + addMeasurement(measurement, instrumentId); + }); } - (dictionary.instruments || []).forEach(addInstrument); + (dictionary.instruments || []).forEach(function(instrument) { + addInstrument(instrument, "msl:curiosity"); + }); return models; }