Allow sics read runction to work OK
This commit is contained in:
@ -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.
|
||||
|
Reference in New Issue
Block a user