mirror of
https://github.com/nasa/openmct.git
synced 2025-06-13 04:38:15 +00:00
[Autoflow] Bring in example taxonomy
Bring in example taxonomy and gitignore changes from topic branch for WTD-614 into open-source-friendly branch, in preparation to merge.
This commit is contained in:
48
example/taxonomy/src/ExampleTaxonomyModelProvider.js
Normal file
48
example/taxonomy/src/ExampleTaxonomyModelProvider.js
Normal file
@ -0,0 +1,48 @@
|
||||
/*global define*/
|
||||
|
||||
define(
|
||||
[],
|
||||
function () {
|
||||
"use strict";
|
||||
|
||||
function ExampleTaxonomyModelProvider($q) {
|
||||
var models = {},
|
||||
packetId,
|
||||
telemetryId,
|
||||
i,
|
||||
j;
|
||||
|
||||
// Add some "subsystems"
|
||||
for (i = 0; i < 3; i += 1) {
|
||||
packetId = "examplePacket" + i;
|
||||
|
||||
models[packetId] = {
|
||||
name: "Stub Subsystem " + (i + 1),
|
||||
type: "telemetry.panel",
|
||||
composition: []
|
||||
};
|
||||
|
||||
// Add some "telemetry points"
|
||||
for (j = 0; j < 100 * (i + 1); j += 1) {
|
||||
telemetryId = "exampleTelemetry" + j;
|
||||
models[telemetryId] = {
|
||||
name: "SWG" + i + "." + j,
|
||||
type: "generator",
|
||||
telemetry: {
|
||||
period: 10 + i + j
|
||||
}
|
||||
};
|
||||
models[packetId].composition.push(telemetryId);
|
||||
}
|
||||
}
|
||||
|
||||
return {
|
||||
getModels: function () {
|
||||
return $q.when(models);
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
return ExampleTaxonomyModelProvider;
|
||||
}
|
||||
);
|
Reference in New Issue
Block a user