Skip to content

Update PassiveRateGroup to push initial values for channels - #6382

Open
bevinduckett wants to merge 1 commit into
nasa:develfrom
bevinduckett:rg-init-tlm
Open

bevinduckett wants to merge 1 commit into
nasa:develfrom
bevinduckett:rg-init-tlm

Conversation

@bevinduckett

Copy link
Copy Markdown
Collaborator
Related Issue(s) n
Has Unit Tests (y/n) y
Documentation Included (y/n) y
Generative AI was used in this contribution (y/n) y

Change Description

Svc::PassiveRateGroup::configure() now writes an initial value for each of the component's telemetry channels:

  • MaxCycleTime (current value of the max-time tracker)
  • CycleTime (0)
  • CycleCount (current cycle count)
  • PortCycleTimeHWM (current per-port high water marks; only when PassiveRateGroupCfg::PortCycleTime is enabled)

The configure() header comment and docs/sdd.md are updated to say that these writes happen, and that the telemetry and time ports must be connected before configure() is called for the writes to be delivered.

A new unit test, InitialTelemetry (test case 101.5.1, runInitialTlmTest), calls configure() after the ports are connected and checks that each channel has exactly one initial value before any cycle runs.

Rationale

Before this change, a rate group channel had no value until its first cycle completed. Channels like PortCycleTimeHWM and MaxCycleTime could therefore be missing from telemetry for a ground system or downstream consumer that reads them right after startup. Writing initial values in configure() means every channel has a defined value from the start.

Testing/Review Recommendations

  • Run the Svc/PassiveRateGroup unit tests (fprime-util check in Svc/PassiveRateGroup), including the new InitialTelemetry test. (The author of this draft did not run them.)
  • Review focus: the initial writes depend on the telemetry and time ports already being connected when configure() runs. Deployments that call configure() before connecting ports will silently not emit these values. The first configure() in the existing unit test fixture runs before the ports are connected, so the new test calls configure() a second time.
  • Check that the added tlmWrite_* calls are acceptable at the configure() call site in existing topologies, in particular the ordering relative to port connection and time-port availability.

Future Work

None planned.

Contributor Checklist

AI Usage (see policy)

Claude Sonnet was used to update the unit test and SDD. It was also used to run the review skills from fprime and summarize the PR changes.

This branch has not been deployed

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants