Merged mode-specific defaults, with some refactoring

This commit is contained in:
Henry
2016-08-03 19:57:03 -07:00
8 changed files with 47 additions and 17 deletions

View File

@ -38,16 +38,6 @@ define(['../../../platform/features/conductor-v2/conductor/src/timeSystems/Local
}
LADTickSource.prototype = Object.create(LocalClock.prototype);
LADTickSource.prototype.tick = function () {
console.log('data tick');
var now = Date.now();
this.listeners.forEach(function (listener){
listener(now);
});
this.timeoutHandle = this.$timeout(this.tick.bind(this), this.period);
};
LADTickSource.prototype.type = function () {
return 'data';
};

View File

@ -26,6 +26,7 @@ define([
'./LADTickSource'
], function (TimeSystem, LocalClock, LADTickSource) {
var FIFTEEN_MINUTES = 15 * 60 * 1000,
THIRTY_MINUTES = 30 * 60 * 1000,
DEFAULT_PERIOD = 1000;
/**
@ -71,8 +72,16 @@ define([
{
key: 'local-default',
name: 'Local 12 hour time system defaults',
mode: 'fixed',
deltas: {start: FIFTEEN_MINUTES, end: 0},
bounds: {start: now - FIFTEEN_MINUTES, 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}
}
];
};