Enhanced EPICS dbLoadRecords functions. More...
#include <stdlib.h>
#include <string.h>
#include <stdio.h>
#include <errno.h>
#include <math.h>
#include <exception>
#include <algorithm>
#include <stdexcept>
#include <iostream>
#include <map>
#include <list>
#include <string>
#include <time.h>
#include <sstream>
#include <fstream>
#include <unistd.h>
#include "epicsStdlib.h"
#include "epicsString.h"
#include "epicsStdio.h"
#include "dbDefs.h"
#include "epicsMutex.h"
#include "dbBase.h"
#include "dbStaticLib.h"
#include "dbFldTypes.h"
#include "dbCommon.h"
#include "dbAccessDefs.h"
#include <epicsTypes.h>
#include <epicsTime.h>
#include <epicsThread.h>
#include <epicsTimer.h>
#include <iocsh.h>
#include "envDefs.h"
#include "macLib.h"
#include "errlog.h"
#include <registryFunction.h>
#include <epicsExport.h>
#include "utilities.h"
Go to the source code of this file.
Functions | |
static void | loadMacEnviron (MAC_HANDLE *pmh) |
load current environment into mac handle More... | |
static void | subMacros (std::string &new_macros, const char *macros, const char *loopVar) |
look for e.g. $(I) and replace with so we can substitute later with macEnvExpand() More... | |
epicsShareFunc void | dbLoadRecordsLoop (const char *dbFile, const char *macros, const char *loopVar, int start, int stop, int step) |
Load a db file multiple times substituting a specified macro according to a number range. More... | |
epicsShareFunc void | dbLoadRecordsList (const char *dbFile, const char *macros, const char *loopVar, const char *list, const char *sep) |
Load a db file multiple times according to a list of items separated by known separator(s). More... | |
static void | dbLoadRecordsLoopInitCallFunc (const iocshArgBuf *args) |
static void | dbLoadRecordsListInitCallFunc (const iocshArgBuf *args) |
static void | dbLoadRecordsFuncsRegister (void) |
epicsExportRegistrar (dbLoadRecordsFuncsRegister) | |
Variables | |
static const iocshArg | dbLoadRecordsLoopInitArg0 = { "dbFile", iocshArgString } |
DB filename. More... | |
static const iocshArg | dbLoadRecordsLoopInitArg1 = { "macros", iocshArgString } |
macros to pass to dbFile More... | |
static const iocshArg | dbLoadRecordsLoopInitArg2 = { "loopVar", iocshArgString } |
loop macro variable name More... | |
static const iocshArg | dbLoadRecordsLoopInitArg3 = { "start", iocshArgInt } |
start loop value More... | |
static const iocshArg | dbLoadRecordsLoopInitArg4 = { "stop", iocshArgInt } |
end loop value More... | |
static const iocshArg | dbLoadRecordsLoopInitArg5 = { "step", iocshArgInt } |
loop step (default: 1) More... | |
static const iocshArg *const | dbLoadRecordsLoopInitArgs [] |
static const iocshArg | dbLoadRecordsListInitArg0 = { "dbFile", iocshArgString } |
DB filename. More... | |
static const iocshArg | dbLoadRecordsListInitArg1 = { "macros", iocshArgString } |
macros to pass to dbFile More... | |
static const iocshArg | dbLoadRecordsListInitArg2 = { "loopVar", iocshArgString } |
list macro variable name More... | |
static const iocshArg | dbLoadRecordsListInitArg3 = { "list", iocshArgString } |
list of values to substitute More... | |
static const iocshArg | dbLoadRecordsListInitArg4 = { "sep", iocshArgString } |
list value separator character More... | |
static const iocshArg *const | dbLoadRecordsListInitArgs [] |
static const iocshFuncDef | dbLoadRecordsLoopDef = {"dbLoadRecordsLoop", sizeof(dbLoadRecordsLoopInitArgs) / sizeof(iocshArg*), dbLoadRecordsLoopInitArgs} |
static const iocshFuncDef | dbLoadRecordsListDef = {"dbLoadRecordsList", sizeof(dbLoadRecordsListInitArgs) / sizeof(iocshArg*), dbLoadRecordsListInitArgs} |
Enhanced EPICS dbLoadRecords functions.
Definition in file dbLoadRecordsFuncs.cpp.
|
static |
Definition at line 241 of file dbLoadRecordsFuncs.cpp.
References dbLoadRecordsListInitCallFunc(), and dbLoadRecordsLoopInitCallFunc().
epicsShareFunc void dbLoadRecordsList | ( | const char * | dbFile, |
const char * | macros, | ||
const char * | loopVar, | ||
const char * | list, | ||
const char * | sep | ||
) |
Load a db file multiple times according to a list of items separated by known separator(s).
The dbFile and macros arguments are like the normal dbLoadRecords() however it is possible to embed a macro within these whose value takes a value from the list. You can either load the same dbFile multiple times with different macros, or even load different database files by using loopVar as part of the filename. If you want to use a pure numeric range see dbLoadRecordsLoop()
The name of the macro to be used for substitution is contained in loopVar and needs to be reference in an \ escaped way to make sure EPICS does not try to substitute it too soon. as well as the macros the dbFile is also passed the loopVar macro value
[in] | dbFile | DB filename. |
[in] | macros | macros to pass to dbFile |
[in] | loopVar | list macro variable name |
[in] | list | list of values to substitute |
[in] | sep | list value separator character |
Definition at line 167 of file dbLoadRecordsFuncs.cpp.
References loadMacEnviron(), and subMacros().
Referenced by dbLoadRecordsListInitCallFunc().
|
static |
Definition at line 236 of file dbLoadRecordsFuncs.cpp.
References dbLoadRecordsList().
Referenced by dbLoadRecordsFuncsRegister().
epicsShareFunc void dbLoadRecordsLoop | ( | const char * | dbFile, |
const char * | macros, | ||
const char * | loopVar, | ||
int | start, | ||
int | stop, | ||
int | step | ||
) |
Load a db file multiple times substituting a specified macro according to a number range.
The dbFile and macros arguments are like the normal dbLoadRecords() however it is possible to embed a macro within these whose value follows the range start to stop. You can either load the same dbFile multiple times with different macros, or even load different database files by using loopVar as part of the filename. If you want to use a list of (non-numeric) substitutions rather than an integer range see dbLoadRecordsList()
The name of the macro to be used for substitution is contained in loopVar and needs to be reference in an \ escaped way to make sure EPICS does not try to substitute it too soon. as well as the macros the dbFile is also passed the loopVar macro value
[in] | dbFile | DB filename. |
[in] | macros | macros to pass to dbFile |
[in] | loopVar | loop macro variable name |
[in] | start | start loop value |
[in] | stop | end loop value |
[in] | step | loop step (default: 1) |
Definition at line 112 of file dbLoadRecordsFuncs.cpp.
References loadMacEnviron(), and subMacros().
Referenced by dbLoadRecordsLoopInitCallFunc().
|
static |
Definition at line 231 of file dbLoadRecordsFuncs.cpp.
References dbLoadRecordsLoop().
Referenced by dbLoadRecordsFuncsRegister().
epicsExportRegistrar | ( | dbLoadRecordsFuncsRegister | ) |
|
static |
load current environment into mac handle
Definition at line 53 of file dbLoadRecordsFuncs.cpp.
Referenced by dbLoadRecordsList(), and dbLoadRecordsLoop().
|
static |
look for e.g. $(I) and replace with so we can substitute later with macEnvExpand()
Definition at line 69 of file dbLoadRecordsFuncs.cpp.
Referenced by dbLoadRecordsList(), and dbLoadRecordsLoop().
|
static |
Definition at line 229 of file dbLoadRecordsFuncs.cpp.
|
static |
DB filename.
Definition at line 219 of file dbLoadRecordsFuncs.cpp.
|
static |
macros to pass to dbFile
Definition at line 220 of file dbLoadRecordsFuncs.cpp.
|
static |
list macro variable name
Definition at line 221 of file dbLoadRecordsFuncs.cpp.
|
static |
list of values to substitute
Definition at line 222 of file dbLoadRecordsFuncs.cpp.
|
static |
list value separator character
Definition at line 223 of file dbLoadRecordsFuncs.cpp.
|
static |
Definition at line 224 of file dbLoadRecordsFuncs.cpp.
|
static |
Definition at line 227 of file dbLoadRecordsFuncs.cpp.
|
static |
DB filename.
Definition at line 210 of file dbLoadRecordsFuncs.cpp.
|
static |
macros to pass to dbFile
Definition at line 211 of file dbLoadRecordsFuncs.cpp.
|
static |
loop macro variable name
Definition at line 212 of file dbLoadRecordsFuncs.cpp.
|
static |
start loop value
Definition at line 213 of file dbLoadRecordsFuncs.cpp.
|
static |
end loop value
Definition at line 214 of file dbLoadRecordsFuncs.cpp.
|
static |
loop step (default: 1)
Definition at line 215 of file dbLoadRecordsFuncs.cpp.
|
static |
Definition at line 216 of file dbLoadRecordsFuncs.cpp.