Skip to content

Commit

Permalink
Restructure COSMOS plugin install script to force review/copy of temp…
Browse files Browse the repository at this point in the history
…lated plugin configuration
  • Loading branch information
Jbsco committed May 31, 2024
1 parent baca563 commit fb193ab
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 8 deletions.
7 changes: 3 additions & 4 deletions gnd/cosmos/install_cosmos_plugin.sh
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@ cosmos_plugin_dir=`realpath $cosmos_install_dir/openc3-cosmos-${adamant_assembly
# Get build directory:
adamant_assembly_name_short=(${adamant_assembly_name//_/ })
adamant_example_plugin_dir=`realpath ../../src/assembly/${adamant_assembly_name_short[0]}/build/cosmos/plugin`
adamant_example_template_dir=`realpath ../../src/assembly/${adamant_assembly_name_short[0]}/build/cosmos/template`
adamant_protocol_dir=`realpath ../../../adamant/gnd/cosmos`
# Copy all protocol files (plugins compile with only needed protocols):
cp -a $adamant_protocol_dir/*.rb $cosmos_plugin_dir/targets/${adamant_assembly_name^^}/lib/
Expand All @@ -44,9 +43,9 @@ else
echo "\"${adamant_assembly_name}_ccsds_cosmos_telemetry.txt\" does not exist, run \"redo cosmos_config\" from the Adamant assembly."
exit 1
fi
if [[ -f "$adamant_example_template_dir/${adamant_assembly_name}_ccsds_cosmos_plugin.txt" ]]; then
cp $adamant_example_template_dir/${adamant_assembly_name}_ccsds_cosmos_plugin.txt $cosmos_plugin_dir/plugin.txt
if [[ -f "$adamant_example_plugin_dir/${adamant_assembly_name}_ccsds_cosmos_plugin.txt" ]]; then
cp $adamant_example_plugin_dir/${adamant_assembly_name}_ccsds_cosmos_plugin.txt $cosmos_plugin_dir/plugin.txt
else
echo "\"${adamant_assembly_name}_ccsds_cosmos_plugin.txt\" does not exist, run \"redo cosmos_config\" from the Adamant assembly."
echo "\"${adamant_assembly_name}_ccsds_cosmos_plugin.txt\" does not exist, run \"redo cosmos_config\" from the Adamant assembly, review the template plugin file, and copy to the \"build/cosmos/plugin\" directory."
exit 1
fi
9 changes: 7 additions & 2 deletions src/assembly/linux/main/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -88,9 +88,14 @@ $ cd adamant_example/src/assembly/linux/main
$ redo cosmos_config
```

This generates the plugin configuration file and its respective command and telemetry configurations in the `adamant_example/src/assembly/linux/build/cosmos/plugin/` directory. The plugin configuration template file is located in the `adamant_example/src/assembly/linux/build/cosmos/template/` directory, and should be reviewed to ensure the interface and required protocols are correct. By default, this template applies settings specific to this example and should be modified for other configurations.
This generates the plugin configuration file and its respective command and telemetry configurations in the `adamant_example/src/assembly/linux/build/cosmos/plugin/` directory. The plugin configuration template file is located in the `adamant_example/src/assembly/linux/build/cosmos/template/` directory, and should be reviewed to ensure the interface and required protocols are correct, before copying to the plugin directory. By default, this template applies settings specific to this example and should be modified for other configurations. The helper script looks for this file in the plugin directory, so copy it to that location by running:

A helper script, which takes the relative path from the top level of the assembly to the COSMOS install directory as an argument, is provided to copy the plugin configuration files, and any custom protocols used by the configuration, to the correct directories. If the COSMOS and Adamant example project directories are adjacent, complete the configuration by running:
```
$ cd adamant_example/src/assembly/linux
$ cp build/cosmos/template/linux_example_ccsds_cosmos_plugin.txt build/cosmos/plugin
```

The helper script, which takes the relative path from the top level of the assembly to the COSMOS install directory as an argument, copies the plugin configuration files, and any custom protocols used by the configuration, to the correct directories. If the COSMOS and Adamant example project directories are adjacent, complete the configuration by running:

```
$ cd adamant_example/src/assembly/linux/main
Expand Down
11 changes: 9 additions & 2 deletions src/assembly/pico/main/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -180,7 +180,7 @@ $ cd adamant_example/src/assembly/pico/main
$ redo cosmos_config
```

This generates the plugin configuration file and its respective command and telemetry configurations in the `adamant_example/src/assembly/pico/build/cosmos/plugin/` directory. The plugin configuration template file is located in the `adamant_example/src/assembly/pico/build/cosmos/template/` directory, and should be reviewed to ensure the interface and required protocols are correct. By default, this template applies settings specific to the Linux example using TCP, and should be modified for the serial connection used by the Pico. The Adamant template includes a functional serial configuration in comments. Enable the serial configuration by commenting out the TCP configuration and uncommenting the serial configuration. This should resemble:
This generates the plugin configuration file and its respective command and telemetry configurations in the `adamant_example/src/assembly/pico/build/cosmos/plugin/` directory. The plugin configuration template file is located in the `adamant_example/src/assembly/pico/build/cosmos/template/` directory, and should be reviewed to ensure the interface and required protocols are correct, before copying to the plugin directory. By default, this template applies settings specific to the Linux example using TCP, and should be modified for the serial connection used by the Pico. The Adamant template includes a functional serial configuration in comments. Enable the serial configuration by commenting out the TCP configuration and uncommenting the serial configuration. This should resemble:

```
# COSMOS interface documentation is available at: https://docs.openc3.com/docs/configuration/interfaces
Expand Down Expand Up @@ -209,7 +209,14 @@ Interface <%= linux_example_target_name %>_INT serial_interface.rb <%= port_w %>
Protocol Write cmd_sync_checksum.rb <%= checksum_parameter_name %>
```

A helper script, which takes the relative path from the top level of the assembly to the COSMOS install directory as an argument, is provided to copy the plugin configuration files, and any custom protocols used by the configuration, to the correct directories. If the COSMOS and Adamant example project directories are adjacent, complete the configuration by running:
The helper script looks for this file in the plugin directory, so copy it to that location by running:

```
$ cd adamant_example/src/assembly/linux
$ cp build/cosmos/template/linux_example_ccsds_cosmos_plugin.txt build/cosmos/plugin
```

The helper script, which takes the relative path from the top level of the assembly to the COSMOS install directory as an argument, copies the plugin configuration files, and any custom protocols used by the configuration, to the correct directories. If the COSMOS and Adamant example project directories are adjacent, complete the configuration by running:

```
$ cd adamant_example/src/assembly/pico/main
Expand Down

0 comments on commit fb193ab

Please sign in to comment.