Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix string records for data products #2697

Merged
merged 132 commits into from
Apr 25, 2024
Merged
Show file tree
Hide file tree
Changes from 126 commits
Commits
Show all changes
132 commits
Select commit Hold shift + click to select a range
6de63cc
Revise Linux platform types
bocchino Dec 7, 2022
980a26f
Fix regression in test autocoder
bocchino Dec 8, 2022
91b6c01
Revise test autocoder
bocchino Dec 8, 2022
7504de2
Revise test autocoder
bocchino Dec 8, 2022
ecf4cb7
Fix integer type mismatch in ComQueue
bocchino Dec 8, 2022
253540d
Merge branch 'linux-platform' into devel
bocchino Dec 12, 2022
31e315d
Merge remote-tracking branch 'upstream/devel' into devel
bocchino Jan 3, 2023
f60e88e
Merge remote-tracking branch 'upstream/devel' into devel
bocchino Jan 25, 2023
2204a0c
Merge remote-tracking branch 'upstream/devel' into devel
bocchino Feb 7, 2023
8b41def
Merge remote-tracking branch 'upstream/devel' into devel
bocchino Feb 15, 2023
2bad0d6
Merge remote-tracking branch 'upstream/devel' into devel
bocchino Mar 3, 2023
fc0317e
Merge remote-tracking branch 'upstream/devel' into devel
bocchino Apr 3, 2023
66a8190
Merge remote-tracking branch 'upstream/devel' into devel
bocchino Apr 10, 2023
8e6412a
Merge branch 'nasa:devel' into devel
bocchino May 4, 2023
949a251
Merge remote-tracking branch 'upstream/devel' into devel
bocchino Jul 18, 2023
6fc15e9
Merge remote-tracking branch 'upstream/devel' into devel
bocchino Jul 18, 2023
e961a4d
Merge remote-tracking branch 'upstream/devel' into devel
bocchino Jul 26, 2023
b00486a
Merge remote-tracking branch 'upstream/devel' into devel
bocchino Aug 1, 2023
6f999de
Merge remote-tracking branch 'upstream/devel' into devel
bocchino Aug 9, 2023
08f7ee1
Merge remote-tracking branch 'upstream/devel' into devel
bocchino Sep 25, 2023
b2f54cf
Merge remote-tracking branch 'upstream/devel' into devel
bocchino Oct 9, 2023
6fcbc51
Merge remote-tracking branch 'upstream/devel' into devel
bocchino Oct 11, 2023
0d4cf3d
Merge remote-tracking branch 'upstream/devel' into devel
bocchino Oct 19, 2023
6514547
Merge remote-tracking branch 'upstream/devel' into devel
bocchino Nov 7, 2023
6f3ae9f
Merge remote-tracking branch 'upstream/devel' into devel
bocchino Nov 16, 2023
89c0e35
Merge remote-tracking branch 'upstream/devel' into devel
bocchino Nov 28, 2023
cdc83ea
Merge remote-tracking branch 'upstream/devel' into devel
bocchino Nov 29, 2023
4a46719
Merge remote-tracking branch 'upstream/devel' into devel
bocchino Dec 5, 2023
7acf774
Merge remote-tracking branch 'upstream/devel' into devel
bocchino Dec 14, 2023
ac20f12
Merge remote-tracking branch 'upstream/devel' into devel
bocchino Jan 2, 2024
50b543b
Merge remote-tracking branch 'upstream/devel' into devel
bocchino Jan 11, 2024
2bff088
Merge remote-tracking branch 'upstream/devel' into devel
bocchino Jan 19, 2024
29ef16e
Merge remote-tracking branch 'upstream/devel' into devel
bocchino Jan 25, 2024
51c3884
Merge remote-tracking branch 'upstream/devel' into devel
bocchino Feb 20, 2024
07d28a7
Merge remote-tracking branch 'upstream/devel' into devel
bocchino Feb 26, 2024
7e98d5b
Merge remote-tracking branch 'upstream/devel' into devel
bocchino Feb 28, 2024
411e09a
Merge remote-tracking branch 'upstream/devel' into devel
bocchino Mar 5, 2024
e864b01
Merge remote-tracking branch 'upstream/devel' into devel
bocchino Mar 7, 2024
7140d75
Merge remote-tracking branch 'upstream/devel' into devel
bocchino Mar 12, 2024
476ba08
Merge remote-tracking branch 'upstream/devel' into devel
bocchino Apr 8, 2024
8cb7700
Merge remote-tracking branch 'upstream/devel' into devel
bocchino Apr 9, 2024
4359574
Update fpp version
bocchino Apr 9, 2024
5f41b0c
Update fpp version
bocchino Apr 9, 2024
d8bf071
Revise DpWriter unit tests
bocchino Apr 9, 2024
b7d3a7d
Update fpp version
bocchino Apr 9, 2024
c3e0aa2
Update fpp version
bocchino Apr 10, 2024
9e04083
Revise DpTest
bocchino Apr 10, 2024
fb44afb
Reivse StringType; add ExternalString
bocchino Apr 10, 2024
eee3ec3
Merge branch 'fpp-issue-398-default-priority' into fpp-issue-392-stri…
bocchino Apr 10, 2024
b1fc19b
Revise dp test
bocchino Apr 10, 2024
800de25
Revise dp test; update fpp version
bocchino Apr 10, 2024
be54883
Revise dp test
bocchino Apr 10, 2024
c0d626a
Revise dp test
bocchino Apr 10, 2024
d4121f7
Revise dp test
bocchino Apr 10, 2024
2e3e2ef
Revise dp test
bocchino Apr 10, 2024
021e0fc
Revise dp test
bocchino Apr 11, 2024
29031f7
Revise dp test
bocchino Apr 11, 2024
03326c6
Revise dp test
bocchino Apr 11, 2024
ce90192
Revise dp test
bocchino Apr 11, 2024
4c66664
Revise dp test
bocchino Apr 11, 2024
864f15a
Merge remote-tracking branch 'upstream/devel' into fpp-issue-397-from…
bocchino Apr 11, 2024
4402937
Merge remote-tracking branch 'upstream/devel' into fpp-issue-398-defa…
bocchino Apr 11, 2024
ea00253
Merge branch 'fpp-issue-398-default-priority' into fpp-issues-397-398
bocchino Apr 11, 2024
738936f
Revise fpp version
bocchino Apr 11, 2024
3b98052
Update fpp version
bocchino Apr 11, 2024
457fc35
Merge branch 'fpp-v2.1.0a7' into fpp-issue-392-string-records
bocchino Apr 11, 2024
4ea55a6
Revise ExternalString
bocchino Apr 11, 2024
48ad464
Reformat Fw/Serializable.{hpp,cpp}
bocchino Apr 11, 2024
772cc57
Reformat StringType.{hpp,cpp}
bocchino Apr 11, 2024
8f26567
Revise StringBase
bocchino Apr 11, 2024
fff0ad6
Update fpp version
bocchino Apr 11, 2024
8f8efe0
Remove trailing space
bocchino Apr 12, 2024
e8586e6
Reformat code
bocchino Apr 12, 2024
c4b9b9a
Revise dp test
bocchino Apr 12, 2024
171781b
Reformat cpp and hpp files in Fw/Types
bocchino Apr 12, 2024
aafbd6e
Revise string types
bocchino Apr 12, 2024
94b3d32
Merge branch 'format-fw-types' into external-string
bocchino Apr 12, 2024
00fb983
Revise string types
bocchino Apr 12, 2024
4c2ad7c
Revise string types
bocchino Apr 12, 2024
e536e88
Remove EightyCharString
bocchino Apr 12, 2024
9eaec83
Revise CmdString
bocchino Apr 12, 2024
91e78f9
Revise LogString
bocchino Apr 12, 2024
24a9242
Revise PrmString
bocchino Apr 12, 2024
e078a59
Revise TextLogString
bocchino Apr 12, 2024
33d7c75
Revise Test/String
bocchino Apr 12, 2024
d3c59db
Revise TlmString
bocchino Apr 12, 2024
d5c4cb2
Revise InternalInterfaceString
bocchino Apr 12, 2024
480e9d3
Revise Os/QueueString
bocchino Apr 12, 2024
5b9a4de
Revise Os/TaskString
bocchino Apr 12, 2024
10dce0c
Add missing type qualifier
bocchino Apr 13, 2024
5fd6b34
Fix warning in String.hpp
bocchino Apr 13, 2024
058e402
Revise string types
bocchino Apr 13, 2024
a6d2b43
Remove stray character
bocchino Apr 13, 2024
ce0616a
Revise StringBase
bocchino Apr 13, 2024
028ac4b
Revise string types
bocchino Apr 13, 2024
4e7ab41
Revise String type
bocchino Apr 13, 2024
ac44ee8
Revise FileNameString
bocchino Apr 13, 2024
3e589a9
Revise string types
bocchino Apr 13, 2024
a215ab7
Add missing file
bocchino Apr 13, 2024
74a2c37
Revise InternalInterfaceString
bocchino Apr 13, 2024
883e8a9
Revise comment
bocchino Apr 13, 2024
9af1b1d
Revise TlmString
bocchino Apr 13, 2024
3628e98
Revise string types
bocchino Apr 13, 2024
6ab639a
Revise log strings
bocchino Apr 13, 2024
9fea2d7
Revise PrmString
bocchino Apr 13, 2024
1d74568
Revise Os string classes
bocchino Apr 13, 2024
ad5a348
Revise string types
bocchino Apr 13, 2024
84c7b54
Revise string types
bocchino Apr 13, 2024
77e1a3b
Revise os strings
bocchino Apr 13, 2024
fe5f6b9
Add test for ExternalString to TypesTest
bocchino Apr 13, 2024
a616fc2
Revise ExternalString
bocchino Apr 13, 2024
4db1eb0
Revise ExternalString
bocchino Apr 13, 2024
d3efd31
Update fpp version
bocchino Apr 13, 2024
85c29f7
Format Fw/Types
bocchino Apr 13, 2024
047d8b7
Merge branch 'format-fw-types' into fpp-issue-392-string-records
bocchino Apr 13, 2024
20a00c5
Merge branch 'external-string' into fpp-issue-392-string-records
bocchino Apr 13, 2024
9c575eb
Merge remote-tracking branch 'upstream/devel' into external-string
bocchino Apr 15, 2024
1c466ba
Merge branch 'external-string' into fpp-issue-392-string-records
bocchino Apr 17, 2024
0989621
Merge remote-tracking branch 'upstream/devel' into fpp-issue-392-stri…
bocchino Apr 18, 2024
094a341
Update fpp version
bocchino Apr 18, 2024
858815a
Revise code formatting
bocchino Apr 18, 2024
db35f81
Merge remote-tracking branch 'upstream/devel' into external-string
bocchino Apr 18, 2024
77c0bc9
Merge branch 'external-string' into fpp-issue-392-string-records
bocchino Apr 18, 2024
36bbe22
Remove helper scripts
bocchino Apr 18, 2024
a7173b4
Update fpp version
bocchino Apr 23, 2024
10fb88a
Fix spelling
bocchino Apr 23, 2024
7533fa5
Update requirements
bocchino Apr 23, 2024
a9a19e7
Update actions@version
thomas-bc Apr 23, 2024
40b2bb2
Fix pip-check CI by restricting versions
thomas-bc Apr 23, 2024
b2a7783
Remove debugging instructions
thomas-bc Apr 23, 2024
a6356b6
Merge pull request #15 from thomas-bc/pr/bocchino/2697
bocchino Apr 23, 2024
0ea60c3
Merge branch 'devel' into fpp-issue-392-string-records
LeStarch Apr 25, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
53 changes: 46 additions & 7 deletions FppTest/dp/DpTest.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -15,19 +15,25 @@ namespace FppTest {
// Construction, initialization, and destruction
// ----------------------------------------------------------------------

DpTest ::DpTest(const char* const compName,
U32 u32RecordData,
U16 dataRecordData,
const U8ArrayRecordData& u8ArrayRecordData,
const U32ArrayRecordData& u32ArrayRecordData,
const DataArrayRecordData& dataArrayRecordData)
DpTest::DpTest(const char* const compName,
U32 u32RecordData,
U16 dataRecordData,
const U8ArrayRecordData& u8ArrayRecordData,
const U32ArrayRecordData& u32ArrayRecordData,
const DataArrayRecordData& dataArrayRecordData,
const Fw::StringBase& a_stringRecordData)
: DpTestComponentBase(compName),
u32RecordData(u32RecordData),
dataRecordData(dataRecordData),
u8ArrayRecordData(u8ArrayRecordData),
u32ArrayRecordData(u32ArrayRecordData),
dataArrayRecordData(dataArrayRecordData),
sendTime(Fw::ZERO_TIME) {}
stringRecordData(a_stringRecordData),
sendTime(Fw::ZERO_TIME) {
for (auto& elt : this->stringArrayRecordData) {
elt = &a_stringRecordData;
}
}

void DpTest ::init(const NATIVE_INT_TYPE queueDepth, const NATIVE_INT_TYPE instance) {
DpTestComponentBase::init(queueDepth, instance);
Expand All @@ -50,6 +56,8 @@ void DpTest::schedIn_handler(const NATIVE_INT_TYPE portNum, U32 context) {
this->dpRequest_Container4(CONTAINER_4_DATA_SIZE);
// Request a buffer for Container 5
this->dpRequest_Container5(CONTAINER_5_DATA_SIZE);
// Request a buffer for Container 6
this->dpRequest_Container6(CONTAINER_6_DATA_SIZE);
// Get a buffer for Container 1
{
DpContainer container;
Expand Down Expand Up @@ -178,6 +186,37 @@ void DpTest ::dpRecv_Container5_handler(DpContainer& container, Fw::Success::T s
}
}

void DpTest ::dpRecv_Container6_handler(DpContainer& container, Fw::Success::T status) {
if (status == Fw::Success::SUCCESS) {
auto serializeStatus = Fw::FW_SERIALIZE_OK;
for (FwSizeType i = 0; i < CONTAINER_6_DATA_SIZE; ++i) {
serializeStatus = container.serializeRecord_StringRecord(this->stringRecordData);
if (serializeStatus == Fw::FW_SERIALIZE_NO_ROOM_LEFT) {
break;
}
FW_ASSERT(serializeStatus == Fw::FW_SERIALIZE_OK, status);
}
// Use the time stamp from the time get port
this->dpSend(container);
}
}

void DpTest ::dpRecv_Container7_handler(DpContainer& container, Fw::Success::T status) {
if (status == Fw::Success::SUCCESS) {
auto serializeStatus = Fw::FW_SERIALIZE_OK;
for (FwSizeType i = 0; i < CONTAINER_7_DATA_SIZE; ++i) {
serializeStatus = container.serializeRecord_StringArrayRecord(
this->stringArrayRecordData, FW_NUM_ARRAY_ELEMENTS(this->stringArrayRecordData));
if (serializeStatus == Fw::FW_SERIALIZE_NO_ROOM_LEFT) {
break;
}
FW_ASSERT(serializeStatus == Fw::FW_SERIALIZE_OK, status);
}
// Use the time stamp from the time get port
this->dpSend(container);
}
}

// ----------------------------------------------------------------------
// Private helper functions
// ----------------------------------------------------------------------
Expand Down
18 changes: 18 additions & 0 deletions FppTest/dp/DpTest.fpp
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,12 @@ module FppTest {
@ A component for testing data product code gen
active component DpTest {

# ----------------------------------------------------------------------
# Constants
# ----------------------------------------------------------------------

constant stringSize = 80

# ----------------------------------------------------------------------
# Types
# ----------------------------------------------------------------------
Expand Down Expand Up @@ -58,6 +64,12 @@ module FppTest {
@ Record 5
product record DataArrayRecord: Data array id 500

@ Record 6
product record StringRecord: string size stringSize id 600

@ Record 7
product record StringArrayRecord: string size stringSize array id 700

# ----------------------------------------------------------------------
# Containers
# ----------------------------------------------------------------------
Expand All @@ -77,6 +89,12 @@ module FppTest {
@ Container 5
product container Container5 id 500 default priority 50

@ Container 6
product container Container6 id 600 default priority 60

@ Container 7
product container Container7 id 700 default priority 70

}

}
126 changes: 77 additions & 49 deletions FppTest/dp/DpTest.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,15 @@
#include <array>

#include "FppTest/dp/DpTestComponentAc.hpp"
#include "Fw/Types/String.hpp"

namespace FppTest {

class DpTest : public DpTestComponentBase {

// Friend class for testing
friend class Tester;

public:
// ----------------------------------------------------------------------
// Constants
Expand All @@ -29,6 +34,12 @@ class DpTest : public DpTestComponentBase {
static constexpr FwSizeType CONTAINER_4_PACKET_SIZE = DpContainer::getPacketSizeForDataSize(CONTAINER_4_DATA_SIZE);
static constexpr FwSizeType CONTAINER_5_DATA_SIZE = 1000;
static constexpr FwSizeType CONTAINER_5_PACKET_SIZE = DpContainer::getPacketSizeForDataSize(CONTAINER_5_DATA_SIZE);
static constexpr FwSizeType CONTAINER_6_DATA_SIZE = 1000;
static constexpr FwSizeType CONTAINER_6_PACKET_SIZE = DpContainer::getPacketSizeForDataSize(CONTAINER_6_DATA_SIZE);
static constexpr FwSizeType CONTAINER_7_DATA_SIZE = 1000;
static constexpr FwSizeType CONTAINER_7_PACKET_SIZE = DpContainer::getPacketSizeForDataSize(CONTAINER_7_DATA_SIZE);

static constexpr FwSizeType STRING_ARRAY_RECORD_ARRAY_SIZE = 100;

public:
// ----------------------------------------------------------------------
Expand All @@ -38,19 +49,21 @@ class DpTest : public DpTestComponentBase {
using U8ArrayRecordData = std::array<U8, 256>;
using U32ArrayRecordData = std::array<U32, 100>;
using DataArrayRecordData = std::array<DpTest_Data, 300>;
using PtrToConstStringBase = const Fw::StringBase*;

public:
// ----------------------------------------------------------------------
// Construction, initialization, and destruction
// ----------------------------------------------------------------------

//! Construct object DpTest
DpTest(const char* const compName, //!< The component name
U32 u32RecordData, //!< The U32Record data
U16 dataRecordData, //!< The DataRecord data
const U8ArrayRecordData& u8ArrayRecordData, //!< The U8ArrayRecord data
const U32ArrayRecordData& u32ArrayRecordData, //!< The U32ArrayRecord data
const DataArrayRecordData& dataArrayRecordData //!< The DataArrayRecord data
DpTest(const char* const compName, //!< The component name
U32 u32RecordData, //!< The U32Record data
U16 dataRecordData, //!< The DataRecord data
const U8ArrayRecordData& u8ArrayRecordData, //!< The U8ArrayRecord data
const U32ArrayRecordData& u32ArrayRecordData, //!< The U32ArrayRecord data
const DataArrayRecordData& dataArrayRecordData, //!< The DataArrayRecord data
const Fw::StringBase& stringRecordData //!< The StringRecord data
);

//! Initialize object DpTest
Expand All @@ -69,73 +82,82 @@ class DpTest : public DpTestComponentBase {
//! Set the send time
void setSendTime(Fw::Time time) { this->sendTime = time; }

PRIVATE :
// ----------------------------------------------------------------------
// Handler implementations for user-defined typed input ports
// ----------------------------------------------------------------------

//! Handler implementation for schedIn
void
schedIn_handler(const NATIVE_INT_TYPE portNum, //!< The port number
U32 context //!< The call order
) override;

PRIVATE :
// ----------------------------------------------------------------------
// Data product handler implementations
// ----------------------------------------------------------------------

//! Receive a data product container of type Container1
//! \return Serialize status
void
dpRecv_Container1_handler(DpContainer& container, //!< The container
Fw::Success::T //!< The container status
) override;
private:
// ----------------------------------------------------------------------
// Handler implementations for user-defined typed input ports
// ----------------------------------------------------------------------

//! Handler implementation for schedIn
void schedIn_handler(const NATIVE_INT_TYPE portNum, //!< The port number
U32 context //!< The call order
) final;

private:
// ----------------------------------------------------------------------
// Data product handler implementations
// ----------------------------------------------------------------------

//! Receive a data product container of type Container1
//! \return Serialize status
void dpRecv_Container1_handler(DpContainer& container, //!< The container
Fw::Success::T //!< The container status
) final;

//! Receive a data product container of type Container2
//! \return Serialize status
void dpRecv_Container2_handler(DpContainer& container, //!< The container
Fw::Success::T //!< The container status
) override;
) final;

//! Receive a data product container of type Container3
//! \return Serialize status
void dpRecv_Container3_handler(DpContainer& container, //!< The container
Fw::Success::T //!< The container status
) override;
) final;

//! Receive a data product container of type Container4
//! \return Serialize status
void dpRecv_Container4_handler(DpContainer& container, //!< The container
Fw::Success::T //!< The container status
) override;
) final;

//! Receive a data product container of type Container5
//! \return Serialize status
void dpRecv_Container5_handler(DpContainer& container, //!< The container
Fw::Success::T //!< The container status
) override;
) final;

PRIVATE :
// ----------------------------------------------------------------------
// Private helper functions
// ----------------------------------------------------------------------
//! Receive a data product container of type Container6
//! \return Serialize status
void dpRecv_Container6_handler(DpContainer& container, //!< The container
Fw::Success::T //!< The container status
) final;

//! Receive a data product container of type Container7
//! \return Serialize status
void dpRecv_Container7_handler(DpContainer& container, //!< The container
Fw::Success::T //!< The container status
) final;

private:
// ----------------------------------------------------------------------
// Private helper functions
// ----------------------------------------------------------------------

//! Check a container for validity
void
checkContainer(const DpContainer& container, //!< The container
FwDpIdType localId, //!< The expected local id
FwSizeType size, //!< The expected size
FwDpPriorityType priority //!< The expected priority
) const;
//! Check a container for validity
void checkContainer(const DpContainer& container, //!< The container
FwDpIdType localId, //!< The expected local id
FwSizeType size, //!< The expected size
FwDpPriorityType priority //!< The expected priority
) const;

PRIVATE :
// ----------------------------------------------------------------------
// Private member variables
// ----------------------------------------------------------------------
private:
// ----------------------------------------------------------------------
// Private member variables
// ----------------------------------------------------------------------

//! U32Record data
const U32 u32RecordData;
//! U32Record data
const U32 u32RecordData;

//! DataRecord data
const U16 dataRecordData;
Expand All @@ -149,6 +171,12 @@ class DpTest : public DpTestComponentBase {
//! DataArrayRecord data
const DataArrayRecordData& dataArrayRecordData;

//! StringRecord data
const Fw::StringBase& stringRecordData;

//! StringArrayRecord data
PtrToConstStringBase stringArrayRecordData[STRING_ARRAY_RECORD_ARRAY_SIZE];

//! Send time for testing
Fw::Time sendTime;
};
Expand Down
24 changes: 24 additions & 0 deletions FppTest/dp/test/ut/TestMain.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,30 @@ TEST(productRecvIn, Container5_FAILURE) {
tester.productRecvIn_Container5_FAILURE();
}

TEST(productRecvIn, Container6_SUCCESS) {
COMMENT("Receive Container6 SUCCESS");
Tester tester;
tester.productRecvIn_Container6_SUCCESS();
}

TEST(productRecvIn, Container6_FAILURE) {
COMMENT("Receive Container6 FAILURE");
Tester tester;
tester.productRecvIn_Container6_FAILURE();
}

TEST(productRecvIn, Container7_SUCCESS) {
COMMENT("Receive Container7 SUCCESS");
Tester tester;
tester.productRecvIn_Container7_SUCCESS();
}

TEST(productRecvIn, Container7_FAILURE) {
COMMENT("Receive Container7 FAILURE");
Tester tester;
tester.productRecvIn_Container7_FAILURE();
}

int main(int argc, char** argv) {
::testing::InitGoogleTest(&argc, argv);
STest::Random::seed();
Expand Down
Loading
Loading