diff --git a/src/std/filters/filters.dbd.pod b/src/std/filters/filters.dbd.pod index 9dbc97feb..afa63978d 100644 --- a/src/std/filters/filters.dbd.pod +++ b/src/std/filters/filters.dbd.pod @@ -4,7 +4,7 @@ Channel Filters can be applied to Channel Access channels by a client, using a JSON Field Modifier to select the filter and any parameters. The following filters are available in this release: -=over 4 +=over =item * L @@ -88,7 +88,7 @@ percentage. =head4 Parameters -=over 4 +=over =item Deadband C<"d"> @@ -136,6 +136,54 @@ registrar(syncInitialize) =head3 Synchronize Filter C<"sync"> -... +This filter is used to dynamically enable or disable monitors according +to a condition and a state variable declared by the IOC. + +State variables have a boolean value and can be set by a binary output +record, an iocsh command or by other software running in the IOC calling +C. + +=head4 Parameters + +=over + +=item Mode C<"m"> + +A single word from the list below, enclosed in double quotes C<">. +This controls how the state value should affect the monitor stream. + +=over + +=item C<"before"> E only the last value received before the state +changes from false to true is forwarded to the client. + +=item C<"first"> E only the first value received after the state +changes from true to false is forwarded to the client. + +=item C<"while"> E values are forwarded to the client as long as +the state is true. + +=item C<"last"> E only the last value received before the state +changes from true to false is forwarded to the client. + +=item C<"after"> E only the first value received after the state +changes from true to false is forwarded to the client. + +=item C<"unless"> E values are forwarded to the client as long +as the state is false. + +=back + +=item State C<"s"> + +The name of a state variable, enclosed in double quotes C<">. + +=back + +=head4 Example + + Woz$ camonitor 'test:channel' + ... =cut + diff --git a/src/std/filters/sync.c b/src/std/filters/sync.c index 9dfd47197..07876b4cb 100644 --- a/src/std/filters/sync.c +++ b/src/std/filters/sync.c @@ -21,11 +21,6 @@ #define STATE_NAME_LENGTH 20 -static const -chfPluginEnumType modeEnum[] = { {"before", 0}, {"first", 1}, - {"last", 2}, {"after", 3}, - {"while", 4}, {"unless", 5}, - {NULL,0} }; typedef enum syncMode { syncModeBefore=0, syncModeFirst=1, @@ -35,6 +30,17 @@ typedef enum syncMode { syncModeUnless=5 } syncMode; +static const +chfPluginEnumType modeEnum[] = { + {"before", syncModeBefore}, + {"first", syncModeFirst}, + {"last", syncModeLast}, + {"after", syncModeAfter}, + {"while", syncModeWhile}, + {"unless", syncModeUnless}, + {NULL, 0} +}; + typedef struct myStruct { syncMode mode; char state[STATE_NAME_LENGTH];