libRASCH: ra.h File Reference
ra.h File Reference
Include dependency graph for ra.h:
This graph shows which files directly or indirectly include this file:
Go to the source code of this file.
Functions
LIBRAAPI ra_handle ra_lib_init (void)
init libRASCH
LIBRAAPI void ra_lib_close (ra_handle h)
close libRASCH
LIBRAAPI long ra_lib_get_error (ra_handle h, char *text, int len)
get last error
LIBRAAPI ra_handle ra_lib_handle_from_any_handle (meas_handle mh)
LIBRAAPI meas_handle ra_meas_handle_from_any_handle (any_handle rh)
retrive measurement-handle from any handle
LIBRAAPI int ra_lib_use_plugin (ra_handle h, int plugin_index, int use_it)
set using a plugin (or not)
LIBRAAPI plugin_handle ra_plugin_get_by_num (ra_handle h, int plugin_index, int search_all)
get plugin-handle
LIBRAAPI plugin_handle ra_plugin_get_by_name (ra_handle h, const char *name, int search_all)
get plugin-handle
LIBRAAPI ra_find_handle ra_meas_find_first (ra_handle h, const char *dir, struct ra_find_struct *rfs)
find libRASCH-handled measurements (return first one)
LIBRAAPI int ra_meas_find_next (ra_find_handle h, struct ra_find_struct *mfs)
find libRASCH-handled measurements (returns next)
LIBRAAPI void ra_meas_close_find (ra_find_handle h)
close the search for libRASCH-handled measurements
LIBRAAPI meas_handle ra_meas_open (ra_handle h, const char *file, const char *eval_file, int fast)
open a measurement
LIBRAAPI meas_handle ra_meas_new (ra_handle h, const char *dir, const char *name)
creates a new measurement
LIBRAAPI int ra_meas_save (meas_handle mh)
saves a measurement
LIBRAAPI void ra_meas_close (meas_handle mh)
close a measurement
LIBRAAPI int ra_info_get (any_handle h, int id, value_handle vh)
get infos
LIBRAAPI int ra_info_get_by_name (any_handle h, const char *name, value_handle vh)
get infos
LIBRAAPI int ra_info_get_by_idx (any_handle h, int info_type, int idx, value_handle vh)
get infos
LIBRAAPI int ra_info_set (any_handle h, value_handle vh)
set info
LIBRAAPI rec_handle ra_rec_get_first (meas_handle mh, long session)
get root-recording
LIBRAAPI rec_handle ra_rec_get_next (rec_handle rh)
get next recording
LIBRAAPI rec_handle ra_rec_get_first_child (rec_handle rh)
get first sub-recording
LIBRAAPI size_t ra_raw_get (rec_handle rh, unsigned int ch, size_t start, size_t num_data, DWORD *data, DWORD *data_high)
get raw-signal data
LIBRAAPI size_t ra_raw_get_unit (rec_handle rh, unsigned int ch, size_t start, size_t num_data, double *data)
get raw-signal data scaled to 'unit'-values
LIBRAAPI int ra_gui_call (any_handle h, plugin_handle pl)
shows GUI-element of a plugin (if avail.)
LIBRAAPI proc_handle ra_proc_get (meas_handle mh, plugin_handle pl, void(*callback)(const char *, int))
get a processing handle
LIBRAAPI void ra_proc_free (proc_handle proc)
free a processing handle
LIBRAAPI int ra_proc_do (proc_handle proc)
process the signal
LIBRAAPI int ra_proc_get_result (proc_handle proc, long res_num, long res_set, value_handle vh)
get the processing results
LIBRAAPI int ra_view_get (view_handle vh)
create/show view of view-plugin
LIBRAAPI value_handle ra_value_malloc ()
allocate and initialize a value_handle
LIBRAAPI void ra_value_free (value_handle vh)
free value-handle
LIBRAAPI void ra_value_reset (value_handle vh)
reset value-handle
LIBRAAPI long ra_value_get_type (value_handle vh)
return value-type
LIBRAAPI int ra_value_is_ok (value_handle vh)
checks if value is valid
LIBRAAPI long ra_value_get_num_elem (value_handle vh)
return number of elements of array values
LIBRAAPI long ra_value_get_info (value_handle vh)
returns id of info
LIBRAAPI const char * ra_value_get_name (value_handle vh)
returns name of info
LIBRAAPI const char * ra_value_get_desc (value_handle vh)
returns description of info
LIBRAAPI int ra_value_set_number (value_handle vh, long number)
set a number in a value-handle
LIBRAAPI long ra_value_get_number (value_handle vh)
get a number set in a value-handle
LIBRAAPI void ra_value_set_short (value_handle vh, const short value)
set short value in value-handle
LIBRAAPI void ra_value_set_long (value_handle vh, const long value)
set long value in value-handle
LIBRAAPI void ra_value_set_double (value_handle vh, const double value)
set double value in value-handle
LIBRAAPI void ra_value_set_string (value_handle vh, const char *value)
set a string in value-handle
LIBRAAPI void ra_value_set_string_utf8 (value_handle vh, const char *value)
set a UTF-8 encoded string in value-handle
LIBRAAPI void ra_value_set_voidp (value_handle vh, const void *value)
set void-pointer value in value-handle
LIBRAAPI void ra_value_set_short_array (value_handle vh, const short *array, long num)
set short-array values in value-handle
LIBRAAPI void ra_value_set_long_array (value_handle vh, const long *array, long num)
set long-array values in value-handle
LIBRAAPI void ra_value_set_double_array (value_handle vh, const double *array, long num)
set double-array values in value-handle
LIBRAAPI void ra_value_set_string_array (value_handle vh, const char **array, long num)
set a string-array in value-handle
LIBRAAPI void ra_value_set_string_array_utf8 (value_handle vh, const char **array, long num)
set a string-array (UTF-8 encoded) in value-handle
LIBRAAPI void ra_value_set_voidp_array (value_handle vh, const void **array, long num)
set void-pointer-array values in value-handle
LIBRAAPI void ra_value_set_vh_array (value_handle vh, const value_handle *array, long num)
set value-handle-array values in value-handle
LIBRAAPI short ra_value_get_short (value_handle vh)
return short value from value-handle
LIBRAAPI long ra_value_get_long (value_handle vh)
return long value from value-handle
LIBRAAPI double ra_value_get_double (value_handle vh)
return double value from value-handle
LIBRAAPI const char * ra_value_get_string (value_handle vh)
return character pointer from value-handle
LIBRAAPI const char * ra_value_get_string_utf8 (value_handle vh)
return character pointer from value-handle (UTF-8 encoded)
LIBRAAPI const void * ra_value_get_voidp (value_handle vh)
return void-pointer from value-handle
LIBRAAPI const short * ra_value_get_short_array (value_handle vh)
return pointer to short array from value-handle
LIBRAAPI const long * ra_value_get_long_array (value_handle vh)
return pointer to long array from value-handle
LIBRAAPI const double * ra_value_get_double_array (value_handle vh)
return pointer to double array from value-handle
LIBRAAPI const char ** ra_value_get_string_array (value_handle vh)
return pointer to character pointer array from value-handle
LIBRAAPI const char ** ra_value_get_string_array_utf8 (value_handle vh)
return pointer to character pointer array from value-handle (UTF-8 encoded)
LIBRAAPI const void ** ra_value_get_voidp_array (value_handle vh)
return pointer to void-pointer array from value-handle
LIBRAAPI const value_handle * ra_value_get_vh_array (value_handle vh)
return pointer to long array from value-handle
LIBRAAPI int ra_value_copy (value_handle dest, value_handle src)
copy one value_handle to another value_handle
LIBRAAPI int ra_value_get_single_elem (value_handle dest, value_handle src, long elem_num)
copy one element from a value-handle in another value-handle
LIBRAAPI int ra_lib_get_option (any_handle h, const char *opt_name, value_handle vh)
returns an option value
LIBRAAPI int ra_lib_set_option (any_handle h, const char *opt_name, value_handle vh)
set an option
LIBRAAPI int ra_meas_copy (meas_handle mh, const char *dest_dir)
copy measurement
LIBRAAPI meas_handle ra_meas_move (meas_handle mh, const char *dest_dir)
move measurement
LIBRAAPI int ra_meas_delete (meas_handle mh)
delete measurement
LIBRAAPI int ra_eval_edit_start (any_handle h)
LIBRAAPI int ra_eval_edit_complete (any_handle h)
LIBRAAPI int ra_eval_edit_cancel (any_handle h)
LIBRAAPI int ra_eval_attribute_list (any_handle h, value_handle vh)
LIBRAAPI int ra_eval_attribute_get (any_handle h, const char *name, value_handle vh)
get from 'h' the value of the attribute 'name'
LIBRAAPI int ra_eval_attribute_set (any_handle h, const char *name, value_handle vh)
set the value of the attribute 'name' in 'h'
LIBRAAPI int ra_eval_attribute_unset (any_handle h, const char *id)
removes the attribute 'name' in 'h'
LIBRAAPI eval_handle ra_eval_add (meas_handle mh, const char *name, const char *desc, int original)
adds an evaluation
LIBRAAPI int ra_eval_delete (eval_handle eh)
delete evaluation
LIBRAAPI int ra_eval_get_all (meas_handle mh, value_handle vh)
returns all evaluation-handles
LIBRAAPI eval_handle ra_eval_get_original (meas_handle mh)
returns the original evaluation-handle
LIBRAAPI eval_handle ra_eval_get_default (meas_handle mh)
returns the default evaluation-handle
LIBRAAPI int ra_eval_set_default (eval_handle eh)
set an evaluation to the default one
LIBRAAPI eval_handle ra_eval_get_handle (class_handle clh)
returns the evaluation handle an event-class belongs to
LIBRAAPI class_handle ra_class_add (eval_handle eh, const char *id, const char *name, const char *desc)
adds an user-defined event-class to an evaluation
LIBRAAPI class_handle ra_class_add_predef (eval_handle eh, const char *id)
adds an pre-defined event-class to an evaluation
LIBRAAPI int ra_class_delete (class_handle clh)
deletes an event-class
LIBRAAPI int ra_class_get (eval_handle eh, const char *id, value_handle vh)
return event-class
LIBRAAPI long ra_class_add_event (class_handle clh, long start, long end)
add an event
LIBRAAPI int ra_class_del_event (class_handle clh, long event_id)
delete an event
LIBRAAPI int ra_class_get_event_pos (class_handle clh, long event_id, long *start, long *end)
get the start and end position of an event
LIBRAAPI int ra_class_set_event_pos (class_handle clh, long event_id, long start, long end)
set the start and end position of an event
LIBRAAPI int ra_class_get_events (class_handle clh, long start, long end, int complete, int sort, value_handle vh)
returns the events in a specific region
LIBRAAPI class_handle ra_class_get_handle (prop_handle ph)
returns the event-class handle the event-property belongs to
LIBRAAPI prop_handle ra_prop_add (class_handle clh, const char *id, long value_type, long num_values, const char *name, const char *desc, const char *unit, int use_minmax, double min, double max)
LIBRAAPI prop_handle ra_prop_add_predef (class_handle clh, const char *id)
LIBRAAPI int ra_prop_delete (prop_handle ph)
LIBRAAPI prop_handle ra_prop_get (class_handle clh, const char *id)
LIBRAAPI int ra_prop_get_all (class_handle clh, value_handle vh)
LIBRAAPI int ra_prop_set_value (prop_handle ph, long event_id, long ch, value_handle vh)
LIBRAAPI int ra_prop_get_ch (prop_handle ph, long event_id, value_handle vh)
LIBRAAPI int ra_prop_get_value (prop_handle ph, long event_id, long ch, value_handle vh)
LIBRAAPI int ra_prop_get_events (prop_handle ph, value_handle min, value_handle max, long ch, value_handle vh)
LIBRAAPI sum_handle ra_sum_add (class_handle clh, const char *id, const char *name, const char *desc)
LIBRAAPI int ra_sum_add_ch (sum_handle sh, long ch, long fiducial_offset, long num_dim, const char **dim_unit, const char **dim_name)
LIBRAAPI int ra_sum_delete (sum_handle sh)
LIBRAAPI int ra_sum_get (class_handle clh, const char *id, value_handle vh)
LIBRAAPI long ra_sum_add_part (sum_handle sh, long num_events, const long *events_based_on)
LIBRAAPI int ra_sum_del_part (sum_handle sh, long part_id)
LIBRAAPI int ra_sum_get_part_all (sum_handle sh, value_handle vh)
LIBRAAPI int ra_sum_set_part_data (sum_handle sh, long part_id, long channel, long dim, value_handle vh)
LIBRAAPI int ra_sum_get_part_data (sum_handle sh, long part_id, long channel, long dim, value_handle vh)
LIBRAAPI int ra_sum_get_part_events (sum_handle sh, long part_id, value_handle vh)
Detailed Description
The header file contains the prototypes of most of the API functions.
Author: Raphael Schneider (rasch@med1.med.tum.de )
Definition in file ra.h .
Function Documentation
Parameters:
<eh> evaluation handle
<id> ASCII-id of the event-class
<name> a short name for the event-class
<desc> a short description of the event-class
The function adds an event-class to the evaluation 'eh'. The parameter 'id' is used to identifiy the event-class and must contain only ASCII characters. The parameters 'name' and 'desc' are used to describe the event-class. If you want to use a pre-defined event-class, use ra_class_add_predef() .
Definition at line 676 of file eval.c .
References _ra_set_error , eval_class::ascii_id , eval::cl , eval_class::eval , get_class_id() , eval_class::handle_id , eval_class::id , MAX_ID_LEN , eval::meas , eval_class::meas , ra_class_delete() , RA_ERR_INFO_MISSING , RA_ERR_NONE , ra_eval_attribute_set() , RA_HANDLE_EVAL_CLASS , ra_list_add() , ra_value_free() , ra_value_malloc() , and ra_value_set_string() .
Referenced by add_class_orig() , and ra_class_add_predef() .
LIBRAAPI long ra_class_add_event
(
class_handle
clh ,
long
start ,
long
end
)
Parameters:
<clh> event-class handle
<start> start position of the event in sample-units
<end> end position of the event in sample-units
The function adds an event to the event-class 'clh'. The start and end of the event are given by 'start' and 'end' respectively. If the event is a point in time, use for 'end' the same value as 'start'. A unique event-id is returned.
Definition at line 883 of file eval.c .
References _ra_set_error , add_prop_mem() , eval_event::end , eval_class::ev , eval_class::handle_id , eval_event::id , eval_class::last_id , eval_class::num_event , RA_ERR_NONE , RA_ERR_WRONG_HANDLE , RA_HANDLE_EVAL_CLASS , and eval_event::start .
Referenced by add_events_orig() , create_auto_class() , and read_sets_xml() .
LIBRAAPI int ra_class_del_event
(
class_handle
clh ,
long
event_id
)
Parameters:
<clh> event-class handle
<event_id> event-id of the event
The function deletes the event 'event_id' from the event-class 'clh'.
Definition at line 996 of file eval.c .
References _ra_set_error , del_prop_values() , eval_class::ev , get_event_idx() , eval_class::handle_id , eval_class::last_id , eval_class::num_event , RA_ERR_NONE , RA_ERR_OUT_OF_RANGE , RA_ERR_WRONG_HANDLE , RA_ERR_WRONG_INPUT , and RA_HANDLE_EVAL_CLASS .
Parameters:
The function deletes the event-class 'clh'.
Definition at line 767 of file eval.c .
References _ra_set_error , eval::cl , delete_attributes() , eval_class::ev , eval_class::handle_id , eval_class::prop , RA_ERR_NONE , RA_ERR_WRONG_HANDLE , RA_HANDLE_EVAL_CLASS , ra_list_del() , ra_prop_delete() , ra_sum_delete() , and eval_class::summaries .
Referenced by ra_class_add() , and ra_eval_delete() .
Parameters:
<eh> evaluation handle
<id> event-class ASCII-id
<vh> value handle
The function returns all event-classes with the id 'id'. If 'id' is NULL (or is an empty string), all event-classes in the evaluation 'eh' are given.
Definition at line 818 of file eval.c .
References _ra_set_error , eval_class::ascii_id , eval::cl , eval::handle_id , eval_class::next , RA_ERR_INFO_MISSING , RA_ERR_NONE , RA_ERR_WRONG_HANDLE , RA_HANDLE_EVAL , ra_value_reset() , and ra_value_set_voidp_array() .
Referenced by do_post_processing() , and ra_eval_delete() .
LIBRAAPI int ra_class_get_event_pos
(
class_handle
clh ,
long
event_id ,
long *
start ,
long *
end
)
Parameters:
<clh> event-class handle
<event_id> event-id of the event
<start> here the start position will be returned
<end> here the end position will be returned
The function returns in 'start' and 'end' the position of the evvent 'event_id' from the event-class 'clh'. The positions are in sample-units.
Definition at line 1162 of file eval.c .
References _ra_set_error , eval_event::end , eval_class::ev , get_event_idx() , eval_class::handle_id , eval_class::last_id , RA_ERR_NONE , RA_ERR_OUT_OF_RANGE , RA_ERR_WRONG_HANDLE , RA_ERR_WRONG_INPUT , RA_HANDLE_EVAL_CLASS , and eval_event::start .
Parameters:
<clh> event-class handle
<start> start of the region of interest
<end> end of the region of interest
<complete> flag if the events have to be complete in the region of interest
<sort> flag if the found events should be sorted according their start position
<vh> value handle receiving the event-id's asked for
The function returns in 'vh' the events which are inside a specific region. The region of interest (ROI)is given by 'start' and 'end'. If the 'complete' flag is set, the events have to be complete inside the ROI. If it is not set, all events are returned which starts or ends inside the ROI.
Definition at line 1269 of file eval.c .
References _ra_set_error , comp_pos() , eval_event::end , eval_class::ev , eval_class::handle_id , eval_event::id , sort_pos::id , eval_class::num_event , sort_pos::pos , RA_ERR_INFO_MISSING , RA_ERR_NONE , RA_ERR_WRONG_HANDLE , RA_HANDLE_EVAL_CLASS , ra_value_reset() , ra_value_set_long_array() , and eval_event::start .
LIBRAAPI int ra_class_set_event_pos
(
class_handle
clh ,
long
event_id ,
long
start ,
long
end
)
Parameters:
<clh> event-class handle
<event_id> event-id of the event
<start> the start position of the event
<end> the end position of the event
The function sets the start and end position of the event 'event_id' in the event-class 'clh' to the values 'start' and 'end'.
Definition at line 1209 of file eval.c .
References _ra_set_error , eval_event::end , eval_class::ev , get_event_idx() , eval_class::handle_id , eval_class::last_id , RA_ERR_NONE , RA_ERR_OUT_OF_RANGE , RA_ERR_WRONG_HANDLE , RA_ERR_WRONG_INPUT , RA_HANDLE_EVAL_CLASS , and eval_event::start .
Parameters:
<mh> measurement-handle
<name> a short name of the evaluation
<desc> a short description of the evaluation
<original> flag if evaluation is the original evaluation
This function adds an evaluation to a measurement.
Definition at line 246 of file eval.c .
References _ra_set_error , ra_meas::eval , EVAL_MAX_DESC , eval_info::evaluations , eval::handle_id , ra_meas::handle_id , eval::meas , eval::original , RA_ERR_EVAL_WRONG_TYPE , RA_ERR_NONE , RA_ERR_WRONG_HANDLE , ra_eval_attribute_set() , ra_eval_get_original() , ra_eval_set_default() , RA_HANDLE_EVAL , RA_HANDLE_MEAS , ra_list_add() , ra_list_del() , ra_value_free() , ra_value_malloc() , ra_value_set_string() , and set_env() .
Referenced by add_eval_orig() , and ra_eval_save_result() .
Definition at line 61 of file eval.c .
References _ra_set_error , eval_info::attribute , ra_meas::eval , MAX_ATTRIB_LEN , eval_head::meas , eval_attribute::name , eval_attribute::next , RA_ERR_NONE , ra_value_reset() , ra_value_set_string_array() , and eval_attribute::src_handle .
Parameters:
<h> an eval-/event-class-/event-prop-handle
<id> ASCII-id of the attribute
<vh> value-handle with the value
This function sets the value of the attribute 'name'.
Definition at line 139 of file eval.c .
References _ra_set_error , eval_info::attribute , ra_meas::eval , find_attribute() , MAX_ATTRIB_LEN , eval_head::meas , eval_attribute::name , RA_ERR_NONE , ra_list_add() , ra_value_copy() , ra_value_malloc() , eval_attribute::src_handle , and eval_attribute::value .
Referenced by create_auto_class() , ra_class_add() , ra_eval_add() , ra_prop_add() , ra_sum_add() , and read_sets_xml() .
LIBRAAPI int ra_eval_attribute_unset
(
any_handle
h ,
const char *
id
)
Parameters:
The function deletes the evaluation given by 'eh'.
Definition at line 451 of file eval.c .
References _ra_set_error , delete_attributes() , ra_meas::eval , eval_info::evaluations , eval::handle_id , eval_head::meas , ra_class_delete() , ra_class_get() , RA_ERR_NONE , RA_ERR_WRONG_HANDLE , RA_HANDLE_EVAL , ra_list_del() , ra_value_free() , ra_value_get_num_elem() , ra_value_get_voidp_array() , and ra_value_malloc() .
Referenced by free_eval_infos() .
LIBRAAPI int ra_eval_edit_complete
(
any_handle
h
)
Parameters:
<h> processing-handle or view-handle
<pl> plugin-handle
If the plugin pl provides a GUI-element, this function shows this GUI-element and transfer control to it. The h variable contains some information, needed by the plugin. For more information if a plugin provides a GUI-element and what type/information is needed, please see the plugin specific documentation.
Definition at line 2126 of file ra.c .
References _ra_set_error , plugin_struct::call_gui , RA_ERR_ERROR , and RA_ERR_PL_API_NOT_AVAIL .
Parameters:
<h> handle
<id> id of information wanted
<vh> value_handle receiving the info
Returns 0 if the wanted information was found and != 0 if not. The information will be in vh. For usage of the function please see user-manual.
Definition at line 1244 of file ra.c .
References _ra_set_error , plugin_struct::access , check_handle_type() , eval_get_info() , plugin_access_func::get_info_id , get_lib_info() , get_meas_general_info() , get_plugin_from_handle() , get_plugin_info() , get_proc_info() , get_session_info() , RA_ERR_PL_API_NOT_AVAIL , RA_HANDLE_LIB , RA_HANDLE_MEAS , RA_HANDLE_PLUGIN , RA_INFO_EVALUATION , RA_INFO_EVALUATION_END , RA_INFO_MEASUREMENT_END , RA_INFO_MEASUREMENT_START , RA_INFO_PROCESSING_END , RA_INFO_PROCESSING_START , RA_INFO_SESSION_END , RA_INFO_SESSION_START , and ra_value_reset() .
Referenced by calc_x_scales() , copy_move_meas() , get_eval_file() , get_eval_file_xml() , ra_info_get_by_name() , ra_meas_delete() , ra_meas_move() , and write_evals_xml() .