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

Work/dp catalog #2713

Draft
wants to merge 80 commits into
base: devel
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
80 commits
Select commit Hold shift + click to select a range
26c8765
Starting on FDD for DpCatalog
timcanham Jan 19, 2024
041a450
More DpCatalog SDD edits
timcanham Jan 22, 2024
c4f6294
More refined DpCatalog requirements
timcanham Jan 23, 2024
91a363e
Starting prototype code
timcanham Jan 24, 2024
3e7d121
Working on DpCatalog build command
timcanham Jan 24, 2024
e1a5783
More DpCatalog work
timcanham Jan 26, 2024
fe96b1a
More DpCatalog work
timcanham Jan 29, 2024
666e77b
Merge from devel
timcanham Feb 20, 2024
f99d851
More work on reading DP headers
timcanham Feb 21, 2024
4394336
More work...
timcanham Feb 21, 2024
f3af664
Continued work
timcanham Feb 26, 2024
c17652f
Spelling fixes
timcanham Feb 27, 2024
06c3fa6
More spelling fixes
timcanham Feb 27, 2024
c80d844
First run of init unit test
timcanham Feb 27, 2024
2848241
One DP works
timcanham Feb 29, 2024
7b9be73
Refactor unit test helpers
timcanham Mar 1, 2024
e51a07e
Working on multiple DPs
timcanham Mar 1, 2024
da0700e
More work on multiple DPs
timcanham Mar 3, 2024
0a1176d
Fixed filesRead bug
timcanham Mar 5, 2024
7425848
Merge from fprime devel
timcanham Mar 5, 2024
1e3452f
More merge fixes
timcanham Mar 5, 2024
cdd6b71
Adding DPs to SignalGen
timcanham Mar 11, 2024
1f0d4ec
Merge from F Prime devel
timcanham Mar 29, 2024
a0748fe
Adding DP components
timcanham Mar 29, 2024
7753fdd
Added DP directory to DpWriter
timcanham Mar 29, 2024
977a6a6
First working version of Data Products!
timcanham Mar 30, 2024
d4a3a0e
Added missing FileDownlink connection
timcanham Apr 3, 2024
3797067
Added early proto warning to SDD.
timcanham Apr 8, 2024
dc5dd7b
Switched to Fw::FileNameString
timcanham Apr 10, 2024
f8ac1cc
Fixed unit test compile
timcanham Apr 10, 2024
018f4ad
Add missing override keyword
timcanham Apr 10, 2024
38a3fd6
Fix unit test override
timcanham Apr 10, 2024
745b19f
Fixed format specifiers
timcanham Apr 10, 2024
d8991d6
Reformat code
bocchino Apr 11, 2024
715cc47
Revise DpWriter uts
bocchino Apr 11, 2024
52168ce
Revise dp writer
bocchino Apr 11, 2024
e3bc890
Revise dp writer
bocchino Apr 11, 2024
e62571c
Removed extra ;
timcanham Apr 25, 2024
623653a
Merge remote-tracking branch 'upstream/devel' into work/DpCatalog
timcanham Apr 25, 2024
da1065b
Fix markdown broken links
timcanham Apr 25, 2024
3c17315
Updated SDD to force CI to run again
timcanham Apr 25, 2024
f2fc62a
Adding async DP request example
timcanham Apr 26, 2024
0f09e8e
Working on async example
timcanham Apr 26, 2024
94170ce
Still working on async DP
timcanham Apr 26, 2024
b7912f6
Remove test printf
timcanham May 1, 2024
fa579b9
Merge from F Prime devel
timcanham May 1, 2024
e59053c
Merge remote-tracking branch 'upstream/devel' into work/DpCatalog
timcanham May 1, 2024
c6de09b
Another merge with F Prime devel
timcanham May 1, 2024
a823572
Merge with mainline
timcanham Jun 11, 2024
45516af
Merge remote-tracking branch 'nasa/devel' into work/DpCatalog
timcanham Jun 28, 2024
9aeb644
Merge remote-tracking branch 'upstream/devel' into work/DpCatalog
timcanham Aug 8, 2024
d4f5aaf
Merge remote-tracking branch 'upstream/devel' into work/DpCatalog
timcanham Aug 22, 2024
7867da5
Working on binary tree implementation
timcanham Aug 24, 2024
5f8be61
Work in progress. Doesn't work yet
timcanham Aug 25, 2024
489b7c9
Merge remote-tracking branch 'upstream/devel' into work/DpCatalog
timcanham Aug 30, 2024
e9bc028
Still working
timcanham Sep 16, 2024
526eca7
Merge remote-tracking branch 'nasa/devel' into work/DpCatalog
timcanham Sep 16, 2024
1bddd64
debug launch config
timcanham Sep 16, 2024
fb0f13e
fixed pre-launch run step
timcanham Sep 16, 2024
a02dd45
Some progress on algo
timcanham Sep 19, 2024
595e440
2 and 3 nodes work
timcanham Sep 19, 2024
8ae835d
Refactored some code
timcanham Sep 19, 2024
4ee2c62
Tree traverse seems to work!
timcanham Sep 26, 2024
7ab7857
One transmitted test
timcanham Sep 26, 2024
108b908
Fixed NULL to nullptr
timcanham Sep 26, 2024
3fdb91a
Fixed spelling
timcanham Sep 26, 2024
96add80
Fixed memory alignment
timcanham Sep 26, 2024
d1219c9
Starting on state file
timcanham Oct 1, 2024
ed9a697
Fixed spelling - AGAIN
timcanham Oct 1, 2024
5f8a863
Added reading of the state file
timcanham Oct 2, 2024
ed94902
Added function to get state for DP from state file
timcanham Oct 2, 2024
3257d82
Added state file data pruning function
timcanham Oct 2, 2024
f0c3793
Code to update the state file
timcanham Oct 3, 2024
da133de
Debugging DpCat
timcanham Oct 3, 2024
a07e5d6
More work on DPs
timcanham Oct 8, 2024
29d6704
Working on state file
timcanham Oct 9, 2024
905b061
Added to spelling expect.txt
timcanham Oct 9, 2024
c6dc446
fix double 'the'
timcanham Oct 9, 2024
ea98bfc
Testing with DpManager/SignalGen
timcanham Oct 11, 2024
195cc44
merge from core devel; updates to DpCatalog
timcanham Oct 11, 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
1 change: 1 addition & 0 deletions .github/actions/spelling/excludes.txt
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
(?:^|/)pyproject.toml
(?:^|/)requirements(?:-dev|-doc|-test|)\.txt$
(?:^|/)vendor/
(?:^|/)launch\.json$
/doc/xml/
/html/
/third-party/
Expand Down
4 changes: 4 additions & 0 deletions .github/actions/spelling/expect.txt
Original file line number Diff line number Diff line change
Expand Up @@ -284,6 +284,7 @@
drv
dsdl
dspal
Dstate
Duerschmid
duey
dumparch
Expand Down Expand Up @@ -399,6 +400,7 @@
genfile
GENHUB
genshi
getblocks
getchildren
getcontext
getdata
Expand Down Expand Up @@ -755,6 +757,7 @@
PASSIVERATEGROUP
PASSIVERATEGROUPIMPLTESTER
pathmaker
patsubst
pbuild
pcmake
pcomp
Expand Down Expand Up @@ -931,6 +934,7 @@
serafin
serializables
setaffinity
setblocks
setdata
SETFL
setid
Expand Down Expand Up @@ -1022,9 +1026,9 @@
subseconds
subtargets
subtopology
subtopologies

