tz: more precision.
This commit is contained in:
parent
0f89e698bb
commit
384030bade
|
@ -638,7 +638,7 @@ swap_out:
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
_temperature_cpu_get(int *temperature)
|
_thermal_zone_temp_get(float *temperature)
|
||||||
{
|
{
|
||||||
#if defined(__OpenBSD__) || defined(__NetBSD__)
|
#if defined(__OpenBSD__) || defined(__NetBSD__)
|
||||||
int mibs[5] = { CTL_HW, HW_SENSORS, 0, 0, 0 };
|
int mibs[5] = { CTL_HW, HW_SENSORS, 0, 0, 0 };
|
||||||
|
@ -721,7 +721,7 @@ _temperature_cpu_get(int *temperature)
|
||||||
char *value = file_contents(path);
|
char *value = file_contents(path);
|
||||||
if (value)
|
if (value)
|
||||||
{
|
{
|
||||||
*temperature = atoi(value) / 1000;
|
*temperature = (float)atoi(value) / 1000.0;
|
||||||
free(value);
|
free(value);
|
||||||
free(type);
|
free(type);
|
||||||
break;
|
break;
|
||||||
|
@ -1176,12 +1176,12 @@ _results_cpu(cpu_core_t **cores, int cpu_count)
|
||||||
return total;
|
return total;
|
||||||
}
|
}
|
||||||
|
|
||||||
int
|
float
|
||||||
system_temperature_cpu_get(void)
|
system_thermal_zone_temp_get(void)
|
||||||
{
|
{
|
||||||
int temp;
|
float temp;
|
||||||
|
|
||||||
_temperature_cpu_get(&temp);
|
_thermal_zone_temp_get(&temp);
|
||||||
|
|
||||||
return temp;
|
return temp;
|
||||||
}
|
}
|
||||||
|
@ -1276,7 +1276,7 @@ sys_info_all_get(void)
|
||||||
if (_power_battery_count_get(&results->power))
|
if (_power_battery_count_get(&results->power))
|
||||||
_power_state_get(&results->power);
|
_power_state_get(&results->power);
|
||||||
|
|
||||||
_temperature_cpu_get(&results->temperature);
|
_thermal_zone_temp_get(&results->temperature);
|
||||||
|
|
||||||
if (!error)
|
if (!error)
|
||||||
{
|
{
|
||||||
|
|
|
@ -61,7 +61,7 @@ struct Sys_Info
|
||||||
|
|
||||||
unsigned long incoming;
|
unsigned long incoming;
|
||||||
unsigned long outgoing;
|
unsigned long outgoing;
|
||||||
int temperature;
|
float temperature;
|
||||||
};
|
};
|
||||||
|
|
||||||
Sys_Info *
|
Sys_Info *
|
||||||
|
|
|
@ -100,7 +100,7 @@ ui_tab_cpu_update(Ui *ui, Sys_Info *sysinfo)
|
||||||
|
|
||||||
if (sysinfo->temperature != INVALID_TEMP)
|
if (sysinfo->temperature != INVALID_TEMP)
|
||||||
elm_object_text_set(ui->temp_label,
|
elm_object_text_set(ui->temp_label,
|
||||||
eina_slstr_printf(_("Core at (%d °C)"),
|
eina_slstr_printf(_("Thermal Zone: %1.1f°C"),
|
||||||
sysinfo->temperature));
|
sysinfo->temperature));
|
||||||
|
|
||||||
EINA_LIST_FOREACH(ui->cpu_list, l, pb)
|
EINA_LIST_FOREACH(ui->cpu_list, l, pb)
|
||||||
|
|
Loading…
Reference in New Issue