new-plot import (#1557)

Merge of new plot
* Introduces new Plot object and view
* Removes Old Plot
* Add LAD support and state type to generators
* Removes Telemetry Panel Type
* Telemetry API Updates
* UTCFormat.parse: passthrough numbers
* TelemetryAPI: default request arguments
* TelemetryAPI: fix enum formatting
* Markup and styling to support new plots
This commit is contained in:
Pete Richards
2018-03-02 14:29:34 -08:00
committed by Andrew Henry
parent 6145843e86
commit 5726fe6313
131 changed files with 6652 additions and 8247 deletions

View File

@ -49,7 +49,7 @@ define([
this.formatter = numberFormatter;
}
if (valueMetadata.type === 'enum') {
if (valueMetadata.format === 'enum') {
this.formatter = {};
this.enumerations = valueMetadata.enumerations.reduce(function (vm, e) {
vm.byValue[e.value] = e.string;
@ -57,11 +57,16 @@ define([
return vm;
}, {byValue: {}, byString: {}});
this.formatter.format = function (value) {
return this.enumerations.byValue[value];
if (typeof value === "number") {
return this.enumerations.byValue[value] || value;
}
return value;
}.bind(this);
this.formatter.parse = function (string) {
if (typeof string === "string" && this.enumerations.hasOwnProperty(string)) {
return this.enumerations.byString[string];
if (typeof string === "string") {
if (this.enumerations.byString.hasOwnProperty(string)) {
return this.enumerations.byString[string];
}
}
return Number(string);
}.bind(this);