Libksysguard

Unit.h
1/*
2 SPDX-FileCopyrightText: 2019 Vlad Zahorodnii <vlad.zahorodnii@kde.org>
3
4 SPDX-License-Identifier: LGPL-2.0-or-later
5*/
6
7#pragma once
8
9// Qt
10#include <QMetaType>
11#include <qqmlregistration.h>
12
13#include "formatter_export.h"
14
15namespace KSysGuard
16{
17FORMATTER_EXPORT Q_NAMESPACE QML_NAMED_ELEMENT(Units)
18
19 /**
20 * This enum type is used to specify metric prefixes.
21 */
22 enum MetricPrefix {
23 MetricPrefixAutoAdjust = -1,
24 MetricPrefixUnity = 0,
25 MetricPrefixKilo,
26 MetricPrefixMega,
27 MetricPrefixGiga,
28 MetricPrefixTera,
29 MetricPrefixPeta,
30 MetricPrefixLast = MetricPrefixPeta
31 };
32Q_ENUM_NS(MetricPrefix)
33
34/**
35 * This enum types is used to specify units.
36 */
37enum Unit {
38 UnitInvalid = -1,
39 UnitNone = 0,
40
41 // Byte size units.
42 UnitByte = 100,
43 UnitKiloByte = MetricPrefixKilo + UnitByte,
44 UnitMegaByte = MetricPrefixMega + UnitByte,
45 UnitGigaByte = MetricPrefixGiga + UnitByte,
46 UnitTeraByte = MetricPrefixTera + UnitByte,
47 UnitPetaByte = MetricPrefixPeta + UnitByte,
48
49 // Data rate units.
50 UnitByteRate = 200,
51 UnitKiloByteRate = MetricPrefixKilo + UnitByteRate,
52 UnitMegaByteRate = MetricPrefixMega + UnitByteRate,
53 UnitGigaByteRate = MetricPrefixGiga + UnitByteRate,
54 UnitTeraByteRate = MetricPrefixTera + UnitByteRate,
55 UnitPetaByteRate = MetricPrefixPeta + UnitByteRate,
56
57 // Frequency.
58 UnitHertz = 300,
59 UnitKiloHertz = MetricPrefixKilo + UnitHertz,
60 UnitMegaHertz = MetricPrefixMega + UnitHertz,
61 UnitGigaHertz = MetricPrefixGiga + UnitHertz,
62 UnitTeraHertz = MetricPrefixTera + UnitHertz,
63 UnitPetaHertz = MetricPrefixPeta + UnitHertz,
64
65 // Time units.
66 UnitBootTimestamp = 400,
67 UnitSecond,
68 UnitTime,
69 UnitTicks,
70 UnitDuration,
71
72 // Data rate units in bits.
73 UnitBitRate = 500,
74 UnitKiloBitRate = MetricPrefixKilo + UnitBitRate,
75 UnitMegaBitRate = MetricPrefixMega + UnitBitRate,
76 UnitGigaBitRate = MetricPrefixGiga + UnitBitRate,
77 UnitTeraBitRate = MetricPrefixTera + UnitBitRate,
78 UnitPetaBitRate = MetricPrefixPeta + UnitBitRate,
79
80 // Volt.
81 UnitVolt = 600,
82 UnitKiloVolt = MetricPrefixKilo + UnitVolt,
83 UnitMegaVolt = MetricPrefixMega + UnitVolt,
84 UnitGigaVolt = MetricPrefixGiga + UnitVolt,
85 UnitTeraVolt = MetricPrefixTera + UnitVolt,
86 UnitPetaVolt = MetricPrefixPeta + UnitVolt,
87
88 // Watt.
89 UnitWatt = 700,
90 UnitKiloWatt = MetricPrefixKilo + UnitWatt,
91 UnitMegaWatt = MetricPrefixMega + UnitWatt,
92 UnitGigaWatt = MetricPrefixGiga + UnitWatt,
93 UnitTeraWatt = MetricPrefixTera + UnitWatt,
94 UnitPetaWatt = MetricPrefixPeta + UnitWatt,
95
96 // WattHour.
97 UnitWattHour = 800,
98 UnitKiloWattHour = MetricPrefixKilo + UnitWattHour,
99 UnitMegaWattHour = MetricPrefixMega + UnitWattHour,
100 UnitGigaWattHour = MetricPrefixGiga + UnitWattHour,
101 UnitTeraWattHour = MetricPrefixTera + UnitWattHour,
102 UnitPetaWattHour = MetricPrefixPeta + UnitWattHour,
103
104 // Ampere.
105 UnitAmpere = 900,
106 UnitKiloAmpere = MetricPrefixKilo + UnitAmpere,
107 UnitMegaAmpere = MetricPrefixMega + UnitAmpere,
108 UnitGigaAmpere = MetricPrefixGiga + UnitAmpere,
109 UnitTeraAmpere = MetricPrefixTera + UnitAmpere,
110 UnitPetaAmpere = MetricPrefixPeta + UnitAmpere,
111
112 // Misc units.
113 UnitCelsius = 1000,
114 UnitDecibelMilliWatts,
115 UnitPercent,
116 UnitRate,
117 UnitRpm,
118};
119Q_ENUM_NS(Unit)
120
121} // namespace KSysGuard
This file is part of the KDE documentation.
Documentation copyright © 1996-2024 The KDE developers.
Generated on Mon Nov 18 2024 12:19:45 by doxygen 1.12.0 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.