[Time] Always include basic formats

Always include basic formats; removing them from the utc format
bundle.  This way, they can be utilized by third parties without
them having to commit to the utc time system.

Fixes https://github.com/nasa/openmct/issues/1574
This commit is contained in:
Pete Richards 2017-05-10 17:41:25 -07:00
parent 6481ddbd7f
commit 88223f5e6d
5 changed files with 25 additions and 16 deletions

View File

@ -22,15 +22,19 @@
define([ define([
"./src/FormatProvider", "./src/FormatProvider",
"./src/UTCTimeFormat",
"./src/DurationFormat",
'legacyRegistry' 'legacyRegistry'
], function ( ], function (
FormatProvider, FormatProvider,
UTCTimeFormat,
DurationFormat,
legacyRegistry legacyRegistry
) { ) {
legacyRegistry.register("platform/commonUI/formats", { legacyRegistry.register("platform/commonUI/formats", {
"name": "Time services bundle", "name": "Format Registry",
"description": "Defines interfaces and provides default implementations for handling different time systems.", "description": "Provides a registry for formats, which allow parsing and formatting of values.",
"extensions": { "extensions": {
"components": [ "components": [
{ {
@ -42,6 +46,22 @@ define([
] ]
} }
], ],
"formats": [
{
"key": "utc",
"implementation": UTCTimeFormat
},
{
"key": "duration",
"implementation": DurationFormat
}
],
"constants": [
{
"key": "DEFAULT_TIME_FORMAT",
"value": "utc"
}
],
"licenses": [ "licenses": [
{ {
"name": "d3", "name": "d3",

View File

@ -21,7 +21,7 @@
*****************************************************************************/ *****************************************************************************/
define([ define([
"./UTCTimeFormat", "../src/UTCTimeFormat",
"moment" "moment"
], function ( ], function (
UTCTimeFormat, UTCTimeFormat,

View File

@ -22,14 +22,10 @@
define([ define([
"./UTCTimeSystem", "./UTCTimeSystem",
"./LocalClock", "./LocalClock"
"./UTCTimeFormat",
"./DurationFormat"
], function ( ], function (
UTCTimeSystem, UTCTimeSystem,
LocalClock, LocalClock
UTCTimeFormat,
DurationFormat
) { ) {
/** /**
* Install a time system that supports UTC times. It also installs a local * Install a time system that supports UTC times. It also installs a local
@ -40,13 +36,6 @@ define([
var timeSystem = new UTCTimeSystem(); var timeSystem = new UTCTimeSystem();
openmct.time.addTimeSystem(timeSystem); openmct.time.addTimeSystem(timeSystem);
openmct.time.addClock(new LocalClock(100)); openmct.time.addClock(new LocalClock(100));
openmct.telemetry.addFormat(new UTCTimeFormat());
openmct.telemetry.addFormat(new DurationFormat());
openmct.legacyExtension("constants", {
"key": "DEFAULT_TIME_FORMAT",
"value": "utc"
});
}; };
}; };
}); });