Motiv
Marvelous OTF2 Traces Interactive Visualizer
Loading...
Searching...
No Matches
InformationDockSlotStrategy.cpp
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#include "InformationDockSlotStrategy.hpp"
19
20
21void InformationDockSlotStrategy::updateView(QFormLayout *layout, Slot *element) {
22 auto name = QString::fromStdString(element->region->name().str());
23 auto rank = QString::fromStdString(element->location->location_group().name().str());
24
25 nameField->setText(name);
26 rankField->setText(rank);
27
29}
30
31void InformationDockSlotStrategy::setup(QFormLayout *layout) {
32 nameField = new QLabel();
33 rankField = new QLabel();
34
35 layout->addRow(tr("Name:"), nameField);
36 layout->addRow(tr("Rank:"), rankField);
37
38
40}
41
43 return tr("Region (Function)").toStdString();
44}
virtual void updateView(QFormLayout *layout, T *element)
Updates the view.
static QString tr(const char *s, const char *c=nullptr, int n=-1)
void setup(QFormLayout *layout) override
Sets up the QFormLayout.
std::string title() override
Returns the title the information dock should show.
void setup(QFormLayout *layout) override
Sets up the QFormLayout.
void updateView(QFormLayout *layout, Slot *element) override
Updates the view.
A Slot represents a visual slot to be rendered in the UI. It contains the information of a location.
Definition: Slot.hpp:37
otf2::definition::region * region
Region the slot occurred in. For example, the source file and line.
Definition: Slot.hpp:70
otf2::definition::location * location
Location of the slot (thread) containing the location group (MPI rank)
Definition: Slot.hpp:65