Project
Loading...
Searching...
No Matches
Plugin.cxx
Go to the documentation of this file.
1// Copyright 2019-2020 CERN and copyright holders of ALICE O2.
2// See https://alice-o2.web.cern.ch/copyright for details of the copyright holders.
3// All rights not expressly granted are reserved.
4//
5// This software is distributed under the terms of the GNU General Public
6// License v3 (GPL Version 3), copied verbatim in the file "COPYING".
7//
8// In applying this license CERN does not waive the privileges and immunities
9// granted to it by virtue of its status as an Intergovernmental Organization
10// or submit itself to any jurisdiction.
11#if __has_include(<DebugGUI/DebugGUI.h>)
12#include <DebugGUI/DebugGUI.h>
13#else
14#pragma message "Building DPL without Debug GUI"
15#include "NoDebugGUI.h"
16#endif
17
18#include "Framework/Plugins.h"
19#include "Framework/DebugGUI.h"
25#include "SpyService.h"
26#include "SpyServiceHelpers.h"
27#include <fairmq/Channel.h>
28
29using namespace o2::framework;
30
32 std::function<void(void)> getGUIDebugger(std::vector<DeviceInfo> const& infos,
33 std::vector<DeviceSpec> const& devices,
34 std::vector<DataProcessingStates> const& allStates,
35 std::vector<DataProcessorInfo> const& metadata,
36 std::vector<DeviceMetricsInfo> const& metricsInfos,
37 DriverInfo const& driverInfo,
38 std::vector<DeviceControl>& controls,
39 DriverControl& driverControl) override
40 {
41 return o2::framework::gui::getGUIDebugger(infos, devices, allStates, metadata, metricsInfos, driverInfo, controls, driverControl);
42 }
43
44 void updateMousePos(float x, float y) override
45 {
47 }
48 void updateMouseButton(bool clicked) override
49 {
51 }
52 void updateMouseWheel(int direction) override
53 {
55 }
56 void updateWindowSize(int x, int y) override
57 {
59 }
60 void keyEvent(char key, bool down) override
61 {
63 }
64 void charIn(char key) override
65 {
67 }
68
69 void* initGUI(char const* windowTitle, ServiceRegistry& registry_) override
70 {
71 registry = &registry_;
72 return o2::framework::initGUI(windowTitle);
73 }
74 void disposeGUI() override
75 {
76 o2::framework::disposeGUI();
77 }
78 void getFrameRaw(void* data, void** raw_data, int* size, bool updateTextures = false) override
79 {
80 o2::framework::getFrameRaw(data, raw_data, size, updateTextures);
81 }
82 bool pollGUIPreRender(void* context, float delta) override
83 {
84 return o2::framework::pollGUIPreRender(context, delta);
85 }
86 void* pollGUIRender(std::function<void(void)> guiCallback) override
87 {
88 auto* result = o2::framework::pollGUIRender(guiCallback);
90 return result;
91 }
92
93 bool supportsDeferredClose() override
94 {
95#if __has_include(<DebugGUI/DebugGUIAPIv3.h>)
96 return true;
97#else
98 return false;
99#endif
100 }
101
102 void pollGUIPostRender(void* context, void* draw_data) override
103 {
104 o2::framework::pollGUIPostRender(context, draw_data);
105 }
107};
108
#define DEFINE_DPL_PLUGIN_INSTANCE(NAME, KIND)
Definition Plugins.h:112
#define DEFINE_DPL_PLUGINS_END
Definition Plugins.h:115
#define DEFINE_DPL_PLUGINS_BEGIN
Definition Plugins.h:107
StringRef key
GLint GLenum GLint x
Definition glcorearb.h:403
GLuint64EXT * result
Definition glcorearb.h:5662
GLsizeiptr size
Definition glcorearb.h:659
GLboolean * data
Definition glcorearb.h:298
typedef void(APIENTRYP PFNGLCULLFACEPROC)(GLenum mode)
void updateMouseButton(bool clicked)
void keyEvent(char key, bool down)
std::function< void(void)> getGUIDebugger(std::vector< DeviceInfo > const &infos, std::vector< DeviceSpec > const &devices, std::vector< DataProcessingStates > const &allStates, std::vector< DataProcessorInfo > const &metadata, std::vector< DeviceMetricsInfo > const &metricsInfos, DriverInfo const &driverInfo, std::vector< DeviceControl > &controls, DriverControl &driverControl)
Helper to get the callback to draw the debug GUI.
void updateMousePos(float x, float y)
void updateWindowSize(int x, int y)
void updateMouseWheel(int direction)
Defining PrimaryVertex explicitly as messageable.
void updateMousePos(float x, float y) override
Definition Plugin.cxx:44
void updateMouseWheel(int direction) override
Definition Plugin.cxx:52
bool supportsDeferredClose() override
Definition Plugin.cxx:93
bool pollGUIPreRender(void *context, float delta) override
Definition Plugin.cxx:82
void charIn(char key) override
Definition Plugin.cxx:64
void pollGUIPostRender(void *context, void *draw_data) override
Definition Plugin.cxx:102
void * pollGUIRender(std::function< void(void)> guiCallback) override
Definition Plugin.cxx:86
std::function< void(void)> getGUIDebugger(std::vector< DeviceInfo > const &infos, std::vector< DeviceSpec > const &devices, std::vector< DataProcessingStates > const &allStates, std::vector< DataProcessorInfo > const &metadata, std::vector< DeviceMetricsInfo > const &metricsInfos, DriverInfo const &driverInfo, std::vector< DeviceControl > &controls, DriverControl &driverControl) override
Definition Plugin.cxx:32
void getFrameRaw(void *data, void **raw_data, int *size, bool updateTextures=false) override
Definition Plugin.cxx:78
void disposeGUI() override
Definition Plugin.cxx:74
void * initGUI(char const *windowTitle, ServiceRegistry &registry_) override
Definition Plugin.cxx:69
void updateMouseButton(bool clicked) override
Definition Plugin.cxx:48
void keyEvent(char key, bool down) override
Definition Plugin.cxx:60
ServiceRegistry * registry
Definition Plugin.cxx:106
void updateWindowSize(int x, int y) override
Definition Plugin.cxx:56
Plugin interface for DPL GUIs.
Definition DebugGUI.h:30