Check warning on line 1029 in .github/actions/spelling/expect.txt

View workflow job for this annotation

GitHub Actions / Spell checking

`subtopologies` is ignored by check spelling because another more general variant is also in expect. (ignored-expect-variant)
Subtopology

Check warning on line 1030 in .github/actions/spelling/expect.txt

View workflow job for this annotation

GitHub Actions / Spell checking

`Subtopology` is ignored by check spelling because another more general variant is also in expect. (ignored-expect-variant)
Subtopologies

Check warning on line 1031 in .github/actions/spelling/expect.txt

View workflow job for this annotation

GitHub Actions / Spell checking

`Subtopologies` is ignored by check spelling because another more general variant is also in expect. (ignored-expect-variant)
suppr
suseconds
SVCLOGFILE
Expand Down
2 changes: 1 addition & 1 deletion Ref/.gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,4 @@ channels/
events/
dict/
DpCat

seq
20 changes: 14 additions & 6 deletions Ref/SignalGen/Commands.fppi
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
@ Signal Generator Settings
async command SignalGen_Settings(
async command Settings(
Frequency: U32
Amplitude: F32
Phase: F32
Expand All @@ -8,16 +8,24 @@ async command SignalGen_Settings(
opcode 0x00

@ Toggle Signal Generator On/Off.
async command SignalGen_Toggle \
async command Toggle \
opcode 1

@ Skip next sample
async command SignalGen_Skip \
async command Skip \
opcode 2

enum DpReqType {
IMMEDIATE
ASYNC
}


@ Signal Generator Settings
async command SignalGen_Dp(
records: U32
) \
async command Dp(
reqType: DpReqType
records: U32
$priority: U32
) \
opcode 3

34 changes: 29 additions & 5 deletions Ref/SignalGen/Events.fppi
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
@ Signal Generator Settings Changed
event SignalGen_SettingsChanged(
event SettingsChanged(
Frequency: U32
Amplitude: F32
Phase: F32
Expand All @@ -9,30 +9,54 @@ event SignalGen_SettingsChanged(
id 0 \
format "Set Frequency(Hz) {}, Amplitude {f}, Phase {f}, Signal Type {}"

event SignalGen_DpStarted(
event DpStarted(
records: U32
) \
severity activity low \
id 1 \
format "Writing {} DP records"

event SignalGen_DpComplete(
event DpComplete(
records: U32
bytes: U32
) \
severity activity low \
id 2 \
format "Writing {} DP records {} bytes total"

event SignalGen_DpRecordFull(
event DpRecordFull(
records: U32
bytes: U32
) \
severity warning low \
id 3 \
format "DP container full with {} records and {} bytes. Closing DP."

event SignalGen_DpsNotConnected \
event DpsNotConnected \
severity warning high \
id 4 \
format "DP Ports not connected!"

event DpMemoryFail \
severity warning high \
id 5 \
format "Failed to acquire a DP buffer"

event InSufficientDpRecords \
severity warning high \
id 6 \
format "Need to request at least one record"

event DpMemRequested(
$size: U32
) \
severity activity low \
id 7 \
format "Requesting {} bytes for DP"

event DpMemReceived(
$size: U32
) \
severity activity low \
id 8 \
format "Received {} bytes for DP"
96 changes: 74 additions & 22 deletions Ref/SignalGen/SignalGen.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,8 @@ namespace Ref {
skipOne(false),
m_dpInProgress(false),
m_numDps(0),
m_currDp(0)
m_currDp(0),
m_dpPriority(0)
{}


Expand Down Expand Up @@ -134,15 +135,22 @@ namespace Ref {

// if a Data product is being generated, store a record
if (this->m_dpInProgress) {
// printf("DP1: %u %u %lu %u\n",
// this->m_dpContainer.getBuffer().getSize(),
// SignalInfo::SERIALIZED_SIZE,
// this->m_dpContainer.getDataSize(),
// this->m_dpContainer.getBuffer().getSerializeRepr().getBuffLeft()
// );
Fw::SerializeStatus stat = this->m_dpContainer.serializeRecord_DataRecord(sigInfo);
this->m_currDp++;
this->m_dpBytes += SignalInfo::SERIALIZED_SIZE;
// printf("DP2: %u %u %lu\n",this->m_dpContainer.getBuffer().getSize(),this->m_dpBytes,this->m_dpContainer.getDataSize());
// check for full data product
if (Fw::SerializeStatus::FW_SERIALIZE_NO_ROOM_LEFT == stat) {
this->log_WARNING_LO_SignalGen_DpRecordFull(this->m_currDp,this->m_dpBytes);
this->log_WARNING_LO_DpRecordFull(this->m_currDp,this->m_dpBytes);
this->cleanupAndSendDp();
} else if (this->m_currDp == this->m_numDps) { // if we reached the target number of DPs
this->log_ACTIVITY_LO_SignalGen_DpComplete(this->m_numDps,this->m_dpBytes);
this->log_ACTIVITY_LO_DpComplete(this->m_numDps,this->m_dpBytes);
this->cleanupAndSendDp();
}

Expand All @@ -153,7 +161,7 @@ namespace Ref {
this->ticks += 1;
}

void SignalGen::SignalGen_Settings_cmdHandler(
void SignalGen::Settings_cmdHandler(
FwOpcodeType opCode, /*!< The opcode*/
U32 cmdSeq, /*!< The command sequence number*/
U32 Frequency,
Expand All @@ -175,12 +183,12 @@ namespace Ref {
this->sigPairHistory[i].settime(0.0f);
this->sigPairHistory[i].setvalue(0.0f);
}
this->log_ACTIVITY_LO_SignalGen_SettingsChanged(this->signalFrequency, this->signalAmplitude, this->signalPhase, this->sigType);
this->log_ACTIVITY_LO_SettingsChanged(this->signalFrequency, this->signalAmplitude, this->signalPhase, this->sigType);
this->tlmWrite_Type(SigType);
this->cmdResponse_out(opCode, cmdSeq, Fw::CmdResponse::OK);
}

void SignalGen::SignalGen_Toggle_cmdHandler(
void SignalGen::Toggle_cmdHandler(
FwOpcodeType opCode, /*!< The opcode*/
U32 cmdSeq /*!< The command sequence number*/
)
Expand All @@ -190,7 +198,7 @@ namespace Ref {
this->cmdResponse_out(opCode, cmdSeq, Fw::CmdResponse::OK);
}

void SignalGen::SignalGen_Skip_cmdHandler(
void SignalGen::Skip_cmdHandler(
FwOpcodeType opCode, /*!< The opcode*/
U32 cmdSeq /*!< The command sequence number*/
)
Expand All @@ -199,34 +207,64 @@ namespace Ref {
this->cmdResponse_out(opCode, cmdSeq, Fw::CmdResponse::OK);
}

void SignalGen ::
SignalGen_Dp_cmdHandler(
FwOpcodeType opCode,
U32 cmdSeq,
U32 records
)
void SignalGen::Dp_cmdHandler(
FwOpcodeType opCode,
U32 cmdSeq,
Ref::SignalGen_DpReqType reqType,
U32 records,
U32 priority
)
{
// at least one record
if (0 == records) {
this->log_WARNING_HI_InSufficientDpRecords();
this->cmdResponse_out(opCode, cmdSeq, Fw::CmdResponse::VALIDATION_ERROR);
return;
}

// make sure DPs are available
if (
not this->isConnected_productGetOut_OutputPort(0)
) {
this->log_WARNING_HI_SignalGen_DpsNotConnected();
this->log_WARNING_HI_DpsNotConnected();
this->cmdResponse_out(opCode, cmdSeq, Fw::CmdResponse::EXECUTION_ERROR);
return;
}

// get DP buffer
this->dpGet_DataContainer(records*SIZE_OF_DataRecord_RECORD,this->m_dpContainer);
this->m_dpInProgress = true;
// get DP buffer. Use sync or async request depending on
// requested type
FwSizeType dpSize = records*(SignalInfo::SERIALIZED_SIZE + sizeof(FwDpIdType));
this->m_numDps = records;
this->m_currDp = 0;
this->log_ACTIVITY_LO_SignalGen_DpStarted(records);
this->cmdResponse_out(opCode, cmdSeq, Fw::CmdResponse::OK);
this->m_dpPriority = static_cast<FwDpPriorityType>(priority);
this->log_ACTIVITY_LO_DpMemRequested(dpSize);
if (Ref::SignalGen_DpReqType::IMMEDIATE == reqType) {
Fw::Success stat = this->dpGet_DataContainer(dpSize,this->m_dpContainer);
// make sure we got the memory we wanted
if (Fw::Success::FAILURE == stat) {
this->log_WARNING_HI_DpMemoryFail();
this->cmdResponse_out(opCode, cmdSeq, Fw::CmdResponse::EXECUTION_ERROR);
} else {
this->m_dpInProgress = true;
this->log_ACTIVITY_LO_DpStarted(records);
this->log_ACTIVITY_LO_DpMemReceived(this->m_dpContainer.getBuffer().getSize());
this->cmdResponse_out(opCode, cmdSeq, Fw::CmdResponse::OK);
// override priority with requested priority
this->m_dpContainer.setPriority(this->m_dpPriority);
}
} else if (Ref::SignalGen_DpReqType::ASYNC == reqType) {
this->dpRequest_DataContainer(dpSize);
this->cmdResponse_out(opCode, cmdSeq, Fw::CmdResponse::OK);
} else {
// should never get here
FW_ASSERT(0,reqType.e);
}

}

void SignalGen::cleanupAndSendDp() {
this->dpSend(this->m_dpContainer);
this->m_dpInProgress = 0;
this->m_dpInProgress = false;
this->m_dpBytes = 0;
this->m_numDps = 0;
this->m_currDp = 0;
Expand All @@ -244,8 +282,22 @@ namespace Ref {
Fw::Success::T status
)
{
// TODO
}

// Make sure we got the buffer we wanted or quit
if (Fw::Success::SUCCESS == status) {
this->m_dpContainer = container;
this->m_dpInProgress = true;
// set previously requested priority
this->m_dpContainer.setPriority(this->m_dpPriority);
this->log_ACTIVITY_LO_DpStarted(this->m_numDps);
} else {
this->log_WARNING_HI_DpMemoryFail();
// cleanup
this->m_dpInProgress = false;
this->m_dpBytes = 0;
this->m_numDps = 0;
this->m_currDp = 0;
}
}

};
26 changes: 17 additions & 9 deletions Ref/SignalGen/SignalGen.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -31,9 +31,9 @@ namespace Ref {
void schedIn_handler(
NATIVE_INT_TYPE portNum, /*!< The port number*/
U32 context /*!< The call order*/
);
) final;

void SignalGen_Settings_cmdHandler(
void Settings_cmdHandler(
FwOpcodeType opCode, /*!< The opcode*/
U32 cmdSeq, /*!< The command sequence number*/
U32 Frequency,
Expand All @@ -42,23 +42,26 @@ namespace Ref {
Ref::SignalType SigType
) final;

void SignalGen_Toggle_cmdHandler(
void Toggle_cmdHandler(
FwOpcodeType opCode, /*!< The opcode*/
U32 cmdSeq /*!< The command sequence number*/
) final;
void SignalGen_Skip_cmdHandler(

void Skip_cmdHandler(
FwOpcodeType opCode, /*!< The opcode*/
U32 cmdSeq /*!< The command sequence number*/
) final;

//! Handler implementation for command SignalGen_Dp
//!
//! Signal Generator Settings
void SignalGen_Dp_cmdHandler(
FwOpcodeType opCode, //!< The opcode
U32 cmdSeq, //!< The command sequence number
U32 records
) final;
void Dp_cmdHandler(
FwOpcodeType opCode, //!< The opcode
U32 cmdSeq, //!< The command sequence number
Ref::SignalGen_DpReqType reqType,
U32 records,
U32 priority
) final;

// ----------------------------------------------------------------------
// Handler implementations for data products
Expand Down Expand Up @@ -103,6 +106,11 @@ namespace Ref {
U32 m_numDps; //!< number of DPs to store
U32 m_currDp; //!< current DP number
U32 m_dpBytes; //!< currently serialized records
FwDpPriorityType m_dpPriority; //!< stored priority for current DP

// for async DP
FwOpcodeType m_opCode;
U32 m_cmdSeq;

};
};
Expand Down
Loading
Loading