Merge branch 'master' into csv-export-update-751
Conflicts: platform/features/timeline/bundle.js
This commit is contained in:
@@ -19,7 +19,6 @@
|
||||
* this source code distribution or the Licensing information page available
|
||||
* at runtime from the About dialog for additional information.
|
||||
*****************************************************************************/
|
||||
/*global define*/
|
||||
|
||||
define([
|
||||
"./src/indicators/ClockIndicator",
|
||||
@@ -44,7 +43,6 @@ define([
|
||||
timerTemplate,
|
||||
legacyRegistry
|
||||
) {
|
||||
"use strict";
|
||||
|
||||
legacyRegistry.register("platform/features/clock", {
|
||||
"name": "Clocks/Timers",
|
||||
|
||||
@@ -19,12 +19,10 @@
|
||||
* this source code distribution or the Licensing information page available
|
||||
* at runtime from the About dialog for additional information.
|
||||
*****************************************************************************/
|
||||
/*global define*/
|
||||
|
||||
define(
|
||||
[],
|
||||
function () {
|
||||
"use strict";
|
||||
|
||||
/**
|
||||
* Implements the "Start" and "Restart" action for timers.
|
||||
|
||||
@@ -19,12 +19,10 @@
|
||||
* this source code distribution or the Licensing information page available
|
||||
* at runtime from the About dialog for additional information.
|
||||
*****************************************************************************/
|
||||
/*global define*/
|
||||
|
||||
define(
|
||||
['./AbstractStartTimerAction'],
|
||||
function (AbstractStartTimerAction) {
|
||||
"use strict";
|
||||
|
||||
/**
|
||||
* Implements the "Restart at 0" action.
|
||||
@@ -41,7 +39,7 @@ define(
|
||||
* @param {ActionContext} context the context for this action
|
||||
*/
|
||||
function RestartTimerAction(now, context) {
|
||||
AbstractStartTimerAction.apply(this, [ now, context ]);
|
||||
AbstractStartTimerAction.apply(this, [now, context]);
|
||||
}
|
||||
|
||||
RestartTimerAction.prototype =
|
||||
@@ -49,8 +47,8 @@ define(
|
||||
|
||||
RestartTimerAction.appliesTo = function (context) {
|
||||
var model =
|
||||
(context.domainObject && context.domainObject.getModel())
|
||||
|| {};
|
||||
(context.domainObject && context.domainObject.getModel()) ||
|
||||
{};
|
||||
|
||||
// We show this variant for timers which already have
|
||||
// a target time.
|
||||
|
||||
@@ -19,12 +19,10 @@
|
||||
* this source code distribution or the Licensing information page available
|
||||
* at runtime from the About dialog for additional information.
|
||||
*****************************************************************************/
|
||||
/*global define*/
|
||||
|
||||
define(
|
||||
['./AbstractStartTimerAction'],
|
||||
function (AbstractStartTimerAction) {
|
||||
"use strict";
|
||||
|
||||
/**
|
||||
* Implements the "Start" action for timers.
|
||||
@@ -41,7 +39,7 @@ define(
|
||||
* @param {ActionContext} context the context for this action
|
||||
*/
|
||||
function StartTimerAction(now, context) {
|
||||
AbstractStartTimerAction.apply(this, [ now, context ]);
|
||||
AbstractStartTimerAction.apply(this, [now, context]);
|
||||
}
|
||||
|
||||
StartTimerAction.prototype =
|
||||
@@ -49,8 +47,8 @@ define(
|
||||
|
||||
StartTimerAction.appliesTo = function (context) {
|
||||
var model =
|
||||
(context.domainObject && context.domainObject.getModel())
|
||||
|| {};
|
||||
(context.domainObject && context.domainObject.getModel()) ||
|
||||
{};
|
||||
|
||||
// We show this variant for timers which do not yet have
|
||||
// a target time.
|
||||
|
||||
@@ -19,12 +19,10 @@
|
||||
* this source code distribution or the Licensing information page available
|
||||
* at runtime from the About dialog for additional information.
|
||||
*****************************************************************************/
|
||||
/*global define*/
|
||||
|
||||
define(
|
||||
['moment'],
|
||||
function (moment) {
|
||||
"use strict";
|
||||
|
||||
/**
|
||||
* Controller for views of a Clock domain object.
|
||||
|
||||
@@ -19,12 +19,10 @@
|
||||
* this source code distribution or the Licensing information page available
|
||||
* at runtime from the About dialog for additional information.
|
||||
*****************************************************************************/
|
||||
/*global define*/
|
||||
|
||||
define(
|
||||
[],
|
||||
function () {
|
||||
"use strict";
|
||||
|
||||
/**
|
||||
* Continually refreshes the represented domain object.
|
||||
|
||||
@@ -19,12 +19,10 @@
|
||||
* this source code distribution or the Licensing information page available
|
||||
* at runtime from the About dialog for additional information.
|
||||
*****************************************************************************/
|
||||
/*global define*/
|
||||
|
||||
define(
|
||||
['./TimerFormatter'],
|
||||
function (TimerFormatter) {
|
||||
"use strict";
|
||||
|
||||
var FORMATTER = new TimerFormatter();
|
||||
|
||||
@@ -40,8 +38,7 @@ define(
|
||||
* time (typically wrapping `Date.now`)
|
||||
*/
|
||||
function TimerController($scope, $window, now) {
|
||||
var timerObject,
|
||||
formatter,
|
||||
var formatter,
|
||||
active = true,
|
||||
relativeTimestamp,
|
||||
lastTimestamp,
|
||||
|
||||
@@ -19,12 +19,10 @@
|
||||
* this source code distribution or the Licensing information page available
|
||||
* at runtime from the About dialog for additional information.
|
||||
*****************************************************************************/
|
||||
/*global define,requirejs*/
|
||||
|
||||
define(
|
||||
['moment', 'moment-duration-format'],
|
||||
function (moment) {
|
||||
"use strict";
|
||||
|
||||
var SHORT_FORMAT = "HH:mm:ss",
|
||||
LONG_FORMAT = "d[D] HH:mm:ss";
|
||||
|
||||
@@ -19,12 +19,10 @@
|
||||
* this source code distribution or the Licensing information page available
|
||||
* at runtime from the About dialog for additional information.
|
||||
*****************************************************************************/
|
||||
/*global define*/
|
||||
|
||||
define(
|
||||
['moment'],
|
||||
function (moment) {
|
||||
"use strict";
|
||||
|
||||
/**
|
||||
* Indicator that displays the current UTC time in the status area.
|
||||
|
||||
@@ -19,12 +19,10 @@
|
||||
* this source code distribution or the Licensing information page available
|
||||
* at runtime from the About dialog for additional information.
|
||||
*****************************************************************************/
|
||||
/*global define*/
|
||||
|
||||
define(
|
||||
['moment'],
|
||||
function (moment) {
|
||||
"use strict";
|
||||
[],
|
||||
function () {
|
||||
|
||||
/**
|
||||
* Calls functions every second, as close to the actual second
|
||||
|
||||
@@ -19,12 +19,10 @@
|
||||
* this source code distribution or the Licensing information page available
|
||||
* at runtime from the About dialog for additional information.
|
||||
*****************************************************************************/
|
||||
/*global define,describe,it,expect,beforeEach,waitsFor,jasmine,window,afterEach*/
|
||||
|
||||
define(
|
||||
["../../src/actions/AbstractStartTimerAction"],
|
||||
function (AbstractStartTimerAction) {
|
||||
"use strict";
|
||||
|
||||
describe("A timer's start/restart action", function () {
|
||||
var mockNow,
|
||||
@@ -45,7 +43,7 @@ define(
|
||||
mockNow = jasmine.createSpy('now');
|
||||
mockDomainObject = jasmine.createSpyObj(
|
||||
'domainObject',
|
||||
[ 'getCapability', 'useCapability' ]
|
||||
['getCapability', 'useCapability']
|
||||
);
|
||||
mockPersistence = jasmine.createSpyObj(
|
||||
'persistence',
|
||||
|
||||
@@ -19,12 +19,10 @@
|
||||
* this source code distribution or the Licensing information page available
|
||||
* at runtime from the About dialog for additional information.
|
||||
*****************************************************************************/
|
||||
/*global define,describe,it,expect,beforeEach,waitsFor,jasmine,window,afterEach*/
|
||||
|
||||
define(
|
||||
["../../src/actions/RestartTimerAction"],
|
||||
function (RestartTimerAction) {
|
||||
"use strict";
|
||||
|
||||
describe("A timer's restart action", function () {
|
||||
var mockNow,
|
||||
@@ -46,7 +44,7 @@ define(
|
||||
mockNow = jasmine.createSpy('now');
|
||||
mockDomainObject = jasmine.createSpyObj(
|
||||
'domainObject',
|
||||
[ 'getCapability', 'useCapability', 'getModel' ]
|
||||
['getCapability', 'useCapability', 'getModel']
|
||||
);
|
||||
mockPersistence = jasmine.createSpyObj(
|
||||
'persistence',
|
||||
|
||||
@@ -19,12 +19,10 @@
|
||||
* this source code distribution or the Licensing information page available
|
||||
* at runtime from the About dialog for additional information.
|
||||
*****************************************************************************/
|
||||
/*global define,describe,it,expect,beforeEach,waitsFor,jasmine,window,afterEach*/
|
||||
|
||||
define(
|
||||
["../../src/actions/StartTimerAction"],
|
||||
function (StartTimerAction) {
|
||||
"use strict";
|
||||
|
||||
describe("A timer's start action", function () {
|
||||
var mockNow,
|
||||
@@ -46,7 +44,7 @@ define(
|
||||
mockNow = jasmine.createSpy('now');
|
||||
mockDomainObject = jasmine.createSpyObj(
|
||||
'domainObject',
|
||||
[ 'getCapability', 'useCapability', 'getModel' ]
|
||||
['getCapability', 'useCapability', 'getModel']
|
||||
);
|
||||
mockPersistence = jasmine.createSpyObj(
|
||||
'persistence',
|
||||
|
||||
@@ -19,12 +19,10 @@
|
||||
* this source code distribution or the Licensing information page available
|
||||
* at runtime from the About dialog for additional information.
|
||||
*****************************************************************************/
|
||||
/*global define,describe,it,expect,beforeEach,waitsFor,jasmine,window,afterEach*/
|
||||
|
||||
define(
|
||||
["../../src/controllers/ClockController"],
|
||||
function (ClockController) {
|
||||
"use strict";
|
||||
|
||||
// Wed, 03 Jun 2015 17:56:14 GMT
|
||||
var TEST_TIMESTAMP = 1433354174000;
|
||||
@@ -33,7 +31,6 @@ define(
|
||||
var mockScope,
|
||||
mockTicker,
|
||||
mockUnticker,
|
||||
mockDomainObject,
|
||||
controller;
|
||||
|
||||
beforeEach(function () {
|
||||
|
||||
@@ -19,12 +19,10 @@
|
||||
* this source code distribution or the Licensing information page available
|
||||
* at runtime from the About dialog for additional information.
|
||||
*****************************************************************************/
|
||||
/*global define,describe,it,expect,beforeEach,waitsFor,jasmine,window,afterEach*/
|
||||
|
||||
define(
|
||||
["../../src/controllers/RefreshingController"],
|
||||
function (RefreshingController) {
|
||||
"use strict";
|
||||
|
||||
|
||||
|
||||
@@ -47,11 +45,11 @@ define(
|
||||
it("refreshes the represented object on every tick", function () {
|
||||
var mockDomainObject = jasmine.createSpyObj(
|
||||
'domainObject',
|
||||
[ 'getCapability' ]
|
||||
['getCapability']
|
||||
),
|
||||
mockPersistence = jasmine.createSpyObj(
|
||||
'persistence',
|
||||
[ 'persist', 'refresh' ]
|
||||
['persist', 'refresh']
|
||||
);
|
||||
|
||||
mockDomainObject.getCapability.andCallFake(function (c) {
|
||||
|
||||
@@ -19,12 +19,10 @@
|
||||
* this source code distribution or the Licensing information page available
|
||||
* at runtime from the About dialog for additional information.
|
||||
*****************************************************************************/
|
||||
/*global define,describe,it,expect,beforeEach,waitsFor,jasmine,window,afterEach*/
|
||||
|
||||
define(
|
||||
["../../src/controllers/TimerController"],
|
||||
function (TimerController) {
|
||||
"use strict";
|
||||
|
||||
// Wed, 03 Jun 2015 17:56:14 GMT
|
||||
var TEST_TIMESTAMP = 1433354174000;
|
||||
@@ -59,7 +57,7 @@ define(
|
||||
);
|
||||
mockDomainObject = jasmine.createSpyObj(
|
||||
'domainObject',
|
||||
[ 'getCapability', 'useCapability', 'getModel' ]
|
||||
['getCapability', 'useCapability', 'getModel']
|
||||
);
|
||||
mockActionCapability = jasmine.createSpyObj(
|
||||
'action',
|
||||
|
||||
@@ -19,12 +19,10 @@
|
||||
* this source code distribution or the Licensing information page available
|
||||
* at runtime from the About dialog for additional information.
|
||||
*****************************************************************************/
|
||||
/*global define,describe,it,expect,beforeEach,waitsFor,jasmine,window,afterEach*/
|
||||
|
||||
define(
|
||||
["../../src/controllers/TimerFormatter"],
|
||||
function (TimerFormatter) {
|
||||
"use strict";
|
||||
|
||||
var MS_IN_SEC = 1000,
|
||||
MS_IN_MIN = MS_IN_SEC * 60,
|
||||
@@ -47,10 +45,6 @@ define(
|
||||
].reduce(sum, 0);
|
||||
}
|
||||
|
||||
function twoDigits(n) {
|
||||
return n < 10 ? ('0' + n) : n;
|
||||
}
|
||||
|
||||
it("formats short-form values (no days)", function () {
|
||||
expect(formatter.short(toDuration(0, 123, 2, 3) + 123))
|
||||
.toEqual("123:02:03");
|
||||
|
||||
@@ -19,12 +19,10 @@
|
||||
* this source code distribution or the Licensing information page available
|
||||
* at runtime from the About dialog for additional information.
|
||||
*****************************************************************************/
|
||||
/*global define,describe,it,expect,beforeEach,waitsFor,jasmine,window,afterEach*/
|
||||
|
||||
define(
|
||||
["../../src/indicators/ClockIndicator"],
|
||||
function (ClockIndicator) {
|
||||
"use strict";
|
||||
|
||||
// Wed, 03 Jun 2015 17:56:14 GMT
|
||||
var TEST_TIMESTAMP = 1433354174000,
|
||||
|
||||
@@ -19,12 +19,10 @@
|
||||
* this source code distribution or the Licensing information page available
|
||||
* at runtime from the About dialog for additional information.
|
||||
*****************************************************************************/
|
||||
/*global define,describe,it,expect,beforeEach,waitsFor,jasmine,window,afterEach*/
|
||||
|
||||
define(
|
||||
["../../src/services/TickerService"],
|
||||
function (TickerService) {
|
||||
"use strict";
|
||||
|
||||
var TEST_TIMESTAMP = 1433354174000;
|
||||
|
||||
|
||||
@@ -19,7 +19,6 @@
|
||||
* this source code distribution or the Licensing information page available
|
||||
* at runtime from the About dialog for additional information.
|
||||
*****************************************************************************/
|
||||
/*global define*/
|
||||
|
||||
define([
|
||||
"./src/ConductorRepresenter",
|
||||
@@ -34,7 +33,6 @@ define([
|
||||
timeConductorTemplate,
|
||||
legacyRegistry
|
||||
) {
|
||||
"use strict";
|
||||
|
||||
legacyRegistry.register("platform/features/conductor", {
|
||||
"extensions": {
|
||||
|
||||
@@ -19,12 +19,10 @@
|
||||
* this source code distribution or the Licensing information page available
|
||||
* at runtime from the About dialog for additional information.
|
||||
*****************************************************************************/
|
||||
/*global define*/
|
||||
|
||||
define(
|
||||
[],
|
||||
function () {
|
||||
"use strict";
|
||||
|
||||
var TEMPLATE = [
|
||||
"<mct-include key=\"'time-conductor'\" ",
|
||||
@@ -146,7 +144,7 @@ define(
|
||||
};
|
||||
|
||||
// Handle a specific representation of a specific domain object
|
||||
ConductorRepresenter.prototype.represent = function represent(representation, representedObject) {
|
||||
ConductorRepresenter.prototype.represent = function represent(representation) {
|
||||
this.destroy();
|
||||
|
||||
if (this.views.indexOf(representation) !== -1 && !GLOBAL_SHOWING) {
|
||||
|
||||
@@ -19,12 +19,10 @@
|
||||
* this source code distribution or the Licensing information page available
|
||||
* at runtime from the About dialog for additional information.
|
||||
*****************************************************************************/
|
||||
/*global define*/
|
||||
|
||||
define(
|
||||
['./TimeConductor'],
|
||||
function (TimeConductor) {
|
||||
'use strict';
|
||||
|
||||
var ONE_DAY_IN_MS = 1000 * 60 * 60 * 24,
|
||||
SIX_HOURS_IN_MS = ONE_DAY_IN_MS / 4;
|
||||
|
||||
@@ -19,11 +19,9 @@
|
||||
* this source code distribution or the Licensing information page available
|
||||
* at runtime from the About dialog for additional information.
|
||||
*****************************************************************************/
|
||||
/*global define*/
|
||||
|
||||
define(
|
||||
function () {
|
||||
'use strict';
|
||||
|
||||
/**
|
||||
* Decorates the `telemetryService` such that requests are
|
||||
@@ -59,14 +57,11 @@ define(
|
||||
};
|
||||
|
||||
ConductorTelemetryDecorator.prototype.requestTelemetry = function (requests) {
|
||||
var self = this;
|
||||
return this.telemetryService
|
||||
.requestTelemetry(this.amendRequests(requests));
|
||||
};
|
||||
|
||||
ConductorTelemetryDecorator.prototype.subscribe = function (callback, requests) {
|
||||
var self = this;
|
||||
|
||||
return this.telemetryService
|
||||
.subscribe(callback, this.amendRequests(requests));
|
||||
};
|
||||
|
||||
@@ -19,7 +19,6 @@
|
||||
* this source code distribution or the Licensing information page available
|
||||
* at runtime from the About dialog for additional information.
|
||||
*****************************************************************************/
|
||||
/*global define*/
|
||||
|
||||
/**
|
||||
* The time conductor bundle adds a global control to the bottom of the
|
||||
@@ -30,7 +29,6 @@
|
||||
*/
|
||||
define(
|
||||
function () {
|
||||
'use strict';
|
||||
|
||||
/**
|
||||
* Tracks the current state of the time conductor.
|
||||
|
||||
@@ -19,13 +19,10 @@
|
||||
* this source code distribution or the Licensing information page available
|
||||
* at runtime from the About dialog for additional information.
|
||||
*****************************************************************************/
|
||||
/*global define,describe,xdescribe,it,expect,beforeEach,
|
||||
waitsFor,afterEach,jasmine*/
|
||||
|
||||
define(
|
||||
["../src/ConductorRepresenter", "./TestTimeConductor"],
|
||||
function (ConductorRepresenter, TestTimeConductor) {
|
||||
"use strict";
|
||||
|
||||
var SCOPE_METHODS = [
|
||||
'$on',
|
||||
@@ -73,7 +70,7 @@ define(
|
||||
['getConductor']
|
||||
);
|
||||
mockCompile = jasmine.createSpy('$compile');
|
||||
testViews = [ { someKey: "some value" } ];
|
||||
testViews = [{ someKey: "some value" }];
|
||||
mockScope = jasmine.createSpyObj('scope', SCOPE_METHODS);
|
||||
mockElement = jasmine.createSpyObj('element', ELEMENT_METHODS);
|
||||
mockElement.parent.andReturn(mockElement);
|
||||
|
||||
@@ -19,12 +19,10 @@
|
||||
* this source code distribution or the Licensing information page available
|
||||
* at runtime from the About dialog for additional information.
|
||||
*****************************************************************************/
|
||||
/*global define,describe,it,expect,beforeEach,waitsFor,jasmine*/
|
||||
|
||||
define(
|
||||
["../src/ConductorService"],
|
||||
function (ConductorService) {
|
||||
"use strict";
|
||||
|
||||
var TEST_NOW = 1020304050;
|
||||
|
||||
|
||||
@@ -19,13 +19,11 @@
|
||||
* this source code distribution or the Licensing information page available
|
||||
* at runtime from the About dialog for additional information.
|
||||
*****************************************************************************/
|
||||
/*global define,describe,it,expect,beforeEach,waitsFor,jasmine*/
|
||||
|
||||
|
||||
define(
|
||||
["../src/ConductorTelemetryDecorator", "./TestTimeConductor"],
|
||||
function (ConductorTelemetryDecorator, TestTimeConductor) {
|
||||
"use strict";
|
||||
|
||||
describe("ConductorTelemetryDecorator", function () {
|
||||
var mockTelemetryService,
|
||||
@@ -35,20 +33,10 @@ define(
|
||||
mockSeries,
|
||||
decorator;
|
||||
|
||||
function seriesIsInWindow(series) {
|
||||
var i, v, inWindow = true;
|
||||
for (i = 0; i < series.getPointCount(); i += 1) {
|
||||
v = series.getDomainValue(i);
|
||||
inWindow = inWindow && (v >= mockConductor.displayStart());
|
||||
inWindow = inWindow && (v <= mockConductor.displayEnd());
|
||||
}
|
||||
return inWindow;
|
||||
}
|
||||
|
||||
beforeEach(function () {
|
||||
mockTelemetryService = jasmine.createSpyObj(
|
||||
'telemetryService',
|
||||
[ 'requestTelemetry', 'subscribe' ]
|
||||
['requestTelemetry', 'subscribe']
|
||||
);
|
||||
mockConductorService = jasmine.createSpyObj(
|
||||
'conductorService',
|
||||
@@ -61,7 +49,7 @@ define(
|
||||
);
|
||||
mockSeries = jasmine.createSpyObj(
|
||||
'series',
|
||||
[ 'getPointCount', 'getDomainValue', 'getRangeValue' ]
|
||||
['getPointCount', 'getDomainValue', 'getRangeValue']
|
||||
);
|
||||
|
||||
mockTelemetryService.requestTelemetry.andReturn(mockPromise);
|
||||
|
||||
@@ -19,12 +19,11 @@
|
||||
* this source code distribution or the Licensing information page available
|
||||
* at runtime from the About dialog for additional information.
|
||||
*****************************************************************************/
|
||||
/*global define,describe,it,expect,beforeEach,waitsFor,jasmine,spyOn*/
|
||||
|
||||
/*global spyOn*/
|
||||
define(
|
||||
["../src/TimeConductor"],
|
||||
function (TimeConductor) {
|
||||
'use strict';
|
||||
|
||||
function TestTimeConductor() {
|
||||
var self = this;
|
||||
|
||||
@@ -19,12 +19,10 @@
|
||||
* this source code distribution or the Licensing information page available
|
||||
* at runtime from the About dialog for additional information.
|
||||
*****************************************************************************/
|
||||
/*global define,describe,it,expect,beforeEach,waitsFor,jasmine*/
|
||||
|
||||
define(
|
||||
["../src/TimeConductor"],
|
||||
function (TimeConductor) {
|
||||
"use strict";
|
||||
|
||||
describe("TimeConductor", function () {
|
||||
var testStart,
|
||||
|
||||
@@ -19,7 +19,6 @@
|
||||
* this source code distribution or the Licensing information page available
|
||||
* at runtime from the About dialog for additional information.
|
||||
*****************************************************************************/
|
||||
/*global define*/
|
||||
|
||||
define([
|
||||
"./src/policies/ImageryViewPolicy",
|
||||
@@ -34,7 +33,6 @@ define([
|
||||
imageryTemplate,
|
||||
legacyRegistry
|
||||
) {
|
||||
"use strict";
|
||||
|
||||
legacyRegistry.register("platform/features/imagery", {
|
||||
"name": "Plot view for telemetry",
|
||||
|
||||
@@ -19,7 +19,6 @@
|
||||
* this source code distribution or the Licensing information page available
|
||||
* at runtime from the About dialog for additional information.
|
||||
*****************************************************************************/
|
||||
/*global define*/
|
||||
|
||||
/**
|
||||
* This bundle implements views of image telemetry.
|
||||
@@ -28,7 +27,6 @@
|
||||
define(
|
||||
['moment'],
|
||||
function (moment) {
|
||||
"use strict";
|
||||
|
||||
var DATE_FORMAT = "YYYY-MM-DD",
|
||||
TIME_FORMAT = "HH:mm:ss.SSS";
|
||||
|
||||
@@ -19,11 +19,9 @@
|
||||
* this source code distribution or the Licensing information page available
|
||||
* at runtime from the About dialog for additional information.
|
||||
*****************************************************************************/
|
||||
/*global define*/
|
||||
|
||||
define(
|
||||
function () {
|
||||
"use strict";
|
||||
|
||||
/**
|
||||
* Defines the `mct-background-image` directive.
|
||||
@@ -38,7 +36,7 @@ define(
|
||||
* @memberof platform/features/imagery
|
||||
*/
|
||||
function MCTBackgroundImage($document) {
|
||||
function link(scope, element, attrs) {
|
||||
function link(scope, element) {
|
||||
// General strategy here:
|
||||
// - Keep count of how many images have been requested; this
|
||||
// counter will be used as an internal identifier or sorts
|
||||
@@ -51,7 +49,7 @@ define(
|
||||
// in which images are actually loaded may be different, so
|
||||
// some strategy like this is necessary to ensure that images
|
||||
// do not display out-of-order.
|
||||
var div, requested = 0, loaded = 0;
|
||||
var requested = 0, loaded = 0;
|
||||
|
||||
function nextImage(url) {
|
||||
var myCounter = requested,
|
||||
|
||||
@@ -19,11 +19,9 @@
|
||||
* this source code distribution or the Licensing information page available
|
||||
* at runtime from the About dialog for additional information.
|
||||
*****************************************************************************/
|
||||
/*global define*/
|
||||
|
||||
define(
|
||||
function () {
|
||||
"use strict";
|
||||
|
||||
/**
|
||||
* Policy preventing the Imagery view from being made available for
|
||||
|
||||
@@ -19,12 +19,10 @@
|
||||
* this source code distribution or the Licensing information page available
|
||||
* at runtime from the About dialog for additional information.
|
||||
*****************************************************************************/
|
||||
/*global define,describe,it,expect,beforeEach,jasmine,xit*/
|
||||
|
||||
define(
|
||||
["../../src/controllers/ImageryController"],
|
||||
function (ImageryController) {
|
||||
"use strict";
|
||||
|
||||
describe("The Imagery controller", function () {
|
||||
var mockScope,
|
||||
|
||||
@@ -19,12 +19,10 @@
|
||||
* this source code distribution or the Licensing information page available
|
||||
* at runtime from the About dialog for additional information.
|
||||
*****************************************************************************/
|
||||
/*global define,describe,it,expect,beforeEach,jasmine,xit*/
|
||||
|
||||
define(
|
||||
["../../src/directives/MCTBackgroundImage"],
|
||||
function (MCTBackgroundImage) {
|
||||
"use strict";
|
||||
|
||||
describe("The mct-background-image directive", function () {
|
||||
var mockDocument,
|
||||
@@ -38,7 +36,7 @@ define(
|
||||
jasmine.createSpyObj('document', ['createElement'])
|
||||
];
|
||||
mockScope = jasmine.createSpyObj('scope', ['$watch']);
|
||||
mockElement = jasmine.createSpyObj('element', [ 'css' ]);
|
||||
mockElement = jasmine.createSpyObj('element', ['css']);
|
||||
testImage = {};
|
||||
|
||||
mockDocument[0].createElement.andReturn(testImage);
|
||||
|
||||
@@ -19,12 +19,10 @@
|
||||
* this source code distribution or the Licensing information page available
|
||||
* at runtime from the About dialog for additional information.
|
||||
*****************************************************************************/
|
||||
/*global define,describe,it,expect,beforeEach,jasmine,xit*/
|
||||
|
||||
define(
|
||||
["../../src/policies/ImageryViewPolicy"],
|
||||
function (ImageryViewPolicy) {
|
||||
"use strict";
|
||||
|
||||
describe("Imagery view policy", function () {
|
||||
var testView,
|
||||
@@ -53,24 +51,24 @@ define(
|
||||
});
|
||||
|
||||
it("allows the imagery view for domain objects with image telemetry", function () {
|
||||
testMetadata.ranges = [ { key: "foo", format: "imageUrl" } ];
|
||||
testMetadata.ranges = [{ key: "foo", format: "imageUrl" }];
|
||||
expect(policy.allow(testView, mockDomainObject)).toBeTruthy();
|
||||
});
|
||||
|
||||
it("disallows the imagery view for domain objects without image telemetry", function () {
|
||||
testMetadata.ranges = [ { key: "foo", format: "somethingElse" } ];
|
||||
testMetadata.ranges = [{ key: "foo", format: "somethingElse" }];
|
||||
expect(policy.allow(testView, mockDomainObject)).toBeFalsy();
|
||||
});
|
||||
|
||||
it("disallows the imagery view for domain objects without telemetry", function () {
|
||||
testMetadata.ranges = [ { key: "foo", format: "imageUrl" } ];
|
||||
testMetadata.ranges = [{ key: "foo", format: "imageUrl" }];
|
||||
mockDomainObject.getCapability.andReturn(undefined);
|
||||
expect(policy.allow(testView, mockDomainObject)).toBeFalsy();
|
||||
});
|
||||
|
||||
it("allows other views", function () {
|
||||
testView.key = "somethingElse";
|
||||
testMetadata.ranges = [ { key: "foo", format: "somethingElse" } ];
|
||||
testMetadata.ranges = [{ key: "foo", format: "somethingElse" }];
|
||||
expect(policy.allow(testView, mockDomainObject)).toBeTruthy();
|
||||
});
|
||||
|
||||
|
||||
@@ -19,7 +19,6 @@
|
||||
* this source code distribution or the Licensing information page available
|
||||
* at runtime from the About dialog for additional information.
|
||||
*****************************************************************************/
|
||||
/*global define*/
|
||||
|
||||
define([
|
||||
"./src/LayoutController",
|
||||
@@ -48,7 +47,6 @@ define([
|
||||
imageTemplate,
|
||||
legacyRegistry
|
||||
) {
|
||||
"use strict";
|
||||
|
||||
legacyRegistry.register("platform/features/layout", {
|
||||
"name": "Layout components.",
|
||||
@@ -73,9 +71,6 @@ define([
|
||||
"uses": [
|
||||
"composition"
|
||||
],
|
||||
"gestures": [
|
||||
"drop"
|
||||
],
|
||||
"toolbar": {
|
||||
"sections": [
|
||||
{
|
||||
|
||||
@@ -19,14 +19,12 @@
|
||||
* this source code distribution or the Licensing information page available
|
||||
* at runtime from the About dialog for additional information.
|
||||
*****************************************************************************/
|
||||
/*global define*/
|
||||
|
||||
define(
|
||||
['./FixedProxy', './elements/ElementProxies', './FixedDragHandle'],
|
||||
function (FixedProxy, ElementProxies, FixedDragHandle) {
|
||||
"use strict";
|
||||
|
||||
var DEFAULT_DIMENSIONS = [ 2, 1 ],
|
||||
var DEFAULT_DIMENSIONS = [2, 1],
|
||||
DEFAULT_GRID_SIZE = [64, 16];
|
||||
|
||||
/**
|
||||
@@ -38,7 +36,7 @@ define(
|
||||
* @constructor
|
||||
* @param {Scope} $scope the controller's Angular scope
|
||||
*/
|
||||
function FixedController($scope, $q, dialogService, telemetryHandler, telemetryFormatter, throttle) {
|
||||
function FixedController($scope, $q, dialogService, telemetryHandler, telemetryFormatter) {
|
||||
var self = this,
|
||||
handle,
|
||||
names = {}, // Cache names by ID
|
||||
@@ -232,7 +230,7 @@ define(
|
||||
}
|
||||
|
||||
// Handle changes in the object's composition
|
||||
function updateComposition(ids) {
|
||||
function updateComposition() {
|
||||
// Populate panel positions
|
||||
// TODO: Ensure defaults here
|
||||
// Resubscribe - objects in view have changed
|
||||
@@ -273,15 +271,13 @@ define(
|
||||
}
|
||||
|
||||
// Position a panel after a drop event
|
||||
function handleDrop(e, id, position, editableDomainObject) {
|
||||
function handleDrop(e, id, position) {
|
||||
// Don't handle this event if it has already been handled
|
||||
// color is set to "" to let the CSS theme determine the default color
|
||||
if (e.defaultPrevented) {
|
||||
return;
|
||||
}
|
||||
if (editableDomainObject){
|
||||
$scope.setEditable(editableDomainObject);
|
||||
}
|
||||
|
||||
e.preventDefault();
|
||||
// Store the position of this element.
|
||||
addElement({
|
||||
|
||||
@@ -19,16 +19,14 @@
|
||||
* this source code distribution or the Licensing information page available
|
||||
* at runtime from the About dialog for additional information.
|
||||
*****************************************************************************/
|
||||
/*global define*/
|
||||
|
||||
define(
|
||||
[],
|
||||
function () {
|
||||
'use strict';
|
||||
|
||||
|
||||
// Drag handle dimensions
|
||||
var DRAG_HANDLE_SIZE = [ 6, 6 ];
|
||||
var DRAG_HANDLE_SIZE = [6, 6];
|
||||
|
||||
/**
|
||||
* Template-displayable drag handle for an element in fixed
|
||||
|
||||
@@ -19,12 +19,10 @@
|
||||
* this source code distribution or the Licensing information page available
|
||||
* at runtime from the About dialog for additional information.
|
||||
*****************************************************************************/
|
||||
/*global define,window*/
|
||||
|
||||
define(
|
||||
['./elements/ElementFactory'],
|
||||
function (ElementFactory) {
|
||||
"use strict";
|
||||
|
||||
/**
|
||||
* Proxy for configuring a fixed position view via the toolbar.
|
||||
|
||||
@@ -19,12 +19,10 @@
|
||||
* this source code distribution or the Licensing information page available
|
||||
* at runtime from the About dialog for additional information.
|
||||
*****************************************************************************/
|
||||
/*global define*/
|
||||
|
||||
define(
|
||||
[],
|
||||
function () {
|
||||
"use strict";
|
||||
|
||||
/**
|
||||
* Defines composition policy for Display Layout objects.
|
||||
|
||||
@@ -19,7 +19,6 @@
|
||||
* this source code distribution or the Licensing information page available
|
||||
* at runtime from the About dialog for additional information.
|
||||
*****************************************************************************/
|
||||
/*global define*/
|
||||
|
||||
/**
|
||||
* This bundle implements object types and associated views for
|
||||
@@ -29,11 +28,10 @@
|
||||
define(
|
||||
['./LayoutDrag'],
|
||||
function (LayoutDrag) {
|
||||
"use strict";
|
||||
|
||||
var DEFAULT_DIMENSIONS = [ 12, 8 ],
|
||||
DEFAULT_GRID_SIZE = [ 32, 32 ],
|
||||
MINIMUM_FRAME_SIZE = [ 320, 180 ];
|
||||
var DEFAULT_DIMENSIONS = [12, 8],
|
||||
DEFAULT_GRID_SIZE = [32, 32],
|
||||
MINIMUM_FRAME_SIZE = [320, 180];
|
||||
|
||||
/**
|
||||
* The LayoutController is responsible for supporting the
|
||||
@@ -62,15 +60,11 @@ define(
|
||||
}
|
||||
|
||||
// Position a panel after a drop event
|
||||
//An editableDomainObject is provided, as the drop may have
|
||||
// triggered a transition to edit mode.
|
||||
function handleDrop(e, id, position, editableDomainObject) {
|
||||
function handleDrop(e, id, position) {
|
||||
if (e.defaultPrevented) {
|
||||
return;
|
||||
}
|
||||
if (editableDomainObject){
|
||||
$scope.setEditable(editableDomainObject);
|
||||
}
|
||||
|
||||
// Ensure that configuration field is populated
|
||||
$scope.configuration = $scope.configuration || {};
|
||||
// Make sure there is a "panels" field in the
|
||||
@@ -105,12 +99,12 @@ define(
|
||||
//Keep a track of how many composition callbacks have been made
|
||||
var thisCount = ++callbackCount;
|
||||
|
||||
$scope.domainObject.useCapability('composition').then(function(composition){
|
||||
$scope.domainObject.useCapability('composition').then(function (composition) {
|
||||
var ids;
|
||||
|
||||
//Is this callback for the most recent composition
|
||||
// request? If not, discard it. Prevents race condition
|
||||
if (thisCount === callbackCount){
|
||||
if (thisCount === callbackCount) {
|
||||
ids = composition.map(function (object) {
|
||||
return object.getId();
|
||||
}) || [];
|
||||
|
||||
@@ -19,12 +19,10 @@
|
||||
* this source code distribution or the Licensing information page available
|
||||
* at runtime from the About dialog for additional information.
|
||||
*****************************************************************************/
|
||||
/*global define*/
|
||||
|
||||
define(
|
||||
[],
|
||||
function () {
|
||||
"use strict";
|
||||
|
||||
/**
|
||||
* Handles drag interactions on frames in layouts. This will
|
||||
|
||||
@@ -19,12 +19,10 @@
|
||||
* this source code distribution or the Licensing information page available
|
||||
* at runtime from the About dialog for additional information.
|
||||
*****************************************************************************/
|
||||
/*global define*/
|
||||
|
||||
define(
|
||||
[],
|
||||
function () {
|
||||
"use strict";
|
||||
|
||||
/**
|
||||
* Utility function for creating getter-setter functions,
|
||||
|
||||
@@ -19,12 +19,10 @@
|
||||
* this source code distribution or the Licensing information page available
|
||||
* at runtime from the About dialog for additional information.
|
||||
*****************************************************************************/
|
||||
/*global define*/
|
||||
|
||||
define(
|
||||
['./ElementProxy', './AccessorMutator'],
|
||||
function (ElementProxy, AccessorMutator) {
|
||||
'use strict';
|
||||
|
||||
/**
|
||||
* Selection proxy for Box elements in a fixed position view.
|
||||
|
||||
@@ -19,12 +19,10 @@
|
||||
* this source code distribution or the Licensing information page available
|
||||
* at runtime from the About dialog for additional information.
|
||||
*****************************************************************************/
|
||||
/*global define*/
|
||||
|
||||
define(
|
||||
[],
|
||||
function () {
|
||||
"use strict";
|
||||
|
||||
var INITIAL_STATES = {
|
||||
"fixed.image": {
|
||||
|
||||
@@ -19,12 +19,10 @@
|
||||
* this source code distribution or the Licensing information page available
|
||||
* at runtime from the About dialog for additional information.
|
||||
*****************************************************************************/
|
||||
/*global define*/
|
||||
|
||||
define(
|
||||
['./TelemetryProxy', './ImageProxy', './LineProxy', './BoxProxy', './TextProxy'],
|
||||
function (TelemetryProxy, ImageProxy, LineProxy, BoxProxy, TextProxy) {
|
||||
"use strict";
|
||||
|
||||
return {
|
||||
"fixed.telemetry": TelemetryProxy,
|
||||
|
||||
@@ -19,12 +19,10 @@
|
||||
* this source code distribution or the Licensing information page available
|
||||
* at runtime from the About dialog for additional information.
|
||||
*****************************************************************************/
|
||||
/*global define*/
|
||||
|
||||
define(
|
||||
['./AccessorMutator', './ResizeHandle'],
|
||||
function (AccessorMutator, ResizeHandle) {
|
||||
"use strict";
|
||||
|
||||
// Index deltas for changes in order
|
||||
var ORDERS = {
|
||||
@@ -56,7 +54,7 @@ define(
|
||||
* @param {Array} elements the full array of elements
|
||||
*/
|
||||
function ElementProxy(element, index, elements) {
|
||||
this.resizeHandles = [ new ResizeHandle(element, 1, 1) ];
|
||||
this.resizeHandles = [new ResizeHandle(element, 1, 1)];
|
||||
|
||||
/**
|
||||
* The element as stored in the view configuration.
|
||||
|
||||
@@ -19,12 +19,10 @@
|
||||
* this source code distribution or the Licensing information page available
|
||||
* at runtime from the About dialog for additional information.
|
||||
*****************************************************************************/
|
||||
/*global define*/
|
||||
|
||||
define(
|
||||
['./ElementProxy', './AccessorMutator'],
|
||||
function (ElementProxy, AccessorMutator) {
|
||||
'use strict';
|
||||
|
||||
/**
|
||||
* Selection proxy for Image elements in a fixed position view.
|
||||
|
||||
@@ -19,11 +19,9 @@
|
||||
* this source code distribution or the Licensing information page available
|
||||
* at runtime from the About dialog for additional information.
|
||||
*****************************************************************************/
|
||||
/*global define*/
|
||||
define(
|
||||
[],
|
||||
function () {
|
||||
'use strict';
|
||||
|
||||
/**
|
||||
* Handle for changing x/y position of a line's end point.
|
||||
|
||||
@@ -19,12 +19,10 @@
|
||||
* this source code distribution or the Licensing information page available
|
||||
* at runtime from the About dialog for additional information.
|
||||
*****************************************************************************/
|
||||
/*global define*/
|
||||
|
||||
define(
|
||||
['./ElementProxy', './LineHandle'],
|
||||
function (ElementProxy, LineHandle) {
|
||||
'use strict';
|
||||
|
||||
/**
|
||||
* Selection/diplay proxy for line elements of a fixed position
|
||||
|
||||
@@ -19,11 +19,9 @@
|
||||
* this source code distribution or the Licensing information page available
|
||||
* at runtime from the About dialog for additional information.
|
||||
*****************************************************************************/
|
||||
/*global define*/
|
||||
define(
|
||||
[],
|
||||
function () {
|
||||
'use strict';
|
||||
|
||||
/**
|
||||
* @interface platform/features/layout.ElementHandle
|
||||
|
||||
@@ -19,12 +19,10 @@
|
||||
* this source code distribution or the Licensing information page available
|
||||
* at runtime from the About dialog for additional information.
|
||||
*****************************************************************************/
|
||||
/*global define*/
|
||||
|
||||
define(
|
||||
['./TextProxy', './AccessorMutator'],
|
||||
function (TextProxy, AccessorMutator) {
|
||||
'use strict';
|
||||
['./TextProxy'],
|
||||
function (TextProxy) {
|
||||
|
||||
// Method names to expose from this proxy
|
||||
var HIDE = 'hideTitle', SHOW = 'showTitle';
|
||||
|
||||
@@ -19,12 +19,10 @@
|
||||
* this source code distribution or the Licensing information page available
|
||||
* at runtime from the About dialog for additional information.
|
||||
*****************************************************************************/
|
||||
/*global define*/
|
||||
|
||||
define(
|
||||
['./BoxProxy', './AccessorMutator'],
|
||||
function (BoxProxy, AccessorMutator) {
|
||||
'use strict';
|
||||
|
||||
/**
|
||||
* Selection proxy for Text elements in a fixed position view.
|
||||
|
||||
@@ -19,12 +19,10 @@
|
||||
* this source code distribution or the Licensing information page available
|
||||
* at runtime from the About dialog for additional information.
|
||||
*****************************************************************************/
|
||||
/*global define,describe,it,expect,beforeEach,jasmine,xit*/
|
||||
|
||||
define(
|
||||
["../src/FixedController"],
|
||||
function (FixedController) {
|
||||
"use strict";
|
||||
|
||||
describe("The Fixed Position controller", function () {
|
||||
var mockScope,
|
||||
@@ -66,7 +64,7 @@ define(
|
||||
function makeMockDomainObject(id) {
|
||||
var mockObject = jasmine.createSpyObj(
|
||||
'domainObject-' + id,
|
||||
[ 'getId', 'getModel', 'getCapability' ]
|
||||
['getId', 'getModel', 'getCapability']
|
||||
);
|
||||
mockObject.getId.andReturn(id);
|
||||
mockObject.getModel.andReturn({ name: "Point " + id});
|
||||
@@ -76,11 +74,11 @@ define(
|
||||
beforeEach(function () {
|
||||
mockScope = jasmine.createSpyObj(
|
||||
'$scope',
|
||||
[ "$on", "$watch", "commit" ]
|
||||
["$on", "$watch", "commit"]
|
||||
);
|
||||
mockHandler = jasmine.createSpyObj(
|
||||
'telemetryHandler',
|
||||
[ 'handle' ]
|
||||
['handle']
|
||||
);
|
||||
mockQ = jasmine.createSpyObj('$q', ['when']);
|
||||
mockDialogService = jasmine.createSpyObj(
|
||||
@@ -89,11 +87,11 @@ define(
|
||||
);
|
||||
mockFormatter = jasmine.createSpyObj(
|
||||
'telemetryFormatter',
|
||||
[ 'formatDomainValue', 'formatRangeValue' ]
|
||||
['formatDomainValue', 'formatRangeValue']
|
||||
);
|
||||
mockDomainObject = jasmine.createSpyObj(
|
||||
'domainObject',
|
||||
[ 'getId', 'getModel', 'getCapability' ]
|
||||
['getId', 'getModel', 'getCapability']
|
||||
);
|
||||
mockHandle = jasmine.createSpyObj(
|
||||
'subscription',
|
||||
@@ -108,10 +106,10 @@ define(
|
||||
);
|
||||
mockEvent = jasmine.createSpyObj(
|
||||
'event',
|
||||
[ 'preventDefault' ]
|
||||
['preventDefault']
|
||||
);
|
||||
|
||||
testGrid = [ 123, 456 ];
|
||||
testGrid = [123, 456];
|
||||
testModel = {
|
||||
composition: ['a', 'b', 'c'],
|
||||
layoutGrid: testGrid
|
||||
@@ -138,7 +136,7 @@ define(
|
||||
mockScope.configuration = testConfiguration;
|
||||
mockScope.selection = jasmine.createSpyObj(
|
||||
'selection',
|
||||
[ 'select', 'get', 'selected', 'deselect', 'proxy' ]
|
||||
['select', 'get', 'selected', 'deselect', 'proxy']
|
||||
);
|
||||
|
||||
controller = new FixedController(
|
||||
@@ -420,7 +418,7 @@ define(
|
||||
expect(controller.selected().style).toEqual(oldStyle);
|
||||
|
||||
// Drag a little
|
||||
controller.moveHandle().continueDrag([ 1000, 100 ]);
|
||||
controller.moveHandle().continueDrag([1000, 100]);
|
||||
|
||||
// Style should have been updated
|
||||
expect(controller.selected().style).not.toEqual(oldStyle);
|
||||
|
||||
@@ -19,14 +19,12 @@
|
||||
* this source code distribution or the Licensing information page available
|
||||
* at runtime from the About dialog for additional information.
|
||||
*****************************************************************************/
|
||||
/*global define,describe,it,expect,beforeEach,jasmine,xit*/
|
||||
|
||||
define(
|
||||
['../src/FixedDragHandle'],
|
||||
function (FixedDragHandle) {
|
||||
"use strict";
|
||||
|
||||
var TEST_GRID_SIZE = [ 13, 33 ];
|
||||
var TEST_GRID_SIZE = [13, 33];
|
||||
|
||||
describe("A fixed position drag handle", function () {
|
||||
var mockElementHandle,
|
||||
@@ -37,7 +35,7 @@ define(
|
||||
beforeEach(function () {
|
||||
mockElementHandle = jasmine.createSpyObj(
|
||||
'elementHandle',
|
||||
[ 'x', 'y' ]
|
||||
['x', 'y']
|
||||
);
|
||||
mockUpdate = jasmine.createSpy('update');
|
||||
mockCommit = jasmine.createSpy('commit');
|
||||
@@ -63,13 +61,13 @@ define(
|
||||
|
||||
it("allows handles to be dragged", function () {
|
||||
handle.startDrag();
|
||||
handle.continueDrag([ 16, 8 ]);
|
||||
handle.continueDrag([16, 8]);
|
||||
|
||||
// Should update x/y, snapped to grid
|
||||
expect(mockElementHandle.x).toHaveBeenCalledWith(7);
|
||||
expect(mockElementHandle.y).toHaveBeenCalledWith(8);
|
||||
|
||||
handle.continueDrag([ -16, -35 ]);
|
||||
handle.continueDrag([-16, -35]);
|
||||
|
||||
// Should have interpreted relative to initial state
|
||||
expect(mockElementHandle.x).toHaveBeenCalledWith(5);
|
||||
@@ -86,4 +84,4 @@ define(
|
||||
|
||||
});
|
||||
}
|
||||
);
|
||||
);
|
||||
|
||||
@@ -19,12 +19,10 @@
|
||||
* this source code distribution or the Licensing information page available
|
||||
* at runtime from the About dialog for additional information.
|
||||
*****************************************************************************/
|
||||
/*global define,describe,it,expect,beforeEach,jasmine,xit*/
|
||||
|
||||
define(
|
||||
['../src/FixedProxy'],
|
||||
function (FixedProxy) {
|
||||
"use strict";
|
||||
|
||||
describe("Fixed Position view's selection proxy", function () {
|
||||
var mockCallback,
|
||||
|
||||
@@ -19,12 +19,10 @@
|
||||
* this source code distribution or the Licensing information page available
|
||||
* at runtime from the About dialog for additional information.
|
||||
*****************************************************************************/
|
||||
/*global define,Promise,describe,it,expect,beforeEach,waitsFor,jasmine*/
|
||||
|
||||
define(
|
||||
["../src/LayoutCompositionPolicy"],
|
||||
function (LayoutCompositionPolicy) {
|
||||
"use strict";
|
||||
describe("Layout's composition policy", function () {
|
||||
var mockCandidate,
|
||||
mockContext,
|
||||
|
||||
@@ -19,12 +19,10 @@
|
||||
* this source code distribution or the Licensing information page available
|
||||
* at runtime from the About dialog for additional information.
|
||||
*****************************************************************************/
|
||||
/*global define,describe,it,expect,beforeEach,jasmine,spyOn*/
|
||||
|
||||
define(
|
||||
["../src/LayoutController"],
|
||||
function (LayoutController) {
|
||||
"use strict";
|
||||
|
||||
describe("The Layout controller", function () {
|
||||
var mockScope,
|
||||
@@ -36,7 +34,7 @@ define(
|
||||
mockComposition,
|
||||
mockCompositionObjects;
|
||||
|
||||
function mockPromise(value){
|
||||
function mockPromise(value) {
|
||||
return {
|
||||
then: function (thenFunc) {
|
||||
return mockPromise(thenFunc(value));
|
||||
@@ -44,12 +42,12 @@ define(
|
||||
};
|
||||
}
|
||||
|
||||
function mockDomainObject(id){
|
||||
function mockDomainObject(id) {
|
||||
return {
|
||||
getId: function() {
|
||||
getId: function () {
|
||||
return id;
|
||||
},
|
||||
useCapability: function() {
|
||||
useCapability: function () {
|
||||
return mockCompositionCapability;
|
||||
}
|
||||
};
|
||||
@@ -58,11 +56,11 @@ define(
|
||||
beforeEach(function () {
|
||||
mockScope = jasmine.createSpyObj(
|
||||
"$scope",
|
||||
[ "$watch", "$watchCollection", "$on", "commit" ]
|
||||
["$watch", "$watchCollection", "$on", "commit"]
|
||||
);
|
||||
mockEvent = jasmine.createSpyObj(
|
||||
'event',
|
||||
[ 'preventDefault' ]
|
||||
['preventDefault']
|
||||
);
|
||||
|
||||
testModel = {};
|
||||
@@ -237,10 +235,10 @@ define(
|
||||
});
|
||||
|
||||
it("ensures a minimum frame size", function () {
|
||||
var styleB, styleC;
|
||||
var styleB;
|
||||
|
||||
// Start with a very small frame size
|
||||
testModel.layoutGrid = [ 1, 1 ];
|
||||
testModel.layoutGrid = [1, 1];
|
||||
|
||||
// White-boxy; we know which watch is which
|
||||
mockScope.$watch.calls[0].args[1](testModel.layoutGrid);
|
||||
@@ -257,7 +255,7 @@ define(
|
||||
var style;
|
||||
|
||||
// Start with a very small frame size
|
||||
testModel.layoutGrid = [ 1, 1 ];
|
||||
testModel.layoutGrid = [1, 1];
|
||||
mockScope.$watch.calls[0].args[1](testModel.layoutGrid);
|
||||
|
||||
// Notify that a drop occurred
|
||||
|
||||
@@ -19,65 +19,63 @@
|
||||
* this source code distribution or the Licensing information page available
|
||||
* at runtime from the About dialog for additional information.
|
||||
*****************************************************************************/
|
||||
/*global define,describe,it,expect,beforeEach,jasmine*/
|
||||
|
||||
define(
|
||||
["../src/LayoutDrag"],
|
||||
function (LayoutDrag) {
|
||||
"use strict";
|
||||
|
||||
describe("A Layout drag handler", function () {
|
||||
var testPosition = {
|
||||
position: [ 8, 11 ],
|
||||
dimensions: [ 3, 2 ]
|
||||
position: [8, 11],
|
||||
dimensions: [3, 2]
|
||||
};
|
||||
|
||||
it("changes position by a supplied factor, rounding by grid size", function () {
|
||||
var handler = new LayoutDrag(
|
||||
testPosition,
|
||||
[ 1, 1 ],
|
||||
[ 0, 0 ],
|
||||
[ 10, 20 ]
|
||||
[1, 1],
|
||||
[0, 0],
|
||||
[10, 20]
|
||||
);
|
||||
|
||||
expect(handler.getAdjustedPosition([ 37, 84 ])).toEqual({
|
||||
position: [ 12, 15 ],
|
||||
dimensions: [ 3, 2 ]
|
||||
expect(handler.getAdjustedPosition([37, 84])).toEqual({
|
||||
position: [12, 15],
|
||||
dimensions: [3, 2]
|
||||
});
|
||||
expect(handler.getAdjustedPosition([ -37, 84 ])).toEqual({
|
||||
position: [ 4, 15 ],
|
||||
dimensions: [ 3, 2 ]
|
||||
expect(handler.getAdjustedPosition([-37, 84])).toEqual({
|
||||
position: [4, 15],
|
||||
dimensions: [3, 2]
|
||||
});
|
||||
});
|
||||
|
||||
it("changes dimensions by a supplied factor, rounding by grid size", function () {
|
||||
var handler = new LayoutDrag(
|
||||
testPosition,
|
||||
[ 0, 0 ],
|
||||
[ 1, 1 ],
|
||||
[ 10, 20 ]
|
||||
[0, 0],
|
||||
[1, 1],
|
||||
[10, 20]
|
||||
);
|
||||
|
||||
expect(handler.getAdjustedPosition([ 37, 84 ])).toEqual({
|
||||
position: [ 8, 11 ],
|
||||
dimensions: [ 7, 6 ]
|
||||
expect(handler.getAdjustedPosition([37, 84])).toEqual({
|
||||
position: [8, 11],
|
||||
dimensions: [7, 6]
|
||||
});
|
||||
});
|
||||
|
||||
it("allows mixing dimension and position factors", function () {
|
||||
var handler = new LayoutDrag(
|
||||
testPosition,
|
||||
[ 0, 1 ],
|
||||
[ -1, 0 ],
|
||||
[ 10, 20 ]
|
||||
[0, 1],
|
||||
[-1, 0],
|
||||
[10, 20]
|
||||
);
|
||||
|
||||
expect(handler.getAdjustedPosition([ 11, 84 ])).toEqual({
|
||||
position: [ 8, 15 ],
|
||||
dimensions: [ 2, 2 ]
|
||||
expect(handler.getAdjustedPosition([11, 84])).toEqual({
|
||||
position: [8, 15],
|
||||
dimensions: [2, 2]
|
||||
});
|
||||
});
|
||||
|
||||
});
|
||||
}
|
||||
);
|
||||
);
|
||||
|
||||
@@ -19,12 +19,10 @@
|
||||
* this source code distribution or the Licensing information page available
|
||||
* at runtime from the About dialog for additional information.
|
||||
*****************************************************************************/
|
||||
/*global define,describe,it,expect,beforeEach,jasmine*/
|
||||
|
||||
define(
|
||||
['../../src/elements/AccessorMutator'],
|
||||
function (AccessorMutator) {
|
||||
"use strict";
|
||||
|
||||
describe("An accessor-mutator", function () {
|
||||
var testObject,
|
||||
|
||||
@@ -19,12 +19,10 @@
|
||||
* this source code distribution or the Licensing information page available
|
||||
* at runtime from the About dialog for additional information.
|
||||
*****************************************************************************/
|
||||
/*global define,describe,it,expect,beforeEach,jasmine*/
|
||||
|
||||
define(
|
||||
['../../src/elements/BoxProxy'],
|
||||
function (BoxProxy) {
|
||||
"use strict";
|
||||
|
||||
describe("A fixed position box proxy", function () {
|
||||
var testElement,
|
||||
@@ -39,7 +37,7 @@ define(
|
||||
height: 24,
|
||||
fill: "transparent"
|
||||
};
|
||||
testElements = [ {}, {}, testElement, {} ];
|
||||
testElements = [{}, {}, testElement, {}];
|
||||
proxy = new BoxProxy(
|
||||
testElement,
|
||||
testElements.indexOf(testElement),
|
||||
|
||||
@@ -19,15 +19,13 @@
|
||||
* this source code distribution or the Licensing information page available
|
||||
* at runtime from the About dialog for additional information.
|
||||
*****************************************************************************/
|
||||
/*global define,describe,it,expect,beforeEach,jasmine*/
|
||||
|
||||
define(
|
||||
['../../src/elements/ElementFactory'],
|
||||
function (ElementFactory) {
|
||||
"use strict";
|
||||
|
||||
var DIALOG_ELEMENTS = [ 'image', 'text' ],
|
||||
NON_DIALOG_ELEMENTS = [ 'box', 'line' ];
|
||||
var DIALOG_ELEMENTS = ['image', 'text'],
|
||||
NON_DIALOG_ELEMENTS = ['box', 'line'];
|
||||
|
||||
describe("The fixed position element factory", function () {
|
||||
var mockDialogService,
|
||||
@@ -37,11 +35,11 @@ define(
|
||||
beforeEach(function () {
|
||||
mockDialogService = jasmine.createSpyObj(
|
||||
'dialogService',
|
||||
[ 'getUserInput' ]
|
||||
['getUserInput']
|
||||
);
|
||||
mockPromise = jasmine.createSpyObj(
|
||||
'promise',
|
||||
[ 'then' ]
|
||||
['then']
|
||||
);
|
||||
|
||||
mockDialogService.getUserInput.andReturn(mockPromise);
|
||||
@@ -68,4 +66,4 @@ define(
|
||||
});
|
||||
});
|
||||
}
|
||||
);
|
||||
);
|
||||
|
||||
@@ -19,12 +19,10 @@
|
||||
* this source code distribution or the Licensing information page available
|
||||
* at runtime from the About dialog for additional information.
|
||||
*****************************************************************************/
|
||||
/*global define,describe,it,expect,beforeEach,jasmine*/
|
||||
|
||||
define(
|
||||
['../../src/elements/ElementProxies'],
|
||||
function (ElementProxies) {
|
||||
"use strict";
|
||||
|
||||
// Expect these element types to have proxies
|
||||
var ELEMENT_TYPES = [
|
||||
|
||||
@@ -19,12 +19,10 @@
|
||||
* this source code distribution or the Licensing information page available
|
||||
* at runtime from the About dialog for additional information.
|
||||
*****************************************************************************/
|
||||
/*global define,describe,it,expect,beforeEach,jasmine*/
|
||||
|
||||
define(
|
||||
['../../src/elements/ElementProxy'],
|
||||
function (ElementProxy) {
|
||||
"use strict";
|
||||
|
||||
describe("A fixed position element proxy", function () {
|
||||
var testElement,
|
||||
@@ -39,7 +37,7 @@ define(
|
||||
width: 42,
|
||||
height: 24
|
||||
};
|
||||
testElements = [ {}, {}, testElement, {} ];
|
||||
testElements = [{}, {}, testElement, {}];
|
||||
proxy = new ElementProxy(
|
||||
testElement,
|
||||
testElements.indexOf(testElement),
|
||||
|
||||
@@ -19,12 +19,10 @@
|
||||
* this source code distribution or the Licensing information page available
|
||||
* at runtime from the About dialog for additional information.
|
||||
*****************************************************************************/
|
||||
/*global define,describe,it,expect,beforeEach,jasmine*/
|
||||
|
||||
define(
|
||||
['../../src/elements/ImageProxy'],
|
||||
function (ImageProxy) {
|
||||
"use strict";
|
||||
|
||||
describe("A fixed position image proxy", function () {
|
||||
var testElement,
|
||||
@@ -39,7 +37,7 @@ define(
|
||||
height: 24,
|
||||
url: "http://www.nasa.gov"
|
||||
};
|
||||
testElements = [ {}, {}, testElement, {} ];
|
||||
testElements = [{}, {}, testElement, {}];
|
||||
proxy = new ImageProxy(
|
||||
testElement,
|
||||
testElements.indexOf(testElement),
|
||||
|
||||
@@ -19,12 +19,10 @@
|
||||
* this source code distribution or the Licensing information page available
|
||||
* at runtime from the About dialog for additional information.
|
||||
*****************************************************************************/
|
||||
/*global define,describe,it,expect,beforeEach,jasmine,xit*/
|
||||
|
||||
define(
|
||||
['../../src/elements/LineHandle'],
|
||||
function (LineHandle) {
|
||||
"use strict";
|
||||
|
||||
describe("A fixed position drag handle", function () {
|
||||
var testElement,
|
||||
@@ -72,4 +70,4 @@ define(
|
||||
|
||||
});
|
||||
}
|
||||
);
|
||||
);
|
||||
|
||||
@@ -19,12 +19,10 @@
|
||||
* this source code distribution or the Licensing information page available
|
||||
* at runtime from the About dialog for additional information.
|
||||
*****************************************************************************/
|
||||
/*global define,describe,it,expect,beforeEach,jasmine*/
|
||||
|
||||
define(
|
||||
['../../src/elements/LineProxy'],
|
||||
function (LineProxy) {
|
||||
"use strict";
|
||||
|
||||
describe("A fixed position line proxy", function () {
|
||||
var vertical, horizontal, diagonal, reversed;
|
||||
@@ -94,4 +92,4 @@ define(
|
||||
|
||||
});
|
||||
}
|
||||
);
|
||||
);
|
||||
|
||||
@@ -19,12 +19,10 @@
|
||||
* this source code distribution or the Licensing information page available
|
||||
* at runtime from the About dialog for additional information.
|
||||
*****************************************************************************/
|
||||
/*global define,describe,it,expect,beforeEach,jasmine,xit*/
|
||||
|
||||
define(
|
||||
['../../src/elements/ResizeHandle'],
|
||||
function (ResizeHandle) {
|
||||
"use strict";
|
||||
|
||||
var TEST_MIN_WIDTH = 4, TEST_MIN_HEIGHT = 2;
|
||||
|
||||
@@ -77,4 +75,4 @@ define(
|
||||
|
||||
});
|
||||
}
|
||||
);
|
||||
);
|
||||
|
||||
@@ -19,12 +19,10 @@
|
||||
* this source code distribution or the Licensing information page available
|
||||
* at runtime from the About dialog for additional information.
|
||||
*****************************************************************************/
|
||||
/*global define,describe,it,expect,beforeEach,jasmine*/
|
||||
|
||||
define(
|
||||
['../../src/elements/TelemetryProxy'],
|
||||
function (TelemetryProxy) {
|
||||
"use strict";
|
||||
|
||||
describe("A fixed position telemetry proxy", function () {
|
||||
var testElement,
|
||||
@@ -40,7 +38,7 @@ define(
|
||||
height: 24,
|
||||
id: "test-id"
|
||||
};
|
||||
testElements = [ {}, {}, testElement, {} ];
|
||||
testElements = [{}, {}, testElement, {}];
|
||||
proxy = new TelemetryProxy(
|
||||
testElement,
|
||||
testElements.indexOf(testElement),
|
||||
|
||||
@@ -19,12 +19,10 @@
|
||||
* this source code distribution or the Licensing information page available
|
||||
* at runtime from the About dialog for additional information.
|
||||
*****************************************************************************/
|
||||
/*global define,describe,it,expect,beforeEach,jasmine*/
|
||||
|
||||
define(
|
||||
['../../src/elements/TextProxy'],
|
||||
function (TextProxy) {
|
||||
"use strict";
|
||||
|
||||
describe("A fixed position text proxy", function () {
|
||||
var testElement,
|
||||
@@ -39,7 +37,7 @@ define(
|
||||
height: 24,
|
||||
fill: "transparent"
|
||||
};
|
||||
testElements = [ {}, {}, testElement, {} ];
|
||||
testElements = [{}, {}, testElement, {}];
|
||||
proxy = new TextProxy(
|
||||
testElement,
|
||||
testElements.indexOf(testElement),
|
||||
|
||||
@@ -19,7 +19,6 @@
|
||||
* this source code distribution or the Licensing information page available
|
||||
* at runtime from the About dialog for additional information.
|
||||
*****************************************************************************/
|
||||
/*global define*/
|
||||
|
||||
define([
|
||||
"./src/EmbeddedPageController",
|
||||
@@ -30,7 +29,6 @@ define([
|
||||
iframeTemplate,
|
||||
legacyRegistry
|
||||
) {
|
||||
"use strict";
|
||||
|
||||
legacyRegistry.register("platform/features/pages", {
|
||||
"extensions": {
|
||||
|
||||
@@ -19,7 +19,6 @@
|
||||
* this source code distribution or the Licensing information page available
|
||||
* at runtime from the About dialog for additional information.
|
||||
*****************************************************************************/
|
||||
/*global define*/
|
||||
|
||||
/**
|
||||
* This bundle adds the Web Page object type, which can be used to embed
|
||||
@@ -29,7 +28,6 @@
|
||||
define(
|
||||
[],
|
||||
function () {
|
||||
"use strict";
|
||||
|
||||
/**
|
||||
* Controller for embedded web pages; serves simply as a
|
||||
|
||||
@@ -19,12 +19,10 @@
|
||||
* this source code distribution or the Licensing information page available
|
||||
* at runtime from the About dialog for additional information.
|
||||
*****************************************************************************/
|
||||
/*global define,Promise,describe,it,expect,beforeEach,waitsFor,jasmine*/
|
||||
|
||||
define(
|
||||
["../src/EmbeddedPageController"],
|
||||
function (EmbeddedPageController) {
|
||||
"use strict";
|
||||
|
||||
describe("The controller for embedded pages", function () {
|
||||
var mockSCE,
|
||||
|
||||
@@ -19,7 +19,6 @@
|
||||
* this source code distribution or the Licensing information page available
|
||||
* at runtime from the About dialog for additional information.
|
||||
*****************************************************************************/
|
||||
/*global define*/
|
||||
|
||||
define([
|
||||
"./src/MCTChart",
|
||||
@@ -38,7 +37,6 @@ define([
|
||||
plotOptionsBrowseTemplate,
|
||||
legacyRegistry
|
||||
) {
|
||||
"use strict";
|
||||
|
||||
legacyRegistry.register("platform/features/plot", {
|
||||
"name": "Plot view for telemetry",
|
||||
|
||||
@@ -19,12 +19,10 @@
|
||||
* this source code distribution or the Licensing information page available
|
||||
* at runtime from the About dialog for additional information.
|
||||
*****************************************************************************/
|
||||
/*global define,Float32Array*/
|
||||
|
||||
define(
|
||||
[],
|
||||
function () {
|
||||
"use strict";
|
||||
|
||||
/**
|
||||
* Create a new chart which uses Canvas's 2D API for rendering.
|
||||
@@ -40,8 +38,8 @@ define(
|
||||
this.c2d = canvas.getContext('2d');
|
||||
this.width = canvas.width;
|
||||
this.height = canvas.height;
|
||||
this.dimensions = [ this.width, this.height ];
|
||||
this.origin = [ 0, 0 ];
|
||||
this.dimensions = [this.width, this.height];
|
||||
this.origin = [0, 0];
|
||||
|
||||
if (!this.c2d) {
|
||||
throw new Error("Canvas 2d API unavailable.");
|
||||
|
||||
@@ -19,7 +19,6 @@
|
||||
* this source code distribution or the Licensing information page available
|
||||
* at runtime from the About dialog for additional information.
|
||||
*****************************************************************************/
|
||||
/*global define,Float32Array*/
|
||||
|
||||
/**
|
||||
* Module defining GLPlot. Created by vwoeltje on 11/12/14.
|
||||
@@ -27,7 +26,6 @@
|
||||
define(
|
||||
[],
|
||||
function () {
|
||||
"use strict";
|
||||
|
||||
// WebGL shader sources (for drawing plain colors)
|
||||
var FRAGMENT_SHADER = [
|
||||
|
||||
@@ -19,7 +19,6 @@
|
||||
* this source code distribution or the Licensing information page available
|
||||
* at runtime from the About dialog for additional information.
|
||||
*****************************************************************************/
|
||||
/*global define*/
|
||||
|
||||
/**
|
||||
* Module defining MCTChart. Created by vwoeltje on 11/12/14.
|
||||
@@ -27,7 +26,6 @@
|
||||
define(
|
||||
["./GLChart", "./Canvas2DChart"],
|
||||
function (GLChart, Canvas2DChart) {
|
||||
"use strict";
|
||||
|
||||
var TEMPLATE = "<canvas style='position: absolute; background: none; width: 100%; height: 100%;'></canvas>";
|
||||
|
||||
|
||||
@@ -19,7 +19,6 @@
|
||||
* this source code distribution or the Licensing information page available
|
||||
* at runtime from the About dialog for additional information.
|
||||
*****************************************************************************/
|
||||
/*global define*/
|
||||
|
||||
/**
|
||||
* This bundle adds a "Plot" view for numeric telemetry data.
|
||||
@@ -44,7 +43,6 @@ define(
|
||||
PlotModeOptions,
|
||||
SubPlotFactory
|
||||
) {
|
||||
"use strict";
|
||||
|
||||
var AXIS_DEFAULTS = [
|
||||
{ "name": "Time" },
|
||||
|
||||
@@ -19,12 +19,10 @@
|
||||
* this source code distribution or the Licensing information page available
|
||||
* at runtime from the About dialog for additional information.
|
||||
*****************************************************************************/
|
||||
/*global define*/
|
||||
|
||||
define(
|
||||
['./PlotOptionsForm'],
|
||||
function (PlotOptionsForm) {
|
||||
"use strict";
|
||||
|
||||
/**
|
||||
* Notes on implementation of plot options
|
||||
@@ -59,7 +57,7 @@ define(
|
||||
Listen for changes to the domain object and update the object's
|
||||
children.
|
||||
*/
|
||||
this.mutationListener = this.domainObject.getCapability('mutation').listen(function(model) {
|
||||
this.mutationListener = this.domainObject.getCapability('mutation').listen(function (model) {
|
||||
if (self.hasCompositionChanged(self.composition, model.composition)) {
|
||||
self.updateChildren();
|
||||
}
|
||||
@@ -72,7 +70,7 @@ define(
|
||||
$scope.xAxisForm = this.plotOptionsForm.xAxisForm;
|
||||
$scope.yAxisForm = this.plotOptionsForm.yAxisForm;
|
||||
|
||||
$scope.$on("$destroy", function() {
|
||||
$scope.$on("$destroy", function () {
|
||||
//Clean up any listeners on destruction of controller
|
||||
self.mutationListener();
|
||||
});
|
||||
@@ -84,10 +82,10 @@ define(
|
||||
* Setup a number of watches for changes to form values. On
|
||||
* change, update the model configuration via mutation
|
||||
*/
|
||||
$scope.$watchCollection('configuration.plot.yAxis', function(newValue, oldValue){
|
||||
$scope.$watchCollection('configuration.plot.yAxis', function (newValue, oldValue) {
|
||||
self.updateConfiguration(newValue, oldValue);
|
||||
});
|
||||
$scope.$watchCollection('configuration.plot.xAxis', function(newValue, oldValue){
|
||||
$scope.$watchCollection('configuration.plot.xAxis', function (newValue, oldValue) {
|
||||
self.updateConfiguration(newValue, oldValue);
|
||||
});
|
||||
|
||||
@@ -100,8 +98,8 @@ define(
|
||||
* child objects)
|
||||
* @private
|
||||
*/
|
||||
PlotOptionsController.prototype.clearSeriesWatches = function() {
|
||||
this.watches.forEach(function(watch) {
|
||||
PlotOptionsController.prototype.clearSeriesWatches = function () {
|
||||
this.watches.forEach(function (watch) {
|
||||
watch();
|
||||
});
|
||||
this.watches = [];
|
||||
@@ -111,16 +109,16 @@ define(
|
||||
* Attach watches for each object in the plot's composition
|
||||
* @private
|
||||
*/
|
||||
PlotOptionsController.prototype.watchSeries = function() {
|
||||
PlotOptionsController.prototype.watchSeries = function () {
|
||||
var self = this;
|
||||
|
||||
this.clearSeriesWatches();
|
||||
|
||||
(self.$scope.children || []).forEach(function(child, index){
|
||||
(self.$scope.children || []).forEach(function (child, index) {
|
||||
self.watches.push(
|
||||
self.$scope.$watchCollection(
|
||||
'configuration.plot.series[' + index + ']',
|
||||
function(newValue, oldValue){
|
||||
function (newValue, oldValue) {
|
||||
self.updateConfiguration(newValue, oldValue);
|
||||
}
|
||||
)
|
||||
@@ -134,13 +132,13 @@ define(
|
||||
*
|
||||
* @private
|
||||
*/
|
||||
PlotOptionsController.prototype.hasCompositionChanged = function(oldComposition, newComposition){
|
||||
PlotOptionsController.prototype.hasCompositionChanged = function (oldComposition, newComposition) {
|
||||
// Framed slightly strangely, but the boolean logic is
|
||||
// easier to follow for the unchanged case.
|
||||
var isUnchanged = oldComposition === newComposition ||
|
||||
(
|
||||
oldComposition.length === newComposition.length &&
|
||||
oldComposition.every( function (currentValue, index) {
|
||||
oldComposition.every(function (currentValue, index) {
|
||||
return newComposition[index] && currentValue === newComposition[index];
|
||||
})
|
||||
);
|
||||
@@ -165,12 +163,12 @@ define(
|
||||
* plot options model
|
||||
* @private
|
||||
*/
|
||||
PlotOptionsController.prototype.updateChildren = function() {
|
||||
PlotOptionsController.prototype.updateChildren = function () {
|
||||
var self = this;
|
||||
this.domainObject.useCapability('composition').then(function(children){
|
||||
this.domainObject.useCapability('composition').then(function (children) {
|
||||
self.$scope.children = children;
|
||||
self.composition = self.domainObject.getModel().composition;
|
||||
children.forEach(function(child, index){
|
||||
children.forEach(function (child, index) {
|
||||
self.configuration.plot.series[index] =
|
||||
self.configuration.plot.series[index] || {'id': child.getId()};
|
||||
});
|
||||
@@ -183,9 +181,9 @@ define(
|
||||
* object
|
||||
* @private
|
||||
*/
|
||||
PlotOptionsController.prototype.updateConfiguration = function() {
|
||||
PlotOptionsController.prototype.updateConfiguration = function () {
|
||||
var self = this;
|
||||
this.domainObject.useCapability('mutation', function(model){
|
||||
this.domainObject.useCapability('mutation', function (model) {
|
||||
model.configuration = model.configuration || {};
|
||||
model.configuration.plot = self.configuration.plot;
|
||||
});
|
||||
|
||||
@@ -19,12 +19,10 @@
|
||||
* this source code distribution or the Licensing information page available
|
||||
* at runtime from the About dialog for additional information.
|
||||
*****************************************************************************/
|
||||
/*global define*/
|
||||
|
||||
define(
|
||||
[],
|
||||
function () {
|
||||
"use strict";
|
||||
|
||||
/**
|
||||
* A class for encapsulating structure and behaviour of the plot
|
||||
@@ -39,7 +37,7 @@ define(
|
||||
Defined below are the form structures for the plot options.
|
||||
*/
|
||||
this.xAxisForm = {
|
||||
'name':'x-axis',
|
||||
'name': 'x-axis',
|
||||
'sections': [{
|
||||
'name': 'x-axis',
|
||||
'rows': [
|
||||
@@ -48,30 +46,30 @@ define(
|
||||
'control': 'select',
|
||||
'key': 'key',
|
||||
'options': [
|
||||
{'name':'SCET', 'value': 'scet'},
|
||||
{'name':'SCLK', 'value': 'sclk'},
|
||||
{'name':'LST', 'value': 'lst'}
|
||||
{'name': 'SCET', 'value': 'scet'},
|
||||
{'name': 'SCLK', 'value': 'sclk'},
|
||||
{'name': 'LST', 'value': 'lst'}
|
||||
]
|
||||
}
|
||||
]
|
||||
}]};
|
||||
}]};
|
||||
|
||||
this.yAxisForm = {
|
||||
'name':'y-axis',
|
||||
'sections': [{
|
||||
// Will need to be repeated for each y-axis, with a
|
||||
// distinct name for each. Ideally the name of the axis
|
||||
// itself.
|
||||
'name': 'y-axis',
|
||||
'rows': [
|
||||
'sections': [{
|
||||
// Will need to be repeated for each y-axis, with a
|
||||
// distinct name for each. Ideally the name of the axis
|
||||
// itself.
|
||||
'name': 'y-axis',
|
||||
'rows': [
|
||||
{
|
||||
'name': 'Range',
|
||||
'control': 'select',
|
||||
'key': 'key',
|
||||
'options': [
|
||||
{'name':'EU', 'value': 'eu'},
|
||||
{'name':'DN', 'value': 'dn'},
|
||||
{'name':'Status', 'value': 'status'}
|
||||
{'name': 'EU', 'value': 'eu'},
|
||||
{'name': 'DN', 'value': 'dn'},
|
||||
{'name': 'Status', 'value': 'status'}
|
||||
]
|
||||
},
|
||||
{
|
||||
@@ -97,7 +95,7 @@ define(
|
||||
}]
|
||||
};
|
||||
this.plotSeriesForm = {
|
||||
'name':'Series Options',
|
||||
'name': 'Series Options',
|
||||
'sections': [
|
||||
{
|
||||
rows: [
|
||||
@@ -108,7 +106,7 @@ define(
|
||||
}]
|
||||
},
|
||||
{
|
||||
'rows':[
|
||||
'rows': [
|
||||
{
|
||||
'name': 'Markers',
|
||||
'control': 'checkbox',
|
||||
@@ -118,7 +116,7 @@ define(
|
||||
]
|
||||
},
|
||||
{
|
||||
'rows':[
|
||||
'rows': [
|
||||
{
|
||||
'name': 'No Line',
|
||||
'control': 'radio',
|
||||
|
||||
@@ -19,7 +19,6 @@
|
||||
* this source code distribution or the Licensing information page available
|
||||
* at runtime from the About dialog for additional information.
|
||||
*****************************************************************************/
|
||||
/*global define*/
|
||||
|
||||
define(
|
||||
[
|
||||
@@ -27,7 +26,6 @@ define(
|
||||
'./elements/PlotTickGenerator'
|
||||
],
|
||||
function (PlotPosition, PlotTickGenerator) {
|
||||
"use strict";
|
||||
|
||||
var DOMAIN_TICKS = 5,
|
||||
RANGE_TICKS = 7;
|
||||
@@ -69,9 +67,9 @@ define(
|
||||
* implies that there is no range data displayed either
|
||||
* @returns {boolean} true if domain data exists for the current pan/zoom level
|
||||
*/
|
||||
SubPlot.prototype.hasDomainData = function() {
|
||||
return this.panZoomStack
|
||||
&& this.panZoomStack.getDimensions()[0] > 0;
|
||||
SubPlot.prototype.hasDomainData = function () {
|
||||
return this.panZoomStack &&
|
||||
this.panZoomStack.getDimensions()[0] > 0;
|
||||
};
|
||||
|
||||
// Utility function for filtering out empty strings.
|
||||
@@ -111,7 +109,7 @@ define(
|
||||
// associated with conversion to a 32-bit floating point
|
||||
// format (which is needed in the chart area itself, by WebGL.)
|
||||
SubPlot.prototype.toDisplayable = function (position) {
|
||||
return [ position[0] - this.domainOffset, position[1] ];
|
||||
return [position[0] - this.domainOffset, position[1]];
|
||||
};
|
||||
|
||||
// Update the current hover coordinates
|
||||
@@ -147,7 +145,7 @@ define(
|
||||
end: this.toDisplayable(
|
||||
this.mousePositionToDomainRange(this.mousePosition)
|
||||
),
|
||||
color: [1, 1, 1, 0.5 ]
|
||||
color: [1, 1, 1, 0.5]
|
||||
}] : undefined;
|
||||
};
|
||||
|
||||
@@ -191,7 +189,7 @@ define(
|
||||
this.panZoomStack
|
||||
);
|
||||
|
||||
delta = [ current[0] - start[0], current[1] - start[1] ];
|
||||
delta = [current[0] - start[0], current[1] - start[1]];
|
||||
nextOrigin = [
|
||||
this.panStartBounds.origin[0] - delta[0],
|
||||
this.panStartBounds.origin[1] - delta[1]
|
||||
|
||||
@@ -19,12 +19,10 @@
|
||||
* this source code distribution or the Licensing information page available
|
||||
* at runtime from the About dialog for additional information.
|
||||
*****************************************************************************/
|
||||
/*global define*/
|
||||
|
||||
define(
|
||||
["./SubPlot"],
|
||||
function (SubPlot) {
|
||||
"use strict";
|
||||
|
||||
/**
|
||||
* Utility factory; wraps the SubPlot constructor and adds
|
||||
|
||||
@@ -19,12 +19,10 @@
|
||||
* this source code distribution or the Licensing information page available
|
||||
* at runtime from the About dialog for additional information.
|
||||
*****************************************************************************/
|
||||
/*global define*/
|
||||
|
||||
define(
|
||||
[],
|
||||
function () {
|
||||
"use strict";
|
||||
|
||||
/**
|
||||
* A PlotAxis provides a template-ready set of options
|
||||
|
||||
@@ -19,12 +19,10 @@
|
||||
* this source code distribution or the Licensing information page available
|
||||
* at runtime from the About dialog for additional information.
|
||||
*****************************************************************************/
|
||||
/*global define,Float32Array*/
|
||||
|
||||
define(
|
||||
[],
|
||||
function () {
|
||||
'use strict';
|
||||
|
||||
/**
|
||||
* Tracks the limit state of telemetry objects being plotted.
|
||||
|
||||
@@ -19,12 +19,10 @@
|
||||
* this source code distribution or the Licensing information page available
|
||||
* at runtime from the About dialog for additional information.
|
||||
*****************************************************************************/
|
||||
/*global define,Float32Array*/
|
||||
|
||||
define(
|
||||
['./PlotSeriesWindow'],
|
||||
function (PlotSeriesWindow) {
|
||||
"use strict";
|
||||
|
||||
|
||||
/**
|
||||
|
||||
@@ -19,12 +19,10 @@
|
||||
* this source code distribution or the Licensing information page available
|
||||
* at runtime from the About dialog for additional information.
|
||||
*****************************************************************************/
|
||||
/*global define,Float32Array*/
|
||||
|
||||
define(
|
||||
[],
|
||||
function () {
|
||||
"use strict";
|
||||
|
||||
/**
|
||||
* Contains the buffer used to draw a plot.
|
||||
@@ -37,7 +35,7 @@ define(
|
||||
function PlotLineBuffer(domainOffset, initialSize, maxSize) {
|
||||
this.buffer = new Float32Array(initialSize * 2);
|
||||
this.rangeExtrema =
|
||||
[ Number.POSITIVE_INFINITY, Number.NEGATIVE_INFINITY ];
|
||||
[Number.POSITIVE_INFINITY, Number.NEGATIVE_INFINITY];
|
||||
this.length = 0;
|
||||
this.domainOffset = domainOffset;
|
||||
this.initialSize = initialSize;
|
||||
|
||||
@@ -19,49 +19,47 @@
|
||||
* this source code distribution or the Licensing information page available
|
||||
* at runtime from the About dialog for additional information.
|
||||
*****************************************************************************/
|
||||
/*global define*/
|
||||
|
||||
/**
|
||||
* Plot palette. Defines colors for various plot lines.
|
||||
*/
|
||||
define(
|
||||
function () {
|
||||
'use strict';
|
||||
|
||||
// Prepare different forms of the palette, since we wish to
|
||||
// describe colors in several ways (as RGB 0-255, as
|
||||
// RGB 0.0-1.0, or as stylesheet-appropriate #-prefixed colors).
|
||||
var integerPalette = [
|
||||
[ 0x20, 0xB2, 0xAA ],
|
||||
[ 0x9A, 0xCD, 0x32 ],
|
||||
[ 0xFF, 0x8C, 0x00 ],
|
||||
[ 0xD2, 0xB4, 0x8C ],
|
||||
[ 0x40, 0xE0, 0xD0 ],
|
||||
[ 0x41, 0x69, 0xFF ],
|
||||
[ 0xFF, 0xD7, 0x00 ],
|
||||
[ 0x6A, 0x5A, 0xCD ],
|
||||
[ 0xEE, 0x82, 0xEE ],
|
||||
[ 0xCC, 0x99, 0x66 ],
|
||||
[ 0x99, 0xCC, 0xCC ],
|
||||
[ 0x66, 0xCC, 0x33 ],
|
||||
[ 0xFF, 0xCC, 0x00 ],
|
||||
[ 0xFF, 0x66, 0x33 ],
|
||||
[ 0xCC, 0x66, 0xFF ],
|
||||
[ 0xFF, 0x00, 0x66 ],
|
||||
[ 0xFF, 0xFF, 0x00 ],
|
||||
[ 0x80, 0x00, 0x80 ],
|
||||
[ 0x00, 0x86, 0x8B ],
|
||||
[ 0x00, 0x8A, 0x00 ],
|
||||
[ 0xFF, 0x00, 0x00 ],
|
||||
[ 0x00, 0x00, 0xFF ],
|
||||
[ 0xF5, 0xDE, 0xB3 ],
|
||||
[ 0xBC, 0x8F, 0x8F ],
|
||||
[ 0x46, 0x82, 0xB4 ],
|
||||
[ 0xFF, 0xAF, 0xAF ],
|
||||
[ 0x43, 0xCD, 0x80 ],
|
||||
[ 0xCD, 0xC1, 0xC5 ],
|
||||
[ 0xA0, 0x52, 0x2D ],
|
||||
[ 0x64, 0x95, 0xED ]
|
||||
[0x20, 0xB2, 0xAA],
|
||||
[0x9A, 0xCD, 0x32],
|
||||
[0xFF, 0x8C, 0x00],
|
||||
[0xD2, 0xB4, 0x8C],
|
||||
[0x40, 0xE0, 0xD0],
|
||||
[0x41, 0x69, 0xFF],
|
||||
[0xFF, 0xD7, 0x00],
|
||||
[0x6A, 0x5A, 0xCD],
|
||||
[0xEE, 0x82, 0xEE],
|
||||
[0xCC, 0x99, 0x66],
|
||||
[0x99, 0xCC, 0xCC],
|
||||
[0x66, 0xCC, 0x33],
|
||||
[0xFF, 0xCC, 0x00],
|
||||
[0xFF, 0x66, 0x33],
|
||||
[0xCC, 0x66, 0xFF],
|
||||
[0xFF, 0x00, 0x66],
|
||||
[0xFF, 0xFF, 0x00],
|
||||
[0x80, 0x00, 0x80],
|
||||
[0x00, 0x86, 0x8B],
|
||||
[0x00, 0x8A, 0x00],
|
||||
[0xFF, 0x00, 0x00],
|
||||
[0x00, 0x00, 0xFF],
|
||||
[0xF5, 0xDE, 0xB3],
|
||||
[0xBC, 0x8F, 0x8F],
|
||||
[0x46, 0x82, 0xB4],
|
||||
[0xFF, 0xAF, 0xAF],
|
||||
[0x43, 0xCD, 0x80],
|
||||
[0xCD, 0xC1, 0xC5],
|
||||
[0xA0, 0x52, 0x2D],
|
||||
[0x64, 0x95, 0xED]
|
||||
], stringPalette = integerPalette.map(function (arr) {
|
||||
// Convert to # notation for use in styles
|
||||
return '#' + arr.map(function (c) {
|
||||
|
||||
@@ -19,12 +19,10 @@
|
||||
* this source code distribution or the Licensing information page available
|
||||
* at runtime from the About dialog for additional information.
|
||||
*****************************************************************************/
|
||||
/*global define*/
|
||||
|
||||
define(
|
||||
[],
|
||||
function () {
|
||||
"use strict";
|
||||
|
||||
/**
|
||||
* The PlotPanZoomStack is responsible for maintaining the
|
||||
|
||||
@@ -19,12 +19,10 @@
|
||||
* this source code distribution or the Licensing information page available
|
||||
* at runtime from the About dialog for additional information.
|
||||
*****************************************************************************/
|
||||
/*global define*/
|
||||
|
||||
define(
|
||||
['./PlotPanZoomStack'],
|
||||
function (PlotPanZoomStack) {
|
||||
"use strict";
|
||||
|
||||
/**
|
||||
* A plot pan zoom stack group provides a collection of individual
|
||||
@@ -52,8 +50,8 @@ define(
|
||||
// For other stacks, do a push, but repeat
|
||||
// their current range axis bounds.
|
||||
stack.pushPanZoom(
|
||||
[ origin[0], stack.getOrigin()[1] ],
|
||||
[ dimensions[0], stack.getDimensions()[1] ]
|
||||
[origin[0], stack.getOrigin()[1]],
|
||||
[dimensions[0], stack.getDimensions()[1]]
|
||||
);
|
||||
}
|
||||
});
|
||||
|
||||
@@ -19,12 +19,10 @@
|
||||
* this source code distribution or the Licensing information page available
|
||||
* at runtime from the About dialog for additional information.
|
||||
*****************************************************************************/
|
||||
/*global define*/
|
||||
|
||||
define(
|
||||
[],
|
||||
function () {
|
||||
"use strict";
|
||||
|
||||
/**
|
||||
* A PlotPosition converts from pixel coordinates to domain-range
|
||||
@@ -62,7 +60,7 @@ define(
|
||||
// Note that range is reversed from the y-axis in pixel space
|
||||
//(positive range points up, positive pixel-y points down)
|
||||
this.position =
|
||||
[ x / width, (height - y) / height ].map(convert);
|
||||
[x / width, (height - y) / height].map(convert);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -19,7 +19,6 @@
|
||||
* this source code distribution or the Licensing information page available
|
||||
* at runtime from the About dialog for additional information.
|
||||
*****************************************************************************/
|
||||
/*global define,Float32Array*/
|
||||
|
||||
/**
|
||||
* Prepares data to be rendered in a GL Plot. Handles
|
||||
@@ -27,9 +26,10 @@
|
||||
*/
|
||||
define(
|
||||
function () {
|
||||
'use strict';
|
||||
|
||||
function identity(x) { return x; }
|
||||
function identity(x) {
|
||||
return x;
|
||||
}
|
||||
|
||||
/**
|
||||
* The PlotPreparer is responsible for handling data sets and
|
||||
|
||||
@@ -19,11 +19,9 @@
|
||||
* this source code distribution or the Licensing information page available
|
||||
* at runtime from the About dialog for additional information.
|
||||
*****************************************************************************/
|
||||
/*global define*/
|
||||
define(
|
||||
[],
|
||||
function () {
|
||||
"use strict";
|
||||
|
||||
/**
|
||||
* Provides a window on a telemetry data series, to support
|
||||
|
||||
@@ -19,12 +19,10 @@
|
||||
* this source code distribution or the Licensing information page available
|
||||
* at runtime from the About dialog for additional information.
|
||||
*****************************************************************************/
|
||||
/*global define*/
|
||||
|
||||
define(
|
||||
[],
|
||||
function () {
|
||||
'use strict';
|
||||
|
||||
var DIGITS = 3;
|
||||
|
||||
|
||||
@@ -19,12 +19,10 @@
|
||||
* this source code distribution or the Licensing information page available
|
||||
* at runtime from the About dialog for additional information.
|
||||
*****************************************************************************/
|
||||
/*global define*/
|
||||
|
||||
define(
|
||||
[],
|
||||
function () {
|
||||
"use strict";
|
||||
|
||||
/**
|
||||
* The PlotTickGenerator provides labels for ticks along the
|
||||
|
||||
@@ -19,12 +19,10 @@
|
||||
* this source code distribution or the Licensing information page available
|
||||
* at runtime from the About dialog for additional information.
|
||||
*****************************************************************************/
|
||||
/*global define,Float32Array*/
|
||||
|
||||
define(
|
||||
['./PlotLine', './PlotLineBuffer'],
|
||||
function (PlotLine, PlotLineBuffer) {
|
||||
'use strict';
|
||||
|
||||
var MAX_POINTS = 86400,
|
||||
PADDING_RATIO = 0.10, // Padding percentage for top & bottom
|
||||
@@ -73,7 +71,7 @@ define(
|
||||
|
||||
// Used in the reduce step of updateExtrema
|
||||
function reduceExtrema(a, b) {
|
||||
return [ Math.min(a[0], b[0]), Math.max(a[1], b[1]) ];
|
||||
return [Math.min(a[0], b[0]), Math.max(a[1], b[1])];
|
||||
}
|
||||
|
||||
// Convert a domain/range extrema to plot dimensions
|
||||
@@ -175,9 +173,9 @@ define(
|
||||
}).reduce(reduceExtrema);
|
||||
|
||||
// Calculate best-fit dimensions
|
||||
this.dimensions = [ this.domainExtrema, this.rangeExtrema ]
|
||||
this.dimensions = [this.domainExtrema, this.rangeExtrema]
|
||||
.map(dimensionsOf);
|
||||
this.origin = [ this.domainExtrema, this.rangeExtrema ]
|
||||
this.origin = [this.domainExtrema, this.rangeExtrema]
|
||||
.map(originOf);
|
||||
|
||||
// Enforce some minimum visible area
|
||||
|
||||
@@ -19,12 +19,10 @@
|
||||
* this source code distribution or the Licensing information page available
|
||||
* at runtime from the About dialog for additional information.
|
||||
*****************************************************************************/
|
||||
/*global define*/
|
||||
|
||||
define(
|
||||
["./PlotOverlayMode", "./PlotStackMode"],
|
||||
function (PlotOverlayMode, PlotStackMode) {
|
||||
"use strict";
|
||||
|
||||
var STACKED = {
|
||||
key: "stacked",
|
||||
@@ -91,7 +89,7 @@ define(
|
||||
*/
|
||||
function PlotModeOptions(telemetryObjects, subPlotFactory) {
|
||||
this.options = telemetryObjects.length > 1 ?
|
||||
[ OVERLAID, STACKED ] : [ OVERLAID ];
|
||||
[OVERLAID, STACKED] : [OVERLAID];
|
||||
this.mode = this.options[0]; // Initial selection (overlaid)
|
||||
this.telemetryObjects = telemetryObjects;
|
||||
this.subPlotFactory = subPlotFactory;
|
||||
|
||||
@@ -19,12 +19,10 @@
|
||||
* this source code distribution or the Licensing information page available
|
||||
* at runtime from the About dialog for additional information.
|
||||
*****************************************************************************/
|
||||
/*global define*/
|
||||
|
||||
define(
|
||||
["../SubPlot", "../elements/PlotPalette", "../elements/PlotPanZoomStack"],
|
||||
function (SubPlot, PlotPalette, PlotPanZoomStack) {
|
||||
"use strict";
|
||||
|
||||
/**
|
||||
* Handles plotting in Overlaid mode. In overlaid mode, there
|
||||
@@ -40,7 +38,7 @@ define(
|
||||
telemetryObjects,
|
||||
this.panZoomStack
|
||||
);
|
||||
this.subplots = [ this.subplot ];
|
||||
this.subplots = [this.subplot];
|
||||
}
|
||||
|
||||
PlotOverlayMode.prototype.plotTelemetry = function (updater) {
|
||||
|
||||
@@ -19,12 +19,10 @@
|
||||
* this source code distribution or the Licensing information page available
|
||||
* at runtime from the About dialog for additional information.
|
||||
*****************************************************************************/
|
||||
/*global define*/
|
||||
|
||||
define(
|
||||
["../SubPlot", "../elements/PlotPalette", "../elements/PlotPanZoomStackGroup"],
|
||||
function (SubPlot, PlotPalette, PlotPanZoomStackGroup) {
|
||||
"use strict";
|
||||
|
||||
/**
|
||||
* Handles plotting in Stacked mode. In stacked mode, there
|
||||
|
||||
@@ -19,11 +19,9 @@
|
||||
* this source code distribution or the Licensing information page available
|
||||
* at runtime from the About dialog for additional information.
|
||||
*****************************************************************************/
|
||||
/*global define*/
|
||||
|
||||
define(
|
||||
function () {
|
||||
"use strict";
|
||||
|
||||
/**
|
||||
* Policy preventing the Plot view from being made available for
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user