- 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:
31
exeman.c
31
exeman.c
@ -169,6 +169,9 @@ static int runBatchBuffer(pExeMan self, SConnection *pCon,
|
||||
pExeBuf buffer = NULL;
|
||||
int status;
|
||||
|
||||
if(!SCMatchRights(pCon,usUser)) {
|
||||
return 0;
|
||||
}
|
||||
filePath = locateBatchBuffer(self,name);
|
||||
if(filePath == NULL){
|
||||
snprintf(pBueffel,255,"ERROR: batch buffer %s not found in path",
|
||||
@ -558,13 +561,24 @@ static int printBuffer(pExeMan self, SConnection *pCon,
|
||||
int argc, char *argv[]){
|
||||
pDynString filePath = NULL;
|
||||
char pLine[512];
|
||||
pExeBuf buf;
|
||||
void *pPtr = NULL;
|
||||
FILE *fd = NULL;
|
||||
|
||||
if(argc < 3){
|
||||
SCWrite(pCon,"ERROR: argument required for exe print",eError);
|
||||
return 0;
|
||||
if(self->exeStackPtr >= 0) {
|
||||
DynarGet(self->exeStack,self->exeStackPtr,&pPtr);
|
||||
buf = (pExeBuf) pPtr;
|
||||
if(buf != NULL){
|
||||
filePath = locateBatchBuffer(self,exeBufName(buf));
|
||||
}
|
||||
} else {
|
||||
SCWrite(pCon,"ERROR: no default buffer to print, argument required",eError);
|
||||
return 0;
|
||||
}
|
||||
} else {
|
||||
filePath = locateBatchBuffer(self,argv[2]);
|
||||
}
|
||||
filePath = locateBatchBuffer(self,argv[2]);
|
||||
if(filePath == NULL){
|
||||
snprintf(pLine,255,"ERROR: batch buffer %s not found in path",
|
||||
argv[2]);
|
||||
@ -610,7 +624,7 @@ static int enqueueBuffer(pExeMan self, SConnection *pCon,
|
||||
buf = exeBufCreate("enqueue");
|
||||
if(buf == NULL){
|
||||
SCWrite(pCon,"ERROR: out of memory",eError);
|
||||
return NULL;
|
||||
return 0;
|
||||
}
|
||||
status = exeBufLoad(buf,GetCharArray(filePath));
|
||||
DeleteDynString(filePath);
|
||||
@ -727,9 +741,6 @@ int ExeManagerWrapper(SConnection *pCon, SicsInterp *pSics, void *pData,
|
||||
return status;
|
||||
}else if(strcmp(argv[1],"info") == 0){
|
||||
status = infoHandler(self,pCon,argc,argv);
|
||||
if(status){
|
||||
SCSendOK(pCon);
|
||||
}
|
||||
return status;
|
||||
}else if(strcmp(argv[1],"print") == 0){
|
||||
status = printBuffer(self,pCon,argc,argv);
|
||||
@ -755,7 +766,11 @@ int ExeManagerWrapper(SConnection *pCon, SicsInterp *pSics, void *pData,
|
||||
}
|
||||
return status;
|
||||
} else {
|
||||
return runBatchBuffer(self,pCon,pSics,pBufferName);
|
||||
status = runBatchBuffer(self,pCon,pSics,pBufferName);
|
||||
if(self->exeStackPtr < 0){
|
||||
SCWrite(pCon,"EXE TERMINATED",eWarning);
|
||||
}
|
||||
return status;
|
||||
}
|
||||
} else {
|
||||
SCWrite(pCon,"ERROR: need argument to manage batch buffers",eError);
|
||||
|
Reference in New Issue
Block a user