mirror of
https://github.com/nasa/openmct.git
synced 2024-12-19 05:07:52 +00:00
[Plot] pass persisted config in constructor
When a plot series is constructed, it checks to see if should set a default interpolation based on the persisted configuration. However, the persisted configuration wasn't available until after construction which resulted in the default value always being set. Pass the persisted configuration through the constructor to ensure the plot series can make the right decision about defaults. Fixes #2120.
This commit is contained in:
parent
04cc8f7aa2
commit
3c075b7ff2
@ -83,6 +83,7 @@ define([
|
||||
|
||||
this.listenTo(this, 'change:xKey', this.onXKeyChange, this);
|
||||
this.listenTo(this, 'change:yKey', this.onYKeyChange, this);
|
||||
this.persistedConfig = options.persistedConfig;
|
||||
|
||||
Model.apply(this, arguments);
|
||||
this.onXKeyChange(this.get('xKey'));
|
||||
@ -176,8 +177,7 @@ define([
|
||||
return;
|
||||
}
|
||||
var valueMetadata = this.metadata.value(newKey);
|
||||
var persistedConfig = this.get('persistedConfiguration');
|
||||
if (!persistedConfig || !persistedConfig.interpolate) {
|
||||
if (!this.persistedConfig || !this.persistedConfig.interpolate) {
|
||||
if (valueMetadata.format === 'enum') {
|
||||
this.set('interpolate', 'stepAfter');
|
||||
} else {
|
||||
|
@ -54,7 +54,7 @@ define([
|
||||
domainObject.configuration.series.forEach(function (seriesConfig) {
|
||||
var series = this.byIdentifier(seriesConfig.identifier);
|
||||
if (series) {
|
||||
series.set('persistedConfiguration', seriesConfig);
|
||||
series.persistedConfig = seriesConfig;
|
||||
}
|
||||
}, this);
|
||||
},
|
||||
@ -90,7 +90,9 @@ define([
|
||||
model: seriesConfig,
|
||||
domainObject: domainObject,
|
||||
collection: this,
|
||||
openmct: this.openmct
|
||||
openmct: this.openmct,
|
||||
persistedConfig: this.plot
|
||||
.getPersistedSeriesConfig(domainObject.identifier)
|
||||
}));
|
||||
},
|
||||
removeTelemetryObject: function (identifier) {
|
||||
|
Loading…
Reference in New Issue
Block a user