TUM-Logo

libRASCH

 

Home
 

General

About libRASCH/News
Design
Screen shots
Sample programs (with source code)
License
 

Download

libRASCH
Tools
 

Documentation

User
Developer
 

Resources

Mailing list
Supported Formats
Plugins
Status
Links
 
Contact
About this site
 
Last updated
Tue Mar 27 23:03:52 2007
libRASCH: ra_eval.h Source File

ra_eval.h

Go to the documentation of this file.
00001 
00009 /*----------------------------------------------------------------------------
00010  *
00011  * Copyright (C) 2002-2005, Raphael Schneider
00012  * See the file COPYING for information on usage and redistribution.
00013  *
00014  * $Id: ra_eval.h 794 2005-05-07 12:46:04Z rasch $
00015  *
00016  *--------------------------------------------------------------------------*/
00017 
00018 #ifndef RA_EVAL_H
00019 #define RA_EVAL_H
00020 
00021 #ifdef __cplusplus
00022 extern "C" {
00023 #endif
00024 
00025 #include <stdio.h>
00026 #include <libxml/tree.h>
00027 
00028 #include <ra_priv.h>
00029 #include <ra.h>
00030 #include <ra_event_props.h>
00031 
00032 /* -------------------- defines -------------------- */
00033 #define EVAL_MAX_TS        21   /* when was evaluation done (date and time in UTC); format: 'dd.mm.yyyy  hh:mm:ss' */
00034 #define EVAL_MAX_USER      50   /* who did evaluation */
00035 #define EVAL_MAX_HOST      50   /* where was evaluation done */
00036 #define EVAL_MAX_PRG       50   /* which program did evaluation */
00037 
00038 #define EVENT_MEM_ADD      0.1  /* add 10% percent of already allocated events */
00039 
00040 #define MAX_ID_LEN         100
00041 #define MAX_ATTRIB_LEN     100
00042 
00043 
00044 /* -------------------- structures -------------------- */
00045 /* forward declarations */
00046 struct ra_meas;
00047 
00048 /* --------------- general --------------- */
00049 
00060 struct eval_attribute
00061 {
00062         unsigned short dummy;
00063 
00064         struct eval_attribute *next;
00065         struct eval_attribute *prev;
00066 
00067         any_handle src_handle;
00068 
00069         char name[MAX_ATTRIB_LEN];
00070         value_handle value;
00071 }; /* struct eval_attribute */
00072 
00073 
00082 struct eval_head
00083 {
00084         unsigned short handle_id;
00085 
00086         struct eval_head *next;
00087         struct eval_head *prev;
00088 
00089         struct ra_meas *meas;
00090 }; /* struct eval_head */
00091 
00092 
00093 /* --------------- main --------------- */
00094 
00095 
00104 struct eval
00105 {
00106         unsigned short handle_id;
00107 
00108         struct eval *next;
00109         struct eval *prev;
00110 
00111         struct ra_meas *meas;
00112 
00113         int original;
00114         int def;
00115 
00116         struct eval_class *cl;
00117 }; /* struct eval */
00118 
00119 
00120 /* --------------- event class --------------- */
00121 
00122 
00130 struct eval_event
00131 {
00132         long id;
00133         long start;
00134         long end;
00135 }; /* struct eval_event */
00136 
00137 
00151 struct eval_class
00152 {
00153         unsigned short handle_id;
00154 
00155         struct eval_class *next;
00156         struct eval_class *prev;
00157 
00158         struct ra_meas *meas;
00159 
00160         struct eval *eval;
00161 
00162         long id;
00163         char ascii_id[MAX_ID_LEN];
00164 
00165         long num_event;
00166         struct eval_event *ev;
00167         long last_id;
00168 
00169         struct eval_property *prop;
00170 
00171         struct eval_summary *summaries;
00172 }; /* struct eval_class */
00173 
00174 
00175 /* --------------- event property --------------- */
00176 
00177 
00195 struct eval_property
00196 {
00197         unsigned short handle_id;
00198 
00199         struct eval_property *next;
00200         struct eval_property *prev;
00201 
00202         struct ra_meas *meas;
00203 
00204         struct eval_class *evclass;
00205 
00206         long id;
00207         char ascii_id[MAX_ID_LEN];
00208 
00209         long allocated_events;
00210 
00211         unsigned short *num_entries;
00212         short **ch_map;
00213         int value_type;
00214         long **num_elements;
00215         union
00216         {
00217                 short **s;
00218                 long **l;
00219                 double **d;
00220                 char ***c;
00221                 short ***sa;
00222                 long ***la;
00223                 double ***da;
00224                 char ****ca;
00225         } value;
00226 }; /* struct eval_property */
00227 
00228 
00229 /* --------------- event summary --------------- */
00230 
00241 struct eval_sum_ch_desc
00242 {
00243         long ch;
00244 
00245         long num_dim;
00246         char **name;
00247         char **unit;
00248         long *data_idx;
00249 
00250         long fiducial_offset;   
00251 }; /* struct eval_sum_ch_desc */
00252 
00253 
00262 struct eval_sum_data
00263 {
00264         unsigned short id;
00265 
00266         struct eval_sum_data *next;
00267         struct eval_sum_data *prev;
00268 
00269         long num_events;
00270         long *event_ids;
00271 
00272         value_handle *data;
00273 }; /* struct eval_sum_data */
00274 
00275 
00291 struct eval_summary
00292 {
00293         unsigned short handle_id;
00294 
00295         struct eval_summary *next;
00296         struct eval_summary *prev;
00297 
00298         struct ra_meas *meas;
00299 
00300         struct eval_class *evclass;
00301 
00302         long id;
00303         char ascii_id[MAX_ID_LEN];
00304 
00305         long num_ch;
00306         struct eval_sum_ch_desc *ch_desc;
00307 
00308         long num_data_elements;
00309         unsigned short last_data_id;
00310         struct eval_sum_data *sum;
00311 }; /* struct eval_summary */
00312 
00313 /* forward declarations */
00314 struct plugin_struct;
00315 struct eval_info;
00316 
00330 struct ra_auto_create_class
00331 {
00332         char *ascii_id;
00333         long start_pos_idx;
00334         long end_pos_idx;
00335         char *info_short;
00336         char *info_long;
00337         char *info_ext;
00338         class_handle clh;
00339         long num_events;
00340         long *event_ids;
00341 }; /* struct ra_auto_create_class */
00342 
00343 
00354 struct ra_auto_create_prop
00355 {
00356         char *ascii_id;
00357         int class_index;
00358         int event_id_idx;
00359         long value_id;
00360         long ch_id;
00361         prop_handle ph; 
00362 }; /* struct ra_auto_create_prop */
00363 
00364 
00365 struct sort_pos
00366 {
00367         long id;
00368         long pos;
00369 }; /* struct sort_pos */
00370 
00371 
00372 /* -------------------- prototypes -------------------- */
00373 struct eval_attribute *find_attribute(struct eval_head *h, const char *id);
00374 int delete_attributes(struct eval_head *h);
00375 long get_event_idx(struct eval_class *c, long event_id);
00376 int del_prop_values(struct eval_class *c, long idx);
00377 int get_sum_data_idx(sum_handle sh, long channel, long dim);
00378 int add_prop_mem(struct eval_class *c);
00379 int alloc_prop_mem(struct eval_property *p);
00380 
00381 
00382 
00383 /* ---------- read_evaluation.c ---------- */
00384 int read_evaluation(meas_handle mh);
00385 eval_handle add_eval_orig(meas_handle mh, struct plugin_struct *pl);
00386 int add_class_orig(meas_handle mh, eval_handle eh, struct plugin_struct *pl);
00387 int add_events_orig(class_handle clh, struct plugin_struct *pl, long **ev_ids, long *num_ev);
00388 int add_prop_orig(class_handle clh, struct plugin_struct *pl, long *ev_ids, long num_ev);
00389 int add_values_orig(prop_handle ph, struct plugin_struct *pl, long *ev_ids, long num_ev);
00390 int add_summaries_orig(class_handle clh, struct plugin_struct *pl);
00391 int add_sum_ch(class_handle clh, sum_handle sh, long sum_num, long num_ch, const long *ch, struct plugin_struct *pl);
00392 int add_sum_part_orig(sum_handle sh, long n_ch, long n_dim, struct plugin_struct *pl);
00393 int do_post_processing(meas_handle mh, eval_handle eh);
00394 void post_process_ecg(meas_handle mh, eval_handle eh, class_handle clh);
00395 
00396 
00397 /* ---------- eval_internal.c ---------- */
00398 int load_eval(meas_handle mh, const char *eval_file);
00399 int get_eval_file(meas_handle mh, char *f);
00400 int eval_get_info(any_handle h, int info_id, value_handle vh);
00401 int free_eval_infos(struct eval_info *ei);
00402 
00403 /* ---------- eval_auto.c ---------- */
00404 /* int create_auto_class(eval_handle eh, struct ra_auto_create_class *acc, value_handle *res); */
00405 /* int create_auto_prop(eval_handle eh, class_handle clh, struct proc_info *pi, struct ra_auto_create_class *acc, */
00406 /*                   struct ra_auto_create_prop *acp, value_handle *res); */
00407 
00408 
00409 /* /\* ---------- load_xml.c ---------- *\/ */
00410 /* int get_eval_file_xml(meas_handle mh, char *f); */
00411 /* int read_evals_xml(meas_handle mh, xmlNodePtr parent); */
00412 /* xmlNodePtr get_node(xmlNodePtr parent, char *name); */
00413 /* int read_sets_xml(struct eval *e, xmlNodePtr parent); */
00414 /* int read_events_start_end_xml(struct event_set *set, xmlNodePtr parent); */
00415 /* int read_props_xml(struct event_set *set, xmlNodePtr parent, int use_ascii); */
00416 
00417 /* int read_events_xml(struct event_property *prop, xmlNodePtr parent, int use_ascii); */
00418 
00419 /* int handle_value_events_ascii(struct event_property *prop, xmlNodePtr parent); */
00420 /* int read_short(xmlNodePtr node, struct event_property *prop, long idx); */
00421 /* int read_long(xmlNodePtr node, struct event_property *prop, long idx); */
00422 /* int read_double(xmlNodePtr node, struct event_property *prop, long idx); */
00423 /* int read_char(xmlNodePtr node, struct event_property *prop, long idx); */
00424 /* int read_short_array(xmlNodePtr node, struct event_property *prop, long idx); */
00425 /* int read_long_array(xmlNodePtr node, struct event_property *prop, long idx); */
00426 /* int read_double_array(xmlNodePtr node, struct event_property *prop, long idx); */
00427 
00428 /* int handle_char_events(struct event_property *prop, xmlChar *c); */
00429 /* char * find_next_string(char *s); */
00430 /* int handle_value_events(struct event_property *prop, xmlChar *c); */
00431 
00432 /* int read_templates_xml(struct event_set *set, xmlNodePtr parent); */
00433 /* prop_handle find_prop(struct eval *e, const char *name); */
00434 /* int read_single_template_xml(struct template_struct *templ, xmlNodePtr parent); */
00435 
00436 /* /\* ---------- save_xml.c ---------- *\/ */
00437 /* int get_eval_file_xml(meas_handle mh, char *f); */
00438 /* int write_evals_xml(meas_handle mh, xmlNodePtr parent, int use_ascii); */
00439 /* int write_sets_xml(struct eval *e, xmlNodePtr parent, int use_ascii); */
00440 /* int write_events_start_end_xml(struct event_set *set, xmlNodePtr parent); */
00441 /* int write_props_xml(struct event_set *set, xmlNodePtr parent, int use_ascii); */
00442 
00443 /* int write_events_xml(struct event_property *prop, xmlNodePtr parent); */
00444 
00445 /* int write_events_xml_ascii(struct event_property *prop, xmlNodePtr parent); */
00446 /* int write_ascii_short(xmlNodePtr p, short *data, long n, char *tag_name); */
00447 /* int write_ascii_long(xmlNodePtr p, long *data, long n, char *tag_name); */
00448 /* int write_ascii_double(xmlNodePtr p, double *data, long n, char *tag_name); */
00449 /* int write_ascii_char(xmlNodePtr p, char **data, long n, char *tag_name); */
00450 /* int write_ascii_short_array(xmlNodePtr p, short **data, short **ch, long *elem, long n, char *tag_name); */
00451 /* int write_ascii_long_array(xmlNodePtr p, long **data, short **ch, long *elem, long n, char *tag_name); */
00452 /* int write_ascii_double_array(xmlNodePtr p, double **data, short **ch, long *elem, long n, char *tag_name); */
00453 
00454 /* int write_templates_xml(struct event_set *set, xmlNodePtr parent); */
00455 /* int find_prop_name(struct eval *e, struct template_struct *templ, char *name); */
00456 /* int write_single_template_xml(struct template_struct *templ, int index, */
00457 /*                            struct single_template *st, xmlNodePtr parent); */
00458 
00459 
00460 /* /\* ----------  event_property.c ---------- *\/ */
00461 /* struct event_prop_desc *get_prop_desc(int id); */
00462 /* struct event_set_desc *get_set_desc(int id); */
00463 /* evset_handle add_set(eval_handle eh, const char *id_ascii, const char *name, const char *desc, long type); */
00464 /* prop_handle add_prop(eval_handle eh, evset_handle seth, const char *id_ascii, const char *name, */
00465 /*                     const char *desc, long val_type, int use_minmax, double min, */
00466 /*                     double max, const char *unit); */
00467 
00468 /* struct event_property *get_prop(struct eval *e, const char *name); */
00469 /* void add_prop_in_events(struct eval *e, int val_type); */
00470 /* int alloc_event_mem(struct event_set *set); */
00471 /* int move_events(struct event_set *set, long src_idx, long dest_idx); */
00472 /* void alloc_prop_mem(struct event_property *prop); */
00473 /* void free_prop_mem(struct event_property *prop); */
00474 /* void move_prop_index(struct event_set *set, long type, long index_remove); */
00475 
00476 /* void del_disc_prop(struct event_property *prop); */
00477 /* void del_cont_prop(struct event_property *prop); */
00478 
00479 /* prop_handle get_evprop_for_flags(struct event_set *set); */
00480 
00481 
00482 /* /\* ---------- event.c ---------- *\/ */
00483 /* double get_ev_disc_value(struct event_property *prop, long event); */
00484 /* int set_ev_disc_value(struct event_property *prop, long event, double value); */
00485 /* double get_ev_cont_value(struct event_property *prop, long event); */
00486 /* int set_ev_cont_value(struct event_property *prop, long event, double value); */
00487 
00488 
00489 /* /\* ---------- template.c ---------- *\/ */
00490 /* int get_last_template_num(struct template_struct *t); */
00491 /* long get_template_index(struct event_property *prop); */
00492 /* void del_template_events(struct event_property *prop, int templ_num); */
00493 /* void del_event(struct event_set *set, long event); */
00494 
00495 #ifdef __cplusplus
00496 }
00497 #endif
00498 
00499 #endif /* RA_EVAL_H */

Generated on Fri May 27 11:32:39 2005 for libRASCH by  doxygen 1.4.2