Skip to content

FpySequencer SEQ_BASE_DIR parameter#5074

Open
zimri-leisher wants to merge 7 commits into
nasa:develfrom
zimri-leisher:5063-fpy-seq-dir
Open

FpySequencer SEQ_BASE_DIR parameter#5074
zimri-leisher wants to merge 7 commits into
nasa:develfrom
zimri-leisher:5063-fpy-seq-dir

Conversation

@zimri-leisher
Copy link
Copy Markdown
Collaborator

Related Issue(s) #5063
Has Unit Tests (y/n) y
Documentation Included (y/n) y
Generative AI was used in this contribution (y/n) y

Change Description

  • Add the SEQ_BASE_DIR parameter to FpySequencer. If specified, it is added as a suffix to provided sequence paths before they are opened. If the provided suffix is not an absolute path, then they are still resolved relative to the cwd of the process. The default suffix is the empty string.

AI Usage (see policy)

  • AI wrote all of the code.

Comment thread Svc/FpySequencer/FpySequencerValidationState.cpp Fixed
Comment thread Svc/FpySequencer/FpySequencerValidationState.cpp Fixed
Fw::ParamValid valid;
Fw::ParamString baseDir = this->paramGet_SEQ_BASE_DIR(valid);
if (baseDir.length() > 0) {
this->m_sequenceFilePath.format("%s/%s", baseDir.toChar(), value.get_filePath().toChar());
Fw::ParamValid valid;
Fw::ParamString baseDir = this->paramGet_SEQ_BASE_DIR(valid);
if (baseDir.length() > 0) {
this->m_sequenceFilePath.format("%s/%s", baseDir.toChar(), value.get_filePath().toChar());
if (baseDir.length() > 0) {
this->m_sequenceFilePath.format("%s/%s", baseDir.toChar(), value.get_filePath().toChar());
} else {
this->m_sequenceFilePath = value.get_filePath();
if (baseDir.length() > 0) {
this->m_sequenceFilePath.format("%s/%s", baseDir.toChar(), value.get_filePath().toChar());
} else {
this->m_sequenceFilePath = value.get_filePath();
@LeStarch LeStarch added CCB PR needs to go through CCB process blocked labels Apr 30, 2026
@LeStarch LeStarch moved this from CCB to Backlog in F´ Development May 5, 2026
@LeStarch LeStarch removed blocked CCB PR needs to go through CCB process labels May 5, 2026
Fw::ParamValid valid;
Fw::ParamString baseDir = this->paramGet_SEQ_BASE_DIR(valid);
if (baseDir.length() > 0) {
this->m_sequenceFilePath.format("%s/%s", baseDir.toChar(), value.get_filePath().toChar());
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You must check the return status of the format function as without it you may get a completely botched path.

}

TEST_F(FpySequencerTester, seqBaseDir_resolvesPath) {
// base dir of "." should resolve "test.bin" to "./test.bin" — m_sequenceFilePath
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't know that this actually tests what you want. To file open, "./test.bin" and "test.bin" mean the same thing. Thus it doesn't test that the prefix works. We should use instead ../<current_dir>/test.bin

ASSERT_TLM_PRM_SEQ_BASE_DIR_SIZE(1);
ASSERT_TLM_PRM_SEQ_BASE_DIR(0, val.toChar());
}

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Probably want an absolute path test too (using pwd or something) because this will be the most frequent use-case.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Backlog

Development

Successfully merging this pull request may close these issues.

3 participants