ngc 1.5.0
 
Loading...
Searching...
No Matches
ngcpp.h File Reference
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <fcntl.h>
#include <signal.h>
#include <errno.h>
#include <unistd.h>
#include <sys/types.h>
#include <sys/socket.h>
#include <sys/stat.h>
#include <sys/shm.h>
#include <sys/sem.h>
#include <sys/ioctl.h>
#include <sys/mman.h>
#include <ngc/core/ngcbDrv.h>
#include <ngc/core/ngcbSched.h>
#include <ngc/core/ngcbSocket.h>
#include <ngc/core/ngcppInt.h>

Go to the source code of this file.

Classes

struct  ngcpp_fs_angle_t
 
struct  ngcpp_fs_t
 
struct  ngcpp_dma_t
 
struct  ngcpp_param_t
 
struct  ngcpp_dcmd_t
 
struct  ngcpp_dmbuf_t
 
struct  ngcppFRAME
 
struct  ngcppDATA_XFER
 
struct  ngcppDATA_CON
 
struct  ngcpp_dit_t
 
struct  ngcpp_cmd_srv_api
 

Macros

#define _REENTRANT
 
#define ngcppREV   1
 
#define ngcppIM_DEFAULT   "normal"
 
#define ngcppMIN_RINGBUFSIZE   (1024 * 1024 * 2)
 
#define ngcppMAX_RINGBUFELE   2048
 
#define ngcppNUMBUF_AUTO   0
 
#define ngcppNUMBUF_MAX   -1
 
#define ngcppERR_STACK_SIZE   32
 
#define ngcppPRI_CI   20
 
#define ngcppPRI_CAPTURE   19
 
#define ngcppPRI_PROC   10
 
#define ngcppPRI_FILE   10
 
#define ngcppMAP_NOP   0
 
#define ngcppMAP_FLIPX   1
 
#define ngcppMAP_FLIPY   2
 
#define ngcppMAP_ROT90   3
 
#define ngcppMAP_ROT270   4
 
#define ngcppCMD_FAILURE   -1
 
#define ngcppCMD_SUCCESS   0
 
#define ngcppCMD_EXIT   1
 
#define ngcppCMD_ABORT   2
 
#define ngcppCMD_DATA   3
 
#define ngcppPARAM_IDX(a, b)
 
#define ngcppCHOP_ZERO   1
 
#define ngcppFS_PORT   8067
 
#define ngcppFS_DEFAULT_BOOK_ID   1
 
#define ngcppMIN_COR_TIME   20
 
#define ngcppPI   3.14159265358979323846
 
#define ngcppWRAP_CNT   0xffffffff
 
#define ngcppWRAP_INC(x)
 
#define ngcppWRAP_DEC(x)
 
#define ngcppWRAP_DIFF(x, a, b)
 
#define ngcppInitClient()
 
#define ngcppReqOut(a, b)
 
#define ngcppAddOutputFrame(t)
 
#define ngcppRemoveOutputFrame(t)
 

Typedefs

typedef int(* ngcpp_ci_t) (ngcpp_cmd_t, ngcpp_rep_t *, char *)
 
typedef int(* ngcppPCHECK) (int *, int, int *)
 
typedef void(* ngcppEXT_CMD) (const char *, char *)
 
typedef void(* ngcppSIM) (ngcpp_t **buf, int size, int num, int *p)
 
typedef void(* ngcppSIM64) (ngcpp_t **buf, size_t size, int num, int *p)
 
typedef int(* ngcppCI_OPEN) (const char *name, int *port, char *erms)
 
typedef int(* ngcppCI_CLOSE) (int handle)
 
typedef int(* ngcppCI_CONNECT) (int handle, char *hostInfo, char *erms)
 
typedef int(* ngcppCI_DISCONNECT) (int client)
 
typedef int(* ngcppCI_CMD) (int client, ngcpp_cmd_t *command, char *erms)
 
typedef int(* ngcppCI_REPLY) (int client, ngcpp_rep_t reply, char *erms)
 
typedef void *(* ngcpp_ds_t) (void *arg)
 

Functions

int ngcppUnsigned (void)
 
int ngcppGetLocHostAddr (char *addr, char *erms)
 
void * ngcppMalloc (size_t size)
 
void * ngcppMalloc2 (void *ptr, size_t size)
 
void ngcppFree (void *ptr)
 
int ngcppReAlloc (size_t bufsize, int n, char *erms)
 
void * ngcppBurstAlloc (size_t size)
 
void ngcppBurstFree (void *buffer, size_t size)
 
void * ngcppAttachBuf (void *buffer, off_t offset, size_t size, size_t *mapSize)
 
void ngcppDetachBuf (void *buffer, size_t size)
 
int ngcppStartup (int argc, char **argv, size_t defaultBufsize, char *erms)
 
void ngcppCmdLineHelp (const char *paramStr, const char *helpStr, const char *defaultStr)
 
void ngcppDivide (int num)
 
void ngcppShutdown (int sigFlag)
 
void ngcppExit (int stat)
 
void ngcppSignalHandler (int sig)
 
int ngcppSemWaitTmo (ngcb_sema_t *sem, int tmo)
 
void ngcppChanMap (int *cm, int n)
 
int ngcppOpen (ngcpp_dma_t *dev, char *erms)
 
int ngcppClose (ngcpp_dma_t *dev, int term, char *erms)
 
int ngcppInit (ngcpp_dma_t *dev, unsigned int *doneCount, char *erms)
 
int ngcppTerm (ngcpp_dma_t *dev, char *erms)
 
char ngcppOverrun (ngcpp_dma_t *dev)
 
void ngcppInitFilter (int devIdx, int *chan, int n)
 
ngcpp_tngcppFilter (int devIdx, ngcpp_t *data, int n)
 
void * ngcppCapture (void *arg)
 
void ngcppAppInit (void)
 
int ngcppWaitStart (void)
 
int ngcppStartCapture (void)
 
char ngcppCheckStop (void)
 
int ngcppWaitData (ngcpp_t **res)
 
void ngcppAckData (void)
 
int ngcppFlushInput (void)
 
void ngcppTermProcessing (void)
 
void ngcppIppCfg (int id, void *param, int n)
 
int ngcppIppApply (int id, void *param, int n, char *erms)
 
int * ngcppSetupDynParam (size_t numParam, const char **id, size_t numCmd, char *erms)
 
int ngcppPSync (int alarmtTime, char *erms)
 
int ngcppDynComHandle (ngcpp_dcmd_t *cmdSet)
 
int * ngcppParamPtr (void)
 
void ngcppParamDefault (void)
 
const char * ngcppProperty (const char *name)
 
void ngcppSigFailure (const char *erms)
 
void ngcppErrStackAdd (int id, const char *erms)
 
void * ngcppErrStack (void *argp)
 
void * ngcppCommandProcess (void *argp)
 
void ngcppCiInitErr (void)
 
int ngcppCiParamInit (void)
 
int ngcppCiParamSync (ngcpp_cmd_t command, ngcpp_rep_t *reply, char *erms)
 
int ngcppCiParamSet (ngcpp_cmd_t command, ngcpp_rep_t *reply, char *erms)
 
int ngcppCiParamStat (ngcpp_cmd_t command, ngcpp_rep_t *reply, char *erms)
 
int ngcppCiParamConf (ngcpp_cmd_t command, ngcpp_rep_t *reply, char *erms)
 
int ngcppCiChanSelect (ngcpp_cmd_t command, ngcpp_rep_t *reply, char *erms)
 
int ngcppCiAbort (ngcpp_cmd_t command, ngcpp_rep_t *reply, char *erms)
 
int ngcppCiStart (ngcpp_cmd_t command, ngcpp_rep_t *reply, char *erms)
 
int ngcppCiStop (ngcpp_cmd_t command, ngcpp_rep_t *reply, char *erms)
 
int ngcppCiPause (ngcpp_cmd_t command, ngcpp_rep_t *reply, char *erms)
 
int ngcppCiGetStatus (ngcpp_cmd_t command, ngcpp_rep_t *reply, char *erms)
 
int ngcppCiGetConfig (ngcpp_cmd_t command, ngcpp_rep_t *reply, char *erms)
 
int ngcppCiGetRecvStat (ngcpp_cmd_t command, ngcpp_rep_t *reply, char *erms)
 
int ngcppCiGetRev (ngcpp_cmd_t command, ngcpp_rep_t *reply, char *erms)
 
int ngcppCiGetErrPort (ngcpp_cmd_t command, ngcpp_rep_t *reply, char *erms)
 
