Add scan object to peak command, as: peak [scanObject] ["value"|"data"]

r3683 | dcl | 2012-07-26 15:50:47 +1000 (Thu, 26 Jul 2012) | 1 line
This commit is contained in:
Douglas Clowes
2012-07-26 15:50:47 +10:00
parent a9fc20abee
commit 822b6d57a1

View File

@@ -444,11 +444,43 @@ float ggf2[] = {0.1429, 0.1429, 0.1429, 0.1429, 0.1429, 0.1429, 0.1429}; //
int iRet;
char pBueffel[256];
pDynString buf = NULL;
pScanData pScan = NULL;
char* cmd = NULL;
self = (pFit)pData;
assert(self);
iRet = CalculateFit(self);
if (argc > 1)
{
cmd = argv[1];
CommandList *pCom = NULL;
pCom = FindCommand(pSics,argv[1]);
if (pCom)
{
pDummy pDum = NULL;
pDum = (pDummy)pCom->pData;
if (pDum)
{
if(strcmp(pDum->pDescriptor->name,"ScanObject") == 0)
{
pScan = (pScanData)pDum;
if (argc > 2)
cmd = argv[2];
}
}
}
}
if (pScan)
{
pScanData pScanSave;
pScanSave = self->pScan;
self->pScan = pScan;
iRet = CalculateFit(self);
self->pScan = pScanSave;
}
else
{
iRet = CalculateFit(self);
}
switch(iRet)
{
case 0:
@@ -481,16 +513,16 @@ float ggf2[] = {0.1429, 0.1429, 0.1429, 0.1429, 0.1429, 0.1429, 0.1429}; //
This is a little feature to get the peak without rubbish for
the TAS routines
*/
if(argc > 1)
if(cmd)
{
strtolower(argv[1]);
if(strcmp(argv[1],"value") == 0)
strtolower(cmd);
if(strcmp(cmd,"value") == 0)
{
sprintf(pBueffel,"%f", self->fCenter);
SCWrite(pCon,pBueffel,eValue);
return 1;
}
if(strcmp(argv[1],"data") == 0)
if(strcmp(cmd,"data") == 0)
{
snprintf(pBueffel,255,"%f,%f,%ld",
self->fCenter, self->FWHM, self->lPeak);