add battery

This commit is contained in:
xueyan hu
2022-01-11 16:58:03 +08:00
parent 7bf85c0b4f
commit 3a517696e0
20 changed files with 1353 additions and 430 deletions

28
src/json/cmdhelper.h Normal file
View File

@@ -0,0 +1,28 @@
#ifndef CMDHELPER_H
#define CMDHELPER_H
#include <QObject>
#include <QString>
class cmdHelper : public QObject
{
Q_OBJECT
public:
static cmdHelper* Instance()
{
static cmdHelper obj;
return &obj;
}
bool getDiskSize(double& size);
bool getDiskUsed(double& used);
QString getLinuxVersion();
QString getDCMTKVersion();
private:
bool exec(const char* cmd, std::string& result);
bool exec2(const char* cmd, std::string& result);
explicit cmdHelper(QObject* parent = nullptr);
};
#endif // CMDHEPLER_H