int ngcppCiGetDataPort (ngcpp_cmd_t command, ngcpp_rep_t *reply, char *erms)
 
int ngcppCiGetDataPath (ngcpp_cmd_t command, ngcpp_rep_t *reply, char *erms)
 
int ngcppCiSetDataPath (ngcpp_cmd_t command, ngcpp_rep_t *reply, char *erms)
 
int ngcppCiTime (ngcpp_cmd_t command, ngcpp_rep_t *reply, char *erms)
 
int ngcppCiSimTime (ngcpp_cmd_t command, ngcpp_rep_t *reply, char *erms)
 
int ngcppCiSimStartDelay (ngcpp_cmd_t command, ngcpp_rep_t *reply, char *erms)
 
int ngcppCiVerbose (ngcpp_cmd_t command, ngcpp_rep_t *reply, char *erms)
 
int ngcppCiDynCmd (ngcpp_cmd_t command, ngcpp_rep_t *reply, char *erms)
 
int ngcppCiMemSet (ngcpp_cmd_t command, ngcpp_rep_t *reply, char *erms)
 
int ngcppCiMemClose (ngcpp_cmd_t command, ngcpp_rep_t *reply, char *erms)
 
int ngcppCiMemSync (ngcpp_cmd_t command, ngcpp_rep_t *reply, char *erms)
 
int ngcppCiFlushOutput (ngcpp_cmd_t command, ngcpp_rep_t *reply, char *erms)
 
int ngcppCiMemRecv (char *erms)
 
int ngcppCiResetCnt (ngcpp_cmd_t command, ngcpp_rep_t *reply, char *erms)
 
int ngcppCiEnd (ngcpp_cmd_t command, ngcpp_rep_t *reply, char *erms)
 
int ngcppCiSetFilePubPath (ngcpp_cmd_t command, ngcpp_rep_t *reply, char *erms)
 
int ngcppCiSetFilePubBase (ngcpp_cmd_t command, ngcpp_rep_t *reply, char *erms)
 
int ngcppCiUsrCmd (ngcpp_cmd_t command, ngcpp_rep_t *reply, char *erms)
 
int ngcppCiChipOffset (ngcpp_cmd_t command, ngcpp_rep_t *reply, char *erms)
 
int ngcppStartDataServer (unsigned int n, char *erms)
 
int ngcppCloseDataServer (void)
 
void ngcppDataServerStatus (int flag, const char *erms)
 
void ngcppDataTransferReset (int n)
 
void * ngcppDataServerTcp (void *argp)
 
int ngcppDataReq (int n, ngcpp_req_t request, int transferMode, ngcpp_frame_t *frame, int *noSort, int *noWin, int *attach, ngcb_sema_t **txSig)
 
void ngcppDataResetReq (int n)
 
void ngcppDataAck (int n)
 
void ngcppDataAckPending (int n)
 
int ngcppAddFrameType (int type, const char *name, const char *paraName, char *erms)
 
void ngcppInitFrame (ngcppFRAME *frame, char **array, int n)
 
void ngcppReInitFrame (ngcppFRAME *frame, char **array)
 
void ngcppReInitFrameN (ngcppFRAME *frame, char **array, int n)
 
int ngcppPublish (int syncMode, ngcppFRAME *frame)
 
void ngcppSetTimeStamp (uint64_t ts)
 
void ngcppResetTimeStamp ()
 
void ngcppAddFrame (int type)
 
void ngcppRemoveFrame (int type)
 
int ngcppExportRequest (int shmId, int semId, char *erms)
 
void ngcppExport (void *buffer, int ftype, int bitPix, int nx, int ny)
 
int ngcppFlushOutput (void)
 
void ngcppSyncOutput (void)
 
void ngcppSetQueue (void)
 
void ngcppSetTransferringState (void)
 
void ngcppResetTransferringState (void)
 
int ngcppFilePublisherInit (const char *name, char *erms)
 
int ngcppInitFileDump (char *erms)
 
int ngcppFilePublish (ngcppFRAME *frame, int bufIdx, int sync, char *erms)
 
void ngcppFileSync (void)
 
int ngcppFilePublisherPath (int id, const char *path, char *erms)
 
void ngcppFilePublisherBase (const char *base)
 
int ngcppShDataAttach (int shared, int n, size_t size, char *erms)
 
int ngcppShDataClose (void)
 
char * ngcppShDataSetPtr (int id, int *len, char *erms)
 
int ngcppShDataGetPtr (char **ptr, int id, int len, char *erms)
 
void ngcppShDataSwap (int id)
 
int ngcppShDataValid (int id)
 
int ngcppShDataInvalid (int id)
 
int ngcppShDataIsValid (int id)
 
int ngcppGetShift (char *first, int *data, char *bpx, int nx, int tx, int ty, int txw, int tyw, int *sx, int *sy, int *posX, int *posY)
 
int ngcppGetShiftFloat (char *first, float *data, char *bpx, int nx, int tx, int ty, int txw, int tyw, int *sx, int *sy, int *posX, int *posY)
 
int ngcppGetShiftCen (char *first, int *data, char *bpx, int nx, int tx, int ty, int txw, int tyw, int *sx, int *sy, int *posX, int *posY)
 
int ngcppGetShiftCenFloat (char *first, float *data, char *bpx, int nx, int tx, int ty, int txw, int tyw, int *sx, int *sy, int *posX, int *posY)
 
int ngcppShiftAddInt (int *sum, int *data, int nx, int ny, int shx, int shy)
 
int ngcppShiftAddFloat (float *sum, float *data, int nx, int ny, int shx, int shy)
 
int ngcppShiftAddIntN (int *sum, int *data, int nx, int ny, int shx, int shy, int n, int np)
 
int ngcppShiftAddFloatN (float *sum, float *data, int nx, int ny, int shx, int shy, int n, int np)
 
int ngcppWinCpy (char *frm, int fx, int fy, char *win, int sx0, int sy0, int nx, int ny, int bytes, int assemble, int noSort)
 
void ngcppApplyPixMap (char *in, char *out, size_t numPix, int bound)
 
void ngcppDim (int nx, int ny)
 
int ngcppSwapXY (void)
 
void ngcppFrameScale16 (void *buffer, size_t size, int n)
 
void ngcppFrameScaleReal16 (void *buffer, size_t size, int n)
 
void ngcppFlipX (int *map, int nx, int ny)
 
void ngcppFlipY (int *map, int nx, int ny)
 
void ngcppR90 (int *map, int nx, int ny)
 
void ngcppR270 (int *map, int nx, int ny)
 
void ngcppApplyMapOp (int nx, int ny)
 
int ngcppBgThreshold (float *data, float *bg, int nx, int ny, int nbg, double k1, int nLoop, double k2, double *thrMin, double *sigma, double badPixLevel)
 
int ngcppCog (double *cx, double *cy, float *data, int nx, int ny, double thr)
 
int ngcppCogX (double *cx, float *data, int nx, int ny, double thr)
 
int ngcppCogY (double *cy, float *data, int nx, int ny, double thr)
 
int ngcppCogLR (double *cx, double *cy, float *data, int nx, int ny, int slx1, int slx2, double thr, double sigma, int min)
 
int ngcppCogSymXP (double *cx, double *cy, float *data, int nx, int ny, int slx1, int slx2, double thr, double sigma, int min)
 
int ngcppCenCircle (double *cx, double *cy, float *data, int nx, int ny, int slx1, int slx2, double thr, double sigma, int min)
 
int ngcppFsConnect (char *host, char *erms)
 
int ngcppFsDisconnect (int fd)
 
int ngcppFsSend (int fd, ngcpp_fs_t *correction, char *erms)
 
int ngcppDitHandler (ngcppFRAME *ditFrame, ngcppFRAME *intFrame, ngcppFRAME *iintFrame, ngcppFRAME *sdvFrame, ngcppFRAME *hcyc1Frame, ngcppFRAME *hcyc2Frame, double *sumSquare, ngcpp_dit_t *param, char *doInit)
 
int ngcppCntHandler (ngcppFRAME *hcyc, int setupId, int phases, int ndit, int cycSkip, int sdv, int *ditCnt, int *cycCnt, char *initFlag, char *sdvOn, char *first)
 
ngcb_thread_t ngcppDPUB_THID (int idx)
 
ngcb_thread_t ngcppDSRV_THID ()
 
ngcb_thread_t ngcppCI_THID ()
 
ngcb_thread_t ngcppERR_THID ()
 

Variables

