diff --git a/hardsup/asynsrv_utility.c b/hardsup/asynsrv_utility.c index 0db06f9..57a28cc 100644 --- a/hardsup/asynsrv_utility.c +++ b/hardsup/asynsrv_utility.c @@ -1499,9 +1499,9 @@ */ if (asyn_info->skt <= 0) { memset (rcve_buff, - '0', sizeof (*rcve_buff)); + '0', sizeof (*rcve_buff)); if ((AsynSrv_errcode == 0) && (asyn_info->skt < 0)) { - AsynSrv_errcode = ASYNSRV__FORCED_CLOSED; + AsynSrv_errcode = ASYNSRV__FORCED_CLOSED; } return False; } @@ -1601,6 +1601,7 @@ ** .. timeout of 1.5*tmo */ } + memset (rcve_buff,0, sizeof (*rcve_buff)); size = sizeof (rcve_buff->msg_size); memset(rcve_buff->msg_size,0,size); status = recv (asyn_info->skt, rcve_buff->msg_size, size, 0); diff --git a/hardsup/sinqhm.c b/hardsup/sinqhm.c index 2130591..3cea5af 100644 --- a/hardsup/sinqhm.c +++ b/hardsup/sinqhm.c @@ -78,6 +78,9 @@ extern int close(int fp); assert(self); assert(self->iClientSocket); + + memset(&Req_buff,0,sizeof(struct req_buff_struct)); + memset(&Rply_buff,0,sizeof(struct rply_buff_struct)); /* prepare a message */ Req_buff.bigend = htonl (0x12345678); @@ -466,6 +469,8 @@ extern int close(int fp); { return INVALID_HARSH; } + memset(&Req_buff,0,sizeof(struct req_buff_struct)); + memset(&Rply_buff,0,sizeof(struct rply_buff_struct)); /* fill in the request data structure */ Req_buff.bigend = htonl (0x12345678); @@ -700,6 +705,9 @@ extern int close(int fp); assert(self); + memset(&Req_buff,0,sizeof(struct req_buff_struct)); + memset(&Rply_buff,0,sizeof(struct rply_buff_struct)); + /* fill in the request data structure */ Req_buff.bigend = htonl (0x12345678); Req_buff.cmnd = htonl (SQHM_CNCT); @@ -804,6 +812,8 @@ extern int close(int fp); } iRet = 1; + memset(&Req_buff,0,sizeof(struct req_buff_struct)); + /* send close message, this helps the master to clean up */ Req_buff.bigend = htonl (0x12345678); @@ -1660,6 +1670,9 @@ extern int close(int fp); struct tof tofi; assert(self); + + memset(&Req_buff,0,sizeof(struct req_buff_struct)); + memset(&Rply_buff,0,sizeof(struct rply_buff_struct)); /* figure out how long we are going to be*/ iLength = 24 + self->iBanks*sizeof(struct tof_bank); diff --git a/libpsi.a b/libpsi.a index a804ba5..c46e1ee 100644 Binary files a/libpsi.a and b/libpsi.a differ diff --git a/sinqhmdriv.c b/sinqhmdriv.c index 4a22c26..3336263 100644 --- a/sinqhmdriv.c +++ b/sinqhmdriv.c @@ -293,7 +293,7 @@ else { /* close the connection if there is such a thing */ - SINQHMCloseDAQ(pInternal->pMaster); + SINQHMCloseDAQ(pInternal->pMaster); } /* in any case let us propagate the state of affairs to diff --git a/sinqhttp.c b/sinqhttp.c index 5b221b7..0bd9ea4 100644 --- a/sinqhttp.c +++ b/sinqhttp.c @@ -25,14 +25,14 @@ extern char *trim(char *); /*=================================================================== The request strings to append to the computer address ====================================================================*/ -static char startdaq[] = {"/sinqhm/startdaq.egi"}; -static char stopdaq[] = {"/sinqhm/stopdaq.egi"}; -static char pausedaq[] = {"/sinqhm/pausedaq.egi"}; -static char continuedaq[] = {"/sinqhm/continuedaq.egi"}; -static char statusdaq[] = {"/sinqhm/textstatus.egi"}; -static char gethm[] = {"/sinqhm/readhmdata.egi"}; -static char configure[] = {"/sinqhm/configure.egi"}; -static char preset[] = {"/sinqhm/presethm.egi"}; +static char startdaq[] = {"/admin/startdaq.egi"}; +static char stopdaq[] = {"/admin/stopdaq.egi"}; +static char pausedaq[] = {"/admin/pausedaq.egi"}; +static char continuedaq[] = {"/admin/continuedaq.egi"}; +static char statusdaq[] = {"/admin/textstatus.egi"}; +static char gethm[] = {"/admin/readhmdata.egi"}; +static char configure[] = {"/admin/configure.egi"}; +static char preset[] = {"/admin/presethm.egi"}; /*==================================================================== error codes ======================================================================*/ @@ -191,7 +191,7 @@ static int SinqHttpConfigure(pHistDriver self, SConnection *pCon, /* actually do configure */ - if(iInit == 0){ + if(iInit == 1){ memset(confCommand,0,512*sizeof(char)); if(StringDictGet(pOpt,"hmconfigscript",confCommand,511) != 1){ SCWrite(pCon, @@ -201,7 +201,8 @@ static int SinqHttpConfigure(pHistDriver self, SConnection *pCon, } status = Tcl_Eval(pSics->pTcl,confCommand); if(status != TCL_OK){ - snprintf(confCommand,511,"ERROR: Tcl reported %s while evaluating hmconfigscript", + snprintf(confCommand,511, + "ERROR: Tcl reported %s while evaluating hmconfigscript", Tcl_GetStringResult(pSics->pTcl)); SCWrite(pCon,confCommand,eError); return 0; @@ -218,6 +219,7 @@ static int SinqHttpConfigure(pHistDriver self, SConnection *pCon, } status = ghttp_set_type(pPriv->syncRequest,ghttp_type_post); confData = (char *)Tcl_GetStringResult(pSics->pTcl); + /* puts(confData); */ status = ghttp_set_body(pPriv->syncRequest,confData, strlen(confData)); ghttp_set_authinfo(pPriv->syncRequest, pPriv->userName, diff --git a/tabledrive.c b/tabledrive.c index 8ddf49b..0b51db3 100644 --- a/tabledrive.c +++ b/tabledrive.c @@ -445,8 +445,9 @@ static int loadTable(pTableDrive self, char *filename, SConnection *pCon){ while(fgets(pBueffel,511,fd) != NULL){ if(pBueffel[0] == '#'){ strcpy(moti.motorName,trim(&pBueffel[1])); - moti.pMot = FindCommandData(pServ->pSics,moti.motorName, - "Motor"); + moti.pMot = FindCommandData(pServ->pSics, + moti.motorName, + "Motor"); if(moti.pMot == NULL){ snprintf(pBueffel,511,"ERROR: motor %s NOT found!", moti.motorName); diff --git a/tasscan.c b/tasscan.c index b4f8d1a..bcaf081 100644 --- a/tasscan.c +++ b/tasscan.c @@ -151,6 +151,8 @@ static int TASHeader(pScanData self) pDummy pDum= NULL; pIDrivable pDrive = NULL; pEVControl pTem = NULL; + pSicsVariable sVar = NULL; + float f1, f2, f3, f4; assert(self); assert(pTAS); @@ -285,6 +287,57 @@ static int TASHeader(pScanData self) pTAS->tasPar[BX]->fVal, pTAS->tasPar[BY]->fVal, pTAS->tasPar[BZ]->fVal); + + /* + * write mupad stuff if available + */ + sVar = FindCommandData(pServ->pSics,"w1","SicsVariable"); + if(sVar != NULL) + { + f1 = sVar->fVal; + sVar = FindCommandData(pServ->pSics,"w2","SicsVariable"); + if(sVar != NULL) + { + f2 = sVar->fVal; + } + sVar = FindCommandData(pServ->pSics,"w3","SicsVariable"); + if(sVar != NULL) + { + f3 = sVar->fVal; + } + sVar = FindCommandData(pServ->pSics,"w4","SicsVariable"); + if(sVar != NULL) + { + f4 = sVar->fVal; + } + fprintf(self->fd,"PARAM: W1=%8.4f, W2=%8.4f, W3=%8.4f, W4=%8.4f\n", + f1, f2, f3, f4); + + sVar = FindCommandData(pServ->pSics,"p1","SicsVariable"); + if(sVar != NULL) + { + f1 = sVar->fVal; + } + sVar = FindCommandData(pServ->pSics,"p2","SicsVariable"); + if(sVar != NULL) + { + f2 = sVar->fVal; + } + sVar = FindCommandData(pServ->pSics,"p3","SicsVariable"); + if(sVar != NULL) + { + f3 = sVar->fVal; + } + sVar = FindCommandData(pServ->pSics,"p4","SicsVariable"); + if(sVar != NULL) + { + f4 = sVar->fVal; + } + fprintf(self->fd,"PARAM: P1=%8.4f, P2=%8.4f, P3=%8.4f, P4=%8.4f\n", + f1, f2, f3, f4); + + + } /* write currents if in polarisation mode