Medical Imaging Interaction Toolkit  2016.11.0
Medical Imaging Interaction Toolkit
QmitkMemoryUsageIndicatorView.h
Go to the documentation of this file.
1 /*===================================================================
2 
3 The Medical Imaging Interaction Toolkit (MITK)
4 
5 Copyright (c) German Cancer Research Center,
6 Division of Medical and Biological Informatics.
7 All rights reserved.
8 
9 This software is distributed WITHOUT ANY WARRANTY; without
10 even the implied warranty of MERCHANTABILITY or FITNESS FOR
11 A PARTICULAR PURPOSE.
12 
13 See LICENSE.txt or http://www.mitk.org for details.
14 
15 ===================================================================*/
16 
17 #ifndef QMITKMEMORYUSAGEINDICATORVIEW_WIDGET
18 #define QMITKMEMORYUSAGEINDICATORVIEW_WIDGET
19 
20 #include <MitkQtWidgetsExports.h>
21 
22 #include "ui_QmitkMemoryUsageIndicator.h"
23 #include <QWidget>
24 #include <qpixmap.h>
25 
27 class MITKQTWIDGETS_EXPORT QmitkMemoryUsageIndicatorView : public QWidget, public Ui::QmitkMemoryUsageIndicator
28 {
29  Q_OBJECT
30 
31 public:
33  QmitkMemoryUsageIndicatorView(QWidget *parent = nullptr, Qt::WindowFlags f = nullptr);
34 
37 
38 protected slots:
39  void UpdateMemoryUsage();
40 
41 protected:
42  std::string FormatMemorySize(size_t size);
43  std::string FormatPercentage(double val);
44  std::string GetMemoryDescription(size_t processSize, float percentage);
45 
46  QPixmap m_LEDGreen;
47  QPixmap m_LEDYellow;
48  QPixmap m_LEDOrange;
49  QPixmap m_LEDRed;
51 };
52 #endif // QMITKMEMORYUSAGEINDICATORVIEW_WIDGET
#define MITKQTWIDGETS_EXPORT