Fixed indentation in epicsadapater.c
Corrected a header file include in zebraswap.c
This commit is contained in:
@ -1,12 +1,12 @@
|
||||
/**
|
||||
* This is a general purpose adapter between SICS and EPICS. It provides callbacks
|
||||
* which allows Hipadaba nodes to be connected to EPICS PV's for both reading and
|
||||
* writing.
|
||||
*
|
||||
* copyright: see file COPYRIGHT
|
||||
*
|
||||
* Mark Koennecke, October - November 2014
|
||||
*/
|
||||
* This is a general purpose adapter between SICS and EPICS. It provides callbacks
|
||||
* which allows Hipadaba nodes to be connected to EPICS PV's for both reading and
|
||||
* writing.
|
||||
*
|
||||
* copyright: see file COPYRIGHT
|
||||
*
|
||||
* Mark Koennecke, October - November 2014
|
||||
*/
|
||||
#include <assert.h>
|
||||
#include <sics.h>
|
||||
#include <sicshipadaba.h>
|
||||
@ -16,15 +16,15 @@
|
||||
#include <messagepipe.h>
|
||||
|
||||
/*
|
||||
One of those: alarmString.h cannot be doubly included into the
|
||||
same application
|
||||
One of those: alarmString.h cannot be doubly included into the
|
||||
same application
|
||||
*/
|
||||
#include <alarmString.h>
|
||||
/* extern char *epicsAlarmConditionStrings[]; */
|
||||
|
||||
/*
|
||||
* we have a SICS tasks which polls EPICS regularly.
|
||||
*/
|
||||
* we have a SICS tasks which polls EPICS regularly.
|
||||
*/
|
||||
static long epicsTaskID = -1L;
|
||||
static pMP readPipe = NULL;
|
||||
static epicsMessageQueueId writeQueue;
|
||||
@ -209,10 +209,10 @@ static void connectPV(pHdb node, pEpicsPriv priv)
|
||||
/*--------------------------------------------------------------------------------------
|
||||
This is the Hipadaba callback function
|
||||
--------------------------------------------------------------------------------------*/
|
||||
static hdbCallbackReturn EPICSReadCallback(pHdb currentNode,
|
||||
static hdbCallbackReturn EPICSReadCallback(pHdb currentNode,
|
||||
void *userData,
|
||||
pHdbMessage message)
|
||||
{
|
||||
{
|
||||
pEpicsPriv priv = (pEpicsPriv)userData;
|
||||
hdbDataMessage *mm = NULL;
|
||||
SConnection *con = NULL;
|
||||
@ -250,11 +250,11 @@ static void connectPV(pHdb node, pEpicsPriv priv)
|
||||
}
|
||||
|
||||
return hdbContinue;
|
||||
}
|
||||
/*------------------------------------------------------------------------------------*/
|
||||
static int EpicsConnectRead(pSICSOBJ ccmd, SConnection * con,
|
||||
}
|
||||
/*------------------------------------------------------------------------------------*/
|
||||
static int EpicsConnectRead(pSICSOBJ ccmd, SConnection * con,
|
||||
Hdb * cmdNode, Hdb * par[], int nPar)
|
||||
{
|
||||
{
|
||||
pHdb node = NULL;
|
||||
pEpicsPriv priv = NULL;
|
||||
|
||||
@ -279,14 +279,14 @@ static void connectPV(pHdb node, pEpicsPriv priv)
|
||||
SCSendOK(con);
|
||||
|
||||
return 1;
|
||||
}
|
||||
}
|
||||
/*==============================================================================================
|
||||
Writing Things. Writing can block, thus it has to run in its own thread. This raises the
|
||||
question how to propagate error messages. The solution is a EPICS message queue to which
|
||||
writing threads post. The epics task will read this queue and do the actual printing in the
|
||||
SICS main thread. A convention: NULL means to print to trace.
|
||||
|
||||
================================================================================================*/
|
||||
================================================================================================*/
|
||||
typedef struct {
|
||||
SConnection *pCon;
|
||||
hdbValue v;
|
||||
@ -386,7 +386,7 @@ static void EpicsWriteFunc(void *param)
|
||||
free(wp);
|
||||
free(pv);
|
||||
ca_clear_channel(cid);
|
||||
ca_context_destroy();
|
||||
/* ca_context_destroy(); */
|
||||
}
|
||||
/*----------------------------------------------------------------------------------------------*/
|
||||
static hdbCallbackReturn EPICSWriteCallback(pHdb currentNode,
|
||||
@ -410,7 +410,7 @@ static hdbCallbackReturn EPICSWriteCallback(pHdb currentNode,
|
||||
strncpy(par->pvName,(char *)userData,sizeof(par->pvName));
|
||||
epicsThreadCreate("Write",
|
||||
epicsThreadPriorityHigh,
|
||||
epicsThreadStackSmall,
|
||||
epicsThreadStackMedium,
|
||||
EpicsWriteFunc,
|
||||
par);
|
||||
}
|
||||
@ -418,9 +418,9 @@ static hdbCallbackReturn EPICSWriteCallback(pHdb currentNode,
|
||||
return hdbContinue;
|
||||
}
|
||||
/*------------------------------------------------------------------------------------*/
|
||||
static int EpicsConnectWrite(pSICSOBJ ccmd, SConnection * con,
|
||||
static int EpicsConnectWrite(pSICSOBJ ccmd, SConnection * con,
|
||||
Hdb * cmdNode, Hdb * par[], int nPar)
|
||||
{
|
||||
{
|
||||
pHdb node = NULL;
|
||||
pEpicsPriv priv = NULL;
|
||||
|
||||
@ -443,14 +443,14 @@ static hdbCallbackReturn EPICSWriteCallback(pHdb currentNode,
|
||||
SCSendOK(con);
|
||||
|
||||
return 1;
|
||||
}
|
||||
}
|
||||
|
||||
/*==============================================================================================
|
||||
SICS Hydraulics
|
||||
================================================================================================*/
|
||||
static int EpicsConvertAlarm(pSICSOBJ ccmd, SConnection * con,
|
||||
================================================================================================*/
|
||||
static int EpicsConvertAlarm(pSICSOBJ ccmd, SConnection * con,
|
||||
Hdb * cmdNode, Hdb * par[], int nPar)
|
||||
{
|
||||
{
|
||||
pHdb node = NULL;
|
||||
char value[256];
|
||||
|
||||
@ -462,7 +462,7 @@ static hdbCallbackReturn EPICSWriteCallback(pHdb currentNode,
|
||||
snprintf(value,sizeof(value),"%s", epicsAlarmConditionStrings[par[0]->value.v.intValue]);
|
||||
SCWrite(con,value,eValue);
|
||||
return 1;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/*----------------------------------------------------------------------------------------------*/
|
||||
|
@ -12,7 +12,7 @@ Mark Koennecke, December 2016
|
||||
*/
|
||||
|
||||
#include <sics.h>
|
||||
#include <histmem.h>
|
||||
#include <HistMem.h>
|
||||
#include <sicshipadaba.h>
|
||||
|
||||
/*---------------------------------------------------------------*/
|
||||
|
Reference in New Issue
Block a user