Skip to content

Commit

Permalink
Merge pull request #1733 from OpenC3/document
Browse files Browse the repository at this point in the history
Document interfaces, protocols, accessors
  • Loading branch information
ryanmelt authored Dec 8, 2024
2 parents 03470ca + 113eedb commit 8e7b172
Show file tree
Hide file tree
Showing 285 changed files with 4,206 additions and 3,880 deletions.
2 changes: 1 addition & 1 deletion docs.openc3.com/docs/configuration/_table.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
---
sidebar_position: 8
sidebar_position: 9
title: Tables
description: Table definition file format and keywords
---
Expand Down
2 changes: 1 addition & 1 deletion docs.openc3.com/docs/configuration/_telemetry-screens.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
---
sidebar_position: 9
sidebar_position: 10
title: Screens
description: Telemetry Viewer screen definition and widget documentation
sidebar_custom_props:
Expand Down
410 changes: 410 additions & 0 deletions docs.openc3.com/docs/configuration/accessors.md

Large diffs are not rendered by default.

18 changes: 15 additions & 3 deletions docs.openc3.com/docs/configuration/command.md
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,7 @@ If an item's bit offset overlaps another item, OpenC3 issues a warning. This key
#### KEY
<div class="right">(Since 5.0.10)</div>**Defines the key used to access this raw value in the packet.**

