From a55185bed9b7b093fb5fc8b41bf54704ad94dcb2 Mon Sep 17 00:00:00 2001 From: Thomas Holder Date: Wed, 14 Jun 2023 21:39:47 -0400 Subject: [PATCH] Break up existing readme --- EosLib/format/README.md | 34 ++++++++++++++++++++++ EosLib/packet/README.md | 27 ++++++++++++++++++ README.md | 63 ++--------------------------------------- 3 files changed, 64 insertions(+), 60 deletions(-) create mode 100644 EosLib/format/README.md create mode 100644 EosLib/packet/README.md diff --git a/EosLib/format/README.md b/EosLib/format/README.md new file mode 100644 index 0000000..b54e92d --- /dev/null +++ b/EosLib/format/README.md @@ -0,0 +1,34 @@ +# EosLib Formats + +To avoid using strings in packet bodies, EosLib contains some pre-made data formats. Their contents are listed below. + +### `Position` Format + +| Field | Variable Type | Unit | +|----------------------|------------------|-----------------| +| GPS Time | datetime | datetime | +| Latitude | float | decimal degrees | +| Longitude | float | decimal degrees | +| Altitude | float | feet | +| Speed | float | miles/hour | +| Number of Satellites | int | number | +| Flight State | FlightState enum | N/A | + +The `FlightState` enum contains 5 possible states, `NOT_SET`, `UNKNOWN`, `ON_GROUND`, `ASCENT`, and `DESCENT`. Their +use should be self-explanatory. + +`Position` objects also automatically set a `valid` field when initialized or decoded. The logic is still pretty primitive, but it's a +good sanity check/first pass validity check. + +### `Telemetry` Format + +| Field | Variable Type | Unit | +|-------------|---------------|----------| +| Temperature | float | celsius | +| Pressure | float | mbar | +| Humidity | float | %RH | +| X-Rotation | float | degrees | +| Y-Rotation | float | degrees | +| Z-Rotation | float | degrees | + +Likewise to `Position` objects, `TelemetryData` objects automatically set a `valid` field when decoded. The current state it's in is quite surface level and will need a better system in the future. diff --git a/EosLib/packet/README.md b/EosLib/packet/README.md new file mode 100644 index 0000000..6dafe15 --- /dev/null +++ b/EosLib/packet/README.md @@ -0,0 +1,27 @@ +# EosLib Packet + +Each Packet is required to contain a `DataHeader`, which holds information about the source of the packet and +information about what the body contains. Any Packet can also include a `TransmitHeader`, which holds information +about the transmission of the packet, typically via radio. + +### `DataHeader` Contents + +| Field | Variable Type | Valid Range | Required? | +|----------------------|-------------------------|------------------------------|-----------| +| Packet Type | PacketType enum | Values in PacketType | Yes | +| Packet Sender | PacketDevice enum | Values in Device | Yes | +| Packet Priority | PacketPriority enum\*\* | Values in PacketPriority\*\* | Yes | +| Packet Destination | PacketDevice enum | Values in Device | No | +| Packet Generate Time | datetime | Any valid date | Yes\* | + +### `TransmitHeader` Contents + +| Field | Variable Type | Valid Range | Required? | +|------------------------|---------------|----------------|-----------| +| Packet Sequence Number | Int | 0-255 | Yes | +| Packet Timestamp | datetime | Any valid date | Yes\* | + +\* If no Timestamp is provided, a default value of `datetime.now()` is provided. + +\*\* Packet Priority can be any integer value between 0-255, but sensible defaults are provided via the PacketPriority +enum. Unless you have good reason to provide your own value, use on of the options given in the enum. diff --git a/README.md b/README.md index 24adc57..3d31623 100644 --- a/README.md +++ b/README.md @@ -12,68 +12,11 @@ It is best to install EosLib via the requirements.txt files provided with both E can be installed directly via pip with `pip install git+https://github.com/VIP-LES/EosLib@main#egg=EosLib`, but this introduces the possibility of version conflicts and should be a last resort. -## EosLib Packet Format +## Further Documentation -Each Packet is required to contain a `DataHeader`, which holds information about the source of the packet and -information about what the body contains. Any Packet can also include a `TransmitHeader`, which holds information -about the transmission of the packet, typically via radio. +To avoid this readme getting out of hand, there are separate readme files for the `packet` and `format` modules. +Real documentation is a work in progress. -### `DataHeader` Contents - -| Field | Variable Type | Valid Range | Required? | -|----------------------|-------------------------|------------------------------|-----------| -| Packet Type | PacketType enum | Values in PacketType | Yes | -| Packet Sender | PacketDevice enum | Values in Device | Yes | -| Packet Priority | PacketPriority enum\*\* | Values in PacketPriority\*\* | Yes | -| Packet Destination | PacketDevice enum | Values in Device | No | -| Packet Generate Time | datetime | Any valid date | Yes\* | - -### `TransmitHeader` Contents - -| Field | Variable Type | Valid Range | Required? | -|------------------------|---------------|----------------|-----------| -| Packet Sequence Number | Int | 0-255 | Yes | -| Packet Timestamp | datetime | Any valid date | Yes\* | - -\* If no Timestamp is provided, a default value of `datetime.now()` is provided. - -\*\* Packet Priority can be any integer value between 0-255, but sensible defaults are provided via the PacketPriority -enum. Unless you have good reason to provide your own value, use on of the options given in the enum. - -## EosLib Data Formats - -To avoid using strings in packet bodies, EosLib contains some pre-made data formats. Their contents are listed below. - -### `Position` Format - -| Field | Variable Type | Unit | -|----------------------|------------------|-----------------| -| GPS Time | datetime | datetime | -| Latitude | float | decimal degrees | -| Longitude | float | decimal degrees | -| Altitude | float | feet | -| Speed | float | miles/hour | -| Number of Satellites | int | number | -| Flight State | FlightState enum | N/A | - -The `FlightState` enum contains 5 possible states, `NOT_SET`, `UNKNOWN`, `ON_GROUND`, `ASCENT`, and `DESCENT`. Their -use should be self-explanatory. - -`Position` objects also automatically set a `valid` field when initialized or decoded. The logic is still pretty primitive, but it's a -good sanity check/first pass validity check. - -### `Telemetry` Format - -| Field | Variable Type | Unit | -|-------------|---------------|----------| -| Temperature | float | celsius | -| Pressure | float | mbar | -| Humidity | float | %RH | -| X-Rotation | float | degrees | -| Y-Rotation | float | degrees | -| Z-Rotation | float | degrees | - -Likewise to `Position` objects, `TelemetryData` objects automatically set a `valid` field when decoded. The current state it's in is quite surface level and will need a better system in the future. ## Using EosLib