- Fixed documentation typos

- In support of HMsec, allow the count command in countsec to run without a
  preset parameter. If this is missing the old, stored preset is used.
- Removed a check which causes initialisation of the HM from a batch file fail
  for POLDI
- fixed @nl@ encoding of \n problem with certain kinds of batch files generated by GTSE
- Fixed a bug with summing on hitsmemsec. nxdataset now uses 64 bit int for dimensions.
- Fixed motorsec to remove itself properly from a parent when linked. Please note
  that there is still the limitation that a second generation motor can only be linked
  once in a Hipadaba tree
- Extended subsampling a HM for second generation HM
- Added a hscriptnotify. This calls a script on the update of a node
- POLDI has been rebuilt, chnages to data file writing
- For testing, sinqhttopt now understands a special command, byteswapoff,
  which switches off byte swapping. Required when the HM ius run on an Intel box.
This commit is contained in:
koennecke
2013-09-16 09:27:51 +00:00
parent 5c3e3a4422
commit ec8a3a7bc4
2 changed files with 39 additions and 6 deletions

View File

@ -183,8 +183,13 @@ static void writeDiaphragm2(NXhandle hfil, NXdict hdict,
static void writeCollimator(NXhandle hfil, NXdict hdict, static void writeCollimator(NXhandle hfil, NXdict hdict,
SConnection * pCon) SConnection * pCon)
{ {
char pBueffel[50];
SNXSPutMotor(pServ->pSics, pCon, hfil, hdict, "cov", "cov"); SNXSPutMotor(pServ->pSics, pCon, hfil, hdict, "cov", "cov");
memset(pBueffel,0,sizeof(pBueffel));
Tcl_Eval(InterpGetTcl(pServ->pSics),"coll");
strncpy(pBueffel,Tcl_GetStringResult(InterpGetTcl(pServ->pSics)), 49);
NXDputalias(hfil, hdict, "collpos", pBueffel);
} }
/*--------------------------------------------------------------------*/ /*--------------------------------------------------------------------*/
@ -231,6 +236,15 @@ static void writeSample(NXhandle hfil, NXdict hdict, SConnection * pCon)
SNXSPutMotorNull(pServ->pSics, pCon, hfil, hdict, "ssv0", "sv"); SNXSPutMotorNull(pServ->pSics, pCon, hfil, hdict, "ssv0", "sv");
SNXSPutMotor(pServ->pSics, pCon, hfil, hdict, "ssa", "sa"); SNXSPutMotor(pServ->pSics, pCon, hfil, hdict, "ssa", "sa");
SNXSPutMotorNull(pServ->pSics, pCon, hfil, hdict, "ssa0", "sa"); SNXSPutMotorNull(pServ->pSics, pCon, hfil, hdict, "ssa0", "sa");
pCom = FindCommand(pServ->pSics,"chi");
if(pCom != NULL){
SNXSPutMotor(pServ->pSics, pCon, hfil, hdict, "schi", "chi");
SNXSPutMotorNull(pServ->pSics, pCon, hfil, hdict, "schi0", "chi");
SNXSPutMotor(pServ->pSics, pCon, hfil, hdict, "sphi", "phi");
SNXSPutMotorNull(pServ->pSics, pCon, hfil, hdict, "sphi0", "phi");
}
} }
/*--------------------------------------------------------------------*/ /*--------------------------------------------------------------------*/

View File

@ -93,6 +93,7 @@ typedef struct {
int bytesExpected; int bytesExpected;
char *contentType; char *contentType;
int headerReceived; int headerReceived;
int byteSwap;
} HttpProt, *pHttpProt; } HttpProt, *pHttpProt;
/*---------------------------------------------------------------------*/ /*---------------------------------------------------------------------*/
static int moreToReadThen(Ascon *a, int length) static int moreToReadThen(Ascon *a, int length)
@ -254,9 +255,15 @@ static void handleReply(Ascon * a)
if(pHttp->node == NULL){ if(pHttp->node == NULL){
clearSICSData(pHttp->binData); clearSICSData(pHttp->binData);
dataPtr = getSICSDataPointer(pHttp->binData, 0, len); dataPtr = getSICSDataPointer(pHttp->binData, 0, len);
for (i = 0; i < len; i++) { if(pHttp->byteSwap == 1){
dataPtr[i] = ntohl(hmData[i]); for (i = 0; i < len; i++) {
} dataPtr[i] = ntohl(hmData[i]);
}
} else {
for (i = 0; i < len; i++) {
dataPtr[i] = hmData[i];
}
}
assignSICSType(pHttp->binData, 0, len, INTTYPE); assignSICSType(pHttp->binData, 0, len, INTTYPE);
DynStringClear(a->rdBuffer); DynStringClear(a->rdBuffer);
DynStringCopy(a->rdBuffer, "SICSDATA"); DynStringCopy(a->rdBuffer, "SICSDATA");
@ -275,9 +282,15 @@ static void handleReply(Ascon * a)
} }
pHttp->node->value.arrayLength = len; pHttp->node->value.arrayLength = len;
} }
for(i = 0; i < len; i++){ if(pHttp->byteSwap == 1){
pHttp->node->value.v.intArray[i] = ntohl(hmData[i]); for(i = 0; i < len; i++){
} pHttp->node->value.v.intArray[i] = ntohl(hmData[i]);
}
} else {
for(i = 0; i < len; i++){
pHttp->node->value.v.intArray[i] = hmData[i];
}
}
NotifyHipadabaPar(pHttp->node,NULL); NotifyHipadabaPar(pHttp->node,NULL);
DynStringClear(a->rdBuffer); DynStringClear(a->rdBuffer);
DynStringCopy(a->rdBuffer, "NODEDATA"); DynStringCopy(a->rdBuffer, "NODEDATA");
@ -377,6 +390,11 @@ static int HttpHandler(Ascon * a)
a->state = AsconConnectDone; /* success */ a->state = AsconConnectDone; /* success */
break; break;
case AsconWriteStart: case AsconWriteStart:
if(strcmp(GetCharArray(a->wrBuffer),"byteswapoff") == 0) {
pHttp->byteSwap = 0;
a->state = AsconReadDone;
return 0;
}
if(!ANETvalidHandle(pHttp->sockHandle)){ if(!ANETvalidHandle(pHttp->sockHandle)){
hostport = strdup(a->hostport); hostport = strdup(a->hostport);
colon = strchr(hostport, ':'); colon = strchr(hostport, ':');
@ -520,6 +538,7 @@ static int HttpProtInit(Ascon * a, SConnection * con,
} }
pHttp->sockHandle = -10; pHttp->sockHandle = -10;
pHttp->contentType = strdup("text/html"); pHttp->contentType = strdup("text/html");
pHttp->byteSwap = 1;
a->private = pHttp; a->private = pHttp;
a->killPrivate = killHttp; a->killPrivate = killHttp;
a->state = AsconConnectStart; a->state = AsconConnectStart;