Skip to content

Commit 85a64e7

Browse files
feat: Transform Editor toolbox plugin — PJ3 Custom Series port (data-only)
Ports PlotJuggler 3's Custom Series / Function Editor to the data-only pj.data_processors.v1 service. On Save it hands the host a self-describing Luau class (N inputs -> M outputs) run as a DerivedEngine node; in-place edit (Modify) and close-on-create match PJ3. The live preview uses the host's engine via createEphemeralTransform and script validation uses validateScript — no local Lua runtime in the plugin. Requires plotjuggler_sdk >= 0.12.0; extern/plotjuggler_core pinned to the matching SDK.
1 parent d7d9158 commit 85a64e7

9 files changed

Lines changed: 1887 additions & 3 deletions

File tree

CMakeLists.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,7 @@ if(TARGET plotjuggler_sdk::plugin_sdk)
4949
add_subdirectory(toolbox_quaternion)
5050
add_subdirectory(toolbox_reactive_scripts_editor)
5151
add_subdirectory(toolbox_mosaico)
52+
add_subdirectory(toolbox_transform_editor)
5253
return()
5354
endif()
5455

SDK_VERSION

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
0.11.0
1+
0.12.0

conanfile.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,6 @@ class PjOfficialPluginsConan(ConanFile):
3838
"asio/1.28.2",
3939
"kissfft/131.1.0",
4040
"lua/5.4.6",
41-
"sol2/3.5.0",
4241
# Pin libsodium to 1.0.20: 1.0.21 has broken ARM NEON code that fails with
4342
# GCC on aarch64.
4443
"libsodium/1.0.20",
Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
find_package(nlohmann_json REQUIRED)
2+
3+
include(${CMAKE_CURRENT_LIST_DIR}/../cmake/EmbedUi.cmake)
4+
include(${CMAKE_CURRENT_LIST_DIR}/../cmake/EmbedManifest.cmake)
5+
6+
add_library(toolbox_transform_editor_plugin SHARED transform_editor_plugin.cpp)
7+
8+
target_compile_features(toolbox_transform_editor_plugin PRIVATE cxx_std_20)
9+
target_compile_options(toolbox_transform_editor_plugin PRIVATE ${PJ_WARNING_FLAGS})
10+
11+
target_link_libraries(toolbox_transform_editor_plugin PRIVATE
12+
plotjuggler_sdk::plugin_sdk
13+
nlohmann_json::nlohmann_json
14+
)
15+
16+
# When built as part of the PJ4 app (not standalone), link pj_dialog_engine_qt
17+
# to get access to ChartPreviewWidget for the live preview chart.
18+
if(TARGET pj_dialog_engine_qt)
19+
target_link_libraries(toolbox_transform_editor_plugin PRIVATE pj_dialog_engine_qt)
20+
target_compile_definitions(toolbox_transform_editor_plugin PRIVATE PJ_HAS_CHART_PREVIEW=1)
21+
endif()
22+
23+
target_include_directories(toolbox_transform_editor_plugin PRIVATE
24+
${CMAKE_CURRENT_BINARY_DIR}/generated
25+
)
26+
27+
pj_embed_ui(toolbox_transform_editor_plugin
28+
UI_FILE ${CMAKE_CURRENT_SOURCE_DIR}/transform_editor_dialog.ui
29+
HEADER ${CMAKE_CURRENT_BINARY_DIR}/generated/transform_editor_dialog_ui.hpp
30+
VAR_NAME kTransformEditorDialogUi
31+
)
32+
33+
pj_embed_manifest(toolbox_transform_editor_plugin
34+
HEADER ${CMAKE_CURRENT_BINARY_DIR}/generated/transform_editor_manifest.hpp
35+
VAR_NAME kTransformEditorManifest
36+
)
37+
38+
pj_emit_plugin_manifest(toolbox_transform_editor_plugin
39+
FAMILY toolbox
40+
MANIFEST_FILE ${CMAKE_CURRENT_SOURCE_DIR}/manifest.json
41+
)
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
import os
2+
from conan import ConanFile
3+
4+
5+
_SDK_VERSION = (
6+
open(os.path.join(os.path.dirname(os.path.abspath(__file__)), os.pardir, "SDK_VERSION"))
7+
.read()
8+
.strip()
9+
)
10+
11+
12+
class ToolboxTransformEditorConan(ConanFile):
13+
name = "toolbox_transform_editor"
14+
version = "0"
15+
settings = "os", "compiler", "build_type", "arch"
16+
generators = "CMakeDeps", "CMakeToolchain"
17+
requires = (
18+
f"plotjuggler_sdk/{_SDK_VERSION}",
19+
"gtest/1.17.0",
20+
"nlohmann_json/3.12.0",
21+
"sol2/3.5.0",
22+
"lua/5.4.6",
23+
)
24+
default_options = {"*:shared": False}
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
{
2+
"id": "toolbox-transform-editor",
3+
"name": "Transform Editor",
4+
"version": "1.0.0",
5+
"description": "Create named derived time series using Lua functions. Equivalent to the Custom Series editor in PJ3.",
6+
"author": "PlotJuggler Team",
7+
"publisher": "PlotJuggler",
8+
"website": "https://github.com/PlotJuggler/pj-official-plugins",
9+
"repository": "https://github.com/PlotJuggler/pj-official-plugins",
10+
"license": "MIT",
11+
"icon_url": "",
12+
"category": "toolbox",
13+
"tags": [
14+
"lua",
15+
"transform",
16+
"derived",
17+
"custom",
18+
"toolbox",
19+
"hidden"
20+
],
21+
"min_plotjuggler_version": "4.0.0"
22+
}

0 commit comments

Comments
 (0)