mirror of
https://gitee.com/drabel/LibQQt.git
synced 2025-01-04 10:18:44 +08:00
update sysinfo
This commit is contained in:
parent
4b499190ba
commit
0a80706891
6
src/frame/qqtsysteminfo.cpp
Normal file
6
src/frame/qqtsysteminfo.cpp
Normal file
@ -0,0 +1,6 @@
|
|||||||
|
#include "qqtsysteminfo.h"
|
||||||
|
|
||||||
|
QQtSystemInfo::QQtSystemInfo ( QObject* parent ) : QObject ( parent )
|
||||||
|
{
|
||||||
|
|
||||||
|
}
|
80
src/frame/qqtsysteminfo.h
Normal file
80
src/frame/qqtsysteminfo.h
Normal file
@ -0,0 +1,80 @@
|
|||||||
|
#ifndef QQTSYSTEMINFO_H
|
||||||
|
#define QQTSYSTEMINFO_H
|
||||||
|
|
||||||
|
#include <QObject>
|
||||||
|
|
||||||
|
typedef struct tDiskInfo
|
||||||
|
{
|
||||||
|
tDiskInfo() {}
|
||||||
|
quint32 mSize; //B
|
||||||
|
quint32 mAvalableSize; //B
|
||||||
|
} TDiskInfo;
|
||||||
|
|
||||||
|
typedef struct tDiskTable
|
||||||
|
{
|
||||||
|
tDiskTable() {}
|
||||||
|
quint32 mNum;
|
||||||
|
QList<TDiskInfo> mList;
|
||||||
|
} TDiskTable;
|
||||||
|
|
||||||
|
typedef struct tMemInfo
|
||||||
|
{
|
||||||
|
tMemInfo() {}
|
||||||
|
} TMemInfo;
|
||||||
|
|
||||||
|
typedef struct tMemTable
|
||||||
|
{
|
||||||
|
tMemTable() {}
|
||||||
|
quint32 mTotalSize;//B
|
||||||
|
quint32 mAvalableSize;//B
|
||||||
|
quint32 mNum;
|
||||||
|
QList<TMemInfo> mList;
|
||||||
|
} TMemTable;
|
||||||
|
|
||||||
|
typedef struct tCPUInfo
|
||||||
|
{
|
||||||
|
tCPUInfo() {}
|
||||||
|
quint32 mCoreNum;
|
||||||
|
quint32 mThreadNumPerCore;
|
||||||
|
quint32 mRate;
|
||||||
|
} TCPUInfo;
|
||||||
|
|
||||||
|
typedef struct tCPUTable
|
||||||
|
{
|
||||||
|
tCPUTable() {}
|
||||||
|
quint32 mNum;
|
||||||
|
QList<TCPUInfo> mList;
|
||||||
|
} TCPUTable;
|
||||||
|
|
||||||
|
class QQtSystemInfo : public QObject
|
||||||
|
{
|
||||||
|
Q_OBJECT
|
||||||
|
public:
|
||||||
|
explicit QQtSystemInfo ( QObject* parent = nullptr );
|
||||||
|
|
||||||
|
bool getCPUInfo ( TCPUTable& cpuInfo ) {
|
||||||
|
#if 0
|
||||||
|
#if defined(Q_OS_WIN32) || defined (Q_OS_WIN64)
|
||||||
|
SYSTEM_INFO systemInfo;
|
||||||
|
GetSystemInfo ( &systemInfo );
|
||||||
|
qDebug() << QStringLiteral ( "处理器掩码:" ) << systemInfo.dwActiveProcessorMask;
|
||||||
|
qDebug() << QStringLiteral ( "处理器个数:" ) << systemInfo.dwNumberOfProcessors;
|
||||||
|
qDebug() << QStringLiteral ( "处理器分页大小:" ) << systemInfo.dwPageSize;
|
||||||
|
qDebug() << QStringLiteral ( "处理器类型:" ) << systemInfo.dwProcessorType;
|
||||||
|
qDebug() << QStringLiteral ( "最大寻址单元:" ) << systemInfo.lpMaximumApplicationAddress;
|
||||||
|
qDebug() << QStringLiteral ( "最小寻址单元:" ) << systemInfo.lpMinimumApplicationAddress;
|
||||||
|
qDebug() << QStringLiteral ( "处理器等级:" ) << systemInfo.wProcessorLevel;
|
||||||
|
qDebug() << QStringLiteral ( "处理器版本:" ) << systemInfo.wProcessorRevision;
|
||||||
|
#else
|
||||||
|
|
||||||
|
#endif
|
||||||
|
#endif
|
||||||
|
}
|
||||||
|
signals:
|
||||||
|
|
||||||
|
public slots:
|
||||||
|
|
||||||
|
private:
|
||||||
|
};
|
||||||
|
|
||||||
|
#endif // QQTSYSTEMINFO_H
|
@ -1,6 +0,0 @@
|
|||||||
#include "qqtsysteminfo.h"
|
|
||||||
|
|
||||||
QQtSystemInfo::QQtSystemInfo(QObject *parent) : QObject(parent)
|
|
||||||
{
|
|
||||||
|
|
||||||
}
|
|
@ -1,23 +0,0 @@
|
|||||||
#ifndef QQTSYSTEMINFO_H
|
|
||||||
#define QQTSYSTEMINFO_H
|
|
||||||
|
|
||||||
#include <QObject>
|
|
||||||
|
|
||||||
class QQtSystemInfoPrivate;
|
|
||||||
|
|
||||||
class QQtSystemInfo : public QObject
|
|
||||||
{
|
|
||||||
Q_OBJECT
|
|
||||||
public:
|
|
||||||
explicit QQtSystemInfo ( QObject* parent = nullptr );
|
|
||||||
|
|
||||||
signals:
|
|
||||||
|
|
||||||
public slots:
|
|
||||||
|
|
||||||
private:
|
|
||||||
Q_DECLARE_PRIVATE ( QQtSystemInfo )
|
|
||||||
Q_DISABLE_COPY ( QQtSystemInfo )
|
|
||||||
};
|
|
||||||
|
|
||||||
#endif // QQTSYSTEMINFO_H
|
|
@ -1,6 +0,0 @@
|
|||||||
#include "qqtsysteminfoprivate.h"
|
|
||||||
|
|
||||||
QQtSystemInfoPrivate::QQtSystemInfoPrivate(QObject *parent) : QObject(parent)
|
|
||||||
{
|
|
||||||
|
|
||||||
}
|
|
@ -1,17 +0,0 @@
|
|||||||
#ifndef QQTSYSTEMINFOPRIVATE_H
|
|
||||||
#define QQTSYSTEMINFOPRIVATE_H
|
|
||||||
|
|
||||||
#include <QObject>
|
|
||||||
|
|
||||||
class QQtSystemInfoPrivate : public QObject
|
|
||||||
{
|
|
||||||
Q_OBJECT
|
|
||||||
public:
|
|
||||||
explicit QQtSystemInfoPrivate(QObject *parent = nullptr);
|
|
||||||
|
|
||||||
signals:
|
|
||||||
|
|
||||||
public slots:
|
|
||||||
};
|
|
||||||
|
|
||||||
#endif // QQTSYSTEMINFOPRIVATE_H
|
|
0
src/linux_cd_path.sh
Normal file → Executable file
0
src/linux_cd_path.sh
Normal file → Executable file
0
src/linux_cp_files.sh
Normal file → Executable file
0
src/linux_cp_files.sh
Normal file → Executable file
0
src/linux_cur_path.sh
Normal file → Executable file
0
src/linux_cur_path.sh
Normal file → Executable file
@ -52,29 +52,30 @@ public:
|
|||||||
*/
|
*/
|
||||||
inline virtual quint16 splitter ( const QByteArray& ) { return 0; }
|
inline virtual quint16 splitter ( const QByteArray& ) { return 0; }
|
||||||
/**
|
/**
|
||||||
* @brief 语义解析器
|
* @brief 语义解析器 分发报文
|
||||||
* /.../quint16 size/.../QByteArray data/.../
|
* /.../quint16 size/.../QByteArray data/.../
|
||||||
* @param 数据包
|
* @param 数据包
|
||||||
* @return 0 no dispatched(others) 1 dispatched(own)
|
* @return 0 no dispatched(others) 1 dispatched(own)
|
||||||
*/
|
*/
|
||||||
inline virtual bool dispatcher ( const QByteArray& ) { return 0; }
|
inline virtual bool dispatcher ( const QByteArray& ) { return 0; }
|
||||||
|
|
||||||
/*
|
|
||||||
* 以下函数,与用户无关。
|
|
||||||
*/
|
|
||||||
signals:
|
signals:
|
||||||
/**
|
/**
|
||||||
* @brief notifyToProtocolManager
|
* @brief notifyToProtocolManager
|
||||||
* 为服务器功能的ProtocolManager添加的,用户不必管理,必要时调用。
|
* 为服务器功能的ProtocolManager添加的,用户,必要时调用。
|
||||||
*
|
*
|
||||||
* 用户继承下去的协议里,在dispatcher的recv函数里,如果必要把收到的信息传递给上层,
|
* 用户继承下去的协议里,在dispatcher的recv函数里,如果必要把收到的信息传递给上层,
|
||||||
* 那么通过emit notifyToProtocolManager,传递给ProtocolManager
|
* 那么通过emit notifyToProtocolManager,传递给ProtocolManager
|
||||||
* BusinessLevel对这些接收到的信息感兴趣,
|
* BusinessLevel对这些接收到的信息感兴趣,
|
||||||
* 那么通过连接ProtocolManager的notifyToBusinessLevel对拿到的信息进行处理,会包括协议句柄,使用户方便写回客户。
|
* 那么通过连接ProtocolManager的notifyToBusinessLevel对拿到的信息进行处理,会包括协议句柄,使用户方便写回客户。
|
||||||
|
* 当然,用户不必管理这个信号和PM的信号的连接,PM内部自动管理了。
|
||||||
* @param self
|
* @param self
|
||||||
* @param message
|
* @param message
|
||||||
*/
|
*/
|
||||||
void notifyToProtocolManager ( const QQtProtocol* self, const QQtMessage* message );
|
void notifyToProtocolManager ( const QQtProtocol* self, const QQtMessage* message );
|
||||||
|
/*
|
||||||
|
* 以下函数,与用户无关。
|
||||||
|
*/
|
||||||
/**
|
/**
|
||||||
* 如果Socket和这个Protocol关联,就会设置关联。
|
* 如果Socket和这个Protocol关联,就会设置关联。
|
||||||
*/
|
*/
|
||||||
|
@ -14,12 +14,6 @@
|
|||||||
#2018年4月6日18点12分
|
#2018年4月6日18点12分
|
||||||
#这里是LibQQt源文件pri,所有开关宏都在LibQQt头文件pri里开关。
|
#这里是LibQQt源文件pri,所有开关宏都在LibQQt头文件pri里开关。
|
||||||
#-------------------------------------------------
|
#-------------------------------------------------
|
||||||
SOURCES = \
|
|
||||||
$$PWD/frame/systeminfo/qqtsysteminfo.cpp \
|
|
||||||
$$PWD/frame/systeminfo/qqtsysteminfoprivate.cpp
|
|
||||||
HEADERS = \
|
|
||||||
$$PWD/frame/systeminfo/qqtsysteminfo.h \
|
|
||||||
$$PWD/frame/systeminfo/qqtsysteminfoprivate.h
|
|
||||||
|
|
||||||
#root dir
|
#root dir
|
||||||
HEADERS += $$PWD/qqt.h \
|
HEADERS += $$PWD/qqt.h \
|
||||||
@ -146,6 +140,11 @@ FORMS += \
|
|||||||
$$PWD/widgets/qqtprogressbar.ui
|
$$PWD/widgets/qqtprogressbar.ui
|
||||||
|
|
||||||
#frame
|
#frame
|
||||||
|
SOURCES += \
|
||||||
|
$$PWD/frame/qqtsysteminfo.cpp
|
||||||
|
HEADERS += \
|
||||||
|
$$PWD/frame/qqtsysteminfo.h
|
||||||
|
|
||||||
SOURCES += \
|
SOURCES += \
|
||||||
$$PWD/frame/qqtlineeditwithsearch.cpp \
|
$$PWD/frame/qqtlineeditwithsearch.cpp \
|
||||||
$$PWD/frame/qqtosdwidget.cpp
|
$$PWD/frame/qqtosdwidget.cpp
|
||||||
|
Loading…
x
Reference in New Issue
Block a user