Clean up the space/tab mess and trailing whitespace

This commit is contained in:
Douglas Clowes
2014-03-03 17:11:12 +11:00
parent 0a012cabc3
commit be347e813c
2 changed files with 333 additions and 333 deletions

View File

@ -76,11 +76,11 @@ static int asciiToUnicode(char *input, char **output){
len = strlen(input);
result = (char *)malloc(2*len*sizeof(char));
if(result == NULL){
return 0;
return 0;
}
memset(result,0,2*len*sizeof(char));
for(i = 0; i < len; i++){
result[i*2] = input[i];
result[i*2] = input[i];
}
*output = result;
return 2*len;
@ -96,11 +96,11 @@ static int unicodeToAscii(char *input, int len, char **output){
result = (char *)malloc((alen+1)*sizeof(char));
if(result == NULL){
return 0;
return 0;
}
memset(result,0,(alen+1)*sizeof(char));
for(i = 0; i < alen; i++){
result[i] = input[i*2];
result[i] = input[i*2];
}
*output = result;
return alen;
@ -108,7 +108,7 @@ static int unicodeToAscii(char *input, int len, char **output){
#endif
/*----------------------------------------------------------------*/
static int tcpDoChoSend(pTcpDoCho self, char *command, int choNum,
char *value){
char *value){
char buffer[1024];
int sendlen, status;
@ -117,22 +117,22 @@ static int tcpDoChoSend(pTcpDoCho self, char *command, int choNum,
*/
self->lastError = 0;
if(choNum < 0){
snprintf(buffer,1023,"#SOS#%s \r\n",command);
snprintf(buffer,1023,"#SOS#%s \r\n",command);
} else if(value != NULL){
snprintf(buffer,1023,"#SOS#%s%1.1d: %s\r\n",command, choNum,
value);
snprintf(buffer,1023,"#SOS#%s%1.1d: %s\r\n",command, choNum,
value);
} else {
snprintf(buffer,1023,"#SOS#%s%1.1d:\r\n",command, choNum);
snprintf(buffer,1023,"#SOS#%s%1.1d:\r\n",command, choNum);
}
sendlen = strlen(buffer);
if(sendlen == 0){
self->lastError = BADCONVERSION;
return 0;
self->lastError = BADCONVERSION;
return 0;
}
status = send(self->controller->pSock->sockid,buffer,sendlen,0);
if(status < 0){
self->lastError = BADWRITE;
return 0;
self->lastError = BADWRITE;
return 0;
}
return 1;
}
@ -147,14 +147,14 @@ static int statusComplete(char *statusMessage){
*/
pPtr = strstr(statusMessage,"TIME");
if(pPtr != NULL){
pPtr = strstr(pPtr+6,"#");
if(pPtr != NULL){
return 1;
} else {
return 0;
}
pPtr = strstr(pPtr+6,"#");
if(pPtr != NULL){
return 1;
} else {
return 0;
}
} else {
return 0;
return 0;
}
}
/*---------------------------------------------------------------*/
@ -164,7 +164,7 @@ static int readChopperNum(char *entry){
pPtr = strstr(entry,"CH");
if(pPtr == NULL){
return -1;
return -1;
}
sscanf(pPtr+3,"%d",&num);
return num;
@ -209,12 +209,12 @@ static int parseStatus(pTcpDoCho self, char *statusMessage){
choNum = readChopperNum(entry);
if(choNum < 0){
self->lastError = BADRESPONSE;
return 0;
self->lastError = BADRESPONSE;
return 0;
}
while((pPtr = stptok(pPtr,entry,79,"#")) != NULL){
addEntry(self,choNum,entry);
memset(entry,0,80);
addEntry(self,choNum,entry);
memset(entry,0,80);
}
return 1;
}
@ -229,45 +229,45 @@ static int tcpDoChoReceive(pTcpDoCho self){
bytesRead = 0;
memset(buffer,0,1024*sizeof(char));
while(time(NULL) < endTime){
if(availableRS232(self->controller)){
bytesRead += recv(self->controller->pSock->sockid,buffer+bufferStart,
1024 - bytesRead,0);
if(bytesRead < 0){
self->lastError = BADREAD;
return 0;
}
if(availableRS232(self->controller)){
bytesRead += recv(self->controller->pSock->sockid,buffer+bufferStart,
1024 - bytesRead,0);
if(bytesRead < 0){
self->lastError = BADREAD;
return 0;
}
if(strstr(buffer,"State") != NULL){
if(statusComplete(buffer) == 0) {
continue;
} else {
status = parseStatus(self,buffer);
return status;
}
}
if(strstr(buffer,"ACCEPT") != NULL){
return 1;
if(statusComplete(buffer) == 0) {
continue;
} else {
status = parseStatus(self,buffer);
return status;
}
}
if(strstr(buffer,"ACCEPT") != NULL){
return 1;
} else if(strstr(buffer,"NCCEPT") != NULL){
self->lastError = FAILEDCOMMAND;
return 0;
self->lastError = FAILEDCOMMAND;
return 0;
} else {
self->lastError = BADRESPONSE;
return 0;
}
self->lastError = BADRESPONSE;
return 0;
}
} else {
SicsWait(1);
}
SicsWait(1);
}
}
self->lastError = TIMEOUT;
return 0;
}
/*-----------------------------------------------------------------*/
static int tcpDoChoCommand(pTcpDoCho self, char *command, int choNum,
char *value){
char *value){
int status;
status = tcpDoChoSend(self,command,choNum,value);
if(status == 0){
return 0;
return 0;
}
return tcpDoChoReceive(self);
}
@ -283,8 +283,8 @@ static int TcpDoChoConnect(pTcpDoCho self){
status = initRS232(self->controller);
if(status != 1){
self->lastError = status;
return 0;
self->lastError = status;
return 0;
}
setRS232Timeout(self->controller,5);
@ -297,13 +297,13 @@ static int TcpDoChoConnect(pTcpDoCho self){
snprintf(buffer,255,"user:%s\r\n",self->user);
sendLen = strlen(buffer);
if(sendLen == 0){
self->lastError = BADCONVERSION;
self->lastError = BADCONVERSION;
return 0;
}
status = send(self->controller->pSock->sockid,buffer,sendLen,0);
if(status < 0){
self->lastError = BADSEND;
return 0;
self->lastError = BADSEND;
return 0;
}
readLen = 255;
readRS232(self->controller,(void *)buffer,&readLen);
@ -314,13 +314,13 @@ static int TcpDoChoConnect(pTcpDoCho self){
snprintf(buffer,255,"password:%s\r\n",self->pword);
sendLen = strlen(buffer);
if(sendLen == 0){
self->lastError = BADCONVERSION;
self->lastError = BADCONVERSION;
return 0;
}
status = send(self->controller->pSock->sockid,buffer,sendLen,0);
if(status < 0){
self->lastError = BADSEND;
return 0;
self->lastError = BADSEND;
return 0;
}
readLen = 255;
readRS232(self->controller,(void *)buffer,&readLen);
@ -348,32 +348,32 @@ static int TcpChopperTask(void *pData){
assert(pPriv);
if(pPriv->stop == 1){
return 0;
return 0;
}
if(time(NULL) > pPriv->nextRefresh){
if(pPriv->lastError != 0){
self->GetError(self,&code,buffer,79);
snprintf(error,511,"WARNING: chopper tries to fix: %s",buffer);
WriteToCommandLog("Chopper-task:>>", error);
if(pPriv->lastError != 0){
self->GetError(self,&code,buffer,79);
snprintf(error,511,"WARNING: chopper tries to fix: %s",buffer);
WriteToCommandLog("Chopper-task:>>", error);
status = self->TryFixIt(self,code);
if(status == CHFAIL){
pPriv->nextRefresh = time(NULL) + pPriv->iRefreshIntervall;
return 1;
}
} else {
pPriv->busy = 1;
for(i = 0; i < pPriv->numChoppers; i++){
status = tcpDoChoCommand(pPriv,"STATE ", i+1,NULL);
if(status != 1){
/*
force error correction
*/
return 1;
}
if(status == CHFAIL){
pPriv->nextRefresh = time(NULL) + pPriv->iRefreshIntervall;
return 1;
}
pPriv->nextRefresh = time(NULL) + pPriv->iRefreshIntervall;
pPriv->busy = 0;
} else {
pPriv->busy = 1;
for(i = 0; i < pPriv->numChoppers; i++){
status = tcpDoChoCommand(pPriv,"STATE ", i+1,NULL);
if(status != 1){
/*
force error correction
*/
return 1;
}
}
pPriv->nextRefresh = time(NULL) + pPriv->iRefreshIntervall;
pPriv->busy = 0;
}
}
return 1;
@ -388,13 +388,13 @@ static int TcpDoChoKill(pCodri self){
return 1;
if(pPriv->controller != NULL){
KillRS232(pPriv->controller);
KillRS232(pPriv->controller);
}
if(pPriv->parameters != NULL){
DeleteStringDict(pPriv->parameters);
DeleteStringDict(pPriv->parameters);
}
if(pPriv->config != NULL){
free(pPriv->config);
free(pPriv->config);
}
free(pPriv);
return 1;
@ -411,11 +411,11 @@ static int TcpDoChoConfigure(pCodri pDriv){
assert(self != NULL);
if(self->config != NULL){
pPtr = self->config;
while( (pPtr = stptok(pPtr,command,79,"\n")) != NULL){
status = tcpDoChoCommand(self,command,-1,NULL);
if(status != 1){
return 0;
pPtr = self->config;
while( (pPtr = stptok(pPtr,command,79,"\n")) != NULL){
status = tcpDoChoCommand(self,command,-1,NULL);
if(status != 1){
return 0;
}
}
}
@ -436,22 +436,22 @@ static int TcpDoChoInit(pCodri pDriv){
status = TcpDoChoConnect(self);
if(status != 1){
return 0;
return 0;
}
status = TcpDoChoConfigure(pDriv);
if(status != 1){
return 0;
return 0;
}
#if 0
/* start the update task */
if(self->lTask == 0){
self->lTask = TaskRegister(pServ->pTasker,
TcpChopperTask,
NULL,
NULL,
pDriv,
1);
self->lTask = TaskRegister(pServ->pTasker,
TcpChopperTask,
NULL,
NULL,
pDriv,
1);
}
#endif
return 1;
@ -462,11 +462,11 @@ static void waitForBusy(pTcpDoCho self){
endTime = time(NULL) + 10 *60; /* max 10 min */
while(time(NULL) < endTime){
if(self->busy == 1){
SicsWait(3);
if(self->busy == 1){
SicsWait(3);
} else {
return;
}
return;
}
}
WriteToCommandLog("Chopper-task>> ","WARNING: timeout on busy flag, flag forced");
self->busy = 0;
@ -481,8 +481,8 @@ static int TcpDoChoClose(pCodri pDriv){
self->stop = 1;
if(self->controller != NULL){
KillRS232(self->controller);
self->controller = NULL;
KillRS232(self->controller);
self->controller = NULL;
}
return 1;
}
@ -492,12 +492,12 @@ static int dissectName(char *name, char par[80], int *num){
pPtr = strrchr(name,(int)'_');
if(pPtr == NULL){
return 0;
return 0;
}
memset(par,0,80*sizeof(char));
strncpy(par,name,pPtr - name);
if(sscanf(pPtr+1,"%d",num) != 1){
return 0;
return 0;
}
return 1;
}
@ -538,37 +538,37 @@ static int TcpDoChoSetPar2(pCodri pDriv, char *parname, char *value){
to make the stored status represent the new target values
*/
if(dissectName(parname,par,&choNum)){
/*
check for emergency stop
*/
snprintf(buffer,79,"State_%1.1d",choNum);
memset(state,0,80*sizeof(char));
StringDictGet(self->parameters,buffer,state,79);
if(strstr(state,"E-Stop") != NULL){
self->lastError = ESTOP;
return 0;
/*
check for emergency stop
*/
snprintf(buffer,79,"State_%1.1d",choNum);
memset(state,0,80*sizeof(char));
StringDictGet(self->parameters,buffer,state,79);
if(strstr(state,"E-Stop") != NULL){
self->lastError = ESTOP;
return 0;
}
if(strcmp(par,"speed") == 0){
waitForBusy(self);
status = tcpDoChoCommand(self,"SPEED ",choNum,trim(value));
tcpDoChoCommand(self,"STATE ",choNum,NULL);
if(status != 1){
return 0;
} else {
return 1;
}
} else if(strcmp(par,"phase") == 0){
waitForBusy(self);
if(strcmp(par,"speed") == 0){
waitForBusy(self);
status = tcpDoChoCommand(self,"SPEED ",choNum,trim(value));
tcpDoChoCommand(self,"STATE ",choNum,NULL);
if(status != 1){
return 0;
} else {
return 1;
}
} else if(strcmp(par,"phase") == 0){
waitForBusy(self);
if (errno != 0)
return 0;
status = tcpDoChoCommand(self,"PHASE ",choNum,trim(value));
tcpDoChoCommand(self,"STATE ",choNum,NULL);
if(status != 1){
return 0;
} else {
return 1;
}
status = tcpDoChoCommand(self,"PHASE ",choNum,trim(value));
tcpDoChoCommand(self,"STATE ",choNum,NULL);
if(status != 1){
return 0;
} else {
return 1;
}
}
}
self->lastError = UNDRIVABLE;
@ -601,12 +601,12 @@ static int TcpDoChoSetPar(pCodri pDriv, char *parname, float fValue){
assert(self != NULL);
if(dissectName(parname,par,&choNum)){
if(strcmp(par,"speed") == 0){
snprintf(value,79,"%5.1f", fValue);
return TcpDoChoSetPar2(pDriv,parname,value);
} else if(strcmp(par,"phase") == 0){
snprintf(value,79,"%6.2f",fValue);
return TcpDoChoSetPar2(pDriv,parname,value);
if(strcmp(par,"speed") == 0){
snprintf(value,79,"%5.1f", fValue);
return TcpDoChoSetPar2(pDriv,parname,value);
} else if(strcmp(par,"phase") == 0){
snprintf(value,79,"%6.2f",fValue);
return TcpDoChoSetPar2(pDriv,parname,value);
}
}
if(strcmp(parname,"updateintervall") == 0){
@ -615,8 +615,8 @@ static int TcpDoChoSetPar(pCodri pDriv, char *parname, float fValue){
self->iRefreshIntervall = (int)fValue;
return 1;
} else {
snprintf(value,79,"%f",fValue);
return TcpDoChoSetPar2(pDriv,parname,value);
snprintf(value,79,"%f",fValue);
return TcpDoChoSetPar2(pDriv,parname,value);
}
}
/*---------------------------------------------------------------------*/
@ -744,10 +744,10 @@ static int TcpDoChoCheckPar(pCodri pDriv, char *parname){
check for flags first
*/
if(self->busy){
return HWBusy;
return HWBusy;
}
if(self->lastError != 0) {
return HWFault;
return HWFault;
}
/*
@ -764,38 +764,38 @@ static int TcpDoChoCheckPar(pCodri pDriv, char *parname){
memset(state,0,80*sizeof(char));
StringDictGet(self->parameters,buffer,state,79);
if(strstr(state,"E-Stop") != NULL){
self->lastError = HWFault;
return 0;
self->lastError = HWFault;
return 0;
}
memset(par,0,80);
dissectName(parname,par,&choNum);
if(strcmp(par,"speed") == 0){
snprintf(buffer,79,"RSPEED_%1.1d", choNum);
StringDictGet(self->parameters,buffer,csoll,79);
sscanf(csoll,"%f",&soll);
StringDictGet(self->parameters,buffer,csoll,79);
sscanf(csoll,"%f",&soll);
snprintf(buffer,79,"ASPEED_%1.1d", choNum);
StringDictGet(self->parameters,buffer,value,79);
sscanf(value,"%f",&val);
delta = ABS(soll - val);
if(delta > SPEEDTOL){
return HWBusy;
} else {
return HWIdle;
}
StringDictGet(self->parameters,buffer,value,79);
sscanf(value,"%f",&val);
delta = ABS(soll - val);
if(delta > SPEEDTOL){
return HWBusy;
} else {
return HWIdle;
}
} else if(strcmp(par,"phase") == 0){
snprintf(buffer,79,"RPHASE_%1.1d", choNum);
StringDictGet(self->parameters,buffer,csoll,79);
sscanf(value,"%f",&soll);
StringDictGet(self->parameters,buffer,csoll,79);
sscanf(value,"%f",&soll);
snprintf(buffer,79,"APHASE_%1.1d", choNum);
StringDictGet(self->parameters,buffer,value,79);
sscanf(value,"%f",&val);
delta = ABS(soll - val);
if(delta > PHASETOL){
return HWBusy;
} else {
return HWIdle;
}
StringDictGet(self->parameters,buffer,value,79);
sscanf(value,"%f",&val);
delta = ABS(soll - val);
if(delta > PHASETOL){
return HWBusy;
} else {
return HWIdle;
}
}
self->lastError = BADPAR;
return HWFault;
@ -810,36 +810,36 @@ static int TcpDoChoError(pCodri pDriv, int *iCode, char *pError, int iLen){
*iCode = self->lastError;
switch(self->lastError){
case WRONGMODE:
strncpy(pError,"Chopper in wrong mode",iLen);
break;
case WRONGMODE:
strncpy(pError,"Chopper in wrong mode",iLen);
break;
case BADCONVERSION:
strncpy(pError,"Bad ASCII to unicode conversion",iLen);
strncpy(pError,"Bad ASCII to unicode conversion",iLen);
break;
case FAILEDCOMMAND:
strncpy(pError,"Command not accepted",iLen);
strncpy(pError,"Command not accepted",iLen);
break;
case BADWRITE:
strncpy(pError,"Failed to write to chopper controller",iLen);
strncpy(pError,"Failed to write to chopper controller",iLen);
break;
case BADRESPONSE:
strncpy(pError,"Chopper controller send invalid command",iLen);
strncpy(pError,"Chopper controller send invalid command",iLen);
break;
case UNDRIVABLE:
strncpy(pError,"Parameter cannot be changed",iLen);
strncpy(pError,"Parameter cannot be changed",iLen);
break;
case BADPAR:
strncpy(pError,"No such parameter",iLen);
strncpy(pError,"No such parameter",iLen);
break;
case BADVALUE:
strncpy(pError,"Invalid parameter value",iLen);
break;
case ESTOP:
strncpy(pError,"Emergency stop is engaged",iLen);
case ESTOP:
strncpy(pError,"Emergency stop is engaged",iLen);
break;
default:
getRS232Error(self->lastError,pError,iLen);
break;
default:
getRS232Error(self->lastError,pError,iLen);
break;
}
return 1;
}
@ -856,26 +856,26 @@ static int TcpDoChoFix(pCodri pDriv, int iCode){
self->lastError = 0;
switch(iCode){
case BADCONVERSION:
case BADCONVERSION:
case BADRESPONSE:
return CHREDO;
break;
return CHREDO;
break;
case WRONGMODE:
case FAILEDCOMMAND:
case UNDRIVABLE:
case BADPAR:
case ESTOP:
return CHFAIL;
break;
break;
default:
closeRS232(self->controller);
status = TcpDoChoConnect(self);
if(status == 1){
return CHREDO;
closeRS232(self->controller);
status = TcpDoChoConnect(self);
if(status == 1){
return CHREDO;
} else {
return CHFAIL;
}
break;
return CHFAIL;
}
break;
}
return CHFAIL;
}
@ -888,21 +888,21 @@ pCodri MakeTcpDoChoDriver(char *tclArray, SConnection *pCon){
int port, i, count;
Tcl_DString pars;
char *parnames[] = {"State",
"ASPEED",
"RSPEED",
"APHASE",
"RPHASE",
"AVETO",
"DIR",
"MONIT",
"FLOWR",
"WTEMP",
"MTEMP",
"MVIBR",
"MVACU",
"speed",
"phase",
NULL,
"ASPEED",
"RSPEED",
"APHASE",
"RPHASE",
"AVETO",
"DIR",
"MONIT",
"FLOWR",
"WTEMP",
"MTEMP",
"MVIBR",
"MVACU",
"speed",
"phase",
NULL,
};
/*
@ -919,19 +919,19 @@ pCodri MakeTcpDoChoDriver(char *tclArray, SConnection *pCon){
/* port and host name */
pPtr = Tcl_GetVar2(pServ->pSics->pTcl,tclArray,"port",TCL_GLOBAL_ONLY);
if(!pPtr){
SCWrite(pCon,"ERROR: port not found in configuration array for TCP Dornier Chopper",
eError);
SCWrite(pCon,"ERROR: port not found in configuration array for TCP Dornier Chopper",
eError);
free(pNew);
free(self);
free(self);
return NULL;
}
sscanf(pPtr,"%d",&port);
pPtr = Tcl_GetVar2(pServ->pSics->pTcl,tclArray,"host",TCL_GLOBAL_ONLY);
if(!pPtr){
SCWrite(pCon,"ERROR: host not found in configuration array for TCP Dornier Chopper",
eError);
SCWrite(pCon,"ERROR: host not found in configuration array for TCP Dornier Chopper",
eError);
free(pNew);
free(self);
free(self);
return NULL;
}
memset(buffer,0,132);
@ -941,27 +941,27 @@ pCodri MakeTcpDoChoDriver(char *tclArray, SConnection *pCon){
/* number of choppers */
pPtr = Tcl_GetVar2(pServ->pSics->pTcl,tclArray,"nchopper",TCL_GLOBAL_ONLY);
if(!pPtr){
SCWrite(pCon,"ERROR: nchopper not found in configuration array for TCP Dornier Chopper",
eError);
SCWrite(pCon,"ERROR: nchopper not found in configuration array for TCP Dornier Chopper",
eError);
free(pNew);
free(self);
free(self);
return NULL;
}
sscanf(pPtr,"%d",&port);
if(port < 0 || port > 8){
SCWrite(pCon,"ERROR: number of choppers not in range 1 - 8",eError);
SCWrite(pCon,"ERROR: number of choppers not in range 1 - 8",eError);
free(pNew);
free(self);
free(self);
}
self->numChoppers = port;
/* timeout */
pPtr = Tcl_GetVar2(pServ->pSics->pTcl,tclArray,"timeout",TCL_GLOBAL_ONLY);
if(!pPtr){
SCWrite(pCon,"ERROR: timeout not found in configuration array for TCP Dornier Chopper",
eError);
SCWrite(pCon,"ERROR: timeout not found in configuration array for TCP Dornier Chopper",
eError);
free(pNew);
free(self);
free(self);
return NULL;
}
sscanf(pPtr,"%d",&port);
@ -970,19 +970,19 @@ pCodri MakeTcpDoChoDriver(char *tclArray, SConnection *pCon){
/* username and password */
pPtr = Tcl_GetVar2(pServ->pSics->pTcl,tclArray,"user",TCL_GLOBAL_ONLY);
if(!pPtr){
SCWrite(pCon,"ERROR: user not found in configuration array for TCP Dornier Chopper",
eError);
SCWrite(pCon,"ERROR: user not found in configuration array for TCP Dornier Chopper",
eError);
free(pNew);
free(self);
free(self);
return NULL;
}
strncpy(self->user,pPtr, 131);
pPtr = Tcl_GetVar2(pServ->pSics->pTcl,tclArray,"password",TCL_GLOBAL_ONLY);
if(!pPtr){
SCWrite(pCon,"ERROR: password not found in configuration array for TCP Dornier Chopper",
eError);
SCWrite(pCon,"ERROR: password not found in configuration array for TCP Dornier Chopper",
eError);
free(pNew);
free(self);
free(self);
return NULL;
}
strncpy(self->pword,pPtr, 131);
@ -992,16 +992,16 @@ pCodri MakeTcpDoChoDriver(char *tclArray, SConnection *pCon){
*/
pPtr = Tcl_GetVar2(pServ->pSics->pTcl,tclArray,"config",TCL_GLOBAL_ONLY);
if(pPtr != NULL){
self->config = strdup(pPtr);
self->config = strdup(pPtr);
}
/* initialize some more */
self->parameters = CreateStringDict();
if(self->parameters == NULL || self->controller == NULL){
SCWrite(pCon,"ERROR: out of memory in MakeTcpDoCho",eError);
SCWrite(pCon,"ERROR: out of memory in MakeTcpDoCho",eError);
free(pNew);
free(self);
free(self);
return NULL;
}
self->iRefreshIntervall = 60;
@ -1025,11 +1025,11 @@ pCodri MakeTcpDoChoDriver(char *tclArray, SConnection *pCon){
count = 0;
Tcl_DStringAppend(&pars,"updateintervall",15);
while(parnames[count] != NULL){
for(i = 0; i < self->numChoppers; i++){
snprintf(buffer,131,",%s_%1.1d", parnames[count], i + 1);
Tcl_DStringAppend(&pars,buffer,strlen(buffer));
for(i = 0; i < self->numChoppers; i++){
snprintf(buffer,131,",%s_%1.1d", parnames[count], i + 1);
Tcl_DStringAppend(&pars,buffer,strlen(buffer));
}
count++;
count++;
}
pNew->pParList = strdup(Tcl_DStringValue(&pars));
Tcl_DStringFree(&pars);

View File

@ -1,5 +1,5 @@
/*--------------------------------------------------------------------------
L A K E S H O R E 3 4 0 D R I V
L A K E S H O R E 3 4 0 D R I V
This file contains the implementation of a driver for the
Lakeshore 340 Temperature controller.
@ -369,8 +369,8 @@
pMe = (pLAKESHORE340Driv )self->pPrivate;
assert(pMe);
/* For the LAKESHORE340 allow selection of internal or external control
where iControl==1 to 4 for A,B,C,D respectively. */
/* For the LAKESHORE340 allow selection of internal or external control
where iControl==1 to 4 for A,B,C,D respectively. */
if( (iSensor < 1) || (iSensor > 4) )
{
return 0;
@ -448,7 +448,7 @@
pMe = (pLAKESHORE340Driv )self->pPrivate;
assert(pMe);
/* The LAKESHORE340 doesn't need divisor, force to 1.0 */
/* The LAKESHORE340 doesn't need divisor, force to 1.0 */
pMe->fDiv = 1.0; /* fDiv */;
return 1;
}
@ -472,7 +472,7 @@
pMe = (pLAKESHORE340Driv )self->pPrivate;
assert(pMe);
/* The LAKESHORE340 doesn't need multiplier, force to 1.0 */
/* The LAKESHORE340 doesn't need multiplier, force to 1.0 */
pMe->fMult = 1.0; /* fDiv */;
return 1;
}