bypassing the static keys for now so that the pr can get build and go in

This commit is contained in:
amerhifi 2019-05-15 13:13:43 -07:00
parent ff742ecd97
commit 1da5298086
5 changed files with 46 additions and 44 deletions

View file

@ -15,19 +15,19 @@ using namespace platform;
void AndroidInstance::enumerateCpu() { void AndroidInstance::enumerateCpu() {
json cpu; json cpu;
cpu[jsonKeys::cpuBrand] = ""; cpu["cpuBrand"] = "";
cpu[jsonKeys::cpuModel] = ""; cpu["cpuModel"] = "";
cpu[jsonKeys::cpuClockSpeed] = ""; cpu["cpuClockSpeed"] = "";
cpu[jsonKeys::cpuNumCores] = ""; cpu["cpuNumCores"] = "";
_cpu.push_back(cpu); _cpu.push_back(cpu);
} }
void AndroidInstance::enumerateGpu() { void AndroidInstance::enumerateGpu() {
GPUIdent* ident = GPUIdent::getInstance(); GPUIdent* ident = GPUIdent::getInstance();
json gpu = {}; json gpu = {};
gpu[jsonKeys::gpuName] = ident->getName().toUtf8().constData(); gpu["gpuName"] = ident->getName().toUtf8().constData();
gpu[jsonKeys::gpuMemory] = ident->getMemory(); gpu["gpuMemory"] = ident->getMemory();
gpu[jsonKeys::gpuDriver] = ident->getDriver().toUtf8().constData(); gpu["gpuDriver"] = ident->getDriver().toUtf8().constData();
_gpu.push_back(gpu); _gpu.push_back(gpu);
_display = ident->getOutput(); _display = ident->getOutput();

View file

@ -15,10 +15,10 @@ using namespace platform;
void LinuxInstance::enumerateCpu() { void LinuxInstance::enumerateCpu() {
json cpu = {}; json cpu = {};
cpu[jsonKeys::cpuBrand] = ""; cpu["cpuBrand"] = "";
cpu[jsonKeys::cpuModel] = ""; cpu["cpuModel"] = "";
cpu[jsonKeys::cpuClockSpeed] = ""; cpu["cpuClockSpeed"] = "";
cpu[jsonKeys::cpuNumCores] = ""; cpu["cpuNumCores"] = "";
_cpu.push_back(cpu); _cpu.push_back(cpu);
} }
@ -26,9 +26,9 @@ void LinuxInstance::enumerateCpu() {
void LinuxInstance::enumerateGpu() { void LinuxInstance::enumerateGpu() {
GPUIdent* ident = GPUIdent::getInstance(); GPUIdent* ident = GPUIdent::getInstance();
json gpu = {}; json gpu = {};
gpu[jsonKeys::gpuName] = ident->getName().toUtf8().constData(); gpu["gpuName"] = ident->getName().toUtf8().constData();
gpu[jsonKeys::gpuMemory] = ident->getMemory(); gpu["gpuMemory"] = ident->getMemory();
gpu[jsonKeys::gpuDriver] = ident->getDriver().toUtf8().constData(); gpu["gpuDriver"] = ident->getDriver().toUtf8().constData();
_gpu.push_back(gpu); _gpu.push_back(gpu);
_display = ident->getOutput(); _display = ident->getOutput();

View file

@ -55,10 +55,10 @@ void MACOSInstance::enumerateCpu() {
} }
} }
cpu[jsonKeys::cpuBrand] = CPUBrandString; cpu["cpuBrand"] = CPUBrandString;
cpu[jsonKeys::cpuModel] = CPUModelString; cpu["cpuModel"] = CPUModelString;
cpu[jsonKeys::cpuClockSpeed] = CPUClockString; cpu["cpuClockSpeed"] = CPUClockString;
cpu[jsonKeys::cpuNumCores] = std::thread::hardware_concurrency(); cpu["cpuNumCores"] = std::thread::hardware_concurrency();
_cpu.push_back(cpu); _cpu.push_back(cpu);
} }
@ -66,9 +66,9 @@ void MACOSInstance::enumerateCpu() {
void MACOSInstance::enumerateGpu() { void MACOSInstance::enumerateGpu() {
GPUIdent* ident = GPUIdent::getInstance(); GPUIdent* ident = GPUIdent::getInstance();
json gpu = {}; json gpu = {};
gpu[jsonKeys::gpuName] = ident->getName().toUtf8().constData(); gpu["gpuName"] = ident->getName().toUtf8().constData();
gpu[jsonKeys::gpuMemory] = ident->getMemory(); gpu["gpuMemory"] = ident->getMemory();
gpu[jsonKeys::gpuDriver] = ident->getDriver().toUtf8().constData(); gpu["gpuDriver"] = ident->getDriver().toUtf8().constData();
_gpu.push_back(gpu); _gpu.push_back(gpu);
_display = ident->getOutput(); _display = ident->getOutput();
@ -80,7 +80,7 @@ void MACOSInstance::enumerateMemory() {
#ifdef Q_OS_MAC #ifdef Q_OS_MAC
long pages = sysconf(_SC_PHYS_PAGES); long pages = sysconf(_SC_PHYS_PAGES);
long page_size = sysconf(_SC_PAGE_SIZE); long page_size = sysconf(_SC_PAGE_SIZE);
ram[jsonKeys::totalMemory] = pages * page_size;; ram["totalMemory"] = pages * page_size;;
#endif #endif
_memory.push_back(ram); _memory.push_back(ram);
} }

View file

@ -46,10 +46,10 @@ void WINInstance::enumerateCpu() {
} }
} }
cpu[jsonKeys::cpuBrand] = CPUBrandString; cpu["cpuBrand"] = CPUBrandString;
cpu[jsonKeys::cpuModel] = CPUModelString; cpu["cpuModel"] = CPUModelString;
cpu[jsonKeys::cpuClockSpeed] = CPUClockString; cpu["cpuClockSpeed"] = CPUClockString;
cpu[jsonKeys::cpuNumCores] = std::thread::hardware_concurrency(); cpu["cpuNumCores"] = std::thread::hardware_concurrency();
#endif #endif
_cpu.push_back(cpu); _cpu.push_back(cpu);
@ -60,9 +60,9 @@ void WINInstance::enumerateGpu() {
GPUIdent* ident = GPUIdent::getInstance(); GPUIdent* ident = GPUIdent::getInstance();
json gpu = {}; json gpu = {};
gpu[jsonKeys::gpuName] = ident->getName().toUtf8().constData(); gpu["gpuName"] = ident->getName().toUtf8().constData();
gpu[jsonKeys::gpuMemory] = ident->getMemory(); gpu["gpuMemory"] = ident->getMemory();
gpu[jsonKeys::gpuDriver] = ident->getDriver().toUtf8().constData(); gpu["gpuDriver"] = ident->getDriver().toUtf8().constData();
_gpu.push_back(gpu); _gpu.push_back(gpu);
_display = ident->getOutput(); _display = ident->getOutput();

View file

@ -11,20 +11,22 @@
namespace platform { namespace platform {
namespace jsonKeys{ namespace jsonKeys{
static const char* cpuBrand= "cpuBrand"; #if 0
static const char* cpuModel = "cpuModel"; static const char* cpuBrand { "cpuBrand"};
static const char* cpuClockSpeed = "clockSpeed"; static const char* cpuModel {"cpuModel"};
static const char* cpuNumCores = "numCores"; static const char* cpuClockSpeed {"clockSpeed"};
static const char* gpuName = "GpuName"; static const char* cpuNumCores { "numCores"};
static const char* gpuMemory = "gpuMemory"; static const char* gpuName {"GpuName"};
static const char* gpuDriver = "gpuDriver"; static const char* gpuMemory {"gpuMemory"};
static const char* totalMemory = "totalMem"; static const char* gpuDriver {"gpuDriver"};
static const char* displayDescription = "description"; static const char* totalMemory {"totalMem"};
static const char* displayName = "deviceName"; static const char* displayDescription { "description"};
static const char* displayCoordsLeft = "coordinatesleft"; static const char* displayName {"deviceName"};
static const char* displayCoordsRight = "coordinatesright"; static const char* displayCoordsLeft {"coordinatesleft"};
static const char* displayCoordsTop = "coordinatestop"; static const char* displayCoordsRight { "coordinatesright"};
static const char* displayCoordsBottom = "coordinatesbottom"; static const char* displayCoordsTop { "coordinatestop"};
static const char* displayCoordsBottom { "coordinatesbottom"};
#endif
} }
} // namespace platform } // namespace platform