Keys are often JsonPath or XPath strings
Keys are often [JSONPath](https://en.wikipedia.org/wiki/JSONPath) or [XPath](https://en.wikipedia.org/wiki/XPath) strings

| Parameter | Description | Required |
|-----------|-------------|----------|
Expand Down Expand Up @@ -261,7 +261,7 @@ class TheGreatConversion(Conversion):
super().__init__()
self.multiplier = float(multiplier)
def call(self, value, packet, buffer):
return value * multiplier
return value * self.multiplier
```

#### POLY_WRITE_CONVERSION
Expand Down Expand Up @@ -572,7 +572,7 @@ Sending a hazardous command causes a dialog asking for confirmation before sendi
### ACCESSOR
<div class="right">(Since 5.0.10)</div>**Defines the class used to read and write raw values from the packet**

Defines the class that is used too read raw values from the packet. Defaults to BinaryAccessor. Provided accessors also include JsonAccessor, CborAccessor, HtmlAccessor, and XmlAccessor.
Defines the class that is used too read raw values from the packet. Defaults to BinaryAccessor. For more information see [Accessors](accessors).

| Parameter | Description | Required |
|-----------|-------------|----------|
Expand Down Expand Up @@ -660,6 +660,12 @@ Defined in custom_validator.rb:

require 'openc3/packets/command_validator'
class CustomValidator < OpenC3::CommandValidator
# Both the pre_check and post_check are passed the command packet that was sent
# You can inspect the command in your checks as follows:
# packet.target_name => target name
# packet.packet_name => packet name (command name)
# packet.read("ITEM") => converted value
# packet.read("ITEM", :RAW) => raw value
def pre_check(packet)
if tlm("TGT PKT ITEM") == 0
return [false, "TGT PKT ITEM is 0"]
Expand All @@ -681,6 +687,12 @@ VALIDATOR custom_validator.rb
Defined in custom_validator.py:

class CustomValidator(CommandValidator):
# Both the pre_check and post_check are passed the command packet that was sent
# You can inspect the command in your checks as follows:
# packet.target_name => target name
# packet.packet_name => packet name (command name)
# packet.read("ITEM") => converted value
# packet.read("ITEM", :RAW) => raw value
def pre_check(self, command):
if tlm("TGT PKT ITEM") == 0:
return [False, "TGT PKT ITEM is 0"]
Expand Down
348 changes: 283 additions & 65 deletions docs.openc3.com/docs/configuration/interfaces.md

Large diffs are not rendered by default.

62 changes: 56 additions & 6 deletions docs.openc3.com/docs/configuration/plugins.md
Original file line number Diff line number Diff line change
Expand Up @@ -231,14 +231,14 @@ ROUTER SERIAL_ROUTER tcpip_server_interface.rb 2950 2950 10.0 nil BURST
### SECRET
<div class="right">(Since 5.3.0)</div>**Define a secret needed by this interface**

Defines a secret for this interface and optionally assigns its value to an option
Defines a secret for this interface and optionally assigns its value to an option. For more information see [Admin Secrets](/docs/tools/admin#secrets).

| Parameter | Description | Required |
|-----------|-------------|----------|
| Type | ENV or FILE. ENV will mount the secret into an environment variable. FILE mounts the secret into a file. | True |
| Secret Name | The name of the secret to retrieve | True |
| Environment Variable or File Path | Environment variable name or file path to store secret | True |
| Option Name | Interface option to pass the secret value | False |
| Secret Name | The name of the secret to retrieve from the Admin / Secrets tab. For more information see [Admin Secrets](/docs/tools/admin#secrets). | True |
| Environment Variable or File Path | Environment variable name or file path to store secret. Note that if you use the Option Name to set an option to the secret value, this value doesn't really matter as long as it is unique. | True |
| Option Name | Interface option to pass the secret value. This is the primary way to pass secrets to interfaces. | False |
| Secret Store Name | Name of the secret store for stores with multipart keys | False |

Example Usage:
Expand Down Expand Up @@ -331,6 +331,20 @@ Example Usage:
ROUTE_PREFIX /interface
```

### SHARD
<div class="right">(Since 6.0.0)</div>**Operator shard to run target microservices on**

Operator Shard. Only used if running multiple operator containers typically in Kubernetes

| Parameter | Description | Required |
|-----------|-------------|----------|
| Shard | Shard number starting from 0 | False |

Example Usage:
```ruby
SHARD 0
```

## ROUTER
**Create router to receive commands and output telemetry packets from one or more interfaces**

Expand Down Expand Up @@ -535,6 +549,20 @@ Disable ERB processing for the entire target or a set of regular expressions ove
|-----------|-------------|----------|
| Regex | Regex to match against filenames. If match, then no ERB processing | False |

### SHARD
<div class="right">(Since 6.0.0)</div>**Operator shard to run target microservices on**

Operator Shard. Only used if running multiple operator containers typically in Kubernetes

| Parameter | Description | Required |
|-----------|-------------|----------|
| Shard | Shard number starting from 0 | False |

Example Usage:
```ruby
SHARD 0
```

## MICROSERVICE
**Defines a new microservice**

Expand Down Expand Up @@ -674,12 +702,12 @@ Container to execute and run the microservice in. Only used in COSMOS Enterprise
### SECRET
<div class="right">(Since 5.3.0)</div>**Define a secret needed by this microservice**

Defines a secret for this microservice
Defines a secret for this microservice. For more information see [Admin Secrets](/docs/tools/admin#secrets).

| Parameter | Description | Required |
|-----------|-------------|----------|
| Type | ENV or FILE. ENV will mount the secret into an environment variable. FILE mounts the secret into a file. | True |
| Secret Name | The name of the secret to retrieve | True |
| Secret Name | The name of the secret to retrieve from the Admin / Secrets tab. For more information see [Admin Secrets](/docs/tools/admin#secrets). | True |
| Environment Variable or File Path | Environment variable name or file path to store secret | True |
| Secret Store Name | Name of the secret store for stores with multipart keys | False |

Expand Down Expand Up @@ -713,6 +741,20 @@ Disable ERB processing for the entire microservice or a set of regular expressio
|-----------|-------------|----------|
| Regex | Regex to match against filenames. If match, then no ERB processing | False |

### SHARD
<div class="right">(Since 6.0.0)</div>**Operator shard to run target microservices on**

Operator Shard. Only used if running multiple operator containers typically in Kubernetes

| Parameter | Description | Required |
|-----------|-------------|----------|
| Shard | Shard number starting from 0 | False |

Example Usage:
```ruby
SHARD 0
```

## TOOL
**Define a tool**

Expand Down Expand Up @@ -803,6 +845,14 @@ Disable ERB processing for the entire tool or a set of regular expressions over
|-----------|-------------|----------|
| Regex | Regex to match against filenames. If match, then no ERB processing | False |

### IMPORT_MAP_ITEM
<div class="right">(Since 6.0.0)</div>**Add an item to the import map**

| Parameter | Description | Required |
|-----------|-------------|----------|
| key | Import Map Key | True |
| value | Import Map Value | True |

## WIDGET
**Define a custom widget**

Expand Down
Loading

0 comments on commit 8e7b172

Please sign in to comment.