projects
/
psensor-pkg-ubuntu.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Merge tag 'upstream/1.0.4'
[psensor-pkg-ubuntu.git]
/
src
/
lib
/
psensor.c
diff --git
a/src/lib/psensor.c
b/src/lib/psensor.c
index
5be048e
..
348885a
100644
(file)
--- a/
src/lib/psensor.c
+++ b/
src/lib/psensor.c
@@
-1,5
+1,5
@@
/*
/*
- * Copyright (C) 2010-201
3
jeanfi@gmail.com
+ * Copyright (C) 2010-201
4
jeanfi@gmail.com
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License as
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License as
@@
-209,18
+209,18
@@
int is_fan_type(unsigned int type)
return type & SENSOR_TYPE_FAN;
}
return type & SENSOR_TYPE_FAN;
}
-double cel
c
ius_to_fahrenheit(double c)
+double cel
s
ius_to_fahrenheit(double c)
{
return c * (9.0/5.0) + 32;
}
{
return c * (9.0/5.0) + 32;
}
-double fahrenheit_to_cel
c
ius(double f)
+double fahrenheit_to_cel
s
ius(double f)
{
return (f - 32) * (5.0/9.0);
}
char *
{
return (f - 32) * (5.0/9.0);
}
char *
-psensor_value_to_str(unsigned int type, double value, int use_cel
c
ius)
+psensor_value_to_str(unsigned int type, double value, int use_cel
s
ius)
{
char *str;
const char *unit;
{
char *str;
const char *unit;
@@
-231,10
+231,10
@@
psensor_value_to_str(unsigned int type, double value, int use_celcius)
*/
str = malloc(20);
*/
str = malloc(20);
- unit = psensor_type_to_unit_str(type, use_cel
c
ius);
+ unit = psensor_type_to_unit_str(type, use_cel
s
ius);
- if (is_temp_type(type) && !use_cel
c
ius)
- value = cel
c
ius_to_fahrenheit(value);
+ if (is_temp_type(type) && !use_cel
s
ius)
+ value = cel
s
ius_to_fahrenheit(value);
sprintf(str, "%.0f%s", value, unit);
sprintf(str, "%.0f%s", value, unit);
@@
-244,9
+244,9
@@
psensor_value_to_str(unsigned int type, double value, int use_celcius)
char *
psensor_measure_to_str(const struct measure *m,
unsigned int type,
char *
psensor_measure_to_str(const struct measure *m,
unsigned int type,
- unsigned int use_cel
c
ius)
+ unsigned int use_cel
s
ius)
{
{
- return psensor_value_to_str(type, m->value, use_cel
c
ius);
+ return psensor_value_to_str(type, m->value, use_cel
s
ius);
}
void psensor_set_current_value(struct psensor *sensor, double value)
}
void psensor_set_current_value(struct psensor *sensor, double value)
@@
-437,8
+437,12
@@
struct psensor **get_all_sensors(int use_libatasmart, int values_max_length)
const char *psensor_type_to_str(unsigned int type)
{
const char *psensor_type_to_str(unsigned int type)
{
- if (type & SENSOR_TYPE_NVCTRL)
- return "NVidia GPU";
+ if (type & SENSOR_TYPE_NVCTRL) {
+ if (type & SENSOR_TYPE_TEMP)
+ return "NVIDIA GPU Temperature";
+ else
+ return "NVIDIA GPU";
+ }
if (type & SENSOR_TYPE_ATIADL) {
if (type & SENSOR_TYPE_TEMP)
if (type & SENSOR_TYPE_ATIADL) {
if (type & SENSOR_TYPE_TEMP)
@@
-471,10
+475,10
@@
const char *psensor_type_to_str(unsigned int type)
}
}
-const char *psensor_type_to_unit_str(unsigned int type, int use_cel
c
ius)
+const char *psensor_type_to_unit_str(unsigned int type, int use_cel
s
ius)
{
if (is_temp_type(type)) {
{
if (is_temp_type(type)) {
- if (use_cel
c
ius)
+ if (use_cel
s
ius)
return "\302\260C";
else
return "\302\260F";
return "\302\260C";
else
return "\302\260F";
@@
-541,11
+545,11
@@
struct psensor **psensor_list_copy(struct psensor **sensors)
}
char *
}
char *
-psensor_current_value_to_str(const struct psensor *s, unsigned int
celc
ius)
+psensor_current_value_to_str(const struct psensor *s, unsigned int
use_cels
ius)
{
return psensor_value_to_str(s->type,
psensor_get_current_value(s),
{
return psensor_value_to_str(s->type,
psensor_get_current_value(s),
-
celc
ius);
+
use_cels
ius);
}
struct psensor **psensor_list_filter_graph_enabled(struct psensor **sensors)
}
struct psensor **psensor_list_filter_graph_enabled(struct psensor **sensors)