cpu usage reader error report added

This commit is contained in:
turanszkij
2016-10-13 21:50:35 +02:00
parent 9c508f3783
commit 27652bfd83
4 changed files with 14 additions and 4 deletions
+11 -1
View File
@@ -175,7 +175,17 @@ void MainComponent::Compose()
}
if (infoDisplay.cpuinfo)
{
ss << "CPU: " << wiCpuInfo::GetCpuPercentage() << "%" << endl;
int cpupercentage = wiCpuInfo::GetCpuPercentage();
ss << "CPU: ";
if (cpupercentage >= 0)
{
ss << cpupercentage << "%";
}
else
{
ss << "Query failed";
}
ss << endl;
}
wiFont(ss.str(), wiFontProps(0, 0, infoDisplay.size, WIFALIGN_LEFT, WIFALIGN_TOP)).Draw();
}
+1 -1
View File
@@ -87,7 +87,7 @@ int wiCpuInfo::GetCpuPercentage()
}
else
{
usage = 0;
usage = -1;
}
return usage;
+1 -1
View File
@@ -32,7 +32,7 @@ public:
static void Initialize(){}
static void Shutdown(){}
static void Frame(){}
static int GetCpuPercentage(){ return 0; }
static int GetCpuPercentage(){ return -1; }
#endif
};
+1 -1
View File
@@ -7,7 +7,7 @@ namespace wiVersion
// minor features, major updates
const int minor = 9;
// minor bug fixes, alterations, refactors, updates
const int revision = 13;
const int revision = 14;
long GetVersion()