ObserverWidget.h
Go to the documentation of this file.
1 /*
2  * This file is part of ArmarX.
3  *
4  * Copyright (C) 2011-2016, 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
19  * @author
20  * @date
21  * @copyright http://www.gnu.org/licenses/gpl-2.0.txt
22  * GNU General Public License
23  */
24 #pragma once
25 
26 // Qt
27 #include <ArmarXGui/gui-plugins/ObserverPropertiesPlugin/ui_ObserverProperties.h>
28 
29 #include <QMainWindow>
30 #include <QStandardItemModel>
31 #include <QAction>
32 #include <QTimer>
33 #include <QWidget>
34 #include <QPointer>
35 
36 #include <string>
37 #include <map>
38 
39 // ArmarX
41 #include "../ObserverItemModel.h"
42 
44 
45 namespace armarx
46 {
47  class ObserverWidgetController;
48  class PlotterController;
49  using ObserverList = std::vector<std::string>;
50 
51 
52  class ObserverWidget : public QWidget
53  {
54  Q_OBJECT
55 
56  public:
58  signals:
59  void createFilterClicked(const std::string& datafieldStr, DatafieldFilterBasePtr filter);
60  public slots:
61  void createNewModel();
62  void treeView_selected(const QItemSelection& selected, const QItemSelection& deselected);
63  void treeView_contextMenu(const QPoint& point);
64  void updateObservers();
65  void toggleAutoUpdate(bool checked);
66  void filterSelected();
67  void clearDetailedView();
68  private slots:
69  void expandFilterSelection(QString filterStr);
70  void delayedFilterExpansion();
71  private:
72  Ui::ObserverProperties ui;
74  ObserverItemModel* model;
75  QPointer<QWidget> propertiesWidget;
76  QTimer* updateTimer;
77  QAction* autoUpdateAction;
78  std::string selectedFilterId;
79  InfixFilterModel* proxyModel;
80  QTimer filterExpansionTimer;
81  };
82 }
83 
armarx::ObserverWidget::createNewModel
void createNewModel()
Definition: ObserverWidget.cpp:73
armarx::ObserverWidget
Definition: ObserverWidget.h:52
armarx::ObserverWidget::updateObservers
void updateObservers()
Definition: ObserverWidget.cpp:89
InfixFilterModel.h
armarx::ObserverWidget::treeView_contextMenu
void treeView_contextMenu(const QPoint &point)
Definition: ObserverWidget.cpp:228
armarx::ObserverWidget::treeView_selected
void treeView_selected(const QItemSelection &selected, const QItemSelection &deselected)
Definition: ObserverWidget.cpp:116
armarx::ObserverWidget::createFilterClicked
void createFilterClicked(const std::string &datafieldStr, DatafieldFilterBasePtr filter)
controller
Definition: AddOperation.h:39
armarx::ObserverList
std::vector< std::string > ObserverList
Definition: ObserverItemModel.h:45
armarx::ObserverWidget::filterSelected
void filterSelected()
Definition: ObserverWidget.cpp:148
armarx::ObserverItemModel
Definition: ObserverItemModel.h:64
armarx::InfixFilterModel
This proxy model reimplements the filterAcceptsRow function with a new behavior: All elements that fi...
Definition: InfixFilterModel.h:41
armarx::ObserverWidget::ObserverWidget
ObserverWidget(ObserverWidgetController *controller)
Definition: ObserverWidget.cpp:44
armarx::ObserverWidget::toggleAutoUpdate
void toggleAutoUpdate(bool checked)
Definition: ObserverWidget.cpp:136
armarx::ObserverWidgetController
Definition: ObserverWidgetController.h:57
armarx
This file offers overloads of toIce() and fromIce() functions for STL container types.
Definition: ArmarXTimeserver.cpp:28
Application.h
armarx::ObserverWidget::clearDetailedView
void clearDetailedView()
Definition: ObserverWidget.cpp:218