Skip to content

Feat: TPwriter's enable/disable logic now determined by readout apps#290

Draft
henry-wallace-phys wants to merge 8 commits into
developfrom
hwallace/feature/tp_disable
Draft

Feat: TPwriter's enable/disable logic now determined by readout apps#290
henry-wallace-phys wants to merge 8 commits into
developfrom
hwallace/feature/tp_disable

Conversation

@henry-wallace-phys

@henry-wallace-phys henry-wallace-phys commented Jun 15, 2026

Copy link
Copy Markdown

Description

Previously TPStreamWriterApplication required additional external logic to determine its enable disable state.

  • "Are any ReadoutApps enabled?"
  • "For each ReadoutApp do any of them have tp generation enabled"?

If there are no readout apps + none of tp generation enabled then the TPStreamWriter is itself disabled.

This is now moved internally using the 'tpset-net-rule' to find all connected readout applications. We find all configuration objects that use this rule, loop over them + find all ReadoutApplications used by them.

Type of change

  • Documentation (non-breaking change that adds or improves the documentation)
  • New feature or enhancement (non-breaking change which adds functionality)
  • Optimization (non-breaking change that improves code/performance)
  • Bug fix (non-breaking change which fixes an issue)
  • Breaking change (whatever its nature)

Testing checklist

  • Unit tests pass (e.g. dbt-build --unittest)
  • Minimal system quicktest passes (pytest -s minimal_system_quick_test.py)
  • Full set of integration tests pass (dunedaq_integtest_bundle.sh)
  • Python tests pass if applicable (e.g. python -m pytest)
  • Pre-commit hooks run successfully if applicable (e.g. pre-commit run --all-files)

Comments here on the testing

Further checks

  • Code is commented where needed, particularly in hard-to-understand areas
  • Code style is correct (dbt-build --lint, and/or see https://dune-daq-sw.readthedocs.io/en/latest/packages/styleguide/)
  • If applicable, new tests have been added or an issue has been opened to tackle that in the future.
    (Indicate issue here: # (issue))

Comment thread src/TPWriterApplication.cpp Outdated

for(auto& rule : get_network_rules()){
/// HACK (minor): We assume TPs will always contain this exact rule
if(rule->UID()!="tpset-net-rule"){continue;}

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Why not use the same logic as at line 50 where you will at least be consistent

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

Ah because I was being silly! Will fix in a moment

Comment thread src/TPWriterApplication.cpp Outdated
for(auto parent : configuration().referenced_by(*rule)){

// Safer than blindly casting to ReadoutApplication (RA)
if(!parent->castable("ReadoutApplication")) continue;

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I think casting and checking for nullptr is just as safe. The continue should really be on a line of its own, surrounded by braces. If statements without braces are against the coding conventions and really screw up my reading of code.

@mroda88 mroda88 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Nope, the function to extend is compute_disabled_state. To make sure, it is the right one, add the the qualifier override.

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.

4 participants