ngcppPCHECK ngcppParamCheck
 
ngcppEXT_CMD ngcppUsrCmdHandler
 
ngcppSIM ngcppSimBuf
 
ngcppSIM64 ngcppSimBuf64
 
ngcpp_cmd_srv_apingcppCiSys
 
ngcpp_cmd_srv_api ngcppCiTcp
 
ngcpp_ds_t ngcppDataServer
 
void(* ngcppDataServerExit )(void)
 
ngcpp_dma_tngcppDev
 
int ngcppNumDev
 
char ngcppStatus
 
char ngcppRunning
 
int ngcppMaxComBufSize
 
int ngcppMaxRepBufSize
 
char ngcppCiInitFlag
 
char ngcppErrInitFlag
 
char ngcppDataInitFlag
 
char ngcppDataSrvName [256]
 
char ** ngcppPublisherName
 
int ngcppNumPublishers
 
int ngcppNumDataClients
 
int ngcppPid
 
int ngcppNumFilePub
 
int ngcppFileDump
 
int ngcppFileId
 
char ngcppBaseName [256]
 
char ngcppLocalPath [256]
 
int ngcppNumDataFiles
 
int * ngcppDynPtr
 
int ngcppParamBuf [3][ngcppMAX_PARAMSIZE]
 
ngcpp_param_t ngcppDynParam
 
double ngcppTime [2]
 
uint64_t ngcppTimeStamp
 
int ngcppAutoTimeStamp
 
ngcb_ma_t ngcppTimeFilter [2]
 
int ngcppDynCmd
 
int ngcppDynCmdAck
 
int ngcppNumDynCmd
 
char ngcppMapFile [256]
 
int ngcppCPU
 
int ngcppSimTime
 
int ngcppSimStartDelay
 
int ngcppSimRt
 
int ngcppSimNoise
 
int ngcppSim32
 
int ngcppRtCheck
 
int ngcppCmdClients
 
int ngcppKeyVal
 
int ngcppTransferTypes
 
char ngcppPrintPars
 
char ngcppProcName [128]
 
int ngcppRemoteFd
 
char ngcppRstCnt
 
char ngcppRstCnt_
 
char ngcppQRstCnt
 
char ngcppQRstCnt_
 
char ngcppEndFlg
 
char ngcppTransferring
 
char ngcppDitX
 
int ngcppCmdPort
 
int ngcppErrPort
 
int ngcppDataPort
 
int ngcppStartX
 
int ngcppStartY
 
char * ngcppErmsCi
 
char * ngcppErmsData
 
int ngcppNumTypes
 
ngcpp_ftype ngcppFrameType [32]
 
int * ngcppPixMap
 
size_t * ngcppPixMap64
 
int ngcppMapOp [4]
 
int ngcppNoSort
 
char ngcppPauseFlag
 
char ngcppSyncInput
 
int ngcppNumDiv
 
int ngcppNumDet
 
int ngcppDmaChan
 
unsigned int ngcppDmaIPPMode
 
int ngcppIppTaskId
 
int ngcppIppParam [NGCDRV_MAX_PARAM]
 
unsigned int ngcppIppNumParam
 
int ngcppNumBuf
 
int ngcppDmaPacketSize
 
int ngcppDmaResync
 
int ngcppAdcPacketSize
 
size_t ngcppFrameSize
 
int ngcppDetSetup
 
int ngcppTestCnt
 
int ngcppNQ
 
int ngcppQSize
 
size_t ngcppQBufSize
 
int ngcppQType
 
int ngcppQCnt
 
int ngcppQEnd
 
ngcpp_win_t ngcppQWin
 
int ngcppOvrScanX
 
int ngcppOvrScanY
 
int ngcppPayloadSize
 
int ngcppUnitSize
 
int ngcppJoinerDelay
 
int ngcppDiskMem
 
int ngcppDiskMemIdx
 
char ngcppDiskMemPath [256]
 
int ngcppChopZero
 
char ngcppDataHost [ngcppMAX_DATA_CON][256]
 
int ngcppDataFcnt [ngcppMAX_DATA_CON]
 
int ngcppDataRcnt [ngcppMAX_DATA_CON]
 
char ngcppCmdHost [ngcppCI_MAX_CON][256]
 
int ngcppDmaDiag
 
int ngcppDmaMon
 
int ngcppSimDma
 
int ngcppSimHiRes
 
int ngcppRevApp
 
char ** ngcppArgv
 
int ngcppArgc
 
ngcb_sema_t semRun
 
ngcb_sema_t semStat
 
ngcb_sema_t semParam
 
ngcb_sema_t semParamLock
 
ngcb_sema_t semCmd
 
ngcb_sema_t semCmdAck
 
ngcb_sema_t semBuf
 
ngcb_sema_t semCiInit
 
ngcb_sema_t semErrInit
 
ngcb_sema_t semDataInit
 
ngcb_sema_t semAppInit
 
ngcb_sema_t semMem
 
ngcb_sema_t semTerm
 

Detailed Description

Macro Definition Documentation

◆ _REENTRANT

#define _REENTRANT

◆ ngcppAddOutputFrame

#define ngcppAddOutputFrame ( t)
Value:
void ngcppAddFrame(int type)
Definition ngcppTransferQueue.c:121

Backwards compatibility macro for frame registration

◆ ngcppCHOP_ZERO

#define ngcppCHOP_ZERO   1

Start position of chopper

◆ ngcppCMD_ABORT

#define ngcppCMD_ABORT   2

abort all

◆ ngcppCMD_DATA

#define ngcppCMD_DATA   3

get data

◆ ngcppCMD_EXIT

#define ngcppCMD_EXIT   1

exit command interpreter

◆ ngcppCMD_FAILURE

#define ngcppCMD_FAILURE   -1

operation failed

◆ ngcppCMD_SUCCESS

#define ngcppCMD_SUCCESS   0

operation successfull

◆ ngcppERR_STACK_SIZE

#define ngcppERR_STACK_SIZE   32

Size of error stack

◆ ngcppFS_DEFAULT_BOOK_ID

#define ngcppFS_DEFAULT_BOOK_ID   1

Field stabilisation default book-id (M2)

◆ ngcppFS_PORT

#define ngcppFS_PORT   8067

Field stabilisation port (M2)

◆ ngcppIM_DEFAULT

#define ngcppIM_DEFAULT   "normal"

Default input mode

◆ ngcppInitClient

#define ngcppInitClient ( )
Value:
void ngcppAppInit(void)
Definition ngcppStartup.c:350

Backwards compatibility macro for application initialization

◆ ngcppMAP_FLIPX

#define ngcppMAP_FLIPX   1

flip in x-direction

◆ ngcppMAP_FLIPY

#define ngcppMAP_FLIPY   2

flip in y-direction

◆ ngcppMAP_NOP

#define ngcppMAP_NOP   0

no operation

◆ ngcppMAP_ROT270

#define ngcppMAP_ROT270   4

rotate by 270 degrees counter clockwise

◆ ngcppMAP_ROT90

#define ngcppMAP_ROT90   3

rotate by 90 degrees counter clockwise

◆ ngcppMAX_RINGBUFELE

#define ngcppMAX_RINGBUFELE   2048

Maximum number of ring buffer elements

◆ ngcppMIN_COR_TIME

#define ngcppMIN_COR_TIME   20

Minimum correction time (in milliseconds)

◆ ngcppMIN_RINGBUFSIZE

#define ngcppMIN_RINGBUFSIZE   (1024 * 1024 * 2)

Minimum ring-buffer size

◆ ngcppNUMBUF_AUTO

#define ngcppNUMBUF_AUTO   0

Automatic calculation of number of ring buffer elements

◆ ngcppNUMBUF_MAX

#define ngcppNUMBUF_MAX   -1

Maximize number of ring buffer elements

◆ ngcppPARAM_IDX

#define ngcppPARAM_IDX ( a,
b )
Value:
(int)(((unsigned long)&a-(unsigned long)b)/sizeof(int))

Get parameter index from structure

◆ ngcppPI

#define ngcppPI   3.14159265358979323846

PI

◆ ngcppPRI_CAPTURE

#define ngcppPRI_CAPTURE   19

capture process priority

◆ ngcppPRI_CI

#define ngcppPRI_CI   20

command interpreter priority

◆ ngcppPRI_FILE

#define ngcppPRI_FILE   10

file publisher priority

◆ ngcppPRI_PROC

#define ngcppPRI_PROC   10

application process priority

◆ ngcppRemoveOutputFrame

