- Added separate drivable motors for four circle H, K, L
- Added a listen mode to commandlog in order to support the batchEditor - Some small fixes to exe* for BatchEditor
This commit is contained in:
12
nxscript.c
12
nxscript.c
@@ -160,7 +160,7 @@ static int handleFileOperations(SConnection *pCon, pNXScript self,
|
||||
if(argc < 4){
|
||||
SCWrite(pCon,"ERROR: insufficient number of arguments for file operation",
|
||||
eError);
|
||||
return 1;
|
||||
return -1;
|
||||
}
|
||||
/*
|
||||
be considerate: close files left open
|
||||
@@ -180,11 +180,13 @@ static int handleFileOperations(SConnection *pCon, pNXScript self,
|
||||
if(status != NX_OK){
|
||||
sprintf(buffer,"ERROR: failed to open %s",argv[2]);
|
||||
SCWrite(pCon,buffer,eError);
|
||||
return -1;
|
||||
}
|
||||
status = NXDinitfromfile(argv[3],&self->dictHandle);
|
||||
if(status != NX_OK){
|
||||
sprintf(buffer,"ERROR: failed to open dictionary %s",argv[3]);
|
||||
SCWrite(pCon,buffer,eError);
|
||||
return -1;
|
||||
}
|
||||
SCSendOK(pCon);
|
||||
return 1;
|
||||
@@ -261,6 +263,7 @@ static void putCounter(SConnection *pCon, SicsInterp *pSics, pNXScript self,
|
||||
eError);
|
||||
return;
|
||||
}
|
||||
memset(dummy,0,80*sizeof(char));
|
||||
|
||||
/*
|
||||
find counter
|
||||
@@ -897,6 +900,8 @@ int NXScriptAction(SConnection *pCon, SicsInterp *pSics, void *pData,
|
||||
int argc, char *argv[]){
|
||||
pNXScript self = (pNXScript)pData;
|
||||
char *pFile = NULL;
|
||||
int status;
|
||||
|
||||
/*
|
||||
preliminary checks
|
||||
*/
|
||||
@@ -934,7 +939,10 @@ int NXScriptAction(SConnection *pCon, SicsInterp *pSics, void *pData,
|
||||
|
||||
|
||||
|
||||
if(handleFileOperations(pCon,self,argc,argv)){
|
||||
status = handleFileOperations(pCon,self,argc,argv);
|
||||
if(status < 0){
|
||||
return 0;
|
||||
} else if(status == 1){
|
||||
return 1;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user