Project
Loading...
Searching...
No Matches
GPUDisplayGUI.h
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
14
15#ifndef GPUDISPLAYGUI_H
16#define GPUDISPLAYGUI_H
17
18#define QT_BEGIN_NAMESPACE \
19 namespace o2::gpu::qtgui \
20 {
21#define QT_END_NAMESPACE }
22
24#include <QMainWindow>
25#include <QTimer>
26#include <memory>
27
28class QKeyEvent;
29
31namespace Ui
32{
33class GPUDisplayGUI;
34}
36
37namespace o2::gpu
38{
40{
41 Q_OBJECT
42
43 public:
44 explicit GPUDisplayGUI(GPUDisplayGUIChannel& channel, QWidget* parent = nullptr);
45 ~GPUDisplayGUI() override;
46 void bringToFront();
47
48 protected:
49 void keyPressEvent(QKeyEvent* event) override;
50
51 private:
52 void timerTick(); // Exchange updates / settings with the display
53 void applySettings();
54 static int32_t translateKey(const QKeyEvent* event); // Qt key → display key code, -1 if not forwarded
55
56 std::unique_ptr<Ui::GPUDisplayGUI> mUi;
57 QTimer mTimer;
58 GPUDisplayGUIChannel& mChannel;
59 GPUDisplayGUIChannel::Update mUpdate; // Changes collected since the last tick
60 GPUDisplayGUIChannel::State mState; // Last state received from the display
61 uint64_t mLastSentId = 0; // Id of the last update sent
62 uint64_t mLastAppliedId = 0; // Id of the last update for which the display state was received
63};
64} // namespace o2::gpu
65
66#endif // GPUDISPLAYGUI_H
#define QT_BEGIN_NAMESPACE
#define QT_END_NAMESPACE
void keyPressEvent(QKeyEvent *event) override
struct _cl_event * event
Definition glcorearb.h:2982