diff --git a/Framework/CMakeLists.txt b/Framework/CMakeLists.txt index 90bdaa39685d2..362968ede706a 100644 --- a/Framework/CMakeLists.txt +++ b/Framework/CMakeLists.txt @@ -18,4 +18,6 @@ add_subdirectory(Utils) add_subdirectory(AnalysisSupport) +add_subdirectory(GUISupport) + add_subdirectory(TestWorkflows) diff --git a/Framework/Core/CMakeLists.txt b/Framework/Core/CMakeLists.txt index 63c7e46765808..84e2d22b88bb7 100644 --- a/Framework/Core/CMakeLists.txt +++ b/Framework/Core/CMakeLists.txt @@ -8,15 +8,6 @@ # granted to it by virtue of its status as an Intergovernmental Organization or # submit itself to any jurisdiction. -if (TARGET AliceO2::DebugGUI) - set(GUI_SOURCES src/FrameworkGUIDebugger.cxx src/FrameworkGUIDevicesGraph.cxx - src/FrameworkGUIDeviceInspector.cxx - src/FrameworkGUIDataRelayerUsage.cxx src/PaletteHelpers.cxx) - set(DEBUGGUI_TARGET AliceO2::DebugGUI) -else() - set(GUI_SOURCES src/FrameworkDummyDebugger.cxx) -endif() - # Given GCC 7.3 does not provide std::filesystem we use Boost instead # Drop this once we move to GCC 8.2+ # if (NOT __APPLE__) @@ -26,7 +17,6 @@ endif() o2_add_library(Framework SOURCES src/AODReaderHelpers.cxx src/ASoA.cxx - ${GUI_SOURCES} src/AnalysisHelpers.cxx src/AnalysisDataModelHelpers.cxx src/BoostOptionsRetriever.cxx @@ -108,8 +98,7 @@ o2_add_library(Framework src/StepTHn.cxx test/TestClasses.cxx PRIVATE_INCLUDE_DIRECTORIES ${CMAKE_CURRENT_LIST_DIR}/src - PUBLIC_LINK_LIBRARIES ${DEBUGGUI_TARGET} - AliceO2::Common + PUBLIC_LINK_LIBRARIES AliceO2::Common AliceO2::Configuration AliceO2::InfoLogger AliceO2::Monitoring @@ -257,16 +246,6 @@ endforeach() # #####################################################@ -if (TARGET AliceO2::DebugGUI) -if (NOT APPLE) -set (DEBUG_GUI_TESTS_WORKFLOW - CustomGUIGL - CustomGUISokol - SimpleTracksED - ) -endif() -endif() - foreach(w BoostSerializedProcessing CallbackService @@ -288,7 +267,6 @@ foreach(w SingleDataSource Task ExternalFairMQDeviceWorkflow - ${DEBUG_GUI_TESTS_WORKFLOW} ) o2_add_test(${w} NAME test_Framework_test_${w} SOURCES test/test_${w}.cxx @@ -304,18 +282,6 @@ endforeach() # part. [WARN] Incoming data is already obsolete, not relaying. set_property(TEST test_Framework_test_DanglingInputs PROPERTY DISABLED TRUE) -if (TARGET AliceO2::DebugGUI) -# TODO: investigate the problem with the two unit tests, maybe setup of the CI -# environment assertion fired X11: The DISPLAY environment variable is missing -# glfw-3.2.1/src/window.c:579: glfwGetFramebufferSize: Assertion `window != -# ((void *)0)' failed. -if(NOT APPLE) -set_property(TEST test_Framework_test_SimpleTracksED PROPERTY DISABLED TRUE) -set_property(TEST test_Framework_test_CustomGUIGL PROPERTY DISABLED TRUE) -set_property(TEST test_Framework_test_CustomGUISokol PROPERTY DISABLED TRUE) -endif() -endif() - # TODO: investigate the problem and re-enable set_property(TEST test_Framework_test_BoostSerializedProcessing PROPERTY DISABLED TRUE) diff --git a/Framework/Core/src/DataProcessorInfo.h b/Framework/Core/include/Framework/DataProcessorInfo.h similarity index 100% rename from Framework/Core/src/DataProcessorInfo.h rename to Framework/Core/include/Framework/DataProcessorInfo.h diff --git a/Framework/Core/include/Framework/DebugGUI.h b/Framework/Core/include/Framework/DebugGUI.h new file mode 100644 index 0000000000000..d2344671a300e --- /dev/null +++ b/Framework/Core/include/Framework/DebugGUI.h @@ -0,0 +1,40 @@ +// Copyright CERN and copyright holders of ALICE O2. This software is +// distributed under the terms of the GNU General Public License v3 (GPL +// Version 3), copied verbatim in the file "COPYING". +// +// See http://alice-o2.web.cern.ch/license for full licensing information. +// +// In applying this license CERN does not waive the privileges and immunities +// granted to it by virtue of its status as an Intergovernmental Organization +// or submit itself to any jurisdiction. +#ifndef O2_FRAMEWORK_DEBUGUIINTERFACE_H_ +#define O2_FRAMEWORK_DEBUGUIINTERFACE_H_ + +#include "Framework/DeviceInfo.h" +#include "Framework/DeviceSpec.h" +#include "Framework/DeviceControl.h" +#include "Framework/DataProcessorInfo.h" +#include "Framework/DeviceMetricsInfo.h" +#include "Framework/DriverInfo.h" +#include "Framework/DriverControl.h" + +#include +#include + +namespace o2::framework +{ +/// Plugin interface for DPL GUIs. +struct DebugGUI { + virtual std::function getGUIDebugger(std::vector const& infos, + std::vector const& devices, + std::vector const& metadata, + std::vector const& metricsInfos, + o2::framework::DriverInfo const& driverInfo, + std::vector& controls, + o2::framework::DriverControl& driverControl) = 0; + virtual void* initGUI(char const* windowTitle) = 0; + virtual bool pollGUI(void* context, std::function guiCallback) = 0; + virtual void disposeGUI() = 0; +}; +} // namespace o2::framework +#endif // O2_FRAMEWORK_DEBUGUIINTERFACE_H_ diff --git a/Framework/Core/src/DriverControl.h b/Framework/Core/include/Framework/DriverControl.h similarity index 98% rename from Framework/Core/src/DriverControl.h rename to Framework/Core/include/Framework/DriverControl.h index 606e1c8ef6bff..b9ac9f303d41e 100644 --- a/Framework/Core/src/DriverControl.h +++ b/Framework/Core/include/Framework/DriverControl.h @@ -13,7 +13,7 @@ #include #include -#include "DriverInfo.h" +#include "Framework/DriverInfo.h" #include "Framework/DataProcessorSpec.h" #include "Framework/DeviceSpec.h" #include "Framework/DeviceExecution.h" diff --git a/Framework/Core/src/DriverInfo.h b/Framework/Core/include/Framework/DriverInfo.h similarity index 100% rename from Framework/Core/src/DriverInfo.h rename to Framework/Core/include/Framework/DriverInfo.h diff --git a/Framework/Core/include/Framework/Plugins.h b/Framework/Core/include/Framework/Plugins.h index 6a159a7065890..eaa15703d94f1 100644 --- a/Framework/Core/include/Framework/Plugins.h +++ b/Framework/Core/include/Framework/Plugins.h @@ -19,7 +19,10 @@ namespace o2::framework enum struct DplPluginKind : int { // A plugin which can customise the workflow. Needs to return // an object of kind o2::framework::WorkflowCustomizationService - CustomAlgorithm + CustomAlgorithm, + // A plugin which implements a ImGUI GUI. Needs to return an + // object of the kind o2::framework::DebugGUIImpl + DebugGUIImpl }; } // namespace o2::framework diff --git a/Framework/Core/src/DeviceSpecHelpers.h b/Framework/Core/src/DeviceSpecHelpers.h index f3c69f8863c0c..244f6ddab3c1a 100644 --- a/Framework/Core/src/DeviceSpecHelpers.h +++ b/Framework/Core/src/DeviceSpecHelpers.h @@ -22,8 +22,8 @@ #include "Framework/AlgorithmSpec.h" #include "Framework/ConfigParamSpec.h" #include "Framework/OutputRoute.h" +#include "Framework/DataProcessorInfo.h" #include "ResourceManager.h" -#include "DataProcessorInfo.h" #include "WorkflowHelpers.h" #include diff --git a/Framework/Core/src/DriverControl.cxx b/Framework/Core/src/DriverControl.cxx index e36ec3c49c0c4..9ff709f28c8a7 100644 --- a/Framework/Core/src/DriverControl.cxx +++ b/Framework/Core/src/DriverControl.cxx @@ -7,4 +7,4 @@ // In applying this license CERN does not waive the privileges and immunities // granted to it by virtue of its status as an Intergovernmental Organization // or submit itself to any jurisdiction. -#include "DriverControl.h" +#include "Framework/DriverControl.h" diff --git a/Framework/Core/src/DriverInfo.cxx b/Framework/Core/src/DriverInfo.cxx index 8df33b8452a83..5d12c9b098ca2 100644 --- a/Framework/Core/src/DriverInfo.cxx +++ b/Framework/Core/src/DriverInfo.cxx @@ -7,4 +7,4 @@ // In applying this license CERN does not waive the privileges and immunities // granted to it by virtue of its status as an Intergovernmental Organization // or submit itself to any jurisdiction. -#include "DriverInfo.h" +#include "Framework/DriverInfo.h" diff --git a/Framework/Core/src/FrameworkDummyDebugger.cxx b/Framework/Core/src/FrameworkDummyDebugger.cxx deleted file mode 100644 index 0520e260cf071..0000000000000 --- a/Framework/Core/src/FrameworkDummyDebugger.cxx +++ /dev/null @@ -1,38 +0,0 @@ -// Copyright CERN and copyright holders of ALICE O2. This software is -// distributed under the terms of the GNU General Public License v3 (GPL -// Version 3), copied verbatim in the file "COPYING". -// -// See http://alice-o2.web.cern.ch/license for full licensing information. -// -// In applying this license CERN does not waive the privileges and immunities -// granted to it by virtue of its status as an Intergovernmental Organization -// or submit itself to any jurisdiction. -#include "DataProcessorInfo.h" -#include "Framework/FrameworkGUIDebugger.h" - -#include -#include - -namespace o2 -{ -namespace framework -{ -namespace gui -{ -// Dummy function in case we want to build without debugger. -std::function getGUIDebugger(std::vector const& infos, - std::vector const& devices, - std::vector const& metadata, - std::vector const& metricsInfos, - DriverInfo const& driverInfo, - std::vector& controls, - DriverControl& driverControl) -{ - return []() {}; -} - -void showNodeGraph(bool* opened) {} - -} // namespace gui -} // namespace framework -} // namespace o2 diff --git a/Framework/Core/src/WorkflowHelpers.h b/Framework/Core/src/WorkflowHelpers.h index c673b1e9940b0..f7ffde511c415 100644 --- a/Framework/Core/src/WorkflowHelpers.h +++ b/Framework/Core/src/WorkflowHelpers.h @@ -15,7 +15,7 @@ #include "Framework/ForwardRoute.h" #include "Framework/WorkflowSpec.h" #include "Framework/DataOutputDirector.h" -#include "DataProcessorInfo.h" +#include "Framework/DataProcessorInfo.h" #include #include diff --git a/Framework/Core/src/WorkflowSerializationHelpers.h b/Framework/Core/src/WorkflowSerializationHelpers.h index 671c14ef60dd7..1d9bd7fa8f904 100644 --- a/Framework/Core/src/WorkflowSerializationHelpers.h +++ b/Framework/Core/src/WorkflowSerializationHelpers.h @@ -11,14 +11,12 @@ #define O2_FRAMEWORK_CORE_WORKFLOWSERIALIZATIONHELPERS_H_ #include "Framework/DataProcessorSpec.h" -#include "DataProcessorInfo.h" +#include "Framework/DataProcessorInfo.h" #include #include -namespace o2 -{ -namespace framework +namespace o2::framework { struct WorkflowSerializationHelpers { @@ -30,7 +28,6 @@ struct WorkflowSerializationHelpers { std::vector const& metadata); }; -} // namespace framework -} // namespace o2 +} // namespace o2::framework #endif // O2_FRAMEWORK_CORE_WORKFLOWSERIALIZATIONHELPERS_H_ diff --git a/Framework/Core/src/runDataProcessing.cxx b/Framework/Core/src/runDataProcessing.cxx index 1c3b8583b5838..54b1aa7bf78b4 100644 --- a/Framework/Core/src/runDataProcessing.cxx +++ b/Framework/Core/src/runDataProcessing.cxx @@ -15,14 +15,7 @@ #include "Framework/ConfigContext.h" #include "Framework/DataProcessingDevice.h" #include "Framework/DataProcessorSpec.h" -#if __has_include() -#include -#else -// the DebugGUI is in a separate package and is optional for O2, -// we include a header implementing GUI interface dummy methods -#pragma message "Building DPL without Debug GUI" -#include "Framework/NoDebugGUI.h" -#endif +#include "Framework/Plugins.h" #include "Framework/DeviceControl.h" #include "Framework/DeviceExecution.h" #include "Framework/DeviceInfo.h" @@ -30,7 +23,7 @@ #include "Framework/DeviceConfigInfo.h" #include "Framework/DeviceSpec.h" #include "Framework/DeviceState.h" -#include "Framework/FrameworkGUIDebugger.h" +#include "Framework/DebugGUI.h" #include "Framework/LocalRootFileService.h" #include "Framework/LogParsingHelpers.h" #include "Framework/Logger.h" @@ -43,15 +36,15 @@ #include "Framework/CallbackService.h" #include "Framework/WorkflowSpec.h" #include "Framework/Monitoring.h" +#include "Framework/DataProcessorInfo.h" +#include "Framework/DriverInfo.h" +#include "Framework/DriverControl.h" #include "ComputingResourceHelpers.h" #include "DataProcessingStatus.h" #include "DDSConfigHelpers.h" #include "O2ControlHelpers.h" #include "DeviceSpecHelpers.h" -#include "DriverControl.h" -#include "DriverInfo.h" -#include "DataProcessorInfo.h" #include "GraphvizHelpers.h" #include "PropertyTreeHelpers.h" #include "SimpleResourceManager.h" @@ -841,6 +834,7 @@ struct GuiCallbackContext { uint64_t frameLast; float* frameLatency; float* frameCost; + DebugGUI* plugin; void* window; bool* guiQuitRequested; std::function callback; @@ -849,9 +843,12 @@ struct GuiCallbackContext { void gui_callback(uv_timer_s* ctx) { GuiCallbackContext* gui = reinterpret_cast(ctx->data); + if (gui->plugin == nullptr) { + return; + } uint64_t frameStart = uv_hrtime(); uint64_t frameLatency = frameStart - gui->frameLast; - *(gui->guiQuitRequested) = (pollGUI(gui->window, gui->callback) == false); + *(gui->guiQuitRequested) = (gui->plugin->pollGUI(gui->window, gui->callback) == false); uint64_t frameEnd = uv_hrtime(); *(gui->frameCost) = (frameEnd - frameStart) / 1000000; *(gui->frameLatency) = frameLatency / 1000000; @@ -892,12 +889,39 @@ int runStateMachine(DataProcessorSpecs const& workflow, auto resourceManager = std::make_unique(resources); + DebugGUI* debugGUI = nullptr; void* window = nullptr; - decltype(gui::getGUIDebugger(infos, deviceSpecs, dataProcessorInfos, metricsInfos, driverInfo, controls, driverControl)) debugGUICallback; + decltype(debugGUI->getGUIDebugger(infos, deviceSpecs, dataProcessorInfos, metricsInfos, driverInfo, controls, driverControl)) debugGUICallback; // An empty frameworkId means this is the driver, so we initialise the GUI if (driverInfo.batch == false && frameworkId.empty()) { - window = initGUI("O2 Framework debug GUI"); + auto initDebugGUI = []() -> DebugGUI* { + uv_lib_t supportLib; + int result = 0; + #ifdef __APPLE__ + result = uv_dlopen("libO2FrameworkGUISupport.dylib", &supportLib); + #else + result = uv_dlopen("libO2FrameworkGUISupport.so", &supportLib); + #endif + if (result == -1) { + LOG(ERROR) << uv_dlerror(&supportLib); + return nullptr; + } + void* callback = nullptr; + DPLPluginHandle* (*dpl_plugin_callback)(DPLPluginHandle*); + + result = uv_dlsym(&supportLib, "dpl_plugin_callback", (void**)&dpl_plugin_callback); + if (result == -1) { + LOG(ERROR) << uv_dlerror(&supportLib); + return nullptr; + } + DPLPluginHandle* pluginInstance = dpl_plugin_callback(nullptr); + return PluginManager::getByName(pluginInstance, "ImGUIDebugGUI"); + }; + debugGUI = initDebugGUI(); + if (debugGUI) { + window = debugGUI->initGUI("O2 Framework debug GUI"); + } } if (driverInfo.batch == false && window == nullptr && frameworkId.empty()) { LOG(WARN) << "Could not create GUI. Switching to batch mode. Do you have GLFW on your system?"; @@ -920,6 +944,7 @@ int runStateMachine(DataProcessorSpecs const& workflow, } GuiCallbackContext guiContext; + guiContext.plugin = debugGUI; guiContext.frameLast = uv_hrtime(); guiContext.frameLatency = &driverInfo.frameLatency; guiContext.frameCost = &driverInfo.frameCost; @@ -1125,7 +1150,7 @@ int runStateMachine(DataProcessorSpecs const& workflow, // because getGUIDebugger actually recreates the GUI state. if (window) { uv_timer_stop(&gui_timer); - guiContext.callback = gui::getGUIDebugger(infos, deviceSpecs, dataProcessorInfos, metricsInfos, driverInfo, controls, driverControl); + guiContext.callback = debugGUI->getGUIDebugger(infos, deviceSpecs, dataProcessorInfos, metricsInfos, driverInfo, controls, driverControl); guiContext.window = window; gui_timer.data = &guiContext; uv_timer_start(&gui_timer, gui_callback, 0, 20); diff --git a/Framework/GUISupport/CMakeLists.txt b/Framework/GUISupport/CMakeLists.txt new file mode 100644 index 0000000000000..e5ed0613edb4f --- /dev/null +++ b/Framework/GUISupport/CMakeLists.txt @@ -0,0 +1,63 @@ +# Copyright CERN and copyright holders of ALICE O2. This software is distributed +# under the terms of the GNU General Public License v3 (GPL Version 3), copied +# verbatim in the file "COPYING". +# +# See http://alice-o2.web.cern.ch/license for full licensing information. +# +# In applying this license CERN does not waive the privileges and immunities +# granted to it by virtue of its status as an Intergovernmental Organization or +# submit itself to any jurisdiction. + +# Given GCC 7.3 does not provide std::filesystem we use Boost instead +# Drop this once we move to GCC 8.2+ + +if (TARGET AliceO2::DebugGUI) + set(GUI_SOURCES src/FrameworkGUIDebugger.cxx src/FrameworkGUIDevicesGraph.cxx + src/FrameworkGUIDeviceInspector.cxx + src/FrameworkGUIDataRelayerUsage.cxx src/PaletteHelpers.cxx) + set(EXTRA_TARGETS AliceO2::DebugGUI) +else() + set(GUI_SOURCES src/FrameworkDummyDebugger.cxx) +endif() + +o2_add_library(FrameworkGUISupport + SOURCES src/Plugin.cxx + ${GUI_SOURCES} + PRIVATE_INCLUDE_DIRECTORIES ${CMAKE_CURRENT_LIST_DIR}/src + PUBLIC_LINK_LIBRARIES O2::Framework ${EXTRA_TARGETS}) + +if (TARGET AliceO2::DebugGUI) +if (NOT APPLE) +set (DEBUG_GUI_TESTS_WORKFLOW + CustomGUIGL + CustomGUISokol + SimpleTracksED + ) +endif() +endif() + +foreach(w + ${DEBUG_GUI_TESTS_WORKFLOW} + ) + o2_add_test(${w} NAME test_Framework_test_${w} + SOURCES test/test_${w}.cxx + COMPONENT_NAME Framework + LABELS framework workflow + PUBLIC_LINK_LIBRARIES O2::Framework AliceO2::DebugGUI + TIMEOUT 30 + NO_BOOST_TEST + COMMAND_LINE_ARGS ${DPL_WORKFLOW_TESTS_EXTRA_OPTIONS} --run --shm-segment-size 20000000) +endforeach() + +if (TARGET AliceO2::DebugGUI) +# TODO: investigate the problem with the two unit tests, maybe setup of the CI +# environment assertion fired X11: The DISPLAY environment variable is missing +# glfw-3.2.1/src/window.c:579: glfwGetFramebufferSize: Assertion `window != +# ((void *)0)' failed. +if(NOT APPLE) +set_property(TEST test_Framework_test_SimpleTracksED PROPERTY DISABLED TRUE) +set_property(TEST test_Framework_test_CustomGUIGL PROPERTY DISABLED TRUE) +set_property(TEST test_Framework_test_CustomGUISokol PROPERTY DISABLED TRUE) +endif() +endif() + diff --git a/Framework/Core/src/FrameworkGUIDataRelayerUsage.cxx b/Framework/GUISupport/src/FrameworkGUIDataRelayerUsage.cxx similarity index 100% rename from Framework/Core/src/FrameworkGUIDataRelayerUsage.cxx rename to Framework/GUISupport/src/FrameworkGUIDataRelayerUsage.cxx diff --git a/Framework/Core/include/Framework/FrameworkGUIDataRelayerUsage.h b/Framework/GUISupport/src/FrameworkGUIDataRelayerUsage.h similarity index 100% rename from Framework/Core/include/Framework/FrameworkGUIDataRelayerUsage.h rename to Framework/GUISupport/src/FrameworkGUIDataRelayerUsage.h diff --git a/Framework/Core/src/FrameworkGUIDebugger.cxx b/Framework/GUISupport/src/FrameworkGUIDebugger.cxx similarity index 99% rename from Framework/Core/src/FrameworkGUIDebugger.cxx rename to Framework/GUISupport/src/FrameworkGUIDebugger.cxx index 9d4fd274e7782..a0e9f97a9122a 100644 --- a/Framework/Core/src/FrameworkGUIDebugger.cxx +++ b/Framework/GUISupport/src/FrameworkGUIDebugger.cxx @@ -7,19 +7,19 @@ // In applying this license CERN does not waive the privileges and immunities // granted to it by virtue of its status as an Intergovernmental Organization // or submit itself to any jurisdiction. -#include "Framework/FrameworkGUIDebugger.h" +#include "FrameworkGUIDebugger.h" #include "Framework/ConfigContext.h" #include "Framework/ConfigParamRegistry.h" #include "DebugGUI/imgui.h" #include "DebugGUI/implot.h" #include "DebugGUI/imgui_extras.h" -#include "DriverControl.cxx" -#include "DriverInfo.cxx" +#include "Framework/DriverControl.h" +#include "Framework/DriverInfo.h" #include "FrameworkGUIDeviceInspector.h" -#include "Framework/FrameworkGUIDevicesGraph.h" -#include "Framework/FrameworkGUIDataRelayerUsage.h" -#include "Framework/PaletteHelpers.h" -#include "Framework/FrameworkGUIState.h" +#include "FrameworkGUIDevicesGraph.h" +#include "FrameworkGUIDataRelayerUsage.h" +#include "PaletteHelpers.h" +#include "FrameworkGUIState.h" #include diff --git a/Framework/Core/include/Framework/FrameworkGUIDebugger.h b/Framework/GUISupport/src/FrameworkGUIDebugger.h similarity index 85% rename from Framework/Core/include/Framework/FrameworkGUIDebugger.h rename to Framework/GUISupport/src/FrameworkGUIDebugger.h index 20cb8d1671e07..0788169177a68 100644 --- a/Framework/Core/include/Framework/FrameworkGUIDebugger.h +++ b/Framework/GUISupport/src/FrameworkGUIDebugger.h @@ -7,10 +7,10 @@ // In applying this license CERN does not waive the privileges and immunities // granted to it by virtue of its status as an Intergovernmental Organization // or submit itself to any jurisdiction. -#ifndef FRAMEWORK_FRAMEWORKGUIDEBUGGER_H_ -#define FRAMEWORK_FRAMEWORKGUIDEBUGGER_H_ +#ifndef O2_FRAMEWORK_FRAMEWORKGUIDEBUGGER_H_ +#define O2_FRAMEWORK_FRAMEWORKGUIDEBUGGER_H_ -#include "DataProcessorInfo.h" +#include "Framework/DataProcessorInfo.h" #include "Framework/DeviceControl.h" #include "Framework/DeviceInfo.h" #include "Framework/DeviceMetricsInfo.h" @@ -19,9 +19,7 @@ #include #include -namespace o2 -{ -namespace framework +namespace o2::framework { class DriverInfo; @@ -38,6 +36,5 @@ std::function getGUIDebugger(std::vector const& infos, std::vector& controls, DriverControl& driverControl); } // namespace gui -} // namespace framework -} // namespace o2 -#endif // FRAMEWORK_FRAMEWORKGUIDEBUGGER_H +} // namespace o2::framework +#endif // O2_FRAMEWORK_FRAMEWORKGUIDEBUGGER_H_ diff --git a/Framework/Core/src/FrameworkGUIDeviceInspector.cxx b/Framework/GUISupport/src/FrameworkGUIDeviceInspector.cxx similarity index 99% rename from Framework/Core/src/FrameworkGUIDeviceInspector.cxx rename to Framework/GUISupport/src/FrameworkGUIDeviceInspector.cxx index 8322ed1b87d6e..d5ff824070799 100644 --- a/Framework/Core/src/FrameworkGUIDeviceInspector.cxx +++ b/Framework/GUISupport/src/FrameworkGUIDeviceInspector.cxx @@ -9,7 +9,7 @@ // or submit itself to any jurisdiction. #include "FrameworkGUIDeviceInspector.h" -#include "DataProcessorInfo.h" +#include "Framework/DataProcessorInfo.h" #include "Framework/DeviceControl.h" #include "Framework/DeviceSpec.h" diff --git a/Framework/Core/src/FrameworkGUIDeviceInspector.h b/Framework/GUISupport/src/FrameworkGUIDeviceInspector.h similarity index 100% rename from Framework/Core/src/FrameworkGUIDeviceInspector.h rename to Framework/GUISupport/src/FrameworkGUIDeviceInspector.h diff --git a/Framework/Core/src/FrameworkGUIDevicesGraph.cxx b/Framework/GUISupport/src/FrameworkGUIDevicesGraph.cxx similarity index 97% rename from Framework/Core/src/FrameworkGUIDevicesGraph.cxx rename to Framework/GUISupport/src/FrameworkGUIDevicesGraph.cxx index 6cd6ea68a91ee..ecb3587d3d915 100644 --- a/Framework/Core/src/FrameworkGUIDevicesGraph.cxx +++ b/Framework/GUISupport/src/FrameworkGUIDevicesGraph.cxx @@ -7,24 +7,19 @@ // In applying this license CERN does not waive the privileges and immunities // granted to it by virtue of its status as an Intergovernmental Organization // or submit itself to any jurisdiction. -#include "Framework/FrameworkGUIDevicesGraph.h" -#include "Framework/FrameworkGUIDataRelayerUsage.h" -#include "Framework/FrameworkGUIState.h" +#include "FrameworkGUIDevicesGraph.h" +#include "FrameworkGUIDataRelayerUsage.h" +#include "FrameworkGUIState.h" +#include "PaletteHelpers.h" #include "Framework/DeviceSpec.h" #include "Framework/DeviceInfo.h" #include "Framework/LogParsingHelpers.h" -#include "Framework/PaletteHelpers.h" #include "Framework/Logger.h" #include "FrameworkGUIDeviceInspector.h" #include "Framework/Logger.h" #include "../src/WorkflowHelpers.h" #include "DebugGUI/imgui.h" -#if __has_include("DebugGUI/icons_font_awesome.h") -#include "DebugGUI/icons_font_awesome.h" -#else -#define ICON_FA_EXCLAMATION_CIRCLE "(Errors!)" -#define ICON_FA_EXCLAMATION_TRIANGLE "(Warnings!)" -#endif +#include #include #include #include @@ -232,7 +227,7 @@ void showTopologyNodeGraph(WorkspaceGUIState& state, int groupId = 0; auto metadatum = std::find_if(metadata.begin(), metadata.end(), - [& name = spec.name](DataProcessorInfo const& info) { return info.name == name; }); + [&name = spec.name](DataProcessorInfo const& info) { return info.name == name; }); for (size_t gi = 0; gi < groupList.Size; ++gi) { if (metadatum == metadata.end()) { diff --git a/Framework/Core/include/Framework/FrameworkGUIDevicesGraph.h b/Framework/GUISupport/src/FrameworkGUIDevicesGraph.h similarity index 78% rename from Framework/Core/include/Framework/FrameworkGUIDevicesGraph.h rename to Framework/GUISupport/src/FrameworkGUIDevicesGraph.h index 7842fcdec2343..31c86c7e57140 100644 --- a/Framework/Core/include/Framework/FrameworkGUIDevicesGraph.h +++ b/Framework/GUISupport/src/FrameworkGUIDevicesGraph.h @@ -7,21 +7,17 @@ // In applying this license CERN does not waive the privileges and immunities // granted to it by virtue of its status as an Intergovernmental Organization // or submit itself to any jurisdiction. -#ifndef FRAMEWORK_FRAMEWORKGUIDEVICEGRAPH_H_ -#define FRAMEWORK_FRAMEWORKGUIDEVICEGRAPH_H_ +#ifndef O2_FRAMEWORK_FRAMEWORKGUIDEVICEGRAPH_H_ +#define O2_FRAMEWORK_FRAMEWORKGUIDEVICEGRAPH_H_ -#include "../../src/DataProcessorInfo.h" +#include "Framework/DataProcessorInfo.h" #include "Framework/DeviceSpec.h" #include "Framework/DeviceInfo.h" #include "Framework/DeviceMetricsInfo.h" #include -namespace o2 -{ -namespace framework -{ -namespace gui +namespace o2::framework::gui { class WorkspaceGUIState; @@ -33,8 +29,6 @@ void showTopologyNodeGraph(WorkspaceGUIState& state, std::vector& controls, std::vector const& metricsInfos); -} // namespace gui -} // namespace framework -} // namespace o2 +} // namespace o2::framework::gui -#endif // FRAMEWORK_FRAMEWORKGUIDEVICEGRAPH_H_ +#endif // O2_FRAMEWORK_FRAMEWORKGUIDEVICEGRAPH_H_ diff --git a/Framework/Core/include/Framework/FrameworkGUIState.h b/Framework/GUISupport/src/FrameworkGUIState.h similarity index 100% rename from Framework/Core/include/Framework/FrameworkGUIState.h rename to Framework/GUISupport/src/FrameworkGUIState.h diff --git a/Framework/Core/include/Framework/NoDebugGUI.h b/Framework/GUISupport/src/NoDebugGUI.h similarity index 100% rename from Framework/Core/include/Framework/NoDebugGUI.h rename to Framework/GUISupport/src/NoDebugGUI.h diff --git a/Framework/Core/src/PaletteHelpers.cxx b/Framework/GUISupport/src/PaletteHelpers.cxx similarity index 98% rename from Framework/Core/src/PaletteHelpers.cxx rename to Framework/GUISupport/src/PaletteHelpers.cxx index 57405823bce57..5a0bf13f385b7 100644 --- a/Framework/Core/src/PaletteHelpers.cxx +++ b/Framework/GUISupport/src/PaletteHelpers.cxx @@ -7,7 +7,7 @@ // In applying this license CERN does not waive the privileges and immunities // granted to it by virtue of its status as an Intergovernmental Organization // or submit itself to any jurisdiction. -#include "Framework/PaletteHelpers.h" +#include "PaletteHelpers.h" namespace o2 { diff --git a/Framework/Core/include/Framework/PaletteHelpers.h b/Framework/GUISupport/src/PaletteHelpers.h similarity index 100% rename from Framework/Core/include/Framework/PaletteHelpers.h rename to Framework/GUISupport/src/PaletteHelpers.h diff --git a/Framework/GUISupport/src/Plugin.cxx b/Framework/GUISupport/src/Plugin.cxx new file mode 100644 index 0000000000000..067e90e81ab00 --- /dev/null +++ b/Framework/GUISupport/src/Plugin.cxx @@ -0,0 +1,49 @@ +// Copyright CERN and copyright holders of ALICE O2. This software is +// distributed under the terms of the GNU General Public License v3 (GPL +// Version 3), copied verbatim in the file "COPYING". +// +// See http://alice-o2.web.cern.ch/license for full licensing information. +// +// In applying this license CERN does not waive the privileges and immunities +// granted to it by virtue of its status as an Intergovernmental Organization +// or submit itself to any jurisdiction. +#if __has_include() +#include +#else +#pragma message "Building DPL without Debug GUI" +#include "NoDebugGUI.h" +#endif + +#include "Framework/Plugins.h" +#include "Framework/DebugGUI.h" +#include "FrameworkGUIDebugger.h" + +using namespace o2::framework; + +struct ImGUIDebugGUI : o2::framework::DebugGUI { + std::function getGUIDebugger(std::vector const& infos, + std::vector const& devices, + std::vector const& metadata, + std::vector const& metricsInfos, + DriverInfo const& driverInfo, + std::vector& controls, + DriverControl& driverControl) override + { + return o2::framework::gui::getGUIDebugger(infos, devices, metadata, metricsInfos, driverInfo, controls, driverControl); + } + + void* initGUI(char const* windowTitle) override + { + return o2::framework::initGUI(windowTitle); + } + bool pollGUI(void* context, std::function guiCallback) override + { + return o2::framework::pollGUI(context, guiCallback); + } + void disposeGUI() override + { + o2::framework::disposeGUI(); + } +}; + +DEFINE_DPL_PLUGIN(ImGUIDebugGUI, DebugGUIImpl); diff --git a/Framework/Core/test/test_CustomGUIGL.cxx b/Framework/GUISupport/test/test_CustomGUIGL.cxx similarity index 100% rename from Framework/Core/test/test_CustomGUIGL.cxx rename to Framework/GUISupport/test/test_CustomGUIGL.cxx diff --git a/Framework/Core/test/test_CustomGUISokol.cxx b/Framework/GUISupport/test/test_CustomGUISokol.cxx similarity index 100% rename from Framework/Core/test/test_CustomGUISokol.cxx rename to Framework/GUISupport/test/test_CustomGUISokol.cxx diff --git a/Framework/Core/test/test_SimpleTracksED.cxx b/Framework/GUISupport/test/test_SimpleTracksED.cxx similarity index 100% rename from Framework/Core/test/test_SimpleTracksED.cxx rename to Framework/GUISupport/test/test_SimpleTracksED.cxx