Description

The Partitioned Data Storage component models an onboard mass storage device for spacecraft data recording. It organizes data into named partitions for logical separation of stored content, such as telemetry logs, science data, or command sequences. The storage enforces capacity limits across all partitions and returns pointer references for subsequent read and delete operations. An optional thermal model can block writes when the device overheats.


Example Use Cases

  • Telemetry Recording: Store housekeeping data in a dedicated partition for later downlink.
  • Science Data Capture: Buffer instrument payloads in separate partitions organized by sensor or observation.
  • Command Storage: Maintain onboard command sequences or flight software updates.

Module Implementation

Storage Organization

Data is organized into partitions, each identified by a case-insensitive name. When data is written to a partition that does not exist, the partition is created automatically. All partitions share a common capacity pool:

where is the total storage capacity and is the sum of bytes currently stored across all partitions.

A write operation succeeds only when the data size does not exceed the available capacity:

Data Encoding

The storage accepts multiple data formats, all of which are serialized to byte arrays for storage:

MethodInput Type
WriteBytesRaw byte array
WriteStringText string
WriteJSONJSON object
WriteMessageSimulation message

Each write returns a pointer containing the partition name, memory offset, and data size. This pointer is required for subsequent read or delete operations.

Thermal Protection

When a thermal model is attached and thermal protection is enabled, write operations are rejected if the storage is in an overtemperature state. This allows the device to cool before accepting additional I/O load. Read operations are not affected by thermal protection.


Assumptions/Limitations

  • All partitions share a single capacity pool; individual partition size limits are not enforced.
  • Data is stored in memory and does not model sector-level storage mechanics or fragmentation.
  • Partition names are case-insensitive; “Science” and “science” refer to the same partition.
  • Deleting a pointer frees the associated memory immediately; wear leveling and garbage collection are not modeled.
  • The storage does not persist across simulation save/load unless explicitly serialized by the parent system.