PeriodicUpdateController.h
Go to the documentation of this file.
1/*
2 * This file is part of ArmarX.
3 *
4 * Copyright (C) 2012-2025, High Performance Humanoid Technologies (H2T), Karlsruhe Institute of Technology (KIT), all rights reserved.
5 *
6 * ArmarX is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License version 2 as
8 * published by the Free Software Foundation.
9 *
10 * ArmarX is distributed in the hope that it will be useful, but
11 * 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 * @package RobotStateComponent::
19 * @author Samet Soenmez (uewtt at student dot kit dot edu)
20 * @date 2025t
21 * @copyright http://www.gnu.org/licenses/gpl-2.0.txt
22 * GNU General Public License
23 */
24
25#pragma once
26
27#include <QObject>
28
34
35class QTimer;
36class QLayout;
37class QBoxLayout;
38class QGroupBox;
39class QLabel;
40class QThread;
41
43{
44 /**
45 * @brief controlls periodic tasks and associated view components
46 *
47 * manages two periodic tasks which are executed in a new worker thread.
48 * Communication between the threads is handled with signals.
49 */
50 class PeriodicUpdateController : public QObject, public armarx::Logging
51 {
52 Q_OBJECT
53 using This = PeriodicUpdateController;
54
55 public:
57 MemoryViewerUIContext& uiContext,
58 std::shared_ptr<armem::gui::model::MemoryViewerModel> model);
59
61
63
65
66 public slots:
67 void onCollapseAll();
68 void onSplitBox();
70 void onToggleAutoUpdates(bool enabled);
71 void updateListOfActiveMemories(QStringList activeMemoryNames);
72 void updateStatusLabelAndMemoryTree(int errorCount);
73
74 private slots:
75
76 signals:
82
83 void update();
84
85 private:
86 void startWorker();
87 void updateStatusLabel(int errorCount);
88
89 private:
90 armem::gui::view::PeriodicUpdateView* _periodicUpdateView;
91 std::shared_ptr<armem::gui::model::MemoryViewerModel> _model;
92 QLabel* _statusLabel;
93
94 std::unique_ptr<MemoryGroupBoxController> _memoryGroupBoxController;
95
96 QThread* _periodicUpdateWorkerThread = nullptr;
97 PeriodicUpdateWorker* _periodicUpdateWorker;
98 };
99}
Base Class for all Logging classes.
Definition Logging.h:240
controlls predictions, commits, LTM recording/storing
PeriodicUpdateController(MemoryViewerUIContext &uiContext, std::shared_ptr< armem::gui::model::MemoryViewerModel > model)
handles updating and periodically checks for new readers/writers and query results