feat(colormap): add ColorMapRegistry service and wire to chart panel#62
Merged
Merged
Conversation
Introduces a dedicated ColorMapRegistry — a session-wide service, peer to DataEngine — that stores plugin-registered color evaluation callbacks and exposes an active selection to rendering consumers. Plugins that publish colormaps receive the registry through a new optional bind_colormap_registry entry on the toolbox plugin vtable; the data-plane toolbox host no longer carries colormap-specific callbacks. pj_proto_app owns one ColorMapRegistry, threads it into each ToolboxSession, and feeds a live view to ChartPanel so registered maps take effect on the next refresh. Contents: - pj_datastore/colormap_registry: new class with register/unregister/ setActive/evaluate; independent, Qt-free, header + cpp - pj_datastore/colormap_registry_host: adapter that exposes a registry reference as a PJ_colormap_registry_t ABI fat pointer - pj_base/plugin_data_api.h: drop register_colormap/unregister_colormap from PJ_toolbox_host_vtable_t; add PJ_colormap_registry_t + PJ_colormap_registry_vtable_t - pj_base/toolbox_protocol.h: add bind_colormap_registry to the toolbox plugin vtable (optional; host checks NULL) - pj_base/sdk/plugin_data_api.hpp: drop registerColorMap/unregisterColorMap from ToolboxHostView; add ColorMapRegistryView C++ wrapper - pj_base/sdk/toolbox_plugin_base.hpp: virtual bindColorMapRegistry, trampoline, colorMapRegistry() accessor - pj_plugins/toolbox_handle.hpp: bindColorMapRegistry pass-through - pj_datastore/plugin_data_host.cpp: remove the obsolete ColorMapEntry storage and the two vtable entries that routed through it - pj_proto_app: ColorMapRegistry member in MainWindow, pass-through to ToolboxSession, ChartPanel setColorMap + per-series last_value - tests: update mock toolbox host vtable in pj_plugins and toolbox_quaternion
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
Introduce a dedicated
ColorMapRegistryas a session-wide service — peer toDataEngine— that stores plugin-registered color evaluation callbacks and exposes an active selection to rendering consumers.Plugins that publish colormaps receive the registry through a new optional
bind_colormap_registryentry on the toolbox plugin vtable. The data-plane toolbox host no longer carries colormap-specific callbacks.Why
The previous shape placed
register_colormap/unregister_colormapon the toolbox host vtable. That coupled the generic data/writing host to a presentation concern and left no first-class home for the registry state. Lifting the registry to its own service — independent class, its own ABI fat pointer, owned byMainWindowalongsideDataEngine— keeps each side cohesive: the host handles data, the registry handles named colormaps, and the chart reads from the registry directly.Key pieces
pj_datastore/colormap_registry.{hpp,cpp}— new class withregisterMap/unregisterMap/setActive/evaluate/hasActive. Qt-free, header + cpp.pj_datastore/colormap_registry_host.{hpp,cpp}—makeColorMapRegistryHost(ColorMapRegistry&)adapter that exposes a registry reference as aPJ_colormap_registry_tABI fat pointer.pj_base/plugin_data_api.h— dropregister_colormap/unregister_colormapfromPJ_toolbox_host_vtable_t; add the new ABI types.pj_base/toolbox_protocol.h— add optionalbind_colormap_registryto the toolbox plugin vtable.pj_base/sdk/plugin_data_api.hpp— dropregisterColorMap/unregisterColorMapfromToolboxHostView; addColorMapRegistryViewC++ wrapper.pj_base/sdk/toolbox_plugin_base.hpp—bindColorMapRegistryvirtual, trampoline,colorMapRegistry()accessor.pj_plugins/toolbox_handle.hpp—bindColorMapRegistrypass-through.pj_proto_app— owns the singleColorMapRegistry, threads it into eachToolboxSession, and feeds a live view toChartPanelviasetColorMap. Chart now tracks the last value per series.pj_pluginsupdated.Breaking change
This changes the toolbox host ABI. The matching plugin-side migration is in pj-official-plugins#NN (
feat/colormap-registry-migration) — they must be merged together for CPM-pulled builds to stay green.Test plan
pj_base+pj_datastore+pj_pluginstests green (ctest -R "toolbox_plugin_test|quaternion"passes)-Wall -Wextra -Werror