Merged simple-filter-conf branch

This commit is contained in:
Andrew Johnson
2014-10-01 18:11:28 -05:00
6 changed files with 348 additions and 83 deletions
+10 -6
View File
@@ -43,6 +43,8 @@ chfPluginArgDef opts[] = {
static void * allocPvt(void)
{
myStruct *my = (myStruct*) freeListCalloc(myStructFreeList);
if (!my) return NULL;
my->incr = 1;
my->end = -1;
return (void *) my;
@@ -120,12 +122,13 @@ static db_field_log* filter(void* pvt, dbChannel *chan, db_field_log *pfl) {
pfl->no_elements = nTarget;
if (nTarget) {
void *pdst = freeListCalloc(my->arrayFreeList);
pfl->u.r.dtor = freeArray;
pfl->u.r.pvt = my->arrayFreeList;
offset = (offset + start) % chan->addr.no_elements;
dbExtractArrayFromRec(&chan->addr, pdst, nTarget, nSource, offset, my->incr);
pfl->u.r.field = pdst;
if (pdst) {
pfl->u.r.dtor = freeArray;
pfl->u.r.pvt = my->arrayFreeList;
offset = (offset + start) % chan->addr.no_elements;
dbExtractArrayFromRec(&chan->addr, pdst, nTarget, nSource, offset, my->incr);
pfl->u.r.field = pdst;
}
}
dbScanUnlock(prec);
chan->addr.pfield = pfieldsave;
@@ -141,6 +144,7 @@ static db_field_log* filter(void* pvt, dbChannel *chan, db_field_log *pfl) {
pfl->no_elements = nTarget;
if (nTarget) { /* Copy the data out */
pdst = freeListCalloc(my->arrayFreeList);
if (!pdst) return pfl;
offset = start;
dbExtractArrayFromBuf(psrc, pdst, pfl->field_size, pfl->field_type, nTarget, nSource, offset, my->incr);
}
+7 -4
View File
@@ -1,13 +1,14 @@
/*************************************************************************\
* Copyright (c) 2010 Brookhaven National Laboratory.
* Copyright (c) 2010 Helmholtz-Zentrum Berlin
* fuer Materialien und Energie GmbH.
* für Materialien und Energie GmbH.
* Copyright (c) 2014 ITER Organization.
* EPICS BASE is distributed subject to a Software License Agreement found
* in file LICENSE that is included with this distribution.
\*************************************************************************/
/*
* Author: Ralph Lange <Ralph.Lange@bessy.de>
* Author: Ralph Lange <Ralph.Lange@gmx.de>
*/
#include <stdio.h>
@@ -34,8 +35,10 @@ chfPluginEnumType modeEnum[] = { {"abs", 0}, {"rel", 1}, {NULL,0} };
static const
chfPluginArgDef opts[] = {
chfDouble (myStruct, cval, "d", 0, 1),
chfEnum (myStruct, mode, "m", 0, 1, modeEnum),
chfDouble (myStruct, cval, "d", 0, 1),
chfEnum (myStruct, mode, "m", 0, 1, modeEnum),
chfTagDouble (myStruct, cval, "abs", mode, 0, 0, 1),
chfTagDouble (myStruct, cval, "rel", mode, 1, 0, 1),
chfPluginArgEnd
};
+11 -5
View File
@@ -22,9 +22,9 @@
#define STATE_NAME_LENGTH 20
static const
chfPluginEnumType modeEnum[] = { {"before", 0}, {"first", 1},
{"last", 2}, {"after", 3},
{"while", 4}, {"unless", 5},
chfPluginEnumType modeEnum[] = { {"before", 0}, {"first", 1},
{"last", 2}, {"after", 3},
{"while", 4}, {"unless", 5},
{NULL,0} };
typedef enum syncMode {
syncModeBefore=0,
@@ -47,8 +47,14 @@ static void *myStructFreeList;
static const
chfPluginArgDef opts[] = {
chfEnum (myStruct, mode, "m", 1, 1, modeEnum),
chfString (myStruct, state, "s", 1, 0),
chfEnum (myStruct, mode, "m", 1, 1, modeEnum),
chfString (myStruct, state, "s", 1, 0),
chfTagString (myStruct, state, "before", mode, 0, 1, 0),
chfTagString (myStruct, state, "first", mode, 1, 1, 0),
chfTagString (myStruct, state, "last", mode, 2, 1, 0),
chfTagString (myStruct, state, "after", mode, 3, 1, 0),
chfTagString (myStruct, state, "while", mode, 4, 1, 0),
chfTagString (myStruct, state, "unless", mode, 5, 1, 0),
chfPluginArgEnd
};