From 2c09002652b107e4e5cc85cd75df298c09ce9a4e Mon Sep 17 00:00:00 2001 From: Rick Kirian Date: Fri, 25 Mar 2011 14:44:08 +0100 Subject: detector.c: add function find_panel_number --- src/detector.c | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) (limited to 'src/detector.c') diff --git a/src/detector.c b/src/detector.c index c542a5a1..a202d5a3 100644 --- a/src/detector.c +++ b/src/detector.c @@ -280,6 +280,23 @@ struct panel *find_panel(struct detector *det, double fs, double ss) } +int find_panel_number(struct detector *det, int fs, int ss) +{ + int p; + + for ( p=0; pn_panels; p++ ) { + if ( (fs >= det->panels[p].min_fs) + && (fs <= det->panels[p].max_fs) + && (ss >= det->panels[p].min_ss) + && (ss <= det->panels[p].max_ss) ) { + return p; + } + } + + return -1; +} + + void fill_in_values(struct detector *det, struct hdfile *f) { int i; -- cgit v1.2.3