From a9067892f4da339c246546b37e675f50b75a1cb3 Mon Sep 17 00:00:00 2001 From: Pete Richards Date: Wed, 10 May 2017 17:47:14 -0700 Subject: [PATCH] [Docs] Update format docs Remove examples of format implementations. The docs stated incorrectly that UTCTimeFormat used the additional parameters for the format method when it did not actually use those parameters. With our current landscape of telemetry providers, parse can frequently be called on an already parsed value, so added documentation to highlight the importance of an idempotent parse method. Cleanup related to change of file locations in: https://github.com/nasa/openmct/issues/1574 --- API.md | 11 +---------- 1 file changed, 1 insertion(+), 10 deletions(-) diff --git a/API.md b/API.md index b6a84992fd..052f4257ea 100644 --- a/API.md +++ b/API.md @@ -435,8 +435,7 @@ They have a simple structure: * `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. It accepts one argument: - * `text`: A `string` representation of a telemetry value. + 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. @@ -460,14 +459,6 @@ openmct.telemetry.addFormat({ }); ``` -##### Examples of Formats in Use - -* The [NumberFormat](https://github.com/nasa/openmct/blob/time-api-redo/platform/features/conductor/core/src/ui/NumberFormat.js) - provides an example of a simple format available by default in OpenMCT. -* The [UTCTimeFormat](https://github.com/nasa/openmct/blob/master/src/plugins/utcTimeSystem/UTCTimeFormat.js) - is a more complex implementation of a format that uses the optional context - arguments in `format` to provide scale-appropriate values. - #### Telemetry Data A single telemetry point is considered a Datum, and is represented by a standard