mirror of
https://github.com/nasa/openmct.git
synced 2024-12-19 21:27:52 +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:
parent
ad4c5849c1
commit
d6f6fa6b6c
1
.gitignore
vendored
1
.gitignore
vendored
@ -4,6 +4,7 @@
|
||||
*.tgz
|
||||
*.DS_Store
|
||||
*.idea
|
||||
*.sass-cache
|
||||
|
||||
# External dependencies
|
||||
|
||||
|
29
example/taxonomy/bundle.json
Normal file
29
example/taxonomy/bundle.json
Normal file
@ -0,0 +1,29 @@
|
||||
{
|
||||
"name": "Example taxonomy",
|
||||
"description": "Example illustrating the addition of a static top-level hierarchy",
|
||||
"extensions": {
|
||||
"roots": [
|
||||
{
|
||||
"id": "exampleTaxonomy",
|
||||
"model": {
|
||||
"type": "folder",
|
||||
"name": "Stub Subsystems",
|
||||
"composition": [
|
||||
"examplePacket0",
|
||||
"examplePacket1",
|
||||
"examplePacket2"
|
||||
]
|
||||
}
|
||||
}
|
||||
],
|
||||
"components": [
|
||||
{
|
||||
"provides": "modelService",
|
||||
"type": "provider",
|
||||
"implementation": "ExampleTaxonomyModelProvider.js",
|
||||
"depends": [ "$q" ]
|
||||
}
|
||||
]
|
||||
|
||||
}
|
||||
}
|
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;
|
||||
}
|
||||
);
|
Loading…
Reference in New Issue
Block a user