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:
16
danu.c
16
danu.c
@@ -75,7 +75,7 @@ static int readDataNumber(pDataNumber self)
|
||||
}
|
||||
|
||||
/*-----------------------------------------------------------------------*/
|
||||
static int writeDataNumber(pDataNumber self, int iNum)
|
||||
static int writeDataNumber(pDataNumber self, int iNum)
|
||||
{
|
||||
FILE *fd = NULL;
|
||||
|
||||
@@ -126,7 +126,18 @@ static int InterestCallback(int iEvent, void *pEvent, void *pUser)
|
||||
}
|
||||
return 1;
|
||||
}
|
||||
|
||||
/*-------------------------------------------------------------------------*/
|
||||
static void *GetDanuInterface(void *data, int interfaceID)
|
||||
{
|
||||
pDataNumber self = (pDataNumber)data;
|
||||
if(self == NULL){
|
||||
return NULL;
|
||||
}
|
||||
if(interfaceID == CALLBACKINTERFACE){
|
||||
return self->pCall;
|
||||
}
|
||||
return NULL;
|
||||
}
|
||||
/*-------------------------------------------------------------------------*/
|
||||
pDataNumber CreateDataNumber(char *pFileName)
|
||||
{
|
||||
@@ -140,6 +151,7 @@ pDataNumber CreateDataNumber(char *pFileName)
|
||||
memset(pNew, 0, sizeof(DataNumber));
|
||||
|
||||
pNew->pDes = CreateDescriptor("DataNumber");
|
||||
pNew->pDes->GetInterface = GetDanuInterface;
|
||||
pNew->pCall = CreateCallBackInterface();
|
||||
if (!pNew->pDes || !pNew->pCall) {
|
||||
free(pNew);
|
||||
|
||||
Reference in New Issue
Block a user