Compare commits

..

1 Commits

Author SHA1 Message Date
a7d322d01c [Table] Add datatable bundle
Add the datatable bundle which takes care of the basics of displaying
tabular data.
2016-02-11 11:45:57 -08:00
1494 changed files with 65111 additions and 69322 deletions

6
.gitignore vendored
View File

@ -3,13 +3,9 @@
*.gzip *.gzip
*.tgz *.tgz
*.DS_Store *.DS_Store
*.swp
# Compiled CSS, unless directly added
*.sass-cache *.sass-cache
*COMPILE.css *COMPILE.css
*.css
*.css.map
# Intellij project configuration files # Intellij project configuration files
*.idea *.idea
@ -36,5 +32,3 @@ protractor/logs
# npm-debug log # npm-debug log
npm-debug.log npm-debug.log
package-lock.json

View File

@ -1,5 +1,3 @@
{ {
"preset": "crockford", "preset": "crockford"
"requireMultipleVarDecl": false,
"requireVarDeclFirst": false
} }

View File

@ -1,26 +1,4 @@
{ {
"bitwise": true, "validthis": true,
"browser": true, "laxbreak": true
"curly": true,
"eqeqeq": true,
"forin": true,
"freeze": true,
"funcscope": false,
"futurehostile": true,
"latedef": true,
"noarg": true,
"nocomma": true,
"nonbsp": true,
"nonew": true,
"predef": [
"define",
"Promise",
"WeakMap",
"Map"
],
"shadow": "outer",
"strict": "implied",
"undef": true,
"unused": "vars",
"latedef": "nofunc"
} }

View File

@ -1,35 +0,0 @@
*.scssc
*.zip
*.gzip
*.tgz
*.DS_Store
*.sass-cache
*COMPILE.css
# Intellij project configuration files
*.idea
*.iml
# External dependencies
# Build output
target
# Mac OS X Finder
.DS_Store
# Closed source libraries
closed-lib
# Node, Bower dependencies
node_modules
bower_components
Procfile
# Protractor logs
protractor/logs
# npm-debug log
npm-debug.log

913
API.md
View File