#define ngcppRemoveOutputFrame ( t)
Value:
void ngcppRemoveFrame(int type)
Definition ngcppTransferQueue.c:134

Backwards compatibility macro for frame un-registration

◆ ngcppReqOut

#define ngcppReqOut ( a,
b )
Value:
int ngcppPublish(int syncMode, ngcppFRAME *frame)
Definition ngcppTransferQueue.c:688

Backwards compatibility macro for data publisher

◆ ngcppREV

#define ngcppREV   1

Pre-processor revision

◆ ngcppWRAP_CNT

#define ngcppWRAP_CNT   0xffffffff

Wrap counter for maximum 32-bit unsigned integer

◆ ngcppWRAP_DEC

#define ngcppWRAP_DEC ( x)
Value:
if(*x==0){*x=ngcppWRAP_CNT;}else{(*x)--;}
#define ngcppWRAP_CNT
Definition ngcpp.h:181

Decrement with 32-bit unsigned integer wrapping

◆ ngcppWRAP_DIFF

#define ngcppWRAP_DIFF ( x,
a,
b )
Value:
if(b<a){*x=(ngcppWRAP_CNT-a)+b;}else{*x=b-a;}

Compute difference between two 32-bit unsigned integer values taking into account the 32-bit wrapping.

◆ ngcppWRAP_INC

#define ngcppWRAP_INC ( x)
Value:
if(*x==ngcppWRAP_CNT){*x=0;}else{(*x)++;}

Increment with 32-bit unsigned integer wrapping

Typedef Documentation

◆ ngcpp_ci_t

typedef int(* ngcpp_ci_t) (ngcpp_cmd_t, ngcpp_rep_t *, char *)

Command handler function type

◆ ngcpp_ds_t

typedef void *(* ngcpp_ds_t) (void *arg)

Data server type

◆ ngcppCI_CLOSE

typedef int(* ngcppCI_CLOSE) (int handle)

Close function type

◆ ngcppCI_CMD

typedef int(* ngcppCI_CMD) (int client, ngcpp_cmd_t *command, char *erms)

Command function type

◆ ngcppCI_CONNECT

typedef int(* ngcppCI_CONNECT) (int handle, char *hostInfo, char *erms)

Connect function type

◆ ngcppCI_DISCONNECT

typedef int(* ngcppCI_DISCONNECT) (int client)

Disconnect function type

◆ ngcppCI_OPEN

typedef int(* ngcppCI_OPEN) (const char *name, int *port, char *erms)

Open function type

◆ ngcppCI_REPLY

typedef int(* ngcppCI_REPLY) (int client, ngcpp_rep_t reply, char *erms)

Reply function type

◆ ngcppEXT_CMD

typedef void(* ngcppEXT_CMD) (const char *, char *)

User command handler type

◆ ngcppPCHECK

typedef int(* ngcppPCHECK) (int *, int, int *)

Parameter check type

◆ ngcppSIM

typedef void(* ngcppSIM) (ngcpp_t **buf, int size, int num, int *p)

Simulator type

◆ ngcppSIM64

typedef void(* ngcppSIM64) (ngcpp_t **buf, size_t size, int num, int *p)

Simulator type (64-bit buffer size)

Function Documentation

◆ ngcppAckData()

void ngcppAckData ( void )

Acknowledge that the current data buffer has been processed.

◆ ngcppAddFrame()

void ngcppAddFrame ( int type)

Add a frame type to the publishing list.

◆ ngcppAddFrameType()

int ngcppAddFrameType ( int type,
const char * name,
const char * paraName,
char * erms )

Add a new frame type and a assign a name and a parameter to switch the frame generation on/off.

◆ ngcppAppInit()

void ngcppAppInit ( void )

Function to be called by the application to signal that all initialization is done.

◆ ngcppApplyMapOp()

void ngcppApplyMapOp ( int nx,
int ny )

Apply stored oparations on pixel sorting map

m1++ = ngcppPixMap[idx];

m1++ = ngcppPixMap64[idx];

◆ ngcppApplyPixMap()

void ngcppApplyPixMap ( char * in,
char * out,
size_t numPix,
int bound )

Apply pixel sorting map.

◆ ngcppAttachBuf()

void * ngcppAttachBuf ( void * buffer,
off_t offset,
size_t size,
size_t * mapSize )

Attach to buffer.

◆ ngcppBgThreshold()

int ngcppBgThreshold ( float * data,
float * bg,
int nx,
int ny,
int nbg,
double k1,
int nLoop,
double k2,
double * thrMin,
double * sigma,
double badPixLevel )

Background threshold estimation (sigma clipping above badPixLevel)

◆ ngcppBurstAlloc()

void * ngcppBurstAlloc ( size_t size)

Return a pointer to the allocated buffer. In case of failure a NULL-pointer is returned.

◆ ngcppBurstFree()

void ngcppBurstFree ( void * buffer,
size_t size )

Free the memory allocated with ngcppBurstAlloc().

◆ ngcppCapture()

void * ngcppCapture ( void * arg)

Capture thread

◆ ngcppCenCircle()

int ngcppCenCircle ( double * cx,
double * cy,
float * data,
int nx,
int ny,
int slx1,
int slx2,
double thr,
double sigma,
int min )

Circle-fit centroiding algorithm

◆ ngcppChanMap()

void ngcppChanMap ( int * cm,
int n )

Default channel mapping

◆ ngcppCheckStop()

char ngcppCheckStop ( void )

Check if the data capture has been stopped.

◆ ngcppCI_THID()

ngcb_thread_t ngcppCI_THID ( )

command service thread id

◆ ngcppCiAbort()

int ngcppCiAbort ( ngcpp_cmd_t command,
ngcpp_rep_t * reply,
char * erms )

Handle ngcppCOM_ABORT command.

◆ ngcppCiChanSelect()

int ngcppCiChanSelect ( ngcpp_cmd_t command,
ngcpp_rep_t * reply,
char * erms )

Handle ngcppCOM_CHAN command.

◆ ngcppCiChipOffset()

int ngcppCiChipOffset ( ngcpp_cmd_t command,
ngcpp_rep_t * reply,
char * erms )

Handle ngcppCOM_CHIPOFFSET command.

◆ ngcppCiDynCmd()

int ngcppCiDynCmd ( ngcpp_cmd_t command,
ngcpp_rep_t * reply,
char * erms )

Handle ngcppCOM_DYNCMD command.

◆ ngcppCiEnd()

int ngcppCiEnd ( ngcpp_cmd_t command,
ngcpp_rep_t * reply,
char * erms )

Handle ngcppCOM_END command.

◆ ngcppCiFlushOutput()

int ngcppCiFlushOutput ( ngcpp_cmd_t command,
ngcpp_rep_t * reply,
char * erms )

Handle ngcppCOM_FLUSHOUT command.

◆ ngcppCiGetConfig()

int ngcppCiGetConfig ( ngcpp_cmd_t command,
ngcpp_rep_t * reply,
char * erms )

Handle ngcppCOM_ICONF command.

◆ ngcppCiGetDataPath()

int ngcppCiGetDataPath ( ngcpp_cmd_t command,
ngcpp_rep_t * reply,
char * erms )

Handle ngcppCOM_GETDPATH command.

◆ ngcppCiGetDataPort()

int ngcppCiGetDataPort ( ngcpp_cmd_t command,
ngcpp_rep_t * reply,
char * erms )

Handle ngcppCOM_DATAPORT command.

◆ ngcppCiGetErrPort()

int ngcppCiGetErrPort ( ngcpp_cmd_t command,
ngcpp_rep_t * reply,
char * erms )

Handle ngcppCOM_ERRPORT command.

◆ ngcppCiGetRecvStat()

int ngcppCiGetRecvStat ( ngcpp_cmd_t command,
ngcpp_rep_t * reply,
char * erms )

Handle ngcppCOM_RCVSTAT command.

◆ ngcppCiGetRev()

int ngcppCiGetRev ( ngcpp_cmd_t command,
ngcpp_rep_t * reply,
char * erms )

Handle ngcppCOM_REV command.

◆ ngcppCiGetStatus()

int ngcppCiGetStatus ( ngcpp_cmd_t command,
ngcpp_rep_t * reply,
char * erms )

Handle ngcppCOM_STAT command.

◆ ngcppCiInitErr()

void ngcppCiInitErr ( void )

Signal command interpreter initialization error.

◆ ngcppCiMemClose()

int ngcppCiMemClose ( ngcpp_cmd_t command,
ngcpp_rep_t * reply,
char * erms )

