- Removed SCStart/EndBuffering as far as possible and fixed an issue with
the capture command in that it not put resluts into the Tcl interpreter. This broke scriptcontext scripts in complicated situations. - Resolved some issues with the TAS calculation and negative scattering sense. - Fixed a bug which did not reset the state to idle after checking reachability in confvirtualmot.c
This commit is contained in:
43
autowin.c
43
autowin.c
@ -97,25 +97,30 @@ static float calcCOG(HistInt *data, int length, int startPos)
|
||||
static void printPeaks(SConnection *pCon, int peakList,
|
||||
HistInt *data, int length)
|
||||
{
|
||||
int status, startPos, oldStartPos = 0;
|
||||
float cog;
|
||||
pDynString buf;
|
||||
|
||||
SCStartBuffering(pCon);
|
||||
status = LLDnodePtr2First(peakList);
|
||||
while(status > 0){
|
||||
LLDnodeDataTo(peakList,&startPos);
|
||||
cog = calcCOG(data, length, startPos);
|
||||
startPos = (int)nintf(cog);
|
||||
if((startPos - oldStartPos) > 2){
|
||||
SCPrintf(pCon,eValue,"%d,%d,%d", startPos - 5, startPos + 5,
|
||||
startPos);
|
||||
oldStartPos = startPos;
|
||||
}
|
||||
status = LLDnodePtr2Next(peakList);
|
||||
}
|
||||
buf = SCEndBuffering(pCon);
|
||||
SCWrite(pCon,GetCharArray(buf), eValue);
|
||||
int status, startPos, oldStartPos = 0;
|
||||
float cog;
|
||||
pDynString buf;
|
||||
char buffer[512];
|
||||
|
||||
buf = CreateDynString(256,256);
|
||||
if(buf == NULL){
|
||||
SCWrite(pCon,"ERROR: out of memory printing peaks", eError);
|
||||
return;
|
||||
}
|
||||
status = LLDnodePtr2First(peakList);
|
||||
while(status > 0){
|
||||
LLDnodeDataTo(peakList,&startPos);
|
||||
cog = calcCOG(data, length, startPos);
|
||||
startPos = (int)nintf(cog);
|
||||
if((startPos - oldStartPos) > 2){
|
||||
snprintf(buffer,512,"%d,%d,%d",startPos - 5, startPos + 5, startPos);
|
||||
DynStringConcatLine(buf,buffer);
|
||||
oldStartPos = startPos;
|
||||
}
|
||||
status = LLDnodePtr2Next(peakList);
|
||||
}
|
||||
SCWrite(pCon,GetCharArray(buf), eValue);
|
||||
DeleteDynString(buf);
|
||||
}
|
||||
/*------------------------------------------------------------------------*/
|
||||
static int CalcCmd(pSICSOBJ self, SConnection *pCon, pHdb commandNode,
|
||||
|
Reference in New Issue
Block a user