Skip to content

Commit

Permalink
rename project to oresat-configs
Browse files Browse the repository at this point in the history
  • Loading branch information
ryanpdx committed Oct 22, 2023
1 parent cac2d5f commit d36cf7c
Show file tree
Hide file tree
Showing 36 changed files with 50 additions and 36 deletions.
54 changes: 34 additions & 20 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,12 @@
# OreSat Object Dictionary Database
# OreSat Configs

A centeralize "database" for all OreSat card object dictionaries (OD) and
beacon definition for each OreSat mission.
Firmware/software configurations for OreSat missions.

Includes:

- A centeralize "database" for all OreSat card object dictionaries (OD)
- Beacon definition for each OreSat mission
- The C3 F-RAM data definition (object values to be saved to the F-RAM chip)

Having all the OD defined in one place makes it much easier to update
OD definitions without having to go to each repo to update each cards OD.
Expand All @@ -10,41 +15,50 @@ transfers.

## How This Works

- All object dictionaries for a specific OreSat mission are defined by YAMLs.
- A `standard_object.yaml` contains some CANopen standard objects that any
`*_common.yaml` file can flag to include.
- The `sw_common.yaml` defines all CANopen standard objects, common objects,
and common PDOs for all Octavo A8-based cards for a OreSat mission.
- The `fw_common.yaml` defines all CANopen standard objects, common objects,
and common PDOs for all STM32-based cards for a OreSat mission.
- All object dictionaries for a specific OreSat mission are defined by [YAML]
files.
- All the OD configs are in `oresat_configs/base/`
- All the beacon configs (`beacon.yaml`)are in their mission directories:
`oresat_configs/oresat<mission_num>/`
- All card specific configs are are named `<card_name>.yaml` format.
They contain all card specific objects and PDOs.
- **NOTE:** The cards YAML are simular to CANopen's `.eds` files; they are for
a device type, not a unique device on a CAN network.
- The `beacon.yaml` file defines the beacon definition as all the data is pulled
strait out the the C3 OD, which is mostly build from all other ODs.
- All the configs are passed to `gen_od_db()` that reads in all configs
cross reference so all OD definition of PDOs match.
- **NOTE:** The cards YAML are simular to CANopen's `.eds` files; they are
for a device type, not a unique device on a CAN network (if you add an
object to `solar.yaml`, all solar cards will have that object).
- The `sw_common.yaml` defines all CANopen standard objects, common objects,
and common PDOs for all Octavo A8-based cards.
- The `fw_common.yaml` defines all CANopen standard objects, common objects,
and common PDOs for all STM32-based cards.
- A `standard_object.yaml` contains some CANopen standard objects that any
`<card_name>.yaml` or `*_common.yaml` can flag to include.
- The `beacon.yaml` file defines the beacon definition as all the data is
pulled strait out the the C3's OD, which is mostly build from all other ODs.
- The `c3.yaml` file also defines what objects have their values periodically
saved to the C3's F-RAM chip.

## Updating a Config

After updating configs for card(s), run the unit tests to validate all the configs.
After updating configs for card(s), run the unit tests to validate all the
configs.

```bash
$ python3 -m unittest
```

If there are no errors, the configs are valid.

Build and install the new version of oresat-od-database to build/test/import with.
Build and install the new version of oresat-configs to build, test, and/or
import with.

Once the change have been tested with firmware/software, open a Pull
Request to this repo to get all changes into the next release.

## Build and Install Local Package

Just run the build_and_install.sh script.
Just run the `build_and_install.sh` script.

```bash
./build_and_install.sh
$ ./build_and_install.sh
```

[YAML]: https://en.wikipedia.org/wiki/YAML
4 changes: 2 additions & 2 deletions build_and_install.sh
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#!/bin/bash -e
# Quick script to locally rebuild and reinstall the oresat-od-db package
# Quick script to locally rebuild and reinstall the oresat-configs package

python3 -m pip uninstall oresat-od-database -y
python3 -m pip uninstall oresat-configs -y
rm -rf dist/ *.egg-info/
python3 -m build
python3 -m pip install dist/*.whl
File renamed without changes.
12 changes: 6 additions & 6 deletions oresat_od_db/__main__.py → oresat_configs/__main__.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
"""oresat_od_db main"""
"""oresat_configs main"""

import sys

Expand All @@ -16,10 +16,10 @@
}


def oresat_od_db():
"""oresat_od_db main."""
def oresat_configs():
"""oresat_configs main."""

print("oresat_od_db v" + __version__)
print("oresat_configs v" + __version__)
print("")

print("command : description")
Expand All @@ -30,7 +30,7 @@ def oresat_od_db():

if __name__ == "__main__":
if len(sys.argv) < 2:
oresat_od_db()
oresat_configs()
elif sys.argv[1] == GEN_DCF_PROG:
gen_dcf(sys.argv[2:])
elif sys.argv[1] == GEN_FW_FILES_PROG:
Expand All @@ -40,4 +40,4 @@ def oresat_od_db():
elif sys.argv[1] == SDO_TRANSFER_PROG:
sdo_transfer(sys.argv[2:])
else:
oresat_od_db()
oresat_configs()
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
8 changes: 4 additions & 4 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@ requires = ["setuptools"]
build-backend = "setuptools.build_meta"

[project]
name = "oresat-od-database"
description = "OreSat object dictionary database"
name = "oresat-configs"
description = "OreSat mission configurations"
readme = "README.md"
requires-python = ">=3.9"
license = {text = "GPL-3.0"}
Expand All @@ -23,14 +23,14 @@ dependencies = [
dynamic = ["version"]

[project.scripts]
oresat-od-db = "__main__:oresat_od_db"
oresat-configs = "__main__:oresat_configs"
oresat-gen-fw-files = "scripts.gen_fw_files:gen_fw_files"
oresat-gen-dcf = "scripts.gen_dcf:gen_dcf"
oresat-print-od = "scripts.print_od:print_od"
oresat-sdo-transfer = "scripts.sdo_transfer:sdo_transfer"

[tool.setuptools.dynamic]
version = {attr = "oresat_od_db.constants.__version__"}
version = {attr = "oresat_configs.constants.__version__"}

[tool.setuptools.packages.find]
exclude = ["docs*", "tests*"]
Expand Down
4 changes: 2 additions & 2 deletions tests/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@

import canopen

from oresat_od_db import NodeId, OreSatId
from oresat_od_db._yaml_to_od import OD_DATA_TYPE_SIZE, TPDO_COMM_START, TPDO_PARA_START
from oresat_configs import NodeId, OreSatId
from oresat_configs._yaml_to_od import OD_DATA_TYPE_SIZE, TPDO_COMM_START, TPDO_PARA_START


class TestConfig(unittest.TestCase):
Expand Down
2 changes: 1 addition & 1 deletion tests/test_oresat0.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
"""Unit tests for OreSat0 OD database."""

from oresat_od_db import BEACON_DEF_DB, FRAM_DEF_DB, OD_DB, OreSatId
from oresat_configs import BEACON_DEF_DB, FRAM_DEF_DB, OD_DB, OreSatId

from . import TestConfig

Expand Down
2 changes: 1 addition & 1 deletion tests/test_oresat0_5.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
"""Unit tests for OreSat0.5 OD database."""

from oresat_od_db import BEACON_DEF_DB, FRAM_DEF_DB, OD_DB, OreSatId
from oresat_configs import BEACON_DEF_DB, FRAM_DEF_DB, OD_DB, OreSatId

from . import TestConfig

Expand Down

0 comments on commit d36cf7c

Please sign in to comment.