Handle ngcppCOM_MCLOSE command.

◆ ngcppCiMemRecv()

int ngcppCiMemRecv ( char * erms)

ngcppCOM_MSET buffer reveiver function

◆ ngcppCiMemSet()

int ngcppCiMemSet ( ngcpp_cmd_t command,
ngcpp_rep_t * reply,
char * erms )

Handle ngcppCOM_MSET command.

◆ ngcppCiMemSync()

int ngcppCiMemSync ( ngcpp_cmd_t command,
ngcpp_rep_t * reply,
char * erms )

Handle ngcppCOM_MSYNC command.

◆ ngcppCiParamConf()

int ngcppCiParamConf ( ngcpp_cmd_t command,
ngcpp_rep_t * reply,
char * erms )

Handle ngcppCOM_PCONF command.

◆ ngcppCiParamInit()

int ngcppCiParamInit ( void )

Synchronize command interpreter with parameter buffers.

◆ ngcppCiParamSet()

int ngcppCiParamSet ( ngcpp_cmd_t command,
ngcpp_rep_t * reply,
char * erms )

Handle ngcppCOM_PSET command.

◆ ngcppCiParamStat()

int ngcppCiParamStat ( ngcpp_cmd_t command,
ngcpp_rep_t * reply,
char * erms )

Handle ngcppCOM_PSTAT command.

◆ ngcppCiParamSync()

int ngcppCiParamSync ( ngcpp_cmd_t command,
ngcpp_rep_t * reply,
char * erms )

Handle ngcppCOM_PSYNC command.

◆ ngcppCiPause()

int ngcppCiPause ( ngcpp_cmd_t command,
ngcpp_rep_t * reply,
char * erms )

Handle ngcppCOM_PAUSE command.

◆ ngcppCiResetCnt()

int ngcppCiResetCnt ( ngcpp_cmd_t command,
ngcpp_rep_t * reply,
char * erms )

Handle ngcppCOM_RSTCNT command.

◆ ngcppCiSetDataPath()

int ngcppCiSetDataPath ( ngcpp_cmd_t command,
ngcpp_rep_t * reply,
char * erms )

Handle ngcppCOM_SETDPATH command.

◆ ngcppCiSetFilePubBase()

int ngcppCiSetFilePubBase ( ngcpp_cmd_t command,
ngcpp_rep_t * reply,
char * erms )

Handle ngcppCOM_FILEBASE command.

◆ ngcppCiSetFilePubPath()

int ngcppCiSetFilePubPath ( ngcpp_cmd_t command,
ngcpp_rep_t * reply,
char * erms )

Handle ngcppCOM_FILEPATH command.

◆ ngcppCiSimStartDelay()

int ngcppCiSimStartDelay ( ngcpp_cmd_t command,
ngcpp_rep_t * reply,
char * erms )

Handle ngcppCOM_SIMDELAY command.

◆ ngcppCiSimTime()

int ngcppCiSimTime ( ngcpp_cmd_t command,
ngcpp_rep_t * reply,
char * erms )

Handle ngcppCOM_SIMTIME command.

◆ ngcppCiStart()

int ngcppCiStart ( ngcpp_cmd_t command,
ngcpp_rep_t * reply,
char * erms )

Handle ngcppCOM_START command.

◆ ngcppCiStop()

int ngcppCiStop ( ngcpp_cmd_t command,
ngcpp_rep_t * reply,
char * erms )

Handle ngcppCOM_STOP command.

◆ ngcppCiTime()

int ngcppCiTime ( ngcpp_cmd_t command,
ngcpp_rep_t * reply,
char * erms )

Handle ngcppCOM_TIME command.

◆ ngcppCiUsrCmd()

int ngcppCiUsrCmd ( ngcpp_cmd_t command,
ngcpp_rep_t * reply,
char * erms )

Handle ngcppCOM_USRCMD command.

◆ ngcppCiVerbose()

int ngcppCiVerbose ( ngcpp_cmd_t command,
ngcpp_rep_t * reply,
char * erms )

Handle ngcppCOM_VERBOSE command.

◆ ngcppClose()

int ngcppClose ( ngcpp_dma_t * dev,
int term,
char * erms )

Close the DMA device. If term is 1, all outstanding DMA transfers are terminated.

◆ ngcppCloseDataServer()

int ngcppCloseDataServer ( void )

Shutdown data server.

◆ ngcppCmdLineHelp()

void ngcppCmdLineHelp ( const char * paramStr,
const char * helpStr,
const char * defaultStr )

Add a help text for the -h command line option.

◆ ngcppCntHandler()

int ngcppCntHandler ( ngcppFRAME * hcyc,
int setupId,
int phases,
int ndit,
int cycSkip,
int sdv,
int * ditCnt,
int * cycCnt,
char * initFlag,
char * sdvOn,
char * first )

Counter processing handler

◆ ngcppCog()

int ngcppCog ( double * cx,
double * cy,
float * data,
int nx,
int ny,
double thr )

Center of gravity

◆ ngcppCogLR()

int ngcppCogLR ( double * cx,
double * cy,
float * data,
int nx,
int ny,
int slx1,
int slx2,
double thr,
double sigma,
int min )

Center of gravity left/right of slit

◆ ngcppCogSymXP()

int ngcppCogSymXP ( double * cx,
double * cy,
float * data,
int nx,
int ny,
int slx1,
int slx2,
double thr,
double sigma,
int min )

Center of gravity with symmetrical slit extrapolation

◆ ngcppCogX()

int ngcppCogX ( double * cx,
float * data,
int nx,
int ny,
double thr )

Center of gravity in x-direction

◆ ngcppCogY()

int ngcppCogY ( double * cy,
float * data,
int nx,
int ny,
double thr )

Center of gravity in y-direction

◆ ngcppCommandProcess()

void * ngcppCommandProcess ( void * argp)

Command interpreter thread

◆ ngcppDataAck()

void ngcppDataAck ( int n)

Acknowledge that the data transfer process has done the frame transfer.

◆ ngcppDataAckPending()

void ngcppDataAckPending ( int n)

Pending acknowledge that the data transfer process has done the frame transfer.

◆ ngcppDataReq()

int ngcppDataReq ( int n,
ngcpp_req_t request,
int transferMode,
ngcpp_frame_t * frame,
int * noSort,
int * noWin,
int * attach,
ngcb_sema_t ** txSig )

Request a frame. If request.blocking is set, the routine blocks, until frame is available or an error (or request abort) occurs. noSort/noWin return flags in order not to apply sorting or window parameters to the output frame.

◆ ngcppDataResetReq()

void ngcppDataResetReq ( int n)

Reset the data transfer request set by ngcppDataReq().

◆ ngcppDataServerStatus()

void ngcppDataServerStatus ( int flag,
const char * erms )

Set the initialization status of the data server (1=success, 0=failure).

◆ ngcppDataServerTcp()

void * ngcppDataServerTcp ( void * argp)

Built-in tcp/ip data transfer server

◆ ngcppDataTransferReset()

void ngcppDataTransferReset ( int n)

Reset all synchronization for data transfer process.

◆ ngcppDetachBuf()

void ngcppDetachBuf ( void * buffer,
size_t size )

Detach from buffer.

◆ ngcppDim()

void ngcppDim ( int nx,
int ny )

Set pixel map dimension

◆ ngcppDitHandler()

int ngcppDitHandler ( ngcppFRAME * ditFrame,
ngcppFRAME * intFrame,
ngcppFRAME * iintFrame,
ngcppFRAME * sdvFrame,
ngcppFRAME * hcyc1Frame,
ngcppFRAME * hcyc2Frame,
double * sumSquare,
ngcpp_dit_t * param,
char * doInit )

DIT-frame handler

◆ ngcppDivide()

void ngcppDivide ( int num)

Divide the DMA in sub-divisions (soft-interrupts).

◆ ngcppDPUB_THID()

ngcb_thread_t ngcppDPUB_THID ( int idx)

data publisher thread id

◆ ngcppDSRV_THID()

ngcb_thread_t ngcppDSRV_THID ( )

data service thread id

◆ ngcppDynComHandle()

int ngcppDynComHandle ( ngcpp_dcmd_t * cmdSet)

Search a command set for the dynamic command that is currently on top of stack.

◆ ngcppERR_THID()

ngcb_thread_t ngcppERR_THID ( )

error stack thread id

◆ ngcppErrStack()

void * ngcppErrStack ( void * argp)

Error-stack thread.

◆ ngcppErrStackAdd()

