Show N/A on unsupported platforms instead of 0KHz

This commit is contained in:
Arnavion 2019-08-10 17:17:45 -07:00
parent 43728b37e7
commit 909bb86f05
6 changed files with 17 additions and 1 deletions

View File

@ -217,6 +217,8 @@ double Platform_setCPUValues(Meter* mtr, int cpu) {
/* Convert to percent and return */ /* Convert to percent and return */
total = mtr->values[CPU_METER_NICE] + mtr->values[CPU_METER_NORMAL] + mtr->values[CPU_METER_KERNEL]; total = mtr->values[CPU_METER_NICE] + mtr->values[CPU_METER_NORMAL] + mtr->values[CPU_METER_KERNEL];
mtr->values[CPU_METER_FREQUENCY] = -1;
return CLAMP(total, 0.0, 100.0); return CLAMP(total, 0.0, 100.0);
} }

View File

@ -179,6 +179,9 @@ double Platform_setCPUValues(Meter* this, int cpu) {
percent = CLAMP(percent, 0.0, 100.0); percent = CLAMP(percent, 0.0, 100.0);
if (isnan(percent)) percent = 0.0; if (isnan(percent)) percent = 0.0;
v[CPU_METER_FREQUENCY] = -1;
return percent; return percent;
} }

View File

@ -178,6 +178,9 @@ double Platform_setCPUValues(Meter* this, int cpu) {
percent = CLAMP(percent, 0.0, 100.0); percent = CLAMP(percent, 0.0, 100.0);
if (isnan(percent)) percent = 0.0; if (isnan(percent)) percent = 0.0;
v[CPU_METER_FREQUENCY] = -1;
return percent; return percent;
} }

View File

@ -233,6 +233,8 @@ double Platform_setCPUValues(Meter* this, int cpu) {
perc = v[0] + v[1] + v[2] + v[3]; perc = v[0] + v[1] + v[2] + v[3];
v[CPU_METER_FREQUENCY] = -1;
if (perc <= 100. && perc >= 0.) { if (perc <= 100. && perc >= 0.) {
return perc; return perc;
} else { } else {

View File

@ -203,6 +203,9 @@ double Platform_setCPUValues(Meter* this, int cpu) {
percent = CLAMP(percent, 0.0, 100.0); percent = CLAMP(percent, 0.0, 100.0);
if (isnan(percent)) percent = 0.0; if (isnan(percent)) percent = 0.0;
v[CPU_METER_FREQUENCY] = -1;
return percent; return percent;
} }

View File

@ -108,8 +108,11 @@ int Platform_getMaxPid() {
} }
double Platform_setCPUValues(Meter* this, int cpu) { double Platform_setCPUValues(Meter* this, int cpu) {
(void) this;
(void) cpu; (void) cpu;
double* v = this->values;
v[CPU_METER_FREQUENCY] = -1;
return 0.0; return 0.0;
} }