Cleaned up ANSTO code to merge with sinqdev.sics

This is our new RELEASE-4_0 branch which was taken from ansto/93d9a7c
Conflicts:
	.gitignore
	SICSmain.c
	asynnet.c
	confvirtualmot.c
	counter.c
	devexec.c
	drive.c
	event.h
	exebuf.c
	exeman.c
	histmem.c
	interface.h
	motor.c
	motorlist.c
	motorsec.c
	multicounter.c
	napi.c
	napi.h
	napi4.c
	network.c
	nwatch.c
	nxscript.c
	nxxml.c
	nxxml.h
	ofac.c
	reflist.c
	scan.c
	sicshipadaba.c
	sicsobj.c
	site_ansto/docs/Copyright.txt
	site_ansto/instrument/lyrebird/config/tasmad/sicscommon/nxsupport.tcl
	site_ansto/instrument/lyrebird/config/tasmad/taspub_sics/tasscript.tcl
	statusfile.c
	tasdrive.c
	tasub.c
	tasub.h
	tasublib.c
	tasublib.h
This commit is contained in:
Ferdi Franceschini
2015-04-23 20:49:26 +10:00
parent c650788a2c
commit 10d29d597c
1336 changed files with 9430 additions and 226646 deletions

View File

@@ -11,6 +11,8 @@
Mark Koennecke, June 2003
added addto. Mark Koennecke, August 2009
Make Hipadaba compatible, Mark Koennecke, November 2012
----------------------------------------------------------------------*/
#include <stdio.h>
#include <assert.h>
@@ -47,7 +49,7 @@ static void KillSICSData(void *pData)
}
/*---------------------------------------------------------------------*/
pSICSData createSICSData(void)
pSICSData createSICSData(char *name)
{
pSICSData pNew = NULL;
@@ -63,6 +65,13 @@ pSICSData createSICSData(void)
KillSICSData(pNew);
return NULL;
}
/* pNew->pDes->parNode = MakeHipadabaNode(name,HIPINTVARAR, 1); */
/* if(pNew->pDes->parNode == NULL){ */
/* KillSICSData(pNew); */
/* return NULL; */
/* } */
/* pNew->pDes->parNode->value.doNotFree = 1; */
/* pNew->pDes->parNode->value.v.intArray = pNew->data; */
memset(pNew->data, 0, 1024 * sizeof(int));
memset(pNew->dataType, 0, 1024 * sizeof(char));
pNew->currentDataSize = 1024;
@@ -702,8 +711,13 @@ static int copyHM(pSICSData self, int argc, char *argv[],
SCWrite(pCon, "ERROR: out of memory in SICSData copyhm", eError);
return 0;
}
GetHistogramDirect(pHist, pCon, 0, start, end, iData,
if(end > GetHistLength(pHist)){
GetHistogramDirect(pHist, pCon, 0, start, end, iData,
(end - start) * sizeof(int));
} else {
GetHistogram(pHist, pCon, 0, start, end, iData,
(end - start) * sizeof(int));
}
assignType(self, pos, pos + (end - start), INTTYPE);
SCSendOK(pCon);
return 1;
@@ -940,7 +954,7 @@ static int copyToNode(pSICSData self, int argc, char *argv[],
}
node->value.arrayLength = length;
}
memcpy(node->value.v.intArray, self->data, length*sizeof(int));
memcpy(node->value.v.intArray, self->data + start, length*sizeof(int));
break;
case HIPFLOATAR:
case HIPFLOATVARAR:
@@ -1115,7 +1129,7 @@ int SICSDataFactory(SConnection * pCon, SicsInterp * pSics, void *pData,
strtolower(argv[2]);
if (strcmp(argv[1], "new") == 0) {
self = createSICSData();
self = createSICSData(argv[2]);
if (self == NULL) {
SCWrite(pCon, "ERROR: not enough memory to create SICSData", eError);
return 0;