- Fixes to HM code for AMOR TOF
- A couple of TAS fixes - o2t was fixed to work with any drivable - FOCUS was mended to include beam monitor in data file
This commit is contained in:
@@ -14,7 +14,8 @@
|
||||
**
|
||||
** Author . . . . . . . . . . : D. Maden
|
||||
** Date of creation . . . . . . : Mar 2000
|
||||
**
|
||||
** Well, start a motor. But not a3 in powder mode in order to
|
||||
|
||||
** Updates:
|
||||
** 1A01 7-Mar-2000 DM Initial version.
|
||||
**---------------------------------------------------------------------------
|
||||
@@ -101,8 +102,11 @@
|
||||
#include "SinqHM_def.h"
|
||||
#include "FOCUS_gbl.h"
|
||||
|
||||
#define READBUFSIZE 66560
|
||||
extern char *vxWorksVersion; /* Version string of vxWorks */
|
||||
extern char *creationDate; /* Creation Date string of vxWorks */
|
||||
static uchar readBuffer[READBUFSIZE];
|
||||
|
||||
/*
|
||||
**=============================================================================
|
||||
** Local routines.
|
||||
@@ -1593,7 +1597,7 @@
|
||||
uint bins_to_go, lastbin;
|
||||
struct req_buff_struct my_rqst;
|
||||
struct rply_buff_struct my_rply;
|
||||
uchar *buff_pntr, *last_byte, *nxt;
|
||||
uchar *buff_pntr, *last_byte, *nxt;
|
||||
uchar buff[pkt_size];
|
||||
|
||||
register union {
|
||||
@@ -1661,23 +1665,12 @@
|
||||
/***************************************************************/
|
||||
/*
|
||||
** The args are OK.
|
||||
** Reserve some space for buffering the histogram data.
|
||||
** Set up fixed buffer to do transfer
|
||||
*/
|
||||
my_pntr.base = NULL;
|
||||
i = memFindMax (); /* Get size of biggest free memory block */
|
||||
if (i > (my_nbins * FS_bpb)) { /* If there's room to hold everything,
|
||||
** try to get it */
|
||||
bins_in_buff = my_nbins;
|
||||
my_pntr.base = malloc (bins_in_buff * FS_bpb);
|
||||
if (my_pntr.base == NULL) {
|
||||
bins_in_buff = my_nbins/2; /* A fall-back position! */
|
||||
my_pntr.base = malloc (bins_in_buff * FS_bpb);
|
||||
}
|
||||
}else {
|
||||
i = (i * 3)/4; /* there's not room to hold everything, so get less! */
|
||||
bins_in_buff = (i + FS_bpb - 1)/FS_bpb;
|
||||
my_pntr.base = malloc (bins_in_buff * FS_bpb);
|
||||
}
|
||||
my_pntr.base = readBuffer;
|
||||
bins_in_buff = READBUFSIZE/FS_bpb;
|
||||
|
||||
if (my_pntr.base == NULL ) {
|
||||
if (FS_dbg_lev0) printf (
|
||||
"\n%s -- SQHM_READ: no buffer space available!\n",
|
||||
@@ -1708,6 +1701,7 @@
|
||||
nbins_to_send = my_nbins;
|
||||
bytes_in_buff = 0;
|
||||
nxt = (char *) my_pntr.base;
|
||||
|
||||
while (nbins_to_send > 0) {
|
||||
/* Read some histogram data into buffer */
|
||||
lastbin = nxtbin_to_send + bins_in_buff;
|
||||
@@ -1743,7 +1737,7 @@
|
||||
nxtbin_to_send += bins_to_go;
|
||||
nbins_to_send -= bins_to_go;
|
||||
}
|
||||
free (my_pntr.base);
|
||||
|
||||
/*
|
||||
** Read-out complete so let DAQ continue.
|
||||
*/
|
||||
|
||||
Reference in New Issue
Block a user