refactor: unify component type dispatch + decompose RfSimulatorApp (#51) - #52
Merged
Merged
Conversation
15 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Fixes the RfSimulatorApp god-object + six parallel hardcoded type-dispatch tables: adding a component used to touch ~10 files. All dispatch now flows through one extended
ComponentTypeRegistry, and the app is decomposed by extractingPFBViewManagerandProjectSerializer.Related issue
Closes #51
Type of change
What changed
Phase 1 — unified registry +
type_name()IComponentEngine::type_name()pure virtual (canonical lowercase key) on all 11 engines + 2 test enginesComponentTypeRegistryextended to 11 descriptors:project_type,display_name,menu_label,label_prefix,kind,authorable,fields,create()factory,draw_inspectorcallback; newfindByProjectType()(accepts legacy + canonical names)saveProject/loadProject/duplicateComponentdispatch through the registry (.rfsimtype strings byte-identical, legacy files still load)ComponentLibrary::instantiateswitched tocreate()+deserialize()— library JSON behavior preserved with 5 key-parity fixes (ADCfs_Hz, mixerconversion_gain_dB, attenuatorattenuation_dB, filter string-enum, amplifierenable_nonlinearderivation)NodeGraphWidget::setAddableComponents+ unifiedRfSimulatorApp::addComponentwith unconditionalmarkDirty()— fixes the Equalizer not-marking-dirty bugdraw_inspectorcallbacks — also fixes the latent CoaxCable/Equalizer empty-panel-title bugnodeKindFromLabeldeleted;NodeGraphWidget::registerNodeKind/kindForLabeldata-driven from registryauthorablerowsPhase 2 — PFBViewManager (new
app/include/pfb_view_manager.h): owns the four lockstep PFB widget/visibility vectors; six hand-rolled rebuild sites collapse to method calls (issue #37 class of bug)Phase 3 — ProjectSerializer (new
app/include/project_serializer.h):.rfsimsave/load/new JSON logic extracted;RfSimulatorAppmethods become thin wrappersTests — new standalone exe
tests/test_component_dispatch.cpp(MinGW TEST_CASE ceiling): Equalizer dirty-flag regression (red→green), all-11-types save/load round-trip, legacy.rfsimbackward-compat load, registry label_prefix→kind mapping,draw_inspector/createcompletenessDocs — DOX pass:
app/AGENTS.md,common/AGENTS.md,openwiki/testing/guidance.mdTest plan
cmake --build build— cleanbuild/bin/tests.exe— 217 cases / 65522 assertions pass (incl.[project_file]round-trips)build/bin/test_component_dispatch.exe— 5 cases passbuild/bin/test_ui.exe— 22/22 passbuild/bin/test_issue37_pfb_input_removal.exe,test_component_authoring.exe,test_extensions.exe— passbash scripts/format.sh --check— cleanNotes
.rfsimtype strings and canvas menu labels byte-identical; library JSON schema untouched; legacy capitalized type names still loadPFBViewManager::draw()size-guard nit; dead includes inapp.h; twoopenwiki/testing/guidance.mddoc nits