Skip to content

Commit c433792

Browse files
feat(toolbox): Filter Editor toolbox plugin
PJ3's 'Apply filter to data' as a PJ4 toolbox panel: multi-curve source selection, closed predefined-transform catalogue, live preview, optional alias, copy/paste clipboard. Launches from the plot right-click via the manifest plot_action tag. Strategy pattern across the plugin / SDK boundary: - Contract (plotjuggler_sdk#120 pj_plugins/filter_protocol/): abstract PJ::sdk::FilterTransform + FilterTransformFactory. - Strategies (this plugin, builtin_transforms.hpp): 12 concrete classes deriving from PJ::sdk::FilterTransform. - Registration: registerAllTransforms() at loaderInit. Tests (builtin_transforms_test.cpp): per-transform deterministic-causal + bit-identity. Pure C++ gtest, no Qt. Bumps extern/plotjuggler_core submodule to the contract+tags commit (plotjuggler_sdk#120).
1 parent b75f981 commit c433792

11 files changed

Lines changed: 2899 additions & 1 deletion

CMakeLists.txt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,7 @@ if(TARGET plotjuggler_sdk::plugin_sdk)
4646
add_subdirectory(toolbox_colormap)
4747
add_subdirectory(toolbox_quaternion)
4848
add_subdirectory(toolbox_reactive_scripts_editor)
49+
add_subdirectory(toolbox_filter_editor)
4950
add_subdirectory(toolbox_mosaico)
5051
return()
5152
endif()
@@ -151,5 +152,6 @@ else()
151152
add_subdirectory(toolbox_fft)
152153
add_subdirectory(toolbox_colormap)
153154
add_subdirectory(toolbox_quaternion)
155+
add_subdirectory(toolbox_filter_editor)
154156
add_subdirectory(toolbox_mosaico)
155157
endif()
Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
find_package(nlohmann_json REQUIRED)
2+
3+
include(${CMAKE_CURRENT_LIST_DIR}/../cmake/EmbedManifest.cmake)
4+
include(${CMAKE_CURRENT_LIST_DIR}/../cmake/EmbedUi.cmake)
5+
6+
add_library(toolbox_filter_editor_plugin SHARED filter_editor_plugin.cpp)
7+
target_compile_features(toolbox_filter_editor_plugin PRIVATE cxx_std_20)
8+
target_compile_options(toolbox_filter_editor_plugin PRIVATE ${PJ_WARNING_FLAGS})
9+
10+
target_link_libraries(toolbox_filter_editor_plugin PRIVATE
11+
plotjuggler_sdk::plugin_sdk
12+
nlohmann_json::nlohmann_json
13+
${CMAKE_DL_LIBS}
14+
)
15+
16+
pj_embed_manifest(toolbox_filter_editor_plugin
17+
HEADER ${CMAKE_CURRENT_BINARY_DIR}/generated/filter_editor_manifest.hpp
18+
VAR_NAME kFilterEditorManifest
19+
)
20+
21+
pj_embed_ui(toolbox_filter_editor_plugin
22+
UI_FILE ${CMAKE_CURRENT_SOURCE_DIR}/filter_editor_dialog.ui
23+
HEADER ${CMAKE_CURRENT_BINARY_DIR}/generated/filter_editor_dialog_ui.hpp
24+
VAR_NAME kFilterEditorDialogUi
25+
)
26+
27+
# v4 plugin discovery: emit a sidecar .pjmanifest.json the host can scan
28+
# pre-dlopen. Content derived from manifest.json + {abi_major, family}.
29+
pj_emit_plugin_manifest(toolbox_filter_editor_plugin
30+
FAMILY toolbox
31+
MANIFEST_FILE ${CMAKE_CURRENT_SOURCE_DIR}/manifest.json
32+
)
33+
34+
# Built-in predefined transforms catalogue lives in this plugin (it provides
35+
# them); the SDK contract they implement is in plotjuggler_sdk::plugin_sdk.
36+
# Tests guard the per-transform PJ3-mirror math + the SDK contract (the
37+
# default appendTail loops calculateNextPoint, save/load round-trips).
38+
if(TARGET GTest::gtest_main)
39+
add_executable(builtin_transforms_test builtin_transforms_test.cpp)
40+
target_compile_features(builtin_transforms_test PRIVATE cxx_std_20)
41+
target_compile_options(builtin_transforms_test PRIVATE ${PJ_WARNING_FLAGS})
42+
target_link_libraries(builtin_transforms_test PRIVATE
43+
plotjuggler_sdk::plugin_sdk
44+
nlohmann_json::nlohmann_json
45+
GTest::gtest_main
46+
)
47+
add_test(NAME builtin_transforms_test COMMAND builtin_transforms_test)
48+
endif()

0 commit comments

Comments
 (0)