mirror of
https://github.com/nasa/openmct.git
synced 2025-02-20 17:33:23 +00:00
[Plot] Get/set from overlay switcher
Get/set mode from the plot mode switcher; only show the switcher if there is more than one mode available (which should only occur when there is more than one telemetry object in the plot.) WTD-625.
This commit is contained in:
parent
3a0e80d360
commit
01f1a92d09
@ -85,6 +85,7 @@
|
||||
</a>
|
||||
|
||||
<div class="menu-element btn icon-btn very-subtle btn-menu dropdown click-invoke"
|
||||
ng-if="plot.getModeOptions().length > 1"
|
||||
ng-controller="ClickAwayController as toggle">
|
||||
|
||||
<span ng-click="toggle.toggle()">
|
||||
|
@ -306,14 +306,27 @@ define(
|
||||
panZoomStack.clearPanZoom();
|
||||
updateDrawingBounds();
|
||||
},
|
||||
/**
|
||||
* Get the mode options (Stacked/Overlaid) that are applicable
|
||||
* for this plot.
|
||||
*/
|
||||
getModeOptions: function () {
|
||||
return modeOptions && modeOptions.getModeOptions();
|
||||
},
|
||||
/**
|
||||
* Get the current mode that is applicable to this plot. This
|
||||
* will include key, name, and glyph fields.
|
||||
*/
|
||||
getMode: function () {
|
||||
return modeOptions && modeOptions.getModeOptions()[0];
|
||||
return modeOptions && modeOptions.getMode();
|
||||
},
|
||||
/**
|
||||
* Set the mode which should be active in this plot.
|
||||
* @param mode one of the mode options returned from
|
||||
* getModeOptions()
|
||||
*/
|
||||
setMode: function (mode) {
|
||||
console.log(mode);
|
||||
return modeOptions && modeOptions.setMode(mode);
|
||||
}
|
||||
|
||||
};
|
||||
|
@ -18,15 +18,19 @@ define(
|
||||
|
||||
function PlotModeOptions(telemetryObjects) {
|
||||
var options = telemetryObjects.length > 1 ?
|
||||
[ STACKED, OVERLAID ] : [ OVERLAID, STACKED ];
|
||||
[ OVERLAID, STACKED ] : [ OVERLAID ],
|
||||
mode = options[0];
|
||||
|
||||
|
||||
return {
|
||||
getModeOptions: function () {
|
||||
return options;
|
||||
},
|
||||
getMode: function (option) {
|
||||
|
||||
getMode: function () {
|
||||
return mode;
|
||||
},
|
||||
setMode: function (option) {
|
||||
mode = option;
|
||||
}
|
||||
};
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user