mirror of
https://github.com/nasa/openmct.git
synced 2025-06-15 05:38:12 +00:00
[Plot] Fix bug for panels
Fix bug wherein number of points-to-plot is misreported with multiple traces in a plot; clean up on modifications to plot to self-cache streaming telemetry, to remove other cache, WTD-751.
This commit is contained in:
@ -34,6 +34,7 @@ define(
|
|||||||
var subPlotFactory = new SubPlotFactory(telemetryFormatter),
|
var subPlotFactory = new SubPlotFactory(telemetryFormatter),
|
||||||
modeOptions = new PlotModeOptions([], subPlotFactory),
|
modeOptions = new PlotModeOptions([], subPlotFactory),
|
||||||
subplots = [],
|
subplots = [],
|
||||||
|
cachedObjects = [],
|
||||||
updater,
|
updater,
|
||||||
subscription,
|
subscription,
|
||||||
domainOffset;
|
domainOffset;
|
||||||
@ -56,10 +57,13 @@ define(
|
|||||||
// Set up available modes (stacked/overlaid), based on the
|
// Set up available modes (stacked/overlaid), based on the
|
||||||
// set of telemetry objects in this plot view.
|
// set of telemetry objects in this plot view.
|
||||||
function setupModes(telemetryObjects) {
|
function setupModes(telemetryObjects) {
|
||||||
modeOptions = new PlotModeOptions(
|
if (cachedObjects !== telemetryObjects) {
|
||||||
telemetryObjects || [],
|
cachedObjects = telemetryObjects;
|
||||||
subPlotFactory
|
modeOptions = new PlotModeOptions(
|
||||||
);
|
telemetryObjects || [],
|
||||||
|
subPlotFactory
|
||||||
|
);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Update all sub-plots
|
// Update all sub-plots
|
||||||
@ -81,6 +85,7 @@ define(
|
|||||||
|
|
||||||
// Handle new telemetry data in this plot
|
// Handle new telemetry data in this plot
|
||||||
function updateValues() {
|
function updateValues() {
|
||||||
|
setupModes(subscription.getTelemetryObjects());
|
||||||
if (updater) {
|
if (updater) {
|
||||||
updater.update();
|
updater.update();
|
||||||
modeOptions.getModeHandler().plotTelemetry(updater);
|
modeOptions.getModeHandler().plotTelemetry(updater);
|
||||||
|
@ -194,7 +194,7 @@ define(
|
|||||||
* @returns {number} the number of points in this buffer
|
* @returns {number} the number of points in this buffer
|
||||||
*/
|
*/
|
||||||
getLength: function (index) {
|
getLength: function (index) {
|
||||||
return lengthArray;
|
return lengthArray[index] || 0;
|
||||||
},
|
},
|
||||||
/**
|
/**
|
||||||
* Update with latest data.
|
* Update with latest data.
|
||||||
|
Reference in New Issue
Block a user