[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
This commit is contained in:
Pete Richards 2017-05-10 17:47:14 -07:00
parent 88223f5e6d
commit a9067892f4

11
API.md
View File

@ -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