1
0
mirror of https://github.com/Llewellynvdm/conky.git synced 2024-12-29 05:12:41 +00:00

convert apcupsd_loadbarval to double

This commit is contained in:
Phil Sutter 2009-12-04 01:37:32 +01:00
parent c52ee46cc3
commit f74ae19944
3 changed files with 6 additions and 6 deletions

View File

@ -229,11 +229,11 @@ void update_apcupsd(void) {
return; return;
} }
uint8_t apcupsd_loadbarval(struct text_object *obj) double apcupsd_loadbarval(struct text_object *obj)
{ {
(void)obj; (void)obj;
return round_to_int(atof(info.apcupsd.items[APCUPSD_LOAD]) * 2.55); return atof(info.apcupsd.items[APCUPSD_LOAD]);
} }
#define APCUPSD_PRINT_GENERATOR(name, idx) \ #define APCUPSD_PRINT_GENERATOR(name, idx) \

View File

@ -51,7 +51,7 @@ typedef struct apcupsd_s {
/* Service routine for the conky main thread */ /* Service routine for the conky main thread */
void update_apcupsd(void); void update_apcupsd(void);
uint8_t apcupsd_loadbarval(struct text_object *); double apcupsd_loadbarval(struct text_object *);
void print_apcupsd_name(struct text_object *, char *, int); void print_apcupsd_name(struct text_object *, char *, int);
void print_apcupsd_model(struct text_object *, char *, int); void print_apcupsd_model(struct text_object *, char *, int);

View File

@ -1571,17 +1571,17 @@ struct text_object *construct_text_object(const char *s, const char *arg, long
END OBJ(apcupsd_load, &update_apcupsd) END OBJ(apcupsd_load, &update_apcupsd)
obj->callbacks.print = &print_apcupsd_load; obj->callbacks.print = &print_apcupsd_load;
END OBJ(apcupsd_loadbar, &update_apcupsd) END OBJ(apcupsd_loadbar, &update_apcupsd)
scan_bar(obj, arg, 255); scan_bar(obj, arg, 100);
obj->callbacks.barval = &apcupsd_loadbarval; obj->callbacks.barval = &apcupsd_loadbarval;
#ifdef X11 #ifdef X11
END OBJ(apcupsd_loadgraph, &update_apcupsd) END OBJ(apcupsd_loadgraph, &update_apcupsd)
char* buf = 0; char* buf = 0;
buf = scan_graph(obj, arg, 255); buf = scan_graph(obj, arg, 100);
if (buf) free(buf); if (buf) free(buf);
obj->callbacks.graphval = &apcupsd_loadbarval; obj->callbacks.graphval = &apcupsd_loadbarval;
#endif /* X11 */ #endif /* X11 */
END OBJ(apcupsd_loadgauge, &update_apcupsd) END OBJ(apcupsd_loadgauge, &update_apcupsd)
scan_gauge(obj, arg, 255); scan_gauge(obj, arg, 100);
obj->callbacks.gaugeval = &apcupsd_loadbarval; obj->callbacks.gaugeval = &apcupsd_loadbarval;
END OBJ(apcupsd_charge, &update_apcupsd) END OBJ(apcupsd_charge, &update_apcupsd)
obj->callbacks.print = &print_apcupsd_charge; obj->callbacks.print = &print_apcupsd_charge;