FeatureLearningSaveToMemoryWidget.cpp
Go to the documentation of this file.
1 /*
2 * This file is part of ArmarX.
3 *
4 * ArmarX is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License version 2 as
6 * published by the Free Software Foundation.
7 *
8 * ArmarX is distributed in the hope that it will be useful, but
9 * WITHOUT ANY WARRANTY; without even the implied warranty of
10 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 * GNU General Public License for more details.
12 *
13 * You should have received a copy of the GNU General Public License
14 * along with this program. If not, see <http://www.gnu.org/licenses/>.
15 *
16 * @package ArmarX::
17 * @author Julian Zimmer (urdbu at student dot kit dot edu)
18 * @date 2018
19 * @copyright http://www.gnu.org/licenses/gpl-2.0.txt
20 * GNU General Public License
21 */
22 
25 #include <VisionX/gui-plugins/FeatureLearning/ui_FeatureLearningSaveToMemoryWidget.h>
26 #include <QPointer>
27 
28 using namespace armarx;
29 
30 namespace visionx
31 {
32  FeatureLearningSaveToMemoryWidget::FeatureLearningSaveToMemoryWidget()
33  {
34  QDialog* dialogPointer = this;
35  widget.setupUi(dialogPointer);
36 
37 
38  connect(widget.okayButtonBox, SIGNAL(accepted()), this, SLOT(accept()));
39  connect(widget.okayButtonBox, SIGNAL(rejected()), this, SLOT(close()));
40  connect(widget.objectComboBox, SIGNAL(currentIndexChanged(QString)), this, SLOT(refreshOverwriteWarningLabel()));
41 
42  //widget.overwriteWarningLabel->setStyleSheet("Qlabel { color : red; }");
43  }
44 
45  FeatureLearningSaveToMemoryWidget::~FeatureLearningSaveToMemoryWidget()
46  {
47 
48  }
49 
50  Ui::FeatureLearningSaveToMemoryWidget* FeatureLearningSaveToMemoryWidget::getWidget()
51  {
52  return &widget;
53  }
54 
55  //this method is triggered, when a different item is chosen in the combobox
56  //it displays a warning if the user is about to overwrite the feature file present in the memory
57  void FeatureLearningSaveToMemoryWidget::refreshOverwriteWarningLabel()
58  {
59  QString objectId = widget.objectComboBox->itemData(widget.objectComboBox->currentIndex()).toString();
60  if (overwriteWarningMap[objectId] == true)
61  {
62  widget.overwriteWarningLabel->setStyleSheet("font-weight: bold; color: red");
63  widget.overwriteWarningLabel->setText("Warning: This Object has Features in the Memory that will be overwritten!");
64  widget.overwriteWarningLabel->setFrameShape(QFrame::Shape::StyledPanel);
65  }
66  else
67  {
68  widget.overwriteWarningLabel->setText("");
69  widget.overwriteWarningLabel->setFrameShape(QFrame::Shape::NoFrame);
70  }
71  }
72 
73  void FeatureLearningSaveToMemoryWidget::setOverwriteWarningMap(QMap<QString, bool> newMap)
74  {
75  overwriteWarningMap = newMap;
76  }
77 
78 }
visionx
ArmarX headers.
Definition: OpenPoseStressTest.h:38
FeatureLearningSaveToMemoryWidget.h
TypeMapping.h
armarx
This file offers overloads of toIce() and fromIce() functions for STL container types.
Definition: ArmarXTimeserver.cpp:28