Motiv
Marvelous OTF2 Traces Interactive Visualizer
Loading...
Searching...
No Matches
TraceDataProxy.hpp
1/*
2 * Marvelous OTF2 Traces Interactive Visualizer (MOTIV)
3 * Copyright (C) 2023 Florian Gallrein, Björn Gehrke
4 *
5 * This program is free software: you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License as published by
7 * the Free Software Foundation, either version 3 of the License, or
8 * (at your option) any later version.
9 *
10 * This program is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU General Public License for more details.
14 *
15 * You should have received a copy of the GNU General Public License
16 * along with this program. If not, see <http://www.gnu.org/licenses/>.
17 */
18#ifndef MOTIV_TRACEDATAPROXY_HPP
19#define MOTIV_TRACEDATAPROXY_HPP
20
21
22#include <QObject>
23
24#include "src/models/Filetrace.hpp"
25#include "src/models/ViewSettings.hpp"
26
27
35class TraceDataProxy : public QObject {
36 Q_OBJECT
37
38public: //constructors
47 TraceDataProxy(FileTrace *trace, ViewSettings *settings, QObject *parent = nullptr);
48 virtual ~TraceDataProxy() override;
49
50
51public: // methods
59 [[nodiscard]] Trace *getSelection() const;
64 [[nodiscard]] types::TraceTime getBegin() const;
65
70 [[nodiscard]] types::TraceTime getEnd() const;
71
76 [[nodiscard]] ViewSettings *getSettings() const;
77
82 [[nodiscard]] Trace *getFullTrace() const;
83
88 [[nodiscard]] types::TraceTime getTotalRuntime() const;
89
90public: Q_SIGNALS:
94 void selectionChanged(types::TraceTime newBegin, types::TraceTime newEnd);
98 void beginChanged(types::TraceTime newBegin);
102 void endChanged(types::TraceTime newEnd);
107
112
113public Q_SLOTS:
119 void setSelectionBegin(types::TraceTime newBegin);
125 void setSelectionEnd(types::TraceTime newEnd);
133 void setSelection(types::TraceTime newBegin, types::TraceTime newEnd);
134
139 void setFilter(Filter filter);
140
146
147private: // methods
148 void updateSelection();
149 void updateSlotSelection();
150
151private: // data
152 FileTrace *trace = nullptr;
153 Trace *selection = nullptr;
154 ViewSettings *settings = nullptr;
155
156 types::TraceTime begin{0};
157 types::TraceTime end{0};
158};
159
160
161#endif //MOTIV_TRACEDATAPROXY_HPP
Trace representing the whole trace loaded from trace files.
Definition: Filetrace.hpp:27
Class containing options to filter the view.
Definition: Filter.hpp:28
A base class for all elements with a start and end time.
Model class providing access to data and pub/sub architecture of change events.
void endChanged(types::TraceTime newEnd)
ViewSettings * getSettings() const
Returns the current view settings.
types::TraceTime getTotalRuntime() const
void setFilter(Filter filter)
types::TraceTime getBegin() const
Returns the selected start time.
void setSelectionBegin(types::TraceTime newBegin)
Trace * getSelection() const
Returns the current selection.
void selectionChanged(types::TraceTime newBegin, types::TraceTime newEnd)
Trace * getFullTrace() const
Returns the entire trace.
void beginChanged(types::TraceTime newBegin)
void setTimeElementSelection(TimedElement *newSlot)
types::TraceTime getEnd() const
Returns the selected end time.
void setSelectionEnd(types::TraceTime newEnd)
void setSelection(types::TraceTime newBegin, types::TraceTime newEnd)
void filterChanged(Filter)
void infoElementSelected(TimedElement *)
Abstract base class for a trace.
Definition: Trace.hpp:52
The ViewSettings class encapsulates settings for the main view.