void ngcppErrStackAdd ( int id,
const char * erms )

Add an error message to the error stack. An additional errorId can be specified.

◆ ngcppExit()

void ngcppExit ( int stat)

Calls ngcppShutdwon() and exits.

◆ ngcppExport()

void ngcppExport ( void * buffer,
int ftype,
int bitPix,
int nx,
int ny )

Export a buffer to an external service process and wait for the processing completion.

◆ ngcppExportRequest()

int ngcppExportRequest ( int shmId,
int semId,
char * erms )

Handle data export request

◆ ngcppFilePublish()

int ngcppFilePublish ( ngcppFRAME * frame,
int bufIdx,
int sync,
char * erms )

Store the frame-buffer to a file. If sync is set to 1 then the routine blocks until a place in the file-output queue is free. bufIdx is the index of the frame within the circular output buffer of the frame.

◆ ngcppFilePublisherBase()

void ngcppFilePublisherBase ( const char * base)

Change the file publishing sequence base-name. The header information (frame-type, counter) is always appended to the basename.

◆ ngcppFilePublisherInit()

int ngcppFilePublisherInit ( const char * name,
char * erms )

Intialize a file publisher. The name may specify a path or a socket connection (host:port).

◆ ngcppFilePublisherPath()

int ngcppFilePublisherPath ( int id,
const char * path,
char * erms )

Change the storaga path of a file publisher.

◆ ngcppFileSync()

void ngcppFileSync ( void )

Waits until the file queues of all file publishers are empty.

◆ ngcppFilter()

ngcpp_t * ngcppFilter ( int devIdx,
ngcpp_t * data,
int n )

Apply channel filter

◆ ngcppFlipX()

void ngcppFlipX ( int * map,
int nx,
int ny )

Vertical flip of pixel sorting map

◆ ngcppFlipY()

void ngcppFlipY ( int * map,
int nx,
int ny )

Horizontal flip of pixel sorting map

◆ ngcppFlushInput()

int ngcppFlushInput ( void )

Skip all buffers in the input-ring-buffer. It returns the number of buffers that have been skipped.

◆ ngcppFlushOutput()

int ngcppFlushOutput ( void )

Flush the output queue

◆ ngcppFrameScale16()

void ngcppFrameScale16 ( void * buffer,
size_t size,
int n )

Scale 32-bit integere frame down to 16-bit

◆ ngcppFrameScaleReal16()

void ngcppFrameScaleReal16 ( void * buffer,
size_t size,
int n )

Scale 32-bit floating point frame down to 16-bit

◆ ngcppFree()

void ngcppFree ( void * ptr)

Free memory.

◆ ngcppFsConnect()

int ngcppFsConnect ( char * host,
char * erms )

Connect to field-stabilisation unit.

◆ ngcppFsDisconnect()

int ngcppFsDisconnect ( int fd)

Disconnect from field-stabilisation unit.

◆ ngcppFsSend()

int ngcppFsSend ( int fd,
ngcpp_fs_t * correction,
char * erms )

Send correction parameters to field stabilisation unit.

◆ ngcppGetLocHostAddr()

int ngcppGetLocHostAddr ( char * addr,
char * erms )

Returns the ip-address of the local host.

◆ ngcppGetShift()

int ngcppGetShift ( char * first,
int * data,
char * bpx,
int nx,
int tx,
int ty,
int txw,
int tyw,
int * sx,
int * sy,
int * posX,
int * posY )

Get shift vector for on-chip tracking using highest intensity method.

◆ ngcppGetShiftCen()

int ngcppGetShiftCen ( char * first,
int * data,
char * bpx,
int nx,
int tx,
int ty,
int txw,
int tyw,
int * sx,
int * sy,
int * posX,
int * posY )

Get shift vector for on-chip tracking using centroiding method.

◆ ngcppGetShiftCenFloat()

int ngcppGetShiftCenFloat ( char * first,
float * data,
char * bpx,
int nx,
int tx,
int ty,
int txw,
int tyw,
int * sx,
int * sy,
int * posX,
int * posY )

Get shift vector for on-chip tracking using centroiding method (floating point data).

◆ ngcppGetShiftFloat()

int ngcppGetShiftFloat ( char * first,
float * data,
char * bpx,
int nx,
int tx,
int ty,
int txw,
int tyw,
int * sx,
int * sy,
int * posX,
int * posY )

Get shift vector for on-chip tracking using highest intensity method (floating point data).

◆ ngcppInit()

int ngcppInit ( ngcpp_dma_t * dev,
unsigned int * doneCount,
char * erms )

Initialize the DMA read and synchronize doneCount to the actual buffer count in the DMA driver.

◆ ngcppInitFileDump()

int ngcppInitFileDump ( char * erms)

Intialize file-dump mode.

◆ ngcppInitFilter()

void ngcppInitFilter ( int devIdx,
int * chan,
int n )

Initialize channel filter

◆ ngcppInitFrame()

void ngcppInitFrame ( ngcppFRAME * frame,
char ** array,
int n )

Initialize the configuration elements of the frame structure. The parameter n is the size of the ring-buffered frames. The array is an array of pointers to output frames of the same type.

◆ ngcppIppApply()

int ngcppIppApply ( int id,
void * param,
int n,
char * erms )

◆ ngcppIppCfg()

void ngcppIppCfg ( int id,
void * param,
int n )

◆ ngcppMalloc()

void * ngcppMalloc ( size_t size)

Allocate size bytes of memory.

◆ ngcppMalloc2()

void * ngcppMalloc2 ( void * ptr,
size_t size )

Re(-allocate) size bytes of memory.

◆ ngcppOpen()

int ngcppOpen ( ngcpp_dma_t * dev,
char * erms )

Open the DMA device.

◆ ngcppOverrun()

char ngcppOverrun ( ngcpp_dma_t * dev)

Checks if the ringbuffer did get full.

◆ ngcppParamDefault()

void ngcppParamDefault ( void )

Signal that the default parameter setting has been done.

◆ ngcppParamPtr()

int * ngcppParamPtr ( void )

Return a pointer to the current parameter structure.

◆ ngcppProperty()

const char * ngcppProperty ( const char * name)

Return the property value assigned to name or a NULL-pointer if the property does not exist.

◆ ngcppPSync()

int ngcppPSync ( int alarmtTime,
char * erms )

Synchronize parameter buffers.

◆ ngcppPublish()

int ngcppPublish ( int syncMode,
ngcppFRAME * frame )

Request a queued output for the frame pointed to by frame. The sync parameter controls the behaviour in the case the output queue becomes full:

ngcppQUEUE_SKIP   - skip the frame
ngcppQUEUE_BLOCK  - block
ngcppQUEUE_SETERR - report an error (-> return -1)

When the function returns, the frame structure element frame->dptr
returns in any case the index of the ring buffer element, that can be processed next by the calling process.

◆ ngcppR270()

void ngcppR270 ( int * map,
int nx,
int ny )

Rotate pixel sorting map by 270 degrees

◆ ngcppR90()

void ngcppR90 ( int * map,
int nx,
int ny )

Rotate pixel sorting map by 90 degrees

◆ ngcppReAlloc()

int ngcppReAlloc ( size_t bufsize,
int n,
char * erms )

Reallocate n input ringbuffers of size bufsize. If n is zero the number ringbuffers is determined dynamically according to bufsize and ngcppMIN_RINGBUFSIZE.

◆ ngcppReInitFrame()

void ngcppReInitFrame ( ngcppFRAME * frame,
char ** array )

Reassign new array buffers.

◆ ngcppReInitFrameN()

void ngcppReInitFrameN ( ngcppFRAME * frame,
char ** array,
int n )

Reassign new array buffers to frame.

◆ ngcppRemoveFrame()

void ngcppRemoveFrame ( int type)

Remove a frame type from the publishing list.

◆ ngcppResetTimeStamp()

void ngcppResetTimeStamp ( )

Reset timestamp in all frames.

◆ ngcppResetTransferringState()

void ngcppResetTransferringState ( void )

Reset transferring state

◆ ngcppSemWaitTmo()

int ngcppSemWaitTmo ( ngcb_sema_t * sem,
int tmo )

Waits with timeout for a semaphore.

◆ ngcppSetQueue()

void ngcppSetQueue ( void )

Switch to queue mode

◆ ngcppSetTimeStamp()

void ngcppSetTimeStamp ( uint64_t ts)

Set the timestamp in all frames, which have the time-stamp marked as not set.

◆ ngcppSetTransferringState()

void ngcppSetTransferringState ( void )

