Working on charts

git-svn-id: file:///home/jan/tmp/wetterstation/trunk@85 dd492736-c11a-0410-ad51-8c26713eaf7f
This commit is contained in:
losinshi 2006-09-13 12:44:02 +00:00
parent dd76037565
commit 0bb9f01fc4
7 changed files with 52 additions and 11 deletions

View File

@ -25,7 +25,7 @@ all: $(BIN_NAME)
# Binary Linken
$(BIN_NAME): $(OBJS)
@ echo Linke: $(LD) $(DEBUG) $(NOLOG) -L$$(pg_config --libdir)/pgsql -lm -lpq $(LDFLAS) $(BIN_NAME) $(OBJS)
@ $(LD) $(DEBUG) $(NOLOG) -L$$(pg_config --libdir)/pgsql -lm -lpq $(LDFLAS) $(BIN_NAME) $(OBJS)
@ $(LD) $(DEBUG) $(NOLOG) -L$$(pg_config --libdir)/pgsql -lefence -lm -lpq $(LDFLAS) $(BIN_NAME) $(OBJS)
@ echo Binary $(BIN_NAME) ist fertig!
# Abhängigkeiten

View File

@ -1,4 +1,5 @@
fork yes
#fork yes
fork no
image_cfg_location image_file/
image_cfg testimage.conf

View File

@ -1,4 +1,12 @@
typedef struct image_cfg_t {
typedef struct img_color *img_color_ptr;
typedef struct img_color {
int r;
int g;
int b;
int alpha;
} img_color_t;
typedef struct image_cfg {
char *file_name;
char *headline;
char *table_field;
@ -11,7 +19,7 @@ typedef struct image_cfg_t {
int width;
int height;
int sens_id;
} image_cfg;
img_color_ptr bg_color;
} image_cfg_t;
extern image_cfg img_cfg;
extern image_cfg_t img_cfg;

View File

@ -28,7 +28,7 @@
#include "image_common.h"
static int read_time(const char *, void *);
static int read_color(const char *, void *);
@ -49,11 +49,34 @@ static const config_keyword keywords[] = {
{"height", read_int, &(img_cfg.height), ""},
{"sensor_id", read_int, &(img_cfg.sens_id), ""},
{"bg_color", read_color, &(img_cfg.bg_color), ""},
{"", NULL, NULL, ""}
};
static int read_color(const char *line, void *arg){
img_color_ptr *col = arg;
img_color_ptr tmp = NULL;
char *buff = malloc(sizeof(char)*3);
if(strlen(line) == 11){
if (strchr(line, ':') != NULL){
tmp = malloc(sizeof(img_color_t));
tmp->r = strtol(strncpy(buff, line, 2), NULL, 16);
tmp->b = strtol(strncpy(buff, line+3, 2), NULL, 16);
tmp->g = strtol(strncpy(buff, line+6, 2), NULL, 16);
tmp->alpha = strtol(strncpy(buff, line+9, 2), NULL, 16);
DEBUGOUT5(" Farbe gelesen: rot:%2x gelb:%2x gruen:%2x mit alpha:%2x\n", tmp->r, tmp->b, tmp->g, tmp->alpha) ;
}
}
*col = tmp;
}
/* Ein Interval einlesen.
* wandelt Zeitangaben von der Form:

View File

@ -2,8 +2,14 @@
#include "image_draw.h"
#include "image_data.h"
static void create_image();
static void draw_image();
static void write_image();
int draw_to_file(FILE *fd){
get_pix_list(210);
draw_image();
}
static void create_image(){
@ -11,6 +17,7 @@ static void create_image(){
}
static void draw_image(){
pix_list_ptr pix_list = get_pix_list(300);
}

View File

@ -33,7 +33,7 @@
/* Optionen des Bildes */
image_cfg img_cfg;
image_cfg_t img_cfg;
static void regenerate_image();
@ -67,7 +67,7 @@ void process_image_cfg(char *image_cfg_file){
regenerate_image();
}
// sleep(3);
//sleep(30);
}

View File

@ -4,9 +4,11 @@ manual_table no
manual_table_name auss2_data
table_field temp
gen_interval 15m
show_interval 1y
show_interval 1h
label_interval 10m
label_sum no
width 400
height 250
sensor_id 1
bg_color 10:2c:30:00 #test