- Introduced a command history log for statistical and
syntax checking input purposes - Rectified an error message in fourmess.c - HMcontrol did not check for the HM to stop before returning. This caused weird data files at AMOR as the data had not yet been downloaded from the HM. - Fixed an issue about parameters in multicounter - Temporary fix in nxscript.c to always read the Hm from the HM and not a buffer. This is prior to rethinking caching strategies for old style HM's. - Synchronize now copies fixed motors correctly. This used to cause irritation with users. This now requires a script syncdrive to exist in the sync server which takes care of handling the fixed flag when this is desired. - Added initify to sicsdata in order to copy large value timebins over properly at AMOR SKIPPED: psi/amorstat.c psi/make_gen psi/makefile_linux psi/polterwrite.c psi/sinq.c psi/sinqhttp.c psi/sinqhttpprot.c psi/sps.c psi/tdchm.c
This commit is contained in:
42
macro.c
42
macro.c
@@ -71,6 +71,7 @@
|
||||
#include "stringdict.h"
|
||||
#include "exeman.h"
|
||||
#include "nxcopy.h"
|
||||
#include "commandlog.h"
|
||||
|
||||
#define SICSERROR "005567SICS"
|
||||
/*----------------------------------------------------------------------------
|
||||
@@ -117,7 +118,33 @@ int MacroPop(void)
|
||||
}
|
||||
return 1;
|
||||
}
|
||||
/*---------------------------------------------------------------------------
|
||||
* This is to suppress certain stuff from the history log in order to stop it
|
||||
* from filling with garbage
|
||||
-----------------------------------------------------------------------------*/
|
||||
static int historyFilter(pDummy pDum, char *command, char *fullCommand)
|
||||
{
|
||||
static char *toRemove[] = {"sct", "hupdate",NULL};
|
||||
static char *typeRemove[] = {"ScriptContext",NULL};
|
||||
int i = 0;
|
||||
|
||||
while(toRemove[i] != NULL){
|
||||
if(strcmp(command,toRemove[i]) == 0){
|
||||
return 0;
|
||||
}
|
||||
i++;
|
||||
}
|
||||
|
||||
i = 0;
|
||||
while(typeRemove[i] != NULL){
|
||||
if(strcmp(pDum->pDescriptor->name, typeRemove[i]) == 0) {
|
||||
return 0;
|
||||
}
|
||||
i++;
|
||||
}
|
||||
|
||||
return 1;
|
||||
}
|
||||
/*---------------------------------------------------------------------------*/
|
||||
static int SicsUnknownProc(ClientData pData, Tcl_Interp * pInter,
|
||||
int argc, char *argv[])
|
||||
@@ -128,7 +155,7 @@ static int SicsUnknownProc(ClientData pData, Tcl_Interp * pInter,
|
||||
SicsInterp *pSinter = NULL;
|
||||
SConnection *pCon = NULL;
|
||||
CommandList *pCommand = NULL;
|
||||
char *lastCommand = NULL, comBuffer[132];
|
||||
char *lastCommand = NULL, comBuffer[132], comHistory[256];
|
||||
int iRet = 0, i;
|
||||
int iMacro;
|
||||
Statistics *old;
|
||||
@@ -188,6 +215,19 @@ static int SicsUnknownProc(ClientData pData, Tcl_Interp * pInter,
|
||||
iRet = pCommand->OFunc(pCon, pSinter, pCommand->pData, margc, myarg);
|
||||
StatisticsEnd(old);
|
||||
SCsetMacro(pCon, iMacro);
|
||||
|
||||
if(iRet == 1){
|
||||
/*
|
||||
* this is OK because comBuffer is length restricted
|
||||
*/
|
||||
strcpy(comHistory,"SICSUNKNOWN: ");
|
||||
strcat(comHistory,comBuffer);
|
||||
/* This gives just to many unwanted entries.... TODO: Filter better
|
||||
if(historyFilter(pCommand->pData, myarg[0], comBuffer) == 1){
|
||||
WriteCommandHistory(comHistory);
|
||||
}
|
||||
*/
|
||||
}
|
||||
/*
|
||||
lastUnkown gets deeply stacked with each SICS command exec'd.
|
||||
This is not reflected in code. However, lastUnknown has already
|
||||
|
||||
Reference in New Issue
Block a user