Set transferring state

◆ ngcppSetupDynParam()

int * ngcppSetupDynParam ( size_t numParam,
const char ** id,
size_t numCmd,
char * erms )

Set the readout mode specific parameter names. numParam is the number of parameters being used, numCmd is the number of dynamic commands being used. If numCmd is zero, no dynamic commands are used. If numParam is zero, no dynamic parameters are used.

◆ ngcppShDataAttach()

int ngcppShDataAttach ( int shared,
int n,
size_t size,
char * erms )

Attach to a memory data structure. If the shared flag is set the memory area is placed in shared memory.

◆ ngcppShDataClose()

int ngcppShDataClose ( void )

Remove the attached shared memory data structure.

◆ ngcppShDataGetPtr()

int ngcppShDataGetPtr ( char ** ptr,
int id,
int len,
char * erms )

Return a pointer to the mirror of a shared memory data entry identified by id. The parameter len returns the maximum length of the dataset.

◆ ngcppShDataInvalid()

int ngcppShDataInvalid ( int id)

Mark an entry as not containing valid data.

◆ ngcppShDataIsValid()

int ngcppShDataIsValid ( int id)

Return 1 in case the data set contains valid data.

◆ ngcppShDataSetPtr()

char * ngcppShDataSetPtr ( int id,
int * len,
char * erms )

Return in a pointer to the mirror of a shared memory data entry identified by id. The parameter len returns the maximum length of the dataset.

◆ ngcppShDataSwap()

void ngcppShDataSwap ( int id)

