DtkDevice
DTK library for device.
ddiskdevice.h
1// SPDX-FileCopyrightText: 2022 UnionTech Software Technology Co., Ltd.
2//
3// SPDX-License-Identifier: LGPL-3.0-or-later
4#ifndef DDISKDEVICE_H
5#define DDISKDEVICE_H
6
7#include "dtkdevice_global.h"
8
9#include <QObject>
10
11DDEVICE_BEGIN_NAMESPACE
12
13class DDiskDevicePrivate;
14class LIBDTKDEVICESHARED_EXPORT DDiskDevice : public QObject
15{
16public:
17 struct DDiskIoStat {
18 quint64 readsCompletedSuccessfully {0}; // # of reads completed successfully
19 quint64 readsMerged {0}; // # of reads merged
20 quint64 readSectors {0}; // # of sectors read
21 quint64 spentReadingTime {0}; // # of time spent reading (ms)
22 quint64 writesCompleted {0}; // # of writes completed
23 quint64 writesMerged {0}; // # of writes merged
24 quint64 writtenSectors {0}; // # of sectors written
25 quint64 spentWritingTime {0}; // # of time spent writing (ms)
26 quint64 currentProgressIOs {0}; // # of I/Os currently in progress
27 quint64 spentDoingIOsTime {0}; // # of time spent doing I/Os (ms)
28 quint64 spentDoingIOsWeightedTime {0}; // # of weighted time spent doing I/Os (ms)
29 quint64 discardsCompletedSuccessfully {0}; // # of discards completed successfully
30 quint64 discardsMerged {0}; // # of discards merged
31 quint64 discardedSectors {0}; // # of sectors discarded
32 quint64 spentDiscardingTime {0}; // # of time spent discarding
33 };
34
35 explicit DDiskDevice(QObject *parent = nullptr);
37
38 int count();
39 QString vendor(int index);
40 QString model(int index);
41 QString mediaType(int index);
42 QString size(int index);
43 QString interface(int index);
44 QString serialNumber(int index);
45 QString deviceFile(int index);
46 QString rotationRate(int index);
47 QString firmwareVersion(int index);
48 QString sectorSize(int index);
49
50 QString temperature(int index);
52
53private:
54 QScopedPointer<DDiskDevicePrivate> d_ptr;
55 Q_DECLARE_PRIVATE(DDiskDevice)
56};
57
58DDEVICE_END_NAMESPACE
59
60#endif // DDISKDEVICE_H
磁盘设备信息.
Definition: ddiskdevice.h:15
DDiskIoStat diskIoStat(int index)
获取指定磁盘的IO状态.
QString temperature(int index)
获取指定磁盘的温度.
QString firmwareVersion(int index)
获取指定磁盘的固件版本.
QString interface(int index)
获取指定磁盘的接口.
int count()
获取所有磁盘个数.
QString deviceFile(int index)
获取指定磁盘的设备文件.
QString rotationRate(int index)
获取指定磁盘的转速.
QString vendor(int index)
获取指定磁盘的厂商.
QString serialNumber(int index)
获取指定磁盘的序列号.
QString mediaType(int index)
获取指定磁盘的介质类型.
QString size(int index)
获取指定磁盘大小.
QString model(int index)
获取指定磁盘的型号.
QString sectorSize(int index)
获取指定磁盘的逻辑分区大小.
磁盘IO状态信息
Definition: ddiskdevice.h:17