mirror of
https://github.com/nasa/openmct.git
synced 2024-12-30 09:58:52 +00:00
Use key to retrieve default
This commit is contained in:
parent
af7954c5a1
commit
46e644e6dc
@ -67,23 +67,14 @@ define([
|
|||||||
return this._tickSources;
|
return this._tickSources;
|
||||||
};
|
};
|
||||||
|
|
||||||
LocalTimeSystem.prototype.defaults = function () {
|
LocalTimeSystem.prototype.defaults = function (key) {
|
||||||
var now = Math.ceil(Date.now() / 1000) * 1000;
|
var now = Math.ceil(Date.now() / 1000) * 1000;
|
||||||
return [
|
return {
|
||||||
{
|
key: 'local-default',
|
||||||
key: 'local-default',
|
name: 'Local 12 hour time system defaults',
|
||||||
name: 'Local 12 hour time system defaults',
|
deltas: {start: THIRTY_MINUTES, end: 0},
|
||||||
mode: 'fixed',
|
bounds: {start: now - THIRTY_MINUTES, end: now}
|
||||||
bounds: {start: now - ONE_HOUR, end: now}
|
};
|
||||||
},
|
|
||||||
{
|
|
||||||
key: 'local-default',
|
|
||||||
name: 'Local 12 hour time system defaults',
|
|
||||||
mode: 'follow',
|
|
||||||
deltas: {start: THIRTY_MINUTES, end: 0},
|
|
||||||
bounds: {start: now - THIRTY_MINUTES, end: now}
|
|
||||||
}
|
|
||||||
];
|
|
||||||
};
|
};
|
||||||
|
|
||||||
return LocalTimeSystem;
|
return LocalTimeSystem;
|
||||||
|
@ -43,16 +43,6 @@ define(
|
|||||||
this.conductor.follow(false);
|
this.conductor.follow(false);
|
||||||
};
|
};
|
||||||
|
|
||||||
FixedMode.prototype.defaults = function () {
|
|
||||||
var timeSystem = this.timeSystem();
|
|
||||||
|
|
||||||
if (timeSystem){
|
|
||||||
return timeSystem.defaults().filter(function (d) {
|
|
||||||
return d.mode === 'fixed';
|
|
||||||
})[0];
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Defines behavior to occur when selected time system changes. In
|
* Defines behavior to occur when selected time system changes. In
|
||||||
* this case, sets default bounds on the time conductor.
|
* this case, sets default bounds on the time conductor.
|
||||||
|
@ -77,16 +77,6 @@ define(
|
|||||||
return this._tickSource;
|
return this._tickSource;
|
||||||
};
|
};
|
||||||
|
|
||||||
FollowMode.prototype.defaults = function () {
|
|
||||||
var timeSystem = this.timeSystem();
|
|
||||||
|
|
||||||
if (timeSystem){
|
|
||||||
return timeSystem.defaults().filter(function (d) {
|
|
||||||
return d.mode === 'follow';
|
|
||||||
})[0];
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* On time system change, default the bounds values in the time
|
* On time system change, default the bounds values in the time
|
||||||
* conductor, using the deltas associated with this mode.
|
* conductor, using the deltas associated with this mode.
|
||||||
|
@ -63,7 +63,12 @@ define(
|
|||||||
};
|
};
|
||||||
|
|
||||||
TimeConductorMode.prototype.defaults = function () {
|
TimeConductorMode.prototype.defaults = function () {
|
||||||
throw new Error("Not implemented");
|
var timeSystem = this.timeSystem(),
|
||||||
|
key = this.key();
|
||||||
|
|
||||||
|
if (timeSystem) {
|
||||||
|
return timeSystem.defaults(key);
|
||||||
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
TimeConductorMode.prototype.destroy = function () {
|
TimeConductorMode.prototype.destroy = function () {
|
||||||
|
@ -64,23 +64,14 @@ define([
|
|||||||
return this._tickSources;
|
return this._tickSources;
|
||||||
};
|
};
|
||||||
|
|
||||||
UTCTimeSystem.prototype.defaults = function () {
|
UTCTimeSystem.prototype.defaults = function (key) {
|
||||||
var now = Math.ceil(Date.now() / 1000) * 1000;
|
var now = Math.ceil(Date.now() / 1000) * 1000;
|
||||||
return [
|
return {
|
||||||
{
|
key: 'utc-default',
|
||||||
key: 'utc-default',
|
name: 'UTC time system defaults',
|
||||||
name: 'UTC time system defaults',
|
deltas: {start: FIFTEEN_MINUTES, end: 0},
|
||||||
mode: 'follow',
|
bounds: {start: now - FIFTEEN_MINUTES, end: now}
|
||||||
deltas: {start: FIFTEEN_MINUTES, end: 0},
|
};
|
||||||
bounds: {start: now - FIFTEEN_MINUTES, end: now}
|
|
||||||
},
|
|
||||||
{
|
|
||||||
key: 'utc-default',
|
|
||||||
name: 'UTC time system defaults',
|
|
||||||
mode: 'fixed',
|
|
||||||
bounds: {start: now - FIFTEEN_MINUTES, end: now}
|
|
||||||
}
|
|
||||||
];
|
|
||||||
};
|
};
|
||||||
|
|
||||||
return UTCTimeSystem;
|
return UTCTimeSystem;
|
||||||
|
Loading…
Reference in New Issue
Block a user