fix: handle memory units as bytes

This commit is contained in:
2024-03-28 01:56:57 +02:00
parent 4d01b87088
commit b0df3535a5
3 changed files with 30 additions and 22 deletions

View File

@ -53,6 +53,7 @@ public:
ACFormat,
MemGBFormat,
MemMBFormat,
MemKBFormat,
NetSmartFormat,
NetSmartUnits,
Quotes,
@ -67,6 +68,10 @@ public:
UptimeCustom
};
static constexpr double KBinBytes = 1024.0;
static constexpr double MBinBytes = 1024.0 * KBinBytes;
static constexpr double GBinBytes = 1024.0 * MBinBytes;
explicit AWKeysAggregator(QObject *_parent = nullptr);
~AWKeysAggregator() override;
void initFormatters();
@ -83,10 +88,10 @@ public:
void setTranslate(bool _translate);
public slots:
QStringList registerSource(const QString &_source, const KSysGuard::Unit &_units, const QStringList &_keys);
QStringList registerSource(const QString &_source, const KSysGuard::Unit _units, const QStringList &_keys);
private:
[[nodiscard]] float temperature(float temp) const;
[[nodiscard]] double temperature(double temp) const;
AWFormatterHelper *m_customFormatters = nullptr;
AWDataEngineMapper *m_mapper = nullptr;
QStringList m_timeKeys;