Added status support to plots

This commit is contained in:
Henry
2016-07-25 16:55:27 -04:00
parent a4f6f6f50b
commit 1b7fc57d21
3 changed files with 15 additions and 2 deletions

View File

@ -35,6 +35,7 @@ define(
this.boundsListener = this.boundsListener.bind(this); this.boundsListener = this.boundsListener.bind(this);
this.timeSystemListener = this.timeSystemListener.bind(this); this.timeSystemListener = this.timeSystemListener.bind(this);
this.followListener = this.followListener.bind(this);
} }
ConductorRepresenter.prototype.boundsListener = function (bounds) { ConductorRepresenter.prototype.boundsListener = function (bounds) {
@ -51,7 +52,11 @@ define(
start: bounds.start, start: bounds.start,
end: bounds.end, end: bounds.end,
domain: timeSystem.metadata.key domain: timeSystem.metadata.key
}); }, this.conductor.follow());
};
ConductorRepresenter.prototype.followListener = function () {
this.boundsListener(this.conductor.bounds());
}; };
// Handle a specific representation of a specific domain object // Handle a specific representation of a specific domain object
@ -61,6 +66,7 @@ define(
this.conductor.on("bounds", this.boundsListener); this.conductor.on("bounds", this.boundsListener);
this.conductor.on("timeSystem", this.timeSystemListener); this.conductor.on("timeSystem", this.timeSystemListener);
this.conductor.on("follow", this.followListener)
} }
}; };

View File

@ -82,7 +82,7 @@
ng-mousemove="subplot.hover($event)" ng-mousemove="subplot.hover($event)"
mct-drag="subplot.continueDrag($event)" mct-drag="subplot.continueDrag($event)"
mct-drag-down="subplot.startDrag($event)" mct-drag-down="subplot.startDrag($event)"
mct-drag-up="subplot.endDrag($event); plot.update()"> mct-drag-up="subplot.endDrag($event); plot.update();">
</mct-chart> </mct-chart>
<!-- TODO: Move into correct position; make part of group; infer from set of actions --> <!-- TODO: Move into correct position; make part of group; infer from set of actions -->
<div class="l-local-controls gl-plot-local-controls t-plot-display-controls" <div class="l-local-controls gl-plot-local-controls t-plot-display-controls"

View File

@ -239,6 +239,7 @@ define(
setBasePanZoom(bounds); setBasePanZoom(bounds);
requery(); requery();
} }
self.updateStatus($scope.domainObject, follow);
} }
this.modeOptions = new PlotModeOptions([], subPlotFactory); this.modeOptions = new PlotModeOptions([], subPlotFactory);
@ -369,6 +370,12 @@ define(
return this.pending; return this.pending;
}; };
PlotController.prototype.updateStatus = function (domainObject, follow) {
if (domainObject.hasCapability('status')) {
domainObject.getCapability('status').set('timeconductor-unsynced', follow && this.isZoomed());
}
};
return PlotController; return PlotController;
} }
); );