123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174 |
- define([
- '../Core/Clock',
- '../Core/defaultValue',
- '../Core/defined',
- '../Core/defineProperties',
- '../Core/DeveloperError',
- '../Core/Event',
- '../Core/JulianDate',
- './createPropertyDescriptor'
- ], function(
- Clock,
- defaultValue,
- defined,
- defineProperties,
- DeveloperError,
- Event,
- JulianDate,
- createPropertyDescriptor) {
- "use strict";
-
- var DataSourceClock = function() {
- this._startTime = undefined;
- this._stopTime = undefined;
- this._currentTime = undefined;
- this._clockRange = undefined;
- this._clockStep = undefined;
- this._multiplier = undefined;
- this._definitionChanged = new Event();
- };
- defineProperties(DataSourceClock.prototype, {
-
- definitionChanged : {
- get : function() {
- return this._definitionChanged;
- }
- },
-
- startTime : createPropertyDescriptor('startTime'),
-
- stopTime : createPropertyDescriptor('stopTime'),
-
- currentTime : createPropertyDescriptor('currentTime'),
-
- clockRange : createPropertyDescriptor('clockRange'),
-
- clockStep : createPropertyDescriptor('clockStep'),
-
- multiplier : createPropertyDescriptor('multiplier')
- });
-
- DataSourceClock.prototype.clone = function(result) {
- if (!defined(result)) {
- result = new DataSourceClock();
- }
- result.startTime = this.startTime;
- result.stopTime = this.stopTime;
- result.currentTime = this.currentTime;
- result.clockRange = this.clockRange;
- result.clockStep = this.clockStep;
- result.multiplier = this.multiplier;
- return result;
- };
-
- DataSourceClock.prototype.equals = function(other) {
- return this === other ||
- defined(other) &&
- JulianDate.equals(this.startTime, other.startTime) &&
- JulianDate.equals(this.stopTime, other.stopTime) &&
- JulianDate.equals(this.currentTime, other.currentTime) &&
- this.clockRange === other.clockRange &&
- this.clockStep === other.clockStep &&
- this.multiplier === other.multiplier;
- };
-
- DataSourceClock.prototype.merge = function(source) {
-
- if (!defined(source)) {
- throw new DeveloperError('source is required.');
- }
-
- this.startTime = defaultValue(this.startTime, source.startTime);
- this.stopTime = defaultValue(this.stopTime, source.stopTime);
- this.currentTime = defaultValue(this.currentTime, source.currentTime);
- this.clockRange = defaultValue(this.clockRange, source.clockRange);
- this.clockStep = defaultValue(this.clockStep, source.clockStep);
- this.multiplier = defaultValue(this.multiplier, source.multiplier);
- };
-
- DataSourceClock.prototype.getValue = function(result) {
- if (!defined(result)) {
- result = new Clock();
- }
- result.startTime = this.startTime;
- result.stopTime = this.stopTime;
- result.clockRange = this.clockRange;
- result.clockStep = this.clockStep;
- result.multiplier = this.multiplier;
- result.currentTime = this.currentTime;
- return result;
- };
- return DataSourceClock;
- });
|