Swap all datasets matching id (id can be or'ed).

◆ ngcppShDataValid()

int ngcppShDataValid ( int id)

Mark an entry as containing valid data.

◆ ngcppShiftAddFloat()

int ngcppShiftAddFloat ( float * sum,
float * data,
int nx,
int ny,
int shx,
int shy )

On-chip-tracking function (floating point data).

◆ ngcppShiftAddFloatN()

int ngcppShiftAddFloatN ( float * sum,
float * data,
int nx,
int ny,
int shx,
int shy,
int n,
int np )

On-chip-tracking function (floating point data).

◆ ngcppShiftAddInt()

int ngcppShiftAddInt ( int * sum,
int * data,
int nx,
int ny,
int shx,
int shy )

On-chip-tracking function

◆ ngcppShiftAddIntN()

int ngcppShiftAddIntN ( int * sum,
int * data,
int nx,
int ny,
int shx,
int shy,
int n,
int np )

On-chip-tracking function

◆ ngcppShutdown()

void ngcppShutdown ( int sigFlag)

Terminate all running DMA, close the DMA device and clean up all allocated resource. When called from within a signal handler the sigFlag should be set.

◆ ngcppSigFailure()

void ngcppSigFailure ( const char * erms)

Add an error message to the error stack.

◆ ngcppSignalHandler()

void ngcppSignalHandler ( int sig)

Signal handler of the ngcpp framework.

◆ ngcppStartCapture()

int ngcppStartCapture ( void )

Start the data capture loop.

◆ ngcppStartDataServer()

int ngcppStartDataServer ( unsigned int n,
char * erms )

Start the data server for n publishers

◆ ngcppStartup()

int ngcppStartup ( int argc,
char ** argv,
size_t defaultBufsize,
char * erms )

Perform complete startup of the scd dma interface. Depending on the argument line interactive and capture threads are started. All semaphores are initialized here. A default buffersize (in bytes) can be passed which might be overwritten by the command line argument.

◆ ngcppSwapXY()

int ngcppSwapXY ( void )

Pixel-map 90deg rotation

◆ ngcppSyncOutput()

void ngcppSyncOutput ( void )

Wait until all output is done.

◆ ngcppTerm()

int ngcppTerm ( ngcpp_dma_t * dev,
char * erms )

Terminate all DMA transfers

◆ ngcppTermProcessing()

void ngcppTermProcessing ( void )

Acknowledges that processing loop has been stopped.

◆ ngcppUnsigned()

int ngcppUnsigned ( void )

Return 1 in case the raw data type is unsigned short integer. Otherwise zero is returned.

◆ ngcppWaitData()

int ngcppWaitData ( ngcpp_t ** res)

Waits for the next data semaphore and returns a pointer to the next data input buffer. The return value is the number of frame that has been skipped during a pause.

◆ ngcppWaitStart()

int ngcppWaitStart ( void )

Wait until data capture has been started.

◆ ngcppWinCpy()

int ngcppWinCpy ( char * frm,
int fx,
int fy,
char * win,
int sx0,
int sy0,
int nx,
int ny,
int bytes,
int assemble,
int noSort )

Copy window.

Variable Documentation

◆ ngcppAdcPacketSize

int ngcppAdcPacketSize
extern

ADC-module packet size

◆ ngcppArgc

int ngcppArgc
extern

Number of command line arguments

◆ ngcppArgv

char** ngcppArgv
extern

Pointer to command line arguments

◆ ngcppAutoTimeStamp

int ngcppAutoTimeStamp
extern

Automatic frame timestamp

◆ ngcppBaseName

char ngcppBaseName[256]
extern

Base-name for file publisher

◆ ngcppChopZero

int ngcppChopZero
extern

Chop zero phase

◆ ngcppCiInitFlag

char ngcppCiInitFlag
extern

Command interpreter initialization flag

◆ ngcppCiSys

ngcpp_cmd_srv_api* ngcppCiSys
extern

Command server interface API

◆ ngcppCiTcp

ngcpp_cmd_srv_api ngcppCiTcp
extern

Command server API for TCP/IP socket communication

◆ ngcppCmdClients

int ngcppCmdClients
extern

Number of cmd clients

◆ ngcppCmdHost

char ngcppCmdHost[ngcppCI_MAX_CON][256]
extern

Command client host info

◆ ngcppCmdPort

int ngcppCmdPort
extern

Command interpreter port number

◆ ngcppCPU

int ngcppCPU
extern

Main-task CPU(s)

◆ ngcppDataFcnt

int ngcppDataFcnt[ngcppMAX_DATA_CON]
extern

Output frame counters

◆ ngcppDataHost

char ngcppDataHost[ngcppMAX_DATA_CON][256]
extern

Data client host info

◆ ngcppDataInitFlag

char ngcppDataInitFlag
extern

Data server initialization flag

◆ ngcppDataPort

int ngcppDataPort
extern

Data server port number

◆ ngcppDataRcnt

int ngcppDataRcnt[ngcppMAX_DATA_CON]
extern

Output request counters

◆ ngcppDataServer

ngcpp_ds_t ngcppDataServer
extern

Data server plug-in

◆ ngcppDataServerExit

void(* ngcppDataServerExit) (void) ( void )
extern

Data server exit hook sending an EXIT service request to data server

◆ ngcppDataSrvName

char ngcppDataSrvName[256]
extern

Data server device name

◆ ngcppDetSetup

int ngcppDetSetup
extern

Setup-id

◆ ngcppDev

ngcpp_dma_t* ngcppDev
extern

Global variables Acquisition devices

◆ ngcppDiskMem

int ngcppDiskMem
extern

Disk memory extension flag

◆ ngcppDiskMemIdx

int ngcppDiskMemIdx
extern

Disk memory index

◆ ngcppDiskMemPath

char ngcppDiskMemPath[256]
extern

disk memory path

◆ ngcppDitX

char ngcppDitX
extern

DIT-handler DIT transfer

◆ ngcppDmaChan

int ngcppDmaChan
extern

DMA channel selection

◆ ngcppDmaDiag

int ngcppDmaDiag
extern

DMA interrupt latency diagnose on/off

◆ ngcppDmaIPPMode

unsigned int ngcppDmaIPPMode
extern

DMA interrupt post processor mode

◆ ngcppDmaMon

int ngcppDmaMon
extern

DMA interrupt queue monitoring flag

◆ ngcppDmaPacketSize

int ngcppDmaPacketSize
extern

DMA channel packet size

◆ ngcppDmaResync

int ngcppDmaResync
extern

DMA resync

◆ ngcppDynCmd

int ngcppDynCmd
extern

Dynamic command code

◆ ngcppDynCmdAck

int ngcppDynCmdAck
extern

Dynamic command code acknowledge

◆ ngcppDynParam

ngcpp_param_t ngcppDynParam
extern

Parameter configuration

◆ ngcppDynPtr

int* ngcppDynPtr
extern

Pointer to parameter buffer

◆ ngcppEndFlg

char ngcppEndFlg
extern

End of measurement flag

◆ ngcppErmsCi

char* ngcppErmsCi
extern

Command interpreter initialization error

◆ ngcppErmsData

char* ngcppErmsData
extern

Data server initialization error

◆ ngcppErrInitFlag

char ngcppErrInitFlag
extern

Error-stack initialization flag

◆ ngcppErrPort

int ngcppErrPort
extern

Error stack port number

◆ ngcppFileDump

int ngcppFileDump
extern

Flag to enable/disable file-dump mode

◆ ngcppFileId

int ngcppFileId
extern

File server id for file-dump

◆ ngcppFrameSize

size_t ngcppFrameSize
extern

Output frame size

◆ ngcppFrameType

ngcpp_ftype ngcppFrameType[32]
extern

Frame types

◆ ngcppIppNumParam

unsigned int ngcppIppNumParam
extern

Number of DMA interrupt post processor task parameters

◆ ngcppIppParam

int ngcppIppParam[NGCDRV_MAX_PARAM]
extern

DMA interrupt post processor task parameters

◆ ngcppIppTaskId

int ngcppIppTaskId
extern

DMA interrupt post processor task-id

◆ ngcppJoinerDelay

int ngcppJoinerDelay
extern

Multicast joinder delay (microseconds)

◆ ngcppKeyVal

int ngcppKeyVal
extern

Shared memory key

◆ ngcppLocalPath

char ngcppLocalPath[256]
extern

Path to local data

◆ ngcppMapFile

char ngcppMapFile[256]
extern

Channel mapping file

◆ ngcppMapOp

int ngcppMapOp[4]
extern

Pixel map operation matrix

◆ ngcppMaxComBufSize

int ngcppMaxComBufSize
extern

Maximum command buffer size

◆ ngcppMaxRepBufSize

int ngcppMaxRepBufSize
extern

Maximum reply buffer size

◆ ngcppNoSort

int ngcppNoSort
extern

Flag to disable the pixel sorting

◆ ngcppNQ

int ngcppNQ
extern

Raw-frame output queue size (number of frames)

◆ ngcppNumBuf

int ngcppNumBuf
extern

Requested number of ringbuffers (0 = automatic)

◆ ngcppNumDataClients

int ngcppNumDataClients
extern

Number of actually connected data clients

◆ ngcppNumDataFiles

int ngcppNumDataFiles
extern

Number of data files

◆ ngcppNumDet

int ngcppNumDet
extern

Number of detector instances

◆ ngcppNumDev

int ngcppNumDev
extern

Number of acquisition devices

◆ ngcppNumDiv

int ngcppNumDiv
extern

Number of DMA sub-divisions

◆ ngcppNumDynCmd

int ngcppNumDynCmd
extern

Number of dynamic command codes

◆ ngcppNumFilePub

int ngcppNumFilePub
extern

Number of file publishers

◆ ngcppNumPublishers

int ngcppNumPublishers
extern

Number of publishers

◆ ngcppNumTypes

int ngcppNumTypes
extern

Number of defined frame types

◆ ngcppOvrScanX

int ngcppOvrScanX
extern

Overscan in X

◆ ngcppOvrScanY

int ngcppOvrScanY
extern

Overscan in Y

◆ ngcppParamBuf

int ngcppParamBuf[3][ngcppMAX_PARAMSIZE]
extern

Parameter buffers

◆ ngcppParamCheck

ngcppPCHECK ngcppParamCheck
extern

External parameter check

◆ ngcppPauseFlag

char ngcppPauseFlag
extern

Pause flag

◆ ngcppPayloadSize

int ngcppPayloadSize
extern

RTMS payload Size (bytes)

◆ ngcppPid

int ngcppPid
extern

Acquisition process id

◆ ngcppPixMap

int* ngcppPixMap
extern

Pixel map

◆ ngcppPixMap64

size_t* ngcppPixMap64
extern

Pixel map (64-bit)

◆ ngcppPrintPars

char ngcppPrintPars
extern

Print params flag

◆ ngcppProcName

char ngcppProcName[128]
extern

Process name

◆ ngcppPublisherName

char** ngcppPublisherName
extern

Publisher names

◆ ngcppQBufSize

size_t ngcppQBufSize
extern

Queue buffer size (bytes)

◆ ngcppQCnt

int ngcppQCnt
extern

Queue frame counter

◆ ngcppQEnd

int ngcppQEnd
extern

Queue end-command

◆ ngcppQRstCnt

char ngcppQRstCnt
extern

Reset queue counters flag

◆ ngcppQRstCnt_

char ngcppQRstCnt_
extern

Reset queue counters flag (internal)

◆ ngcppQSize

int ngcppQSize
extern

Queue size

◆ ngcppQType

int ngcppQType
extern

Queue frame type

◆ ngcppQWin

ngcpp_win_t ngcppQWin
extern

Queue window

◆ ngcppRemoteFd

int ngcppRemoteFd
extern

Remote execution reply file descriptor

◆ ngcppRevApp

int ngcppRevApp
extern

Pre-processor application revision

◆ ngcppRstCnt

char ngcppRstCnt
extern

Reset counters flag

◆ ngcppRstCnt_

char ngcppRstCnt_
extern

Reset counters flag (internal)

◆ ngcppRtCheck

int ngcppRtCheck
extern

Run-time check flag

◆ ngcppRunning

char ngcppRunning
extern

Capture running flag

◆ ngcppSim32

int ngcppSim32
extern

32-bit simulation

◆ ngcppSimBuf

ngcppSIM ngcppSimBuf
extern

Built-in simulator

◆ ngcppSimBuf64

ngcppSIM64 ngcppSimBuf64
extern

Built-in simulator (64-bit buffer size)

◆ ngcppSimDma

int ngcppSimDma
extern

DMA simulation flag

◆ ngcppSimHiRes

int ngcppSimHiRes
extern

High-resolution simulation

◆ ngcppSimNoise

int ngcppSimNoise
extern

Noise simulation

◆ ngcppSimRt

int ngcppSimRt
extern

Real-time simulation flag

◆ ngcppSimStartDelay

int ngcppSimStartDelay
extern

Simulation start delay

◆ ngcppSimTime

int ngcppSimTime
extern

Simulation interval

◆ ngcppStartX

int ngcppStartX
extern

Chip offset in x-direction

◆ ngcppStartY

int ngcppStartY
extern

Chip offset in y-direction

◆ ngcppStatus

char ngcppStatus
extern

Processing status

◆ ngcppSyncInput

char ngcppSyncInput
extern

Synchronous input flag

◆ ngcppTestCnt

int ngcppTestCnt
extern

Counter for tests

◆ ngcppTime

double ngcppTime[2]
extern

Calculation-time and frame-time information

◆ ngcppTimeFilter

ngcb_ma_t ngcppTimeFilter[2]
extern

Filters for time measurements

◆ ngcppTimeStamp

uint64_t ngcppTimeStamp
extern

Last sample timestamp

◆ ngcppTransferring

char ngcppTransferring
extern

Transferring flag

◆ ngcppTransferTypes

int ngcppTransferTypes
extern

Valid frame types

◆ ngcppUnitSize

int ngcppUnitSize
extern

RTMS data unit size (bytes)

◆ ngcppUsrCmdHandler

ngcppEXT_CMD ngcppUsrCmdHandler
extern

External user command handler

◆ semAppInit

ngcb_sema_t semAppInit
extern

Application startup synchronization semaphore

◆ semBuf

ngcb_sema_t semBuf
extern

Ringbuffer access protection semaphore

◆ semCiInit

ngcb_sema_t semCiInit
extern

Command interpreter synchronization semaphore

◆ semCmd

ngcb_sema_t semCmd
extern

Dynamic command synchronization semaphore

◆ semCmdAck

ngcb_sema_t semCmdAck
extern

Dynamic command acknowledge semaphore

◆ semDataInit

ngcb_sema_t semDataInit
extern

Data server synchronization semaphore

◆ semErrInit

ngcb_sema_t semErrInit
extern

Error-stack synchronization semaphore

◆ semMem

ngcb_sema_t semMem
extern

Data set access protection semaphore

◆ semParam

ngcb_sema_t semParam
extern

Parameter access protection semaphore

◆ semParamLock

ngcb_sema_t semParamLock
extern

Parameter lock synchronization semaphore

◆ semRun

ngcb_sema_t semRun
extern

Running flag access protection semaphore

◆ semStat

ngcb_sema_t semStat
extern

Status access protection semaphore

◆ semTerm

ngcb_sema_t semTerm
extern

Termination synchronization semaphore