From b57d356d1724275ca353b9df7afb87431ce83623 Mon Sep 17 00:00:00 2001 From: LorenzzoQM Date: Wed, 22 Nov 2023 11:15:19 -0700 Subject: [PATCH] Added description of setDataBuffer to .rst files and ReleaseNotes --- docs/source/Support/bskReleaseNotes.rst | 1 + .../_GeneralModuleFiles/dataStorageUnitBase.rst | 3 ++- .../storageUnit/partitionedStorageUnit.rst | 4 ++++ .../onboardDataHandling/storageUnit/simpleStorageUnit.rst | 4 ++++ 4 files changed, 11 insertions(+), 1 deletion(-) diff --git a/docs/source/Support/bskReleaseNotes.rst b/docs/source/Support/bskReleaseNotes.rst index 94ff382d86..d480d060c8 100644 --- a/docs/source/Support/bskReleaseNotes.rst +++ b/docs/source/Support/bskReleaseNotes.rst @@ -82,6 +82,7 @@ Version |release| use spherical harmonics and loads them from a file with a single command. Similarly, the methods ``usePolyhedralGravityModel`` and ``usePointMassGravityModel`` have been added. - Fixed examples and tests to run even when Basilisk is built with ``--vizInterface False``. +- Added a new method ``setDataBuffer()`` to :ref:`simpleStorageUnit` and :ref:`partitionedStorageUnit` to add or remove data from specified partitions. Version 2.2.0 (June 28, 2023) ----------------------------- diff --git a/src/simulation/onboardDataHandling/_GeneralModuleFiles/dataStorageUnitBase.rst b/src/simulation/onboardDataHandling/_GeneralModuleFiles/dataStorageUnitBase.rst index 0090ffd709..036f8cbdbe 100644 --- a/src/simulation/onboardDataHandling/_GeneralModuleFiles/dataStorageUnitBase.rst +++ b/src/simulation/onboardDataHandling/_GeneralModuleFiles/dataStorageUnitBase.rst @@ -2,10 +2,11 @@ Executive Summary ----------------- DataStorageUnitBase is a base class that is used generate a standard interface and list of features for modules that store simulated onboard data. This class is used by other modules as a parent class and cannot be instantiated by itself. All Basilisk data storage modules based on this DataStorageUnitBase inherit the following common properties: -1. Writes out a :ref:`DataStorageStatusMsgPayload` containing the sum of the current stored data (in bits), the storage capacity (bits), the current net data rate (in baud), an array of char array containing the names of the stored data (ex. Instrument 1, Instrument 2), and an array of doubles containing the stored data associated with each type (bits). +1. Writes out a :ref:`DataStorageStatusMsgPayload` containing the sum of the current stored data (in bits), the storage capacity (bits), the current net data rate (in baud), an array of char array containing the names of the stored data (ex. Instrument 1, Instrument 2), and an array of integers containing the stored data associated with each type (bits). 2. Allows for multiple :ref:`DataNodeUsageMsgPayload` corresponding to individual :ref:`dataNodeBase` instances to be subscribed to using the ``addDataNodeToModel(msg)`` method. 3. Iterates through attached :ref:`DataNodeUsageMsgPayload` instances, integrates the data for each data node, and adds it to its respective entry using ``integrateDataStatus()`` method, which may be overwritten in child classes. 4. Loops through the vector of storedData to sum the total amount of data contained within the storage unit. +5. Add or remove data from specified partitions using ``setDataBuffer()`` method. Core functionality is wrapped in the ``integrateDataStatus`` protected virtual void method, which computes the amount of data stored in a storage unit on a module basis. This base class automatically implements a partitioned storage unit (different data buffers for each device). See :ref:`simpleStorageUnit` for an example of how this functionality can be overwritten. diff --git a/src/simulation/onboardDataHandling/storageUnit/partitionedStorageUnit.rst b/src/simulation/onboardDataHandling/storageUnit/partitionedStorageUnit.rst index bc7761001b..24eb16c17a 100644 --- a/src/simulation/onboardDataHandling/storageUnit/partitionedStorageUnit.rst +++ b/src/simulation/onboardDataHandling/storageUnit/partitionedStorageUnit.rst @@ -40,4 +40,8 @@ Then, the names of the partitions need to be added to the storageUnit using:: storageUnit.addPartition("partitionName") +The ``setDataBuffer()`` method can be used to add or remove a given amount of data from specified partitions:: + + storageUnit.setDataBuffer(["partitionName","anotherPartitionName"], [1E4, -1E4]) # Given in bits + For more information on how to set up and use this module, see the simple data system example :ref:`scenarioDataDemo`. diff --git a/src/simulation/onboardDataHandling/storageUnit/simpleStorageUnit.rst b/src/simulation/onboardDataHandling/storageUnit/simpleStorageUnit.rst index 897c1f6db9..f149ac6f43 100644 --- a/src/simulation/onboardDataHandling/storageUnit/simpleStorageUnit.rst +++ b/src/simulation/onboardDataHandling/storageUnit/simpleStorageUnit.rst @@ -35,4 +35,8 @@ The next step is to attach one or more :ref:`DataNodeUsageMsgPayload` instances storageUnit.addDataNodeToModel(dataMsg) +The method ``setDataBuffer()`` can be used to add or remove a specific amount of data from the storage unit:: + + storageUnit.setDataBuffer(1E4) # Given in bits + For more information on how to set up and use this module, see the simple data system example :ref:`scenarioDataDemo`.