mirror of
https://github.com/nasa/openmct.git
synced 2025-06-03 16:10:54 +00:00
[Time Conductor] Update formatService usages
...to remove checks for unknown formats.
This commit is contained in:
parent
a1d765f271
commit
cecc52f0a9
@ -26,9 +26,6 @@ define(
|
|||||||
function () {
|
function () {
|
||||||
'use strict';
|
'use strict';
|
||||||
|
|
||||||
var UNRECOGNIZED_FORMAT_ERROR =
|
|
||||||
"Unrecognized format for date-time field.";
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Controller to support the date-time entry field.
|
* Controller to support the date-time entry field.
|
||||||
*
|
*
|
||||||
@ -69,9 +66,6 @@ define(
|
|||||||
|
|
||||||
function setFormat(format) {
|
function setFormat(format) {
|
||||||
formatter = formatService.getFormat(format || defaultFormat);
|
formatter = formatService.getFormat(format || defaultFormat);
|
||||||
if (!formatter) {
|
|
||||||
throw new Error(UNRECOGNIZED_FORMAT_ERROR);
|
|
||||||
}
|
|
||||||
updateFromModel($scope.ngModel[$scope.field]);
|
updateFromModel($scope.ngModel[$scope.field]);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -26,9 +26,7 @@ define(
|
|||||||
function (moment) {
|
function (moment) {
|
||||||
"use strict";
|
"use strict";
|
||||||
|
|
||||||
var TICK_SPACING_PX = 150,
|
var TICK_SPACING_PX = 150;
|
||||||
UNRECOGNIZED_FORMAT_ERROR =
|
|
||||||
"Unrecognized format for time range control.";
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -221,11 +219,6 @@ define(
|
|||||||
|
|
||||||
function updateFormat(key) {
|
function updateFormat(key) {
|
||||||
formatter = formatService.getFormat(key || defaultFormat);
|
formatter = formatService.getFormat(key || defaultFormat);
|
||||||
|
|
||||||
if (!formatter) {
|
|
||||||
throw new Error(UNRECOGNIZED_FORMAT_ERROR);
|
|
||||||
}
|
|
||||||
|
|
||||||
updateViewForInnerSpanFromModel($scope.ngModel);
|
updateViewForInnerSpanFromModel($scope.ngModel);
|
||||||
updateTicks();
|
updateTicks();
|
||||||
}
|
}
|
||||||
|
@ -38,7 +38,7 @@
|
|||||||
{
|
{
|
||||||
"key": "telemetryFormatter",
|
"key": "telemetryFormatter",
|
||||||
"implementation": "TelemetryFormatter.js",
|
"implementation": "TelemetryFormatter.js",
|
||||||
"depends": [ "formatService", "DEFAULT_TIME_FORMAT", "$log" ]
|
"depends": [ "formatService", "DEFAULT_TIME_FORMAT" ]
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"key": "telemetrySubscriber",
|
"key": "telemetrySubscriber",
|
||||||
|
@ -40,12 +40,10 @@ define(
|
|||||||
* domain values
|
* domain values
|
||||||
* @param {string} defaultFormatKey the format to request when no
|
* @param {string} defaultFormatKey the format to request when no
|
||||||
* format has been otherwise specified
|
* format has been otherwise specified
|
||||||
* @param $log Angular's `$log`, to log warnings
|
|
||||||
*/
|
*/
|
||||||
function TelemetryFormatter(formatService, defaultFormatKey, $log) {
|
function TelemetryFormatter(formatService, defaultFormatKey) {
|
||||||
this.formatService = formatService;
|
this.formatService = formatService;
|
||||||
this.defaultFormat = formatService.getFormat(defaultFormatKey);
|
this.defaultFormat = formatService.getFormat(defaultFormatKey);
|
||||||
this.$log = $log;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -62,7 +60,7 @@ define(
|
|||||||
this.defaultFormat :
|
this.defaultFormat :
|
||||||
this.formatService.getFormat(key);
|
this.formatService.getFormat(key);
|
||||||
|
|
||||||
return isNaN(v) ? "" : formatter ? formatter.format(v) : String(v);
|
return isNaN(v) ? "" : formatter.format(v);
|
||||||
};
|
};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
Loading…
x
Reference in New Issue
Block a user