Changeset 103131 in vbox for trunk/src/VBox/Frontends
- Timestamp:
- Jan 31, 2024 8:55:10 AM (10 months ago)
- Location:
- trunk/src/VBox/Frontends/VirtualBox
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Frontends/VirtualBox/Makefile.kmk
r103068 r103131 856 856 src/logviewer/UIVMLogViewerWidget.h \ 857 857 src/activity/vmactivity/UIVMActivityMonitor.h \ 858 src/activity/UIMonitorCommon.h \ 858 859 src/medium/UIFDCreationDialog.h \ 859 860 src/medium/UIMediumEnumerator.h \ -
trunk/src/VBox/Frontends/VirtualBox/src/activity/UIMonitorCommon.cpp
r98103 r103131 40 40 #include "CMachineDebugger.h" 41 41 #include "CPerformanceCollector.h" 42 43 44 45 /********************************************************************************************************************************* 46 * UIProgressTaskReadCloudMachineMetricList implementation. * 47 *********************************************************************************************************************************/ 48 49 UIProgressTaskReadCloudMachineMetricList::UIProgressTaskReadCloudMachineMetricList(QObject *pParent, CCloudMachine comCloudMachine) 50 :UIProgressTask(pParent) 51 , m_comCloudMachine(comCloudMachine) 52 { 53 } 54 55 CProgress UIProgressTaskReadCloudMachineMetricList::createProgress() 56 { 57 if (!m_comCloudMachine.isOk()) 58 return CProgress(); 59 return m_comCloudMachine.ListMetricNames(m_metricNamesArray); 60 } 61 62 void UIProgressTaskReadCloudMachineMetricList::handleProgressFinished(CProgress &comProgress) 63 { 64 if (!comProgress.isOk()) 65 return; 66 emit sigMetricListReceived(m_metricNamesArray.GetValues()); 67 } 68 69 70 /********************************************************************************************************************************* 71 * UIProgressTaskReadCloudMachineMetricData implementation. * 72 *********************************************************************************************************************************/ 73 74 UIProgressTaskReadCloudMachineMetricData::UIProgressTaskReadCloudMachineMetricData(QObject *pParent, 75 CCloudMachine comCloudMachine, 76 KMetricType enmMetricType, 77 ULONG uDataPointsCount) 78 :UIProgressTask(pParent) 79 , m_comCloudMachine(comCloudMachine) 80 , m_enmMetricType(enmMetricType) 81 , m_uDataPointsCount(uDataPointsCount) 82 { 83 } 84 85 CProgress UIProgressTaskReadCloudMachineMetricData::createProgress() 86 { 87 if (!m_comCloudMachine.isOk()) 88 return CProgress(); 89 90 CStringArray aUnit; 91 return m_comCloudMachine.EnumerateMetricData(m_enmMetricType, m_uDataPointsCount, m_metricData, m_timeStamps, aUnit); 92 } 93 94 95 void UIProgressTaskReadCloudMachineMetricData::handleProgressFinished(CProgress &comProgress) 96 { 97 if (!comProgress.isOk()) 98 return; 99 if (m_metricData.isOk() && m_timeStamps.isOk()) 100 emit sigMetricDataReceived(m_enmMetricType, m_metricData.GetValues(), m_timeStamps.GetValues()); 101 } 42 102 43 103 /* static */ -
trunk/src/VBox/Frontends/VirtualBox/src/activity/UIMonitorCommon.h
r98103 r103131 31 31 # pragma once 32 32 #endif 33 34 #include <QPainterPath> 35 #include "UIProgressTask.h" 36 #include "COMEnums.h" 37 #include "CStringArray.h" 38 #include "CCloudMachine.h" 39 40 class SHARED_LIBRARY_STUFF UIProgressTaskReadCloudMachineMetricList : public UIProgressTask 41 { 42 Q_OBJECT; 43 44 signals: 45 46 void sigMetricListReceived(QVector<QString> metricNamesList); 47 48 public: 49 50 UIProgressTaskReadCloudMachineMetricList(QObject *pParent, CCloudMachine comCloudMachine); 51 52 protected: 53 54 virtual CProgress createProgress() RT_OVERRIDE; 55 virtual void handleProgressFinished(CProgress &comProgress) RT_OVERRIDE; 56 57 private: 58 59 CCloudMachine m_comCloudMachine; 60 CStringArray m_metricNamesArray; 61 }; 62 63 64 class SHARED_LIBRARY_STUFF UIProgressTaskReadCloudMachineMetricData : public UIProgressTask 65 { 66 Q_OBJECT; 67 68 signals: 69 70 void sigMetricDataReceived(KMetricType enmMetricType, QVector<QString> data, QVector<QString> timeStamps); 71 72 public: 73 74 UIProgressTaskReadCloudMachineMetricData(QObject *pParent, CCloudMachine comCloudMachine, 75 KMetricType enmMetricType, ULONG uDataPointsCount); 76 77 protected: 78 79 virtual CProgress createProgress() RT_OVERRIDE; 80 virtual void handleProgressFinished(CProgress &comProgress) RT_OVERRIDE; 81 82 private: 83 84 CCloudMachine m_comCloudMachine; 85 CStringArray m_metricData; 86 CStringArray m_timeStamps; 87 KMetricType m_enmMetricType; 88 ULONG m_uDataPointsCount; 89 }; 90 33 91 34 92 /** UIDebuggerMetricData is used as data storage while parsing the xml stream received from IMachineDebugger. */ -
trunk/src/VBox/Frontends/VirtualBox/src/activity/vmactivity/UIVMActivityMonitor.cpp
r102927 r103131 44 44 #include "UIConverter.h" 45 45 #include "UIIconPool.h" 46 #include "UIProgressTask.h"47 46 #include "UITranslator.h" 48 47 #include "UIVMActivityMonitor.h" … … 56 55 #include "CPerformanceCollector.h" 57 56 #include "CPerformanceMetric.h" 58 #include "CStringArray.h"59 57 #include "CRangedIntegerFormValue.h" 60 58 #include <iprt/string.h> … … 72 70 const int g_iBackgroundTint = 104; 73 71 const quint64 uInvalidValueSentinel = ~0U; 74 75 76 /*********************************************************************************************************************************77 * UIProgressTaskReadCloudMachineMetricList definition. *78 *********************************************************************************************************************************/79 80 class UIProgressTaskReadCloudMachineMetricList : public UIProgressTask81 {82 Q_OBJECT;83 84 signals:85 86 void sigMetricListReceived(QVector<QString> metricNamesList);87 88 public:89 90 UIProgressTaskReadCloudMachineMetricList(QObject *pParent, CCloudMachine comCloudMachine);91 92 protected:93 94 virtual CProgress createProgress() RT_OVERRIDE;95 virtual void handleProgressFinished(CProgress &comProgress) RT_OVERRIDE;96 97 private:98 99 CCloudMachine m_comCloudMachine;100 CStringArray m_metricNamesArray;101 };102 103 104 /*********************************************************************************************************************************105 * UIProgressTaskReadCloudMachineMetricList definition. *106 *********************************************************************************************************************************/107 108 class UIProgressTaskReadCloudMachineMetricData : public UIProgressTask109 {110 Q_OBJECT;111 112 signals:113 114 void sigMetricDataReceived(KMetricType enmMetricType, QVector<QString> data, QVector<QString> timeStamps);115 116 public:117 118 UIProgressTaskReadCloudMachineMetricData(QObject *pParent, CCloudMachine comCloudMachine,119 KMetricType enmMetricType, ULONG uDataPointsCount);120 121 protected:122 123 virtual CProgress createProgress() RT_OVERRIDE;124 virtual void handleProgressFinished(CProgress &comProgress) RT_OVERRIDE;125 126 private:127 128 CCloudMachine m_comCloudMachine;129 CStringArray m_metricData;130 CStringArray m_timeStamps;131 KMetricType m_enmMetricType;132 ULONG m_uDataPointsCount;133 };134 135 72 136 73 /********************************************************************************************************************************* … … 254 191 QLabel *m_pMouseOverLabel; 255 192 }; 256 257 258 /*********************************************************************************************************************************259 * UIProgressTaskReadCloudMachineMetricList implementation. *260 *********************************************************************************************************************************/261 262 UIProgressTaskReadCloudMachineMetricList::UIProgressTaskReadCloudMachineMetricList(QObject *pParent, CCloudMachine comCloudMachine)263 :UIProgressTask(pParent)264 , m_comCloudMachine(comCloudMachine)265 {266 }267 268 CProgress UIProgressTaskReadCloudMachineMetricList::createProgress()269 {270 if (!m_comCloudMachine.isOk())271 return CProgress();272 return m_comCloudMachine.ListMetricNames(m_metricNamesArray);273 }274 275 void UIProgressTaskReadCloudMachineMetricList::handleProgressFinished(CProgress &comProgress)276 {277 if (!comProgress.isOk())278 return;279 emit sigMetricListReceived(m_metricNamesArray.GetValues());280 }281 282 283 /*********************************************************************************************************************************284 * UIProgressTaskReadCloudMachineMetricData implementation. *285 *********************************************************************************************************************************/286 287 UIProgressTaskReadCloudMachineMetricData::UIProgressTaskReadCloudMachineMetricData(QObject *pParent,288 CCloudMachine comCloudMachine,289 KMetricType enmMetricType,290 ULONG uDataPointsCount)291 :UIProgressTask(pParent)292 , m_comCloudMachine(comCloudMachine)293 , m_enmMetricType(enmMetricType)294 , m_uDataPointsCount(uDataPointsCount)295 {296 }297 298 CProgress UIProgressTaskReadCloudMachineMetricData::createProgress()299 {300 if (!m_comCloudMachine.isOk())301 return CProgress();302 303 CStringArray aUnit;304 return m_comCloudMachine.EnumerateMetricData(m_enmMetricType, m_uDataPointsCount, m_metricData, m_timeStamps, aUnit);305 }306 307 308 void UIProgressTaskReadCloudMachineMetricData::handleProgressFinished(CProgress &comProgress)309 {310 if (!comProgress.isOk())311 return;312 if (m_metricData.isOk() && m_timeStamps.isOk())313 emit sigMetricDataReceived(m_enmMetricType, m_metricData.GetValues(), m_timeStamps.GetValues());314 }315 193 316 194 /*********************************************************************************************************************************
Note:
See TracChangeset
for help on using the changeset viewer.