- Fixed proton current in mesure

This commit is contained in:
koennecke
2007-09-05 11:15:55 +00:00
parent 8693509927
commit cc0995541f
6 changed files with 1409 additions and 1802 deletions

View File

@ -14,7 +14,7 @@ NILIB=$(SINQDIR)/sl-linux/lib/cib.o
include sllinux_def
CC = gcc
CFLAGS = -I$(HDFROOT)/include -DHDF4 -DHDF5 -DNXXML $(NI) \
CFLAGS = -I$(HDFROOT)/include -DNXXML -DHDF4 -DHDF5 $(NI) \
-Ipsi/hardsup -I. \
-Werror -DCYGNUS -DNONINTF -g $(DFORTIFY) \
-Wall -Wno-unused -Wno-comment -Wno-switch

View File

@ -987,10 +987,28 @@ static int ScanReflection(pMesure self, float twoTheta, SConnection *pCon)
return 1;
}
/*---------------------------------------------------------------------------*/
static double getProtonAverage(pMesure self){
int np, i;
long *lData = NULL, lSum = 0;
np = GetScanNP(self->pScanner);
lData = (long *)malloc((np+1)*sizeof(long));
if(lData == NULL || np == 0){
return 0.;
}
memset(lData,0,(np+1)*sizeof(long));
GetScanMonitor(self->pScanner,2,lData, np);
for(i = 0; i < np; i++){
lSum += lData[i];
}
return (double)lSum/(double)np;
}
/*---------------------------------------------------------------------------*/
static int WriteReflection(pMesure self, float fHKL[3],SConnection *pCon)
{
float fSum, fSigma, fSet[4], fTemp, fPreset, fStep;
double prot;
static float fMax = 10.;
int iRet, i,ii, iLF, iNP;
char pBueffel[512], pNum[10], pTime[132];
@ -1107,8 +1125,9 @@ static int ScanReflection(pMesure self, float twoTheta, SConnection *pCon)
SNXFormatTime(pBueffel,512);
GetScanVarStep(self->pScanner,0,&fStep);
fPreset = GetScanPreset(self->pScanner);
fprintf(self->fRefl,"%3d %7.4f %9.0f %7.3f %s\n",iNP,fStep,
fPreset,fTemp,pBueffel);
prot = getProtonAverage(self);
fprintf(self->fRefl,"%3d %7.4f %9.0f %7.3f %12f %s\n",iNP,fStep,
fPreset,fTemp,prot, pBueffel);
for(i = 0; i < iNP; i++)
{
for(ii = 0; ii < 10 && i < iNP; ii++)

View File

@ -689,6 +689,7 @@ extern int VerifyChannel(mkChannel *self); /* defined in network.c */
int conCount = 0;
char num[50];
IPair *options = NULL;
char buffer[1024];
self = (pNetRead)pData;
assert(self);
@ -707,6 +708,7 @@ extern int VerifyChannel(mkChannel *self); /* defined in network.c */
FD_ZERO(&lMask);
iRet = LLDnodePtr2First(self->iList);
iCount = 0;
buffer[0] = '\0';
while(iRet != 0)
{
LLDnodeDataTo(self->iList,&NItem);
@ -714,6 +716,8 @@ extern int VerifyChannel(mkChannel *self); /* defined in network.c */
{
break;
}
sprintf(num,"%d, type %d:", NItem.pSock->sockid, NItem.eType);
strcat(buffer,num);
FD_SET(NItem.pSock->sockid,&lMask);
if(NItem.pSock->sockid > iCount)
{
@ -725,6 +729,8 @@ extern int VerifyChannel(mkChannel *self); /* defined in network.c */
snprintf(num,50,"%d", conCount);
IFSetOption(pSICSOptions,"ConnectionCount",num);
IFSetOption(pSICSOptions,"ConMask",buffer);
/* the select itself */
tmo.tv_usec = self->iReadTimeout;

View File

@ -112,6 +112,7 @@
assert(TaskerInit(&self->pTasker));
pSICSOptions = IFAddOption(pSICSOptions, "ConnectionCount","0");
pSICSOptions = IFAddOption(pSICSOptions, "ConMask","0");
/* initialize the network watcher */
NetWatchInit();

View File

@ -286,7 +286,7 @@ static int sendZippedNodeData(pHdb node, SConnection *pCon){
}
memset(iData,0,newValue.arrayLength*sizeof(int));
for(i = 0; i < newValue.arrayLength; i++){
iData[i] = htonl((int)newValue.v.floatArray[i]*65536.);
iData[i] = htonl((int)(newValue.v.floatArray[i]*65536.));
}
SCWriteZipped(pCon,path, iData,
newValue.arrayLength*sizeof(int));

3177
val.lis

File diff suppressed because it is too large Load Diff