32 #include <qapplication.h>
33 #include <qeventloop.h>
42 #include "QmitkMemoryUsageIndicatorImagesGreen.xpm"
43 #include "QmitkMemoryUsageIndicatorImagesOrange.xpm"
44 #include "QmitkMemoryUsageIndicatorImagesRed.xpm"
45 #include "QmitkMemoryUsageIndicatorImagesYellow.xpm"
51 auto timer =
new QTimer(
this);
54 m_LEDGreen = QPixmap(QmitkMemoryUsageIndicatorImagesGreen_xpm);
55 m_LEDYellow = QPixmap(QmitkMemoryUsageIndicatorImagesYellow_xpm);
56 m_LEDOrange = QPixmap(QmitkMemoryUsageIndicatorImagesOrange_xpm);
57 m_LEDRed = QPixmap(QmitkMemoryUsageIndicatorImagesRed_xpm);
70 float percentage = ((float)processSize / (
float)totalSize) * 100.0;
72 if (percentage < 50.0)
81 else if (percentage < 65.0)
90 else if (percentage < 80.0)
113 std::string descriptor(
"B");
129 std::ostringstream str;
130 str.imbue(std::locale::classic());
131 str << std::fixed << std::setprecision(2) << val <<
" " << descriptor;
137 std::ostringstream str;
138 str.imbue(std::locale::classic());
139 str << std::fixed << std::setprecision(2) << val <<
" "
146 std::ostringstream str;
147 str.imbue(std::locale::classic());
static vcl_size_t GetTotalSizeOfPhysicalRam()
std::string FormatMemorySize(vcl_size_t size)
~QmitkMemoryUsageIndicatorView()
destructor
std::string GetMemoryDescription(vcl_size_t processSize, float percentage)
static vcl_size_t GetProcessMemoryUsage()
std::string FormatPercentage(double val)
QmitkMemoryUsageIndicatorView(QWidget *parent=nullptr, Qt::WindowFlags f=nullptr)
constructor