Showing the changes to interface/src/scripting/PlatformInfoScriptingInterface.cpp (1 of 2 files). Show all
Unified · Split
| @@ -7,6 +7,10 @@ · 6 unmodified lines | ||
| 7 | 7 | // |
| 8 | 8 | #include "PlatformInfoScriptingInterface.h" |
| 9 | 9 | |
| 10 | +#ifdef Q_OS_WIN | |
| 11 | +#include <Windows.h> | |
| 12 | +#endif | |
| 13 | + | |
| 10 | 14 | PlatformInfoScriptingInterface* PlatformInfoScriptingInterface::getInstance() { |
| 11 | 15 | static PlatformInfoScriptingInterface sharedInstance; |
| 12 | 16 | return &sharedInstance; |
| @@ -23,6 +27,7 @@ QString PlatformInfoScriptingInterface::getOperatingSystemType() { · 10 unmodified lines | ||
| 23 | 27 | } |
| 24 | 28 | |
| 25 | 29 | QString PlatformInfoScriptingInterface::getCPUBrand() { |
| 30 | +#ifdef Q_OS_WIN | |
| 26 | 31 | int CPUInfo[4] = { -1 }; |
| 27 | 32 | unsigned nExIds, i = 0; |
| 28 | 33 | char CPUBrandString[0x40]; |
| @@ -42,16 +47,21 @@ QString PlatformInfoScriptingInterface::getCPUBrand() { · 13 unmodified lines | ||
| 42 | 47 | } |
| 43 | 48 | |
| 44 | 49 | return CPUBrandString; |
| 45 | − //////string includes manufacturer, model and clockspeed | |
| 46 | − ////cout << "CPU Type: " << CPUBrandString << endl; | |
| 47 | − | |
| 48 | − | |
| 49 | − ////SYSTEM_INFO sysInfo; | |
| 50 | − ////GetSystemInfo(&sysInfo); | |
| 51 | − ////cout << "Number of Cores: " << sysInfo.dwNumberOfProcessors << endl; | |
| 52 | − | |
| 50 | +#else | |
| 51 | + return "NOT IMPLEMENTED"; | |
| 52 | +#endif | |
| 53 | +} | |
| 53 | 54 | ////MEMORYSTATUSEX statex; |
| 54 | 55 | ////statex.dwLength = sizeof (statex); |
| 55 | 56 | ////GlobalMemoryStatusEx(&statex); |
| 56 | 57 | ////cout << "Total System Memory: " << (statex.ullTotalPhys / 1024) / 1024 << "MB" << endl; |
| 58 | + | |
| 59 | +int PlatformInfoScriptingInterface::getNumCores() { | |
| 60 | +#ifdef Q_OS_WIN | |
| 61 | + SYSTEM_INFO sysInfo; | |
| 62 | + GetSystemInfo(&sysInfo); | |
| 63 | + return sysInfo.dwNumberOfProcessors; | |
| 64 | +#else | |
| 65 | + return -1; | |
| 66 | +#endif | |
| 57 | 67 | } |