Skip to content

Commit

Permalink
[Examples] Add Kerbal Space Program as telemetry source
Browse files Browse the repository at this point in the history
Resolves issue nasa#1064. Used example code from Telemetry tutorial and
converted for use by Kerbal Space Program's Telemachus plugin.

Note that websockets in Telemachus are non-operational (see
KSP-Telemachus/Telemachus#74). The HTTP
API was used instead, polling every second.
  • Loading branch information
David Hudson committed Aug 27, 2016
1 parent 4091e9c commit a7080ca
Show file tree
Hide file tree
Showing 7 changed files with 1,046 additions and 0 deletions.
82 changes: 82 additions & 0 deletions example/kerbal/bundle.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,82 @@
define([
'legacyRegistry'
], function (legacyRegistry) {
legacyRegistry.register("example/kerbal", {
"name": "Kerbal Telemetry Adapter",
"extensions": {
"types": [
{
"name": "Spacecraft",
"key": "kerbal.spacecraft",
"glyph": "o"
},
{
"name": "Subsystem",
"key": "kerbal.subsystem",
"glyph": "o",
"model": {"composition": []}
},
{
"name": "Measurement",
"key": "kerbal.measurement",
"glyph": "T",
"model": {"telemetry": {}},
"telemetry": {
"source": "kerbal.source",
"domains": [
{
"name": "Time",
"key": "timestamp"
}
]
}
}
],
"roots": [
{
"id": "kerbal:sc",
"priority": "preferred",
"model": {
"type": "kerbal.spacecraft",
"name": "My Spacecraft",
"composition": []
}
}
],
"services": [
{
"key": "kerbal.adapter",
"implementation": "KerbalTelemetryServerAdapter.js",
"depends": ["$q", "$http", "$interval", "KERBAL_HTTP_API_URL"]
}
],
"constants": [
{
"key": "KERBAL_HTTP_API_URL",
"priority": "fallback",
"value": "http://localhost:8085/telemachus/datalink"
}
],
"runs": [
{
"implementation": "KerbalTelemetryInitializer.js",
"depends": ["kerbal.adapter", "objectService"]
}
],
"components": [
{
"provides": "modelService",
"type": "provider",
"implementation": "KerbalTelemetryModelProvider.js",
"depends": ["kerbal.adapter", "$q"]
},
{
"provides": "telemetryService",
"type": "provider",
"implementation": "KerbalTelemetryProvider.js",
"depends": ["kerbal.adapter", "$q"]
}
]
}
});
});
Loading

0 comments on commit a7080ca

Please sign in to comment.