00001
00005 #include <stdio.h>
00006 #include <bpm/bpm_units.h>
00007 #include <bpm/bpm_messages.h>
00008 #include <bpm/bpm_process.h>
00009
00010
00011 int process_monopole( doublewf_t *sig, bpmconf_t *bpm, bpmcalib_t *cal,
00012 bpmproc_t *proc, bpmproc_t *trig, unsigned int mode ) {
00013
00014 char msg[128];
00015
00016 if ( ! sig || ! bpm || ! cal || ! proc || ! trig ) {
00017 bpm_error( "Invalid pointer arguments in process_monopole(...)",
00018 __FILE__, __LINE__ );
00019 return BPM_FAILURE;
00020 }
00021
00022 if ( process_waveform( sig, bpm, proc, trig, mode ) == BPM_FAILURE ) {
00023 sprintf( msg, "Unable to process waveform for BPM %s in process_monopole(...)", bpm->name );
00024 bpm_error( msg, __FILE__, __LINE__ );
00025 return BPM_FAILURE;
00026
00027 }
00028
00029 if ( correct_gain( proc, cal, mode ) == BPM_FAILURE ) {
00030 sprintf( msg, "Unable to correct gains for BPM %s in process_monopole(...)", bpm->name );
00031 bpm_error( msg, __FILE__, __LINE__ );
00032 return BPM_FAILURE;
00033 }
00034
00035 return BPM_SUCCESS;
00036 }
00037
00038