mirror of
https://github.com/nasa/openmct.git
synced 2025-06-17 22:58:14 +00:00
[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:
11
API.md
11
API.md
@ -435,8 +435,7 @@ They have a simple structure:
|
|||||||
* `count`: An __optional__ argument specifying the number of displayed
|
* `count`: An __optional__ argument specifying the number of displayed
|
||||||
values.
|
values.
|
||||||
* `parse`: A `function` that takes a `string` representation of a telemetry
|
* `parse`: A `function` that takes a `string` representation of a telemetry
|
||||||
value, and returns the value in its native type. It accepts one argument:
|
value, and returns the value in its native type. **Note** parse might receive an already-parsed value. This function should be idempotent.
|
||||||
* `text`: A `string` representation of a telemetry value.
|
|
||||||
* `validate`: A `function` that takes a `string` representation of a telemetry
|
* `validate`: A `function` that takes a `string` representation of a telemetry
|
||||||
value, and returns a `boolean` value indicating whether the provided string
|
value, and returns a `boolean` value indicating whether the provided string
|
||||||
can be parsed.
|
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
|
#### Telemetry Data
|
||||||
|
|
||||||
A single telemetry point is considered a Datum, and is represented by a standard
|
A single telemetry point is considered a Datum, and is represented by a standard
|
||||||
|
Reference in New Issue
Block a user