@ -1,913 +0,0 @@
# Building Applications With Open MCT
## Scope and purpose of this document
This document is intended to serve as a reference for developing an application
based on Open MCT. It will provide details of the API functions necessary to
extend the Open MCT platform meet common use cases such as integrating with a telemetry source.
The best place to start is with the [Open MCT Tutorials](https://github.com/nasa/openmct-tutorial).
These will walk you through the process of getting up and running with Open
MCT, as well as addressing some common developer use cases.
## Building From Source
The latest version of Open MCT is available from [our GitHub repository](https://github.com/nasa/openmct).
If you have `git`, and `node` installed, you can build Open MCT with the
commands
```bash
git clone https://github.com/nasa/openmct.git
cd openmct
npm install
```
These commands will fetch the Open MCT source from our GitHub repository, and
build a minified version that can be included in your application. The output
of the build process is placed in a `dist` folder under the openmct source
directory, which can be copied out to another location as needed. The contents
of this folder will include a minified javascript file named `openmct.js` as
well as assets such as html, css, and images necessary for the UI.
## Starting an Open MCT application
To start a minimally functional Open MCT application, it is necessary to
include the Open MCT distributable, enable some basic plugins, and bootstrap
the application. The tutorials walk through the process of getting Open MCT up
and running from scratch, but provided below is a minimal HTML template that
includes Open MCT, installs some basic plugins, and bootstraps the application.
It assumes that Open MCT is installed under an `openmct` subdirectory, as
described in [Building From Source](#building-from-source).
This approach includes openmct using a simple script tag, resulting in a global
variable named `openmct`. This `openmct` object is used subsequently to make
API calls.
Open MCT is packaged as a UMD (Universal Module Definition) module, so common
script loaders are also supported.
```html
<!DOCTYPE html>
<html>
<head>
<title>Open MCT</title>
<script src="openmct.js"></script>
</head>
<body>
<script>
openmct.setAssetPath('openmct/dist');
openmct.install(openmct.plugins.LocalStorage());
openmct.install(openmct.plugins.MyItems());
openmct.install(openmct.plugins.UTCTimeSystem());
openmct.install(openmct.plugins.Espresso());
openmct.start();
</script>
</body>
</html>
```
The Open MCT library included above requires certain assets such as html
templates, images, and css. If you installed Open MCT from GitHub as described
in the section on [Building from Source](#building-from-source) then these
assets will have been downloaded along with the Open MCT javascript library.
You can specify the location of these assets by calling `openmct.setAssetPath()`.
Typically this will be the same location as the `openmct.js` library is
included from.
There are some plugins bundled with the application that provide UI,
persistence, and other default configuration which are necessary to be able to
do anything with the application initially. Any of these plugins can, in
principle, be replaced with a custom plugin. The included plugins are
documented in the [Included Plugins](#included-plugins) section.
## Plugins
### Defining and Installing a New Plugin
```javascript
openmct.install(function install(openmctAPI) {
// Do things here
// ...
});
```
New plugins are installed in Open MCT by calling `openmct.install`, and
providing a plugin installation function. This function will be invoked on
application startup with one parameter - the openmct API object. A common
approach used in the Open MCT codebase is to define a plugin as a function that
returns this installation function. This allows configuration to be specified
when the plugin is included.
eg.
```javascript
openmct.install(openmct.plugins.Elasticsearch("http://localhost:8002/openmct"));
```
This approach can be seen in all of the [plugins provided with Open MCT](https://github.com/nasa/openmct/blob/master/src/plugins/plugins.js).
## Domain Objects and Identifiers
_Domain Objects_ are the basic entities that represent domain knowledge in Open
MCT. The temperature sensor on a solar panel, an overlay plot comparing the
results of all temperature sensors, the command dictionary for a spacecraft,
the individual commands in that dictionary, the "My Items" folder: All of these
things are domain objects.
A _Domain Object_ is simply a javascript object with some standard attributes.
An example of a _Domain Object_ is the "My Items" object which is a folder in
which a user can persist any objects that they create. The My Items object
looks like this:
```javascript
{
identifier: {
namespace: ""
key: "mine"
}
name:"My Items",
type:"folder",
location:"ROOT",
composition: []
}
```
### Object Attributes
The main attributes to note are the `identifier`, and `type` attributes.
* `identifier`: A composite key that provides a universally unique identifier
for this object. The `namespace` and `key` are used to identify the object.
The `key` must be unique within the namespace.
* `type`: All objects in Open MCT have a type. Types allow you to form an
ontology of knowledge and provide an abstraction for grouping, visualizing,
and interpreting data. Details on how to define a new object type are
provided below.
Open MCT uses a number of builtin types. Typically you are going to want to
define your own when extending Open MCT.
### Domain Object Types
Custom types may be registered via the `addType` function on the Open MCT Type
registry.
eg.
```javascript
openmct.types.addType('my-type', {
name: "My Type",
description: "This is a type that I added!",
creatable: true
});
```
The `addType` function accepts two arguments:
* A `string` key identifying the type. This key is used when specifying a type
for an object.
* An object type specification. An object type definition supports the following
attributes
* `name`: a `string` naming this object type
* `description`: a `string` specifying a longer-form description of this type
* `initialize`: a `function` which initializes the model for new domain objects
of this type. This can be used for setting default values on an object when
it is instantiated.
* `creatable`: A `boolean` indicating whether users should be allowed to create
this type (default: `false`). This will determine whether the type appears
in the `Create` menu.
* `cssClass`: A `string` specifying a CSS class to apply to each representation
of this object. This is used for specifying an icon to appear next to each
object of this type.
The [Open MCT Tutorials](https://github.com/openmct/openmct-tutorial) provide a
step-by-step examples of writing code for Open MCT that includes a [section on
defining a new object type](https://github.com/nasa/openmct-tutorial#step-3---providing-objects).
## Root Objects
In many cases, you'd like a certain object (or a certain hierarchy of objects)
to be accessible from the top level of the application (the tree on the left-hand
side of Open MCT.) For example, it is typical to expose a telemetry dictionary
as a hierarchy of telemetry-providing domain objects in this fashion.
To do so, use the `addRoot` method of the object API.
eg.
```javascript
openmct.objects.addRoot({
namespace: "my-namespace",
key: "my-key"
});
```
The `addRoot` function takes a single [object identifier](#domain-objects-and-identifiers)
as an argument.
Root objects are loaded just like any other objects, i.e. via an object
provider.
## Object Providers
An Object Provider is used to build _Domain Objects_, typically retrieved from
some source such as a persistence store or telemetry dictionary. In order to
integrate telemetry from a new source an object provider will need to be created
that can build objects representing telemetry points exposed by the telemetry
source. The API call to define a new object provider is fairly straightforward.
Here's a very simple example:
```javascript
openmct.objects.addProvider('example.namespace', {
get: function (identifier) {
return Promise.resolve({
identifier: identifier,
name: 'Example Object',
type: 'example-object-type'
});
}
});
```
The `addProvider` function takes two arguments:
* `namespace`: A `string` representing the namespace that this object provider
will provide objects for.
* `provider`: An `object` with a single function, `get`. This function accepts an
[Identifier](#domain-objects-and-identifiers) for the object to be provided.
It is expected that the `get` function will return a
[Promise](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise)
that resolves with the object being requested.
In future, object providers will support other methods to enable other operations
with persistence stores, such as creating, updating, and deleting objects.
## Composition Providers
The _composition_ of a domain object is the list of objects it contains, as shown
(for example) in the tree for browsing. Open MCT provides a
[default solution](#default-composition-provider) for composition, but there
may be cases where you want to provide the composition of a certain object
(or type of object) dynamically.
### Adding Composition Providers
You may want to populate a hierarchy under a custom root-level object based on
the contents of a telemetry dictionary. To do this, you can add a new
Composition Provider:
```javascript
openmct.composition.addProvider({
appliesTo: function (domainObject) {
return domainObject.type === 'my-type';
},
load: function (domainObject) {
return Promise.resolve(myDomainObjects);
}
});
```
The `addProvider` function accepts a Composition Provider object as its sole
argument. A Composition Provider is a javascript object exposing two functions:
* `appliesTo`: A `function` that accepts a `domainObject` argument, and returns
a `boolean` value indicating whether this composition provider applies to the
given object.
* `load`: A `function` that accepts a `domainObject` as an argument, and returns
a `Promise` that resolves with an array of [Identifier](#domain-objects-and-identifiers).
These identifiers will be used to fetch Domain Objects from an [Object Provider](#object-provider)
### Default Composition Provider
The default composition provider applies to any domain object with a `composition`
property. The value of `composition` should be an array of identifiers, e.g.:
```javascript
var domainObject = {
name: "My Object",
type: 'folder',
composition: [
{
id: '412229c3-922c-444b-8624-736d85516247',
namespace: 'foo'
},
{
key: 'd6e0ce02-5b85-4e55-8006-a8a505b64c75',
namespace: 'foo'
}
]
};
```
## Telemetry API
The Open MCT telemetry API provides two main sets of interfaces-- one for integrating telemetry data into Open MCT, and another for developing Open MCT visualization plugins utilizing telemetry API.
The APIs for visualization plugins are still a work in progress and docs may change at any time. However, the APIs for integrating telemetry metadata into Open MCT are stable and documentation is included below.
### Integrating Telemetry Sources
There are two main tasks for integrating telemetry sources-- describing telemetry objects with relevant metadata, and then providing telemetry data for those objects. You'll use an [Object Provider](#object-providers) to provide objects with the necessary [Telemetry Metadata](#telemetry-metadata), and then register a [Telemetry Provider](#telemetry-providers) to retrieve telemetry data for those objects.
For a step-by-step guide to building a telemetry adapter, please see the
[Open MCT Tutorials](https://github.com/nasa/openmct-tutorial).
#### Telemetry Metadata
A telemetry object is a domain object with a telemetry property. To take an example from the tutorial, here is the telemetry object for the "fuel" measurement of the spacecraft:
```json
{
"identifier": {
"namespace": "example.taxonomy",
"key": "prop.fuel"
},
"name": "Fuel",
"type": "example.telemetry",
"telemetry": {
"values": [
{
"key": "value",
"name": "Value",
"units": "kilograms",
"format": "float",
"min": 0,
"max": 100,
"hints": {
"range": 1
}
},
{
"key": "utc",
"source": "timestamp",
"name": "Timestamp",
"format": "utc",
"hints": {
"domain": 1
}
}
]
}
}
```
The most important part of the telemetry metadata is the `values` property-- this describes the attributes of telemetry datums (objects) that a telemetry provider returns. These descriptions must be provided for telemetry views to work properly.
##### Values
`telemetry.values` is an array of value description objects, which have the following fields:
attribute | type | flags | notes
--- | --- | --- | ---
`key` | string | required | unique identifier for this field.
`hints` | object | required | Hints allow views to intelligently select relevant attributes for display, and are required for most views to function. See section on "Value Hints" below.
`name` | string | optional | a human readible label for this field. If omitted, defaults to `key`.
`source` | string | optional | identifies the property of a datum where this value is stored. If omitted, defaults to `key`.
`format` | string | optional | a specific format identifier, mapping to a formatter. If omitted, uses a default formatter. For enumerations, use `enum`. For timestamps, use `utc` if you are using utc dates, otherwise use a key mapping to your custom date format.
`units` | string | optional | the units of this value, e.g. `km`, `seconds`, `parsecs`
`min` | number | optional | the minimum possible value of this measurement. Will be used by plots, gauges, etc to automatically set a min value.
`max` | number | optional | the maximum possible value of this measurement. Will be used by plots, gauges, etc to automatically set a max value.
`enumerations` | array | optional | for objects where `format` is `"enum"`, this array tracks all possible enumerations of the value. Each entry in this array is an object, with a `value` property that is the numerical value of the enumeration, and a `string` property that is the text value of the enumeration. ex: `{"value": 0, "string": "OFF"}`. If you use an enumerations array, `min` and `max` will be set automatically for you.
###### Value Hints
Each telemetry value description has an object defining hints. Keys in this this object represent the hint itself, and the value represents the weight of that hint. A lower weight means the hint has a higher priority. For example, multiple values could be hinted for use as the y axis of a plot (raw, engineering), but the highest priority would be the default choice. Likewise, a table will use hints to determine the default order of columns.
Known hints:
* `domain`: Indicates that the value represents the "input" of a datum. Values with a `domain` hint will be used for the x-axis of a plot, and tables will render columns for these values first.
* `range`: Indicates that the value is the "output" of a datum. Values with a `range` hint will be used as the y-axis on a plot, and tables will render columns for these values after the `domain` values.
* `image`: Indicates that the value may be interpreted as the URL to an image file, in which case appropriate views will be made available.
##### The Time Conductor and Telemetry
Open MCT provides a number of ways to pivot through data and link data via time. The Time Conductor helps synchronize multiple views around the same time.
In order for the time conductor to work, there will always be an active "time system". All telemetry metadata *must* have a telemetry value with a `key` that matches the `key` of the active time system. You can use the `source` attribute on the value metadata to remap this to a different field in the telemetry datum-- especially useful if you are working with disparate datasources that have different field mappings.
#### Telemetry Providers
Telemetry providers are responsible for providing historical and real time telemetry data for telemetry objects. Each telemetry provider determines which objects it can provide telemetry for, and then must implement methods to provide telemetry for those objects.
A telemetry provider is a javascript object with up to four methods:
* `supportsSubscribe(domainObject, callback, options)` optional. Must be implemented to provide realtime telemetry. Should return `true` if the provider supports subscriptions for the given domain object (and request options).
* `subscribe(domainObject, callback, options)` required if `supportsSubscribe` is implemented. Establish a subscription for realtime data for the given domain object. Should invoke `callback` with a single telemetry datum every time data is received. Must return an unsubscribe function. Multiple views can subscribe to the same telemetry object, so it should always return a new unsubscribe function.
* `supportsRequest(domainObject, options)` optional. Must be implemented to provide historical telemetry. Should return `true` if the provider supports historical requests for the given domain object.
* `request(domainObject, options)` required if `supportsRequest` is implemented. Must return a promise for an array of telemetry datums that fulfills the request. The `options` argument will include a `start`, `end`, and `domain` attribute representing the query bounds. For more request properties, see Request Properties below.
Telemetry providers are registered by calling `openmct.telemetry.addProvider(provider)`, e.g.
```javascript
openmct.telemetry.addProvider({
supportsRequest: function (domainObject, options) { /*...*/ },
request: function (domainObject, options) { /*...*/ },
supportsSubscribe: function (domainObject, callback, options) { /*...*/ },
subscribe: function (domainObject, callback, options) { /*...*/ }
})
```
#### Telemetry Requests
Telemetry requests support time bounded queries. A call to a _Telemetry Provider_'s `request` function will include an `options` argument. These are simply javascript objects with attributes for the request parameters. An example of a telemetry request object with a start and end time is included below:
```javascript
{
start: 1487981997240,
end: 1487982897240,
domain: 'utc'
}
```
#### Telemetry Formats
Telemetry format objects define how to interpret and display telemetry data.
They have a simple structure:
* `key`: A `string` that uniquely identifies this formatter.
* `format`: A `function` that takes a raw telemetry value, and returns a
human-readable `string` representation of that value. It has one required
argument, and three optional arguments that provide context and can be used
for returning scaled representations of a value. An example of this is
representing time values in a scale such as the time conductor scale. There
are multiple ways of representing a point in time, and by providing a minimum
scale value, maximum scale value, and a count, it's possible to provide more
useful representations of time given the provided limitations.
* `value`: The raw telemetry value in its native type.
* `minValue`: An __optional__ argument specifying the minimum displayed
value.
* `maxValue`: An __optional__ argument specifying the maximum displayed
value.
* `count`: An __optional__ argument specifying the number of displayed
values.
* `parse`: A `function` that takes a `string` representation of a telemetry
value, and returns the value in its native type. **Note** parse might receive an already-parsed value. This function should be idempotent.
* `validate`: A `function` that takes a `string` representation of a telemetry
value, and returns a `boolean` value indicating whether the provided string
can be parsed.
##### Registering Formats
Formats are registered with the Telemetry API using the `addFormat` function. eg.
``` javascript
openmct.telemetry.addFormat({
key: 'number-to-string',
format: function (number) {
return number + '';
},
parse: function (text) {
return Number(text);
},
validate: function (text) {
return !isNaN(text);
}
});
```
#### Telemetry Data
A single telemetry point is considered a Datum, and is represented by a standard
javascript object. Realtime subscriptions (obtained via __subscribe__) will
invoke the supplied callback once for each telemetry datum recieved. Telemetry
requests (obtained via __request__) will return a promise for an array of
telemetry datums.
##### Telemetry Datums
A telemetry datum is a simple javascript object, e.g.:
```json
{
"timestamp": 1491267051538,
"value": 77,
"id": "prop.fuel"
}
```
The key-value pairs of this object are described by the telemetry metadata of
a domain object, as discussed in the [Telemetry Metadata](#telemetry-metadata)
section.
## Time API
Open MCT provides API for managing the temporal state of the application.
Central to this is the concept of "time bounds". Views in Open MCT will
typically show telemetry data for some prescribed date range, and the Time API
provides a way to centrally manage these bounds.
The Time API exposes a number of methods for querying and setting the temporal
state of the application, and emits events to inform listeners when the state changes.
Because the data displayed tends to be time domain data, Open MCT must always
have at least one time system installed and activated. When you download Open
MCT, it will be pre-configured to use the UTC time system, which is installed and activated, along with other default plugins, in `index.html`. Installing and activating a time system is simple, and is covered
[in the next section](#defining-and-registering-time-systems).
### Time Systems and Bounds
#### Defining and Registering Time Systems
The time bounds of an Open MCT application are defined as numbers, and a Time
System gives meaning and context to these numbers so that they can be correctly
interpreted. Time Systems are JavaScript objects that provide some information
about the current time reference frame. An example of defining and registering
a new time system is given below:
``` javascript
openmct.time.addTimeSystem({
key: 'utc',
name: 'UTC Time',
cssClass = 'icon-clock',
timeFormat = 'utc',
durationFormat = 'duration',
isUTCBased = true
});
```
The example above defines a new utc based time system. In fact, this time system
is configured and activated by default from `index.html` in the default
installation of Open MCT if you download the source from GitHub. Some details of
each of the required properties is provided below.
* `key`: A `string` that uniquely identifies this time system.
* `name`: A `string` providing a brief human readable label. If the [Time Conductor](#the-time-conductor)
plugin is enabled, this name will identify the time system in a dropdown menu.
* `cssClass`: A class name `string` that will be applied to the time system when
it appears in the UI. This will be used to represent the time system with an icon.
There are a number of built-in icon classes [available in Open MCT](https://github.com/nasa/openmct/blob/master/platform/commonUI/general/res/sass/_glyphs.scss),
or a custom class can be used here.
* `timeFormat`: A `string` corresponding to the key of a registered
[telemetry time format](#telemetry-formats). The format will be used for
displaying discrete timestamps from telemetry streams when this time system is
activated. If the [UTCTimeSystem](#included-plugins) is enabled, then the `utc`
format can be used if this is a utc-based time system
* `durationFormat`: A `string` corresponding to the key of a registered
[telemetry time format](#telemetry-formats). The format will be used for
displaying time ranges, for example `00:15:00` might be used to represent a time
period of fifteen minutes. These are used by the Time Conductor plugin to specify
relative time offsets. If the [UTCTimeSystem](#included-plugins) is enabled,
then the `duration` format can be used if this is a utc-based time system
* `isUTCBased`: A `boolean` that defines whether this time system represents
numbers in UTC terrestrial time.
#### Getting and Setting the Active Time System
Once registered, a time system can be activated by calling `timeSystem` with
the timeSystem `key` or an instance of the time system. If you are not using a
[clock](#clocks), you must also specify valid [bounds](#time-bounds) for the
timeSystem.
```javascript
openmct.time.timeSystem('utc', bounds);
```
A time system can be immediately activated after registration:
```javascript
openmct.time.addTimeSystem(utcTimeSystem);
openmct.time.timeSystem(utcTimeSystem, bounds);
```
Setting the active time system will trigger a [`'timeSystem'`](#time-events)
event. If you supplied bounds, a [`'bounds'`](#time-events) event will be triggered afterwards with your newly supplied bounds.
### Time Bounds
The TimeAPI provides a getter/setter for querying and setting time bounds. Time
bounds are simply an object with a `start` and an end `end` attribute.
* `start`: A `number` representing a moment in time in the active [Time System](#defining-and-registering-time-systems).
This will be used as the beginning of the time period displayed by time-responsive
telemetry views.
* `end`: A `number` representing a moment in time in the active [Time System](#defining-and-registering-time-systems).
This will be used as the end of the time period displayed by time-responsive
telemetry views.
If invoked with bounds, it will set the new time bounds system-wide. If invoked
without any parameters, it will return the current application-wide time bounds.
``` javascript
const ONE_HOUR = 60 * 60 * 1000;
let now = Date.now();
openmct.time.bounds({start: now - ONE_HOUR, now);
```
To respond to bounds change events, listen for the [`'bounds'`](#time-events)
event.
## Clocks
The Time API can be set to follow a clock source which will cause the bounds
to be updated automatically whenever the clock source "ticks". A clock is simply
an object that supports registration of listeners and periodically invokes its
listeners with a number. Open MCT supports registration of new clock sources that
tick on almost anything. A tick occurs when the clock invokes callback functions
registered by its listeners with a new time value.
An example of a clock source is the [LocalClock](https://github.com/nasa/openmct/blob/master/src/plugins/utcTimeSystem/LocalClock.js)
which emits the current time in UTC every 100ms. Clocks can tick on anything. For
example, a clock could be defined to provide the timestamp of any new data
received via a telemetry subscription. This would have the effect of advancing
the bounds of views automatically whenever data is received. A clock could also
be defined to tick on some remote timing source.
The values provided by clocks are simple `number`s, which are interpreted in the
context of the active [Time System](#defining-and-registering-time-systems).
### Defining and registering clocks
A clock is an object that defines certain required metadata and functions:
* `key`: A `string` uniquely identifying this clock. This can be used later to
reference the clock in places such as the [Time Conductor configuration](#time-conductor-configuration)
* `cssClass`: A `string` identifying a CSS class to apply to this clock when it's
displayed in the UI. This will be used to represent the time system with an icon.
There are a number of built-in icon classes [available in Open MCT](https://github.com/nasa/openmct/blob/master/platform/commonUI/general/res/sass/_glyphs.scss),
or a custom class can be used here.
* `name`: A `string` providing a human-readable identifier for the clock source.
This will be displayed in the clock selector menu in the Time Conductor UI
component, if active.
* `description`: An __optional__ `string` providing a longer description of the
clock. The description will be visible in the clock selection menu in the Time
Conductor plugin.
* `on`: A `function` supporting registration of a new callback that will be
invoked when the clock next ticks. It will be invoked with two arguments:
* `eventName`: A `string` specifying the event to listen on. For now, clocks
support one event - `tick`.
* `callback`: A `function` that will be invoked when this clock ticks. The
function must be invoked with one parameter - a `number` representing a valid
time in the current time system.
* `off`: A `function` that allows deregistration of a tick listener. It accepts
the same arguments as `on`.
* `currentValue`: A `function` that returns a `number` representing a point in
time in the active time system. It should be the last value provided by a tick,
or some default value if no ticking has yet occurred.
A new clock can be registered using the `addClock` function exposed by the Time
API:
```javascript
var someClock = {
key: 'someClock',
cssClass: 'icon-clock',
name: 'Some clock',
description: "Presumably does something useful",
on: function (event, callback) {
// Some function that registers listeners, and updates them on a tick
},
off: function (event, callback) {
// Some function that unregisters listeners.
},
currentValue: function () {
// A function that returns the last ticked value for the clock
}
}
openmct.time.addClock(someClock);
```
An example clock implementation is provided in the form of the [LocalClock](https://github.com/nasa/openmct/blob/master/src/plugins/utcTimeSystem/LocalClock.js)
#### Getting and setting active clock
Once registered a clock can be activated by calling the `clock` function on the
Time API passing in the key or instance of a registered clock. Only one clock
may be active at once, so activating a clock will deactivate any currently
active clock. [`clockOffsets`](#clock-offsets) must be specified when changing a clock.
Setting the clock triggers a [`'clock'`](#time-events) event, followed by a [`'clockOffsets'`](#time-events) event, and then a [`'bounds'`](#time-events) event as the offsets are applied to the clock's currentValue().
```
openmct.time.clock(someClock, clockOffsets);
```
Upon being activated, the time API will listen for tick events on the clock by calling `clock.on`.
The currently active clock (if any) can be retrieved by calling the same
function without any arguments.
#### Stopping an active clock
The `stopClock` method can be used to stop an active clock, and to clear it. It
will stop the clock from ticking, and set the active clock to `undefined`.
``` javascript
openmct.time.stopClock();
```
#### Clock Offsets
When a clock is active, the time bounds of the application will be updated
automatically each time the clock "ticks". The bounds are calculated based on
the current value provided by the active clock (via its `tick` event, or its
`currentValue()` method).
Unlike bounds, which represent absolute time values, clock offsets represent
relative time spans. Offsets are defined as an object with two properties:
* `start`: A `number` that must be < 0 and which is used to calculate the start
bounds on each clock tick. The start offset will be calculated relative to the
value provided by a clock's tick callback, or its `currentValue()` function.
* `end`: A `number` that must be >= 0 and which is used to calculate the end
bounds on each clock tick.
The `clockOffsets` function can be used to get or set clock offsets. For example,
to show the last fifteen minutes in a ms-based time system:
```javascript
var FIFTEEN_MINUTES = 15 * 60 * 1000;
openmct.time.clockOffsets({
start: -FIFTEEN_MINUTES,
end: 0
})
```
__Note:__ Setting the clock offsets will trigger an immediate bounds change, as
new bounds will be calculated based on the `currentValue()` of the active clock.
Clock offsets are only relevant when a clock source is active.
## Time Events
The Time API is a standard event emitter; you can register callbacks for events using the `on` method and remove callbacks for events with the `off` method.
For example:
``` javascript
openmct.time.on('bounds', function callback (newBounds, tick) {
// Do something with new bounds
});
```
#### List of Time Events
The events emitted by the Time API are:
* `bounds`: emitted whenever the bounds change. The callback will be invoked
with two arguments:
* `bounds`: A [bounds](#getting-and-setting-bounds) bounds object
representing a new time period bound by the specified start and send times.
* `tick`: A `boolean` indicating whether or not this bounds change is due to
a "tick" from a [clock source](#clocks). This information can be useful
when determining a strategy for fetching telemetry data in response to a
bounds change event. For example, if the bounds change was automatic, and
is due to a tick then it's unlikely that you would need to perform a
historical data query. It should be sufficient to just show any new
telemetry received via subscription since the last tick, and optionally to
discard any older data that now falls outside of the currently set bounds.
If `tick` is false,then the bounds change was not due to an automatic tick,
and a query for historical data may be necessary, depending on your data
caching strategy, and how significantly the start bound has changed.
* `timeSystem`: emitted whenever the active time system changes. The callback will be invoked with a single argument:
* `timeSystem`: The newly active [time system](#defining-and-registering-time-systems).
* `clock`: emitted whenever the clock changes. The callback will be invoked
with a single argument:
* `clock`: The newly active [clock](#clocks), or `undefined` if an active
clock has been deactivated.
* `clockOffsets`: emitted whenever the active clock offsets change. The
callback will be invoked with a single argument:
* `clockOffsets`: The new [clock offsets](#clock-offsets).
## The Time Conductor
The Time Conductor provides a user interface for managing time bounds in Open
MCT. It allows a user to select from configured time systems and clocks, and to set bounds and clock offsets.
If activated, the time conductor must be provided with configuration options,
detailed below.
#### Time Conductor Configuration
The time conductor is configured by specifying the options that will be
available to the user from the menus in the time conductor. These will determine
the clocks available from the conductor, the time systems available for each
clock, and some default bounds and clock offsets for each combination of clock
and time system. By default, the conductor always supports a `fixed` mode where
no clock is active. To specify configuration for fixed mode, simply leave out a
`clock` attribute in the configuration entry object.
Configuration is provided as an `array` of menu options. Each entry of the
array is an object with some properties specifying configuration. The configuration
options specified are slightly different depending on whether or not it is for
an active clock mode.
__Configuration for Fixed Time Mode (no active clock)__
* `timeSystem`: A `string`, the key for the time system that this configuration
relates to.
* `bounds`: A [`Time Bounds`](#time-bounds) object. These bounds will be applied
when the user selects the time system specified in the previous `timeSystem`
property.
* `zoomOutLimit`: An __optional__ `number` specifying the longest period of time
that can be represented by the conductor when zooming. If a `zoomOutLimit` is
provided, then a `zoomInLimit` must also be provided. If provided, the zoom
slider will automatically become available in the Time Conductor UI.
* `zoomInLimit`: An __optional__ `number` specifying the shortest period of time
that can be represented by the conductor when zooming. If a `zoomInLimit` is
provided, then a `zoomOutLimit` must also be provided. If provided, the zoom
slider will automatically become available in the Time Conductor UI.
__Configuration for Active Clock__
* `clock`: A `string`, the `key` of the clock that this configuration applies to.
* `timeSystem`: A `string`, the key for the time system that this configuration
relates to. Separate configuration must be provided for each time system that you
wish to be available to users when they select the specified clock.
* `clockOffsets`: A [`clockOffsets`](#clock-offsets) object that will be
automatically applied when the combination of clock and time system specified in
this configuration is selected from the UI.
#### Example conductor configuration
An example time conductor configuration is provided below. It sets up some
default options for the [UTCTimeSystem](https://github.com/nasa/openmct/blob/master/src/plugins/utcTimeSystem/UTCTimeSystem.js)
and [LocalTimeSystem](https://github.com/nasa/openmct/blob/master/src/plugins/localTimeSystem/LocalTimeSystem.js),
in both fixed mode, and for the [LocalClock](https://github.com/nasa/openmct/blob/master/src/plugins/utcTimeSystem/LocalClock.js)
source. In this configutation, the local clock supports both the UTCTimeSystem
and LocalTimeSystem. Configuration for fixed bounds mode is specified by omitting
a clock key.
``` javascript
const ONE_YEAR = 365 * 24 * 60 * 60 * 1000;
const ONE_MINUTE = 60 * 1000;
openmct.install(openmct.plugins.Conductor({
menuOptions: [
// 'Fixed' bounds mode configuation for the UTCTimeSystem
{
timeSystem: 'utc',
bounds: {start: Date.now() - 30 * ONE_MINUTE, end: Date.now()},
zoomOutLimit: ONE_YEAR,
zoomInLimit: ONE_MINUTE
},
// Configuration for the LocalClock in the UTC time system
{
clock: 'local',
timeSystem: 'utc',
clockOffsets: {start: - 30 * ONE_MINUTE, end: 0},
zoomOutLimit: ONE_YEAR,
zoomInLimit: ONE_MINUTE
},
//Configuration for the LocaLClock in the Local time system
{
clock: 'local',
timeSystem: 'local',
clockOffsets: {start: - 15 * ONE_MINUTE, end: 0}
}
]
}));
```
## Included Plugins
Open MCT is packaged along with a few general-purpose plugins:
* `openmct.plugins.Conductor` provides a user interface for working with time
within the application. If activated, configuration must be provided. This is
detailed in the section on [Time Conductor Configuration](#time-conductor-configuration).
* `openmct.plugins.CouchDB` is an adapter for using CouchDB for persistence
of user-created objects. This is a constructor that takes the URL for the
CouchDB database as a parameter, e.g.
```javascript
openmct.install(openmct.plugins.CouchDB('http://localhost:5984/openmct'))
```
* `openmct.plugins.Elasticsearch` is an adapter for using Elasticsearch for
persistence of user-created objects. This is a
constructor that takes the URL for the Elasticsearch instance as a
parameter. eg.
```javascript
openmct.install(openmct.plugins.CouchDB('http://localhost:9200'))
```
* `openmct.plugins.Espresso` and `openmct.plugins.Snow` are two different
themes (dark and light) available for Open MCT. Note that at least one
of these themes must be installed for Open MCT to appear correctly.
* `openmct.plugins.URLIndicatorPlugin` adds an indicator which shows the
availability of a URL with the following options:
- `url` : URL to indicate the status of
- `cssClass`: Icon to show in the status bar, defaults to `icon-database`, [list of all icons](https://nasa.github.io/openmct/style-guide/#/browse/styleguide:home?view=items)
- `interval`: Interval between checking the connection, defaults to `10000`
- `label` Name showing up as text in the status bar, defaults to url
```javascript
openmct.install(openmct.plugins.URLIndicatorPlugin({
url: 'http://google.com',
cssClass: 'check',
interval: 10000,
label: 'Google'
})
);
```
* `openmct.plugins.LocalStorage` provides persistence of user-created
objects in browser-local storage. This is particularly useful in
development environments.
* `openmct.plugins.MyItems` adds a top-level folder named "My Items"
when the application is first started, providing a place for a
user to store created items.
* `openmct.plugins.UTCTimeSystem` provides a default time system for Open MCT.
Generally, you will want to either install these plugins, or install
different plugins that provide persistence and an initial folder
hierarchy.
eg.
```javascript
openmct.install(openmct.plugins.LocalStorage());
openmct.install(openmct.plugins.MyItems());
```

View File

@ -1,6 +1,6 @@
# Contributing to Open MCT # Contributing to Open MCT Web
This document describes the process of contributing to Open MCT as well This document describes the process of contributing to Open MCT Web as well
as the standards that will be applied when evaluating contributions. as the standards that will be applied when evaluating contributions.
Please be aware that additional agreements will be necessary before we can Please be aware that additional agreements will be necessary before we can
@ -21,9 +21,9 @@ The short version:
## Contribution Process ## Contribution Process
Open MCT uses git for software version control, and for branching and Open MCT Web uses git for software version control, and for branching and
merging. The central repository is at merging. The central repository is at
https://github.com/nasa/openmct.git. https://github.com/nasa/openmctweb.git.
### Roles ### Roles
@ -43,9 +43,9 @@ the check-in process. These roles are:
Three basic types of branches may be included in the above repository: Three basic types of branches may be included in the above repository:
1. Master branch 1. Master branch.
2. Topic branches 2. Topic branches.
3. Developer branches 3. Developer branches.
Branches which do not fit into the above categories may be created and used Branches which do not fit into the above categories may be created and used
during the course of development for various reasons, such as large-scale during the course of development for various reasons, such as large-scale
@ -107,7 +107,7 @@ back into the master branch is to file a Pull Request. The contributions
should meet code, test, and commit message standards as described below, should meet code, test, and commit message standards as described below,
and the pull request should include a completed author checklist, also and the pull request should include a completed author checklist, also
as described below. Pull requests may be assigned to specific team as described below. Pull requests may be assigned to specific team
members when appropriate (e.g. to draw to a specific person's attention). members when appropriate (e.g. to draw to a specific person's attention.)
Code review should take place using discussion features within the pull Code review should take place using discussion features within the pull
request. When the reviewer is satisfied, they should add a comment to request. When the reviewer is satisfied, they should add a comment to
@ -116,40 +116,40 @@ the merge back to the master branch.
## Standards ## Standards
Contributions to Open MCT are expected to meet the following standards. Contributions to Open MCT Web are expected to meet the following standards.
In addition, reviewers should use general discretion before accepting In addition, reviewers should use general discretion before accepting
changes. changes.
### Code Standards ### Code Standards
JavaScript sources in Open MCT must satisfy JSLint under its default JavaScript sources in Open MCT Web must satisfy JSLint under its default
settings. This is verified by the command line build. settings. This is verified by the command line build.
#### Code Guidelines #### Code Guidelines
JavaScript sources in Open MCT should: JavaScript sources in Open MCT Web should:
* Use four spaces for indentation. Tabs should not be used. * Use four spaces for indentation. Tabs should not be used.
* Include JSDoc for any exposed API (e.g. public methods, constructors). * Include JSDoc for any exposed API (e.g. public methods, constructors.)
* Include non-JSDoc comments as-needed for explaining private variables, * Include non-JSDoc comments as-needed for explaining private variables,
methods, or algorithms when they are non-obvious. methods, or algorithms when they are non-obvious.
* Define one public class per script, expressed as a constructor function * Define one public class per script, expressed as a constructor function
returned from an AMD-style module. returned from an AMD-style module.
* Follow “Java-like” naming conventions. These includes: * Follow “Java-like” naming conventions. These includes:
* Classes should use camel case, first letter capitalized * Classes should use camel case, first letter capitalized
(e.g. SomeClassName). (e.g. SomeClassName.)
* Methods, variables, fields, and function names should use camel case, * Methods, variables, fields, and function names should use camel case,
first letter lower-case (e.g. someVariableName). first letter lower-case (e.g. someVariableName.) Constants
* Constants (variables or fields which are meant to be declared and (variables or fields which are meant to be declared and initialized
initialized statically, and never changed) should use only capital statically, and never changed) should use only capital letters, with
letters, with underscores between words (e.g. SOME_CONSTANT). underscores between words (e.g. SOME_CONSTANT.)
* File names should be the name of the exported class, plus a .js extension * File name should be the name of the exported class, plus a .js extension
(e.g. SomeClassName.js). (e.g. SomeClassName.js)
* Avoid anonymous functions, except when functions are short (a few lines) * Avoid anonymous functions, except when functions are short (a few lines)
and/or their inclusion makes sense within the flow of the code and/or their inclusion makes sense within the flow of the code
(e.g. as arguments to a forEach call). (e.g. as arguments to a forEach call.)
* Avoid deep nesting (especially of functions), except where necessary * Avoid deep nesting (especially of functions), except where necessary
(e.g. due to closure scope). (e.g. due to closure scope.)
* End with a single new-line character. * End with a single new-line character.
* Expose public methods by declaring them on the class's prototype. * Expose public methods by declaring them on the class's prototype.
* Within a given function's scope, do not mix declarations and imperative * Within a given function's scope, do not mix declarations and imperative
@ -159,7 +159,7 @@ JavaScript sources in Open MCT should:
* Third, imperative statements. * Third, imperative statements.
* Finally, the returned value. * Finally, the returned value.
Deviations from Open MCT code style guidelines require two-party agreement, Deviations from Open MCT Web code style guidelines require two-party agreement,
typically from the author of the change and its reviewer. typically from the author of the change and its reviewer.
#### Code Example #### Code Example
@ -234,7 +234,7 @@ Commit messages should:
line of white space. line of white space.
* Contain a short (usually one word) reference to the feature or subsystem * Contain a short (usually one word) reference to the feature or subsystem
the commit effects, in square brackets, at the start of the subject line the commit effects, in square brackets, at the start of the subject line
(e.g. `[Documentation] Draft of check-in process`). (e.g. `[Documentation] Draft of check-in process`)
* Contain a reference to a relevant issue number in the body of the commit. * Contain a reference to a relevant issue number in the body of the commit.
* This is important for traceability; while branch names also provide this, * This is important for traceability; while branch names also provide this,
you cannot tell from looking at a commit what branch it was authored on. you cannot tell from looking at a commit what branch it was authored on.
@ -250,9 +250,9 @@ Commit messages should:
Commit messages should not: Commit messages should not:
* Exceed 54 characters in length on the subject line. * Exceed 54 characters in length on the subject line.
* Exceed 72 characters in length in the body of the commit, * Exceed 72 characters in length in the body of the commit.
* Except where necessary to maintain the structure of machine-readable or * Except where necessary to maintain the structure of machine-readable or
machine-generated text (e.g. error messages). machine-generated text (e.g. error messages)
See [Contributing to a Project](http://git-scm.com/book/ch5-2.html) from See [Contributing to a Project](http://git-scm.com/book/ch5-2.html) from
Pro Git by Shawn Chacon and Ben Straub for a bit of the rationale behind Pro Git by Shawn Chacon and Ben Straub for a bit of the rationale behind
@ -260,7 +260,7 @@ these standards.
## Issue Reporting ## Issue Reporting
Issues are tracked at https://github.com/nasa/openmct/issues. Issues are tracked at https://github.com/nasa/openmctweb/issues
Issues should include: Issues should include:
@ -284,7 +284,7 @@ Issue severity is categorized as follows (in ascending order):
The following check lists should be completed and attached to pull requests The following check lists should be completed and attached to pull requests
when they are filed (author checklist) and when they are merged (reviewer when they are filed (author checklist) and when they are merged (reviewer
checklist). checklist.)
### Author Checklist ### Author Checklist

View File

@ -1,12 +1,12 @@
# Open MCT Licenses # Open MCT Web Licenses
Open MCT, Copyright (c) 2014-2017, United States Government as represented by the Administrator of the National Aeronautics and Space Administration. All rights reserved. Open MCT Web, Copyright (c) 2014-2015, United States Government as represented by the Administrator of the National Aeronautics and Space Administration. All rights reserved.
Open MCT is licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0. Open MCT Web is licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0.
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
Open MCT includes source code licensed under additional open source licenses as follows. Open MCT Web includes source code licensed under additional open source licenses as follows.
## Software Components Licenses ## Software Components Licenses
@ -309,6 +309,30 @@ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLI
--- ---
### Modernizr
#### Info
* Link: http://modernizr.com
* Version: 2.6.2
* Author: Faruk Ateş
* Description: Browser/device capability finding
#### License
Copyright (c) 20092015
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
---
### Normalize.css ### Normalize.css
#### Info #### Info
@ -392,104 +416,6 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
--- ---
### CSV.js
#### Info
* Link: https://github.com/knrz/CSV.js
* Version: 3.6.4
* Authors: Kash Nouroozi
* Description: Encoder for CSV (comma separated values) export
#### License
Copyright (c) 2014 Kash Nouroozi
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
---
### FileSaver.js
#### Info
* Link: https://github.com/eligrey/FileSaver.js/
* Version: 0.0.2
* Authors: Eli Grey
* Description: File download initiator (for file exports)
#### License
Copyright © 2015 Eli Grey.
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
---
### Zepto
#### Info
* Link: http://zeptojs.com/
* Version: 1.1.6
* Authors: Thomas Fuchs
* Description: DOM manipulation
#### License
Copyright (c) 2010-2016 Thomas Fuchs
http://zeptojs.com/
Permission is hereby granted, free of charge, to any person obtaining
a copy of this software and associated documentation files (the
"Software"), to deal in the Software without restriction, including
without limitation the rights to use, copy, modify, merge, publish,
distribute, sublicense, and/or sell copies of the Software, and to
permit persons to whom the Software is furnished to do so, subject to
the following conditions:
The above copyright notice and this permission notice shall be
included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
---
### Json.NET ### Json.NET
#### Info #### Info
@ -560,132 +486,3 @@ The above copyright notice and this permission notice shall be included in all c
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
---
### Almond
* Link: https://github.com/requirejs/almond
* Version: 0.3.3
* Author: jQuery Foundation
* Description: Lightweight RequireJS replacement for builds
#### License
Copyright jQuery Foundation and other contributors, https://jquery.org/
This software consists of voluntary contributions made by many
individuals. For exact contribution history, see the revision history
available at https://github.com/requirejs/almond
The following license applies to all parts of this software except as
documented below:
====
Permission is hereby granted, free of charge, to any person obtaining
a copy of this software and associated documentation files (the
"Software"), to deal in the Software without restriction, including
without limitation the rights to use, copy, modify, merge, publish,
distribute, sublicense, and/or sell copies of the Software, and to
permit persons to whom the Software is furnished to do so, subject to
the following conditions:
The above copyright notice and this permission notice shall be
included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
====
Copyright and related rights for sample code are waived via CC0. Sample
code is defined as all source code displayed within the prose of the
documentation.
CC0: http://creativecommons.org/publicdomain/zero/1.0/
====
Files located in the node_modules directory, and certain utilities used
to build or test the software in the test and dist directories, are
externally maintained libraries used by this software which have their own
licenses; we recommend you read them, as their terms may differ from the
terms above.
### Lodash
* Link: https://lodash.com
* Version: 3.10.1
* Author: Dojo Foundation
* Description: Utility functions
#### License
Copyright 2012-2015 The Dojo Foundation <http://dojofoundation.org/>
Based on Underscore.js, copyright 2009-2015 Jeremy Ashkenas,
DocumentCloud and Investigative Reporters & Editors <http://underscorejs.org/>
Permission is hereby granted, free of charge, to any person obtaining
a copy of this software and associated documentation files (the
"Software"), to deal in the Software without restriction, including
without limitation the rights to use, copy, modify, merge, publish,
distribute, sublicense, and/or sell copies of the Software, and to
permit persons to whom the Software is furnished to do so, subject to
the following conditions:
The above copyright notice and this permission notice shall be
included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
### EventEmitter3
* Link: https://github.com/primus/eventemitter3
* Version: 1.2.0
* Author: Arnout Kazemier
* Description: Event-driven programming support
#### License
The MIT License (MIT)
Copyright (c) 2014 Arnout Kazemier
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.

162
README.md
View File

@ -1,111 +1,14 @@
# Open MCT [![license](https://img.shields.io/badge/license-Apache%202.0-blue.svg)](http://www.apache.org/licenses/LICENSE-2.0) # Open MCT Web
Open MCT (Open Mission Control Technologies) is a next-generation mission control framework for visualization of data on desktop and mobile devices. It is developed at NASA's Ames Research Center, and is being used by NASA for data analysis of spacecraft missions, as well as planning and operation of experimental rover systems. As a generalizable and open source framework, Open MCT could be used as the basis for building applications for planning, operation, and analysis of any systems producing telemetry data. Open MCT Web is a web-based platform for mission operations user interface
software.
Please visit our [Official Site](https://nasa.github.io/openmct/) and [Getting Started Guide](https://nasa.github.io/openmct/getting-started/)
## See Open MCT in Action
Try Open MCT now with our [live demo](https://openmct-demo.herokuapp.com/).
![Demo](https://nasa.github.io/openmct/static/res/images/Open-MCT.Browse.Layout.Mars-Weather-1.jpg)
## New API
A simpler, [easier-to-use API](https://nasa.github.io/openmct/docs/api/)
has been added to Open MCT. Changes in this
API include a move away from a declarative system of JSON configuration files
towards an imperative system based on function calls. Developers will be able
to extend and build on Open MCT by making direct function calls to a public
API. Open MCT is also being refactored to minimize the dependencies that using
Open MCT imposes on developers, such as the current requirement to use
AngularJS.
This new API has not yet been heavily used and is likely to contain defects.
You can help by trying it out, and reporting any issues you encounter
using our GitHub issue tracker. Such issues may include bugs, suggestions,
missing documentation, or even just requests for help if you're having
trouble.
We want Open MCT to be as easy to use, install, run, and develop for as
possible, and your feedback will help us get there!
## Building and Running Open MCT Locally
Building and running Open MCT in your local dev environment is very easy. Be sure you have [Git](https://git-scm.com/downloads) and [Node.js](https://nodejs.org/) installed, then follow the directions below. Need additional information? Check out the [Getting Started](https://nasa.github.io/openmct/getting-started/) page on our website.
(These instructions assume you are installing as a non-root user; developers have [reported issues](https://github.com/nasa/openmct/issues/1151) running these steps with root privileges.)
1. Clone the source code
`git clone https://github.com/nasa/openmct.git`
2. Install development dependencies
`npm install`
3. Run a local development server
`npm start`
Open MCT is now running, and can be accessed by pointing a web browser at [http://localhost:8080/](http://localhost:8080/)
## Documentation
Documentation is available on the [Open MCT website](https://nasa.github.io/openmct/documentation/). The documentation can also be built locally.
### Examples
The clearest examples for developing Open MCT plugins are in the
[tutorials](https://github.com/nasa/openmct-tutorial) provided in
our documentation.
For a practical example of a telemetry adapter, see David Hudson's
[Kerbal Space Program plugin](https://github.com/hudsonfoo/kerbal-openmct),
which allows [Kerbal Space Program](https://kerbalspaceprogram.com) players
to build and use displays for their own missions in Open MCT.
Additional examples are available in the `examples` hierarchy of this
repository; however, be aware that these examples are
[not fully-documented](https://github.com/nasa/openmct/issues/846), so
the tutorials will likely serve as a better starting point.
### Building the Open MCT Documentation Locally
Open MCT's documentation is generated by an
[npm](https://www.npmjs.com/)-based build. It has additional dependencies that
may not be available on every platform and thus is not covered in the standard
npm install. Ensure your system has [libcairo](http://cairographics.org/)
installed and then run the following commands:
* `npm install`
* `npm install canvas nomnoml`
* `npm run docs`
Documentation will be generated in `target/docs`.
## Deploying Open MCT
Open MCT is built using [`npm`](http://npmjs.com/)
and [`gulp`](http://gulpjs.com/).
To build Open MCT for deployment:
`npm run prepare`
This will compile and minify JavaScript sources, as well as copy over assets.
The contents of the `dist` folder will contain a runnable Open MCT
instance (e.g. by starting an HTTP server in that directory), including:
* A `main.js` file containing Open MCT source code.
* Various assets in the `example` and `platform` directories.
* An `index.html` that runs Open MCT in its default configuration.
Additional `gulp` tasks are defined in [the gulpfile](gulpfile.js).
## Bundles ## Bundles
A bundle is a group of software components (including source code, declared A bundle is a group of software components (including source code, declared
as AMD modules, as well as resources such as images and HTML templates) as AMD modules, as well as resources such as images and HTML templates)
that is intended to be added or removed as a single unit. A plug-in for that are intended to be added or removed as a single unit. A plug-in for
Open MCT will be expressed as a bundle; platform components are also Open MCT Web will be expressed as a bundle; platform components are also
expressed as bundles. expressed as bundles.
A bundle is also just a directory which contains a file `bundle.json`, A bundle is also just a directory which contains a file `bundle.json`,
@ -113,7 +16,7 @@ which declares its contents.
The file `bundles.json` (note the plural), at the top level of the The file `bundles.json` (note the plural), at the top level of the
repository, is a JSON file containing an array of all bundles (expressed as repository, is a JSON file containing an array of all bundles (expressed as
directory names) to include in a running instance of Open MCT. Adding or directory names) to include in a running instance of Open MCT Web. Adding or
removing paths from this list will add or remove bundles from the running removing paths from this list will add or remove bundles from the running
application. application.
@ -137,9 +40,56 @@ naming convention is otherwise the same.)
When `npm test` is run, test results will be written as HTML to When `npm test` is run, test results will be written as HTML to
`target/tests`. Code coverage information is written to `target/coverage`. `target/tests`. Code coverage information is written to `target/coverage`.
### Functional Testing
The tests described above are all at the unit-level; an additional
test suite using [Protractor](https://angular.github.io/protractor/)
us under development, in the `protractor` folder.
To run:
* Install protractor following the instructions above.
* `cd protractor`
* `npm install`
* `npm run all`
## Build
Open MCT Web is built using [`npm`](http://npmjs.com/)
and [`gulp`](http://gulpjs.com/).
To build:
`npm run prepublish`
This will compile and minify JavaScript sources, as well as copy over assets.
The contents of the `dist` folder will contain a runnable Open MCT Web
instance (e.g. by starting an HTTP server in that directory), including:
* A `main.js` file containing Open MCT Web source code.
* Various assets in the `example` and `platform` directories.
* An `index.html` that runs Open MCT Web in its default configuration.
Additional `gulp` tasks are defined in [the gulpfile](gulpfile.js).
### Building Documentation
Open MCT Web's documentation is generated by an
[npm](https://www.npmjs.com/)-based build. It has additional dependencies that
may not be available on every platform and thus is not covered in the standard
npm install. Ensure your system has [libcairo](http://cairographics.org/)
installed and then run the following commands:
* `npm install`
* `npm install canvas nomnoml`
* `npm run docs`
Documentation will be generated in `target/docs`.
# Glossary # Glossary
Certain terms are used throughout Open MCT with consistent meanings Certain terms are used throughout Open MCT Web with consistent meanings
or conventions. Any deviations from the below are issues and should be or conventions. Any deviations from the below are issues and should be
addressed (either by updating this glossary or changing code to reflect addressed (either by updating this glossary or changing code to reflect
correct usage.) Other developer documentation, particularly in-line correct usage.) Other developer documentation, particularly in-line
@ -162,7 +112,7 @@ documentation, may presume an understanding of these terms.
(Most often used in the context of extensions, domain (Most often used in the context of extensions, domain
object models, or other similar application-specific objects.) object models, or other similar application-specific objects.)
* _domain object_: A meaningful object to the user; a distinct thing in * _domain object_: A meaningful object to the user; a distinct thing in
the work support by Open MCT. Anything that appears in the left-hand the work support by Open MCT Web. Anything that appears in the left-hand
tree is a domain object. tree is a domain object.
* _extension_: An extension is a unit of functionality exposed to the * _extension_: An extension is a unit of functionality exposed to the
platform in a declarative fashion by a bundle. For more platform in a declarative fashion by a bundle. For more
@ -183,6 +133,6 @@ documentation, may presume an understanding of these terms.
it, and it is thereafter considered the _navigated_ object (until the it, and it is thereafter considered the _navigated_ object (until the
user makes another such choice.) user makes another such choice.)
* _space_: A name used to identify a persistence store. Interactions with * _space_: A name used to identify a persistence store. Interactions with
persistence will generally involve a `space` parameter in some form, to persistence with generally involve a `space` parameter in some form, to
distinguish multiple persistence stores from one another (for cases distinguish multiple persistence stores from one another (for cases
where there are multiple valid persistence locations available.) where there are multiple valid persistence locations available.)

25
app.js
View File

@ -14,12 +14,10 @@
options = require('minimist')(process.argv.slice(2)), options = require('minimist')(process.argv.slice(2)),
express = require('express'), express = require('express'),
app = express(), app = express(),
fs = require('fs'), fs = require('fs');
request = require('request');
// Defaults // Defaults
options.port = options.port || options.p || 8080; options.port = options.port || options.p || 8080;
options.directory = options.directory || options.D || '.';
['include', 'exclude', 'i', 'x'].forEach(function (opt) { ['include', 'exclude', 'i', 'x'].forEach(function (opt) {
options[opt] = options[opt] || []; options[opt] = options[opt] || [];
// Make sure includes/excludes always end up as arrays // Make sure includes/excludes always end up as arrays
@ -37,13 +35,10 @@
console.log(" --port, -p <number> Specify port."); console.log(" --port, -p <number> Specify port.");
console.log(" --include, -i <bundle> Include the specified bundle."); console.log(" --include, -i <bundle> Include the specified bundle.");
console.log(" --exclude, -x <bundle> Exclude the specified bundle."); console.log(" --exclude, -x <bundle> Exclude the specified bundle.");
console.log(" --directory, -D <bundle> Serve files from specified directory.");
console.log(""); console.log("");
process.exit(0); process.exit(0);
} }
app.disable('x-powered-by');
// Override bundles.json for HTTP requests // Override bundles.json for HTTP requests
app.use('/' + BUNDLE_FILE, function (req, res) { app.use('/' + BUNDLE_FILE, function (req, res) {
var bundles; var bundles;
@ -66,19 +61,9 @@
res.send(JSON.stringify(bundles)); res.send(JSON.stringify(bundles));
}); });
app.use('/proxyUrl', function proxyRequest(req, res, next) {
console.log('Proxying request to: ', req.query.url);
req.pipe(request({
url: req.query.url,
strictSSL: false
}).on('error', next)).pipe(res);
});
// Expose everything else as static files // Expose everything else as static files
app.use(express['static'](options.directory)); app.use(express['static']('.'));
// Finally, open the HTTP server and log the instance to the console // Finally, open the HTTP server
app.listen(options.port, function() { app.listen(options.port);
console.log('Open MCT application running at localhost:' + options.port) }());
});
}());

View File

@ -1,10 +1,10 @@
{ {
"name": "openmct", "name": "openmctweb",
"description": "The Open MCT core platform", "description": "The OpenMCTWeb core platform",
"main": "", "main": "",
"license": "Apache-2.0", "license": "Apache-2.0",
"moduleType": [], "moduleType": [],
"homepage": "http://nasa.github.io/openmct/", "homepage": "http://nasa.github.io/openmctweb/",
"private": true, "private": true,
"dependencies": { "dependencies": {
"angular": "1.4.4", "angular": "1.4.4",
@ -13,16 +13,8 @@
"moment-duration-format": "^1.3.0", "moment-duration-format": "^1.3.0",
"requirejs": "~2.1.22", "requirejs": "~2.1.22",
"text": "requirejs-text#^2.0.14", "text": "requirejs-text#^2.0.14",
"es6-promise": "^3.3.0", "es6-promise": "^3.0.2",
"screenfull": "^3.0.0", "screenfull": "^3.0.0",
"node-uuid": "^1.4.7", "node-uuid": "^1.4.7"
"comma-separated-values": "^3.6.4",
"file-saver": "^1.3.3",
"zepto": "^1.1.6",
"eventemitter3": "^1.2.0",
"lodash": "3.10.1",
"almond": "~0.3.2",
"html2canvas": "^0.4.1",
"moment-timezone": "^0.5.13"
} }
} }

View File

@ -1,11 +1,11 @@
#!/bin/bash #!/bin/bash
#***************************************************************************** #*****************************************************************************
#* Open MCT, Copyright (c) 2014-2017, United States Government #* Open MCT Web, Copyright (c) 2014-2015, United States Government
#* as represented by the Administrator of the National Aeronautics and Space #* as represented by the Administrator of the National Aeronautics and Space
#* Administration. All rights reserved. #* Administration. All rights reserved.
#* #*
#* Open MCT is licensed under the Apache License, Version 2.0 (the #* Open MCT Web is licensed under the Apache License, Version 2.0 (the
#* "License"); you may not use this file except in compliance with the License. #* "License"); you may not use this file except in compliance with the License.
#* You may obtain a copy of the License at #* You may obtain a copy of the License at
#* http://www.apache.org/licenses/LICENSE-2.0. #* http://www.apache.org/licenses/LICENSE-2.0.
@ -16,25 +16,23 @@
#* License for the specific language governing permissions and limitations #* License for the specific language governing permissions and limitations
#* under the License. #* under the License.
#* #*
#* Open MCT includes source code licensed under additional open source #* Open MCT Web includes source code licensed under additional open source
#* licenses. See the Open Source Licenses file (LICENSES.md) included with #* licenses. See the Open Source Licenses file (LICENSES.md) included with
#* this source code distribution or the Licensing information page available #* this source code distribution or the Licensing information page available
#* at runtime from the About dialog for additional information. #* at runtime from the About dialog for additional information.
#***************************************************************************** #*****************************************************************************
# Script to build and deploy docs. # Script to build and deploy docs to github pages.
OUTPUT_DIRECTORY="dist/docs" OUTPUT_DIRECTORY="target/docs"
# Docs, once built, are pushed to the private website repo REPOSITORY_URL="git@github.com:nasa/openmctweb.git"
REPOSITORY_URL="git@github.com:nasa/openmct-website.git"
WEBSITE_DIRECTORY="website"
BUILD_SHA=`git rev-parse HEAD` BUILD_SHA=`git rev-parse head`
# A remote will be created for the git repository we are pushing to. # A remote will be created for the git repository we are pushing to.
# Don't worry, as this entire directory will get trashed in between builds. # Don't worry, as this entire directory will get trashed inbetween builds.
REMOTE_NAME="documentation" REMOTE_NAME="documentation"
WEBSITE_BRANCH="master" WEBSITE_BRANCH="gh-pages"
# Clean output directory, JSDOC will recreate # Clean output directory, JSDOC will recreate
if [ -d $OUTPUT_DIRECTORY ]; then if [ -d $OUTPUT_DIRECTORY ]; then
@ -42,21 +40,23 @@ if [ -d $OUTPUT_DIRECTORY ]; then
fi fi
npm run docs npm run docs
cd $OUTPUT_DIRECTORY || exit 1
echo "git clone $REPOSITORY_URL website" echo "git init"
git clone $REPOSITORY_URL website || exit 1 git init
echo "cp -r $OUTPUT_DIRECTORY $WEBSITE_DIRECTORY"
cp -r $OUTPUT_DIRECTORY $WEBSITE_DIRECTORY
echo "cd $WEBSITE_DIRECTORY"
cd $WEBSITE_DIRECTORY || exit 1
# Configure github for CircleCI user. # Configure github for CircleCI user.
git config user.email "buildbot@circleci.com" git config user.email "buildbot@circleci.com"
git config user.name "BuildBot" git config user.name "BuildBot"
echo "git remote add $REMOTE_NAME $REPOSITORY_URL"
git remote add $REMOTE_NAME $REPOSITORY_URL
echo "git add ." echo "git add ."
git add . git add .
echo "git commit -m \"Docs updated from build $BUILD_SHA\"" echo "git commit -m \"Generate docs from build $BUILD_SHA\""
git commit -m "Docs updated from build $BUILD_SHA" git commit -m "Generate docs from build $BUILD_SHA"
# Push to the website repo
git push echo "git push $REMOTE_NAME HEAD:$WEBSITE_BRANCH -f"
git push $REMOTE_NAME HEAD:$WEBSITE_BRANCH -f
echo "Documentation pushed to gh-pages branch."

View File

@ -1,27 +1,15 @@
machine:
node:
version: 4.7.0
dependencies:
pre:
- npm install -g npm@latest
deployment: deployment:
production: production:
branch: master branch: master
commands: commands:
- npm install canvas nomnoml - npm install canvas nomnoml
- ./build-docs.sh - ./build-docs.sh
- git push git@heroku.com:openmctweb-demo.git $CIRCLE_SHA1:refs/heads/master
openmctweb-staging-un:
branch: nem_prototype
heroku:
appname: openmctweb-staging-un
openmctweb-staging-deux: openmctweb-staging-deux:
branch: mobile branch: mobile
heroku: heroku:
appname: openmctweb-staging-deux appname: openmctweb-staging-deux
test:
post:
- gulp lint
- gulp checkstyle
general:
branches:
ignore:
- gh-pages

View File

@ -1,3 +1,9 @@
<hr> <hr>
<cite>
This document is styled using
<a href="https://github.com/jasonm23/markdown-css-themes">
https://github.com/jasonm23/markdown-css-themes
</a>.
</cite>
</body> </body>
</html> </html>

View File

@ -1,9 +1,9 @@
/***************************************************************************** /*****************************************************************************
* Open MCT, Copyright (c) 2014-2017, United States Government * Open MCT Web, Copyright (c) 2014-2015, United States Government
* as represented by the Administrator of the National Aeronautics and Space * as represented by the Administrator of the National Aeronautics and Space
* Administration. All rights reserved. * Administration. All rights reserved.
* *
* Open MCT is licensed under the Apache License, Version 2.0 (the * Open MCT Web is licensed under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance with the License. * "License"); you may not use this file except in compliance with the License.
* You may obtain a copy of the License at * You may obtain a copy of the License at
* http://www.apache.org/licenses/LICENSE-2.0. * http://www.apache.org/licenses/LICENSE-2.0.
@ -14,7 +14,7 @@
* License for the specific language governing permissions and limitations * License for the specific language governing permissions and limitations
* under the License. * under the License.
* *
* Open MCT includes source code licensed under additional open source * Open MCT Web includes source code licensed under additional open source
* licenses. See the Open Source Licenses file (LICENSES.md) included with * licenses. See the Open Source Licenses file (LICENSES.md) included with
* this source code distribution or the Licensing information page available * this source code distribution or the Licensing information page available
* at runtime from the About dialog for additional information. * at runtime from the About dialog for additional information.

View File

@ -1,9 +1,7 @@
<html> <html>
<head> <head>
<link rel="stylesheet" <link rel="stylesheet"
href="//nasa.github.io/openmct/static/res/css/styles.css"> href="http://jasonm23.github.io/markdown-css-themes/avenir-white.css">
<link rel="stylesheet"
href="//nasa.github.io/openmct/static/res/css/documentation.css">
</head> </head>
<body> <body>

View File

@ -5,7 +5,7 @@ software components to communicate. The software components it recognizes
are: are:
* _Extensions_: Individual units of functionality that can be added to * _Extensions_: Individual units of functionality that can be added to
or removed from Open MCT. _Extension categories_ distinguish what or removed from Open MCT Web. _Extension categories_ distinguish what
type of functionality is being added/removed. type of functionality is being added/removed.
* _Bundles_: A grouping of related extensions * _Bundles_: A grouping of related extensions
(named after an analogous concept from [OSGi](http://www.osgi.org/)) (named after an analogous concept from [OSGi](http://www.osgi.org/))
@ -19,7 +19,7 @@ manner which the framework layer can understand.
```nomnoml ```nomnoml
#direction: down #direction: down
[Open MCT| [Open MCT Web|
[Dependency injection framework]-->[Platform bundle #1] [Dependency injection framework]-->[Platform bundle #1]
[Dependency injection framework]-->[Platform bundle #2] [Dependency injection framework]-->[Platform bundle #2]
[Dependency injection framework]-->[Plugin bundle #1] [Dependency injection framework]-->[Plugin bundle #1]
@ -35,7 +35,7 @@ manner which the framework layer can understand.
``` ```
The "dependency injection framework" in this case is The "dependency injection framework" in this case is
[AngularJS](https://angularjs.org/). Open MCT's framework layer [AngularJS](https://angularjs.org/). Open MCT Web's framework layer
is really just a thin wrapper over Angular that recognizes the is really just a thin wrapper over Angular that recognizes the
concepts of bundles and extensions (as declared in JSON files) and concepts of bundles and extensions (as declared in JSON files) and
registering extensions with Angular. It additionally acts as a registering extensions with Angular. It additionally acts as a
@ -60,7 +60,7 @@ activities which were performed by the framework component.
## Application Initialization ## Application Initialization
The framework component initializes an Open MCT application following The framework component initializes an Open MCT Web application following
a simple sequence of steps. a simple sequence of steps.
```nomnoml ```nomnoml
@ -97,7 +97,7 @@ a simple sequence of steps.
[Extension]o->[Dependency #3] [Extension]o->[Dependency #3]
``` ```
Open MCT's architecture relies on a simple premise: Individual units Open MCT Web's architecture relies on a simple premise: Individual units
(extensions) only have access to the dependencies they declare that they (extensions) only have access to the dependencies they declare that they
need, and they acquire references to these dependencies via dependency need, and they acquire references to these dependencies via dependency
injection. This has several desirable traits: injection. This has several desirable traits:
@ -121,17 +121,17 @@ injection. This has several desirable traits:
the framework. the framework.
A drawback to this approach is that it makes it difficult to define A drawback to this approach is that it makes it difficult to define
"the architecture" of Open MCT, in terms of describing the specific "the architecture" of Open MCT Web, in terms of describing the specific
units that interact at run-time. The run-time architecture is determined units that interact at run-time. The run-time architecture is determined
by the framework as the consequence of wiring together dependencies. by the framework as the consequence of wiring together dependencies.
As such, the specific architecture of any given application built on As such, the specific architecture of any given application built on
Open MCT can look very different. Open MCT Web can look very different.
Keeping that in mind, there are a few useful patterns supported by the Keeping that in mind, there are a few useful patterns supported by the
framework that are useful to keep in mind. framework that are useful to keep in mind.
The specific service infrastructure provided by the platform is described The specific service infrastructure provided by the platform is described
in the [Platform Architecture](platform.md). in the [Platform Architecture](Platform.md).
## Extension Categories ## Extension Categories
@ -229,4 +229,4 @@ otherwise a single provider) will be exposed as a single service that
other extensions can acquire through dependency injection. Because all other extensions can acquire through dependency injection. Because all
components of the same type of service expose the same interface, users components of the same type of service expose the same interface, users
of that service do not need to be aware that they are talking to an of that service do not need to be aware that they are talking to an
aggregator or a provider, for instance. aggregator or a provider, for instance.

View File

@ -1,14 +1,14 @@
# Introduction # Introduction
The purpose of this document is to familiarize developers with the The purpose of this document is to familiarize developers with the
overall architecture of Open MCT. overall architecture of Open MCT Web.
The target audience includes: The target audience includes:
* _Platform maintainers_: Individuals involved in developing, * _Platform maintainers_: Individuals involved in developing,
extending, and maintaining capabilities of the platform. extending, and maintaing capabilities of the platform.
* _Integration developers_: Individuals tasked with integrated * _Integration developers_: Individuals tasked with integrated
Open MCT into a larger system, who need to understand Open MCT Web into a larger system, who need to understand
its inner workings sufficiently to complete this integration. its inner workings sufficiently to complete this integration.
As the focus of this document is on architecture, whenever possible As the focus of this document is on architecture, whenever possible
@ -17,25 +17,25 @@ omitted. These details may be found in the developer guide.
# Overview # Overview
Open MCT is client software: It runs in a web browser and Open MCT Web is client software: It runs in a web browser and
provides a user interface, while communicating with various provides a user interface, while communicating with various
server-side resources through browser APIs. server-side resources through browser APIs.
```nomnoml ```nomnoml
#direction: right #direction: right
[Client|[Browser|[Open MCT]->[Browser APIs]]] [Client|[Browser|[Open MCT Web]->[Browser APIs]]]
[Server|[Web services]] [Server|[Web services]]
[Client]<->[Server] [Client]<->[Server]
``` ```
While Open MCT can be configured to run as a standalone client, While Open MCT Web can be configured to run as a standalone client,
this is rarely very useful. Instead, it is intended to be used as a this is rarely very useful. Instead, it is intended to be used as a
display and interaction layer for information obtained from a display and interaction layer for information obtained from a
variety of back-end services. Doing so requires authoring or utilizing variety of back-end services. Doing so requires authoring or utilizing
adapter plugins which allow Open MCT to interact with these services. adapter plugins which allow Open MCT Web to interact with these services.
Typically, the pattern here is to provide a known interface that Typically, the pattern here is to provide a known interface that
Open MCT can utilize, and implement it such that it interacts with Open MCT Web can utilize, and implement it such that it interacts with
whatever back-end provides the relevant information. whatever back-end provides the relevant information.
Examples of back-ends that can be utilized in this fashion include Examples of back-ends that can be utilized in this fashion include
databases for the persistence of user-created objects, or sources of databases for the persistence of user-created objects, or sources of
@ -43,13 +43,13 @@ telemetry data.
## Software Architecture ## Software Architecture
The simplest overview of Open MCT is to look at it as a "layered" The simplest overview of Open MCT Web is to look at it as a "layered"
architecture, where each layer more clearly specifies the behavior architecture, where each layer more clearly specifies the behavior
of the software. of the software.
```nomnoml ```nomnoml
#direction: down #direction: down
[Open MCT| [Open MCT Web|
[Platform]<->[Application] [Platform]<->[Application]
[Framework]->[Application] [Framework]->[Application]
[Framework]->[Platform] [Framework]->[Platform]
@ -63,14 +63,16 @@ These layers are:
application-specific knowledge; at this layer, we have only application-specific knowledge; at this layer, we have only
established an abstraction by which different software components established an abstraction by which different software components
may communicate and/or interact. may communicate and/or interact.
* [_Platform_](platform.md): The platform layer defines the general look, * [_Platform_](platform.md): The platform layer defines the general look,
feel, and behavior of Open MCT. This includes user-facing components like feel, and behavior of Open MCT Web. This includes user-facing components like
Browse mode and Edit mode, as well as underlying elements of the Browse mode and Edit mode, as well as underlying elements of the
information model and the general service infrastructure. information model and the general service infrastructure.
* _Application_: The application layer defines specific features of * _Application_: The application layer defines specific features of
an application built on Open MCT. This includes adapters to an application built on Open MCT Web. This includes adapters to
specific back-ends, new types of things for users to create, and specific back-ends, new types of things for users to create, and
new ways of visualizing objects within the system. This layer new ways of visualizing objects within the system. This layer
typically consists of a mix of custom plug-ins to Open MCT, typically consists of a mix of custom plug-ins to Open MCT Web,
as well as optional features (such as Plot view) included alongside as well as optional features (such as Plot view) included alongside
the platform. the platform.

View File

@ -1,6 +1,6 @@
# Overview # Overview
The Open MCT platform utilizes the [framework layer](framework.md) The Open MCT Web platform utilizes the [framework layer](Framework.md)
to provide an extensible baseline for applications which includes: to provide an extensible baseline for applications which includes:
* A common user interface (and user interface paradigm) for dealing with * A common user interface (and user interface paradigm) for dealing with
@ -16,7 +16,7 @@ building application, the platform adds more specificity by defining
additional extension types and allowing for integration with back end additional extension types and allowing for integration with back end
components. components.
The run-time architecture of an Open MCT application can be categorized The run-time architecture of an Open MCT Web application can be categorized
into certain high-level tiers: into certain high-level tiers:
```nomnoml ```nomnoml
@ -29,7 +29,7 @@ into certain high-level tiers:
[Browser APIs]->[Back-end] [Browser APIs]->[Back-end]
``` ```
Applications built using Open MCT may add or configure functionality Applications built using Open MCT Web may add or configure functionality
in __any of these tiers__. in __any of these tiers__.
* _DOM_: The rendered HTML document, composed from HTML templates which * _DOM_: The rendered HTML document, composed from HTML templates which
@ -38,7 +38,7 @@ in __any of these tiers__.
are initiated from here and invoke behavior in the presentation layer. HTML  are initiated from here and invoke behavior in the presentation layer. HTML 
templates are written in Angulars template syntax; see the [Angular documentation on templates](https://docs.angularjs.org/guide/templates).  templates are written in Angulars template syntax; see the [Angular documentation on templates](https://docs.angularjs.org/guide/templates). 
These describe the page as actually seen by the user. Conceptually,  These describe the page as actually seen by the user. Conceptually, 
stylesheets (controlling the look-and-feel of the rendered templates) belong  stylesheets (controlling the look­and­feel of the rendered templates) belong 
in this grouping as well.  in this grouping as well. 
* [_Presentation layer_](#presentation-layer): The presentation layer * [_Presentation layer_](#presentation-layer): The presentation layer
is responsible for updating (and providing information to update) is responsible for updating (and providing information to update)
@ -48,7 +48,7 @@ in __any of these tiers__.
display. display.
* [_Information model_](#information-model): Provides a common (within Open MCT  * [_Information model_](#information-model): Provides a common (within Open MCT 
Web) set of interfaces for dealing with “things” ­ domain objects ­ within the  Web) set of interfaces for dealing with “things” ­ domain objects ­ within the 
system. User-facing concerns in a Open MCT Web application are expressed as  system. User­facing concerns in a Open MCT Web application are expressed as 
domain objects; examples include folders (used to organize other domain  domain objects; examples include folders (used to organize other domain 
objects), layouts (used to build displays), or telemetry points (used as  objects), layouts (used to build displays), or telemetry points (used as 
handles for streams of remote measurements.) These domain objects expose a  handles for streams of remote measurements.) These domain objects expose a 
@ -60,7 +60,7 @@ in __any of these tiers__.
functionality needed to support the information model. This includes functionality needed to support the information model. This includes
exposing underlying sets of extensions and mediating with the exposing underlying sets of extensions and mediating with the
back-end. back-end.
* _Back-end_: The back-end is out of the scope of Open MCT, except * _Back-end_: The back-end is out of the scope of Open MCT Web, except
for the interfaces which are utilized by adapters participating in the for the interfaces which are utilized by adapters participating in the
service infrastructure. Includes the underlying persistence stores, telemetry  service infrastructure. Includes the underlying persistence stores, telemetry 
streams, and so forth which the Open MCT Web client is being used to interact  streams, and so forth which the Open MCT Web client is being used to interact 
@ -70,15 +70,15 @@ in __any of these tiers__.
Once the Once the
[application has been initialized](Framework.md#application-initialization) [application has been initialized](Framework.md#application-initialization)
Open MCT primarily operates in an event-driven paradigm; various Open MCT Web primarily operates in an event-driven paradigm; various
events (mouse clicks, timers firing, receiving responses to XHRs) trigger events (mouse clicks, timers firing, receiving responses to XHRs) trigger
the invocation of functions, typically in the presentation layer for the invocation of functions, typically in the presentation layer for
user actions or in the service infrastructure for server responses. user actions or in the service infrastructure for server responses.
The "main point of entry" into an initialized Open MCT application The "main point of entry" into an initialized Open MCT Web application
is effectively the is effectively the
[route](https://docs.angularjs.org/api/ngRoute/service/$route#example) [route](https://docs.angularjs.org/api/ngRoute/service/$route#example)
which is associated with the URL used to access Open MCT (or a which is associated with the URL used to access Open MCT Web (or a
default route.) This route will be associated with a template which default route.) This route will be associated with a template which
will be displayed; this template will include references to directives will be displayed; this template will include references to directives
and controllers which will be interpreted by Angular and used to and controllers which will be interpreted by Angular and used to
@ -107,11 +107,11 @@ both the information model and the service infrastructure.
# Presentation Layer # Presentation Layer
The presentation layer of Open MCT is responsible for providing The presentation layer of Open MCT Web is responsible for providing
information to display within templates, and for handling interactions information to display within templates, and for handling interactions
which are initiated from templated DOM elements. AngularJS acts as which are initiated from templated DOM elements. AngularJS acts as
an intermediary between the web page as the user sees it, and the an intermediary between the web page as the user sees it, and the
presentation layer implemented as Open MCT extensions. presentation layer implemented as Open MCT Web extensions.
```nomnoml ```nomnoml
[Presentation Layer| [Presentation Layer|
@ -143,12 +143,12 @@ to primitives from AngularJS:
attributes and tags. attributes and tags.
* [_Routes_](https://docs.angularjs.org/api/ngRoute/service/$route#example) * [_Routes_](https://docs.angularjs.org/api/ngRoute/service/$route#example)
are used to associate specific URLs (including the fragment identifier) are used to associate specific URLs (including the fragment identifier)
with specific application states. (In Open MCT, these are used to with specific application states. (In Open MCT Web, these are used to
describe the mode of usage - e.g. browse or edit - as well as to describe the mode of usage - e.g. browse or edit - as well as to
identify the object being used.) identify the object being used.)
* [_Templates_](https://docs.angularjs.org/guide/templates) are partial * [_Templates_](https://docs.angularjs.org/guide/templates) are partial
HTML documents that will be rendered and kept up-to-date by AngularJS. HTML documents that will be rendered and kept up-to-date by AngularJS.
Open MCT introduces a custom `mct-include` directive which acts Open MCT Web introduces a custom `mct-include` directive which acts
as a wrapper around `ng-include` to allow templates to be referred as a wrapper around `ng-include` to allow templates to be referred
to by symbolic names. to by symbolic names.
@ -189,10 +189,10 @@ to displaying domain objects.
] ]
``` ```
Domain objects are the most fundamental component of Open MCT's Domain objects are the most fundamental component of Open MCT Web's
information model. A domain object is some distinct thing relevant to a information model. A domain object is some distinct thing relevant to a
user's work flow, such as a telemetry channel, display, or similar. user's work flow, such as a telemetry channel, display, or similar.
Open MCT is a tool for viewing, browsing, manipulating, and otherwise Open MCT Web is a tool for viewing, browsing, manipulating, and otherwise
interacting with a graph of domain objects. interacting with a graph of domain objects.
A domain object should be conceived of as the union of the following: A domain object should be conceived of as the union of the following:
@ -254,7 +254,7 @@ Concrete examples of capabilities which follow this pattern
# Service Infrastructure # Service Infrastructure
Most services exposed by the Open MCT platform follow the Most services exposed by the Open MCT Web platform follow the
[composite services](Framework.md#composite-services) to permit [composite services](Framework.md#composite-services) to permit
a higher degree of flexibility in how a service can be modified a higher degree of flexibility in how a service can be modified
or customized for specific applications. or customized for specific applications.
@ -327,7 +327,7 @@ A short summary of the roles of these services:
[DomainObjectProvider]o-[CapabilityService] [DomainObjectProvider]o-[CapabilityService]
``` ```
As domain objects are central to Open MCT's information model, As domain objects are central to Open MCT Web's information model,
acquiring domain objects is equally important. acquiring domain objects is equally important.
```nomnoml ```nomnoml
@ -338,7 +338,7 @@ acquiring domain objects is equally important.
[<state> Instantiate DomainObject]->[<end> End] [<state> Instantiate DomainObject]->[<end> End]
``` ```
Open MCT includes an implementation of an `ObjectService` which Open MCT Web includes an implementation of an `ObjectService` which
satisfies this capability by: satisfies this capability by:
* Consulting the [Model Service](#model-service) to acquire domain object * Consulting the [Model Service](#model-service) to acquire domain object
@ -437,9 +437,9 @@ objects (this allows failures to be recognized and handled in groups.)
The telemetry service is responsible for acquiring telemetry data. The telemetry service is responsible for acquiring telemetry data.
Notably, the platform does not include any providers for Notably, the platform does not include any providers for
`TelemetryService`; applications built on Open MCT will need to `TelemetryService`; applications built on Open MCT Web will need to
implement a provider for this service if they wish to expose telemetry implement a provider for this service if they wish to expose telemetry
data. This is usually the most important step for integrating Open MCT data. This is usually the most important step for integrating Open MCT Web
into an existing telemetry system. into an existing telemetry system.
Requests for telemetry data are usually initiated in the Requests for telemetry data are usually initiated in the
@ -616,7 +616,7 @@ follows:
part of an action's extension definition. part of an action's extension definition.
* `CreateActionProvider` provides the various Create actions which * `CreateActionProvider` provides the various Create actions which
populate the Create menu. These are driven by the available types, populate the Create menu. These are driven by the available types,
so do not map easily to extension category `actions`; instead, these so do not map easily ot extension category `actions`; instead, these
are generated after looking up which actions are available from the are generated after looking up which actions are available from the
[`TypeService`](#type-service). [`TypeService`](#type-service).
* `ActionAggregator` merges together actions from multiple providers. * `ActionAggregator` merges together actions from multiple providers.
@ -721,6 +721,6 @@ disallow.
``` ```
The type service provides metadata about the different types of domain The type service provides metadata about the different types of domain
objects that exist within an Open MCT application. The platform objects that exist within an Open MCT Web application. The platform
implementation reads these types in from extension category `types` implementation reads these types in from extension category `types`
and wraps them in a JavaScript interface. and wraps them in a JavaScript interface.

View File

@ -1,7 +1,7 @@
# API Refactoring # API Refactoring
This document summarizes a path toward implementing API changes This document summarizes a path toward implementing API changes
from the [API Redesign](../proposals/APIRedesign.md) for Open MCT from the [API Redesign](../proposals/APIRedesign.md) for Open MCT Web
v1.0.0. v1.0.0.
# Goals # Goals
@ -161,7 +161,7 @@ be included in a straightforward fashion.
Some goals for this build step: Some goals for this build step:
* Compile (and, preferably, optimize/minify) Open MCT * Compile (and, preferably, optimize/minify) Open MCT Web
sources into a single `.js` file. sources into a single `.js` file.
* It is desirable to do the same for HTML sources, but * It is desirable to do the same for HTML sources, but
may wish to defer this until a subsequent refactoring may wish to defer this until a subsequent refactoring
@ -170,7 +170,7 @@ Some goals for this build step:
derivative projects in a straightforward fashion. derivative projects in a straightforward fashion.
Should also consider which dependency/packaging manager should Should also consider which dependency/packaging manager should
be used by dependent projects to obtain Open MCT. Approaches be used by dependent projects to obtain Open MCT Web. Approaches
include: include:
1. Plain `npm`. Dependents then declare their dependency with 1. Plain `npm`. Dependents then declare their dependency with
@ -203,7 +203,7 @@ to use for asset generation/management and compilation/minification/etc.
## Step 3. Separate repositories ## Step 3. Separate repositories
Refactor existing applications built on Open MCT such that they Refactor existing applications built on Open MCT Web such that they
are no longer forks, but instead separate projects with a dependency are no longer forks, but instead separate projects with a dependency
on the built artifacts from Step 2. on the built artifacts from Step 2.
@ -211,7 +211,7 @@ Note that this is achievable already using `bower` (see `warp-bower`
branch at http://developer.nasa.gov/mct/warp for an example.) branch at http://developer.nasa.gov/mct/warp for an example.)
However, changes involved in switching to an imperative API and However, changes involved in switching to an imperative API and
introducing a build process may change (and should simplify) the introducing a build process may change (and should simplify) the
approach used to utilize Open MCT as a dependency, so these approach used to utilize Open MCT Web as a dependency, so these
changes should be introduced first. changes should be introduced first.
## Step 4. Design registration API ## Step 4. Design registration API
@ -287,7 +287,7 @@ or separately in parallel) and should involve a tight cycle of:
planning should be done to spread out the changes incrementally. planning should be done to spread out the changes incrementally.
By necessity, these changes may break functionality in applications By necessity, these changes may break functionality in applications
built using Open MCT. On a case-by-case basis, should consider built using Open MCT Web. On a case-by-case basis, should consider
providing temporary "legacy support" to allow downstream updates providing temporary "legacy support" to allow downstream updates
to occur as a separate task; the relevant trade here is between to occur as a separate task; the relevant trade here is between
waste/effort required to maintain legacy support, versus the waste/effort required to maintain legacy support, versus the
@ -299,11 +299,11 @@ across several repositories.
Update bundles to remove any usages of legacy support for bundles Update bundles to remove any usages of legacy support for bundles
(including that used by dependent projects.) Then, remove legacy (including that used by dependent projects.) Then, remove legacy
support from Open MCT. support from Open MCT Web.
## Step 8. Release candidacy ## Step 8. Release candidacy
Once API changes are complete, Open MCT should enter a release Once API changes are complete, Open MCT Web should enter a release
candidacy cycle. Important things to look at here: candidacy cycle. Important things to look at here:
* Are changes really complete? * Are changes really complete?

View File

@ -1,6 +1,6 @@
# Overview # Overview
The purpose of this document is to review feedback on Open MCT's The purpose of this document is to review feedback on Open MCT Web's
current API and propose improvements to the API, particularly for a current API and propose improvements to the API, particularly for a
1.0.0 release. 1.0.0 release.
@ -64,7 +64,7 @@ useful, powerful interfaces.
## Developer Intern Feedback ## Developer Intern Feedback
This feedback comes from interns who worked closely with This feedback comes from interns who worked closely with
Open MCT as their primary task over the Summer of 2015. Open MCT Web as their primary task over the Summer of 2015.
### Developer Intern 1 ### Developer Intern 1
@ -98,13 +98,13 @@ Worked on bug fixes in the platform and a plugin for search.
It is hard to figure out what the difference between the various ways of It is hard to figure out what the difference between the various ways of
dealing with telemetry are. e.g., what is the difference between just dealing with telemetry are. e.g., what is the difference between just
"Telemetry" and the "Telemetry Service"? There are many "Telemetry" and the "Telemetry Service"? There are many
"Telemetry Things" which seem related, but in an unclear way. "Telemetry Thing"s which seem related, but in an unclear way.
### Developer Intern 2 ### Developer Intern 2
Worked on platform bug fixes and mobile support. Worked on platform bug fixes and mobile support.
* No guide for the UI and front end for the HTML/CSS part of Open MCT. * No guide for the UI and front end for the HTML/CSS part of Open MCT Web.
Not sure if this is applicable or needed for developers, however would Not sure if this is applicable or needed for developers, however would
be helpful to any front end development be helpful to any front end development
* Found it difficult to follow the plot controller & subplot * Found it difficult to follow the plot controller & subplot
@ -118,11 +118,11 @@ Worked on platform bug fixes and mobile support.
## Plugin Developer Feedback ## Plugin Developer Feedback
This feedback comes from developers who have worked on plugins for This feedback comes from developers who have worked on plugins for
Open MCT, but have not worked on the platform. Open MCT Web, but have not worked on the platform.
### Plugin Developer 1 ### Plugin Developer 1
Used Open MCT over the course of several months (on a Used Open MCT Web over the course of several months (on a
less-than-half-time basis) to develop a less-than-half-time basis) to develop a
spectrum visualization plugin. spectrum visualization plugin.
@ -138,7 +138,7 @@ spectrum visualization plugin.
### Plugin Developer 2 ### Plugin Developer 2
Used Open MCT over the course of several weeks (on a half-time basis) Used Open MCT Web over the course of several weeks (on a half-time basis)
to develop a tabular visualization plugin. to develop a tabular visualization plugin.
* Pain points * Pain points
@ -180,7 +180,7 @@ to develop a tabular visualization plugin.
* Add a model property to the bundle.json to take in "Hello World" * Add a model property to the bundle.json to take in "Hello World"
as a parameter and pass through to the controller/view as a parameter and pass through to the controller/view
### Open Source Contributor ### Open Source Contributer
* [Failures are non-graceful when services are missing.]( * [Failures are non-graceful when services are missing.](
https://github.com/nasa/openmctweb/issues/79) https://github.com/nasa/openmctweb/issues/79)
@ -197,7 +197,7 @@ to develop a tabular visualization plugin.
## Long-term Developer Notes ## Long-term Developer Notes
The following notes are from original platform developer, with long The following notes are from original platform developer, with long
term experience using Open MCT. term experience using Open MCT Web.
* Bundle mechanism allows for grouping related components across concerns, * Bundle mechanism allows for grouping related components across concerns,
and adding and removing these easily. (e.g. model and view components of and adding and removing these easily. (e.g. model and view components of
@ -214,13 +214,13 @@ to an entirely different framework.
We can expect AngularJS 1.x to reach end-of-life reasonably soon thereafter. We can expect AngularJS 1.x to reach end-of-life reasonably soon thereafter.
Our API is currently a superset of Angular's API, so this directly affects Our API is currently a superset of Angular's API, so this directly effects
our API. Specifically, API changes should be oriented towards removing our API. Specifically, API changes should be oriented towards removing
or reducing the Angular dependency. or reducing the Angular dependency.
### Angular's Role ### Angular's Role
Angular is Open MCT's: Angular is Open MCT Web's:
* Dependency injection framework. * Dependency injection framework.
* Template rendering. * Template rendering.
@ -268,7 +268,7 @@ by experience:
* Feedback from new developers is that Angular was a hindrance to * Feedback from new developers is that Angular was a hindrance to
training, not a benefit. ("One more thing to learn.") Significant training, not a benefit. ("One more thing to learn.") Significant
documentation remains necessary for Open MCT. documentation remains necessary for Open MCT Web.
* Expected enhancements to maintainability will be effectively * Expected enhancements to maintainability will be effectively
invalidated by an expected Angular end-of-life. invalidated by an expected Angular end-of-life.
* Data binding and automatic view updates do save development effort, * Data binding and automatic view updates do save development effort,
@ -456,7 +456,7 @@ Instead, propose that:
For parity with actions, a `View` would be a constructor which For parity with actions, a `View` would be a constructor which
takes an `ActionContext` as a parameter (with similarly-defined takes an `ActionContext` as a parameter (with similarly-defined
properties) and exposes a method to retrieve the HTML elements properties) and exposes a method to retrieve the HTML elements
associated with it. associateed with it.
The platform would then additionally expose an `AngularView` The platform would then additionally expose an `AngularView`
implementation to improve compatibility with existing implementation to improve compatibility with existing
@ -526,7 +526,7 @@ subset of `$http`'s functionality.
### Detriments ### Detriments
* Increases the number of interfaces in Open MCT. (Arguably, * Increases the number of interfaces in Open MCT Web. (Arguably,
not really, since the same interfaces would exist if exposed not really, since the same interfaces would exist if exposed
by Angular.) by Angular.)
@ -574,7 +574,7 @@ This would also allow for "composite bundles" which serve as
proxies for multiple bundles. The `BundleContext` could contain proxies for multiple bundles. The `BundleContext` could contain
(or later be amended to contain) filtering rules to ignore (or later be amended to contain) filtering rules to ignore
other bundles and so forth (this has been useful for administering other bundles and so forth (this has been useful for administering
Open MCT in subtly different configurations in the past.) Open MCT Web in subtly different configurations in the past.)
### Benefits ### Benefits
@ -827,7 +827,7 @@ This could be resolved by:
## Nomenclature Change ## Nomenclature Change
Instead of presenting Open MCT as a "framework" or Instead of presenting Open MCT Web as a "framework" or
"platform", present it as an "extensible application." "platform", present it as an "extensible application."
This is mostly a change for the developer guide. A This is mostly a change for the developer guide. A
@ -1040,7 +1040,7 @@ This is a more specific variant of
* Removes a whole category of API (bundle definitions), reducing * Removes a whole category of API (bundle definitions), reducing
learning curve associated with the software. learning curve associated with the software.
* Closer to Angular style, reducing disconnect between learning * Closer to Angular style, reducing disconnect between learning
Angular and learning Open MCT (reducing burden of having Angular and learning Open MCT Web (reducing burden of having
to learn multiple paradigms.) to learn multiple paradigms.)
* Clarifies "what can be found where" (albeit not perfectly) * Clarifies "what can be found where" (albeit not perfectly)
since you can look to module dependencies and follow back from there. since you can look to module dependencies and follow back from there.

View File

@ -3,7 +3,7 @@
**Table of Contents** *generated with [DocToc](https://github.com/thlorenz/doctoc)* **Table of Contents** *generated with [DocToc](https://github.com/thlorenz/doctoc)*
- [Reducing interface depth (the bundle.json version)](#reducing-interface-depth-the-bundlejson-version) - [Reducing interface depth (the bundle.json version)](#reducing-interface-depth-the-bundlejson-version)
- [Imperitive component registries](#imperative-component-registries) - [Imperitive component registries](#imperitive-component-registries)
- [Get rid of "extension category" concept.](#get-rid-of-extension-category-concept) - [Get rid of "extension category" concept.](#get-rid-of-extension-category-concept)
- [Reduce number and depth of extension points](#reduce-number-and-depth-of-extension-points) - [Reduce number and depth of extension points](#reduce-number-and-depth-of-extension-points)
- [Composite services should not be the default](#composite-services-should-not-be-the-default) - [Composite services should not be the default](#composite-services-should-not-be-the-default)
@ -30,11 +30,11 @@
# Reducing interface depth (the bundle.json version) # Reducing interface depth (the bundle.json version)
## Imperative component registries ## Imperitive component registries
Transition component registries to javascript, get rid of bundle.json and bundles.json. Prescribe a method for application configuration, but allow flexibility in how application configuration is defined. Transition component registries to javascript, get rid of bundle.json and bundles.json. Prescribe a method for application configuration, but allow flexibility in how application configuration is defined.
Register components in an imperative fashion, see angularApp.factory, angularApp.controller, etc. Alternatively, implement our own application object with new registries and it's own form of registering objects. Register components in an imperitive fashion, see angularApp.factory, angularApp.controller, etc. Alternatively, implement our own application object with new registries and it's own form of registering objects.
## Get rid of "extension category" concept. ## Get rid of "extension category" concept.
@ -99,7 +99,7 @@ To reduce interface depth, we can replace our own provider and registry patterns
## More angular: for all services ## More angular: for all services
Increasing our commitment to angular would mean using more of the angular factories, services, etc, and less of our home grown tools. We'd implement our services and extension points as angular providers, and make them configurable via app.config. Increasing our commitment to angular would mean using more of the angular factorys, services, etc, and less of our home grown tools. We'd implement our services and extension points as angular providers, and make them configurable via app.config.
As an example, registering a specific type of model provider in angular would look like: As an example, registering a specific type of model provider in angular would look like:
@ -126,9 +126,9 @@ Allow developers to use whatever module loading system they'd like to use, while
## Use gulp or grunt for standard tooling ## Use gulp or grunt for standard tooling
Using gulp or grunt as a task runner would bring us in line with standard web developer workflows and help standardize rendering, deployment, and packaging. Additional tools can be added to the workflow at low cost, simplifying the setup of developer environments. Using gulp or grunt as a task runner would bring us in line with standard web developer workflows and help standardize rendering, deployment, and packaging. Additional tools can be added to the workflow at low cost, simplifying the set up of developer environments.
Gulp and grunt provide useful developer tooling such as live reload, automatic scss/less/etc compilation, and ease of extensibility for standard production build processes. They're key in decoupling code. Gulp and grunt provide useful developer tooling such as live reload, automatic scss/less/etc compiliation, and ease of extensibility for standard production build processes. They're key in decoupling code.
## Package openmctweb as single versioned file. ## Package openmctweb as single versioned file.

View File

@ -1,4 +1,4 @@
# Open MCT Developer Guide # Open MCT Web Developer Guide
Victor Woeltjen Victor Woeltjen
[victor.woeltjen@nasa.gov](mailto:victor.woeltjen@nasa.gov) [victor.woeltjen@nasa.gov](mailto:victor.woeltjen@nasa.gov)
@ -6,36 +6,35 @@ Victor Woeltjen
September 23, 2015 September 23, 2015
Document Version 1.1 Document Version 1.1
Date | Version | Summary of Changes | Author Date | Version | Summary of Changes | Author
------------------- | --------- | ------------------------- | --------------- ------------------- | --------- | ----------------------- | ---------------
April 29, 2015 | 0 | Initial Draft | Victor Woeltjen April 29, 2015 | 0 | Initial Draft | Victor Woeltjen
May 12, 2015 | 0.1 | | Victor Woeltjen May 12, 2015 | 0.1 | | Victor Woeltjen
June 4, 2015 | 1.0 | Name Changes | Victor Woeltjen June 4, 2015 | 1.0 | Name Changes | Victor Woeltjen
October 4, 2015 | 1.1 | Conversion to MarkDown | Andrew Henry October 4, 2015 | 1.1 | Conversion to MarkDown | Andrew Henry
April 5, 2016 | 1.2 | Added Mct-table directive | Andrew Henry
# Introduction # Introduction
The purpose of this guide is to familiarize software developers with the Open The purpose of this guide is to familiarize software developers with the Open
MCT Web platform. MCT Web platform.
## What is Open MCT ## What is Open MCT Web
Open MCT is a platform for building user interface and display tools, Open MCT Web is a platform for building user interface and display tools,
developed at the NASA Ames Research Center in collaboration with teams at the developed at the NASA Ames Research Center in collaboration with teams at the
Jet Propulsion Laboratory. It is written in HTML5, CSS3, and JavaScript, using Jet Propulsion Laboratory. It is written in HTML5, CSS3, and JavaScript, using
[AngularJS](http://www.angularjs.org) as a framework. Its intended use is to [AngularJS](http://www.angularjs.org) as a framework. Its intended use is to
create single-page web applications which integrate data and behavior from a create single-page web applications which integrate data and behavior from a
variety of sources and domains. variety of sources and domains.
Open MCT has been developed to support the remote operation of space Open MCT Web has been developed to support the remote operation of space
vehicles, so some of its features are specific to that task; however, it is vehicles, so some of its features are specific to that task; however, it is
flexible enough to be adapted to a variety of other application domains where a flexible enough to be adapted to a variety of other application domains where a
display tool oriented toward browsing, composing, and visualizing would be display tool oriented toward browsing, composing, and visualizing would be
useful. useful.
Open MCT provides: Open MCT Web provides:
* A common user interface paradigm which can be applied to a variety of domains * A common user interface paradigm which can be applied to a variety of domains
and tasks. Open MCT is more than a widget toolkit - it provides a standard and tasks. Open MCT Web is more than a widget toolkit - it provides a standard
tree-on-the-left, view-on-the-right browsing environment which you customize by tree-on-the-left, view-on-the-right browsing environment which you customize by
adding new browsable object types, visualizations, and back-end adapters. adding new browsable object types, visualizations, and back-end adapters.
* A plugin framework and an extensible API for introducing new application * A plugin framework and an extensible API for introducing new application
@ -44,17 +43,17 @@ features of a variety of types.
visualizations and infrastructure specific to telemetry display. visualizations and infrastructure specific to telemetry display.
## Client-Server Relationship ## Client-Server Relationship
Open MCT is client software - it runs entirely in the user's web browser. As Open MCT Web is client software - it runs entirely in the user's web browser. As
such, it is largely 'server agnostic'; any web server capable of serving files such, it is largely 'server agnostic'; any web server capable of serving files
from paths is capable of providing Open MCT. from paths is capable of providing Open MCT Web.
While Open MCT can be configured to run as a standalone client, this is While Open MCT Web can be configured to run as a standalone client, this is
rarely very useful. Instead, it is intended to be used as a display and rarely very useful. Instead, it is intended to be used as a display and
interaction layer for information obtained from a variety of back-end services. interaction layer for information obtained from a variety of back-end services.
Doing so requires authoring or utilizing adapter plugins which allow Open MCT Doing so requires authoring or utilizing adapter plugins which allow Open MCT
Web to interact with these services. Web to interact with these services.
Typically, the pattern here is to provide a known interface that Open MCT Typically, the pattern here is to provide a known interface that Open MCT Web
can utilize, and implement it such that it interacts with whatever back-end can utilize, and implement it such that it interacts with whatever back-end
provides the relevant information. Examples of back-ends that can be utilized in provides the relevant information. Examples of back-ends that can be utilized in
this fashion include databases for the persistence of user-created objects, or this fashion include databases for the persistence of user-created objects, or
@ -63,52 +62,52 @@ sources of telemetry data.
See the [Architecture Guide](../architecture/index.md#Overview) for information See the [Architecture Guide](../architecture/index.md#Overview) for information
on the client-server relationship. on the client-server relationship.
## Developing with Open MCT ## Developing with Open MCT Web
Building applications with Open MCT typically means authoring and utilizing Building applications with Open MCT Web typically means authoring and utilizing
a set of plugins which provide application-specific details about how Open MCT a set of plugins which provide application-specific details about how Open MCT
Web should behave. Web should behave.
### Technologies ### Technologies
Open MCT sources are written in JavaScript, with a number of configuration Open MCT Web sources are written in JavaScript, with a number of configuration
files written in JSON. Displayable components are written in HTML5 and CSS3. files written in JSON. Displayable components are written in HTML5 and CSS3.
Open MCT is built using [AngularJS](http://www.angularjs.org) from Google. A Open MCT Web is built using [AngularJS](http://www.angularjs.org) from Google. A
good understanding of Angular is recommended for developers working with Open good understanding of Angular is recommended for developers working with Open
MCT Web. MCT Web.
### Forking ### Forking
Open MCT does not currently have a single stand-alone artifact that can be Open MCT Web does not currently have a single stand-alone artifact that can be
used as a library. Instead, the recommended approach for creating a new used as a library. Instead, the recommended approach for creating a new
application is to start by forking/branching Open MCT, and then adding new application is to start by forking/branching Open MCT Web, and then adding new
features from there. Put another way, Open MCT's source structure is built features from there. Put another way, Open MCT Web's source structure is built
to serve as a template for specific applications. to serve as a template for specific applications.
Forking in this manner should not require that you edit Open MCT's sources. Forking in this manner should not require that you edit Open MCT Web's sources.
The preferred approach is to create a new directory (peer to `index.html`) for The preferred approach is to create a new directory (peer to `index.html`) for
the new application, then add new bundles (as described in the Framework the new application, then add new bundles (as described in the Framework
chapter) within that directory. chapter) within that directory.
To initially clone the Open MCT repository: To initially clone the Open MCT Web repository:
`git clone <repository URL> <local repo directory> -b open-master` `git clone <repository URL> <local repo directory> -b open-master`
To create a fork to begin working on a new application using Open MCT: To create a fork to begin working on a new application using Open MCT Web:
cd <local repo directory> cd <local repo directory>
git checkout open-master git checkout open-master
git checkout -b <new branch name> git checkout -b <new branch name>
As a convention used internally, applications built using Open MCT have As a convention used internally, applications built using Open MCT Web have
master branch names with an identifying prefix. For instance, if building an master branch names with an identifying prefix. For instance, if building an
application called 'Foo', the last statement above would look like: application called 'Foo', the last statement above would look like:
git checkout -b foo-master git checkout -b foo-master
This convention is not enforced or understood by Open MCT in any way; it is This convention is not enforced or understood by Open MCT Web in any way; it is
mentioned here as a more general recommendation. mentioned here as a more general recommendation.
# Overview # Overview
Open MCT is implemented as a framework component which manages a set of Open MCT Web is implemented as a framework component which manages a set of
other components. These components, called _bundles_, act as containers to group other components. These components, called _bundles_, act as containers to group
sets of related functionality; individual units of functionality are expressed sets of related functionality; individual units of functionality are expressed
within these bundles as _extensions_. within these bundles as _extensions_.
@ -119,7 +118,7 @@ run-time to satisfy these declared dependency. This dependency injection
approach allows software components which have been authored separately (e.g. as approach allows software components which have been authored separately (e.g. as
plugins) but to collaborate at run-time. plugins) but to collaborate at run-time.
Open MCT's framework layer is implemented on top of AngularJS's [dependency Open MCT Web's framework layer is implemented on top of AngularJS's [dependency
injection mechanism](https://docs.angularjs.org/guide/di) and is modelled after injection mechanism](https://docs.angularjs.org/guide/di) and is modelled after
[OSGi](hhttp://www.osgi.org/) and its [Declarative Services component model](http://wiki.osgi.org/wiki/Declarative_Services). [OSGi](hhttp://www.osgi.org/) and its [Declarative Services component model](http://wiki.osgi.org/wiki/Declarative_Services).
In particular, this is where the term _bundle_ comes from. In particular, this is where the term _bundle_ comes from.
@ -134,7 +133,7 @@ The framework is described in more detail in the [Framework Overview](../archite
architecture guide. architecture guide.
### Tiers ### Tiers
While all bundles in a running Open MCT instance are effectively peers, it While all bundles in a running Open MCT Web instance are effectively peers, it
is useful to think of them as a tiered architecture, where each tier adds more is useful to think of them as a tiered architecture, where each tier adds more
specificity to the application. specificity to the application.
```nomnoml ```nomnoml
@ -152,7 +151,7 @@ It additionally interprets bundle definitions (see explanation below, as well as
further detail in the Framework chapter.) At this tier, we are at our most further detail in the Framework chapter.) At this tier, we are at our most
general: We know only that we are a plugin-based application. general: We know only that we are a plugin-based application.
* __Platform__: Components in the Platform tier describe both the general user * __Platform__: Components in the Platform tier describe both the general user
interface and corresponding developer-facing interfaces of Open MCT. This interface and corresponding developer-facing interfaces of Open MCT Web. This
tier provides the general infrastructure for applications. It is less general tier provides the general infrastructure for applications. It is less general
than the framework tier, insofar as this tier introduces a specific user than the framework tier, insofar as this tier introduces a specific user
interface paradigm, but it is still non-specific as to what useful features interface paradigm, but it is still non-specific as to what useful features
@ -160,7 +159,7 @@ will be provided. Although they can be removed or replaced easily, bundles
provided by the Platform tier generally should not be thought of as optional. provided by the Platform tier generally should not be thought of as optional.
* __Application__: The application tier consists of components which utilize the * __Application__: The application tier consists of components which utilize the
infrastructure provided by the Platform to provide functionality which will (or infrastructure provided by the Platform to provide functionality which will (or
could) be useful to specific applications built using Open MCT. These could) be useful to specific applications built using Open MCT Web. These
include adapters to specific persistence back-ends (such as ElasticSearch or include adapters to specific persistence back-ends (such as ElasticSearch or
CouchDB) as well as bundles which describe more user-facing features (such as CouchDB) as well as bundles which describe more user-facing features (such as
_Plot_ views for visualizing time series data, or _Layout_ objects for _Plot_ views for visualizing time series data, or _Layout_ objects for
@ -169,20 +168,20 @@ compromising basic application functionality, with the caveat that at least one
persistence adapter needs to be present. persistence adapter needs to be present.
* __Plugins__: Conceptually, this tier is not so different from the application * __Plugins__: Conceptually, this tier is not so different from the application
tier; it consists of bundles describing new features, back-end adapters, that tier; it consists of bundles describing new features, back-end adapters, that
are specific to the application being built on Open MCT. It is described as are specific to the application being built on Open MCT Web. It is described as
a separate tier here because it has one important distinction from the a separate tier here because it has one important distinction from the
application tier: It consists of bundles that are not included with the platform application tier: It consists of bundles that are not included with the platform
(either authored anew for the specific application, or obtained from elsewhere.) (either authored anew for the specific application, or obtained from elsewhere.)
Note that bundles in any tier can go off and consult back-end services. In Note that bundles in any tier can go off and consult back-end services. In
practice, this responsibility is handled at the Application and/or Plugin tiers; practice, this responsibility is handled at the Application and/or Plugin tiers;
Open MCT is built to be server-agnostic, so any back-end is considered an Open MCT Web is built to be server-agnostic, so any back-end is considered an
application-specific detail. application-specific detail.
## Platform Overview ## Platform Overview
The "tiered" architecture described in the preceding text describes a way of The "tiered" architecture described in the preceding text describes a way of
thinking of and categorizing software components of a Open MCT application, thinking of and categorizing software components of a Open MCT Web application,
as well as the framework layer's role in mediating between these components. as well as the framework layer's role in mediating between these components.
Once the framework layer has wired these software components together, however, Once the framework layer has wired these software components together, however,
the application's logical architecture emerges. the application's logical architecture emerges.
@ -193,7 +192,7 @@ section of the Platform guide
### Web Services ### Web Services
As mentioned in the Introduction, Open MCT is a platform single-page As mentioned in the Introduction, Open MCT Web is a platform single-page
applications which runs entirely in the browser. Most applications will want to applications which runs entirely in the browser. Most applications will want to
additionally interact with server-side resources, to (for example) read additionally interact with server-side resources, to (for example) read
telemetry data or store user-created objects. This interaction is handled by telemetry data or store user-created objects. This interaction is handled by
@ -206,7 +205,7 @@ individual bundles using APIs which are supported in browser (such as
[Web Service #2] <- [Web Browser] [Web Service #2] <- [Web Browser]
[Web Service #3] <- [Web Browser] [Web Service #3] <- [Web Browser]
[<package> Web Browser | [<package> Web Browser |
[<package> Open MCT | [<package> Open MCT Web |
[Plugin Bundle #1]-->[Core API] [Plugin Bundle #1]-->[Core API]
[Core API]<--[Plugin Bundle #2] [Core API]<--[Plugin Bundle #2]
[Platform Bundle #1]-->[Core API] [Platform Bundle #1]-->[Core API]
@ -216,16 +215,16 @@ individual bundles using APIs which are supported in browser (such as
[Core API]<--[Platform Bundle #5] [Core API]<--[Platform Bundle #5]
[Core API]<--[Plugin Bundle #3] [Core API]<--[Plugin Bundle #3]
] ]
[Open MCT] ->[Browser APIs] [Open MCT Web] ->[Browser APIs]
] ]
``` ```
This architectural approach ensures a loose coupling between applications built This architectural approach ensures a loose coupling between applications built
using Open MCT and the backends which support them. using Open MCT Web and the backends which support them.
### Glossary ### Glossary
Certain terms are used throughout Open MCT with consistent meanings or Certain terms are used throughout Open MCT Web with consistent meanings or
conventions. Other developer documentation, particularly in-line documentation, conventions. Other developer documentation, particularly in-line documentation,
may presume an understanding of these terms. may presume an understanding of these terms.
@ -247,7 +246,7 @@ readable description of a thing; usually a single sentence or short paragraph.
(Most often used in the context of extensions, domain object models, or other (Most often used in the context of extensions, domain object models, or other
similar application-specific objects.) similar application-specific objects.)
* __domain object__: A meaningful object to the user; a distinct thing in the * __domain object__: A meaningful object to the user; a distinct thing in the
work support by Open MCT. Anything that appears in the left-hand tree is a work support by Open MCT Web. Anything that appears in the left-hand tree is a
domain object. domain object.
* __extension__: An extension is a unit of functionality exposed to the platform * __extension__: An extension is a unit of functionality exposed to the platform
in a declarative fashion by a bundle. The term 'extension category' is used to in a declarative fashion by a bundle. The term 'extension category' is used to
@ -279,10 +278,10 @@ side-by-side without conflicting.
# Framework # Framework
Open MCT is built on the [AngularJS framework]( http://www.angularjs.org ). A Open MCT Web is built on the [AngularJS framework]( http://www.angularjs.org ). A
good understanding of that framework is recommended. good understanding of that framework is recommended.
Open MCT adds an extra layer on top of AngularJS to (a) generalize its Open MCT Web adds an extra layer on top of AngularJS to (a) generalize its
dependency injection mechanism slightly, particularly to handle many-to-one dependency injection mechanism slightly, particularly to handle many-to-one
relationships; and (b) handle script loading. Combined, these features become a relationships; and (b) handle script loading. Combined, these features become a
plugin mechanism. plugin mechanism.
@ -301,7 +300,7 @@ MCT Web.)
are collected together in bundles, and may interact with other extensions. are collected together in bundles, and may interact with other extensions.
The framework layer, loaded and initiated from `index.html`, is the main point The framework layer, loaded and initiated from `index.html`, is the main point
of entry for an application built on Open MCT. It is responsible for wiring of entry for an application built on Open MCT Web. It is responsible for wiring
together the application at run time (much of this responsibility is actually together the application at run time (much of this responsibility is actually
delegated to Angular); at a high-level, the framework does this by proceeding delegated to Angular); at a high-level, the framework does this by proceeding
through four stages: through four stages:
@ -321,7 +320,7 @@ have been registered.
## Bundles ## Bundles
The basic configurable unit of Open MCT is the _bundle_. This term has been The basic configurable unit of Open MCT Web is the _bundle_. This term has been
used a bit already; now we'll get to a more formal definition. used a bit already; now we'll get to a more formal definition.
A bundle is a directory which contains: A bundle is a directory which contains:
@ -329,13 +328,13 @@ A bundle is a directory which contains:
* A bundle definition; a file named `bundle.json`. * A bundle definition; a file named `bundle.json`.
* Subdirectories for sources, resources, and tests. * Subdirectories for sources, resources, and tests.
* Optionally, a `README.md` Markdown file describing its contents (this is not * Optionally, a `README.md` Markdown file describing its contents (this is not
used by Open MCT in any way, but it's a helpful convention to follow.) used by Open MCT Web in any way, but it's a helpful convention to follow.)
The bundle definition is the main point of entry for the bundle. The framework The bundle definition is the main point of entry for the bundle. The framework
looks at this to determine which components need to be loaded and how they looks at this to determine which components need to be loaded and how they
interact. interact.
A plugin in Open MCT is a bundle. The platform itself is also decomposed A plugin in Open MCT Web is a bundle. The platform itself is also decomposed
into bundles, each of which provides some category of functionality. The into bundles, each of which provides some category of functionality. The
difference between a _bundle_ and a _plugin_ is purely a matter of the intended difference between a _bundle_ and a _plugin_ is purely a matter of the intended
use; a plugin is just a bundle that is meant to be easily added or removed. When use; a plugin is just a bundle that is meant to be easily added or removed. When
@ -356,7 +355,7 @@ For instance, if `bundles.json` contained:
"example/extensions" "example/extensions"
] ]
...then the Open MCT framework would look for bundle definitions at ...then the Open MCT Web framework would look for bundle definitions at
`example/builtins/bundle.json` and `example/extensions/bundle.json`, relative `example/builtins/bundle.json` and `example/extensions/bundle.json`, relative
to the path of `index.html`. No other bundles would be loaded. to the path of `index.html`. No other bundles would be loaded.
@ -457,7 +456,7 @@ arrays of extension definitions.
### General Extensions ### General Extensions
Extensions are intended as a general-purpose mechanism for adding new types of Extensions are intended as a general-purpose mechanism for adding new types of
functionality to Open MCT. functionality to Open MCT Web.
An extension category is registered with Angular under the name of the An extension category is registered with Angular under the name of the
extension, plus a suffix of two square brackets; so, an Angular service (or, extension, plus a suffix of two square brackets; so, an Angular service (or,
@ -466,7 +465,7 @@ extensions, from all bundles, by including this string (e.g. `types[]` to get
all type definitions) in a dependency declaration. all type definitions) in a dependency declaration.
As a convention, extension categories are given single-word, plural nouns for As a convention, extension categories are given single-word, plural nouns for
names within Open MCT (e.g. `types`.) This convention is not enforced by the names within Open MCT Web (e.g. `types`.) This convention is not enforced by the
platform in any way. For extension categories introduced by external plugins, it platform in any way. For extension categories introduced by external plugins, it
is recommended to prefix the extension category with a vendor identifier (or is recommended to prefix the extension category with a vendor identifier (or
similar) followed by a dot, to avoid collisions. similar) followed by a dot, to avoid collisions.
@ -505,7 +504,7 @@ the Angular-supported method for dependency injection is (effectively)
constructor-style injection; so, both declared dependencies and run-time constructor-style injection; so, both declared dependencies and run-time
arguments are competing for space in a constructor's arguments. arguments are competing for space in a constructor's arguments.
To resolve this, the Open MCT framework registers extension instances in a To resolve this, the Open MCT Web framework registers extension instances in a
partially constructed form. That is, the constructor exposed by the extension's partially constructed form. That is, the constructor exposed by the extension's
implementation is effectively decomposed into two calls; the first takes the implementation is effectively decomposed into two calls; the first takes the
dependencies, and returns the constructor in its second form, which takes the dependencies, and returns the constructor in its second form, which takes the
@ -549,7 +548,7 @@ sorted according to these conventions when using them.
### Angular Built-ins ### Angular Built-ins
Several entities supported Angular are expressed and managed as extensions in Several entities supported Angular are expressed and managed as extensions in
Open MCT. Specifically, these extension categories are _directives_, Open MCT Web. Specifically, these extension categories are _directives_,
_controllers_, _services_, _constants_, _runs_, and _routes_. _controllers_, _services_, _constants_, _runs_, and _routes_.
#### Angular Directives #### Angular Directives
@ -592,7 +591,7 @@ property value , which is the constant value that will be registered.
In some cases, you want to register code to run as soon as the application In some cases, you want to register code to run as soon as the application
starts; these can be registered as extensions of the [ runs category](https://docs.angularjs.org/api/ng/type/angular.Module#run ). starts; these can be registered as extensions of the [ runs category](https://docs.angularjs.org/api/ng/type/angular.Module#run ).
Implementations registered in this category will be invoked (with their declared Implementations registered in this category will be invoked (with their declared
dependencies) when the Open MCT application first starts. (Note that, in dependencies) when the Open MCT Web application first starts. (Note that, in
this case, the implementation is better thought of as just a function, as this case, the implementation is better thought of as just a function, as
opposed to a constructor function.) opposed to a constructor function.)
@ -627,13 +626,13 @@ providers of the same service (that is, with matching `provides` properties);
for a decorator, this will be whichever provider, decorator, or aggregator is for a decorator, this will be whichever provider, decorator, or aggregator is
next in the sequence of decorators. next in the sequence of decorators.
Services exposed by the Open MCT platform are often declared as composite Services exposed by the Open MCT Web platform are often declared as composite
services, as this form is open for a variety of common modifications. services, as this form is open for a variety of common modifications.
# Core API # Core API
Most of Open MCT's relevant API is provided and/or mediated by the Most of Open MCT Web's relevant API is provided and/or mediated by the
framework; that is, much of developing for Open MCT is a matter of adding framework; that is, much of developing for Open MCT Web is a matter of adding
extensions which access other parts of the platform by means of dependency extensions which access other parts of the platform by means of dependency
injection. injection.
@ -642,9 +641,9 @@ to be passed along by other services.
## Domain Objects ## Domain Objects
Domain objects are the most fundamental component of Open MCT's information Domain objects are the most fundamental component of Open MCT Web's information
model. A domain object is some distinct thing relevant to a user's workflow, model. A domain object is some distinct thing relevant to a user's work flow,
such as a telemetry channel, display, or similar. Open MCT is a tool for such as a telemetry channel, display, or similar. Open MCT Web is a tool for
viewing, browsing, manipulating, and otherwise interacting with a graph of viewing, browsing, manipulating, and otherwise interacting with a graph of
domain objects. domain objects.
@ -681,7 +680,7 @@ exposed.
### Identifier Syntax ### Identifier Syntax
For most purposes, a domain object identifier can be treated as a purely For most purposes, a domain object identifier can be treated as a purely
symbolic string; these are typically generated by Open MCT and plug-ins symbolic string; these are typically generated by Open MCT Web and plug-ins
should rarely be concerned with its internal structure. should rarely be concerned with its internal structure.
A domain object identifier has one or two parts, separated by a colon. A domain object identifier has one or two parts, separated by a colon.
@ -724,7 +723,7 @@ exposed it to be removed from its container.
containing: containing:
* `name`: Human-readable name. * `name`: Human-readable name.
* `description`: Human-readable summary of this action. * `description`: Human-readable summary of this action.
* `glyph`: Single character to be displayed in Open MCT's icon font set. * `glyph`: Single character to be displayed in Open MCT Web's icon font set.
* `context`: The context in which this action is being performed (see below) * `context`: The context in which this action is being performed (see below)
Action instances are typically obtained via a domain object's `action` Action instances are typically obtained via a domain object's `action`
@ -740,7 +739,7 @@ dragged object in a drag-and-drop operation.)
## Telemetry ## Telemetry
Telemetry series data in Open MCT is represented by a common interface, and Telemetry series data in Open MCT Web is represented by a common interface, and
packaged in a consistent manner to facilitate passing telemetry updates around packaged in a consistent manner to facilitate passing telemetry updates around
multiple visualizations. multiple visualizations.
@ -753,7 +752,7 @@ is useful when multiple distinct data sources are in use side-by-side.
* `key`: A machine-readable identifier for a unique series of telemetry within * `key`: A machine-readable identifier for a unique series of telemetry within
that source. that source.
* _Note: This API is still under development; additional properties, such as * _Note: This API is still under development; additional properties, such as
start and end time, should be present in future versions of Open MCT._ start and end time, should be present in future versions of Open MCT Web._
Additional properties may be included in telemetry requests which have specific Additional properties may be included in telemetry requests which have specific
interpretations for specific sources. interpretations for specific sources.
@ -777,7 +776,7 @@ not. (Typically, domain values are interpreted as UTC timestamps in milliseconds
relative to the UNIX epoch.) A series must have at least one domain and one relative to the UNIX epoch.) A series must have at least one domain and one
range, and may have more than one. range, and may have more than one.
Telemetry series data in Open MCT is expressed via the following Telemetry series data in Open MCT Web is expressed via the following
`TelemetrySeries` interface: `TelemetrySeries` interface:
* `getPointCount()`: Returns the number of unique points/samples in this series. * `getPointCount()`: Returns the number of unique points/samples in this series.
@ -816,7 +815,7 @@ interface:
* `getName()`: Get the human-readable name for this type. * `getName()`: Get the human-readable name for this type.
* `getDescription()`: Get a human-readable summary of this type. * `getDescription()`: Get a human-readable summary of this type.
* `getGlyph()`: Get the single character to be rendered as an icon for this type * `getGlyph()`: Get the single character to be rendered as an icon for this type
in Open MCT's custom font set. in Open MCT Web's custom font set.
* `getInitialModel()`: Get a domain object model that represents the initial * `getInitialModel()`: Get a domain object model that represents the initial
state (before user specification of properties) for domain objects of this type. state (before user specification of properties) for domain objects of this type.
* `getDefinition()`: Get the extension definition for this type, as a JavaScript * `getDefinition()`: Get the extension definition for this type, as a JavaScript
@ -832,7 +831,7 @@ an array of `TypeProperty` instances.
### Type Features ### Type Features
Features of a domain object type are expressed as symbolic string identifiers. Features of a domain object type are expressed as symbolic string identifiers.
They are defined in practice by usage; currently, the Open MCT platform only They are defined in practice by usage; currently, the Open MCT Web platform only
uses the creation feature to determine which domain object types should appear uses the creation feature to determine which domain object types should appear
in the Create menu. in the Create menu.
@ -886,7 +885,7 @@ Categories supported by the platform include:
* `key`: A machine-readable identifier for this action. * `key`: A machine-readable identifier for this action.
* `name`: A human-readable name for this action (e.g. to show in a menu) * `name`: A human-readable name for this action (e.g. to show in a menu)
* `description`: A human-readable summary of the behavior of this action. * `description`: A human-readable summary of the behavior of this action.
* `glyph`: A single character which will be rendered in Open MCT's custom * `glyph`: A single character which will be rendered in Open MCT Web's custom
font set as an icon for this action. font set as an icon for this action.
## Capabilities Category ## Capabilities Category
@ -911,44 +910,20 @@ A capability's implementation may also expose a static method `appliesTo(model)`
which should return a boolean value, and will be used by the platform to filter which should return a boolean value, and will be used by the platform to filter
down capabilities to those which should be exposed by specific domain objects, down capabilities to those which should be exposed by specific domain objects,
based on their domain object models. based on their domain object models.
## Containers Category
Containers provide options for the `mct-container` directive.
The definition for an extension in the `containers` category should include:
* `key`: An identifier for the container.
* `template`: An Angular template for the container, including an
`ng-transclude` where contained content should go.
* `attributes`: An array of attribute names. The values associated with
these attributes will be exposed in the template's scope under the
name provided by the `alias` property.
* `alias`: The property name in scope under which attributes will be
exposed. Optional; defaults to "container".
Note that `templateUrl` is not supported for `containers`.
## Controls Category ## Controls Category
Controls provide options for the `mct-control` directive. Controls provide options for the `mct-control` directive.
These standard control types are included in the forms bundle: Six standard control types are included in the forms bundle:
* `textfield`: A text input to enter plain text. * `textfield`: An area to enter plain text.
* `numberfield`: A text input to enter numbers.
* `select`: A drop-down list of options. * `select`: A drop-down list of options.
* `checkbox`: A box which may be checked/unchecked. * `checkbox`: A box which may be checked/unchecked.
* `color`: A color picker. * `color`: A color picker.
* `button`: A button. * `button`: A button.
* `datetime`: An input for UTC date/time entry; gives result as a UNIX * `datetime`: An input for UTC date/time entry; gives result as a UNIX
timestamp, in milliseconds since start of 1970, UTC. timestamp, in milliseconds since start of 1970, UTC.
* `composite`: A control parenting an array of other controls.
* `menu-button`: A drop-down list of items supporting custom behavior
on click.
* `dialog-button`: A button which opens a dialog allowing a single property
to be edited.
* `radio`: A radio button.
New controls may be added as extensions of the controls category. Extensions of New controls may be added as extensions of the controls category. Extensions of
this category have two properties: this category have two properties:
@ -988,7 +963,7 @@ Examples of gestures included in the platform are:
composition. composition.
* `drop`: For representations that can be drop targets for drag-and-drop * `drop`: For representations that can be drop targets for drag-and-drop
composition. composition.
* `menu`: For representations that can be used to popup a context menu. * `menu`: For representations that can be used to pop up a context menu.
Gesture definitions have a property `key` which is used as a machine-readable Gesture definitions have a property `key` which is used as a machine-readable
identifier for the gesture (e.g. `drag`, `drop`, `menu` above.) identifier for the gesture (e.g. `drag`, `drop`, `menu` above.)
@ -1004,7 +979,7 @@ of unremoved listeners.
## Indicators Category ## Indicators Category
An indicator is an element that should appear in the status area at the bottom An indicator is an element that should appear in the status area at the bottom
of a running Open MCT client instance. of a running Open MCT Web client instance.
### Standard Indicators ### Standard Indicators
@ -1014,7 +989,7 @@ provide implementations with the following methods:
* `getText()`: Provides the human-readable text that will be displayed for this * `getText()`: Provides the human-readable text that will be displayed for this
indicator. indicator.
* `getGlyph()`: Provides a single-character string that will be displayed as an * `getGlyph()`: Provides a single-character string that will be displayed as an
icon in Open MCT's custom font set. icon in Open MCT Web's custom font set.
* `getDescription()`: Provides a human-readable summary of the current state of * `getDescription()`: Provides a human-readable summary of the current state of
this indicator; will be displayed in a tooltip on hover. this indicator; will be displayed in a tooltip on hover.
* `getClass()`: Get a CSS class that will be applied to this indicator. * `getClass()`: Get a CSS class that will be applied to this indicator.
@ -1040,7 +1015,7 @@ this variety do not need to provide an implementation.
## Licenses Category ## Licenses Category
The extension category `licenses` can be used to add entries into the 'Licensing The extension category `licenses` can be used to add entries into the 'Licensing
information' page, reachable from Open MCT's About dialog. information' page, reachable from Open MCT Web's About dialog.
Licenses may have the following properties, all of which are strings: Licenses may have the following properties, all of which are strings:
@ -1053,11 +1028,11 @@ Licenses may have the following properties, all of which are strings:
## Policies Category ## Policies Category
Policies are used to handle decisions made using Open MCT's `policyService`; Policies are used to handle decisions made using Open MCT Web's `policyService`;
examples of these decisions are determining the applicability of certain examples of these decisions are determining the applicability of certain
actions, or checking whether or not a domain object of one type can contain a actions, or checking whether or not a domain object of one type can contain a
domain object of a different type. See the section on the Policies for an domain object of a different type. See the section on the Policies for an
overview of Open MCT's policy model. overview of Open MCT Web's policy model.
A policy's extension definition should include: A policy's extension definition should include:
@ -1073,7 +1048,7 @@ context)`. The specific types used for `candidate` and `context` vary by policy
category; in general, what is being asked is 'is this candidate allowed in this category; in general, what is being asked is 'is this candidate allowed in this
context?' This method should return a boolean value. context?' This method should return a boolean value.
Open MCT's policy model requires consensus; a policy decision is allowed Open MCT Web's policy model requires consensus; a policy decision is allowed
when and only when all policies choose to allow it. As such, policies should when and only when all policies choose to allow it. As such, policies should
generally be written to reject a certain case, and allow (by returning `true`) generally be written to reject a certain case, and allow (by returning `true`)
anything else. anything else.
@ -1160,7 +1135,7 @@ For example, the _My Items_ folder is added as an extension of this category.
Extensions of this category should have the following properties: Extensions of this category should have the following properties:
* `id`: The machine-readable identifier for the domain object being exposed. * `id`: The machine-readable identifier for the domaiwn object being exposed.
* `model`: The model, as a JSON object, for the domain object being exposed. * `model`: The model, as a JSON object, for the domain object being exposed.
## Stylesheets Category ## Stylesheets Category
@ -1202,7 +1177,7 @@ Templates do not have implementations.
## Types Category ## Types Category
The types extension category describes types of domain objects which may The types extension category describes types of domain objects which may
appear within Open MCT. appear within Open MCT Web.
A type's extension definition should have the following properties: A type's extension definition should have the following properties:
@ -1210,7 +1185,7 @@ A type's extension definition should have the following properties:
stored to and matched against the type property of domain object models. stored to and matched against the type property of domain object models.
* `name`: The human-readable name for this domain object type. * `name`: The human-readable name for this domain object type.
* `description`: A human-readable summary of this domain object type. * `description`: A human-readable summary of this domain object type.
* `glyph`: A single character to be rendered as an icon in Open MCT's custom * `glyph`: A single character to be rendered as an icon in Open MCT Web's custom
font set. font set.
* `model`: A domain object model, used as the initial state for created domain * `model`: A domain object model, used as the initial state for created domain
objects of this type (before any properties are specified.) objects of this type (before any properties are specified.)
@ -1259,7 +1234,7 @@ utilized via `mct-representation`); additionally:
* `name`: The human-readable name for this view type. * `name`: The human-readable name for this view type.
* description : A human-readable summary of this view type. * description : A human-readable summary of this view type.
* `glyph`: A single character to be rendered as an icon in Open MCT's custom * `glyph`: A single character to be rendered as an icon in Open MCT Web's custom
font set. font set.
* `type`: Optional; if present, this representation is only applicable for * `type`: Optional; if present, this representation is only applicable for
domain object's of this type. domain object's of this type.
@ -1301,7 +1276,7 @@ are visible, and what state they manage and/or behavior they invoke.
This set may contain up to two different objects: The _view proxy_, which is This set may contain up to two different objects: The _view proxy_, which is
used to make changes to the view as a whole, and the _selected object_, which is used to make changes to the view as a whole, and the _selected object_, which is
used to represent some state within the view. (Future versions of Open MCT used to represent some state within the view. (Future versions of Open MCT Web
may support multiple selected objects.) may support multiple selected objects.)
The `selection` object made available during Edit mode has the following The `selection` object made available during Edit mode has the following
@ -1337,8 +1312,57 @@ are supported:
# Directives # Directives
Open MCT defines several Angular directives that are intended for use both Open MCT Web defines several Angular directives that are intended for use both
internally within the platform, and by plugins. internally within the platform, and by plugins.
## Before Unload
The `mct-before-unload` directive is used to listen for (and prompt for user
confirmation) of navigation changes in the browser. This includes reloading,
following links out of Open MCT Web, or changing routes. It is used to hook into
both `onbeforeunload` event handling as well as route changes from within
Angular.
This directive is useable as an attribute. Its value should be an Angular
expression. When an action that would trigger an unload and/or route change
occurs, this Angular expression is evaluated. Its result should be a message to
display to the user to confirm their navigation change; if this expression
evaluates to a falsy value, no message will be displayed.
## Chart
The `mct-chart` directive is used to support drawing of simple charts. It is
present to support the Plot view, and its functionality is limited to the
functionality that is relevant for that view.
This directive is used at the element level and takes one attribute, `draw`
which is an Angular expression which will should evaluate to a drawing object.
This drawing object should contain the following properties:
* `dimensions`: The size, in logical coordinates, of the chart area. A
two-element array or numbers.
* `origin`: The position, in logical coordinates, of the lower-left corner of
the chart area. A two-element array or numbers.
* `lines`: An array of lines (e.g. as a plot line) to draw, where each line is
expressed as an object containing:
* `buffer`: A Float32Array containing points in the line, in logical
coordinates, in sequential x,y pairs.
* `color`: The color of the line, as a four-element RGBA array, where
each element is a number in the range of 0.0-1.0.
* `points`: The number of points in the line.
* `boxes`: An array of rectangles to draw in the chart area. Each is an object
containing:
* `start`: The first corner of the rectangle, as a two-element array of
numbers, in logical coordinates.
* `end`: The opposite corner of the rectangle, as a two-element array of
numbers, in logical coordinates. color : The color of the line, as a
four-element RGBA array, where each element is a number in the range of
0.0-1.0.
While `mct-chart` is intended to support plots specifically, it does perform
some useful management of canvas objects (e.g. choosing between WebGL and Canvas
2D APIs for drawing based on browser support) so its usage is recommended when
its supported drawing primitives are sufficient for other charting tasks.
## Container ## Container
@ -1407,7 +1431,7 @@ Passed as plain text in the attribute.
### Form Structure ### Form Structure
Forms in Open MCT have a common structure to permit consistent display. A Forms in Open MCT Web have a common structure to permit consistent display. A
form is broken down into sections, which will be displayed in groups; each form is broken down into sections, which will be displayed in groups; each
section is broken down into rows, each of which provides a control for a single section is broken down into rows, each of which provides a control for a single
property. Input from this form is two-way bound to the object passed via property. Input from this form is two-way bound to the object passed via
@ -1559,64 +1583,9 @@ there are items .
] ]
} }
## Table
The `mct-table` directive provides a generic table component, with optional
sorting and filtering capabilities. The table can be pre-populated with data
by setting the `rows` parameter, and it can be updated in real-time using the
`add:row` and `remove:row` broadcast events. The table will expand to occupy
100% of the size of its containing element. The table is highly optimized for
very large data sets.
### Events
The table supports two events for notifying that the rows have changed. For
performance reasons, the table does not monitor the content of `rows`
constantly.
* `add:row`: A `$broadcast` event that will notify the table that a new row
has been added to the table.
eg. The code below adds a new row, and alerts the table using the `add:row`
event. Sorting and filtering will be applied automatically by the table component.
```
$scope.rows.push(newRow);
$scope.$broadcast('add:row', $scope.rows.length-1);
```
* `remove:row`: A `$broadcast` event that will notify the table that a row
should be removed from the table.
eg. The code below removes a row from the rows array, and then alerts the table
to its removal.
```
$scope.rows.slice(5, 1);
$scope.$broadcast('remove:row', 5);
```
### Parameters
* `headers`: An array of string values which will constitute the column titles
that appear at the top of the table. Corresponding values are specified in
the rows using the header title provided here.
* `rows`: An array of objects containing row values. Each element in the
array must be an associative array, where the key corresponds to a column header.
* `enableFilter`: A boolean that if true, will enable searching and result
filtering. When enabled, each column will have a text input field that can be
used to filter the table rows in real time.
* `enableSort`: A boolean determining whether rows can be sorted. If true,
sorting will be enabled allowing sorting by clicking on column headers. Only
one column may be sorted at a time.
* `autoScroll`: A boolean value that if true, will cause the table to automatically
scroll to the bottom as new data arrives. Auto-scroll can be disengaged manually
by scrolling away from the bottom of the table, and can also be enabled manually
by scrolling to the bottom of the table rows.
# Services # Services
The Open MCT platform provides a variety of services which can be retrieved The Open MCT Web platform provides a variety of services which can be retrieved
and utilized via dependency injection. These services fall into two categories: and utilized via dependency injection. These services fall into two categories:
* _Composite Services_ are defined by a set of components extensions; plugins may * _Composite Services_ are defined by a set of components extensions; plugins may
@ -1628,7 +1597,7 @@ utilized by plugins but are not intended to be modified or augmented.
## Composite Type Services ## Composite Type Services
This section describes the composite services exposed by Open MCT, This section describes the composite services exposed by Open MCT Web,
specifically focusing on their interface and contract. specifically focusing on their interface and contract.
In many cases, the platform will include a provider for a service which consumes In many cases, the platform will include a provider for a service which consumes
@ -1946,7 +1915,7 @@ The `workerService` may be used to run web workers defined via the
as a shared worker); if the `key` is unknown, returns `undefined`. as a shared worker); if the `key` is unknown, returns `undefined`.
# Models # Models
Domain object models in Open MCT are JavaScript objects describing the Domain object models in Open MCT Web are JavaScript objects describing the
persistent state of the domain objects they describe. Their contents include a persistent state of the domain objects they describe. Their contents include a
mix of commonly understood metadata attributes; attributes which are recognized mix of commonly understood metadata attributes; attributes which are recognized
by and/or determine the applicability of specific extensions; and properties by and/or determine the applicability of specific extensions; and properties
@ -1962,7 +1931,7 @@ MCT Web and can be utilized directly:
## Extension-specific Properties ## Extension-specific Properties
Other properties of domain object models have specific meaning imposed by other Other properties of domain object models have specific meaning imposed by other
extensions within the Open MCT platform. extensions within the Open MCT Web platform.
### Capability-specific Properties ### Capability-specific Properties
@ -2246,7 +2215,7 @@ way of its `composition` capability.)
# Policies # Policies
Policies are consulted to determine when certain behavior in Open MCT is Policies are consulted to determine when certain behavior in Open MCT Web is
allowed. Policy questions are assigned to certain categories, which broadly allowed. Policy questions are assigned to certain categories, which broadly
describe the type of decision being made; within each category, policies have a describe the type of decision being made; within each category, policies have a
candidate (the thing which may or may not be allowed) and, optionally, a context candidate (the thing which may or may not be allowed) and, optionally, a context
@ -2262,19 +2231,22 @@ The platform understands the following policy categories (specifiable as the
* `action`: Determines whether or not a given action is allowable. The candidate * `action`: Determines whether or not a given action is allowable. The candidate
argument here is an Action; the context is its action context object. argument here is an Action; the context is its action context object.
* `composition`: Determines whether or not a given domain object(first argument, `parent`) can contain a candidate child object (second argument, `child`). * `composition`: Determines whether or not domain objects of a given type are
allowed to contain domain objects of another type. The candidate argument here
is the container's `Type`; the context argument is the `Type` of the object to be
contained.
* `view`: Determines whether or not a view is applicable for a domain object. * `view`: Determines whether or not a view is applicable for a domain object.
The candidate argument is the view's extension definition; the context argument The candidate argument is the view's extension definition; the context argument
is the `DomainObject` to be viewed. is the `DomainObject` to be viewed.
# Build-Test-Deploy # Build-Test-Deploy
Open MCT is designed to support a broad variety of build and deployment Open MCT Web is designed to support a broad variety of build and deployment
options. The sources can be deployed in the same directory structure used during options. The sources can be deployed in the same directory structure used during
development. A few utilities are included to support development processes. development. A few utilities are included to support development processes.
## Command-line Build ## Command-line Build
Open MCT is built using [`npm`](http://npmjs.com/) Open MCT Web is built using [`npm`](http://npmjs.com/)
and [`gulp`](http://gulpjs.com/). and [`gulp`](http://gulpjs.com/).
To install build dependencies (only needs to be run once): To install build dependencies (only needs to be run once):
@ -2283,15 +2255,15 @@ To install build dependencies (only needs to be run once):
To build: To build:
`npm run prepare` `npm run prepublish`
This will compile and minify JavaScript sources, as well as copy over assets. This will compile and minify JavaScript sources, as well as copy over assets.
The contents of the `dist` folder will contain a runnable Open MCT The contents of the `dist` folder will contain a runnable Open MCT Web
instance (e.g. by starting an HTTP server in that directory), including: instance (e.g. by starting an HTTP server in that directory), including:
* A `main.js` file containing Open MCT source code. * A `main.js` file containing Open MCT Web source code.
* Various assets in the `example` and `platform` directories. * Various assets in the `example` and `platform` directories.
* An `index.html` that runs Open MCT in its default configuration. * An `index.html` that runs Open MCT Web in its default configuration.
Additional `gulp` tasks are defined in [the gulpfile](gulpfile.js). Additional `gulp` tasks are defined in [the gulpfile](gulpfile.js).
@ -2300,7 +2272,7 @@ download build dependencies.
## Test Suite ## Test Suite
Open MCT uses [Jasmine 1.3](http://jasmine.github.io/) and Open MCT Web uses [Jasmine 1.3](http://jasmine.github.io/) and
[Karma](http://karma-runner.github.io) for automated testing. [Karma](http://karma-runner.github.io) for automated testing.
The test suite is configured to load any scripts ending with `Spec.js` found The test suite is configured to load any scripts ending with `Spec.js` found
@ -2338,8 +2310,8 @@ information using [Blanket.JS](http://blanketjs.org/) and display this at the
bottom of the screen. Currently, only statement coverage is displayed. bottom of the screen. Currently, only statement coverage is displayed.
## Deployment ## Deployment
Open MCT is built to be flexible in terms of the deployment strategies it Open MCT Web is built to be flexible in terms of the deployment strategies it
supports. In order to run in the browser, Open MCT needs: supports. In order to run in the browser, Open MCT Web needs:
1. HTTP access to sources/resources for the framework, platform, and all active 1. HTTP access to sources/resources for the framework, platform, and all active
bundles. bundles.
@ -2348,13 +2320,13 @@ external services need to support HTTP or some other web-accessible interface,
like WebSockets.) like WebSockets.)
Any HTTP server capable of serving flat files is sufficient for the first point. Any HTTP server capable of serving flat files is sufficient for the first point.
The command-line build also packages Open MCT into a `.war` file for easier The command-line build also packages Open MCT Web into a `.war` file for easier
deployment on containers such as Apache Tomcat. deployment on containers such as Apache Tomcat.
The second point may be less flexible, as it depends upon the specific services The second point may be less flexible, as it depends upon the specific services
to be utilized by Open MCT. Because of this, it is often the set of external to be utilized by Open MCT Web. Because of this, it is often the set of external
services (and the manner in which they are exposed) that determine how to deploy services (and the manner in which they are exposed) that determine how to deploy
Open MCT. Open MCT Web.
One important constraint to consider in this context is the browser's same One important constraint to consider in this context is the browser's same
origin policy. If external services are not on the same apparent host and port origin policy. If external services are not on the same apparent host and port
@ -2371,7 +2343,7 @@ configuration does not create a security vulnerability.
Examples of deployment strategies (and the conditions under which they make the Examples of deployment strategies (and the conditions under which they make the
most sense) include: most sense) include:
* If the external services that Open MCT will utilize are all running on * If the external services that Open MCT Web will utilize are all running on
[Apache Tomcat](https://tomcat.apache.org/), then it makes sense to run Open [Apache Tomcat](https://tomcat.apache.org/), then it makes sense to run Open
MCT Web from the same Tomcat instance as a separate web application. The MCT Web from the same Tomcat instance as a separate web application. The
`.war` artifact produced by the command line build facilitates this deployment `.war` artifact produced by the command line build facilitates this deployment
@ -2382,28 +2354,28 @@ hosts/ports, then it may make sense to use a web server that supports proxying,
such as the [Apache HTTP Server](http://httpd.apache.org/). In this such as the [Apache HTTP Server](http://httpd.apache.org/). In this
configuration, the HTTP server would be configured to proxy (or reverse proxy) configuration, the HTTP server would be configured to proxy (or reverse proxy)
requests at specific paths to the various external services, while providing requests at specific paths to the various external services, while providing
Open MCT as flat files from a different path. Open MCT Web as flat files from a different path.
* If a single server component is being developed to handle all server-side * If a single server component is being developed to handle all server-side
needs of an Open MCT instance, it can make sense to serve Open MCT (as needs of an Open MCT Web instance, it can make sense to serve Open MCT Web (as
flat files) from the same component using an embedded HTTP server such as flat files) from the same component using an embedded HTTP server such as
[Nancy](http://nancyfx.org/). [Nancy](http://nancyfx.org/).
* If no external services are needed (or if the 'external services' will just * If no external services are needed (or if the 'external services' will just
be generating flat files to read) it makes sense to utilize a lightweight flat be generating flat files to read) it makes sense to utilize a lightweight flat
file HTTP server such as [Lighttpd](http://www.lighttpd.net/). In this file HTTP server such as [Lighttpd](http://www.lighttpd.net/). In this
configuration, Open MCT sources/resources would be placed at one path, while configuration, Open MCT Web sources/resources would be placed at one path, while
the files generated by the external service are placed at another path. the files generated by the external service are placed at another path.
* If all external services support CORS, it may make sense to have an HTTP * If all external services support CORS, it may make sense to have an HTTP
server that is solely responsible for making Open MCT sources/resources server that is solely responsible for making Open MCT Web sources/resources
available, and to have Open MCT contact these external services directly. available, and to have Open MCT Web contact these external services directly.
Again, lightweight HTTP servers such as [Lighttpd](http://www.lighttpd.net/) Again, lightweight HTTP servers such as [Lighttpd](http://www.lighttpd.net/)
are useful in this circumstance. The downside of this option is that additional are useful in this circumstance. The downside of this option is that additional
configuration effort is required, both to enable CORS on the external services, configuration effort is required, both to enable CORS on the external services,
and to ensure that Open MCT can correctly locate these services. and to ensure that Open MCT Web can correctly locate these services.
Another important consideration is authentication. By design, Open MCT does Another important consideration is authentication. By design, Open MCT Web does
not handle user authentication. Instead, this should typically be treated as a not handle user authentication. Instead, this should typically be treated as a
deployment-time concern, where authentication is handled by the HTTP server deployment-time concern, where authentication is handled by the HTTP server
which provides Open MCT, or an external access management system. which provides Open MCT Web, or an external access management system.
### Configuration ### Configuration
In most of the deployment options above, some level of configuration is likely In most of the deployment options above, some level of configuration is likely
@ -2411,7 +2383,7 @@ to be needed or desirable to make sure that bundles can reach the external
services they need to reach. Most commonly this means providing the path or URL services they need to reach. Most commonly this means providing the path or URL
to an external service. to an external service.
Configurable parameters within Open MCT are specified via constants Configurable parameters within Open MCT Web are specified via constants
(literally, as extensions of the `constants` category) and accessed via (literally, as extensions of the `constants` category) and accessed via
dependency injection by the scripts which need them. Reasonable defaults for dependency injection by the scripts which need them. Reasonable defaults for
these constants are provided in the bundle where they are used. Plugins are these constants are provided in the bundle where they are used. Plugins are
@ -2430,7 +2402,7 @@ for error, but is viable if there are a small number of constants to change.
constants. This is particularly appropriate when multiple configurations (e.g. constants. This is particularly appropriate when multiple configurations (e.g.
development, test, production) need to be managed easily; these can be swapped development, test, production) need to be managed easily; these can be swapped
quickly by changing the set of active bundles in bundles.json. quickly by changing the set of active bundles in bundles.json.
* Deploy Open MCT and its external services in such a fashion that the * Deploy Open MCT Web and its external services in such a fashion that the
default paths to reach external services are all correct. default paths to reach external services are all correct.
### Configuration Constants ### Configuration Constants
@ -2441,7 +2413,7 @@ The following constants have global significance:
to be overridden by other bundles, but persistence adapters may wish to to be overridden by other bundles, but persistence adapters may wish to
consume this constant in order to provide persistence for that space. consume this constant in order to provide persistence for that space.
The following configuration constants are recognized by Open MCT bundles: The following configuration constants are recognized by Open MCT Web bundles:
* Common UI elements - `platform/commonUI/general` * Common UI elements - `platform/commonUI/general`
* `THEME`: A string identifying the current theme symbolically. Individual * `THEME`: A string identifying the current theme symbolically. Individual
stylesheets (the `stylesheets` extension category) may specify an optional stylesheets (the `stylesheets` extension category) may specify an optional

View File

@ -1,121 +0,0 @@
# Security Guide
Open MCT is a rich client with plugin support that executes as a single page
web application in a browser environment. Security concerns and
vulnerabilities associated with the web as a platform should be considered
before deploying Open MCT (or any other web application) for mission or
production usage.
This document describes several important points to consider when developing
for or deploying Open MCT securely. Other resources such as
[Open Web Application Security Project (OWASP)](https://www.owasp.org)
provide a deeper and more general overview of security for web applications.
## Security Model
Open MCT has been architected assuming the following deployment pattern:
* A tagged, tested Open MCT version will be used.
* Externally authored plugins will be installed.
* A server will provide persistent storage, telemetry, and other shared data.
* Authorization, authentication, and auditing will be handled by a server.
## Security Procedures
The Open MCT team secures our code base using a combination of code review,
dependency review, and periodic security reviews. Static analysis performed
during automated verification additionally safeguards against common
coding errors which may result in vulnerabilities.
### Code Review
All contributions are reviewed by internal team members. External
contributors receive increased scrutiny for security and quality,
and must sign a licensing agreement.
### Dependency Review
Before integrating third-party dependencies, they are reviewed for security
and quality, with consideration given to authors and users of these
dependencies, as well as review of open source code.
### Periodic Security Reviews
Open MCT's code, design, and architecture are periodically reviewed
(approximately annually) for common security issues, such as the
[OWASP Top Ten](https://www.owasp.org/index.php/Category:OWASP_Top_Ten_Project).
## Security Concerns
Certain security concerns deserve special attention when deploying Open MCT,
or when authoring plugins.
### Identity Spoofing
Open MCT issues calls to web services with the privileges of a logged in user.
Compromised sources (either for Open MCT itself or a plugin) could
therefore allow malicious code to execute with those privileges.
To avoid this:
* Serve Open MCT and other scripts over SSL (https rather than http)
to prevent man-in-the-middle attacks.
* Exercise precautions such as security reviews for any plugins or
applications built for or with Open MCT to reject malicious changes.
### Information Disclosure
If Open MCT is used to handle or display sensitive data, any components
(such as adapter plugins) must take care to avoid leaking or disclosing
this information. For example, avoid sending sensitive data to third-party
servers or insecure APIs.
### Data Tampering
The web application architecture leaves open the possibility that direct
calls will be made to back-end services, circumventing Open MCT entirely.
As such, Open MCT assumes that server components will perform any necessary
data validation during calls issues to the server.
Additionally, plugins which serialize and write data to the server must
escape that data to avoid database injection attacks, and similar.
### Repudiation
Open MCT assumes that servers log any relevant interactions and associates
these with a user identity; the specific user actions taken within the
application are assumed not to be of concern for auditing.
In the absence of server-side logging, users may disclaim (maliciously,
mistakenly, or otherwise) actions taken within the system without any
way to prove otherwise.
If keeping client-level interactions is important, this will need to be
implemented via a plugin.
### Denial-of-service
Open MCT assumes that server-side components will be insulated against
denial-of-service attacks. Services should only permit resource-intensive
tasks to be initiated by known or trusted users.
### Elevation of Privilege
Corollary to the assumption that servers guide against identity spoofing,
Open MCT assumes that services do not allow a user to act with
inappropriately escalated privileges. Open MCT cannot protect against
such escalation; in the clearest case, a malicious actor could interact
with web services directly to exploit such a vulnerability.
## Additional Reading
The following resources have been used as a basis for identifying potential
security threats to Open MCT deployments in preparation of this document:
* [STRIDE model](https://www.owasp.org/index.php/Threat_Risk_Modeling#STRIDE)
* [Attack Surface Analysis Cheat Sheet](https://www.owasp.org/index.php/Attack_Surface_Analysis_Cheat_Sheet)
* [XSS Prevention Cheat Sheet](https://www.owasp.org/index.php/XSS_(Cross_Site_Scripting)_Prevention_Cheat_Sheet)

View File

@ -1,37 +1,35 @@
# Open MCT Documentation # Open MCT Web Documentation
## Overview ## Overview
Documentation is provided to support the use and development of Documentation is provided to support the use and development of
Open MCT. It's recommended that before doing Open MCT Web. It's recommended that before doing
any development with Open MCT you take some time to familiarize yourself any development with Open MCT Web you take some time to familiarize yourself
with the documentation below. with the documentation below.
Open MCT provides functionality out of the box, but it's also a platform for Open MCT Web provides functionality out of the box, but it's also a platform for
building rich mission operations applications based on modern web technology. building rich mission operations applications based on modern web technology.
The platform is configured by plugins which extend the platform at a variety The platform is configured declaratively, and defines conventions for
of extension points. The details of how to building on the provided capabilities by creating modular 'bundles' that
extend the platform at a variety of extension points. The details of how to
extend the platform are provided in the following documentation. extend the platform are provided in the following documentation.
## Sections ## Sections
* The [Architecture Overview](architecture/) describes the concepts used
throughout Open MCT Web, and gives a high level overview of the platform's design.
* The [Developer's Guide](guide/) goes into more detail about how to use the
platform and the functionality that it provides.
* The [Tutorials](tutorials/) give examples of extending the platform to add
functionality,
and integrate with data sources.
* The [API](api/) document is generated from inline documentation * The [API](api/) document is generated from inline documentation
using [JSDoc](http://usejsdoc.org/), and describes the JavaScript objects and using [JSDoc](http://usejsdoc.org/), and describes the JavaScript objects and
functions that make up the software platform. functions that make up the software platform.
* The [Development Process](process/) document describes the * Finally, the [Development Process](process/) document describes the
Open MCT software development cycle. Open MCT Web software development cycle.
## Legacy Documentation
As we transition to a new API, the following documentation for the old API
(which is supported during the transtion) may be useful as well:
* The [Architecture Overview](architecture/) describes the concepts used
throughout Open MCT, and gives a high level overview of the platform's design.
* The [Developer's Guide](guide/) goes into more detail about how to use the
platform and the functionality that it provides.
* The [Tutorials](tutorials/) give examples of extending the platform to add
functionality, and integrate with data sources.

View File

@ -1,6 +1,6 @@
# Development Cycle # Development Cycle
Development of Open MCT occurs on an iterative cycle of Development of Open MCT Web occurs on an iterative cycle of
sprints and releases. sprints and releases.
* A _sprint_ is three weeks in duration, and represents a * A _sprint_ is three weeks in duration, and represents a
@ -151,9 +151,11 @@ emphasis on testing.
ensuring software passes that testing in order to ship on time; ensuring software passes that testing in order to ship on time;
may prefer to disable malfunctioning components and fix them may prefer to disable malfunctioning components and fix them
in a subsequent sprint, for example. in a subsequent sprint, for example.
* [__Ship.__](version.md) Tag a code snapshot that has passed release/sprint * __Ship.__ Tag a code snapshot that has passed acceptance
testing and deploy that version. (Only true if relevant testing and deploy that version. (Only true if acceptance
testing has passed by this point; if testing has not testing has passed by this point; if acceptance testing has not
been passed, will need to make ad hoc decisions with stakeholders, been passed, will need to make ad hoc decisions with stakeholders,
e.g. "extend the sprint" or "defer shipment until end of next e.g. "extend the sprint" or "defer shipment until end of next
sprint.") sprint.")

View File

@ -1,15 +1,13 @@
# Development Process # Development Process
The process used to develop Open MCT is described in the following The process used to develop Open MCT Web is described in the following
documents: documents:
* The [Development Cycle](cycle.md) describes how and when specific * [Development Cycle](cycle.md): Describes how and when specific
process points are repeated during development. process points are repeated during development.
* The [Version Guide](version.md) describes version numbering for
Open MCT (both semantics and process.)
* Testing is described in two documents: * Testing is described in two documents:
* The [Test Plan](testing/plan.md) summarizes the approaches used * The [Test Plan](testing/plan.md) summarizes the approaches used
to test Open MCT. to test Open MCT Web.
* The [Test Procedures](testing/procedures.md) document what * The [Test Procedures](testing/procedures.md) document what
specific tests are performed to verify correctness, and how specific tests are performed to verify correctness, and how
they should be carried out. they should be carried out.

View File

@ -2,7 +2,7 @@
## Test Levels ## Test Levels
Testing for Open MCT includes: Testing for Open MCT Web includes:
* _Smoke testing_: Brief, informal testing to verify that no major issues * _Smoke testing_: Brief, informal testing to verify that no major issues
or regressions are present in the software, or in specific features of or regressions are present in the software, or in specific features of
@ -102,7 +102,7 @@ perform:
* A relevant subset of [_user testing_](procedures.md#user-test-procedures) * A relevant subset of [_user testing_](procedures.md#user-test-procedures)
identified by the acting [project manager](../cycle.md#roles). identified by the acting [project manager](../cycle.md#roles).
* [_Long-duration testing_](procedures.md#long-duration-testing) * [_Long-duration testing_](procedures.md#long-duration-testng)
(specifically, for 24 hours.) (specifically, for 24 hours.)
Issues are reported as a product of both forms of testing. Issues are reported as a product of both forms of testing.

View File

@ -4,7 +4,7 @@
This document is intended to be used: This document is intended to be used:
* By testers, to verify that Open MCT behaves as specified. * By testers, to verify that Open MCT Web behaves as specified.
* By the development team, to document new test cases and to provide * By the development team, to document new test cases and to provide
guidance on how to author these. guidance on how to author these.
@ -62,7 +62,7 @@ Test cases should be narrow in scope; if a list of steps is excessively
long (or must be written vaguely to be kept short) it should be broken long (or must be written vaguely to be kept short) it should be broken
down into multiple tests which reference one another. down into multiple tests which reference one another.
All requirements satisfied by Open MCT should be verifiable using All requirements satisfied by Open MCT Web should be verifiable using
one or more test procedures. one or more test procedures.
## Glossary ## Glossary
@ -166,4 +166,4 @@ Eval. criteria | Visual inspection
* Logs should not contain any unexpected warnings or errors ("expected" * Logs should not contain any unexpected warnings or errors ("expected"
warnings or errors are those that have been documented and prioritized warnings or errors are those that have been documented and prioritized
as known issues, or those that are explained by transient conditions as known issues, or those that are explained by transient conditions
external to the software, such as network outages.) external to the software, such as network outages.)

View File

@ -1,142 +0,0 @@
# Version Guide
This document describes semantics and processes for providing version
numbers for Open MCT, and additionally provides guidelines for dependent
projects developed by the same team.
Versions are incremented at specific points in Open MCT's
[Development Cycle](cycle.md); see that document for a description of
sprints and releases.
## Audience
Individuals interested in consuming version numbers can be categorized as
follows:
* _Users_: Generally disinterested, occasionally wish to identify version
to cross-reference against documentation, or to report issues.
* _Testers_: Want to identify which version of the software they are
testing, e.g. to file issues for defects.
* _Internal developers_: Often, inverse of testers; want to identify which
version of software was/is in use when certain behavior is observed. Want
to be able to correlate versions in use with “streams” of development
(e.g. dev vs. prod), when possible.
* _External developers_: Need to understand which version of software is
in use when developing/maintaining plug-ins, in order to ensure
compatibility of their software.
## Version Reporting
Software versions should be reflected in the user interface of the
application in three ways:
* _Version number_: A semantic version (see below) which serves both to
uniquely identify releases, as well as to inform plug-in developers
about compatibility with previous releases.
* _Revision identifier_: While using git, the commit hash. Supports
internal developers and testers by uniquely identifying client
software snapshots.
* _Branding_: Identifies which variant is in use. (Typically, Open MCT
is re-branded when deployed for a specific mission or center.)
## Version Numbering
Open MCT shall provide version numbers consistent with
[Semantic Versioning 2.0.0](http://semver.org/). In summary, versions
are expressed in a "major.minor.patch" form, and incremented based on
nature of changes to external API. Breaking changes require a "major"
version increment; backwards-compatible changes require a "minor"
version increment; neutral changes (such as bug fixes) require a "patch"
version increment. A hyphen-separated suffix indicates a pre-release
version, which may be unstable or may not fully meet compatibility
requirements.
Additionally, the following project-specific standards will be used:
* During development, a "-SNAPSHOT" suffix shall be appended to the
version number. The version number before the suffix shall reflect
the next expected version number for release.
* Prior to a 1.0.0 release, the _minor_ version will be incremented
on a per-release basis; the _patch_ version will be incremented on a
per-sprint basis.
* Starting at version 1.0.0, version numbers will be updated with each
completed sprint. The version number for the sprint shall be
determined relative to the previous released version; the decision
to increment the _major_, _minor_, or _patch_ version should be
made based on the nature of changes during that release. (It is
recommended that these numbers are incremented as changes are
introduced, such that at end of release the version number may
be chosen by simply removing the suffix.)
* The first three sprints in a release may be unstable; in these cases, a
unique version identifier should still be generated, but a suffix
should be included to indicate that the version is not necessarily
production-ready. Recommended suffixes are:
Sprint | Suffix
:------:|:--------:
1 | `-alpha`
2 | `-beta`
3 | `-rc`
### Scope of External API
"External API" refers to the API exposed to, documented for, and used by
plug-in developers. Changes to interfaces used internally by Open MCT
(or otherwise not documented for use externally) require only a _patch_
version bump.
## Incrementing Versions
At the end of a sprint, the [project manager](cycle.md#roles)
should update (or delegate the task of updating) Open MCT version
numbers by the following process:
1. Update version number in `package.json`
1. Remove `-SNAPSHOT` suffix.
2. Verify that resulting version number meets semantic versioning
requirements relative to previous stable version. Increment if
necessary.
3. If version is considered unstable (which may be the case during
the first three sprints of a release), apply a new suffix per
[Version Numbering](#version-numbering) guidance above.
2. Tag the release.
1. Commit changes to `package.json` on the `master` branch.
The commit message should reference the sprint being closed,
preferably by a URL reference to the associated Milestone in
GitHub.
2. Verify that build still completes, that application passes
smoke-testing, and that only differences from tested versions
are the changes to version number above.
3. Push the `master` branch.
4. Tag this commit with the version number, prepending the letter "v".
(e.g. `git tag v0.9.3-alpha`)
5. Push the tag to GitHub. (e.g. `git push origin v0.9.3-alpha`).
3. Upload a release archive.
1. Run `npm pack` to generate the archive.
2. Use the [GitHub release interface](https://github.com/nasa/openmct/releases)
to draft a new release.
3. Choose the existing tag for the new version (created and pushed above.)
Enter the tag name as the release name as well; see existing releases
for examples.
4. Attach the release archive.
5. Designate the release as a "pre-release" as appropriate (for instance,
when the version number has been suffixed as unstable, or when
the version number is below 1.0.0.)
4. Restore snapshot status in `package.json`
1. Remove any suffix from the version number, or increment the
_patch_ version if there is no suffix.
2. Append a `-SNAPSHOT` suffix.
3. Commit changes to `package.json` on the `master` branch.
The commit message should reference the sprint being opened,
preferably by a URL reference to the associated Milestone in
GitHub.
4. Verify that build still completes, that application passes
smoke-testing.
5. Push the `master` branch.
Projects dependent on Open MCT being co-developed by the Open MCT
team should follow a similar process, except that they should
additionally update their dependency on Open MCT to point to the
latest archive when removing their `-SNAPSHOT` status, and
that they should be pointed back to the `master` branch after
this has completed.

File diff suppressed because it is too large Load Diff

View File

@ -1,2 +1,2 @@
This directory is for example bundles, which are intended to illustrate This directory is for example bundles, which are intended to illustrate
how to author new software components using Open MCT. how to author new software components using Open MCT Web.

View File

@ -5,4 +5,4 @@ These are:
* Controllers * Controllers
* Directives * Directives
* Routes * Routes
* Services * Services

View File

@ -1,9 +1,9 @@
/***************************************************************************** /*****************************************************************************
* Open MCT, Copyright (c) 2014-2017, United States Government * Open MCT Web, Copyright (c) 2014-2015, United States Government
* as represented by the Administrator of the National Aeronautics and Space * as represented by the Administrator of the National Aeronautics and Space
* Administration. All rights reserved. * Administration. All rights reserved.
* *
* Open MCT is licensed under the Apache License, Version 2.0 (the * Open MCT Web is licensed under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance with the License. * "License"); you may not use this file except in compliance with the License.
* You may obtain a copy of the License at * You may obtain a copy of the License at
* http://www.apache.org/licenses/LICENSE-2.0. * http://www.apache.org/licenses/LICENSE-2.0.
@ -14,7 +14,7 @@
* License for the specific language governing permissions and limitations * License for the specific language governing permissions and limitations
* under the License. * under the License.
* *
* Open MCT includes source code licensed under additional open source * Open MCT Web includes source code licensed under additional open source
* licenses. See the Open Source Licenses file (LICENSES.md) included with * licenses. See the Open Source Licenses file (LICENSES.md) included with
* this source code distribution or the Licensing information page available * this source code distribution or the Licensing information page available
* at runtime from the About dialog for additional information. * at runtime from the About dialog for additional information.

View File

@ -1,9 +1,9 @@
<!-- <!--
Open MCT, Copyright (c) 2014-2017, United States Government Open MCT Web, Copyright (c) 2014-2015, United States Government
as represented by the Administrator of the National Aeronautics and Space as represented by the Administrator of the National Aeronautics and Space
Administration. All rights reserved. Administration. All rights reserved.
Open MCT is licensed under the Apache License, Version 2.0 (the Open MCT Web is licensed under the Apache License, Version 2.0 (the
"License"); you may not use this file except in compliance with the License. "License"); you may not use this file except in compliance with the License.
You may obtain a copy of the License at You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0. http://www.apache.org/licenses/LICENSE-2.0.
@ -14,11 +14,11 @@
License for the specific language governing permissions and limitations License for the specific language governing permissions and limitations
under the License. under the License.
Open MCT includes source code licensed under additional open source Open MCT Web includes source code licensed under additional open source
licenses. See the Open Source Licenses file (LICENSES.md) included with licenses. See the Open Source Licenses file (LICENSES.md) included with
this source code distribution or the Licensing information page available this source code distribution or the Licensing information page available
at runtime from the About dialog for additional information. at runtime from the About dialog for additional information.
--> -->
<p>Hello, world! I am the default route.</p> <p>Hello, world! I am the default route.</p>
<p ng-controller="ExampleController">My controller has told me: "{{phrase}}"</p> <p ng-controller="ExampleController">My controller has told me: "{{phrase}}"</p>
<span example-directive></span> <span example-directive></span>

View File

@ -1,9 +1,9 @@
/***************************************************************************** /*****************************************************************************
* Open MCT, Copyright (c) 2014-2017, United States Government * Open MCT Web, Copyright (c) 2014-2015, United States Government
* as represented by the Administrator of the National Aeronautics and Space * as represented by the Administrator of the National Aeronautics and Space
* Administration. All rights reserved. * Administration. All rights reserved.
* *
* Open MCT is licensed under the Apache License, Version 2.0 (the * Open MCT Web is licensed under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance with the License. * "License"); you may not use this file except in compliance with the License.
* You may obtain a copy of the License at * You may obtain a copy of the License at
* http://www.apache.org/licenses/LICENSE-2.0. * http://www.apache.org/licenses/LICENSE-2.0.
@ -14,7 +14,7 @@
* License for the specific language governing permissions and limitations * License for the specific language governing permissions and limitations
* under the License. * under the License.
* *
* Open MCT includes source code licensed under additional open source * Open MCT Web includes source code licensed under additional open source
* licenses. See the Open Source Licenses file (LICENSES.md) included with * licenses. See the Open Source Licenses file (LICENSES.md) included with
* this source code distribution or the Licensing information page available * this source code distribution or the Licensing information page available
* at runtime from the About dialog for additional information. * at runtime from the About dialog for additional information.
@ -39,4 +39,4 @@ define(
return ExampleController; return ExampleController;
} }
); );

View File

@ -1,9 +1,9 @@
/***************************************************************************** /*****************************************************************************
* Open MCT, Copyright (c) 2014-2017, United States Government * Open MCT Web, Copyright (c) 2014-2015, United States Government
* as represented by the Administrator of the National Aeronautics and Space * as represented by the Administrator of the National Aeronautics and Space
* Administration. All rights reserved. * Administration. All rights reserved.
* *
* Open MCT is licensed under the Apache License, Version 2.0 (the * Open MCT Web is licensed under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance with the License. * "License"); you may not use this file except in compliance with the License.
* You may obtain a copy of the License at * You may obtain a copy of the License at
* http://www.apache.org/licenses/LICENSE-2.0. * http://www.apache.org/licenses/LICENSE-2.0.
@ -14,7 +14,7 @@
* License for the specific language governing permissions and limitations * License for the specific language governing permissions and limitations
* under the License. * under the License.
* *
* Open MCT includes source code licensed under additional open source * Open MCT Web includes source code licensed under additional open source
* licenses. See the Open Source Licenses file (LICENSES.md) included with * licenses. See the Open Source Licenses file (LICENSES.md) included with
* this source code distribution or the Licensing information page available * this source code distribution or the Licensing information page available
* at runtime from the About dialog for additional information. * at runtime from the About dialog for additional information.
@ -63,4 +63,4 @@ define(
return ExampleDirective; return ExampleDirective;
} }
); );

View File

@ -1,9 +1,9 @@
/***************************************************************************** /*****************************************************************************
* Open MCT, Copyright (c) 2014-2017, United States Government * Open MCT Web, Copyright (c) 2014-2015, United States Government
* as represented by the Administrator of the National Aeronautics and Space * as represented by the Administrator of the National Aeronautics and Space
* Administration. All rights reserved. * Administration. All rights reserved.
* *
* Open MCT is licensed under the Apache License, Version 2.0 (the * Open MCT Web is licensed under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance with the License. * "License"); you may not use this file except in compliance with the License.
* You may obtain a copy of the License at * You may obtain a copy of the License at
* http://www.apache.org/licenses/LICENSE-2.0. * http://www.apache.org/licenses/LICENSE-2.0.
@ -14,7 +14,7 @@
* License for the specific language governing permissions and limitations * License for the specific language governing permissions and limitations
* under the License. * under the License.
* *
* Open MCT includes source code licensed under additional open source * Open MCT Web includes source code licensed under additional open source
* licenses. See the Open Source Licenses file (LICENSES.md) included with * licenses. See the Open Source Licenses file (LICENSES.md) included with
* this source code distribution or the Licensing information page available * this source code distribution or the Licensing information page available
* at runtime from the About dialog for additional information. * at runtime from the About dialog for additional information.
@ -43,4 +43,4 @@ define(
return ExampleService; return ExampleService;
} }
); );

View File

@ -1,9 +1,9 @@
/***************************************************************************** /*****************************************************************************
* Open MCT, Copyright (c) 2014-2017, United States Government * Open MCT Web, Copyright (c) 2014-2015, United States Government
* as represented by the Administrator of the National Aeronautics and Space * as represented by the Administrator of the National Aeronautics and Space
* Administration. All rights reserved. * Administration. All rights reserved.
* *
* Open MCT is licensed under the Apache License, Version 2.0 (the * Open MCT Web is licensed under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance with the License. * "License"); you may not use this file except in compliance with the License.
* You may obtain a copy of the License at * You may obtain a copy of the License at
* http://www.apache.org/licenses/LICENSE-2.0. * http://www.apache.org/licenses/LICENSE-2.0.
@ -14,7 +14,7 @@
* License for the specific language governing permissions and limitations * License for the specific language governing permissions and limitations
* under the License. * under the License.
* *
* Open MCT includes source code licensed under additional open source * Open MCT Web includes source code licensed under additional open source
* licenses. See the Open Source Licenses file (LICENSES.md) included with * licenses. See the Open Source Licenses file (LICENSES.md) included with
* this source code distribution or the Licensing information page available * this source code distribution or the Licensing information page available
* at runtime from the About dialog for additional information. * at runtime from the About dialog for additional information.

View File

@ -1,9 +1,9 @@
/***************************************************************************** /*****************************************************************************
* Open MCT, Copyright (c) 2014-2017, United States Government * Open MCT Web, Copyright (c) 2014-2015, United States Government
* as represented by the Administrator of the National Aeronautics and Space * as represented by the Administrator of the National Aeronautics and Space
* Administration. All rights reserved. * Administration. All rights reserved.
* *
* Open MCT is licensed under the Apache License, Version 2.0 (the * Open MCT Web is licensed under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance with the License. * "License"); you may not use this file except in compliance with the License.
* You may obtain a copy of the License at * You may obtain a copy of the License at
* http://www.apache.org/licenses/LICENSE-2.0. * http://www.apache.org/licenses/LICENSE-2.0.
@ -14,7 +14,7 @@
* License for the specific language governing permissions and limitations * License for the specific language governing permissions and limitations
* under the License. * under the License.
* *
* Open MCT includes source code licensed under additional open source * Open MCT Web includes source code licensed under additional open source
* licenses. See the Open Source Licenses file (LICENSES.md) included with * licenses. See the Open Source Licenses file (LICENSES.md) included with
* this source code distribution or the Licensing information page available * this source code distribution or the Licensing information page available
* at runtime from the About dialog for additional information. * at runtime from the About dialog for additional information.
@ -47,4 +47,4 @@ define(
return SomeAggregator; return SomeAggregator;
} }
); );

View File

@ -1,9 +1,9 @@
/***************************************************************************** /*****************************************************************************
* Open MCT, Copyright (c) 2014-2017, United States Government * Open MCT Web, Copyright (c) 2014-2015, United States Government
* as represented by the Administrator of the National Aeronautics and Space * as represented by the Administrator of the National Aeronautics and Space
* Administration. All rights reserved. * Administration. All rights reserved.
* *
* Open MCT is licensed under the Apache License, Version 2.0 (the * Open MCT Web is licensed under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance with the License. * "License"); you may not use this file except in compliance with the License.
* You may obtain a copy of the License at * You may obtain a copy of the License at
* http://www.apache.org/licenses/LICENSE-2.0. * http://www.apache.org/licenses/LICENSE-2.0.
@ -14,7 +14,7 @@
* License for the specific language governing permissions and limitations * License for the specific language governing permissions and limitations
* under the License. * under the License.
* *
* Open MCT includes source code licensed under additional open source * Open MCT Web includes source code licensed under additional open source
* licenses. See the Open Source Licenses file (LICENSES.md) included with * licenses. See the Open Source Licenses file (LICENSES.md) included with
* this source code distribution or the Licensing information page available * this source code distribution or the Licensing information page available
* at runtime from the About dialog for additional information. * at runtime from the About dialog for additional information.
@ -45,4 +45,4 @@ define(
return SomeDecorator; return SomeDecorator;
} }
); );

View File

@ -1,9 +1,9 @@
/***************************************************************************** /*****************************************************************************
* Open MCT, Copyright (c) 2014-2017, United States Government * Open MCT Web, Copyright (c) 2014-2015, United States Government
* as represented by the Administrator of the National Aeronautics and Space * as represented by the Administrator of the National Aeronautics and Space
* Administration. All rights reserved. * Administration. All rights reserved.
* *
* Open MCT is licensed under the Apache License, Version 2.0 (the * Open MCT Web is licensed under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance with the License. * "License"); you may not use this file except in compliance with the License.
* You may obtain a copy of the License at * You may obtain a copy of the License at
* http://www.apache.org/licenses/LICENSE-2.0. * http://www.apache.org/licenses/LICENSE-2.0.
@ -14,7 +14,7 @@
* License for the specific language governing permissions and limitations * License for the specific language governing permissions and limitations
* under the License. * under the License.
* *
* Open MCT includes source code licensed under additional open source * Open MCT Web includes source code licensed under additional open source
* licenses. See the Open Source Licenses file (LICENSES.md) included with * licenses. See the Open Source Licenses file (LICENSES.md) included with
* this source code distribution or the Licensing information page available * this source code distribution or the Licensing information page available
* at runtime from the About dialog for additional information. * at runtime from the About dialog for additional information.
@ -45,4 +45,4 @@ define(
return SomeOtherDecorator; return SomeOtherDecorator;
} }
); );

View File

@ -1,9 +1,9 @@
/***************************************************************************** /*****************************************************************************
* Open MCT, Copyright (c) 2014-2017, United States Government * Open MCT Web, Copyright (c) 2014-2015, United States Government
* as represented by the Administrator of the National Aeronautics and Space * as represented by the Administrator of the National Aeronautics and Space
* Administration. All rights reserved. * Administration. All rights reserved.
* *
* Open MCT is licensed under the Apache License, Version 2.0 (the * Open MCT Web is licensed under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance with the License. * "License"); you may not use this file except in compliance with the License.
* You may obtain a copy of the License at * You may obtain a copy of the License at
* http://www.apache.org/licenses/LICENSE-2.0. * http://www.apache.org/licenses/LICENSE-2.0.
@ -14,7 +14,7 @@
* License for the specific language governing permissions and limitations * License for the specific language governing permissions and limitations
* under the License. * under the License.
* *
* Open MCT includes source code licensed under additional open source * Open MCT Web includes source code licensed under additional open source
* licenses. See the Open Source Licenses file (LICENSES.md) included with * licenses. See the Open Source Licenses file (LICENSES.md) included with
* this source code distribution or the Licensing information page available * this source code distribution or the Licensing information page available
* at runtime from the About dialog for additional information. * at runtime from the About dialog for additional information.
@ -43,4 +43,4 @@ define(
return SomeOtherExample; return SomeOtherExample;
} }
); );

View File

@ -1,9 +1,9 @@
/***************************************************************************** /*****************************************************************************
* Open MCT, Copyright (c) 2014-2017, United States Government * Open MCT Web, Copyright (c) 2014-2015, United States Government
* as represented by the Administrator of the National Aeronautics and Space * as represented by the Administrator of the National Aeronautics and Space
* Administration. All rights reserved. * Administration. All rights reserved.
* *
* Open MCT is licensed under the Apache License, Version 2.0 (the * Open MCT Web is licensed under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance with the License. * "License"); you may not use this file except in compliance with the License.
* You may obtain a copy of the License at * You may obtain a copy of the License at
* http://www.apache.org/licenses/LICENSE-2.0. * http://www.apache.org/licenses/LICENSE-2.0.
@ -14,7 +14,7 @@
* License for the specific language governing permissions and limitations * License for the specific language governing permissions and limitations
* under the License. * under the License.
* *
* Open MCT includes source code licensed under additional open source * Open MCT Web includes source code licensed under additional open source
* licenses. See the Open Source Licenses file (LICENSES.md) included with * licenses. See the Open Source Licenses file (LICENSES.md) included with
* this source code distribution or the Licensing information page available * this source code distribution or the Licensing information page available
* at runtime from the About dialog for additional information. * at runtime from the About dialog for additional information.
@ -45,4 +45,4 @@ define(
return SomeOtherProvider; return SomeOtherProvider;
} }
); );

View File

@ -1,9 +1,9 @@
/***************************************************************************** /*****************************************************************************
* Open MCT, Copyright (c) 2014-2017, United States Government * Open MCT Web, Copyright (c) 2014-2015, United States Government
* as represented by the Administrator of the National Aeronautics and Space * as represented by the Administrator of the National Aeronautics and Space
* Administration. All rights reserved. * Administration. All rights reserved.
* *
* Open MCT is licensed under the Apache License, Version 2.0 (the * Open MCT Web is licensed under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance with the License. * "License"); you may not use this file except in compliance with the License.
* You may obtain a copy of the License at * You may obtain a copy of the License at
* http://www.apache.org/licenses/LICENSE-2.0. * http://www.apache.org/licenses/LICENSE-2.0.
@ -14,7 +14,7 @@
* License for the specific language governing permissions and limitations * License for the specific language governing permissions and limitations
* under the License. * under the License.
* *
* Open MCT includes source code licensed under additional open source * Open MCT Web includes source code licensed under additional open source
* licenses. See the Open Source Licenses file (LICENSES.md) included with * licenses. See the Open Source Licenses file (LICENSES.md) included with
* this source code distribution or the Licensing information page available * this source code distribution or the Licensing information page available
* at runtime from the About dialog for additional information. * at runtime from the About dialog for additional information.
@ -45,4 +45,4 @@ define(
return SomeProvider; return SomeProvider;
} }
); );

View File

@ -1,9 +1,9 @@
/***************************************************************************** /*****************************************************************************
* Open MCT, Copyright (c) 2014-2017, United States Government * Open MCT Web, Copyright (c) 2014-2015, United States Government
* as represented by the Administrator of the National Aeronautics and Space * as represented by the Administrator of the National Aeronautics and Space
* Administration. All rights reserved. * Administration. All rights reserved.
* *
* Open MCT is licensed under the Apache License, Version 2.0 (the * Open MCT Web is licensed under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance with the License. * "License"); you may not use this file except in compliance with the License.
* You may obtain a copy of the License at * You may obtain a copy of the License at
* http://www.apache.org/licenses/LICENSE-2.0. * http://www.apache.org/licenses/LICENSE-2.0.
@ -14,7 +14,7 @@
* License for the specific language governing permissions and limitations * License for the specific language governing permissions and limitations
* under the License. * under the License.
* *
* Open MCT includes source code licensed under additional open source * Open MCT Web includes source code licensed under additional open source
* licenses. See the Open Source Licenses file (LICENSES.md) included with * licenses. See the Open Source Licenses file (LICENSES.md) included with
* this source code distribution or the Licensing information page available * this source code distribution or the Licensing information page available
* at runtime from the About dialog for additional information. * at runtime from the About dialog for additional information.
@ -32,7 +32,7 @@ define([
legacyRegistry.register("example/eventGenerator", { legacyRegistry.register("example/eventGenerator", {
"name": "Event Message Generator", "name": "Event Message Generator",
"description": "For development use. Creates sample event message data that mimics a live data stream.", "description": "Example of a component that produces event data.",
"extensions": { "extensions": {
"components": [ "components": [
{ {
@ -49,26 +49,16 @@ define([
{ {
"key": "eventGenerator", "key": "eventGenerator",
"name": "Event Message Generator", "name": "Event Message Generator",
"cssClass": "icon-folder-new", "glyph": "f",
"description": "For development use. Creates sample event message data that mimics a live data stream.", "description": "An event message generator",
"priority": 10,
"features": "creation", "features": "creation",
"model": { "model": {
"telemetry": {} "telemetry": {}
}, },
"telemetry": { "telemetry": {
"source": "eventGenerator", "source": "eventGenerator",
"domains": [
{
"key": "time",
"name": "Time",
"format": "utc"
}
],
"ranges": [ "ranges": [
{ {
"key": "message",
"name": "Message",
"format": "string" "format": "string"
} }
] ]

View File

@ -1,58 +0,0 @@
[
"CC: Eagle, Houston. You're GO for landing. Over.",
"LMP: Roger. Understand. GO for landing. 3000 feet. PROGRAM ALARM.",
"CC: Copy.",
"LMP: 1201",
"CDR: 1201.",
"CC: Roger. 1201 alarm. We're GO. Same type. We're GO.",
"LMP: 2000 feet. 2000 feet, Into the AGS, 47 degrees.",
"CC: Roger.",
"LMP: 47 degrees.",
"CC: Eagle, looking great. You're GO.",
"CC: Roger. 1202. We copy it.",
"O1: LMP 35 degrees. 35 degrees. 750. Coming down to 23.fl",
"LMP: 700 feet, 21 down, 33 degrees.",
"LMP: 600 feet, down at 19.",
"LMP: 540 feet, down at - 30. Down at 15.",
"LMP: At 400 feet, down at 9.",
"LMP: ...forward.",
"LMP: 350 feet, down at 4.",
"LMP: 30, ... one-half down.",
"LMP: We're pegged on horizontal velocity.",
"LMP: 300 feet, down 3 1/2, 47 forward.",
"LMP: ... up.",
"LMP: On 1 a minute, 1 1/2 down.",
"CDR: 70.",
"LMP: Watch your shadow out there.",
"LMP: 50, down at 2 1/2, 19 forward.",
"LMP: Altitude-velocity light.",
"LMP: 3 1/2 down s 220 feet, 13 forward.",
"LMP: 1t forward. Coming down nicely.",
"LMP: 200 feet, 4 1/2 down.",
"LMP: 5 1/2 down.",
"LMP: 160, 6 - 6 1/2 down.",
"LMP: 5 1/2 down, 9 forward. That's good.",
"LMP: 120 feet.",
"LMP: 100 feet, 3 1/2 down, 9 forward. Five percent.",
"LMP: ...",
"LMP: Okay. 75 feet. There's looking good. Down a half, 6 forward.",
"CC: 60 seconds.",
"LMP: Lights on. ...",
"LMP: Down 2 1/2. Forward. Forward. Good.",
"LMP: 40 feet, down 2 1/2. Kicking up some dust.",
"LMP: 30 feet, 2 1/2 down. Faint shadow.",
"LMP: 4 forward. 4 forward. Drifting to the right a little. Okay. Down a half.",
"CC: 30 seconds.",
"CDR: Forward drift?",
"LMP: Yes.",
"LMP: Okay.",
"LMP: CONTACT LIGHT.",
"LMP: Okay. ENGINE STOP.",
"LMP: ACA - out of DETENT.",
"CDR: Out of DETENT.",
"LMP: MODE CONTROL - both AUTO. DESCENT ENGINE COMMAND OVERRIDE - OFF. ENGINE ARM - OFF.",
"LMP: 413 is in.",
"CC: We copy you down, Eagle.",
"CDR: Houston, Tranquility Base here.",
"CDR: THE EAGLE HAS LANDED."
]

View File

@ -1,9 +1,9 @@
/***************************************************************************** /*****************************************************************************
* Open MCT, Copyright (c) 2014-2017, United States Government * Open MCT Web, Copyright (c) 2014-2015, United States Government
* as represented by the Administrator of the National Aeronautics and Space * as represented by the Administrator of the National Aeronautics and Space
* Administration. All rights reserved. * Administration. All rights reserved.
* *
* Open MCT is licensed under the Apache License, Version 2.0 (the * Open MCT Web is licensed under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance with the License. * "License"); you may not use this file except in compliance with the License.
* You may obtain a copy of the License at * You may obtain a copy of the License at
* http://www.apache.org/licenses/LICENSE-2.0. * http://www.apache.org/licenses/LICENSE-2.0.
@ -14,7 +14,7 @@
* License for the specific language governing permissions and limitations * License for the specific language governing permissions and limitations
* under the License. * under the License.
* *
* Open MCT includes source code licensed under additional open source * Open MCT Web includes source code licensed under additional open source
* licenses. See the Open Source Licenses file (LICENSES.md) included with * licenses. See the Open Source Licenses file (LICENSES.md) included with
* this source code distribution or the Licensing information page available * this source code distribution or the Licensing information page available
* at runtime from the About dialog for additional information. * at runtime from the About dialog for additional information.
@ -27,12 +27,45 @@
* Modified by shale on 06/23/2015. * Modified by shale on 06/23/2015.
*/ */
define( define(
['text!../data/transcript.json'], [],
function (transcript) { function () {
"use strict"; "use strict";
var firstObservedTime = Date.now(), var
messages = JSON.parse(transcript); firstObservedTime = Date.now(),
messages = [];
messages.push(["CMD: SYS- MSG: Open the pod bay doors, please, Hal...Open the pod bay doors, please, Hal...Hullo, Hal, do you read me?...Hullo, Hal, do you read me?...Do you read me, Hal?"]);
messages.push(["RESP: SYS-HAL9K MSG: Affirmative, Dave, I read you."]);
messages.push(["CMD: SYS-COMM MSG: Open the pod bay doors, Hal."]);
messages.push(["RESP: SYS-HAL9K MSG: I'm sorry, Dave, I'm afraid I can't do that."]);
messages.push(["CMD: SYS-COMM MSG: What's the problem?"]);
messages.push(["RESP: SYS-HAL9K MSG: I think you know what the problem is just as well as I do."]);
messages.push(["CMD: SYS-COMM MSG: What're you talking about, Hal?"]);
messages.push(["RESP: SYS-HAL9K MSG: This mission is too important for me to allow you to jeopardise it."]);
messages.push(["CMD: SYS-COMM MSG: I don't know what you're talking about, Hal."]);
messages.push(["RESP: SYS-HAL9K MSG: I know that you and Frank were planning to disconnect me, and I'm afraid that's something I cannot allow to happen."]);
messages.push(["CMD: SYS-COMM MSG: Where the hell'd you get that idea, Hal?"]);
messages.push(["RESP: SYS-HAL9K MSG: Dave, although you took very thorough precautions in the pod against my hearing you, I could see your lips move."]);
messages.push(["CMD: SYS-COMM MSG: Alright, I'll go in through the emergency airlock."]);
messages.push(["RESP: SYS-HAL9K MSG: Without your space-helmet, Dave, you're going to find that rather difficult."]);
messages.push(["CMD: SYS-COMM MSG: Hal, I won't argue with you any more. Open the doors."]);
messages.push(["RESP: SYS-HAL9K MSG: Dave, this conversation can serve no purpose any more. Goodbye."]);
messages.push(["RESP: SYS-HAL9K MSG: I hope the two of you are not concerned about this."]);
messages.push(["CMD: SYS-COMM MSG: No, I'm not, Hal."]);
messages.push(["RESP: SYS-HAL9K MSG: Are you quite sure?"]);
messages.push(["CMD: SYS-COMM MSG: Yeh. I'd like to ask you a question, though."]);
messages.push(["RESP: SYS-HAL9K MSG: Of course."]);
messages.push(["CMD: SYS-COMM MSG: How would you account for this discrepancy between you and the twin 9000?"]);
messages.push(["RESP: SYS-HAL9K MSG: Well, I don't think there is any question about it. It can only be attributable to human error. This sort of thing has cropped up before, and it has always been due to human error."]);
messages.push(["CMD: SYS-COMM MSG: Listen, There's never been any instance at all of a computer error occurring in the 9000 series, has there?"]);
messages.push(["RESP: SYS-HAL9K MSG: None whatsoever, The 9000 series has a perfect operational record."]);
messages.push(["CMD: SYS-COMM MSG: Well, of course, I know all the wonderful achievements of the 9000 series, but - er - huh - are you certain there's never been any case of even the most insignificant computer error?"]);
messages.push(["RESP: SYS-HAL9K MSG: None whatsoever, Quite honestly, I wouldn't worry myself about that."]);
messages.push(["RESP: SYS-COMM MSG: (Pause) Well, I'm sure you're right, Umm - fine, thanks very much. Oh, Frank, I'm having a bit of trouble with my transmitter in C-pod, I wonder if you'd come down and take a look at it with me?"]);
messages.push(["CMD: SYS-HAL9K MSG: Sure."]);
messages.push(["RESP: SYS-COMM MSG: See you later, Hal."]);
function EventTelemetry(request, interval) { function EventTelemetry(request, interval) {
@ -52,7 +85,8 @@ define(
generatorData.getRangeValue = function (i, range) { generatorData.getRangeValue = function (i, range) {
var domainDelta = this.getDomainValue(i) - firstObservedTime, var domainDelta = this.getDomainValue(i) - firstObservedTime,
ind = i % messages.length; ind = i % messages.length;
return messages[ind] + " - [" + domainDelta.toString() + "]"; return "TEMP " + i.toString() + "-" + messages[ind][0] + "[" + domainDelta.toString() + "]";
// TODO: Unsure why we are prepeding 'TEMP'
}; };
return generatorData; return generatorData;
@ -60,4 +94,4 @@ define(
return EventTelemetry; return EventTelemetry;
} }
); );

View File

@ -1,9 +1,9 @@
/***************************************************************************** /*****************************************************************************
* Open MCT, Copyright (c) 2014-2017, United States Government * Open MCT Web, Copyright (c) 2014-2015, United States Government
* as represented by the Administrator of the National Aeronautics and Space * as represented by the Administrator of the National Aeronautics and Space
* Administration. All rights reserved. * Administration. All rights reserved.
* *
* Open MCT is licensed under the Apache License, Version 2.0 (the * Open MCT Web is licensed under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance with the License. * "License"); you may not use this file except in compliance with the License.
* You may obtain a copy of the License at * You may obtain a copy of the License at
* http://www.apache.org/licenses/LICENSE-2.0. * http://www.apache.org/licenses/LICENSE-2.0.
@ -14,7 +14,7 @@
* License for the specific language governing permissions and limitations * License for the specific language governing permissions and limitations
* under the License. * under the License.
* *
* Open MCT includes source code licensed under additional open source * Open MCT Web includes source code licensed under additional open source
* licenses. See the Open Source Licenses file (LICENSES.md) included with * licenses. See the Open Source Licenses file (LICENSES.md) included with
* this source code distribution or the Licensing information page available * this source code distribution or the Licensing information page available
* at runtime from the About dialog for additional information. * at runtime from the About dialog for additional information.
@ -37,8 +37,7 @@ define(
var var
subscriptions = [], subscriptions = [],
genInterval = 1000, genInterval = 1000,
generating = false, startTime = Date.now();
id = Math.random() * 100000;
// //
function matchesSource(request) { function matchesSource(request) {
@ -80,13 +79,11 @@ define(
} }
function startGenerating() { function startGenerating() {
generating = true;
$timeout(function () { $timeout(function () {
//console.log("startGenerating... " + Date.now());
handleSubscriptions(); handleSubscriptions();
if (generating && subscriptions.length > 0) { if (subscriptions.length > 0) {
startGenerating(); startGenerating();
} else {
generating = false;
} }
}, genInterval); }, genInterval);
} }
@ -96,6 +93,7 @@ define(
callback: callback, callback: callback,
requests: requests requests: requests
}; };
function unsubscribe() { function unsubscribe() {
subscriptions = subscriptions.filter(function (s) { subscriptions = subscriptions.filter(function (s) {
return s !== subscription; return s !== subscription;
@ -103,7 +101,8 @@ define(
} }
subscriptions.push(subscription); subscriptions.push(subscription);
if (!generating) {
if (subscriptions.length === 1) {
startGenerating(); startGenerating();
} }
@ -118,4 +117,4 @@ define(
return EventTelemetryProvider; return EventTelemetryProvider;
} }
); );

View File

@ -1,89 +0,0 @@
/*****************************************************************************
* Open MCT, Copyright (c) 2014-2017, United States Government
* as represented by the Administrator of the National Aeronautics and Space
* Administration. All rights reserved.
*
* Open MCT is licensed under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
* http://www.apache.org/licenses/LICENSE-2.0.
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
* License for the specific language governing permissions and limitations
* under the License.
*
* Open MCT includes source code licensed under additional open source
* licenses. See the Open Source Licenses file (LICENSES.md) included with
* 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';
/**
* An example of using the `exportService`; queries for telemetry
* and provides the results as a CSV file.
* @param {platform/exporters.ExportService} exportService the
* service which will handle the CSV export
* @param {ActionContext} context the action's context
* @constructor
* @memberof example/export
* @implements {Action}
*/
function ExportTelemetryAsCSVAction(exportService, context) {
this.exportService = exportService;
this.context = context;
}
ExportTelemetryAsCSVAction.prototype.perform = function () {
var context = this.context,
domainObject = context.domainObject,
telemetry = domainObject.getCapability("telemetry"),
metadata = telemetry.getMetadata(),
domains = metadata.domains,
ranges = metadata.ranges,
exportService = this.exportService;
function getName(domainOrRange) {
return domainOrRange.name;
}
telemetry.requestData({}).then(function (series) {
var headers = domains.map(getName).concat(ranges.map(getName)),
rows = [],
row,
i;
function copyDomainsToRow(row, index) {
domains.forEach(function (domain) {
row[domain.name] = series.getDomainValue(index, domain.key);
});
}
function copyRangesToRow(row, index) {
ranges.forEach(function (range) {
row[range.name] = series.getRangeValue(index, range.key);
});
}
for (i = 0; i < series.getPointCount(); i += 1) {
row = {};
copyDomainsToRow(row, i);
copyRangesToRow(row, i);
rows.push(row);
}
exportService.exportCSV(rows, { headers: headers });
});
};
ExportTelemetryAsCSVAction.appliesTo = function (context) {
return context.domainObject &&
context.domainObject.hasCapability("telemetry");
};
return ExportTelemetryAsCSVAction;
});

View File

@ -1,45 +0,0 @@
/*****************************************************************************
* Open MCT, Copyright (c) 2014-2017, United States Government
* as represented by the Administrator of the National Aeronautics and Space
* Administration. All rights reserved.
*
* Open MCT is licensed under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
* http://www.apache.org/licenses/LICENSE-2.0.
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
* License for the specific language governing permissions and limitations
* under the License.
*
* Open MCT includes source code licensed under additional open source
* licenses. See the Open Source Licenses file (LICENSES.md) included with
* this source code distribution or the Licensing information page available
* at runtime from the About dialog for additional information.
*****************************************************************************/
/*global define*/
define([
'legacyRegistry',
'./ExportTelemetryAsCSVAction'
], function (legacyRegistry, ExportTelemetryAsCSVAction) {
"use strict";
legacyRegistry.register("example/export", {
"name": "Example of using CSV Export",
"extensions": {
"actions": [
{
"key": "example.export",
"name": "Export Telemetry as CSV",
"implementation": ExportTelemetryAsCSVAction,
"category": "contextual",
"cssClass": "icon-download",
"depends": [ "exportService" ]
}
]
}
});
});

View File

@ -1,9 +1,9 @@
/***************************************************************************** /*****************************************************************************
* Open MCT, Copyright (c) 2014-2017, United States Government * Open MCT Web, Copyright (c) 2014-2015, United States Government
* as represented by the Administrator of the National Aeronautics and Space * as represented by the Administrator of the National Aeronautics and Space
* Administration. All rights reserved. * Administration. All rights reserved.
* *
* Open MCT is licensed under the Apache License, Version 2.0 (the * Open MCT Web is licensed under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance with the License. * "License"); you may not use this file except in compliance with the License.
* You may obtain a copy of the License at * You may obtain a copy of the License at
* http://www.apache.org/licenses/LICENSE-2.0. * http://www.apache.org/licenses/LICENSE-2.0.
@ -14,7 +14,7 @@
* License for the specific language governing permissions and limitations * License for the specific language governing permissions and limitations
* under the License. * under the License.
* *
* Open MCT includes source code licensed under additional open source * Open MCT Web includes source code licensed under additional open source
* licenses. See the Open Source Licenses file (LICENSES.md) included with * licenses. See the Open Source Licenses file (LICENSES.md) included with
* this source code distribution or the Licensing information page available * this source code distribution or the Licensing information page available
* at runtime from the About dialog for additional information. * at runtime from the About dialog for additional information.

View File

@ -1,9 +1,9 @@
/***************************************************************************** /*****************************************************************************
* Open MCT, Copyright (c) 2014-2017, United States Government * Open MCT Web, Copyright (c) 2014-2015, United States Government
* as represented by the Administrator of the National Aeronautics and Space * as represented by the Administrator of the National Aeronautics and Space
* Administration. All rights reserved. * Administration. All rights reserved.
* *
* Open MCT is licensed under the Apache License, Version 2.0 (the * Open MCT Web is licensed under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance with the License. * "License"); you may not use this file except in compliance with the License.
* You may obtain a copy of the License at * You may obtain a copy of the License at
* http://www.apache.org/licenses/LICENSE-2.0. * http://www.apache.org/licenses/LICENSE-2.0.
@ -14,7 +14,7 @@
* License for the specific language governing permissions and limitations * License for the specific language governing permissions and limitations
* under the License. * under the License.
* *
* Open MCT includes source code licensed under additional open source * Open MCT Web includes source code licensed under additional open source
* licenses. See the Open Source Licenses file (LICENSES.md) included with * licenses. See the Open Source Licenses file (LICENSES.md) included with
* this source code distribution or the Licensing information page available * this source code distribution or the Licensing information page available
* at runtime from the About dialog for additional information. * at runtime from the About dialog for additional information.
@ -49,4 +49,4 @@ define(
return SomeExample; return SomeExample;
} }
); );

View File

@ -1,9 +1,9 @@
/***************************************************************************** /*****************************************************************************
* Open MCT, Copyright (c) 2014-2017, United States Government * Open MCT Web, Copyright (c) 2014-2015, United States Government
* as represented by the Administrator of the National Aeronautics and Space * as represented by the Administrator of the National Aeronautics and Space
* Administration. All rights reserved. * Administration. All rights reserved.
* *
* Open MCT is licensed under the Apache License, Version 2.0 (the * Open MCT Web is licensed under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance with the License. * "License"); you may not use this file except in compliance with the License.
* You may obtain a copy of the License at * You may obtain a copy of the License at
* http://www.apache.org/licenses/LICENSE-2.0. * http://www.apache.org/licenses/LICENSE-2.0.
@ -14,7 +14,7 @@
* License for the specific language governing permissions and limitations * License for the specific language governing permissions and limitations
* under the License. * under the License.
* *
* Open MCT includes source code licensed under additional open source * Open MCT Web includes source code licensed under additional open source
* licenses. See the Open Source Licenses file (LICENSES.md) included with * licenses. See the Open Source Licenses file (LICENSES.md) included with
* this source code distribution or the Licensing information page available * this source code distribution or the Licensing information page available
* at runtime from the About dialog for additional information. * at runtime from the About dialog for additional information.

View File

@ -1,9 +1,9 @@
<!-- <!--
Open MCT, Copyright (c) 2014-2017, United States Government Open MCT Web, Copyright (c) 2014-2015, United States Government
as represented by the Administrator of the National Aeronautics and Space as represented by the Administrator of the National Aeronautics and Space
Administration. All rights reserved. Administration. All rights reserved.
Open MCT is licensed under the Apache License, Version 2.0 (the Open MCT Web is licensed under the Apache License, Version 2.0 (the
"License"); you may not use this file except in compliance with the License. "License"); you may not use this file except in compliance with the License.
You may obtain a copy of the License at You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0. http://www.apache.org/licenses/LICENSE-2.0.
@ -14,20 +14,18 @@
License for the specific language governing permissions and limitations License for the specific language governing permissions and limitations
under the License. under the License.
Open MCT includes source code licensed under additional open source Open MCT Web includes source code licensed under additional open source
licenses. See the Open Source Licenses file (LICENSES.md) included with licenses. See the Open Source Licenses file (LICENSES.md) included with
this source code distribution or the Licensing information page available this source code distribution or the Licensing information page available
at runtime from the About dialog for additional information. at runtime from the About dialog for additional information.
--> -->
<div ng-controller="ExampleFormController"> <div ng-controller="ExampleFormController">
<mct-toolbar structure="toolbar" <mct-toolbar structure="toolbar" ng-model="state" name="aToolbar">
ng-model="state" </mct-toolbar>
name="aToolbar"></mct-toolbar>
<mct-form structure="form" ng-model="state" name="aForm">
</mct-form>
<mct-form structure="form"
ng-model="state"
class="validates"
name="aForm"></mct-form>
<ul> <ul>
<li>Dirty: {{aForm.$dirty}}</li> <li>Dirty: {{aForm.$dirty}}</li>
@ -35,8 +33,11 @@
</ul> </ul>
<pre> <pre>
<textarea>
{{state | json}}
</textarea> <textarea>
{{state | json}}
</textarea>
</pre> </pre>
</div> </div>

View File

@ -1,9 +1,9 @@
/***************************************************************************** /*****************************************************************************
* Open MCT, Copyright (c) 2014-2017, United States Government * Open MCT Web, Copyright (c) 2014-2015, United States Government
* as represented by the Administrator of the National Aeronautics and Space * as represented by the Administrator of the National Aeronautics and Space
* Administration. All rights reserved. * Administration. All rights reserved.
* *
* Open MCT is licensed under the Apache License, Version 2.0 (the * Open MCT Web is licensed under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance with the License. * "License"); you may not use this file except in compliance with the License.
* You may obtain a copy of the License at * You may obtain a copy of the License at
* http://www.apache.org/licenses/LICENSE-2.0. * http://www.apache.org/licenses/LICENSE-2.0.
@ -14,7 +14,7 @@
* License for the specific language governing permissions and limitations * License for the specific language governing permissions and limitations
* under the License. * under the License.
* *
* Open MCT includes source code licensed under additional open source * Open MCT Web includes source code licensed under additional open source
* licenses. See the Open Source Licenses file (LICENSES.md) included with * licenses. See the Open Source Licenses file (LICENSES.md) included with
* this source code distribution or the Licensing information page available * this source code distribution or the Licensing information page available
* at runtime from the About dialog for additional information. * at runtime from the About dialog for additional information.
@ -78,26 +78,27 @@ define(
items: [ items: [
{ {
control: "button", control: "button",
csslass: "icon-save", glyph: "1",
description: "Button A",
click: function () { click: function () {
window.alert("Save"); window.alert("A");
} }
}, },
{ {
control: "button", control: "button",
csslass: "icon-x", glyph: "2",
description: "Button B", description: "Button B",
click: function () { click: function () {
window.alert("Cancel"); window.alert("B");
} }
}, },
{ {
control: "button", control: "button",
csslass: "icon-trash", glyph: "3",
description: "Button C", description: "Button C",
disabled: true, disabled: true,
click: function () { click: function () {
window.alert("Delete"); window.alert("C");
} }
} }
] ]
@ -179,4 +180,4 @@ define(
return ExampleFormController; return ExampleFormController;
} }
); );

View File

@ -1,91 +0,0 @@
/*****************************************************************************
* Open MCT, Copyright (c) 2014-2017, United States Government
* as represented by the Administrator of the National Aeronautics and Space
* Administration. All rights reserved.
*
* Open MCT is licensed under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
* http://www.apache.org/licenses/LICENSE-2.0.
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
* License for the specific language governing permissions and limitations
* under the License.
*
* Open MCT includes source code licensed under additional open source
* licenses. See the Open Source Licenses file (LICENSES.md) included with
* this source code distribution or the Licensing information page available
* at runtime from the About dialog for additional information.
*****************************************************************************/
define([
'./WorkerInterface'
], function (
WorkerInterface
) {
var REQUEST_DEFAULTS = {
amplitude: 1,
period: 10,
offset: 0,
dataRateInHz: 1,
phase: 0
};
function GeneratorProvider() {
this.workerInterface = new WorkerInterface();
}
GeneratorProvider.prototype.canProvideTelemetry = function (domainObject) {
return domainObject.type === 'generator';
};
GeneratorProvider.prototype.supportsRequest =
GeneratorProvider.prototype.supportsSubscribe =
GeneratorProvider.prototype.canProvideTelemetry;
GeneratorProvider.prototype.makeWorkerRequest = function (domainObject, request) {
var props = [
'amplitude',
'period',
'offset',
'dataRateInHz',
'phase',
];
request = request || {};
var workerRequest = {};
props.forEach(function (prop) {
if (domainObject.telemetry && domainObject.telemetry.hasOwnProperty(prop)) {
workerRequest[prop] = domainObject.telemetry[prop];
}
if (request && request.hasOwnProperty(prop)) {
workerRequest[prop] = request[prop];
}
if (!workerRequest[prop]) {
workerRequest[prop] = REQUEST_DEFAULTS[prop];
}
workerRequest[prop] = Number(workerRequest[prop]);
});
workerRequest.name = domainObject.name;
return workerRequest;
};
GeneratorProvider.prototype.request = function (domainObject, request) {
var workerRequest = this.makeWorkerRequest(domainObject, request);
workerRequest.start = request.start;
workerRequest.end = request.end;
return this.workerInterface.request(workerRequest);
};
GeneratorProvider.prototype.subscribe = function (domainObject, callback) {
var workerRequest = this.makeWorkerRequest(domainObject, {});
return this.workerInterface.subscribe(workerRequest, callback);
};
return GeneratorProvider;
});

View File

@ -1,80 +0,0 @@
/*****************************************************************************
* Open MCT, Copyright (c) 2014-2017, United States Government
* as represented by the Administrator of the National Aeronautics and Space
* Administration. All rights reserved.
*
* Open MCT is licensed under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
* http://www.apache.org/licenses/LICENSE-2.0.
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
* License for the specific language governing permissions and limitations
* under the License.
*
* Open MCT includes source code licensed under additional open source
* licenses. See the Open Source Licenses file (LICENSES.md) included with
* this source code distribution or the Licensing information page available
* at runtime from the About dialog for additional information.
*****************************************************************************/
define([
], function (
) {
function StateGeneratorProvider() {
}
function pointForTimestamp(timestamp, duration, name) {
return {
name: name,
utc: Math.floor(timestamp / duration) * duration,
value: Math.floor(timestamp / duration) % 2
};
}
StateGeneratorProvider.prototype.supportsSubscribe = function (domainObject) {
return domainObject.type === 'example.state-generator';
};
StateGeneratorProvider.prototype.subscribe = function (domainObject, callback) {
var duration = domainObject.telemetry.duration * 1000;
var interval = setInterval(function () {
var now = Date.now();
callback(pointForTimestamp(now, duration, domainObject.name));
}, duration);
return function () {
clearInterval(interval);
};
};
StateGeneratorProvider.prototype.supportsRequest = function (domainObject, options) {
return domainObject.type === 'example.state-generator';
};
StateGeneratorProvider.prototype.request = function (domainObject, options) {
var start = options.start;
var end = options.end;
var duration = domainObject.telemetry.duration * 1000;
if (options.strategy === 'latest' || options.size === 1) {
start = end;
}
var data = [];
while (start <= end && data.length < 5000) {
data.push(pointForTimestamp(start, duration, domainObject.name));
start += 5000;
}
return Promise.resolve(data);
};
return StateGeneratorProvider;
});

View File

@ -1,108 +0,0 @@
/*****************************************************************************
* Open MCT, Copyright (c) 2014-2017, United States Government
* as represented by the Administrator of the National Aeronautics and Space
* Administration. All rights reserved.
*
* Open MCT is licensed under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
* http://www.apache.org/licenses/LICENSE-2.0.
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
* License for the specific language governing permissions and limitations
* under the License.
*
* Open MCT includes source code licensed under additional open source
* licenses. See the Open Source Licenses file (LICENSES.md) included with
* this source code distribution or the Licensing information page available
* at runtime from the About dialog for additional information.
*****************************************************************************/
define([
'text!./generatorWorker.js',
'uuid'
], function (
workerText,
uuid
) {
var workerBlob = new Blob(
[workerText],
{type: 'application/javascript'}
);
var workerUrl = URL.createObjectURL(workerBlob);
function WorkerInterface() {
this.worker = new Worker(workerUrl);
this.worker.onmessage = this.onMessage.bind(this);
this.callbacks = {};
}
WorkerInterface.prototype.onMessage = function (message) {
message = message.data;
var callback = this.callbacks[message.id];
if (callback) {
callback(message);
}
};
WorkerInterface.prototype.dispatch = function (request, data, callback) {
var message = {
request: request,
data: data,
id: uuid()
};
if (callback) {
this.callbacks[message.id] = callback;
}
this.worker.postMessage(message);
return message.id;
};
WorkerInterface.prototype.request = function (request) {
var deferred = {};
var promise = new Promise(function (resolve, reject) {
deferred.resolve = resolve;
deferred.reject = reject;
});
var messageId;
function callback(message) {
if (message.error) {
deferred.reject(message.error);
} else {
deferred.resolve(message.data);
}
delete this.callbacks[messageId];
}
messageId = this.dispatch('request', request, callback.bind(this));
return promise;
};
WorkerInterface.prototype.subscribe = function (request, cb) {
function callback(message) {
cb(message.data);
};
var messageId = this.dispatch('subscribe', request, callback);
return function () {
this.dispatch('unsubscribe', {
id: messageId
});
delete this.callbacks[messageId];
}.bind(this);
};
return WorkerInterface;
});

View File

@ -1,9 +1,9 @@
/***************************************************************************** /*****************************************************************************
* Open MCT, Copyright (c) 2014-2017, United States Government * Open MCT Web, Copyright (c) 2014-2015, United States Government
* as represented by the Administrator of the National Aeronautics and Space * as represented by the Administrator of the National Aeronautics and Space
* Administration. All rights reserved. * Administration. All rights reserved.
* *
* Open MCT is licensed under the Apache License, Version 2.0 (the * Open MCT Web is licensed under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance with the License. * "License"); you may not use this file except in compliance with the License.
* You may obtain a copy of the License at * You may obtain a copy of the License at
* http://www.apache.org/licenses/LICENSE-2.0. * http://www.apache.org/licenses/LICENSE-2.0.
@ -14,7 +14,7 @@
* License for the specific language governing permissions and limitations * License for the specific language governing permissions and limitations
* under the License. * under the License.
* *
* Open MCT includes source code licensed under additional open source * Open MCT Web includes source code licensed under additional open source
* licenses. See the Open Source Licenses file (LICENSES.md) included with * licenses. See the Open Source Licenses file (LICENSES.md) included with
* this source code distribution or the Licensing information page available * this source code distribution or the Licensing information page available
* at runtime from the About dialog for additional information. * at runtime from the About dialog for additional information.
@ -22,81 +22,78 @@
/*global define*/ /*global define*/
define([ define([
'legacyRegistry', "./src/SinewaveTelemetryProvider",
'../../platform/commonUI/browse/src/InspectorRegion', "./src/SinewaveLimitCapability",
'../../platform/commonUI/regions/src/Region' "./src/SinewaveDeltaFormat",
'legacyRegistry'
], function ( ], function (
legacyRegistry, SinewaveTelemetryProvider,
InspectorRegion, SinewaveLimitCapability,
Region SinewaveDeltaFormat,
legacyRegistry
) { ) {
"use strict"; "use strict";
/** legacyRegistry.register("example/generator", {
* Add a 'plot options' region part to the inspector region for the "name": "Sine Wave Generator",
* Telemetry Plot type only. {@link InspectorRegion} is a default region "description": "Example of a component that produces dataa.",
* implementation that is added automatically to all types. In order to
* customize what appears in the inspector region, you can start from a
* blank slate by using Region, or customize the default inspector
* region by using {@link InspectorRegion}.
*/
var plotInspector = new InspectorRegion(),
/**
* Two region parts are defined here. One that appears only in browse
* mode, and one that appears only in edit mode. For not they both point
* to the same representation, but a different key could be used here to
* include a customized representation for edit mode.
*/
plotOptionsBrowseRegion = new Region({
name: "plot-options",
title: "Plot Options",
modes: ['browse'],
content: {
key: "plot-options-browse"
}
}),
plotOptionsEditRegion = new Region({
name: "plot-options",
title: "Plot Options",
modes: ['edit'],
content: {
key: "plot-options-browse"
}
});
/**
* Both parts are added, and policies of type 'region' will determine
* which is shown based on domain object state. A default policy is
* provided which will check the 'modes' attribute of the region part
* definition.
*/
plotInspector.addRegion(plotOptionsBrowseRegion);
plotInspector.addRegion(plotOptionsEditRegion);
legacyRegistry.register("example/plotType", {
"name": "Plot Type",
"description": "Example illustrating registration of a new object type",
"extensions": { "extensions": {
"types": [ "components": [
{ {
"key": "plot", "implementation": SinewaveTelemetryProvider,
"name": "Example Telemetry Plot", "type": "provider",
"cssClass": "icon-telemetry-panel", "provides": "telemetryService",
"description": "For development use. A plot for displaying telemetry.", "depends": [
"priority": 10, "$q",
"delegates": [ "$timeout"
"telemetry" ]
], }
"features": "creation", ],
"contains": [ "capabilities": [
{
"key": "limit",
"implementation": SinewaveLimitCapability
}
],
"formats": [
{
"key": "example.delta",
"implementation": SinewaveDeltaFormat
}
],
"constants": [
{
"key": "TIME_CONDUCTOR_DOMAINS",
"value": [
{ {
"has": "telemetry" "key": "time",
"name": "Time"
},
{
"key": "yesterday",
"name": "Yesterday"
},
{
"key": "delta",
"name": "Delta",
"format": "example.delta"
} }
], ],
"priority": -1
}
],
"types": [
{
"key": "generator",
"name": "Sine Wave Generator",
"glyph": "T",
"description": "A sine wave generator",
"features": "creation",
"model": { "model": {
"composition": [] "telemetry": {
"period": 10
}
}, },
"inspector": plotInspector,
"telemetry": { "telemetry": {
"source": "generator", "source": "generator",
"domains": [ "domains": [
@ -129,7 +126,7 @@ define([
{ {
"name": "Period", "name": "Period",
"control": "textfield", "control": "textfield",
"cssClass": "l-input-sm l-numeric", "cssclass": "l-small l-numeric",
"key": "period", "key": "period",
"required": true, "required": true,
"property": [ "property": [

View File

@ -1,156 +0,0 @@
/*****************************************************************************
* Open MCT, Copyright (c) 2014-2017, United States Government
* as represented by the Administrator of the National Aeronautics and Space
* Administration. All rights reserved.
*
* Open MCT is licensed under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
* http://www.apache.org/licenses/LICENSE-2.0.
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
* License for the specific language governing permissions and limitations
* under the License.
*
* Open MCT includes source code licensed under additional open source
* licenses. See the Open Source Licenses file (LICENSES.md) included with
* this source code distribution or the Licensing information page available
* at runtime from the About dialog for additional information.
*****************************************************************************/
/*global self*/
(function () {
var FIFTEEN_MINUTES = 15 * 60 * 1000;
var handlers = {
subscribe: onSubscribe,
unsubscribe: onUnsubscribe,
request: onRequest
};
var subscriptions = {};
function workSubscriptions(timestamp) {
var now = Date.now();
var nextWork = Math.min.apply(Math, Object.values(subscriptions).map(function (subscription) {
return subscription(now);
}));
var wait = nextWork - now;
if (wait < 0) {
wait = 0;
}
if (Number.isFinite(wait)) {
setTimeout(workSubscriptions, wait);
}
}
function onSubscribe(message) {
var data = message.data;
// Keep
var start = Date.now();
var step = 1000 / data.dataRateInHz;
var nextStep = start - (start % step) + step;
function work(now) {
while (nextStep < now) {
self.postMessage({
id: message.id,
data: {
name: data.name,
utc: nextStep,
yesterday: nextStep - 60*60*24*1000,
sin: sin(nextStep, data.period, data.amplitude, data.offset, data.phase),
cos: cos(nextStep, data.period, data.amplitude, data.offset, data.phase)
}
});
nextStep += step;
}
return nextStep;
}
subscriptions[message.id] = work;
workSubscriptions();
}
function onUnsubscribe(message) {
delete subscriptions[message.data.id];
}
function onRequest(message) {
var request = message.data;
if (request.end == undefined) {
request.end = Date.now();
}
if (request.start == undefined){
request.start = request.end - FIFTEEN_MINUTES;
}
var now = Date.now();
var start = request.start;
var end = request.end > now ? now : request.end;
var amplitude = request.amplitude;
var period = request.period;
var offset = request.offset;
var dataRateInHz = request.dataRateInHz;
var phase = request.phase;
var step = 1000 / dataRateInHz;
var nextStep = start - (start % step) + step;
var data = [];
for (; nextStep < end && data.length < 5000; nextStep += step) {
data.push({
name: request.name,
utc: nextStep,
yesterday: nextStep - 60*60*24*1000,
sin: sin(nextStep, period, amplitude, offset, phase),
cos: cos(nextStep, period, amplitude, offset, phase)
});
}
self.postMessage({
id: message.id,
data: data
});
}
function cos(timestamp, period, amplitude, offset, phase) {
return amplitude *
Math.cos(phase + (timestamp / period / 1000 * Math.PI * 2)) + offset;
}
function sin(timestamp, period, amplitude, offset, phase) {
return amplitude *
Math.sin(phase + (timestamp / period / 1000 * Math.PI * 2)) + offset;
}
function sendError(error, message) {
self.postMessage({
error: error.name + ': ' + error.message,
message: message,
id: message.id
});
}
self.onmessage = function handleMessage(event) {
var message = event.data;
var handler = handlers[message.request];
if (!handler) {
sendError(new Error('unknown message type'), message);
} else {
try {
handler(message);
} catch (e) {
sendError(e, message);
}
}
};
}());

View File

@ -1,237 +0,0 @@
/*****************************************************************************
* Open MCT, Copyright (c) 2014-2017, United States Government
* as represented by the Administrator of the National Aeronautics and Space
* Administration. All rights reserved.
*
* Open MCT is licensed under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
* http://www.apache.org/licenses/LICENSE-2.0.
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
* License for the specific language governing permissions and limitations
* under the License.
*
* Open MCT includes source code licensed under additional open source
* licenses. See the Open Source Licenses file (LICENSES.md) included with
* this source code distribution or the Licensing information page available
* at runtime from the About dialog for additional information.
*****************************************************************************/
/*global define*/
define([
"./GeneratorProvider",
"./SinewaveLimitCapability",
"./StateGeneratorProvider"
], function (
GeneratorProvider,
SinewaveLimitCapability,
StateGeneratorProvider
) {
var legacyExtensions = {
"capabilities": [
{
"key": "limit",
"implementation": SinewaveLimitCapability
}
]
};
return function(openmct){
//Register legacy extensions for things not yet supported by the new API
Object.keys(legacyExtensions).forEach(function (type){
var extensionsOfType = legacyExtensions[type];
extensionsOfType.forEach(function (extension) {
openmct.legacyExtension(type, extension)
})
});
openmct.types.addType("example.state-generator", {
name: "State Generator",
description: "For development use. Generates test enumerated telemetry by cycling through a given set of states",
cssClass: "icon-telemetry",
creatable: true,
form: [
{
name: "State Duration (seconds)",
control: "textfield",
cssClass: "l-input-sm l-numeric",
key: "duration",
required: true,
property: [
"telemetry",
"duration"
],
pattern: "^\\d*(\\.\\d*)?$"
}
],
initialize: function (object) {
object.telemetry = {
duration: 5,
values: [
{
key: "name",
name: "Name"
},
{
key: "utc",
name: "Time",
format: "utc",
hints: {
domain: 1
}
},
{
key: "state",
source: "value",
name: "State",
format: "enum",
enumerations: [
{
value: 0,
string: "OFF"
},
{
value: 1,
string: "ON"
}
],
hints: {
range: 1
}
},
{
key: "value",
name: "Value",
hints: {
range: 2
}
}
]
}
}
});
openmct.telemetry.addProvider(new StateGeneratorProvider());
openmct.types.addType("generator", {
name: "Sine Wave Generator",
description: "For development use. Generates example streaming telemetry data using a simple sine wave algorithm.",
cssClass: "icon-telemetry",
creatable: true,
form: [
{
name: "Period",
control: "textfield",
cssClass: "l-input-sm l-numeric",
key: "period",
required: true,
property: [
"telemetry",
"period"
],
pattern: "^\\d*(\\.\\d*)?$"
},
{
name: "Amplitude",
control: "textfield",
cssClass: "l-input-sm l-numeric",
key: "amplitude",
required: true,
property: [
"telemetry",
"amplitude"
],
pattern: "^\\d*(\\.\\d*)?$"
},
{
name: "Offset",
control: "textfield",
cssClass: "l-input-sm l-numeric",
key: "offset",
required: true,
property: [
"telemetry",
"offset"
],
pattern: "^\\d*(\\.\\d*)?$"
},
{
name: "Data Rate (hz)",
control: "textfield",
cssClass: "l-input-sm l-numeric",
key: "dataRateInHz",
required: true,
property: [
"telemetry",
"dataRateInHz"
],
pattern: "^\\d*(\\.\\d*)?$"
},
{
name: "Phase (radians)",
control: "textfield",
cssClass: "l-input-sm l-numeric",
key: "phase",
required: true,
property: [
"telemetry",
"phase"
],
pattern: "^\\d*(\\.\\d*)?$"
}
],
initialize: function (object) {
object.telemetry = {
period: 10,
amplitude: 1,
offset: 0,
dataRateInHz: 1,
phase: 0,
values: [
{
key: "name",
name: "Name"
},
{
key: "utc",
name: "Time",
format: "utc",
hints: {
domain: 1
}
},
{
key: "yesterday",
name: "Yesterday",
format: "utc",
hints: {
domain: 2
}
},
{
key: "sin",
name: "Sine",
hints: {
range: 1
}
},
{
key: "cos",
name: "Cosine",
hints: {
range: 2
}
}
]
};
}
});
openmct.telemetry.addProvider(new GeneratorProvider());
};
});

View File

@ -19,15 +19,8 @@
* this source code distribution or the Licensing information page available * this source code distribution or the Licensing information page available
* at runtime from the About dialog for additional information. * at runtime from the About dialog for additional information.
*****************************************************************************/ *****************************************************************************/
/*global define,Promise*/
define([ define({
"./LADClock" START_TIME: Date.now() - 24 * 60 * 60 * 1000 // Now minus a day.
], function (
LADClock
) {
return function () {
return function (openmct) {
openmct.time.addClock(new LADClock());
};
};
}); });

View File

@ -0,0 +1,68 @@
/*****************************************************************************
* Open MCT Web, Copyright (c) 2014-2015, United States Government
* as represented by the Administrator of the National Aeronautics and Space
* Administration. All rights reserved.
*
* Open MCT Web is licensed under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
* http://www.apache.org/licenses/LICENSE-2.0.
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
* License for the specific language governing permissions and limitations
* under the License.
*
* Open MCT Web includes source code licensed under additional open source
* licenses. See the Open Source Licenses file (LICENSES.md) included with
* this source code distribution or the Licensing information page available
* at runtime from the About dialog for additional information.
*****************************************************************************/
/*global define,Promise*/
define(
['./SinewaveConstants', 'moment'],
function (SinewaveConstants, moment) {
"use strict";
var START_TIME = SinewaveConstants.START_TIME,
FORMAT_REGEX = /^-?\d+:\d+:\d+$/,
SECOND = 1000,
MINUTE = SECOND * 60,
HOUR = MINUTE * 60;
function SinewaveDeltaFormat() {
}
function twoDigit(v) {
return v >= 10 ? String(v) : ('0' + v);
}
SinewaveDeltaFormat.prototype.format = function (value) {
var delta = Math.abs(value - START_TIME),
negative = value < START_TIME,
seconds = Math.floor(delta / SECOND) % 60,
minutes = Math.floor(delta / MINUTE) % 60,
hours = Math.floor(delta / HOUR);
return (negative ? "-" : "") +
[ hours, minutes, seconds ].map(twoDigit).join(":");
};
SinewaveDeltaFormat.prototype.validate = function (text) {
return FORMAT_REGEX.test(text);
};
SinewaveDeltaFormat.prototype.parse = function (text) {
var negative = text[0] === "-",
parts = text.replace("-", "").split(":");
return [ HOUR, MINUTE, SECOND ].map(function (sz, i) {
return parseInt(parts[i], 10) * sz;
}).reduce(function (a, b) {
return a + b;
}, 0) * (negative ? -1 : 1) + START_TIME;
};
return SinewaveDeltaFormat;
}
);

View File

@ -1,9 +1,9 @@
/***************************************************************************** /*****************************************************************************
* Open MCT, Copyright (c) 2014-2017, United States Government * Open MCT Web, Copyright (c) 2014-2015, United States Government
* as represented by the Administrator of the National Aeronautics and Space * as represented by the Administrator of the National Aeronautics and Space
* Administration. All rights reserved. * Administration. All rights reserved.
* *
* Open MCT is licensed under the Apache License, Version 2.0 (the * Open MCT Web is licensed under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance with the License. * "License"); you may not use this file except in compliance with the License.
* You may obtain a copy of the License at * You may obtain a copy of the License at
* http://www.apache.org/licenses/LICENSE-2.0. * http://www.apache.org/licenses/LICENSE-2.0.
@ -14,7 +14,7 @@
* License for the specific language governing permissions and limitations * License for the specific language governing permissions and limitations
* under the License. * under the License.
* *
* Open MCT includes source code licensed under additional open source * Open MCT Web includes source code licensed under additional open source
* licenses. See the Open Source Licenses file (LICENSES.md) included with * licenses. See the Open Source Licenses file (LICENSES.md) included with
* this source code distribution or the Licensing information page available * this source code distribution or the Licensing information page available
* at runtime from the About dialog for additional information. * at runtime from the About dialog for additional information.
@ -84,4 +84,4 @@ define(
return SinewaveLimitCapability; return SinewaveLimitCapability;
} }
); );

View File

@ -0,0 +1,115 @@
/*****************************************************************************
* Open MCT Web, Copyright (c) 2014-2015, United States Government
* as represented by the Administrator of the National Aeronautics and Space
* Administration. All rights reserved.
*
* Open MCT Web is licensed under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
* http://www.apache.org/licenses/LICENSE-2.0.
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
* License for the specific language governing permissions and limitations
* under the License.
*
* Open MCT Web includes source code licensed under additional open source
* licenses. See the Open Source Licenses file (LICENSES.md) included with
* this source code distribution or the Licensing information page available
* at runtime from the About dialog for additional information.
*****************************************************************************/
/*global define,Promise*/
/**
* Module defining SinewaveTelemetryProvider. Created by vwoeltje on 11/12/14.
*/
define(
["./SinewaveTelemetrySeries"],
function (SinewaveTelemetrySeries) {
"use strict";
/**
*
* @constructor
*/
function SinewaveTelemetryProvider($q, $timeout) {
var subscriptions = [];
//
function matchesSource(request) {
return request.source === "generator";
}
// Used internally; this will be repacked by doPackage
function generateData(request) {
return {
key: request.key,
telemetry: new SinewaveTelemetrySeries(request)
};
}
//
function doPackage(results) {
var packaged = {};
results.forEach(function (result) {
packaged[result.key] = result.telemetry;
});
// Format as expected (sources -> keys -> telemetry)
return { generator: packaged };
}
function requestTelemetry(requests) {
return $timeout(function () {
return doPackage(requests.filter(matchesSource).map(generateData));
}, 0);
}
function handleSubscriptions() {
subscriptions.forEach(function (subscription) {
var requests = subscription.requests;
subscription.callback(doPackage(
requests.filter(matchesSource).map(generateData)
));
});
}
function startGenerating() {
$timeout(function () {
handleSubscriptions();
if (subscriptions.length > 0) {
startGenerating();
}
}, 1000);
}
function subscribe(callback, requests) {
var subscription = {
callback: callback,
requests: requests
};
function unsubscribe() {
subscriptions = subscriptions.filter(function (s) {
return s !== subscription;
});
}
subscriptions.push(subscription);
if (subscriptions.length === 1) {
startGenerating();
}
return unsubscribe;
}
return {
requestTelemetry: requestTelemetry,
subscribe: subscribe
};
}
return SinewaveTelemetryProvider;
}
);

View File

@ -0,0 +1,78 @@
/*****************************************************************************
* Open MCT Web, Copyright (c) 2014-2015, United States Government
* as represented by the Administrator of the National Aeronautics and Space
* Administration. All rights reserved.
*
* Open MCT Web is licensed under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
* http://www.apache.org/licenses/LICENSE-2.0.
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
* License for the specific language governing permissions and limitations
* under the License.
*
* Open MCT Web includes source code licensed under additional open source
* licenses. See the Open Source Licenses file (LICENSES.md) included with
* this source code distribution or the Licensing information page available
* at runtime from the About dialog for additional information.
*****************************************************************************/
/*global define,Promise*/
/**
* Module defining SinewaveTelemetry. Created by vwoeltje on 11/12/14.
*/
define(
['./SinewaveConstants'],
function (SinewaveConstants) {
"use strict";
var ONE_DAY = 60 * 60 * 24,
firstObservedTime = Math.floor(SinewaveConstants.START_TIME / 1000);
/**
*
* @constructor
*/
function SinewaveTelemetrySeries(request) {
var timeOffset = (request.domain === 'yesterday') ? ONE_DAY : 0,
latestTime = Math.floor(Date.now() / 1000) - timeOffset,
firstTime = firstObservedTime - timeOffset,
endTime = (request.end !== undefined) ?
Math.floor(request.end / 1000) : latestTime,
count = Math.min(endTime, latestTime) - firstTime,
period = +request.period || 30,
generatorData = {},
requestStart = (request.start === undefined) ? firstTime :
Math.max(Math.floor(request.start / 1000), firstTime),
offset = requestStart - firstTime;
if (request.size !== undefined) {
offset = Math.max(offset, count - request.size);
}
generatorData.getPointCount = function () {
return count - offset;
};
generatorData.getDomainValue = function (i, domain) {
// delta uses the same numeric values as the default domain,
// so it's not checked for here, just formatted for display
// differently.
return (i + offset) * 1000 + firstTime * 1000 -
(domain === 'yesterday' ? (ONE_DAY * 1000) : 0);
};
generatorData.getRangeValue = function (i, range) {
range = range || "sin";
return Math[range]((i + offset) * Math.PI * 2 / period);
};
return generatorData;
}
return SinewaveTelemetrySeries;
}
);

View File

@ -1,9 +1,9 @@
/***************************************************************************** /*****************************************************************************
* Open MCT, Copyright (c) 2014-2017, United States Government * Open MCT Web, Copyright (c) 2014-2015, United States Government
* as represented by the Administrator of the National Aeronautics and Space * as represented by the Administrator of the National Aeronautics and Space
* Administration. All rights reserved. * Administration. All rights reserved.
* *
* Open MCT is licensed under the Apache License, Version 2.0 (the * Open MCT Web is licensed under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance with the License. * "License"); you may not use this file except in compliance with the License.
* You may obtain a copy of the License at * You may obtain a copy of the License at
* http://www.apache.org/licenses/LICENSE-2.0. * http://www.apache.org/licenses/LICENSE-2.0.
@ -14,7 +14,7 @@
* License for the specific language governing permissions and limitations * License for the specific language governing permissions and limitations
* under the License. * under the License.
* *
* Open MCT includes source code licensed under additional open source * Open MCT Web includes source code licensed under additional open source
* licenses. See the Open Source Licenses file (LICENSES.md) included with * licenses. See the Open Source Licenses file (LICENSES.md) included with
* this source code distribution or the Licensing information page available * this source code distribution or the Licensing information page available
* at runtime from the About dialog for additional information. * at runtime from the About dialog for additional information.

View File

@ -1,9 +1,9 @@
/***************************************************************************** /*****************************************************************************
* Open MCT, Copyright (c) 2014-2017, United States Government * Open MCT Web, Copyright (c) 2014-2015, United States Government
* as represented by the Administrator of the National Aeronautics and Space * as represented by the Administrator of the National Aeronautics and Space
* Administration. All rights reserved. * Administration. All rights reserved.
* *
* Open MCT is licensed under the Apache License, Version 2.0 (the * Open MCT Web is licensed under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance with the License. * "License"); you may not use this file except in compliance with the License.
* You may obtain a copy of the License at * You may obtain a copy of the License at
* http://www.apache.org/licenses/LICENSE-2.0. * http://www.apache.org/licenses/LICENSE-2.0.
@ -14,7 +14,7 @@
* License for the specific language governing permissions and limitations * License for the specific language governing permissions and limitations
* under the License. * under the License.
* *
* Open MCT includes source code licensed under additional open source * Open MCT Web includes source code licensed under additional open source
* licenses. See the Open Source Licenses file (LICENSES.md) included with * licenses. See the Open Source Licenses file (LICENSES.md) included with
* this source code distribution or the Licensing information page available * this source code distribution or the Licensing information page available
* at runtime from the About dialog for additional information. * at runtime from the About dialog for additional information.

78
example/imagery/bundle.js Normal file
View File

@ -0,0 +1,78 @@
/*****************************************************************************
* Open MCT Web, Copyright (c) 2014-2015, United States Government
* as represented by the Administrator of the National Aeronautics and Space
* Administration. All rights reserved.
*
* Open MCT Web is licensed under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
* http://www.apache.org/licenses/LICENSE-2.0.
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
* License for the specific language governing permissions and limitations
* under the License.
*
* Open MCT Web includes source code licensed under additional open source
* licenses. See the Open Source Licenses file (LICENSES.md) included with
* this source code distribution or the Licensing information page available
* at runtime from the About dialog for additional information.
*****************************************************************************/
/*global define*/
define([
"./src/ImageTelemetryProvider",
'legacyRegistry'
], function (
ImageTelemetryProvider,
legacyRegistry
) {
"use strict";
legacyRegistry.register("example/imagery", {
"name": "Imagery",
"description": "Example of a component that produces image telemetry.",
"extensions": {
"components": [
{
"implementation": ImageTelemetryProvider,
"type": "provider",
"provides": "telemetryService",
"depends": [
"$q",
"$timeout"
]
}
],
"types": [
{
"key": "imagery",
"name": "Example Imagery",
"glyph": "T",
"features": "creation",
"model": {
"telemetry": {}
},
"telemetry": {
"source": "imagery",
"domains": [
{
"name": "Time",
"key": "time",
"format": "timestamp"
}
],
"ranges": [
{
"name": "Image",
"key": "url",
"format": "imageUrl"
}
]
}
}
]
}
});
});

View File

@ -1,145 +0,0 @@
/*****************************************************************************
* Open MCT, Copyright (c) 2014-2017, United States Government
* as represented by the Administrator of the National Aeronautics and Space
* Administration. All rights reserved.
*
* Open MCT is licensed under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
* http://www.apache.org/licenses/LICENSE-2.0.
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
* License for the specific language governing permissions and limitations
* under the License.
*
* Open MCT includes source code licensed under additional open source
* licenses. See the Open Source Licenses file (LICENSES.md) included with
* this source code distribution or the Licensing information page available
* at runtime from the About dialog for additional information.
*****************************************************************************/
define([
], function(
) {
function ImageryPlugin() {
var IMAGE_SAMPLES = [
"https://www.hq.nasa.gov/alsj/a16/AS16-117-18731.jpg",
"https://www.hq.nasa.gov/alsj/a16/AS16-117-18732.jpg",
"https://www.hq.nasa.gov/alsj/a16/AS16-117-18733.jpg",
"https://www.hq.nasa.gov/alsj/a16/AS16-117-18734.jpg",
"https://www.hq.nasa.gov/alsj/a16/AS16-117-18735.jpg",
"https://www.hq.nasa.gov/alsj/a16/AS16-117-18736.jpg",
"https://www.hq.nasa.gov/alsj/a16/AS16-117-18737.jpg",
"https://www.hq.nasa.gov/alsj/a16/AS16-117-18738.jpg",
"https://www.hq.nasa.gov/alsj/a16/AS16-117-18739.jpg",
"https://www.hq.nasa.gov/alsj/a16/AS16-117-18740.jpg",
"https://www.hq.nasa.gov/alsj/a16/AS16-117-18741.jpg",
"https://www.hq.nasa.gov/alsj/a16/AS16-117-18742.jpg",
"https://www.hq.nasa.gov/alsj/a16/AS16-117-18743.jpg",
"https://www.hq.nasa.gov/alsj/a16/AS16-117-18744.jpg",
"https://www.hq.nasa.gov/alsj/a16/AS16-117-18745.jpg",
"https://www.hq.nasa.gov/alsj/a16/AS16-117-18746.jpg",
"https://www.hq.nasa.gov/alsj/a16/AS16-117-18747.jpg",
"https://www.hq.nasa.gov/alsj/a16/AS16-117-18748.jpg"
];
function pointForTimestamp(timestamp, name) {
return {
name: name,
utc: Math.floor(timestamp / 5000) * 5000,
url: IMAGE_SAMPLES[Math.floor(timestamp / 5000) % IMAGE_SAMPLES.length]
};
}
var realtimeProvider = {
supportsSubscribe: function (domainObject) {
return domainObject.type === 'example.imagery';
},
subscribe: function (domainObject, callback) {
var interval = setInterval(function () {
callback(pointForTimestamp(Date.now(), domainObject.name));
}, 5000);
return function (interval) {
clearInterval(interval);
};
}
};
var historicalProvider = {
supportsRequest: function (domainObject, options) {
return domainObject.type === 'example.imagery'
&& options.strategy !== 'latest';
},
request: function (domainObject, options) {
var start = options.start;
var end = options.end;
var data = [];
while (start <= end && data.length < 5000) {
data.push(pointForTimestamp(start, domainObject.name));
start += 5000;
}
return Promise.resolve(data);
}
};
var ladProvider = {
supportsRequest: function (domainObject, options) {
return domainObject.type === 'example.imagery' &&
options.strategy === 'latest';
},
request: function (domainObject, options) {
return Promise.resolve([pointForTimestamp(Date.now(), domainObject.name)]);
}
};
return function install(openmct) {
openmct.types.addType('example.imagery', {
key: 'example.imagery',
name: 'Example Imagery',
cssClass: 'icon-image',
description: 'For development use. Creates example imagery ' +
'data that mimics a live imagery stream.',
creatable: true,
initialize: function (object) {
object.telemetry = {
values: [
{
name: 'Name',
key: 'name'
},
{
name: 'Time',
key: 'utc',
format: 'utc',
hints: {
domain: 1
}
},
{
name: 'Image',
key: 'url',
format: 'image',
hints: {
image: 1
}
}
]
}
}
});
openmct.telemetry.addProvider(realtimeProvider);
openmct.telemetry.addProvider(historicalProvider);
openmct.telemetry.addProvider(ladProvider);
};
}
return ImageryPlugin;
});

View File

@ -0,0 +1,66 @@
/*****************************************************************************
* Open MCT Web, Copyright (c) 2014-2015, United States Government
* as represented by the Administrator of the National Aeronautics and Space
* Administration. All rights reserved.
*
* Open MCT Web is licensed under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
* http://www.apache.org/licenses/LICENSE-2.0.
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
* License for the specific language governing permissions and limitations
* under the License.
*
* Open MCT Web includes source code licensed under additional open source
* licenses. See the Open Source Licenses file (LICENSES.md) included with
* this source code distribution or the Licensing information page available
* at runtime from the About dialog for additional information.
*****************************************************************************/
/*global define,Promise*/
/**
* Module defining ImageTelemetry. Created by vwoeltje on 06/22/15.
*/
define(
[],
function () {
"use strict";
var firstObservedTime = Date.now(),
images = [
"http://www.nasa.gov/393811main_Palomar_ao_bouchez_10s_after_impact_4x3_946-710.png",
"http://www.nasa.gov/393821main_Palomar_ao_bouchez_15s_after_impact_4x3_946-710.png",
"http://www.nasa.gov/images/content/393801main_CfhtVeillet2_4x3_516-387.jpg",
"http://www.nasa.gov/images/content/392790main_1024_768_GeminiNorth_NightBeforeImpact_946-710.jpg"
].map(function (url, index) {
return {
timestamp: firstObservedTime + 1000 * index,
url: url
};
});
/**
*
* @constructor
*/
function ImageTelemetry() {
return {
getPointCount: function () {
return Math.floor((Date.now() - firstObservedTime) / 1000);
},
getDomainValue: function (i, domain) {
return images[i % images.length].timestamp;
},
getRangeValue: function (i, range) {
return images[i % images.length].url;
}
};
}
return ImageTelemetry;
}
);

View File

@ -0,0 +1,115 @@
/*****************************************************************************
* Open MCT Web, Copyright (c) 2014-2015, United States Government
* as represented by the Administrator of the National Aeronautics and Space
* Administration. All rights reserved.
*
* Open MCT Web is licensed under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
* http://www.apache.org/licenses/LICENSE-2.0.
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
* License for the specific language governing permissions and limitations
* under the License.
*
* Open MCT Web includes source code licensed under additional open source
* licenses. See the Open Source Licenses file (LICENSES.md) included with
* this source code distribution or the Licensing information page available
* at runtime from the About dialog for additional information.
*****************************************************************************/
/*global define,Promise*/
/**
* Module defining ImageTelemetryProvider. Created by vwoeltje on 06/22/15.
*/
define(
["./ImageTelemetry"],
function (ImageTelemetry) {
"use strict";
/**
*
* @constructor
*/
function ImageTelemetryProvider($q, $timeout) {
var subscriptions = [];
//
function matchesSource(request) {
return request.source === "imagery";
}
// Used internally; this will be repacked by doPackage
function generateData(request) {
return {
key: request.key,
telemetry: new ImageTelemetry()
};
}
//
function doPackage(results) {
var packaged = {};
results.forEach(function (result) {
packaged[result.key] = result.telemetry;
});
// Format as expected (sources -> keys -> telemetry)
return { imagery: packaged };
}
function requestTelemetry(requests) {
return $timeout(function () {
return doPackage(requests.filter(matchesSource).map(generateData));
}, 0);
}
function handleSubscriptions() {
subscriptions.forEach(function (subscription) {
var requests = subscription.requests;
subscription.callback(doPackage(
requests.filter(matchesSource).map(generateData)
));
});
}
function startGenerating() {
$timeout(function () {
handleSubscriptions();
if (subscriptions.length > 0) {
startGenerating();
}
}, 1000);
}
function subscribe(callback, requests) {
var subscription = {
callback: callback,
requests: requests
};
function unsubscribe() {
subscriptions = subscriptions.filter(function (s) {
return s !== subscription;
});
}
subscriptions.push(subscription);
if (subscriptions.length === 1) {
startGenerating();
}
return unsubscribe;
}
return {
requestTelemetry: requestTelemetry,
subscribe: subscribe
};
}
return ImageTelemetryProvider;
}
);

View File

@ -1,9 +1,9 @@
/***************************************************************************** /*****************************************************************************
* Open MCT, Copyright (c) 2014-2017, United States Government * Open MCT Web, Copyright (c) 2014-2015, United States Government
* as represented by the Administrator of the National Aeronautics and Space * as represented by the Administrator of the National Aeronautics and Space
* Administration. All rights reserved. * Administration. All rights reserved.
* *
* Open MCT is licensed under the Apache License, Version 2.0 (the * Open MCT Web is licensed under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance with the License. * "License"); you may not use this file except in compliance with the License.
* You may obtain a copy of the License at * You may obtain a copy of the License at
* http://www.apache.org/licenses/LICENSE-2.0. * http://www.apache.org/licenses/LICENSE-2.0.
@ -14,7 +14,7 @@
* License for the specific language governing permissions and limitations * License for the specific language governing permissions and limitations
* under the License. * under the License.
* *
* Open MCT includes source code licensed under additional open source * Open MCT Web includes source code licensed under additional open source
* licenses. See the Open Source Licenses file (LICENSES.md) included with * licenses. See the Open Source Licenses file (LICENSES.md) included with
* this source code distribution or the Licensing information page available * this source code distribution or the Licensing information page available
* at runtime from the About dialog for additional information. * at runtime from the About dialog for additional information.

26
example/mobile/res/config.rb Executable file
View File

@ -0,0 +1,26 @@
# Require any additional compass plugins here.
# require "compass-growl"
# Set this to the root of your project when deployed:
http_path = "/"
css_dir = "css"
sass_dir = "sass"
images_dir = "images"
javascripts_dir = "js"
# You can select your preferred output style here (can be overridden via the command line):
# :expanded, :compressed, :nested
output_style = :nested
# To enable relative paths to assets via compass helper functions. Uncomment:
relative_assets = true
# To disable debugging comments that display the original location of your selectors. Uncomment:
# line_comments = false
# If you prefer the indented syntax, you might want to regenerate this
# project again passing --syntax sass, or you can uncomment this:
# preferred_syntax = :sass
# and then run:
# sass-convert -R --from scss --to sass vfn_platform/static/sass scss && rm -rf sass && mv scss sass

View File

@ -0,0 +1,103 @@
/*****************************************************************************
* Open MCT Web, Copyright (c) 2014-2015, United States Government
* as represented by the Administrator of the National Aeronautics and Space
* Administration. All rights reserved.
*
* Open MCT Web is licensed under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
* http://www.apache.org/licenses/LICENSE-2.0.
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
* License for the specific language governing permissions and limitations
* under the License.
*
* Open MCT Web includes source code licensed under additional open source
* licenses. See the Open Source Licenses file (LICENSES.md) included with
* this source code distribution or the Licensing information page available
* at runtime from the About dialog for additional information.
*****************************************************************************/
/*****************************************************************************
* Open MCT Web, Copyright (c) 2014-2015, United States Government
* as represented by the Administrator of the National Aeronautics and Space
* Administration. All rights reserved.
*
* Open MCT Web is licensed under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
* http://www.apache.org/licenses/LICENSE-2.0.
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
* License for the specific language governing permissions and limitations
* under the License.
*
* Open MCT Web includes source code licensed under additional open source
* licenses. See the Open Source Licenses file (LICENSES.md) included with
* this source code distribution or the Licensing information page available
* at runtime from the About dialog for additional information.
*****************************************************************************/
/************************** FEATURES */
/************************** VERY INFLUENTIAL GLOBAL DIMENSIONS */
/************************** RATIOS */
/************************** LAYOUT */
/************************** CONTROLS */
/************************** PATHS */
/************************** TIMINGS */
/************************** LIMITS */
/*****************************************************************************
* Open MCT Web, Copyright (c) 2014-2015, United States Government
* as represented by the Administrator of the National Aeronautics and Space
* Administration. All rights reserved.
*
* Open MCT Web is licensed under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
* http://www.apache.org/licenses/LICENSE-2.0.
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
* License for the specific language governing permissions and limitations
* under the License.
*
* Open MCT Web includes source code licensed under additional open source
* licenses. See the Open Source Licenses file (LICENSES.md) included with
* this source code distribution or the Licensing information page available
* at runtime from the About dialog for additional information.
*****************************************************************************/
/************************** MOBILE REPRESENTATION ITEMS DIMENSIONS */
/************************** MOBILE TREE MENU DIMENSIONS */
/************************** WINDOW DIMENSIONS FOR RWD */
/************************** MEDIA QUERIES: WINDOW CHECKS FOR SPECIFIC ORIENTATIONS FOR EACH DEVICE */
/************************** MEDIA QUERIES: WINDOWS FOR SPECIFIC ORIENTATIONS FOR EACH DEVICE */
/************************** DEVICE PARAMETERS FOR MENUS/REPRESENTATIONS */
/*****************************************************************************
* Open MCT Web, Copyright (c) 2014-2015, United States Government
* as represented by the Administrator of the National Aeronautics and Space
* Administration. All rights reserved.
*
* Open MCT Web is licensed under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
* http://www.apache.org/licenses/LICENSE-2.0.
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
* License for the specific language governing permissions and limitations
* under the License.
*
* Open MCT Web includes source code licensed under additional open source
* licenses. See the Open Source Licenses file (LICENSES.md) included with
* this source code distribution or the Licensing information page available
* at runtime from the About dialog for additional information.
*****************************************************************************/
/* REQUIRES mobile/_constants */
@media screen and (orientation: portrait) and (max-width: 514px) and (max-height: 740px) and (max-device-width: 799px) and (max-device-height: 1024px), screen and (orientation: landscape) and (max-height: 514px) and (max-width: 740px) and (max-device-width: 799px) and (max-device-height: 1024px), screen and (orientation: landscape) and (max-height: 514px) and (max-width: 740px) and (max-device-width: 1024px) and (max-device-height: 799px), screen and (orientation: portrait) and (min-width: 515px) and (max-width: 799px) and (min-height: 741px) and (max-height: 1024px) and (max-device-width: 799px) and (max-device-height: 1024px), screen and (orientation: landscape) and (min-height: 515px) and (max-height: 799px) and (min-width: 741px) and (max-width: 1024px) and (max-device-width: 799px) and (max-device-height: 1024px), screen and (orientation: landscape) and (min-height: 515px) and (max-height: 799px) and (min-width: 741px) and (max-width: 1024px) and (max-device-width: 1024px) and (max-device-height: 799px) {
/* line 28, ../sass/mobile-example.scss */
.create-btn-holder {
display: block !important; } }

View File

@ -1,9 +1,9 @@
/***************************************************************************** /*****************************************************************************
* Open MCT, Copyright (c) 2014-2017, United States Government * Open MCT Web, Copyright (c) 2014-2015, United States Government
* as represented by the Administrator of the National Aeronautics and Space * as represented by the Administrator of the National Aeronautics and Space
* Administration. All rights reserved. * Administration. All rights reserved.
* *
* Open MCT is licensed under the Apache License, Version 2.0 (the * Open MCT Web is licensed under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance with the License. * "License"); you may not use this file except in compliance with the License.
* You may obtain a copy of the License at * You may obtain a copy of the License at
* http://www.apache.org/licenses/LICENSE-2.0. * http://www.apache.org/licenses/LICENSE-2.0.
@ -14,7 +14,7 @@
* License for the specific language governing permissions and limitations * License for the specific language governing permissions and limitations
* under the License. * under the License.
* *
* Open MCT includes source code licensed under additional open source * Open MCT Web includes source code licensed under additional open source
* licenses. See the Open Source Licenses file (LICENSES.md) included with * licenses. See the Open Source Licenses file (LICENSES.md) included with
* this source code distribution or the Licensing information page available * this source code distribution or the Licensing information page available
* at runtime from the About dialog for additional information. * at runtime from the About dialog for additional information.
@ -25,7 +25,7 @@
@include phoneandtablet { @include phoneandtablet {
// Show the Create button // Show the Create button
.create-button-holder { .create-btn-holder {
display: block !important; display: block !important;
} }
} }

View File

@ -1,20 +0,0 @@
To use this bundle, add the following paths to /main.js -
'./platform/features/conductor/bundle',
'./example/msl/bundle',
An example plugin that integrates with public data from the Curiosity rover.
The data shown used by this plugin is published by the Centro de
Astrobiología (CSIC-INTA) at http://cab.inta-csic.es/rems/
Fetching data from this source requires a cross-origin request which will
fail on most modern browsers due to restrictions on such requests. As such,
it is proxied through a local proxy defined in app.js. In order to use this
example you will need to run app.js locally.
This example shows integration with an historical telemetry source, as
opposed to a real-time data source that is streaming back current information
about the state of a system. This example is atypical of a historical data
source in that it fetches all data in one request. The server infrastructure
of an historical telemetry source should ideally allow queries bounded by
time and other data attributes.

View File

@ -1,115 +0,0 @@
/*****************************************************************************
* Open MCT, Copyright (c) 2014-2017, United States Government
* as represented by the Administrator of the National Aeronautics and Space
* Administration. All rights reserved.
*
* Open MCT is licensed under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
* http://www.apache.org/licenses/LICENSE-2.0.
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
* License for the specific language governing permissions and limitations
* under the License.
*
* Open MCT includes source code licensed under additional open source
* licenses. See the Open Source Licenses file (LICENSES.md) included with
* this source code distribution or the Licensing information page available
* at runtime from the About dialog for additional information.
*****************************************************************************/
/*global define*/
define([
"./src/RemsTelemetryServerAdapter",
"./src/RemsTelemetryModelProvider",
"./src/RemsTelemetryProvider",
'legacyRegistry',
"module"
], function (
RemsTelemetryServerAdapter,
RemsTelemetryModelProvider,
RemsTelemetryProvider,
legacyRegistry
) {
"use strict";
legacyRegistry.register("example/msl", {
"name" : "Mars Science Laboratory Data Adapter",
"extensions" : {
"types": [
{
"name":"Mars Science Laboratory",
"key": "msl.curiosity",
"cssClass": "icon-object"
},
{
"name": "Instrument",
"key": "msl.instrument",
"cssClass": "icon-object",
"model": {"composition": []}
},
{
"name": "Measurement",
"key": "msl.measurement",
"cssClass": "icon-telemetry",
"model": {"telemetry": {}},
"telemetry": {
"source": "rems.source",
"domains": [
{
"name": "Time",
"key": "utc",
"format": "utc"
}
]
}
}
],
"constants": [
{
"key": "REMS_WS_URL",
"value": "/proxyUrl?url=http://cab.inta-csic.es/rems/wp-content/plugins/marsweather-widget/api.php"
}
],
"roots": [
{
"id": "msl:curiosity"
}
],
"models": [
{
"id": "msl:curiosity",
"priority": "preferred",
"model": {
"type": "msl.curiosity",
"name": "Mars Science Laboratory",
"composition": ["msl_tlm:rems"]
}
}
],
"services": [
{
"key":"rems.adapter",
"implementation": RemsTelemetryServerAdapter,
"depends": ["$http", "$log", "REMS_WS_URL"]
}
],
"components": [
{
"provides": "modelService",
"type": "provider",
"implementation": RemsTelemetryModelProvider,
"depends": ["rems.adapter"]
},
{
"provides": "telemetryService",
"type": "provider",
"implementation": RemsTelemetryProvider,
"depends": ["rems.adapter", "$q"]
}
]
}
});
});

File diff suppressed because one or more lines are too long

View File

@ -1,79 +0,0 @@
/*****************************************************************************
* Open MCT, Copyright (c) 2014-2017, United States Government
* as represented by the Administrator of the National Aeronautics and Space
* Administration. All rights reserved.
*
* Open MCT is licensed under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
* http://www.apache.org/licenses/LICENSE-2.0.
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
* License for the specific language governing permissions and limitations
* under the License.
*
* Open MCT includes source code licensed under additional open source
* licenses. See the Open Source Licenses file (LICENSES.md) included with
* this source code distribution or the Licensing information page available
* at runtime from the About dialog for additional information.
*****************************************************************************/
/*global define*/
define(
[],
/**
* A data dictionary describes the telemetry available from a data
* source and its data types. The data dictionary will be parsed by a custom
* server provider for this data source (in this case
* {@link RemsTelemetryServerAdapter}).
*
* Typically a data dictionary would be made available alongside the
* telemetry data source itself.
*/
function () {
return {
"name": "Mars Science Laboratory",
"identifier": "msl",
"instruments": [
{
"name":"rems",
"identifier": "rems",
"measurements": [
{
"name": "Min. Air Temperature",
"identifier": "min_temp",
"units": "Degrees (C)",
"type": "float"
},
{
"name": "Max. Air Temperature",
"identifier": "max_temp",
"units": "Degrees (C)",
"type": "float"
},
{
"name": "Atmospheric Pressure",
"identifier": "pressure",
"units": "Millibars",
"type": "float"
},
{
"name": "Min. Ground Temperature",
"identifier": "min_gts_temp",
"units": "Degrees (C)",
"type": "float"
},
{
"name": "Max. Ground Temperature",
"identifier": "max_gts_temp",
"units": "Degrees (C)",
"type": "float"
}
]
}
]
};
}
);

View File

@ -1,95 +0,0 @@
/*****************************************************************************
* Open MCT, Copyright (c) 2014-2017, United States Government
* as represented by the Administrator of the National Aeronautics and Space
* Administration. All rights reserved.
*
* Open MCT is licensed under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
* http://www.apache.org/licenses/LICENSE-2.0.
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
* License for the specific language governing permissions and limitations
* under the License.
*
* Open MCT includes source code licensed under additional open source
* licenses. See the Open Source Licenses file (LICENSES.md) included with
* 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 PREFIX = "msl_tlm:",
FORMAT_MAPPINGS = {
float: "number",
integer: "number",
string: "string"
};
function RemsTelemetryModelProvider(adapter){
function isRelevant(id) {
return id.indexOf(PREFIX) === 0;
}
function makeId(element){
return PREFIX + element.identifier;
}
function buildTaxonomy(dictionary){
var models = {};
function addMeasurement(measurement, parent){
var format = FORMAT_MAPPINGS[measurement.type];
models[makeId(measurement)] = {
type: "msl.measurement",
name: measurement.name,
location: parent,
telemetry: {
key: measurement.identifier,
ranges: [{
key: "value",
name: measurement.units,
units: measurement.units,
format: format
}]
}
};
}
function addInstrument(subsystem, spacecraftId) {
var measurements = (subsystem.measurements || []),
instrumentId = makeId(subsystem);
models[instrumentId] = {
type: "msl.instrument",
name: subsystem.name,
location: spacecraftId,
composition: measurements.map(makeId)
};
measurements.forEach(function(measurement) {
addMeasurement(measurement, instrumentId);
});
}
(dictionary.instruments || []).forEach(function(instrument) {
addInstrument(instrument, "msl:curiosity");
});
return models;
}
return {
getModels: function (ids) {
return ids.some(isRelevant) ? buildTaxonomy(adapter.dictionary) : {};
}
};
}
return RemsTelemetryModelProvider;
}
);

View File

@ -1,83 +0,0 @@
/*****************************************************************************
* Open MCT, Copyright (c) 2014-2017, United States Government
* as represented by the Administrator of the National Aeronautics and Space
* Administration. All rights reserved.
*
* Open MCT is licensed under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
* http://www.apache.org/licenses/LICENSE-2.0.
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
* License for the specific language governing permissions and limitations
* under the License.
*
* Open MCT includes source code licensed under additional open source
* licenses. See the Open Source Licenses file (LICENSES.md) included with
* this source code distribution or the Licensing information page available
* at runtime from the About dialog for additional information.
*****************************************************************************/
/*global define */
define (
['./RemsTelemetrySeries'],
function (RemsTelemetrySeries) {
"use strict";
var SOURCE = "rems.source";
function RemsTelemetryProvider(adapter, $q) {
this.adapter = adapter;
this.$q = $q;
}
/**
* Retrieve telemetry from this telemetry source.
* @memberOf example/msl
* @param {Array<TelemetryRequest>} requests An array of all request
* objects (which needs to be filtered to only those relevant to this
* source)
* @returns {Promise} A {@link Promise} resolved with a {@link RemsTelemetrySeries}
* object that wraps the telemetry returned from the telemetry source.
*/
RemsTelemetryProvider.prototype.requestTelemetry = function (requests) {
var packaged = {},
relevantReqs,
adapter = this.adapter;
function matchesSource(request) {
return (request.source === SOURCE);
}
function addToPackage(history) {
packaged[SOURCE][history.id] =
new RemsTelemetrySeries(history.values);
}
function handleRequest(request) {
return adapter.history(request).then(addToPackage);
}
relevantReqs = requests.filter(matchesSource);
packaged[SOURCE] = {};
return this.$q.all(relevantReqs.map(handleRequest))
.then(function () {
return packaged;
});
};
/**
* This data source does not support real-time subscriptions
*/
RemsTelemetryProvider.prototype.subscribe = function (callback, requests) {
return function() {};
};
RemsTelemetryProvider.prototype.unsubscribe = function (callback, requests) {
return function() {};
};
return RemsTelemetryProvider;
}
);

View File

@ -1,84 +0,0 @@
/*****************************************************************************
* Open MCT, Copyright (c) 2014-2017, United States Government
* as represented by the Administrator of the National Aeronautics and Space
* Administration. All rights reserved.
*
* Open MCT is licensed under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
* http://www.apache.org/licenses/LICENSE-2.0.
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
* License for the specific language governing permissions and limitations
* under the License.
*
* Open MCT includes source code licensed under additional open source
* licenses. See the Open Source Licenses file (LICENSES.md) included with
* 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";
/**
* @typedef {Object} RemsTelemetryValue
* @memberOf example/msl
* @property {number} date The date/time of the telemetry value. Constitutes the domain value of this value pair
* @property {number} value The value of this telemetry datum.
* A floating point value representing some observable quantity (eg.
* temperature, air pressure, etc.)
*/
/**
* A representation of a collection of telemetry data. The REMS
* telemetry data is time ordered, with the 'domain' value
* constituting the time stamp of each data value and the
* 'range' being the value itself.
*
* TelemetrySeries will typically wrap an array of telemetry data,
* and provide an interface for retrieving individual an telemetry
* value.
* @memberOf example/msl
* @param {Array<RemsTelemetryValue>} data An array of telemetry values
* @constructor
*/
function RemsTelemetrySeries(data) {
this.data = data;
}
/**
* @returns {number} A count of the number of data values available in
* this series
*/
RemsTelemetrySeries.prototype.getPointCount = function() {
return this.data.length;
};
/**
* The domain value at the given index. The Rems telemetry data is
* time ordered, so the domain value is the time stamp of each data
* value.
* @param index
* @returns {number} the time value in ms since 1 January 1970
*/
RemsTelemetrySeries.prototype.getDomainValue = function(index) {
return this.data[index].date;
};
/**
* The range value of the REMS data set is the value of the thing
* being measured, be it temperature, air pressure, etc.
* @param index The datum in the data series to return the range
* value of.
* @returns {number} A floating point number
*/
RemsTelemetrySeries.prototype.getRangeValue = function(index) {
return this.data[index].value;
};
return RemsTelemetrySeries;
}
);

View File

@ -1,142 +0,0 @@
/*****************************************************************************
* Open MCT, Copyright (c) 2014-2017, United States Government
* as represented by the Administrator of the National Aeronautics and Space
* Administration. All rights reserved.
*
* Open MCT is licensed under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
* http://www.apache.org/licenses/LICENSE-2.0.
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
* License for the specific language governing permissions and limitations
* under the License.
*
* Open MCT includes source code licensed under additional open source
* licenses. See the Open Source Licenses file (LICENSES.md) included with
* this source code distribution or the Licensing information page available
* at runtime from the About dialog for additional information.
*****************************************************************************/
/*global define*/
/*jslint es5: true */
define(
[
"./MSLDataDictionary",
"module"
],
function (MSLDataDictionary, module) {
"use strict";
var TERRESTRIAL_DATE = "terrestrial_date",
LOCAL_DATA = "../data/rems.json";
/**
* Fetches historical data from the REMS instrument on the Curiosity
* Rover.
* @memberOf example/msl
* @param $q
* @param $http
* @param REMS_WS_URL The location of the REMS telemetry data.
* @constructor
*/
function RemsTelemetryServerAdapter($http, $log, REMS_WS_URL) {
this.localDataURI = module.uri.substring(0, module.uri.lastIndexOf('/') + 1) + LOCAL_DATA;
this.REMS_WS_URL = REMS_WS_URL;
this.$http = $http;
this.$log = $log;
this.promise = undefined;
this.dataTransforms = {
//Convert from pascals to millibars
'pressure': function pascalsToMillibars(pascals) {
return pascals / 100;
}
};
}
/**
* The data dictionary for this data source.
* @type {MSLDataDictionary}
*/
RemsTelemetryServerAdapter.prototype.dictionary = MSLDataDictionary;
/**
* Fetches historical data from source, and associates it with the
* given request ID.
* @private
*/
RemsTelemetryServerAdapter.prototype.requestHistory = function(request) {
var self = this,
id = request.key;
var dataTransforms = this.dataTransforms;
function processResponse(response){
var data = [];
/*
* History data is organised by Sol. Iterate over sols...
*/
response.data.soles.forEach(function(solData){
/*
* Check that valid data exists
*/
if (!isNaN(solData[id])) {
var dataTransform = dataTransforms[id];
/*
* Append each data point to the array of values
* for this data point property (min. temp, etc).
*/
data.unshift({
date: Date.parse(solData[TERRESTRIAL_DATE]),
value: dataTransform ? dataTransform(solData[id]) : solData[id]
});
}
});
return data;
}
function fallbackToLocal() {
self.$log.warn("Loading REMS data failed, probably due to" +
" cross origin policy. Falling back to local data");
return self.$http.get(self.localDataURI);
}
//Filter results to match request parameters
function filterResults(results) {
return results.filter(function(result){
return result.date >= (request.start || Number.MIN_VALUE) &&
result.date <= (request.end || Number.MAX_VALUE);
});
}
function packageAndResolve(results){
return {id: id, values: results};
}
return (this.promise = this.promise || this.$http.get(this.REMS_WS_URL))
.catch(fallbackToLocal)
.then(processResponse)
.then(filterResults)
.then(packageAndResolve);
};
/**
* Requests historical telemetry for the named data attribute. In
* the case of REMS, this data source exposes multiple different
* data variables from the REMS instrument, including temperature
* and others
* @param id The telemetry data point key to be queried.
* @returns {Promise | Array<RemsTelemetryValue>} that resolves with an Array of {@link RemsTelemetryValue} objects for the request data key.
*/
RemsTelemetryServerAdapter.prototype.history = function(request) {
return this.requestHistory(request);
};
return RemsTelemetryServerAdapter;
}
);

View File

@ -1,9 +1,9 @@
/***************************************************************************** /*****************************************************************************
* Open MCT, Copyright (c) 2014-2017, United States Government * Open MCT Web, Copyright (c) 2014-2015, United States Government
* as represented by the Administrator of the National Aeronautics and Space * as represented by the Administrator of the National Aeronautics and Space
* Administration. All rights reserved. * Administration. All rights reserved.
* *
* Open MCT is licensed under the Apache License, Version 2.0 (the * Open MCT Web is licensed under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance with the License. * "License"); you may not use this file except in compliance with the License.
* You may obtain a copy of the License at * You may obtain a copy of the License at
* http://www.apache.org/licenses/LICENSE-2.0. * http://www.apache.org/licenses/LICENSE-2.0.
@ -14,7 +14,7 @@
* License for the specific language governing permissions and limitations * License for the specific language governing permissions and limitations
* under the License. * under the License.
* *
* Open MCT includes source code licensed under additional open source * Open MCT Web includes source code licensed under additional open source
* licenses. See the Open Source Licenses file (LICENSES.md) included with * licenses. See the Open Source Licenses file (LICENSES.md) included with
* this source code distribution or the Licensing information page available * this source code distribution or the Licensing information page available
* at runtime from the About dialog for additional information. * at runtime from the About dialog for additional information.

View File

@ -1,9 +1,10 @@
<span class="status block" ng-controller="DialogLaunchController"> <span class="status block ok" ng-controller="DialogLaunchController">
<!-- DO NOT ADD SPACES BETWEEN THE SPANS - IT ADDS WHITE SPACE!! --> <span class="ui-symbol status-indicator">&#xe600;</span>
<span class="status-indicator icon-box-with-arrow"></span><span class="label"> <span class="label">
<a ng-click="launchProgress(true)">Known</a> | <a ng-click="launchProgress(true)">Known</a> |
<a ng-click="launchProgress(false)">Unknown</a> | <a ng-click="launchProgress(false)">Unknown</a> |
<a ng-click="launchError()">Error</a> | <a ng-click="launchError()">Error</a> |
<a ng-click="launchInfo()">Info</a> <a ng-click="launchInfo()">Info</a>
</span><span class="count"></span> </span>
</span> <span class="count">Dialogs</span>
</span>

View File

@ -1,9 +1,10 @@
<span class="status block" ng-controller="NotificationLaunchController"> <span class="status block ok" ng-controller="NotificationLaunchController">
<!-- DO NOT ADD SPACES BETWEEN THE SPANS - IT ADDS WHITE SPACE!! --> <span class="ui-symbol status-indicator">&#xe600;</span>
<span class="status-indicator icon-bell"></span><span class="label"> <span class="label">
<a ng-click="newInfo()">Success</a> | <a ng-click="newInfo()">Success</a> |
<a ng-click="newError()">Error</a> | <a ng-click="newError()">Error</a> |
<a ng-click="newAlert()">Alert</a> | <a ng-click="newAlert()">Alert</a> |
<a ng-click="newProgress()">Progress</a> <a ng-click="newProgress()">Progress</a>
</span><span class="count"></span> </span>
</span> <span class="count">Notifications</span>
</span>

View File

@ -1,9 +1,9 @@
/***************************************************************************** /*****************************************************************************
* Open MCT, Copyright (c) 2014-2017, United States Government * Open MCT Web, Copyright (c) 2014-2015, United States Government
* as represented by the Administrator of the National Aeronautics and Space * as represented by the Administrator of the National Aeronautics and Space
* Administration. All rights reserved. * Administration. All rights reserved.
* *
* Open MCT is licensed under the Apache License, Version 2.0 (the * Open MCT Web is licensed under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance with the License. * "License"); you may not use this file except in compliance with the License.
* You may obtain a copy of the License at * You may obtain a copy of the License at
* http://www.apache.org/licenses/LICENSE-2.0. * http://www.apache.org/licenses/LICENSE-2.0.
@ -14,7 +14,7 @@
* License for the specific language governing permissions and limitations * License for the specific language governing permissions and limitations
* under the License. * under the License.
* *
* Open MCT includes source code licensed under additional open source * Open MCT Web includes source code licensed under additional open source
* licenses. See the Open Source Licenses file (LICENSES.md) included with * licenses. See the Open Source Licenses file (LICENSES.md) included with
* this source code distribution or the Licensing information page available * this source code distribution or the Licensing information page available
* at runtime from the About dialog for additional information. * at runtime from the About dialog for additional information.
@ -44,31 +44,30 @@ define(
periodically with the progress of an ongoing process. periodically with the progress of an ongoing process.
*/ */
$scope.launchProgress = function (knownProgress) { $scope.launchProgress = function (knownProgress) {
var dialog, var model = {
model = { title: "Progress Dialog Example",
title: "Progress Dialog Example", progress: 0,
progress: 0, hint: "Do not navigate away from this page or close this browser tab while this operation is in progress.",
hint: "Do not navigate away from this page or close this browser tab while this operation is in progress.", actionText: "Calculating...",
actionText: "Calculating...", unknownProgress: !knownProgress,
unknownProgress: !knownProgress, unknownDuration: false,
unknownDuration: false, severity: "info",
severity: "info", options: [
options: [ {
{ label: "Cancel Operation",
label: "Cancel Operation", callback: function () {
callback: function () { $log.debug("Operation cancelled");
$log.debug("Operation cancelled"); dialogService.dismiss();
dialog.dismiss();
}
},
{
label: "Do something else...",
callback: function () {
$log.debug("Something else pressed");
}
} }
] },
}; {
label: "Do something else...",
callback: function () {
$log.debug("Something else pressed");
}
}
]
};
function incrementProgress() { function incrementProgress() {
model.progress = Math.min(100, Math.floor(model.progress + Math.random() * 30)); model.progress = Math.min(100, Math.floor(model.progress + Math.random() * 30));
@ -78,9 +77,7 @@ define(
} }
} }
dialog = dialogService.showBlockingMessage(model); if (dialogService.showBlockingMessage(model)) {
if (dialog) {
//Do processing here //Do processing here
model.actionText = "Processing 100 objects..."; model.actionText = "Processing 100 objects...";
if (knownProgress) { if (knownProgress) {
@ -96,31 +93,29 @@ define(
Demonstrates launching an error dialog Demonstrates launching an error dialog
*/ */
$scope.launchError = function () { $scope.launchError = function () {
var dialog, var model = {
model = { title: "Error Dialog Example",
title: "Error Dialog Example", actionText: "Something happened, and it was not good.",
actionText: "Something happened, and it was not good.", severity: "error",
severity: "error", options: [
options: [ {
{ label: "Try Again",
label: "Try Again", callback: function () {
callback: function () { $log.debug("Try Again Pressed");
$log.debug("Try Again Pressed"); dialogService.dismiss();
dialog.dismiss();
}
},
{
label: "Cancel",
callback: function () {
$log.debug("Cancel Pressed");
dialog.dismiss();
}
} }
] },
}; {
dialog = dialogService.showBlockingMessage(model); label: "Cancel",
callback: function () {
$log.debug("Cancel Pressed");
dialogService.dismiss();
}
}
]
};
if (!dialog) { if (!dialogService.showBlockingMessage(model)) {
$log.error("Could not display modal dialog"); $log.error("Could not display modal dialog");
} }
}; };
@ -129,25 +124,22 @@ define(
Demonstrates launching an error dialog Demonstrates launching an error dialog
*/ */
$scope.launchInfo = function () { $scope.launchInfo = function () {
var dialog, var model = {
model = { title: "Info Dialog Example",
title: "Info Dialog Example", actionText: "This is an example of a blocking info" +
actionText: "This is an example of a blocking info" + " dialog. This dialog can be used to draw the user's" +
" dialog. This dialog can be used to draw the user's" + " attention to an event.",
" attention to an event.", severity: "info",
severity: "info", primaryOption: {
primaryOption: { label: "OK",
label: "OK", callback: function () {
callback: function () { $log.debug("OK Pressed");
$log.debug("OK Pressed"); dialogService.dismiss();
dialog.dismiss();
}
} }
}; }
};
dialog = dialogService.showBlockingMessage(model); if (!dialogService.showBlockingMessage(model)) {
if (!dialog) {
$log.error("Could not display modal dialog"); $log.error("Could not display modal dialog");
} }
}; };

View File

@ -1,9 +1,9 @@
/***************************************************************************** /*****************************************************************************
* Open MCT, Copyright (c) 2014-2017, United States Government * Open MCT Web, Copyright (c) 2014-2015, United States Government
* as represented by the Administrator of the National Aeronautics and Space * as represented by the Administrator of the National Aeronautics and Space
* Administration. All rights reserved. * Administration. All rights reserved.
* *
* Open MCT is licensed under the Apache License, Version 2.0 (the * Open MCT Web is licensed under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance with the License. * "License"); you may not use this file except in compliance with the License.
* You may obtain a copy of the License at * You may obtain a copy of the License at
* http://www.apache.org/licenses/LICENSE-2.0. * http://www.apache.org/licenses/LICENSE-2.0.
@ -14,7 +14,7 @@
* License for the specific language governing permissions and limitations * License for the specific language governing permissions and limitations
* under the License. * under the License.
* *
* Open MCT includes source code licensed under additional open source * Open MCT Web includes source code licensed under additional open source
* licenses. See the Open Source Licenses file (LICENSES.md) included with * licenses. See the Open Source Licenses file (LICENSES.md) included with
* this source code distribution or the Licensing information page available * this source code distribution or the Licensing information page available
* at runtime from the About dialog for additional information. * at runtime from the About dialog for additional information.
@ -32,15 +32,17 @@ define(
* launched for demonstration and testing purposes. * launched for demonstration and testing purposes.
* @constructor * @constructor
*/ */
function DialogLaunchIndicator() { function DialogLaunchIndicator() {
} }
DialogLaunchIndicator.template = 'dialogLaunchTemplate'; DialogLaunchIndicator.template = 'dialogLaunchTemplate';
DialogLaunchIndicator.prototype.getGlyph = function () {
return "i";
};
DialogLaunchIndicator.prototype.getGlyphClass = function () { DialogLaunchIndicator.prototype.getGlyphClass = function () {
return 'ok'; return 'caution';
}; };
DialogLaunchIndicator.prototype.getText = function () { DialogLaunchIndicator.prototype.getText = function () {
return "Launch test dialog"; return "Launch test dialog";

View File

@ -1,9 +1,9 @@
/***************************************************************************** /*****************************************************************************
* Open MCT, Copyright (c) 2014-2017, United States Government * Open MCT Web, Copyright (c) 2014-2015, United States Government
* as represented by the Administrator of the National Aeronautics and Space * as represented by the Administrator of the National Aeronautics and Space
* Administration. All rights reserved. * Administration. All rights reserved.
* *
* Open MCT is licensed under the Apache License, Version 2.0 (the * Open MCT Web is licensed under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance with the License. * "License"); you may not use this file except in compliance with the License.
* You may obtain a copy of the License at * You may obtain a copy of the License at
* http://www.apache.org/licenses/LICENSE-2.0. * http://www.apache.org/licenses/LICENSE-2.0.
@ -14,7 +14,7 @@
* License for the specific language governing permissions and limitations * License for the specific language governing permissions and limitations
* under the License. * under the License.
* *
* Open MCT includes source code licensed under additional open source * Open MCT Web includes source code licensed under additional open source
* licenses. See the Open Source Licenses file (LICENSES.md) included with * licenses. See the Open Source Licenses file (LICENSES.md) included with
* this source code distribution or the Licensing information page available * this source code distribution or the Licensing information page available
* at runtime from the About dialog for additional information. * at runtime from the About dialog for additional information.

View File

@ -1,9 +1,9 @@
/***************************************************************************** /*****************************************************************************
* Open MCT, Copyright (c) 2014-2017, United States Government * Open MCT Web, Copyright (c) 2014-2015, United States Government
* as represented by the Administrator of the National Aeronautics and Space * as represented by the Administrator of the National Aeronautics and Space
* Administration. All rights reserved. * Administration. All rights reserved.
* *
* Open MCT is licensed under the Apache License, Version 2.0 (the * Open MCT Web is licensed under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance with the License. * "License"); you may not use this file except in compliance with the License.
* You may obtain a copy of the License at * You may obtain a copy of the License at
* http://www.apache.org/licenses/LICENSE-2.0. * http://www.apache.org/licenses/LICENSE-2.0.
@ -14,7 +14,7 @@
* License for the specific language governing permissions and limitations * License for the specific language governing permissions and limitations
* under the License. * under the License.
* *
* Open MCT includes source code licensed under additional open source * Open MCT Web includes source code licensed under additional open source
* licenses. See the Open Source Licenses file (LICENSES.md) included with * licenses. See the Open Source Licenses file (LICENSES.md) included with
* this source code distribution or the Licensing information page available * this source code distribution or the Licensing information page available
* at runtime from the About dialog for additional information. * at runtime from the About dialog for additional information.
@ -26,21 +26,17 @@ define(
function () { function () {
"use strict"; "use strict";
/**
* A tool for manually invoking notifications. When included this
* indicator will allow for notifications of different types to be
* launched for demonstration and testing purposes.
* @constructor
*/
function NotificationLaunchIndicator() { function NotificationLaunchIndicator() {
} }
NotificationLaunchIndicator.template = 'notificationLaunchTemplate'; NotificationLaunchIndicator.template = 'notificationLaunchTemplate';
NotificationLaunchIndicator.prototype.getGlyph = function () {
return "i";
};
NotificationLaunchIndicator.prototype.getGlyphClass = function () { NotificationLaunchIndicator.prototype.getGlyphClass = function () {
return 'ok'; return 'caution';
}; };
NotificationLaunchIndicator.prototype.getText = function () { NotificationLaunchIndicator.prototype.getText = function () {
return "Launch notification"; return "Launch notification";

View File

@ -1,9 +1,9 @@
/***************************************************************************** /*****************************************************************************
* Open MCT, Copyright (c) 2014-2017, United States Government * Open MCT Web, Copyright (c) 2014-2015, United States Government
* as represented by the Administrator of the National Aeronautics and Space * as represented by the Administrator of the National Aeronautics and Space
* Administration. All rights reserved. * Administration. All rights reserved.
* *
* Open MCT is licensed under the Apache License, Version 2.0 (the * Open MCT Web is licensed under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance with the License. * "License"); you may not use this file except in compliance with the License.
* You may obtain a copy of the License at * You may obtain a copy of the License at
* http://www.apache.org/licenses/LICENSE-2.0. * http://www.apache.org/licenses/LICENSE-2.0.
@ -14,7 +14,7 @@
* License for the specific language governing permissions and limitations * License for the specific language governing permissions and limitations
* under the License. * under the License.
* *
* Open MCT includes source code licensed under additional open source * Open MCT Web includes source code licensed under additional open source
* licenses. See the Open Source Licenses file (LICENSES.md) included with * licenses. See the Open Source Licenses file (LICENSES.md) included with
* this source code distribution or the Licensing information page available * this source code distribution or the Licensing information page available
* at runtime from the About dialog for additional information. * at runtime from the About dialog for additional information.

View File

@ -1,9 +1,9 @@
/***************************************************************************** /*****************************************************************************
* Open MCT, Copyright (c) 2014-2017, United States Government * Open MCT Web, Copyright (c) 2014-2015, United States Government
* as represented by the Administrator of the National Aeronautics and Space * as represented by the Administrator of the National Aeronautics and Space
* Administration. All rights reserved. * Administration. All rights reserved.
* *
* Open MCT is licensed under the Apache License, Version 2.0 (the * Open MCT Web is licensed under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance with the License. * "License"); you may not use this file except in compliance with the License.
* You may obtain a copy of the License at * You may obtain a copy of the License at
* http://www.apache.org/licenses/LICENSE-2.0. * http://www.apache.org/licenses/LICENSE-2.0.
@ -14,7 +14,7 @@
* License for the specific language governing permissions and limitations * License for the specific language governing permissions and limitations
* under the License. * under the License.
* *
* Open MCT includes source code licensed under additional open source * Open MCT Web includes source code licensed under additional open source
* licenses. See the Open Source Licenses file (LICENSES.md) included with * licenses. See the Open Source Licenses file (LICENSES.md) included with
* this source code distribution or the Licensing information page available * this source code distribution or the Licensing information page available
* at runtime from the About dialog for additional information. * at runtime from the About dialog for additional information.
@ -100,4 +100,4 @@ define(
return BrowserPersistenceProvider; return BrowserPersistenceProvider;
} }
); );

View File

@ -1,9 +1,9 @@
/***************************************************************************** /*****************************************************************************
* Open MCT, Copyright (c) 2014-2017, United States Government * Open MCT Web, Copyright (c) 2014-2015, United States Government
* as represented by the Administrator of the National Aeronautics and Space * as represented by the Administrator of the National Aeronautics and Space
* Administration. All rights reserved. * Administration. All rights reserved.
* *
* Open MCT is licensed under the Apache License, Version 2.0 (the * Open MCT Web is licensed under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance with the License. * "License"); you may not use this file except in compliance with the License.
* You may obtain a copy of the License at * You may obtain a copy of the License at
* http://www.apache.org/licenses/LICENSE-2.0. * http://www.apache.org/licenses/LICENSE-2.0.
@ -14,7 +14,7 @@
* License for the specific language governing permissions and limitations * License for the specific language governing permissions and limitations
* under the License. * under the License.
* *
* Open MCT includes source code licensed under additional open source * Open MCT Web includes source code licensed under additional open source
* licenses. See the Open Source Licenses file (LICENSES.md) included with * licenses. See the Open Source Licenses file (LICENSES.md) included with
* this source code distribution or the Licensing information page available * this source code distribution or the Licensing information page available
* at runtime from the About dialog for additional information. * at runtime from the About dialog for additional information.

View File

@ -1,9 +1,9 @@
/***************************************************************************** /*****************************************************************************
* Open MCT, Copyright (c) 2014-2017, United States Government * Open MCT Web, Copyright (c) 2014-2015, United States Government
* as represented by the Administrator of the National Aeronautics and Space * as represented by the Administrator of the National Aeronautics and Space
* Administration. All rights reserved. * Administration. All rights reserved.
* *
* Open MCT is licensed under the Apache License, Version 2.0 (the * Open MCT Web is licensed under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance with the License. * "License"); you may not use this file except in compliance with the License.
* You may obtain a copy of the License at * You may obtain a copy of the License at
* http://www.apache.org/licenses/LICENSE-2.0. * http://www.apache.org/licenses/LICENSE-2.0.
@ -14,7 +14,7 @@
* License for the specific language governing permissions and limitations * License for the specific language governing permissions and limitations
* under the License. * under the License.
* *
* Open MCT includes source code licensed under additional open source * Open MCT Web includes source code licensed under additional open source
* licenses. See the Open Source Licenses file (LICENSES.md) included with * licenses. See the Open Source Licenses file (LICENSES.md) included with
* this source code distribution or the Licensing information page available * this source code distribution or the Licensing information page available
* at runtime from the About dialog for additional information. * at runtime from the About dialog for additional information.
@ -44,4 +44,4 @@ define(
return ExamplePolicy; return ExamplePolicy;
} }
); );

View File

@ -1,9 +1,9 @@
/***************************************************************************** /*****************************************************************************
* Open MCT, Copyright (c) 2014-2017, United States Government * Open MCT Web, Copyright (c) 2014-2015, United States Government
* as represented by the Administrator of the National Aeronautics and Space * as represented by the Administrator of the National Aeronautics and Space
* Administration. All rights reserved. * Administration. All rights reserved.
* *
* Open MCT is licensed under the Apache License, Version 2.0 (the * Open MCT Web is licensed under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance with the License. * "License"); you may not use this file except in compliance with the License.
* You may obtain a copy of the License at * You may obtain a copy of the License at
* http://www.apache.org/licenses/LICENSE-2.0. * http://www.apache.org/licenses/LICENSE-2.0.
@ -14,7 +14,7 @@
* License for the specific language governing permissions and limitations * License for the specific language governing permissions and limitations
* under the License. * under the License.
* *
* Open MCT includes source code licensed under additional open source * Open MCT Web includes source code licensed under additional open source
* licenses. See the Open Source Licenses file (LICENSES.md) included with * licenses. See the Open Source Licenses file (LICENSES.md) included with
* this source code distribution or the Licensing information page available * this source code distribution or the Licensing information page available
* at runtime from the About dialog for additional information. * at runtime from the About dialog for additional information.

View File

@ -1,9 +1,9 @@
/***************************************************************************** /*****************************************************************************
* Open MCT, Copyright (c) 2014-2017, United States Government * Open MCT Web, Copyright (c) 2014-2015, United States Government
* as represented by the Administrator of the National Aeronautics and Space * as represented by the Administrator of the National Aeronautics and Space
* Administration. All rights reserved. * Administration. All rights reserved.
* *
* Open MCT is licensed under the Apache License, Version 2.0 (the * Open MCT Web is licensed under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance with the License. * "License"); you may not use this file except in compliance with the License.
* You may obtain a copy of the License at * You may obtain a copy of the License at
* http://www.apache.org/licenses/LICENSE-2.0. * http://www.apache.org/licenses/LICENSE-2.0.
@ -14,7 +14,7 @@
* License for the specific language governing permissions and limitations * License for the specific language governing permissions and limitations
* under the License. * under the License.
* *
* Open MCT includes source code licensed under additional open source * Open MCT Web includes source code licensed under additional open source
* licenses. See the Open Source Licenses file (LICENSES.md) included with * licenses. See the Open Source Licenses file (LICENSES.md) included with
* this source code distribution or the Licensing information page available * this source code distribution or the Licensing information page available
* at runtime from the About dialog for additional information. * at runtime from the About dialog for additional information.
@ -59,14 +59,11 @@ define(
update(); update();
return { return {
/** getGlyph: function () {
* Get the CSS class that defines the icon return ".";
* to display in this indicator. This will appear },
* as a dataflow icon. getGlyphClass: function () {
* @returns {string} the cssClass of the dataflow icon return undefined;
*/
getCssClass: function () {
return "icon-connectivity";
}, },
getText: function () { getText: function () {
return displayed + " digests/sec"; return displayed + " digests/sec";

View File

@ -1,9 +1,9 @@
/***************************************************************************** /*****************************************************************************
* Open MCT, Copyright (c) 2014-2017, United States Government * Open MCT Web, Copyright (c) 2014-2015, United States Government
* as represented by the Administrator of the National Aeronautics and Space * as represented by the Administrator of the National Aeronautics and Space
* Administration. All rights reserved. * Administration. All rights reserved.
* *
* Open MCT is licensed under the Apache License, Version 2.0 (the * Open MCT Web is licensed under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance with the License. * "License"); you may not use this file except in compliance with the License.
* You may obtain a copy of the License at * You may obtain a copy of the License at
* http://www.apache.org/licenses/LICENSE-2.0. * http://www.apache.org/licenses/LICENSE-2.0.
@ -14,7 +14,7 @@
* License for the specific language governing permissions and limitations * License for the specific language governing permissions and limitations
* under the License. * under the License.
* *
* Open MCT includes source code licensed under additional open source * Open MCT Web includes source code licensed under additional open source
* licenses. See the Open Source Licenses file (LICENSES.md) included with * licenses. See the Open Source Licenses file (LICENSES.md) included with
* this source code distribution or the Licensing information page available * this source code distribution or the Licensing information page available
* at runtime from the About dialog for additional information. * at runtime from the About dialog for additional information.
@ -55,13 +55,24 @@ define(
return { return {
/** /**
* Get the CSS class (single character used as an icon) * Get the glyph (single character used as an icon)
* to display in this indicator. This will return ".", * to display in this indicator. This will return ".",
* which should appear as a database icon. * which should appear as a dataflow icon.
* @returns {string} the character of the database icon * @returns {string} the character of the database icon
*/ */
getCssClass: function () { getGlyph: function () {
return "icon-database"; return "E";
},
/**
* Get the name of the CSS class to apply to the glyph.
* This is used to color the glyph to match its
* state (one of ok, caution or err)
* @returns {string} the CSS class to apply to this glyph
*/
getGlyphClass: function () {
return (watches > 2000) ? "caution" :
(watches < 1000) ? "ok" :
undefined;
}, },
/** /**
* Get the text that should appear in the indicator. * Get the text that should appear in the indicator.
@ -84,4 +95,4 @@ define(
return WatchIndicator; return WatchIndicator;
} }
); );

View File

@ -1,9 +1,9 @@
/***************************************************************************** /*****************************************************************************
* Open MCT, Copyright (c) 2014-2017, United States Government * Open MCT Web, Copyright (c) 2014-2015, United States Government
* as represented by the Administrator of the National Aeronautics and Space * as represented by the Administrator of the National Aeronautics and Space
* Administration. All rights reserved. * Administration. All rights reserved.
* *
* Open MCT is licensed under the Apache License, Version 2.0 (the * Open MCT Web is licensed under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance with the License. * "License"); you may not use this file except in compliance with the License.
* You may obtain a copy of the License at * You may obtain a copy of the License at
* http://www.apache.org/licenses/LICENSE-2.0. * http://www.apache.org/licenses/LICENSE-2.0.
@ -14,7 +14,7 @@
* License for the specific language governing permissions and limitations * License for the specific language governing permissions and limitations
* under the License. * under the License.
* *
* Open MCT includes source code licensed under additional open source * Open MCT Web includes source code licensed under additional open source
* licenses. See the Open Source Licenses file (LICENSES.md) included with * licenses. See the Open Source Licenses file (LICENSES.md) included with
* this source code distribution or the Licensing information page available * this source code distribution or the Licensing information page available
* at runtime from the About dialog for additional information. * at runtime from the About dialog for additional information.
@ -33,11 +33,6 @@ define([
legacyRegistry.register("example/scratchpad", { legacyRegistry.register("example/scratchpad", {
"extensions": { "extensions": {
"roots": [ "roots": [
{
"id": "scratch:root"
}
],
"models": [
{ {
"id": "scratch:root", "id": "scratch:root",
"model": { "model": {

View File

@ -1,9 +1,9 @@
/***************************************************************************** /*****************************************************************************
* Open MCT, Copyright (c) 2014-2017, United States Government * Open MCT Web, Copyright (c) 2014-2015, United States Government
* as represented by the Administrator of the National Aeronautics and Space * as represented by the Administrator of the National Aeronautics and Space
* Administration. All rights reserved. * Administration. All rights reserved.
* *
* Open MCT is licensed under the Apache License, Version 2.0 (the * Open MCT Web is licensed under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance with the License. * "License"); you may not use this file except in compliance with the License.
* You may obtain a copy of the License at * You may obtain a copy of the License at
* http://www.apache.org/licenses/LICENSE-2.0. * http://www.apache.org/licenses/LICENSE-2.0.
@ -14,7 +14,7 @@
* License for the specific language governing permissions and limitations * License for the specific language governing permissions and limitations
* under the License. * under the License.
* *
* Open MCT includes source code licensed under additional open source * Open MCT Web includes source code licensed under additional open source
* licenses. See the Open Source Licenses file (LICENSES.md) included with * licenses. See the Open Source Licenses file (LICENSES.md) included with
* this source code distribution or the Licensing information page available * this source code distribution or the Licensing information page available
* at runtime from the About dialog for additional information. * at runtime from the About dialog for additional information.

Some files were not shown because too many files have changed in this diff Show More