QElectroTech  0.8-dev
machine_info.h
Go to the documentation of this file.
1 /*
2  Copyright 2006-2020 The QElectroTech Team
3  This file is part of QElectroTech.
4 
5  QElectroTech is free software: you can redistribute it and/or modify
6  it under the terms of the GNU General Public License as published by
7  the Free Software Foundation, either version 2 of the License, or
8  (at your option) any later version.
9 
10  QElectroTech is distributed in the hope that it will be useful,
11  but WITHOUT ANY WARRANTY; without even the implied warranty of
12  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13  GNU General Public License for more details.
14 
15  You should have received a copy of the GNU General Public License
16  along with QElectroTech. If not, see <http://www.gnu.org/licenses/>.
17 */
18 #ifndef MACHINE_INFO_H
19 #define MACHINE_INFO_H
20 
21 #include <QObject>
22 #include <QThread>
23 
28 class Machine_info : public QObject
29 {
30  Q_OBJECT
31 public:
32  explicit Machine_info(QObject *parent = nullptr);
33  int32_t i_max_screen_width();
34  int32_t i_max_screen_height();
35  QString compilation_info();
36  void send_info_to_debug();
37 
38 signals:
39 
40 private:
41  void init_get_Screen_info();
42  void init_get_cpu_info();
46  struct Pc
47  {
48  struct Screen
49  {
50  int32_t count;
51  int32_t width[10];
52  int32_t height[10];
53  int32_t Max_width;
54  int32_t Max_height;
56  struct Built
57  {
58  QString version=
59  #ifdef __GNUC__
60  #ifdef __APPLE_CC__
61  "CLANG " + QString(__clang_version__);
62  #else
63  "GCC " + QString(__VERSION__);
64 #endif
65 #endif
66  QString QT=QString(QT_VERSION_STR);
67  QString date=QString(__DATE__);
68  QString time=QString(__TIME__);
70  struct CPU
71  {
72  QString info;
73  QString Architecture=QString(
74  QSysInfo::currentCpuArchitecture());
75  int32_t ThreadCount=QThread::idealThreadCount();
76  }cpu;
77  struct RAM
78  {
79  QString Total;
80  QString Available;
81  }ram;
82  struct GPU
83  {
84  QString info;
85  QString RAM;
86 
87  }gpu;
88  struct OS
89  {
90  QString type=QString(QSysInfo::kernelType());
91  QString name=QString(QSysInfo::prettyProductName());
92  QString kernel=QString(QSysInfo::kernelVersion());
93  }os;
94  }pc;
95 
96 
97 };
98 
99 #endif // MACHINE_INFO_H
Machine_info::Pc::GPU
Definition: machine_info.h:83
Machine_info::Pc::gpu
struct Machine_info::Pc::GPU gpu
Machine_info::Pc::Built
Definition: machine_info.h:57
Machine_info::Pc::cpu
struct Machine_info::Pc::CPU cpu
Machine_info::Pc::Built::version
QString version
Definition: machine_info.h:58
QET::version
const QString version
QElectroTech version (as string, used to mark projects and elements XML documents)
Definition: qet.h:32
Machine_info::Pc
Definition: machine_info.h:47
Machine_info::Pc::ram
struct Machine_info::Pc::RAM ram
Machine_info::pc
struct Machine_info::Pc pc
Machine_info::Pc::OS::kernel
QString kernel
Definition: machine_info.h:92
Machine_info::Pc::OS
Definition: machine_info.h:89
Machine_info::send_info_to_debug
void send_info_to_debug()
Machine_info::send_info_to_debug.
Definition: machine_info.cpp:45
Machine_info::Pc::Screen::height
int32_t height[10]
Definition: machine_info.h:52
Machine_info::Pc::Screen::width
int32_t width[10]
Definition: machine_info.h:51
Machine_info::compilation_info
QString compilation_info()
Machine_info::compilation_info.
Definition: machine_info.cpp:303
Machine_info::Pc::Screen::Max_height
int32_t Max_height
Definition: machine_info.h:54
Machine_info::Pc::Screen::count
int32_t count
Definition: machine_info.h:50
qet.h
Machine_info::Pc::CPU::ThreadCount
int32_t ThreadCount
Definition: machine_info.h:75
QET::displayedVersion
const QString displayedVersion
QElectroTech displayed version.
Definition: qet.h:34
Machine_info::Pc::RAM::Total
QString Total
Definition: machine_info.h:79
Machine_info::Pc::os
struct Machine_info::Pc::OS os
Machine_info::init_get_cpu_info_linux
void init_get_cpu_info_linux()
Machine_info::init_get_cpu_info_linux.
Definition: machine_info.cpp:158
machine_info.h
Machine_info::Pc::OS::type
QString type
Definition: machine_info.h:90
Machine_info::Pc::Screen
Definition: machine_info.h:49
Machine_info::i_max_screen_height
int32_t i_max_screen_height()
Machine_info::i_max_screen_height.
Definition: machine_info.cpp:294
Machine_info::Pc::GPU::RAM
QString RAM
Definition: machine_info.h:85
Machine_info::Pc::CPU
Definition: machine_info.h:71
Machine_info::Pc::RAM
Definition: machine_info.h:78
Machine_info::init_get_cpu_info_winnt
void init_get_cpu_info_winnt()
Machine_info::init_get_cpu_info_winnt.
Definition: machine_info.cpp:204
Machine_info::Pc::GPU::info
QString info
Definition: machine_info.h:84
Machine_info::Pc::CPU::info
QString info
Definition: machine_info.h:72
Machine_info::Pc::screen
struct Machine_info::Pc::Screen screen
Machine_info::Pc::RAM::Available
QString Available
Definition: machine_info.h:80
Machine_info::init_get_Screen_info
void init_get_Screen_info()
Machine_info::init_get_Screen_info Finds the largest screen and saves the values.
Definition: machine_info.cpp:119
Machine_info::i_max_screen_width
int32_t i_max_screen_width()
Machine_info::i_max_screen_width.
Definition: machine_info.cpp:285
Machine_info::Pc::Built::date
QString date
Definition: machine_info.h:67
Machine_info::Pc::built
struct Machine_info::Pc::Built built
Machine_info::Pc::Built::time
QString time
Definition: machine_info.h:68
Machine_info::Pc::CPU::Architecture
QString Architecture
Definition: machine_info.h:73
Machine_info
The Machine_info class This class hold information from your PC.
Definition: machine_info.h:29
Machine_info::Pc::Screen::Max_width
int32_t Max_width
Definition: machine_info.h:53
Machine_info::init_get_cpu_info
void init_get_cpu_info()
Machine_info::init_get_cpu_info.
Definition: machine_info.cpp:141
QET::Icons::tr
QIcon tr
Definition: qeticons.cpp:206
Machine_info::Machine_info
Machine_info(QObject *parent=nullptr)
Machine_info::Machine_info.
Definition: machine_info.cpp:36
Machine_info::Pc::OS::name
QString name
Definition: machine_info.h:91
Machine_info::init_get_cpu_info_macos
void init_get_cpu_info_macos()
Machine_info::init_get_cpu_info_macos.
Definition: machine_info.cpp:258