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