refactor(config): rename event mode key#401
Conversation
6ff6222 to
b4c320f
Compare
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 6ff6222679
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| Assign(event_, "max_genstep", max_genstep); | ||
| Assign(event_, "maxslot", maxslot); | ||
| AssignNamedEnum(event_, "event", "mode", event_mode, EventModeInfos); | ||
| AssignNamedEnum(event_, "event", "event_mode", event_mode, EventModeInfos); |
There was a problem hiding this comment.
Preserve or reject the legacy mode key
When a user points GPHOX_CONFIG_DIR at an existing config that still uses the pre-rename event.mode key, this parser now ignores that key and leaves event_mode at its default Minimal. Because unknown JSON keys are otherwise accepted, configs that requested modes such as DebugLite or HitPhoton silently stop gathering/saving the configured event arrays instead of failing or migrating; consider accepting the legacy key or explicitly rejecting it during the rename.
Useful? React with 👍 / 👎.
There was a problem hiding this comment.
Pull request overview
This PR refactors the event persistence mode configuration key by renaming the JSON field from event.mode to event.event_mode, updating both the C++ config reader and the checked-in sample config files so that Config continues to drive SEventConfig correctly.
Changes:
- Update
Config::ReadConfigto read the event mode fromevent.event_modeinstead ofevent.mode. - Reorder
Config’sevent_modemember placement and adjustConfig::Apply()call ordering forSEventConfig::SetEventMode. - Update sample JSON configs to use
"event_mode".
Reviewed changes
Copilot reviewed 7 out of 7 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| sysrap/config.h | Moves event_mode member (no semantic change by itself). |
| sysrap/config.cpp | Reads renamed JSON key and applies SEventConfig::SetEventMode. |
| config/wls_test.json | Updates event mode key to "event_mode". |
| config/trap_iso.json | Updates event mode key to "event_mode". |
| config/sphere_leak.json | Updates event mode key to "event_mode". |
| config/dev.json | Updates event mode key to "event_mode" and reorders within the object. |
| config/8x8SiPM_crystal.json | Updates event mode key to "event_mode". |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| Assign(event_, "max_genstep", max_genstep); | ||
| Assign(event_, "maxslot", maxslot); | ||
| AssignNamedEnum(event_, "event", "mode", event_mode, EventModeInfos); | ||
| AssignNamedEnum(event_, "event", "event_mode", event_mode, EventModeInfos); |
No description provided.