[Time Conductor] Fixing bugs found in smoke testing. Fixes #933

This commit is contained in:
Henry 2016-09-09 16:39:21 -07:00
parent fbab890081
commit e639e056ba
13 changed files with 44 additions and 45 deletions

View File

@ -30,7 +30,7 @@ define(['../../../platform/features/conductor-v2/conductor/src/timeSystems/Local
this.metadata = {
key: 'test-lad',
mode: 'LAD',
mode: 'lad',
cssclass: 'icon-clock',
label: 'Latest Available Data',
name: 'Latest available data',

View File

@ -25,9 +25,7 @@ define([
'../../../platform/features/conductor-v2/conductor/src/timeSystems/LocalClock',
'./LADTickSource'
], function (TimeSystem, LocalClock, LADTickSource) {
var FIFTEEN_MINUTES = 15 * 60 * 1000,
THIRTY_MINUTES = 30 * 60 * 1000,
ONE_HOUR = 60 * 60 * 1000,
var THIRTY_MINUTES = 30 * 60 * 1000,
DEFAULT_PERIOD = 1000;
/**
@ -49,14 +47,14 @@ define([
'glyph': '\u0043'
};
this._formats = ['local-format'];
this._tickSources = [new LocalClock($timeout, DEFAULT_PERIOD), new LADTickSource($timeout, DEFAULT_PERIOD)];
this.fmts = ['local-format'];
this.sources = [new LocalClock($timeout, DEFAULT_PERIOD), new LADTickSource($timeout, DEFAULT_PERIOD)];
}
LocalTimeSystem.prototype = Object.create(TimeSystem.prototype);
LocalTimeSystem.prototype.formats = function () {
return this._formats;
return this.fmts;
};
LocalTimeSystem.prototype.deltaFormat = function () {
@ -64,7 +62,7 @@ define([
};
LocalTimeSystem.prototype.tickSources = function () {
return this._tickSources;
return this.sources;
};
LocalTimeSystem.prototype.defaults = function (key) {

12
main.js
View File

@ -91,10 +91,14 @@ define([
'./platform/features/pages/bundle',
'./platform/features/plot/bundle',
'./platform/features/timeline/bundle',
// Old time conductor
//'./platform/features/conductor/bundle',
'./platform/features/conductor-v2/conductor/bundle',
'./platform/features/conductor-v2/compatibility/bundle',
'./platform/features/conductor-v2/utcTimeSystem/bundle',
// New time conductor
//'./platform/features/conductor-v2/conductor/bundle',
//'./platform/features/conductor-v2/compatibility/bundle',
//'./platform/features/conductor-v2/utcTimeSystem/bundle',
'./platform/features/table/bundle',
'./platform/forms/bundle',
'./platform/identity/bundle',
@ -106,7 +110,7 @@ define([
'./platform/search/bundle',
'./platform/status/bundle',
'./platform/commonUI/regions/bundle'
//'./example/localTimeSystem/bundle'
], function (Main, legacyRegistry) {
return {

View File

@ -59,9 +59,5 @@
</mct-representation>
</div>
</div>
<mct-include key="'time-conductor'" class="abs holder flex-elem flex-fixed l-flex-row l-time-conductor-holder"></mct-include>
<!-- <mct-representation mct-object="domainObject"
key="'time-conductor'"
class="abs holder flex-elem flex-fixed l-flex-row l-time-conductor-holder">
</mct-representation> -->
<mct-include key="'conductor'" class="abs holder flex-elem flex-fixed l-flex-row l-time-conductor-holder"></mct-include>
</div>

View File

@ -116,6 +116,7 @@ $colorProgressBarAmt: $colorKey;
$progressBarHOverlay: 15px;
$progressBarStripeW: 20px;
$shdwStatusIc: rgba(black, 0.4) 0 1px 2px;
$animPausedPulseDur: 500ms;
// Selects
$colorSelectBg: $colorBtnBg;

View File

@ -116,6 +116,7 @@ $colorProgressBarAmt: #0a0;
$progressBarHOverlay: 15px;
$progressBarStripeW: 20px;
$shdwStatusIc: rgba(white, 0.8) 0 0px 5px;
$animPausedPulseDur: 1s;
// Selects
$colorSelectBg: $colorBtnBg;

View File

@ -93,22 +93,22 @@ define([
],
"templates": [
{
"key": "time-conductor",
"key": "conductor",
"template": timeConductorTemplate
},
{
"key": "mode-menu",
"template": modeMenuTemplate
},
{
"key": "mode-selector",
"template": modeSelectorTemplate
}
],
"representations": [
{
"key": "time-conductor",
"template": timeConductorTemplate
},
{
"key": "mode-selector",
"template": modeSelectorTemplate
},
{
"key": "mode-menu",
"template": modeMenuTemplate
}
],
"formats": [

View File

@ -233,7 +233,7 @@
// Real-time, latest modes
&.realtime-mode,
&.latest-mode {
&.lad-mode {
.time-conductor-icon {
&:before { color: $colorTimeCondKeyBg; }
div[class*="hand"] {
@ -318,7 +318,7 @@
}
// LAD mode
&.latest-mode {
&.lad-mode {
$i: $glyph-icon-database;
.time-conductor-icon div[class*="hand"] {
@include animation-name(clock-hands-sticky);
@ -411,7 +411,7 @@
// Real-time, latest modes
&.realtime-mode,
&.latest-mode {
&.lad-mode {
.l-time-conductor-inputs-and-ticks {
.l-time-range-w {
&.start-w {

View File

@ -24,8 +24,8 @@
<ul>
<li ng-repeat="(key, metadata) in ngModel.options"
ng-click="ngModel.selectedKey=key">
<a ng-mouseover="representation.activeMetadata = metadata"
ng-mouseleave="representation.activeMetadata = undefined"
<a ng-mouseover="ngModel.activeMetadata = metadata"
ng-mouseleave="ngModel.activeMetadata = undefined"
class="menu-item-a {{metadata.cssclass}}">
{{metadata.name}}
</a>
@ -33,12 +33,13 @@
</ul>
</div>
<div class="pane right menu-item-description">
<div class="desc-area ui-symbol icon type-icon {{representation.activeMetadata.cssclass}}"></div>
<div
class="desc-area ui-symbol icon type-icon {{ngModel.activeMetadata.cssclass}}"></div>
<div class="desc-area title">
{{representation.activeMetadata.name}}
{{ngModel.activeMetadata.name}}
</div>
<div class="desc-area description">
{{representation.activeMetadata.description}}
{{ngModel.activeMetadata.description}}
</div>
</div>
</div>

View File

@ -27,9 +27,8 @@
</div>
<div class="menu super-menu mini mode-selector-menu"
ng-show="modeController.isActive()">
<mct-representation mct-object="domainObject"
key="'mode-menu'"
ng-model="ngModel">
</mct-representation>
<mct-include key="'mode-menu'"
ng-model="ngModel">
</mct-include>
</div>
</span>

View File

@ -83,12 +83,11 @@
<!-- Holds time system and session selectors, and zoom control -->
<div class="l-time-conductor-controls l-row-elem l-flex-row flex-elem">
<mct-representation
<mct-include
key="'mode-selector'"
mct-object="domainObject"
ng-model="modeModel"
class="holder flex-elem menus-up mode-selector">
</mct-representation>
</mct-include>
<mct-control
key="'menu-button'"
class="holder flex-elem menus-up time-system"

View File

@ -85,9 +85,9 @@ define(
}
//Only show 'LAD mode' if appropriate time systems available
if (timeSystemsForMode('LAD').length > 0) {
if (timeSystemsForMode('lad').length > 0) {
var ladMode = {
key: 'LAD',
key: 'lad',
cssclass: 'icon-database',
label: 'LAD',
name: 'LAD Mode',

View File

@ -112,7 +112,7 @@ define(['./TimeConductorViewService'], function (TimeConductorViewService) {
var mockTimeSystems = [mockConstructor(tickingTimeSystem)];
var mockLADTickSource = {
metadata: {
mode: 'LAD'
mode: 'lad'
}
};
tickingTimeSystem.tickSources.andReturn([mockLADTickSource]);
@ -120,7 +120,7 @@ define(['./TimeConductorViewService'], function (TimeConductorViewService) {
viewService = new TimeConductorViewService(mockTimeConductor, mockTimeSystems);
var availableModes = viewService.availableModes();
expect(availableModes.LAD).toBeDefined();
expect(availableModes.lad).toBeDefined();
});
describe("when mode is changed", function () {