Compare commits

...

2 Commits

Author SHA1 Message Date
akhenry
407e9dd11b Clear all data on bounds change 2018-10-02 07:51:05 -07:00
akhenry
bc297f1fc3 Implement basic plot synchronization 2018-07-23 01:49:31 -07:00
4 changed files with 17 additions and 5 deletions

View File

@@ -161,10 +161,13 @@
the-x-axis="xAxis"
the-y-axis="yAxis">
</mct-chart>
<div class="h-local-controls h-local-controls-overlay-content"
ng-show="plotHistory.length">
<div class="l-btn-set">
<a class="s-button icon-brackets"
ng-click="plot.syncConductor()"
title="Synchronize Time Conductor to plot bounds">
</a>
<a class="s-button icon-arrow-left"
ng-click="plot.back()"
title="Restore previous pan/zoom">

View File

@@ -33,12 +33,13 @@ define([
* It supports pan and zoom, implements zoom history, and supports locating
* values near the cursor.
*/
function MCTPlotController($scope, $element, $window) {
function MCTPlotController($scope, $element, $window, openmct) {
this.$scope = $scope;
this.$scope.config = this.config;
this.$scope.plot = this;
this.$element = $element;
this.$window = $window;
this.openmct = openmct;
this.xScale = new LinearScale(this.config.xAxis.get('displayRange'));
this.yScale = new LinearScale(this.config.yAxis.get('displayRange'));
@@ -358,6 +359,13 @@ define([
this.$scope.$emit('user:viewport:change:end');
};
MCTPlotController.prototype.syncConductor = function () {
var xDisplayRange = this.config.xAxis.get('displayRange');
this.openmct.time.stopClock();
this.openmct.time.bounds({start: xDisplayRange.min, end: xDisplayRange.max});
};
MCTPlotController.prototype.destroy = function () {
this.stopListening();
};

View File

@@ -33,7 +33,7 @@ define([
return {
restrict: "E",
template: PlotTemplate,
controller: MCTPlotController,
controller: ['$scope', '$element', '$window', 'openmct', MCTPlotController],
controllerAs: 'mctPlotController',
bindToController: {
config: "="

View File

@@ -159,15 +159,16 @@ define([
PlotController.prototype.loadMoreData = function (range, purge) {
this.config.series.map(function (plotSeries) {
this.startLoading();
plotSeries.reset();
plotSeries.load({
size: this.$element[0].offsetWidth,
start: range.min,
end: range.max
})
.then(this.stopLoading.bind(this));
if (purge) {
/*if (purge) {
plotSeries.purgeRecordsOutsideRange(range);
}
}*/
}, this);
};