[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:
Victor Woeltjen 2014-12-31 13:43:47 -08:00
parent ad4c5849c1
commit d6f6fa6b6c
3 changed files with 78 additions and 0 deletions

1
.gitignore vendored
View File

@ -4,6 +4,7 @@
*.tgz
*.DS_Store
*.idea
*.sass-cache
# External dependencies

View 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" ]
}
]
}
}

View 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;
}
);