From f9a31d20653d7f49473a4023a46d6008662e2852 Mon Sep 17 00:00:00 2001 From: cvs Date: Wed, 15 Nov 2000 14:48:55 +0000 Subject: [PATCH] Allow sics read runction to work OK --- sinqhm/FOCUS_srv_main.c | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/sinqhm/FOCUS_srv_main.c b/sinqhm/FOCUS_srv_main.c index df2dabe7..53b45f14 100755 --- a/sinqhm/FOCUS_srv_main.c +++ b/sinqhm/FOCUS_srv_main.c @@ -1,4 +1,4 @@ -#define IDENT "1A02" +#define IDENT "1A03" /* ** +--------------------------------------------------------------+ ** | Paul Scherrer Institute | @@ -1603,8 +1603,9 @@ ** SQHM_CONFIG rejects anything else. So, start by checking arguments. */ maxbins = (FS_hi_cntr - FS_lo_cntr + 1) * (FS_hi_bin - FS_lo_bin + 1); - - if (hist_no == -1) { +/***************************************************************/ +/***************************************************************/ + if ((hist_no == -1) || (hist_no == 0)) { /* Regard the histograms as 1 long array */ if ((first == -1) && (nbins == -1)) { /* The user just wants to read everything */ @@ -1614,13 +1615,13 @@ /* The user wants a part of the histogram data */ if (first >= maxbins) { if (FS_dbg_lev0) printf ( - "\n%s -- SQHM_READ: bad first_bin!\n", FS_name[index]); + "\n%s -- SQHM_READ: bad first_bin %d!\n", FS_name[index], first); is = FS_rply_status_setup_and_send (rw_skt, rply_bf, KER__BAD_VALUE, 0, "\"first_bin\" too big", &FS_bytes_put); return is; }else if ((nbins > maxbins) || ((first + nbins) > maxbins)) { if (FS_dbg_lev0) printf ( - "\n%s -- SQHM_READ: bad n_bins!\n", FS_name[index]); + "\n%s -- SQHM_READ: bad n_bins %d!\n", FS_name[index], nbins); is = FS_rply_status_setup_and_send (rw_skt, rply_bf, KER__BAD_VALUE, 0, "\"n_bins\" too big", &FS_bytes_put); return is; @@ -1653,6 +1654,7 @@ my_fstbin = (hist_no - FS_lo_cntr) * (FS_hi_bin - FS_lo_bin + 1) + first; my_nbins = nbins; } +/***************************************************************/ /* ** The args are OK. ** Reserve some space for buffering the histogram data.