clean up some whitespace
This commit is contained in:
@ -22,7 +22,7 @@ endif
|
|||||||
# Do you have synApps and want support for scalcout?
|
# Do you have synApps and want support for scalcout?
|
||||||
# Then define CALC or SYNAPPS in your RELEASE file
|
# Then define CALC or SYNAPPS in your RELEASE file
|
||||||
# pointing to the 'calc' module of synApps.
|
# pointing to the 'calc' module of synApps.
|
||||||
# Older 'calc' versions have a cross reference on
|
# Older 'calc' versions have a cross reference on
|
||||||
# 'sscan' and/or 'genSub', so you may have to build them first.
|
# 'sscan' and/or 'genSub', so you may have to build them first.
|
||||||
# Up to version 2-6 (synApps 5-1) the 'calc' module needs a fix.
|
# Up to version 2-6 (synApps 5-1) the 'calc' module needs a fix.
|
||||||
# See doc/scalcout.html for details.
|
# See doc/scalcout.html for details.
|
||||||
@ -71,7 +71,7 @@ ifneq ($(words $(PCRE) $(PCRE_LIB) $(PCRE_INCLUDE)),0)
|
|||||||
FORMATS += Regexp
|
FORMATS += Regexp
|
||||||
endif
|
endif
|
||||||
|
|
||||||
# Want a loadable module?
|
# Want a loadable module?
|
||||||
# For Tornado 2.0.2, a fix is needed in the
|
# For Tornado 2.0.2, a fix is needed in the
|
||||||
# registerRecordDeviceDriver.pl script in base:
|
# registerRecordDeviceDriver.pl script in base:
|
||||||
# at the end replace the line "IoccrfReg iocshReg;"
|
# at the end replace the line "IoccrfReg iocshReg;"
|
||||||
|
@ -130,7 +130,7 @@ public:
|
|||||||
|
|
||||||
StreamBuffer& append(const StreamBuffer& s)
|
StreamBuffer& append(const StreamBuffer& s)
|
||||||
{return append(s.buffer+s.offs, s.len);}
|
{return append(s.buffer+s.offs, s.len);}
|
||||||
|
|
||||||
// operator += alias for append
|
// operator += alias for append
|
||||||
StreamBuffer& operator+=(char c)
|
StreamBuffer& operator+=(char c)
|
||||||
{return append(c);}
|
{return append(c);}
|
||||||
@ -224,7 +224,7 @@ public:
|
|||||||
// expand: create copy of StreamBuffer where all nonprintable characters
|
// expand: create copy of StreamBuffer where all nonprintable characters
|
||||||
// are replaced by <xx> with xx being the hex code of the characters
|
// are replaced by <xx> with xx being the hex code of the characters
|
||||||
StreamBuffer expand(ssize_t start, ssize_t length) const;
|
StreamBuffer expand(ssize_t start, ssize_t length) const;
|
||||||
|
|
||||||
StreamBuffer expand(ssize_t start=0) const
|
StreamBuffer expand(ssize_t start=0) const
|
||||||
{return expand(start, len);}
|
{return expand(start, len);}
|
||||||
|
|
||||||
|
@ -117,7 +117,7 @@ public:
|
|||||||
|
|
||||||
protected:
|
protected:
|
||||||
StreamBusInterface(Client* client);
|
StreamBusInterface(Client* client);
|
||||||
|
|
||||||
// map client functions into StreamBusInterface namespace
|
// map client functions into StreamBusInterface namespace
|
||||||
void lockCallback(StreamIoStatus status)
|
void lockCallback(StreamIoStatus status)
|
||||||
{ client->lockCallback(status); }
|
{ client->lockCallback(status); }
|
||||||
@ -178,7 +178,7 @@ protected:
|
|||||||
StreamBusInterfaceRegistrarBase(const char* name);
|
StreamBusInterfaceRegistrarBase(const char* name);
|
||||||
virtual ~StreamBusInterfaceRegistrarBase();
|
virtual ~StreamBusInterfaceRegistrarBase();
|
||||||
};
|
};
|
||||||
|
|
||||||
template <class C>
|
template <class C>
|
||||||
class StreamBusInterfaceRegistrar : protected StreamBusInterfaceRegistrarBase
|
class StreamBusInterfaceRegistrar : protected StreamBusInterfaceRegistrarBase
|
||||||
{
|
{
|
||||||
|
@ -244,7 +244,7 @@ compile(StreamProtocolParser::Protocol* protocol)
|
|||||||
pollPeriod = 1000;
|
pollPeriod = 1000;
|
||||||
inTerminatorDefined = false;
|
inTerminatorDefined = false;
|
||||||
outTerminatorDefined = false;
|
outTerminatorDefined = false;
|
||||||
|
|
||||||
unsigned short ignoreExtraInput = false;
|
unsigned short ignoreExtraInput = false;
|
||||||
if (!protocol->getEnumVariable("extrainput", ignoreExtraInput,
|
if (!protocol->getEnumVariable("extrainput", ignoreExtraInput,
|
||||||
extraInputNames))
|
extraInputNames))
|
||||||
@ -383,7 +383,7 @@ compileCommand(StreamProtocolParser::Protocol* protocol,
|
|||||||
buffer.append(disconnect_cmd);
|
buffer.append(disconnect_cmd);
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
error(getLineNumber(command), protocol->filename(),
|
error(getLineNumber(command), protocol->filename(),
|
||||||
"Unknown command name '%s'\n", command);
|
"Unknown command name '%s'\n", command);
|
||||||
return false;
|
return false;
|
||||||
@ -636,7 +636,7 @@ formatOutput()
|
|||||||
const char* fieldName = NULL;
|
const char* fieldName = NULL;
|
||||||
const char* formatstring;
|
const char* formatstring;
|
||||||
int formatstringlen;
|
int formatstringlen;
|
||||||
|
|
||||||
outputLine.clear();
|
outputLine.clear();
|
||||||
while ((command = *commandIndex++) != StreamProtocolParser::eos)
|
while ((command = *commandIndex++) != StreamProtocolParser::eos)
|
||||||
{
|
{
|
||||||
@ -670,7 +670,7 @@ normal_format:
|
|||||||
}
|
}
|
||||||
formatstringlen = commandIndex-formatstring;
|
formatstringlen = commandIndex-formatstring;
|
||||||
commandIndex++;
|
commandIndex++;
|
||||||
|
|
||||||
StreamFormat fmt = extract<StreamFormat>(commandIndex);
|
StreamFormat fmt = extract<StreamFormat>(commandIndex);
|
||||||
fmt.info = commandIndex; // point to info string
|
fmt.info = commandIndex; // point to info string
|
||||||
commandIndex += fmt.infolen;
|
commandIndex += fmt.infolen;
|
||||||
@ -1016,12 +1016,12 @@ readCallback(StreamIoStatus status,
|
|||||||
if (inputBuffer) unparsedInput = true;
|
if (inputBuffer) unparsedInput = true;
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
// prepare to parse the input
|
// prepare to parse the input
|
||||||
const char *commandStart = commandIndex;
|
const char *commandStart = commandIndex;
|
||||||
long end = -1;
|
long end = -1;
|
||||||
long termlen = 0;
|
long termlen = 0;
|
||||||
|
|
||||||
if (inTerminator)
|
if (inTerminator)
|
||||||
{
|
{
|
||||||
// look for terminator
|
// look for terminator
|
||||||
@ -1175,9 +1175,9 @@ matchInput()
|
|||||||
char command;
|
char command;
|
||||||
const char* fieldName = NULL;
|
const char* fieldName = NULL;
|
||||||
StreamBuffer formatstring;
|
StreamBuffer formatstring;
|
||||||
|
|
||||||
consumedInput = 0;
|
consumedInput = 0;
|
||||||
|
|
||||||
while ((command = *commandIndex++) != StreamProtocolParser::eos)
|
while ((command = *commandIndex++) != StreamProtocolParser::eos)
|
||||||
{
|
{
|
||||||
switch (command)
|
switch (command)
|
||||||
@ -1202,7 +1202,7 @@ normal_format:
|
|||||||
// formatstring <eos> StreamFormat [info]
|
// formatstring <eos> StreamFormat [info]
|
||||||
formatstring.clear();
|
formatstring.clear();
|
||||||
commandIndex = StreamProtocolParser::printString(formatstring, commandIndex);
|
commandIndex = StreamProtocolParser::printString(formatstring, commandIndex);
|
||||||
|
|
||||||
StreamFormat fmt = extract<StreamFormat>(commandIndex);
|
StreamFormat fmt = extract<StreamFormat>(commandIndex);
|
||||||
fmt.info = commandIndex; // point to info string
|
fmt.info = commandIndex; // point to info string
|
||||||
commandIndex += fmt.infolen;
|
commandIndex += fmt.infolen;
|
||||||
@ -1279,7 +1279,7 @@ normal_format:
|
|||||||
#ifndef NO_TEMPORARY
|
#ifndef NO_TEMPORARY
|
||||||
debug("StreamCore::matchInput(%s): compare \"%s\" with \"%s\"\n",
|
debug("StreamCore::matchInput(%s): compare \"%s\" with \"%s\"\n",
|
||||||
name(), inputLine.expand(consumedInput,
|
name(), inputLine.expand(consumedInput,
|
||||||
outputLine.length())(), outputLine.expand()());
|
outputLine.length())(), outputLine.expand()());
|
||||||
#endif
|
#endif
|
||||||
if (inputLine.length() - consumedInput < outputLine.length())
|
if (inputLine.length() - consumedInput < outputLine.length())
|
||||||
{
|
{
|
||||||
@ -1287,7 +1287,7 @@ normal_format:
|
|||||||
{
|
{
|
||||||
error("%s: Input \"%s%s\" too short."
|
error("%s: Input \"%s%s\" too short."
|
||||||
" No match for format \"%%%s\" (\"%s\")\n",
|
" No match for format \"%%%s\" (\"%s\")\n",
|
||||||
name(),
|
name(),
|
||||||
inputLine.length() > 20 ? "..." : "",
|
inputLine.length() > 20 ? "..." : "",
|
||||||
inputLine.expand(-20)(),
|
inputLine.expand(-20)(),
|
||||||
formatstring(),
|
formatstring(),
|
||||||
@ -1349,7 +1349,7 @@ normal_format:
|
|||||||
if (!(flags & AsyncMode) && onMismatch[0] != in_cmd)
|
if (!(flags & AsyncMode) && onMismatch[0] != in_cmd)
|
||||||
{
|
{
|
||||||
error("%s: Input \"%s%s\" too short.\n",
|
error("%s: Input \"%s%s\" too short.\n",
|
||||||
name(),
|
name(),
|
||||||
inputLine.length() > 20 ? "..." : "",
|
inputLine.length() > 20 ? "..." : "",
|
||||||
inputLine.expand(-20)());
|
inputLine.expand(-20)());
|
||||||
#ifndef NO_TEMPORARY
|
#ifndef NO_TEMPORARY
|
||||||
@ -1396,7 +1396,7 @@ normal_format:
|
|||||||
name(), surplus, surplus==1 ? "" : "s",
|
name(), surplus, surplus==1 ? "" : "s",
|
||||||
inputLine.expand(consumedInput, 20)(),
|
inputLine.expand(consumedInput, 20)(),
|
||||||
surplus > 20 ? "..." : "");
|
surplus > 20 ? "..." : "");
|
||||||
|
|
||||||
if (consumedInput>20)
|
if (consumedInput>20)
|
||||||
error("%s: after %ld byte%s \"...%s\"\n",
|
error("%s: after %ld byte%s \"...%s\"\n",
|
||||||
name(), consumedInput,
|
name(), consumedInput,
|
||||||
|
@ -192,8 +192,8 @@ long streamReloadSub()
|
|||||||
|
|
||||||
long streamReload(const char* recordname)
|
long streamReload(const char* recordname)
|
||||||
{
|
{
|
||||||
DBENTRY dbentry;
|
DBENTRY dbentry;
|
||||||
dbCommon* record;
|
dbCommon* record;
|
||||||
long status;
|
long status;
|
||||||
|
|
||||||
if(!pdbbase) {
|
if(!pdbbase) {
|
||||||
@ -748,7 +748,7 @@ process()
|
|||||||
{
|
{
|
||||||
debug("Stream::process(%s) error status=%s (%d)\n",
|
debug("Stream::process(%s) error status=%s (%d)\n",
|
||||||
name(),
|
name(),
|
||||||
status >= 0 && status < ALARM_NSTATUS ?
|
status >= 0 && status < ALARM_NSTATUS ?
|
||||||
epicsAlarmConditionStrings[status] : "ERROR",
|
epicsAlarmConditionStrings[status] : "ERROR",
|
||||||
status);
|
status);
|
||||||
(void) recGblSetSevr(record, status, INVALID_ALARM);
|
(void) recGblSetSevr(record, status, INVALID_ALARM);
|
||||||
@ -826,7 +826,7 @@ scan(format_t *format, void* value, size_t maxStringSize)
|
|||||||
error("INTERNAL ERROR (%s): Illegal format type\n", name());
|
error("INTERNAL ERROR (%s): Illegal format type\n", name());
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
if (currentValueLength < 0)
|
if (currentValueLength < 0)
|
||||||
{
|
{
|
||||||
currentValueLength = 0;
|
currentValueLength = 0;
|
||||||
return false;
|
return false;
|
||||||
@ -1027,12 +1027,12 @@ formatValue(const StreamFormat& format, const void* fieldaddress)
|
|||||||
// from field of this or other record.
|
// from field of this or other record.
|
||||||
StreamBuffer fieldBuffer;
|
StreamBuffer fieldBuffer;
|
||||||
DBADDR* pdbaddr = (DBADDR*)fieldaddress;
|
DBADDR* pdbaddr = (DBADDR*)fieldaddress;
|
||||||
|
|
||||||
/* Handle time stamps special. %T converter takes double. */
|
/* Handle time stamps special. %T converter takes double. */
|
||||||
if (strcmp(((dbFldDes*)pdbaddr->pfldDes)->name, "TIME") == 0)
|
if (strcmp(((dbFldDes*)pdbaddr->pfldDes)->name, "TIME") == 0)
|
||||||
{
|
{
|
||||||
double time;
|
double time;
|
||||||
|
|
||||||
if (format.type != double_format)
|
if (format.type != double_format)
|
||||||
{
|
{
|
||||||
error ("%s: can only read double values from TIME field\n",
|
error ("%s: can only read double values from TIME field\n",
|
||||||
@ -1071,7 +1071,7 @@ formatValue(const StreamFormat& format, const void* fieldaddress)
|
|||||||
fmt.type = DBF_CHAR;
|
fmt.type = DBF_CHAR;
|
||||||
size = nelem;
|
size = nelem;
|
||||||
}
|
}
|
||||||
|
|
||||||
char* buffer = fieldBuffer.clear().reserve(size);
|
char* buffer = fieldBuffer.clear().reserve(size);
|
||||||
|
|
||||||
if (dbGet(pdbaddr, fmt.type, buffer,
|
if (dbGet(pdbaddr, fmt.type, buffer,
|
||||||
|
@ -42,7 +42,7 @@ __attribute__((__format__(__printf__,1,2)));
|
|||||||
|
|
||||||
inline void StreamVError(const char* fmt, va_list args)
|
inline void StreamVError(const char* fmt, va_list args)
|
||||||
{
|
{
|
||||||
StreamVError(0, NULL, fmt, args);
|
StreamVError(0, NULL, fmt, args);
|
||||||
}
|
}
|
||||||
|
|
||||||
class StreamDebugClass
|
class StreamDebugClass
|
||||||
|
@ -118,7 +118,7 @@ private:
|
|||||||
bool parseAssignment(const char* variable, Protocol&);
|
bool parseAssignment(const char* variable, Protocol&);
|
||||||
bool parseValue(StreamBuffer& buffer, bool lazy = false);
|
bool parseValue(StreamBuffer& buffer, bool lazy = false);
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
~StreamProtocolParser(); // get rid of cygnus-2.7.2 compiler warning
|
~StreamProtocolParser(); // get rid of cygnus-2.7.2 compiler warning
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
@ -25,9 +25,9 @@
|
|||||||
#include "epicsExport.h"
|
#include "epicsExport.h"
|
||||||
#include "devStream.h"
|
#include "devStream.h"
|
||||||
|
|
||||||
static long readData (dbCommon *record, format_t *format)
|
static long readData(dbCommon *record, format_t *format)
|
||||||
{
|
{
|
||||||
aaiRecord *aai = (aaiRecord *) record;
|
aaiRecord *aai = (aaiRecord *)record;
|
||||||
double dval;
|
double dval;
|
||||||
long lval;
|
long lval;
|
||||||
|
|
||||||
@ -37,7 +37,7 @@ static long readData (dbCommon *record, format_t *format)
|
|||||||
{
|
{
|
||||||
case DBF_DOUBLE:
|
case DBF_DOUBLE:
|
||||||
{
|
{
|
||||||
if (streamScanf (record, format, &dval) != OK)
|
if (streamScanf(record, format, &dval) != OK)
|
||||||
{
|
{
|
||||||
return aai->nord ? OK : ERROR;
|
return aai->nord ? OK : ERROR;
|
||||||
}
|
}
|
||||||
@ -50,7 +50,7 @@ static long readData (dbCommon *record, format_t *format)
|
|||||||
((epicsFloat32 *)aai->bptr)[aai->nord] = (epicsFloat32)dval;
|
((epicsFloat32 *)aai->bptr)[aai->nord] = (epicsFloat32)dval;
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
errlogSevPrintf (errlogFatal,
|
errlogSevPrintf(errlogFatal,
|
||||||
"readData %s: can't convert from double to %s\n",
|
"readData %s: can't convert from double to %s\n",
|
||||||
record->name, pamapdbfType[aai->ftvl].strvalue);
|
record->name, pamapdbfType[aai->ftvl].strvalue);
|
||||||
return ERROR;
|
return ERROR;
|
||||||
@ -61,7 +61,7 @@ static long readData (dbCommon *record, format_t *format)
|
|||||||
case DBF_LONG:
|
case DBF_LONG:
|
||||||
case DBF_ENUM:
|
case DBF_ENUM:
|
||||||
{
|
{
|
||||||
if (streamScanf (record, format, &lval) != OK)
|
if (streamScanf(record, format, &lval) != OK)
|
||||||
{
|
{
|
||||||
return aai->nord ? OK : ERROR;
|
return aai->nord ? OK : ERROR;
|
||||||
}
|
}
|
||||||
@ -93,7 +93,7 @@ static long readData (dbCommon *record, format_t *format)
|
|||||||
((epicsInt8 *)aai->bptr)[aai->nord] = (epicsInt8)lval;
|
((epicsInt8 *)aai->bptr)[aai->nord] = (epicsInt8)lval;
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
errlogSevPrintf (errlogFatal,
|
errlogSevPrintf(errlogFatal,
|
||||||
"readData %s: can't convert from long to %s\n",
|
"readData %s: can't convert from long to %s\n",
|
||||||
record->name, pamapdbfType[aai->ftvl].strvalue);
|
record->name, pamapdbfType[aai->ftvl].strvalue);
|
||||||
return ERROR;
|
return ERROR;
|
||||||
@ -105,7 +105,7 @@ static long readData (dbCommon *record, format_t *format)
|
|||||||
switch (aai->ftvl)
|
switch (aai->ftvl)
|
||||||
{
|
{
|
||||||
case DBF_STRING:
|
case DBF_STRING:
|
||||||
if (streamScanfN (record, format,
|
if (streamScanfN(record, format,
|
||||||
(char *)aai->bptr + aai->nord * MAX_STRING_SIZE,
|
(char *)aai->bptr + aai->nord * MAX_STRING_SIZE,
|
||||||
MAX_STRING_SIZE) != OK)
|
MAX_STRING_SIZE) != OK)
|
||||||
{
|
{
|
||||||
@ -114,9 +114,9 @@ static long readData (dbCommon *record, format_t *format)
|
|||||||
break;
|
break;
|
||||||
case DBF_CHAR:
|
case DBF_CHAR:
|
||||||
case DBF_UCHAR:
|
case DBF_UCHAR:
|
||||||
memset (aai->bptr, 0, aai->nelm);
|
memset(aai->bptr, 0, aai->nelm);
|
||||||
aai->nord = 0;
|
aai->nord = 0;
|
||||||
if (streamScanfN (record, format,
|
if (streamScanfN(record, format,
|
||||||
(char *)aai->bptr, aai->nelm) != OK)
|
(char *)aai->bptr, aai->nelm) != OK)
|
||||||
{
|
{
|
||||||
return ERROR;
|
return ERROR;
|
||||||
@ -128,7 +128,7 @@ static long readData (dbCommon *record, format_t *format)
|
|||||||
aai->nord = lval+1;
|
aai->nord = lval+1;
|
||||||
return OK;
|
return OK;
|
||||||
default:
|
default:
|
||||||
errlogSevPrintf (errlogFatal,
|
errlogSevPrintf(errlogFatal,
|
||||||
"readData %s: can't convert from string to %s\n",
|
"readData %s: can't convert from string to %s\n",
|
||||||
record->name, pamapdbfType[aai->ftvl].strvalue);
|
record->name, pamapdbfType[aai->ftvl].strvalue);
|
||||||
return ERROR;
|
return ERROR;
|
||||||
@ -137,7 +137,7 @@ static long readData (dbCommon *record, format_t *format)
|
|||||||
}
|
}
|
||||||
default:
|
default:
|
||||||
{
|
{
|
||||||
errlogSevPrintf (errlogMajor,
|
errlogSevPrintf(errlogMajor,
|
||||||
"readData %s: can't convert from %s to %s\n",
|
"readData %s: can't convert from %s to %s\n",
|
||||||
record->name, pamapdbfType[format->type].strvalue,
|
record->name, pamapdbfType[format->type].strvalue,
|
||||||
pamapdbfType[aai->ftvl].strvalue);
|
pamapdbfType[aai->ftvl].strvalue);
|
||||||
@ -148,9 +148,9 @@ static long readData (dbCommon *record, format_t *format)
|
|||||||
return OK;
|
return OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
static long writeData (dbCommon *record, format_t *format)
|
static long writeData(dbCommon *record, format_t *format)
|
||||||
{
|
{
|
||||||
aaiRecord *aai = (aaiRecord *) record;
|
aaiRecord *aai = (aaiRecord *)record;
|
||||||
double dval;
|
double dval;
|
||||||
long lval;
|
long lval;
|
||||||
unsigned long nowd;
|
unsigned long nowd;
|
||||||
@ -197,12 +197,12 @@ static long writeData (dbCommon *record, format_t *format)
|
|||||||
dval = ((epicsUInt8 *)aai->bptr)[nowd];
|
dval = ((epicsUInt8 *)aai->bptr)[nowd];
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
errlogSevPrintf (errlogFatal,
|
errlogSevPrintf(errlogFatal,
|
||||||
"writeData %s: can't convert from %s to double\n",
|
"writeData %s: can't convert from %s to double\n",
|
||||||
record->name, pamapdbfType[aai->ftvl].strvalue);
|
record->name, pamapdbfType[aai->ftvl].strvalue);
|
||||||
return ERROR;
|
return ERROR;
|
||||||
}
|
}
|
||||||
if (streamPrintf (record, format, dval))
|
if (streamPrintf(record, format, dval))
|
||||||
return ERROR;
|
return ERROR;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
@ -240,12 +240,12 @@ static long writeData (dbCommon *record, format_t *format)
|
|||||||
lval = ((epicsUInt8 *)aai->bptr)[nowd];
|
lval = ((epicsUInt8 *)aai->bptr)[nowd];
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
errlogSevPrintf (errlogFatal,
|
errlogSevPrintf(errlogFatal,
|
||||||
"writeData %s: can't convert from %s to long\n",
|
"writeData %s: can't convert from %s to long\n",
|
||||||
record->name, pamapdbfType[aai->ftvl].strvalue);
|
record->name, pamapdbfType[aai->ftvl].strvalue);
|
||||||
return ERROR;
|
return ERROR;
|
||||||
}
|
}
|
||||||
if (streamPrintf (record, format, lval))
|
if (streamPrintf(record, format, lval))
|
||||||
return ERROR;
|
return ERROR;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
@ -254,7 +254,7 @@ static long writeData (dbCommon *record, format_t *format)
|
|||||||
switch (aai->ftvl)
|
switch (aai->ftvl)
|
||||||
{
|
{
|
||||||
case DBF_STRING:
|
case DBF_STRING:
|
||||||
if (streamPrintf (record, format,
|
if (streamPrintf(record, format,
|
||||||
((char *)aai->bptr) + nowd * MAX_STRING_SIZE))
|
((char *)aai->bptr) + nowd * MAX_STRING_SIZE))
|
||||||
return ERROR;
|
return ERROR;
|
||||||
break;
|
break;
|
||||||
@ -269,12 +269,12 @@ static long writeData (dbCommon *record, format_t *format)
|
|||||||
{
|
{
|
||||||
((char *)aai->bptr)[aai->nelm-1] = 0;
|
((char *)aai->bptr)[aai->nelm-1] = 0;
|
||||||
}
|
}
|
||||||
if (streamPrintf (record, format,
|
if (streamPrintf(record, format,
|
||||||
((char *)aai->bptr)))
|
((char *)aai->bptr)))
|
||||||
return ERROR;
|
return ERROR;
|
||||||
return OK;
|
return OK;
|
||||||
default:
|
default:
|
||||||
errlogSevPrintf (errlogFatal,
|
errlogSevPrintf(errlogFatal,
|
||||||
"writeData %s: can't convert from %s to string\n",
|
"writeData %s: can't convert from %s to string\n",
|
||||||
record->name, pamapdbfType[aai->ftvl].strvalue);
|
record->name, pamapdbfType[aai->ftvl].strvalue);
|
||||||
return ERROR;
|
return ERROR;
|
||||||
@ -283,7 +283,7 @@ static long writeData (dbCommon *record, format_t *format)
|
|||||||
}
|
}
|
||||||
default:
|
default:
|
||||||
{
|
{
|
||||||
errlogSevPrintf (errlogFatal,
|
errlogSevPrintf(errlogFatal,
|
||||||
"writeData %s: can't convert from %s to %s\n",
|
"writeData %s: can't convert from %s to %s\n",
|
||||||
record->name, pamapdbfType[aai->ftvl].strvalue,
|
record->name, pamapdbfType[aai->ftvl].strvalue,
|
||||||
pamapdbfType[format->type].strvalue);
|
pamapdbfType[format->type].strvalue);
|
||||||
@ -294,19 +294,19 @@ static long writeData (dbCommon *record, format_t *format)
|
|||||||
return OK;
|
return OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
static long initRecord (dbCommon *record)
|
static long initRecord(dbCommon *record)
|
||||||
{
|
{
|
||||||
aaiRecord *aai = (aaiRecord *) record;
|
aaiRecord *aai = (aaiRecord *)record;
|
||||||
|
|
||||||
aai->bptr = calloc(aai->nelm, dbValueSize(aai->ftvl));
|
aai->bptr = calloc(aai->nelm, dbValueSize(aai->ftvl));
|
||||||
if (aai->bptr == NULL)
|
if (aai->bptr == NULL)
|
||||||
{
|
{
|
||||||
errlogSevPrintf (errlogFatal,
|
errlogSevPrintf(errlogFatal,
|
||||||
"initRecord %s: can't allocate memory for data array\n",
|
"initRecord %s: can't allocate memory for data array\n",
|
||||||
record->name);
|
record->name);
|
||||||
return ERROR;
|
return ERROR;
|
||||||
}
|
}
|
||||||
return streamInitRecord (record, &aai->inp, readData, writeData) == ERROR ?
|
return streamInitRecord(record, &aai->inp, readData, writeData) == ERROR ?
|
||||||
ERROR : OK;
|
ERROR : OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -25,9 +25,9 @@
|
|||||||
#include "epicsExport.h"
|
#include "epicsExport.h"
|
||||||
#include "devStream.h"
|
#include "devStream.h"
|
||||||
|
|
||||||
static long readData (dbCommon *record, format_t *format)
|
static long readData(dbCommon *record, format_t *format)
|
||||||
{
|
{
|
||||||
aaoRecord *aao = (aaoRecord *) record;
|
aaoRecord *aao = (aaoRecord *)record;
|
||||||
double dval;
|
double dval;
|
||||||
long lval;
|
long lval;
|
||||||
|
|
||||||
@ -37,7 +37,7 @@ static long readData (dbCommon *record, format_t *format)
|
|||||||
{
|
{
|
||||||
case DBF_DOUBLE:
|
case DBF_DOUBLE:
|
||||||
{
|
{
|
||||||
if (streamScanf (record, format, &dval) != OK)
|
if (streamScanf(record, format, &dval) != OK)
|
||||||
{
|
{
|
||||||
return aao->nord ? OK : ERROR;
|
return aao->nord ? OK : ERROR;
|
||||||
}
|
}
|
||||||
@ -50,7 +50,7 @@ static long readData (dbCommon *record, format_t *format)
|
|||||||
((epicsFloat32 *)aao->bptr)[aao->nord] = (epicsFloat32)dval;
|
((epicsFloat32 *)aao->bptr)[aao->nord] = (epicsFloat32)dval;
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
errlogSevPrintf (errlogFatal,
|
errlogSevPrintf(errlogFatal,
|
||||||
"readData %s: can't convert from double to %s\n",
|
"readData %s: can't convert from double to %s\n",
|
||||||
record->name, pamapdbfType[aao->ftvl].strvalue);
|
record->name, pamapdbfType[aao->ftvl].strvalue);
|
||||||
return ERROR;
|
return ERROR;
|
||||||
@ -61,7 +61,7 @@ static long readData (dbCommon *record, format_t *format)
|
|||||||
case DBF_LONG:
|
case DBF_LONG:
|
||||||
case DBF_ENUM:
|
case DBF_ENUM:
|
||||||
{
|
{
|
||||||
if (streamScanf (record, format, &lval) != OK)
|
if (streamScanf(record, format, &lval) != OK)
|
||||||
{
|
{
|
||||||
return aao->nord ? OK : ERROR;
|
return aao->nord ? OK : ERROR;
|
||||||
}
|
}
|
||||||
@ -93,7 +93,7 @@ static long readData (dbCommon *record, format_t *format)
|
|||||||
((epicsInt8 *)aao->bptr)[aao->nord] = (epicsInt8)lval;
|
((epicsInt8 *)aao->bptr)[aao->nord] = (epicsInt8)lval;
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
errlogSevPrintf (errlogFatal,
|
errlogSevPrintf(errlogFatal,
|
||||||
"readData %s: can't convert from long to %s\n",
|
"readData %s: can't convert from long to %s\n",
|
||||||
record->name, pamapdbfType[aao->ftvl].strvalue);
|
record->name, pamapdbfType[aao->ftvl].strvalue);
|
||||||
return ERROR;
|
return ERROR;
|
||||||
@ -105,7 +105,7 @@ static long readData (dbCommon *record, format_t *format)
|
|||||||
switch (aao->ftvl)
|
switch (aao->ftvl)
|
||||||
{
|
{
|
||||||
case DBF_STRING:
|
case DBF_STRING:
|
||||||
if (streamScanfN (record, format,
|
if (streamScanfN(record, format,
|
||||||
(char *)aao->bptr + aao->nord * MAX_STRING_SIZE,
|
(char *)aao->bptr + aao->nord * MAX_STRING_SIZE,
|
||||||
MAX_STRING_SIZE) != OK)
|
MAX_STRING_SIZE) != OK)
|
||||||
{
|
{
|
||||||
@ -114,9 +114,9 @@ static long readData (dbCommon *record, format_t *format)
|
|||||||
break;
|
break;
|
||||||
case DBF_CHAR:
|
case DBF_CHAR:
|
||||||
case DBF_UCHAR:
|
case DBF_UCHAR:
|
||||||
memset (aao->bptr, 0, aao->nelm);
|
memset(aao->bptr, 0, aao->nelm);
|
||||||
aao->nord = 0;
|
aao->nord = 0;
|
||||||
if (streamScanfN (record, format,
|
if (streamScanfN(record, format,
|
||||||
(char *)aao->bptr, aao->nelm) != OK)
|
(char *)aao->bptr, aao->nelm) != OK)
|
||||||
{
|
{
|
||||||
return ERROR;
|
return ERROR;
|
||||||
@ -128,7 +128,7 @@ static long readData (dbCommon *record, format_t *format)
|
|||||||
aao->nord = lval+1;
|
aao->nord = lval+1;
|
||||||
return OK;
|
return OK;
|
||||||
default:
|
default:
|
||||||
errlogSevPrintf (errlogFatal,
|
errlogSevPrintf(errlogFatal,
|
||||||
"readData %s: can't convert from string to %s\n",
|
"readData %s: can't convert from string to %s\n",
|
||||||
record->name, pamapdbfType[aao->ftvl].strvalue);
|
record->name, pamapdbfType[aao->ftvl].strvalue);
|
||||||
return ERROR;
|
return ERROR;
|
||||||
@ -137,7 +137,7 @@ static long readData (dbCommon *record, format_t *format)
|
|||||||
}
|
}
|
||||||
default:
|
default:
|
||||||
{
|
{
|
||||||
errlogSevPrintf (errlogMajor,
|
errlogSevPrintf(errlogMajor,
|
||||||
"readData %s: can't convert from %s to %s\n",
|
"readData %s: can't convert from %s to %s\n",
|
||||||
record->name, pamapdbfType[format->type].strvalue,
|
record->name, pamapdbfType[format->type].strvalue,
|
||||||
pamapdbfType[aao->ftvl].strvalue);
|
pamapdbfType[aao->ftvl].strvalue);
|
||||||
@ -148,9 +148,9 @@ static long readData (dbCommon *record, format_t *format)
|
|||||||
return OK;
|
return OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
static long writeData (dbCommon *record, format_t *format)
|
static long writeData(dbCommon *record, format_t *format)
|
||||||
{
|
{
|
||||||
aaoRecord *aao = (aaoRecord *) record;
|
aaoRecord *aao = (aaoRecord *)record;
|
||||||
double dval;
|
double dval;
|
||||||
long lval;
|
long lval;
|
||||||
unsigned long nowd;
|
unsigned long nowd;
|
||||||
@ -197,12 +197,12 @@ static long writeData (dbCommon *record, format_t *format)
|
|||||||
dval = ((epicsUInt8 *)aao->bptr)[nowd];
|
dval = ((epicsUInt8 *)aao->bptr)[nowd];
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
errlogSevPrintf (errlogFatal,
|
errlogSevPrintf(errlogFatal,
|
||||||
"writeData %s: can't convert from %s to double\n",
|
"writeData %s: can't convert from %s to double\n",
|
||||||
record->name, pamapdbfType[aao->ftvl].strvalue);
|
record->name, pamapdbfType[aao->ftvl].strvalue);
|
||||||
return ERROR;
|
return ERROR;
|
||||||
}
|
}
|
||||||
if (streamPrintf (record, format, dval))
|
if (streamPrintf(record, format, dval))
|
||||||
return ERROR;
|
return ERROR;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
@ -240,12 +240,12 @@ static long writeData (dbCommon *record, format_t *format)
|
|||||||
lval = ((epicsUInt8 *)aao->bptr)[nowd];
|
lval = ((epicsUInt8 *)aao->bptr)[nowd];
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
errlogSevPrintf (errlogFatal,
|
errlogSevPrintf(errlogFatal,
|
||||||
"writeData %s: can't convert from %s to long\n",
|
"writeData %s: can't convert from %s to long\n",
|
||||||
record->name, pamapdbfType[aao->ftvl].strvalue);
|
record->name, pamapdbfType[aao->ftvl].strvalue);
|
||||||
return ERROR;
|
return ERROR;
|
||||||
}
|
}
|
||||||
if (streamPrintf (record, format, lval))
|
if (streamPrintf(record, format, lval))
|
||||||
return ERROR;
|
return ERROR;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
@ -254,7 +254,7 @@ static long writeData (dbCommon *record, format_t *format)
|
|||||||
switch (aao->ftvl)
|
switch (aao->ftvl)
|
||||||
{
|
{
|
||||||
case DBF_STRING:
|
case DBF_STRING:
|
||||||
if (streamPrintf (record, format,
|
if (streamPrintf(record, format,
|
||||||
((char *)aao->bptr) + nowd * MAX_STRING_SIZE))
|
((char *)aao->bptr) + nowd * MAX_STRING_SIZE))
|
||||||
return ERROR;
|
return ERROR;
|
||||||
break;
|
break;
|
||||||
@ -269,12 +269,12 @@ static long writeData (dbCommon *record, format_t *format)
|
|||||||
{
|
{
|
||||||
((char *)aao->bptr)[aao->nelm-1] = 0;
|
((char *)aao->bptr)[aao->nelm-1] = 0;
|
||||||
}
|
}
|
||||||
if (streamPrintf (record, format,
|
if (streamPrintf(record, format,
|
||||||
((char *)aao->bptr)))
|
((char *)aao->bptr)))
|
||||||
return ERROR;
|
return ERROR;
|
||||||
return OK;
|
return OK;
|
||||||
default:
|
default:
|
||||||
errlogSevPrintf (errlogFatal,
|
errlogSevPrintf(errlogFatal,
|
||||||
"writeData %s: can't convert from %s to string\n",
|
"writeData %s: can't convert from %s to string\n",
|
||||||
record->name, pamapdbfType[aao->ftvl].strvalue);
|
record->name, pamapdbfType[aao->ftvl].strvalue);
|
||||||
return ERROR;
|
return ERROR;
|
||||||
@ -283,7 +283,7 @@ static long writeData (dbCommon *record, format_t *format)
|
|||||||
}
|
}
|
||||||
default:
|
default:
|
||||||
{
|
{
|
||||||
errlogSevPrintf (errlogFatal,
|
errlogSevPrintf(errlogFatal,
|
||||||
"writeData %s: can't convert from %s to %s\n",
|
"writeData %s: can't convert from %s to %s\n",
|
||||||
record->name, pamapdbfType[aao->ftvl].strvalue,
|
record->name, pamapdbfType[aao->ftvl].strvalue,
|
||||||
pamapdbfType[format->type].strvalue);
|
pamapdbfType[format->type].strvalue);
|
||||||
@ -294,19 +294,19 @@ static long writeData (dbCommon *record, format_t *format)
|
|||||||
return OK;
|
return OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
static long initRecord (dbCommon *record)
|
static long initRecord(dbCommon *record)
|
||||||
{
|
{
|
||||||
aaoRecord *aao = (aaoRecord *) record;
|
aaoRecord *aao = (aaoRecord *)record;
|
||||||
|
|
||||||
aao->bptr = calloc(aao->nelm, dbValueSize(aao->ftvl));
|
aao->bptr = calloc(aao->nelm, dbValueSize(aao->ftvl));
|
||||||
if (aao->bptr == NULL)
|
if (aao->bptr == NULL)
|
||||||
{
|
{
|
||||||
errlogSevPrintf (errlogFatal,
|
errlogSevPrintf(errlogFatal,
|
||||||
"initRecord %s: can't allocate memory for data array\n",
|
"initRecord %s: can't allocate memory for data array\n",
|
||||||
record->name);
|
record->name);
|
||||||
return ERROR;
|
return ERROR;
|
||||||
}
|
}
|
||||||
return streamInitRecord (record, &aao->out, readData, writeData) == ERROR ?
|
return streamInitRecord(record, &aao->out, readData, writeData) == ERROR ?
|
||||||
ERROR : OK;
|
ERROR : OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -25,30 +25,30 @@
|
|||||||
#include "epicsExport.h"
|
#include "epicsExport.h"
|
||||||
#include "devStream.h"
|
#include "devStream.h"
|
||||||
|
|
||||||
static long readData (dbCommon *record, format_t *format)
|
static long readData(dbCommon *record, format_t *format)
|
||||||
{
|
{
|
||||||
aiRecord *ai = (aiRecord *) record;
|
aiRecord *ai = (aiRecord *)record;
|
||||||
double val;
|
double val;
|
||||||
|
|
||||||
switch (format->type)
|
switch (format->type)
|
||||||
{
|
{
|
||||||
case DBF_DOUBLE:
|
case DBF_DOUBLE:
|
||||||
{
|
{
|
||||||
if (streamScanf (record, format, &val)) return ERROR;
|
if (streamScanf(record, format, &val)) return ERROR;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case DBF_ULONG:
|
case DBF_ULONG:
|
||||||
case DBF_LONG:
|
case DBF_LONG:
|
||||||
{
|
{
|
||||||
long rval;
|
long rval;
|
||||||
if (streamScanf (record, format, &rval)) return ERROR;
|
if (streamScanf(record, format, &rval)) return ERROR;
|
||||||
ai->rval = rval;
|
ai->rval = rval;
|
||||||
if (ai->linr == 0)
|
if (ai->linr == 0)
|
||||||
{
|
{
|
||||||
/* allow integers with more than 32 bits */
|
/* allow integers with more than 32 bits */
|
||||||
if (format->type == DBF_ULONG)
|
if (format->type == DBF_ULONG)
|
||||||
val = (unsigned long)rval;
|
val = (unsigned long)rval;
|
||||||
else
|
else
|
||||||
val = rval;
|
val = rval;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
@ -65,9 +65,9 @@ static long readData (dbCommon *record, format_t *format)
|
|||||||
return DO_NOT_CONVERT;
|
return DO_NOT_CONVERT;
|
||||||
}
|
}
|
||||||
|
|
||||||
static long writeData (dbCommon *record, format_t *format)
|
static long writeData(dbCommon *record, format_t *format)
|
||||||
{
|
{
|
||||||
aiRecord *ai = (aiRecord *) record;
|
aiRecord *ai = (aiRecord *)record;
|
||||||
|
|
||||||
double val = ai->val - ai->aoff;
|
double val = ai->val - ai->aoff;
|
||||||
if (ai->aslo != 0.0 && ai->aslo != 1.0) val /= ai->aslo;
|
if (ai->aslo != 0.0 && ai->aslo != 1.0) val /= ai->aslo;
|
||||||
@ -76,35 +76,35 @@ static long writeData (dbCommon *record, format_t *format)
|
|||||||
{
|
{
|
||||||
case DBF_DOUBLE:
|
case DBF_DOUBLE:
|
||||||
{
|
{
|
||||||
return streamPrintf (record, format, val);
|
return streamPrintf(record, format, val);
|
||||||
}
|
}
|
||||||
case DBF_ULONG:
|
case DBF_ULONG:
|
||||||
{
|
{
|
||||||
if (ai->linr == 0)
|
if (ai->linr == 0)
|
||||||
{
|
{
|
||||||
/* allow more bits than 32 */
|
/* allow more bits than 32 */
|
||||||
return streamPrintf (record, format, (unsigned long)val);
|
return streamPrintf(record, format, (unsigned long)val);
|
||||||
}
|
}
|
||||||
return streamPrintf (record, format, (unsigned long)ai->rval);
|
return streamPrintf(record, format, (unsigned long)ai->rval);
|
||||||
}
|
}
|
||||||
case DBF_LONG:
|
case DBF_LONG:
|
||||||
{
|
{
|
||||||
if (ai->linr == 0)
|
if (ai->linr == 0)
|
||||||
{
|
{
|
||||||
/* allow more bits than 32 */
|
/* allow more bits than 32 */
|
||||||
return streamPrintf (record, format, (long)val);
|
return streamPrintf(record, format, (long)val);
|
||||||
}
|
}
|
||||||
return streamPrintf (record, format, (long)ai->rval);
|
return streamPrintf(record, format, (long)ai->rval);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return ERROR;
|
return ERROR;
|
||||||
}
|
}
|
||||||
|
|
||||||
static long initRecord (dbCommon *record)
|
static long initRecord(dbCommon *record)
|
||||||
{
|
{
|
||||||
aiRecord *ai = (aiRecord *) record;
|
aiRecord *ai = (aiRecord *)record;
|
||||||
|
|
||||||
return streamInitRecord (record, &ai->inp, readData, writeData) == ERROR ?
|
return streamInitRecord(record, &ai->inp, readData, writeData) == ERROR ?
|
||||||
ERROR : OK;
|
ERROR : OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -23,23 +23,23 @@
|
|||||||
#include "epicsExport.h"
|
#include "epicsExport.h"
|
||||||
#include "devStream.h"
|
#include "devStream.h"
|
||||||
|
|
||||||
static long readData (dbCommon *record, format_t *format)
|
static long readData(dbCommon *record, format_t *format)
|
||||||
{
|
{
|
||||||
aoRecord *ao = (aoRecord *) record;
|
aoRecord *ao = (aoRecord *)record;
|
||||||
double val;
|
double val;
|
||||||
|
|
||||||
switch (format->type)
|
switch (format->type)
|
||||||
{
|
{
|
||||||
case DBF_DOUBLE:
|
case DBF_DOUBLE:
|
||||||
{
|
{
|
||||||
if (streamScanf (record, format, &val)) return ERROR;
|
if (streamScanf(record, format, &val)) return ERROR;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case DBF_ULONG:
|
case DBF_ULONG:
|
||||||
case DBF_LONG:
|
case DBF_LONG:
|
||||||
{
|
{
|
||||||
long rval;
|
long rval;
|
||||||
if (streamScanf (record, format, &rval)) return ERROR;
|
if (streamScanf(record, format, &rval)) return ERROR;
|
||||||
ao->rbv = rval;
|
ao->rbv = rval;
|
||||||
ao->rval = rval;
|
ao->rval = rval;
|
||||||
if (ao->linr == 0)
|
if (ao->linr == 0)
|
||||||
@ -47,7 +47,7 @@ static long readData (dbCommon *record, format_t *format)
|
|||||||
/* allow integers with more than 32 bits */
|
/* allow integers with more than 32 bits */
|
||||||
if (format->type == DBF_ULONG)
|
if (format->type == DBF_ULONG)
|
||||||
val = (unsigned long)rval;
|
val = (unsigned long)rval;
|
||||||
else
|
else
|
||||||
val = rval;
|
val = rval;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
@ -61,46 +61,46 @@ static long readData (dbCommon *record, format_t *format)
|
|||||||
return DO_NOT_CONVERT;
|
return DO_NOT_CONVERT;
|
||||||
}
|
}
|
||||||
|
|
||||||
static long writeData (dbCommon *record, format_t *format)
|
static long writeData(dbCommon *record, format_t *format)
|
||||||
{
|
{
|
||||||
aoRecord *ao = (aoRecord *) record;
|
aoRecord *ao = (aoRecord *)record;
|
||||||
|
|
||||||
double val = (INIT_RUN ? ao->val : ao->oval) - ao->aoff;
|
double val = (INIT_RUN ? ao->val : ao->oval) - ao->aoff;
|
||||||
if (ao->aslo != 0.0 && ao->aslo != 1.0) val /= ao->aslo;
|
if (ao->aslo != 0.0 && ao->aslo != 1.0) val /= ao->aslo;
|
||||||
|
|
||||||
switch (format->type)
|
switch (format->type)
|
||||||
{
|
{
|
||||||
case DBF_DOUBLE:
|
case DBF_DOUBLE:
|
||||||
{
|
{
|
||||||
return streamPrintf (record, format, val);
|
return streamPrintf(record, format, val);
|
||||||
}
|
}
|
||||||
case DBF_ULONG:
|
case DBF_ULONG:
|
||||||
{
|
{
|
||||||
if (ao->linr == 0)
|
if (ao->linr == 0)
|
||||||
{
|
{
|
||||||
/* allow integers with more than 32 bits */
|
/* allow integers with more than 32 bits */
|
||||||
return streamPrintf (record, format, (unsigned long)val);
|
return streamPrintf(record, format, (unsigned long)val);
|
||||||
}
|
}
|
||||||
return streamPrintf (record, format, (unsigned long)ao->rval);
|
return streamPrintf(record, format, (unsigned long)ao->rval);
|
||||||
}
|
}
|
||||||
case DBF_LONG:
|
case DBF_LONG:
|
||||||
{
|
{
|
||||||
if (ao->linr == 0)
|
if (ao->linr == 0)
|
||||||
{
|
{
|
||||||
/* allow integers with more than 32 bits */
|
/* allow integers with more than 32 bits */
|
||||||
return streamPrintf (record, format, (long)val);
|
return streamPrintf(record, format, (long)val);
|
||||||
}
|
}
|
||||||
return streamPrintf (record, format, (long)ao->rval);
|
return streamPrintf(record, format, (long)ao->rval);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return ERROR;
|
return ERROR;
|
||||||
}
|
}
|
||||||
|
|
||||||
static long initRecord (dbCommon *record)
|
static long initRecord(dbCommon *record)
|
||||||
{
|
{
|
||||||
aoRecord *ao = (aoRecord *) record;
|
aoRecord *ao = (aoRecord *)record;
|
||||||
|
|
||||||
return streamInitRecord (record, &ao->out, readData, writeData);
|
return streamInitRecord(record, &ao->out, readData, writeData);
|
||||||
}
|
}
|
||||||
|
|
||||||
struct {
|
struct {
|
||||||
|
@ -23,9 +23,9 @@
|
|||||||
#include "epicsExport.h"
|
#include "epicsExport.h"
|
||||||
#include "devStream.h"
|
#include "devStream.h"
|
||||||
|
|
||||||
static long readData (dbCommon *record, format_t *format)
|
static long readData(dbCommon *record, format_t *format)
|
||||||
{
|
{
|
||||||
biRecord *bi = (biRecord *) record;
|
biRecord *bi = (biRecord *)record;
|
||||||
unsigned long val;
|
unsigned long val;
|
||||||
|
|
||||||
switch (format->type)
|
switch (format->type)
|
||||||
@ -33,21 +33,21 @@ static long readData (dbCommon *record, format_t *format)
|
|||||||
case DBF_ULONG:
|
case DBF_ULONG:
|
||||||
case DBF_LONG:
|
case DBF_LONG:
|
||||||
{
|
{
|
||||||
if (streamScanf (record, format, &val)) return ERROR;
|
if (streamScanf(record, format, &val)) return ERROR;
|
||||||
if (bi->mask) val &= bi->mask;
|
if (bi->mask) val &= bi->mask;
|
||||||
bi->rval = val;
|
bi->rval = val;
|
||||||
return OK;
|
return OK;
|
||||||
}
|
}
|
||||||
case DBF_ENUM:
|
case DBF_ENUM:
|
||||||
{
|
{
|
||||||
if (streamScanf (record, format, &val)) return ERROR;
|
if (streamScanf(record, format, &val)) return ERROR;
|
||||||
bi->val = (val != 0);
|
bi->val = (val != 0);
|
||||||
return DO_NOT_CONVERT;
|
return DO_NOT_CONVERT;
|
||||||
}
|
}
|
||||||
case DBF_STRING:
|
case DBF_STRING:
|
||||||
{
|
{
|
||||||
char buffer[sizeof(bi->znam)];
|
char buffer[sizeof(bi->znam)];
|
||||||
if (streamScanfN (record, format, buffer, sizeof(buffer)))
|
if (streamScanfN(record, format, buffer, sizeof(buffer)))
|
||||||
return ERROR;
|
return ERROR;
|
||||||
if (strcmp (bi->znam, buffer) == 0)
|
if (strcmp (bi->znam, buffer) == 0)
|
||||||
{
|
{
|
||||||
@ -64,35 +64,35 @@ static long readData (dbCommon *record, format_t *format)
|
|||||||
return ERROR;
|
return ERROR;
|
||||||
}
|
}
|
||||||
|
|
||||||
static long writeData (dbCommon *record, format_t *format)
|
static long writeData(dbCommon *record, format_t *format)
|
||||||
{
|
{
|
||||||
biRecord *bi = (biRecord *) record;
|
biRecord *bi = (biRecord *)record;
|
||||||
|
|
||||||
switch (format->type)
|
switch (format->type)
|
||||||
{
|
{
|
||||||
case DBF_ULONG:
|
case DBF_ULONG:
|
||||||
case DBF_LONG:
|
case DBF_LONG:
|
||||||
{
|
{
|
||||||
return streamPrintf (record, format, bi->rval);
|
return streamPrintf(record, format, bi->rval);
|
||||||
}
|
}
|
||||||
case DBF_ENUM:
|
case DBF_ENUM:
|
||||||
{
|
{
|
||||||
return streamPrintf (record, format, (long)bi->val);
|
return streamPrintf(record, format, (long)bi->val);
|
||||||
}
|
}
|
||||||
case DBF_STRING:
|
case DBF_STRING:
|
||||||
{
|
{
|
||||||
return streamPrintf (record, format,
|
return streamPrintf(record, format,
|
||||||
bi->val ? bi->onam : bi->znam);
|
bi->val ? bi->onam : bi->znam);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return ERROR;
|
return ERROR;
|
||||||
}
|
}
|
||||||
|
|
||||||
static long initRecord (dbCommon *record)
|
static long initRecord(dbCommon *record)
|
||||||
{
|
{
|
||||||
biRecord *bi = (biRecord *) record;
|
biRecord *bi = (biRecord *)record;
|
||||||
|
|
||||||
return streamInitRecord (record, &bi->inp, readData, writeData) == ERROR ?
|
return streamInitRecord(record, &bi->inp, readData, writeData) == ERROR ?
|
||||||
ERROR : OK;
|
ERROR : OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -23,9 +23,9 @@
|
|||||||
#include "epicsExport.h"
|
#include "epicsExport.h"
|
||||||
#include "devStream.h"
|
#include "devStream.h"
|
||||||
|
|
||||||
static long readData (dbCommon *record, format_t *format)
|
static long readData(dbCommon *record, format_t *format)
|
||||||
{
|
{
|
||||||
boRecord *bo = (boRecord *) record;
|
boRecord *bo = (boRecord *)record;
|
||||||
unsigned long val;
|
unsigned long val;
|
||||||
|
|
||||||
switch (format->type)
|
switch (format->type)
|
||||||
@ -33,7 +33,7 @@ static long readData (dbCommon *record, format_t *format)
|
|||||||
case DBF_ULONG:
|
case DBF_ULONG:
|
||||||
case DBF_LONG:
|
case DBF_LONG:
|
||||||
{
|
{
|
||||||
if (streamScanf (record, format, &val)) return ERROR;
|
if (streamScanf(record, format, &val)) return ERROR;
|
||||||
if (bo->mask) val &= bo->mask;
|
if (bo->mask) val &= bo->mask;
|
||||||
bo->rbv = val;
|
bo->rbv = val;
|
||||||
if (INIT_RUN) bo->rval = val;
|
if (INIT_RUN) bo->rval = val;
|
||||||
@ -41,14 +41,14 @@ static long readData (dbCommon *record, format_t *format)
|
|||||||
}
|
}
|
||||||
case DBF_ENUM:
|
case DBF_ENUM:
|
||||||
{
|
{
|
||||||
if (streamScanf (record, format, &val)) return ERROR;
|
if (streamScanf(record, format, &val)) return ERROR;
|
||||||
bo->val = (val != 0);
|
bo->val = (val != 0);
|
||||||
return DO_NOT_CONVERT;
|
return DO_NOT_CONVERT;
|
||||||
}
|
}
|
||||||
case DBF_STRING:
|
case DBF_STRING:
|
||||||
{
|
{
|
||||||
char buffer[sizeof(bo->znam)];
|
char buffer[sizeof(bo->znam)];
|
||||||
if (streamScanfN (record, format, buffer, sizeof(buffer)))
|
if (streamScanfN(record, format, buffer, sizeof(buffer)))
|
||||||
return ERROR;
|
return ERROR;
|
||||||
if (strcmp (bo->znam, buffer) == 0)
|
if (strcmp (bo->znam, buffer) == 0)
|
||||||
{
|
{
|
||||||
@ -65,35 +65,35 @@ static long readData (dbCommon *record, format_t *format)
|
|||||||
return ERROR;
|
return ERROR;
|
||||||
}
|
}
|
||||||
|
|
||||||
static long writeData (dbCommon *record, format_t *format)
|
static long writeData(dbCommon *record, format_t *format)
|
||||||
{
|
{
|
||||||
boRecord *bo = (boRecord *) record;
|
boRecord *bo = (boRecord *)record;
|
||||||
|
|
||||||
switch (format->type)
|
switch (format->type)
|
||||||
{
|
{
|
||||||
case DBF_ULONG:
|
case DBF_ULONG:
|
||||||
case DBF_LONG:
|
case DBF_LONG:
|
||||||
{
|
{
|
||||||
return streamPrintf (record, format, bo->rval);
|
return streamPrintf(record, format, bo->rval);
|
||||||
}
|
}
|
||||||
case DBF_ENUM:
|
case DBF_ENUM:
|
||||||
{
|
{
|
||||||
return streamPrintf (record, format, (long)bo->val);
|
return streamPrintf(record, format, (long)bo->val);
|
||||||
}
|
}
|
||||||
case DBF_STRING:
|
case DBF_STRING:
|
||||||
{
|
{
|
||||||
return streamPrintf (record, format,
|
return streamPrintf(record, format,
|
||||||
bo->val ? bo->onam : bo->znam);
|
bo->val ? bo->onam : bo->znam);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return ERROR;
|
return ERROR;
|
||||||
}
|
}
|
||||||
|
|
||||||
static long initRecord (dbCommon *record)
|
static long initRecord(dbCommon *record)
|
||||||
{
|
{
|
||||||
boRecord *bo = (boRecord *) record;
|
boRecord *bo = (boRecord *)record;
|
||||||
|
|
||||||
return streamInitRecord (record, &bo->out, readData, writeData);
|
return streamInitRecord(record, &bo->out, readData, writeData);
|
||||||
}
|
}
|
||||||
|
|
||||||
struct {
|
struct {
|
||||||
|
@ -22,15 +22,15 @@
|
|||||||
#include "epicsExport.h"
|
#include "epicsExport.h"
|
||||||
#include "devStream.h"
|
#include "devStream.h"
|
||||||
|
|
||||||
static long readData (dbCommon *record, format_t *format)
|
static long readData(dbCommon *record, format_t *format)
|
||||||
{
|
{
|
||||||
calcoutRecord *co = (calcoutRecord *) record;
|
calcoutRecord *co = (calcoutRecord *)record;
|
||||||
|
|
||||||
switch (format->type)
|
switch (format->type)
|
||||||
{
|
{
|
||||||
case DBF_DOUBLE:
|
case DBF_DOUBLE:
|
||||||
{
|
{
|
||||||
return streamScanf (record, format, &co->val);
|
return streamScanf(record, format, &co->val);
|
||||||
}
|
}
|
||||||
case DBF_ULONG:
|
case DBF_ULONG:
|
||||||
case DBF_LONG:
|
case DBF_LONG:
|
||||||
@ -38,7 +38,7 @@ static long readData (dbCommon *record, format_t *format)
|
|||||||
{
|
{
|
||||||
long lval;
|
long lval;
|
||||||
|
|
||||||
if (streamScanf (record, format, &lval)) return ERROR;
|
if (streamScanf(record, format, &lval)) return ERROR;
|
||||||
if (format->type == DBF_LONG)
|
if (format->type == DBF_LONG)
|
||||||
co->val = lval;
|
co->val = lval;
|
||||||
else
|
else
|
||||||
@ -49,34 +49,34 @@ static long readData (dbCommon *record, format_t *format)
|
|||||||
return ERROR;
|
return ERROR;
|
||||||
}
|
}
|
||||||
|
|
||||||
static long writeData (dbCommon *record, format_t *format)
|
static long writeData(dbCommon *record, format_t *format)
|
||||||
{
|
{
|
||||||
calcoutRecord *co = (calcoutRecord *) record;
|
calcoutRecord *co = (calcoutRecord *)record;
|
||||||
|
|
||||||
switch (format->type)
|
switch (format->type)
|
||||||
{
|
{
|
||||||
case DBF_DOUBLE:
|
case DBF_DOUBLE:
|
||||||
{
|
{
|
||||||
return streamPrintf (record, format, co->oval);
|
return streamPrintf(record, format, co->oval);
|
||||||
}
|
}
|
||||||
case DBF_ULONG:
|
case DBF_ULONG:
|
||||||
case DBF_ENUM:
|
case DBF_ENUM:
|
||||||
{
|
{
|
||||||
return streamPrintf (record, format, (unsigned long)co->oval);
|
return streamPrintf(record, format, (unsigned long)co->oval);
|
||||||
}
|
}
|
||||||
case DBF_LONG:
|
case DBF_LONG:
|
||||||
{
|
{
|
||||||
return streamPrintf (record, format, (long)co->oval);
|
return streamPrintf(record, format, (long)co->oval);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return ERROR;
|
return ERROR;
|
||||||
}
|
}
|
||||||
|
|
||||||
static long initRecord (dbCommon *record)
|
static long initRecord(dbCommon *record)
|
||||||
{
|
{
|
||||||
calcoutRecord *co = (calcoutRecord *) record;
|
calcoutRecord *co = (calcoutRecord *)record;
|
||||||
|
|
||||||
return streamInitRecord (record, &co->out, readData, writeData) == ERROR ?
|
return streamInitRecord(record, &co->out, readData, writeData) == ERROR ?
|
||||||
ERROR : OK;
|
ERROR : OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -21,18 +21,18 @@
|
|||||||
#include "epicsExport.h"
|
#include "epicsExport.h"
|
||||||
#include "devStream.h"
|
#include "devStream.h"
|
||||||
|
|
||||||
static long readData (dbCommon *record, format_t *format)
|
static long readData(dbCommon *record, format_t *format)
|
||||||
{
|
{
|
||||||
int64inRecord *i64i = (int64inRecord *) record;
|
int64inRecord *i64i = (int64inRecord *)record;
|
||||||
|
|
||||||
switch (format->type)
|
switch (format->type)
|
||||||
{
|
{
|
||||||
case DBF_ULONG:
|
case DBF_ULONG:
|
||||||
case DBF_LONG:
|
case DBF_LONG:
|
||||||
case DBF_ENUM:
|
case DBF_ENUM:
|
||||||
{
|
{
|
||||||
long val;
|
long val;
|
||||||
if (streamScanf (record, format, &val)) return ERROR;
|
if (streamScanf(record, format, &val)) return ERROR;
|
||||||
if (format->type == DBF_LONG)
|
if (format->type == DBF_LONG)
|
||||||
i64i->val = val;
|
i64i->val = val;
|
||||||
else
|
else
|
||||||
@ -43,25 +43,25 @@ static long readData (dbCommon *record, format_t *format)
|
|||||||
return ERROR;
|
return ERROR;
|
||||||
}
|
}
|
||||||
|
|
||||||
static long writeData (dbCommon *record, format_t *format)
|
static long writeData(dbCommon *record, format_t *format)
|
||||||
{
|
{
|
||||||
int64inRecord *i64i = (int64inRecord *) record;
|
int64inRecord *i64i = (int64inRecord *)record;
|
||||||
|
|
||||||
switch (format->type)
|
switch (format->type)
|
||||||
{
|
{
|
||||||
case DBF_ULONG:
|
case DBF_ULONG:
|
||||||
case DBF_ENUM:
|
case DBF_ENUM:
|
||||||
case DBF_LONG:
|
case DBF_LONG:
|
||||||
return streamPrintf (record, format, (long)i64i->val);
|
return streamPrintf(record, format, (long)i64i->val);
|
||||||
}
|
}
|
||||||
return ERROR;
|
return ERROR;
|
||||||
}
|
}
|
||||||
|
|
||||||
static long initRecord (dbCommon *record)
|
static long initRecord(dbCommon *record)
|
||||||
{
|
{
|
||||||
int64inRecord *i64i = (int64inRecord *) record;
|
int64inRecord *i64i = (int64inRecord *)record;
|
||||||
|
|
||||||
return streamInitRecord (record, &i64i->inp, readData, writeData) == ERROR ?
|
return streamInitRecord(record, &i64i->inp, readData, writeData) == ERROR ?
|
||||||
ERROR : OK;
|
ERROR : OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -23,18 +23,18 @@
|
|||||||
#include "epicsExport.h"
|
#include "epicsExport.h"
|
||||||
#include "devStream.h"
|
#include "devStream.h"
|
||||||
|
|
||||||
static long readData (dbCommon *record, format_t *format)
|
static long readData(dbCommon *record, format_t *format)
|
||||||
{
|
{
|
||||||
int64outRecord *i64o = (int64outRecord *) record;
|
int64outRecord *i64o = (int64outRecord *)record;
|
||||||
|
|
||||||
switch (format->type)
|
switch (format->type)
|
||||||
{
|
{
|
||||||
case DBF_ULONG:
|
case DBF_ULONG:
|
||||||
case DBF_LONG:
|
case DBF_LONG:
|
||||||
case DBF_ENUM:
|
case DBF_ENUM:
|
||||||
{
|
{
|
||||||
long val;
|
long val;
|
||||||
if (streamScanf (record, format, &val)) return ERROR;
|
if (streamScanf(record, format, &val)) return ERROR;
|
||||||
if (format->type == DBF_LONG)
|
if (format->type == DBF_LONG)
|
||||||
i64o->val = val;
|
i64o->val = val;
|
||||||
else
|
else
|
||||||
@ -45,25 +45,25 @@ static long readData (dbCommon *record, format_t *format)
|
|||||||
return ERROR;
|
return ERROR;
|
||||||
}
|
}
|
||||||
|
|
||||||
static long writeData (dbCommon *record, format_t *format)
|
static long writeData(dbCommon *record, format_t *format)
|
||||||
{
|
{
|
||||||
int64outRecord *i64o = (int64outRecord *) record;
|
int64outRecord *i64o = (int64outRecord *)record;
|
||||||
|
|
||||||
switch (format->type)
|
switch (format->type)
|
||||||
{
|
{
|
||||||
case DBF_ULONG:
|
case DBF_ULONG:
|
||||||
case DBF_ENUM:
|
case DBF_ENUM:
|
||||||
case DBF_LONG:
|
case DBF_LONG:
|
||||||
return streamPrintf (record, format, (long)i64o->val);
|
return streamPrintf(record, format, (long)i64o->val);
|
||||||
}
|
}
|
||||||
return ERROR;
|
return ERROR;
|
||||||
}
|
}
|
||||||
|
|
||||||
static long initRecord (dbCommon *record)
|
static long initRecord(dbCommon *record)
|
||||||
{
|
{
|
||||||
int64outRecord *i64o = (int64outRecord *) record;
|
int64outRecord *i64o = (int64outRecord *)record;
|
||||||
|
|
||||||
return streamInitRecord (record, &i64o->out, readData, writeData) == ERROR ?
|
return streamInitRecord(record, &i64o->out, readData, writeData) == ERROR ?
|
||||||
ERROR : OK;
|
ERROR : OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -22,18 +22,18 @@
|
|||||||
#include "epicsExport.h"
|
#include "epicsExport.h"
|
||||||
#include "devStream.h"
|
#include "devStream.h"
|
||||||
|
|
||||||
static long readData (dbCommon *record, format_t *format)
|
static long readData(dbCommon *record, format_t *format)
|
||||||
{
|
{
|
||||||
longinRecord *li = (longinRecord *) record;
|
longinRecord *li = (longinRecord *)record;
|
||||||
|
|
||||||
switch (format->type)
|
switch (format->type)
|
||||||
{
|
{
|
||||||
case DBF_ULONG:
|
case DBF_ULONG:
|
||||||
case DBF_LONG:
|
case DBF_LONG:
|
||||||
case DBF_ENUM:
|
case DBF_ENUM:
|
||||||
{
|
{
|
||||||
long val;
|
long val;
|
||||||
if (streamScanf (record, format, &val)) return ERROR;
|
if (streamScanf(record, format, &val)) return ERROR;
|
||||||
li->val = val;
|
li->val = val;
|
||||||
return OK;
|
return OK;
|
||||||
}
|
}
|
||||||
@ -41,26 +41,26 @@ static long readData (dbCommon *record, format_t *format)
|
|||||||
return ERROR;
|
return ERROR;
|
||||||
}
|
}
|
||||||
|
|
||||||
static long writeData (dbCommon *record, format_t *format)
|
static long writeData(dbCommon *record, format_t *format)
|
||||||
{
|
{
|
||||||
longinRecord *li = (longinRecord *) record;
|
longinRecord *li = (longinRecord *)record;
|
||||||
|
|
||||||
switch (format->type)
|
switch (format->type)
|
||||||
{
|
{
|
||||||
case DBF_ULONG:
|
case DBF_ULONG:
|
||||||
case DBF_ENUM:
|
case DBF_ENUM:
|
||||||
return streamPrintf (record, format, (unsigned long)li->val);
|
return streamPrintf(record, format, (unsigned long)li->val);
|
||||||
case DBF_LONG:
|
case DBF_LONG:
|
||||||
return streamPrintf (record, format, (long)li->val);
|
return streamPrintf(record, format, (long)li->val);
|
||||||
}
|
}
|
||||||
return ERROR;
|
return ERROR;
|
||||||
}
|
}
|
||||||
|
|
||||||
static long initRecord (dbCommon *record)
|
static long initRecord(dbCommon *record)
|
||||||
{
|
{
|
||||||
longinRecord *li = (longinRecord *) record;
|
longinRecord *li = (longinRecord *)record;
|
||||||
|
|
||||||
return streamInitRecord (record, &li->inp, readData, writeData) == ERROR ?
|
return streamInitRecord(record, &li->inp, readData, writeData) == ERROR ?
|
||||||
ERROR : OK;
|
ERROR : OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -23,18 +23,18 @@
|
|||||||
#include "epicsExport.h"
|
#include "epicsExport.h"
|
||||||
#include "devStream.h"
|
#include "devStream.h"
|
||||||
|
|
||||||
static long readData (dbCommon *record, format_t *format)
|
static long readData(dbCommon *record, format_t *format)
|
||||||
{
|
{
|
||||||
longoutRecord *lo = (longoutRecord *) record;
|
longoutRecord *lo = (longoutRecord *)record;
|
||||||
|
|
||||||
switch (format->type)
|
switch (format->type)
|
||||||
{
|
{
|
||||||
case DBF_ULONG:
|
case DBF_ULONG:
|
||||||
case DBF_LONG:
|
case DBF_LONG:
|
||||||
case DBF_ENUM:
|
case DBF_ENUM:
|
||||||
{
|
{
|
||||||
long val;
|
long val;
|
||||||
if (streamScanf (record, format, &val)) return ERROR;
|
if (streamScanf(record, format, &val)) return ERROR;
|
||||||
lo->val = val;
|
lo->val = val;
|
||||||
return OK;
|
return OK;
|
||||||
}
|
}
|
||||||
@ -42,26 +42,26 @@ static long readData (dbCommon *record, format_t *format)
|
|||||||
return ERROR;
|
return ERROR;
|
||||||
}
|
}
|
||||||
|
|
||||||
static long writeData (dbCommon *record, format_t *format)
|
static long writeData(dbCommon *record, format_t *format)
|
||||||
{
|
{
|
||||||
longoutRecord *lo = (longoutRecord *) record;
|
longoutRecord *lo = (longoutRecord *)record;
|
||||||
|
|
||||||
switch (format->type)
|
switch (format->type)
|
||||||
{
|
{
|
||||||
case DBF_ULONG:
|
case DBF_ULONG:
|
||||||
case DBF_ENUM:
|
case DBF_ENUM:
|
||||||
return streamPrintf (record, format, (unsigned long)lo->val);
|
return streamPrintf(record, format, (unsigned long)lo->val);
|
||||||
case DBF_LONG:
|
case DBF_LONG:
|
||||||
return streamPrintf (record, format, (long)lo->val);
|
return streamPrintf(record, format, (long)lo->val);
|
||||||
}
|
}
|
||||||
return ERROR;
|
return ERROR;
|
||||||
}
|
}
|
||||||
|
|
||||||
static long initRecord (dbCommon *record)
|
static long initRecord(dbCommon *record)
|
||||||
{
|
{
|
||||||
longoutRecord *lo = (longoutRecord *) record;
|
longoutRecord *lo = (longoutRecord *)record;
|
||||||
|
|
||||||
return streamInitRecord (record, &lo->out, readData, writeData) == ERROR ?
|
return streamInitRecord(record, &lo->out, readData, writeData) == ERROR ?
|
||||||
ERROR : OK;
|
ERROR : OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -23,14 +23,14 @@
|
|||||||
#include "epicsExport.h"
|
#include "epicsExport.h"
|
||||||
#include "devStream.h"
|
#include "devStream.h"
|
||||||
|
|
||||||
static long readData (dbCommon *record, format_t *format)
|
static long readData(dbCommon *record, format_t *format)
|
||||||
{
|
{
|
||||||
mbbiDirectRecord *mbbiD = (mbbiDirectRecord *) record;
|
mbbiDirectRecord *mbbiD = (mbbiDirectRecord *)record;
|
||||||
unsigned long val;
|
unsigned long val;
|
||||||
|
|
||||||
if (format->type == DBF_ULONG || format->type == DBF_LONG)
|
if (format->type == DBF_ULONG || format->type == DBF_LONG)
|
||||||
{
|
{
|
||||||
if (streamScanf (record, format, &val)) return ERROR;
|
if (streamScanf(record, format, &val)) return ERROR;
|
||||||
if (mbbiD->mask)
|
if (mbbiD->mask)
|
||||||
{
|
{
|
||||||
val &= mbbiD->mask;
|
val &= mbbiD->mask;
|
||||||
@ -47,26 +47,26 @@ static long readData (dbCommon *record, format_t *format)
|
|||||||
return ERROR;
|
return ERROR;
|
||||||
}
|
}
|
||||||
|
|
||||||
static long writeData (dbCommon *record, format_t *format)
|
static long writeData(dbCommon *record, format_t *format)
|
||||||
{
|
{
|
||||||
mbbiDirectRecord *mbbiD = (mbbiDirectRecord *) record;
|
mbbiDirectRecord *mbbiD = (mbbiDirectRecord *)record;
|
||||||
unsigned long val;
|
unsigned long val;
|
||||||
|
|
||||||
if (format->type == DBF_ULONG || format->type == DBF_LONG)
|
if (format->type == DBF_ULONG || format->type == DBF_LONG)
|
||||||
{
|
{
|
||||||
if (mbbiD->mask) val = mbbiD->rval & mbbiD->mask;
|
if (mbbiD->mask) val = mbbiD->rval & mbbiD->mask;
|
||||||
else val = mbbiD->val;
|
else val = mbbiD->val;
|
||||||
return streamPrintf (record, format, val);
|
return streamPrintf(record, format, val);
|
||||||
}
|
}
|
||||||
return ERROR;
|
return ERROR;
|
||||||
}
|
}
|
||||||
|
|
||||||
static long initRecord (dbCommon *record)
|
static long initRecord(dbCommon *record)
|
||||||
{
|
{
|
||||||
mbbiDirectRecord *mbbiD = (mbbiDirectRecord *) record;
|
mbbiDirectRecord *mbbiD = (mbbiDirectRecord *)record;
|
||||||
|
|
||||||
mbbiD->mask <<= mbbiD->shft;
|
mbbiD->mask <<= mbbiD->shft;
|
||||||
return streamInitRecord (record, &mbbiD->inp, readData, writeData) == ERROR ?
|
return streamInitRecord(record, &mbbiD->inp, readData, writeData) == ERROR ?
|
||||||
ERROR : OK;
|
ERROR : OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -24,9 +24,9 @@
|
|||||||
#include "epicsExport.h"
|
#include "epicsExport.h"
|
||||||
#include "devStream.h"
|
#include "devStream.h"
|
||||||
|
|
||||||
static long readData (dbCommon *record, format_t *format)
|
static long readData(dbCommon *record, format_t *format)
|
||||||
{
|
{
|
||||||
mbbiRecord *mbbi = (mbbiRecord *) record;
|
mbbiRecord *mbbi = (mbbiRecord *)record;
|
||||||
unsigned long val;
|
unsigned long val;
|
||||||
int i;
|
int i;
|
||||||
|
|
||||||
@ -35,7 +35,7 @@ static long readData (dbCommon *record, format_t *format)
|
|||||||
case DBF_ULONG:
|
case DBF_ULONG:
|
||||||
case DBF_LONG:
|
case DBF_LONG:
|
||||||
{
|
{
|
||||||
if (streamScanf (record, format, &val)) return ERROR;
|
if (streamScanf(record, format, &val)) return ERROR;
|
||||||
/* read VAL or RBV? Look if any value is defined */
|
/* read VAL or RBV? Look if any value is defined */
|
||||||
if (mbbi->sdef) for (i=0; i<16; i++)
|
if (mbbi->sdef) for (i=0; i<16; i++)
|
||||||
{
|
{
|
||||||
@ -51,14 +51,14 @@ static long readData (dbCommon *record, format_t *format)
|
|||||||
}
|
}
|
||||||
case DBF_ENUM:
|
case DBF_ENUM:
|
||||||
{
|
{
|
||||||
if (streamScanf (record, format, &val)) return ERROR;
|
if (streamScanf(record, format, &val)) return ERROR;
|
||||||
mbbi->val = val;
|
mbbi->val = val;
|
||||||
return DO_NOT_CONVERT;
|
return DO_NOT_CONVERT;
|
||||||
}
|
}
|
||||||
case DBF_STRING:
|
case DBF_STRING:
|
||||||
{
|
{
|
||||||
char buffer[sizeof(mbbi->zrst)];
|
char buffer[sizeof(mbbi->zrst)];
|
||||||
if (streamScanfN (record, format, buffer, sizeof(buffer)))
|
if (streamScanfN(record, format, buffer, sizeof(buffer)))
|
||||||
return ERROR;
|
return ERROR;
|
||||||
for (val = 0; val < 16; val++)
|
for (val = 0; val < 16; val++)
|
||||||
{
|
{
|
||||||
@ -73,9 +73,9 @@ static long readData (dbCommon *record, format_t *format)
|
|||||||
return ERROR;
|
return ERROR;
|
||||||
}
|
}
|
||||||
|
|
||||||
static long writeData (dbCommon *record, format_t *format)
|
static long writeData(dbCommon *record, format_t *format)
|
||||||
{
|
{
|
||||||
mbbiRecord *mbbi = (mbbiRecord *) record;
|
mbbiRecord *mbbi = (mbbiRecord *)record;
|
||||||
long val;
|
long val;
|
||||||
int i;
|
int i;
|
||||||
|
|
||||||
@ -94,28 +94,28 @@ static long writeData (dbCommon *record, format_t *format)
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return streamPrintf (record, format, val);
|
return streamPrintf(record, format, val);
|
||||||
}
|
}
|
||||||
case DBF_ENUM:
|
case DBF_ENUM:
|
||||||
{
|
{
|
||||||
return streamPrintf (record, format, (long)mbbi->val);
|
return streamPrintf(record, format, (long)mbbi->val);
|
||||||
}
|
}
|
||||||
case DBF_STRING:
|
case DBF_STRING:
|
||||||
{
|
{
|
||||||
if (mbbi->val >= 16) return ERROR;
|
if (mbbi->val >= 16) return ERROR;
|
||||||
return streamPrintf (record, format,
|
return streamPrintf(record, format,
|
||||||
mbbi->zrst + sizeof(mbbi->zrst) * mbbi->val);
|
mbbi->zrst + sizeof(mbbi->zrst) * mbbi->val);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return ERROR;
|
return ERROR;
|
||||||
}
|
}
|
||||||
|
|
||||||
static long initRecord (dbCommon *record)
|
static long initRecord(dbCommon *record)
|
||||||
{
|
{
|
||||||
mbbiRecord *mbbi = (mbbiRecord *) record;
|
mbbiRecord *mbbi = (mbbiRecord *)record;
|
||||||
|
|
||||||
mbbi->mask <<= mbbi->shft;
|
mbbi->mask <<= mbbi->shft;
|
||||||
return streamInitRecord (record, &mbbi->inp, readData, writeData) == ERROR ?
|
return streamInitRecord(record, &mbbi->inp, readData, writeData) == ERROR ?
|
||||||
ERROR : OK;
|
ERROR : OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -24,14 +24,14 @@
|
|||||||
#include "epicsExport.h"
|
#include "epicsExport.h"
|
||||||
#include "devStream.h"
|
#include "devStream.h"
|
||||||
|
|
||||||
static long readData (dbCommon *record, format_t *format)
|
static long readData(dbCommon *record, format_t *format)
|
||||||
{
|
{
|
||||||
mbboDirectRecord *mbboD = (mbboDirectRecord *) record;
|
mbboDirectRecord *mbboD = (mbboDirectRecord *)record;
|
||||||
unsigned long val;
|
unsigned long val;
|
||||||
|
|
||||||
if (format->type == DBF_ULONG || format->type == DBF_LONG)
|
if (format->type == DBF_ULONG || format->type == DBF_LONG)
|
||||||
{
|
{
|
||||||
if (streamScanf (record, format, &val)) return ERROR;
|
if (streamScanf(record, format, &val)) return ERROR;
|
||||||
if (mbboD->mask)
|
if (mbboD->mask)
|
||||||
{
|
{
|
||||||
val &= mbboD->mask;
|
val &= mbboD->mask;
|
||||||
@ -49,32 +49,32 @@ static long readData (dbCommon *record, format_t *format)
|
|||||||
return ERROR;
|
return ERROR;
|
||||||
}
|
}
|
||||||
|
|
||||||
static long writeData (dbCommon *record, format_t *format)
|
static long writeData(dbCommon *record, format_t *format)
|
||||||
{
|
{
|
||||||
mbboDirectRecord *mbboD = (mbboDirectRecord *) record;
|
mbboDirectRecord *mbboD = (mbboDirectRecord *)record;
|
||||||
long val;
|
long val;
|
||||||
|
|
||||||
if (format->type == DBF_ULONG || format->type == DBF_LONG)
|
if (format->type == DBF_ULONG || format->type == DBF_LONG)
|
||||||
{
|
{
|
||||||
if (mbboD->mask) val = mbboD->rval & mbboD->mask;
|
if (mbboD->mask) val = mbboD->rval & mbboD->mask;
|
||||||
else val = mbboD->val;
|
else val = mbboD->val;
|
||||||
return streamPrintf (record, format, val);
|
return streamPrintf(record, format, val);
|
||||||
}
|
}
|
||||||
return ERROR;
|
return ERROR;
|
||||||
}
|
}
|
||||||
|
|
||||||
static long initRecord (dbCommon *record)
|
static long initRecord(dbCommon *record)
|
||||||
{
|
{
|
||||||
mbboDirectRecord *mbboD = (mbboDirectRecord *) record;
|
mbboDirectRecord *mbboD = (mbboDirectRecord *)record;
|
||||||
|
|
||||||
mbboD->mask <<= mbboD->shft;
|
mbboD->mask <<= mbboD->shft;
|
||||||
|
|
||||||
/* Workaround for bug in mbboDirect record:
|
/* Workaround for bug in mbboDirect record:
|
||||||
Put to VAL overwrites value to 0 if SEVR is INVALID_ALARM
|
Put to VAL overwrites value to 0 if SEVR is INVALID_ALARM
|
||||||
Thus first write may send a wrong value.
|
Thus first write may send a wrong value.
|
||||||
*/
|
*/
|
||||||
mbboD->sevr = 0;
|
mbboD->sevr = 0;
|
||||||
return streamInitRecord (record, &mbboD->out, readData, writeData);
|
return streamInitRecord(record, &mbboD->out, readData, writeData);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Unfortunately the bug also corrupts the next write to VAL after an I/O error.
|
/* Unfortunately the bug also corrupts the next write to VAL after an I/O error.
|
||||||
|
@ -24,9 +24,9 @@
|
|||||||
#include "epicsExport.h"
|
#include "epicsExport.h"
|
||||||
#include "devStream.h"
|
#include "devStream.h"
|
||||||
|
|
||||||
static long readData (dbCommon *record, format_t *format)
|
static long readData(dbCommon *record, format_t *format)
|
||||||
{
|
{
|
||||||
mbboRecord *mbbo = (mbboRecord *) record;
|
mbboRecord *mbbo = (mbboRecord *)record;
|
||||||
unsigned long val;
|
unsigned long val;
|
||||||
int i;
|
int i;
|
||||||
|
|
||||||
@ -35,7 +35,7 @@ static long readData (dbCommon *record, format_t *format)
|
|||||||
case DBF_ULONG:
|
case DBF_ULONG:
|
||||||
case DBF_LONG:
|
case DBF_LONG:
|
||||||
{
|
{
|
||||||
if (streamScanf (record, format, &val)) return ERROR;
|
if (streamScanf(record, format, &val)) return ERROR;
|
||||||
/* read VAL or RBV? Look if any value is defined */
|
/* read VAL or RBV? Look if any value is defined */
|
||||||
if (mbbo->sdef) for (i=0; i<16; i++)
|
if (mbbo->sdef) for (i=0; i<16; i++)
|
||||||
{
|
{
|
||||||
@ -52,14 +52,14 @@ static long readData (dbCommon *record, format_t *format)
|
|||||||
}
|
}
|
||||||
case DBF_ENUM:
|
case DBF_ENUM:
|
||||||
{
|
{
|
||||||
if (streamScanf (record, format, &val)) return ERROR;
|
if (streamScanf(record, format, &val)) return ERROR;
|
||||||
mbbo->val = val;
|
mbbo->val = val;
|
||||||
return DO_NOT_CONVERT;
|
return DO_NOT_CONVERT;
|
||||||
}
|
}
|
||||||
case DBF_STRING:
|
case DBF_STRING:
|
||||||
{
|
{
|
||||||
char buffer[sizeof(mbbo->zrst)];
|
char buffer[sizeof(mbbo->zrst)];
|
||||||
if (streamScanfN (record, format, buffer, sizeof(buffer)))
|
if (streamScanfN(record, format, buffer, sizeof(buffer)))
|
||||||
return ERROR;
|
return ERROR;
|
||||||
for (val = 0; val < 16; val++)
|
for (val = 0; val < 16; val++)
|
||||||
{
|
{
|
||||||
@ -74,9 +74,9 @@ static long readData (dbCommon *record, format_t *format)
|
|||||||
return ERROR;
|
return ERROR;
|
||||||
}
|
}
|
||||||
|
|
||||||
static long writeData (dbCommon *record, format_t *format)
|
static long writeData(dbCommon *record, format_t *format)
|
||||||
{
|
{
|
||||||
mbboRecord *mbbo = (mbboRecord *) record;
|
mbboRecord *mbbo = (mbboRecord *)record;
|
||||||
unsigned long val;
|
unsigned long val;
|
||||||
int i;
|
int i;
|
||||||
|
|
||||||
@ -97,28 +97,28 @@ static long writeData (dbCommon *record, format_t *format)
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return streamPrintf (record, format, val);
|
return streamPrintf(record, format, val);
|
||||||
}
|
}
|
||||||
case DBF_ENUM:
|
case DBF_ENUM:
|
||||||
{
|
{
|
||||||
return streamPrintf (record, format, (long)mbbo->val);
|
return streamPrintf(record, format, (long)mbbo->val);
|
||||||
}
|
}
|
||||||
case DBF_STRING:
|
case DBF_STRING:
|
||||||
{
|
{
|
||||||
if (mbbo->val >= 16) return ERROR;
|
if (mbbo->val >= 16) return ERROR;
|
||||||
return streamPrintf (record, format,
|
return streamPrintf(record, format,
|
||||||
mbbo->zrst + sizeof(mbbo->zrst) * mbbo->val);
|
mbbo->zrst + sizeof(mbbo->zrst) * mbbo->val);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return ERROR;
|
return ERROR;
|
||||||
}
|
}
|
||||||
|
|
||||||
static long initRecord (dbCommon *record)
|
static long initRecord(dbCommon *record)
|
||||||
{
|
{
|
||||||
mbboRecord *mbbo = (mbboRecord *) record;
|
mbboRecord *mbbo = (mbboRecord *)record;
|
||||||
|
|
||||||
mbbo->mask <<= mbbo->shft;
|
mbbo->mask <<= mbbo->shft;
|
||||||
return streamInitRecord (record, &mbbo->out, readData, writeData);
|
return streamInitRecord(record, &mbbo->out, readData, writeData);
|
||||||
}
|
}
|
||||||
|
|
||||||
struct {
|
struct {
|
||||||
|
@ -25,68 +25,68 @@
|
|||||||
scalcout record has a bug: it never calls init_record
|
scalcout record has a bug: it never calls init_record
|
||||||
of the device support.
|
of the device support.
|
||||||
Fix: sCalcoutRecord.c, end of init_record() add
|
Fix: sCalcoutRecord.c, end of init_record() add
|
||||||
|
|
||||||
if(pscalcoutDSET->init_record ) {
|
if(pscalcoutDSET->init_record ) {
|
||||||
return (*pscalcoutDSET->init_record)(pcalc);
|
return (*pscalcoutDSET->init_record)(pcalc);
|
||||||
}
|
}
|
||||||
*/
|
*/
|
||||||
|
|
||||||
static long readData (dbCommon *record, format_t *format)
|
static long readData(dbCommon *record, format_t *format)
|
||||||
{
|
{
|
||||||
scalcoutRecord *sco = (scalcoutRecord *) record;
|
scalcoutRecord *sco = (scalcoutRecord *)record;
|
||||||
|
|
||||||
switch (format->type)
|
switch (format->type)
|
||||||
{
|
{
|
||||||
case DBF_DOUBLE:
|
case DBF_DOUBLE:
|
||||||
{
|
{
|
||||||
return streamScanf (record, format, &sco->val);
|
return streamScanf(record, format, &sco->val);
|
||||||
}
|
}
|
||||||
case DBF_LONG:
|
case DBF_LONG:
|
||||||
case DBF_ENUM:
|
case DBF_ENUM:
|
||||||
{
|
{
|
||||||
long lval;
|
long lval;
|
||||||
|
|
||||||
if (streamScanf (record, format, &lval)) return ERROR;
|
if (streamScanf(record, format, &lval)) return ERROR;
|
||||||
sco->val = lval;
|
sco->val = lval;
|
||||||
return OK;
|
return OK;
|
||||||
}
|
}
|
||||||
case DBF_STRING:
|
case DBF_STRING:
|
||||||
{
|
{
|
||||||
return (streamScanfN (record, format,
|
return (streamScanfN(record, format,
|
||||||
sco->sval, sizeof(sco->val)));
|
sco->sval, sizeof(sco->val)));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return ERROR;
|
return ERROR;
|
||||||
}
|
}
|
||||||
|
|
||||||
static long writeData (dbCommon *record, format_t *format)
|
static long writeData(dbCommon *record, format_t *format)
|
||||||
{
|
{
|
||||||
scalcoutRecord *sco = (scalcoutRecord *) record;
|
scalcoutRecord *sco = (scalcoutRecord *)record;
|
||||||
|
|
||||||
switch (format->type)
|
switch (format->type)
|
||||||
{
|
{
|
||||||
case DBF_DOUBLE:
|
case DBF_DOUBLE:
|
||||||
{
|
{
|
||||||
return streamPrintf (record, format, sco->oval);
|
return streamPrintf(record, format, sco->oval);
|
||||||
}
|
}
|
||||||
case DBF_LONG:
|
case DBF_LONG:
|
||||||
case DBF_ENUM:
|
case DBF_ENUM:
|
||||||
{
|
{
|
||||||
return streamPrintf (record, format, (long)sco->oval);
|
return streamPrintf(record, format, (long)sco->oval);
|
||||||
}
|
}
|
||||||
case DBF_STRING:
|
case DBF_STRING:
|
||||||
{
|
{
|
||||||
return streamPrintf (record, format, sco->osv);
|
return streamPrintf(record, format, sco->osv);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return ERROR;
|
return ERROR;
|
||||||
}
|
}
|
||||||
|
|
||||||
static long initRecord (dbCommon *record)
|
static long initRecord(dbCommon *record)
|
||||||
{
|
{
|
||||||
scalcoutRecord *sco = (scalcoutRecord *) record;
|
scalcoutRecord *sco = (scalcoutRecord *)record;
|
||||||
|
|
||||||
return streamInitRecord (record, &sco->out, readData, writeData);
|
return streamInitRecord(record, &sco->out, readData, writeData);
|
||||||
}
|
}
|
||||||
|
|
||||||
struct {
|
struct {
|
||||||
|
@ -22,33 +22,33 @@
|
|||||||
#include "epicsExport.h"
|
#include "epicsExport.h"
|
||||||
#include "devStream.h"
|
#include "devStream.h"
|
||||||
|
|
||||||
static long readData (dbCommon *record, format_t *format)
|
static long readData(dbCommon *record, format_t *format)
|
||||||
{
|
{
|
||||||
stringinRecord *si = (stringinRecord *) record;
|
stringinRecord *si = (stringinRecord *)record;
|
||||||
|
|
||||||
if (format->type == DBF_STRING)
|
if (format->type == DBF_STRING)
|
||||||
{
|
{
|
||||||
return streamScanfN (record, format, si->val, sizeof(si->val));
|
return streamScanfN(record, format, si->val, sizeof(si->val));
|
||||||
}
|
}
|
||||||
return ERROR;
|
return ERROR;
|
||||||
}
|
}
|
||||||
|
|
||||||
static long writeData (dbCommon *record, format_t *format)
|
static long writeData(dbCommon *record, format_t *format)
|
||||||
{
|
{
|
||||||
stringinRecord *si = (stringinRecord *) record;
|
stringinRecord *si = (stringinRecord *)record;
|
||||||
|
|
||||||
if (format->type == DBF_STRING)
|
if (format->type == DBF_STRING)
|
||||||
{
|
{
|
||||||
return streamPrintf (record, format, si->val);
|
return streamPrintf(record, format, si->val);
|
||||||
}
|
}
|
||||||
return ERROR;
|
return ERROR;
|
||||||
}
|
}
|
||||||
|
|
||||||
static long initRecord (dbCommon *record)
|
static long initRecord(dbCommon *record)
|
||||||
{
|
{
|
||||||
stringinRecord *si = (stringinRecord *) record;
|
stringinRecord *si = (stringinRecord *)record;
|
||||||
|
|
||||||
return streamInitRecord (record, &si->inp, readData, writeData) == ERROR ?
|
return streamInitRecord(record, &si->inp, readData, writeData) == ERROR ?
|
||||||
ERROR : OK;
|
ERROR : OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -22,33 +22,33 @@
|
|||||||
#include "epicsExport.h"
|
#include "epicsExport.h"
|
||||||
#include "devStream.h"
|
#include "devStream.h"
|
||||||
|
|
||||||
static long readData (dbCommon *record, format_t *format)
|
static long readData(dbCommon *record, format_t *format)
|
||||||
{
|
{
|
||||||
stringoutRecord *so = (stringoutRecord *) record;
|
stringoutRecord *so = (stringoutRecord *)record;
|
||||||
|
|
||||||
if (format->type == DBF_STRING)
|
if (format->type == DBF_STRING)
|
||||||
{
|
{
|
||||||
return streamScanfN (record, format, so->val, sizeof(so->val));
|
return streamScanfN(record, format, so->val, sizeof(so->val));
|
||||||
}
|
}
|
||||||
return ERROR;
|
return ERROR;
|
||||||
}
|
}
|
||||||
|
|
||||||
static long writeData (dbCommon *record, format_t *format)
|
static long writeData(dbCommon *record, format_t *format)
|
||||||
{
|
{
|
||||||
stringoutRecord *so = (stringoutRecord *) record;
|
stringoutRecord *so = (stringoutRecord *)record;
|
||||||
|
|
||||||
if (format->type == DBF_STRING)
|
if (format->type == DBF_STRING)
|
||||||
{
|
{
|
||||||
return streamPrintf (record, format, so->val);
|
return streamPrintf(record, format, so->val);
|
||||||
}
|
}
|
||||||
return ERROR;
|
return ERROR;
|
||||||
}
|
}
|
||||||
|
|
||||||
static long initRecord (dbCommon *record)
|
static long initRecord(dbCommon *record)
|
||||||
{
|
{
|
||||||
stringoutRecord *so = (stringoutRecord *) record;
|
stringoutRecord *so = (stringoutRecord *)record;
|
||||||
|
|
||||||
return streamInitRecord (record, &so->out, readData, writeData) == ERROR ?
|
return streamInitRecord(record, &so->out, readData, writeData) == ERROR ?
|
||||||
ERROR : OK;
|
ERROR : OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -24,9 +24,9 @@
|
|||||||
#include "epicsExport.h"
|
#include "epicsExport.h"
|
||||||
#include "devStream.h"
|
#include "devStream.h"
|
||||||
|
|
||||||
static long readData (dbCommon *record, format_t *format)
|
static long readData(dbCommon *record, format_t *format)
|
||||||
{
|
{
|
||||||
waveformRecord *wf = (waveformRecord *) record;
|
waveformRecord *wf = (waveformRecord *)record;
|
||||||
double dval;
|
double dval;
|
||||||
long lval;
|
long lval;
|
||||||
|
|
||||||
@ -37,7 +37,7 @@ static long readData (dbCommon *record, format_t *format)
|
|||||||
{
|
{
|
||||||
case DBF_DOUBLE:
|
case DBF_DOUBLE:
|
||||||
{
|
{
|
||||||
if (streamScanf (record, format, &dval) != OK)
|
if (streamScanf(record, format, &dval) != OK)
|
||||||
{
|
{
|
||||||
return wf->nord ? OK : ERROR;
|
return wf->nord ? OK : ERROR;
|
||||||
}
|
}
|
||||||
@ -50,7 +50,7 @@ static long readData (dbCommon *record, format_t *format)
|
|||||||
((epicsFloat32 *)wf->bptr)[wf->nord] = (epicsFloat32)dval;
|
((epicsFloat32 *)wf->bptr)[wf->nord] = (epicsFloat32)dval;
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
errlogSevPrintf (errlogFatal,
|
errlogSevPrintf(errlogFatal,
|
||||||
"readData %s: can't convert from double to %s\n",
|
"readData %s: can't convert from double to %s\n",
|
||||||
record->name, pamapdbfType[wf->ftvl].strvalue);
|
record->name, pamapdbfType[wf->ftvl].strvalue);
|
||||||
return ERROR;
|
return ERROR;
|
||||||
@ -61,7 +61,7 @@ static long readData (dbCommon *record, format_t *format)
|
|||||||
case DBF_LONG:
|
case DBF_LONG:
|
||||||
case DBF_ENUM:
|
case DBF_ENUM:
|
||||||
{
|
{
|
||||||
if (streamScanf (record, format, &lval) != OK)
|
if (streamScanf(record, format, &lval) != OK)
|
||||||
{
|
{
|
||||||
return wf->nord ? OK : ERROR;
|
return wf->nord ? OK : ERROR;
|
||||||
}
|
}
|
||||||
@ -93,7 +93,7 @@ static long readData (dbCommon *record, format_t *format)
|
|||||||
((epicsInt8 *)wf->bptr)[wf->nord] = (epicsInt8)lval;
|
((epicsInt8 *)wf->bptr)[wf->nord] = (epicsInt8)lval;
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
errlogSevPrintf (errlogFatal,
|
errlogSevPrintf(errlogFatal,
|
||||||
"readData %s: can't convert from long to %s\n",
|
"readData %s: can't convert from long to %s\n",
|
||||||
record->name, pamapdbfType[wf->ftvl].strvalue);
|
record->name, pamapdbfType[wf->ftvl].strvalue);
|
||||||
return ERROR;
|
return ERROR;
|
||||||
@ -105,7 +105,7 @@ static long readData (dbCommon *record, format_t *format)
|
|||||||
switch (wf->ftvl)
|
switch (wf->ftvl)
|
||||||
{
|
{
|
||||||
case DBF_STRING:
|
case DBF_STRING:
|
||||||
if (streamScanfN (record, format,
|
if (streamScanfN(record, format,
|
||||||
(char *)wf->bptr + wf->nord * MAX_STRING_SIZE,
|
(char *)wf->bptr + wf->nord * MAX_STRING_SIZE,
|
||||||
MAX_STRING_SIZE) != OK)
|
MAX_STRING_SIZE) != OK)
|
||||||
{
|
{
|
||||||
@ -114,9 +114,9 @@ static long readData (dbCommon *record, format_t *format)
|
|||||||
break;
|
break;
|
||||||
case DBF_CHAR:
|
case DBF_CHAR:
|
||||||
case DBF_UCHAR:
|
case DBF_UCHAR:
|
||||||
memset (wf->bptr, 0, wf->nelm);
|
memset(wf->bptr, 0, wf->nelm);
|
||||||
wf->nord = 0;
|
wf->nord = 0;
|
||||||
if (streamScanfN (record, format,
|
if (streamScanfN(record, format,
|
||||||
(char *)wf->bptr, wf->nelm) != OK)
|
(char *)wf->bptr, wf->nelm) != OK)
|
||||||
{
|
{
|
||||||
return ERROR;
|
return ERROR;
|
||||||
@ -128,7 +128,7 @@ static long readData (dbCommon *record, format_t *format)
|
|||||||
wf->nord = lval+1;
|
wf->nord = lval+1;
|
||||||
return OK;
|
return OK;
|
||||||
default:
|
default:
|
||||||
errlogSevPrintf (errlogFatal,
|
errlogSevPrintf(errlogFatal,
|
||||||
"readData %s: can't convert from string to %s\n",
|
"readData %s: can't convert from string to %s\n",
|
||||||
record->name, pamapdbfType[wf->ftvl].strvalue);
|
record->name, pamapdbfType[wf->ftvl].strvalue);
|
||||||
return ERROR;
|
return ERROR;
|
||||||
@ -137,7 +137,7 @@ static long readData (dbCommon *record, format_t *format)
|
|||||||
}
|
}
|
||||||
default:
|
default:
|
||||||
{
|
{
|
||||||
errlogSevPrintf (errlogMajor,
|
errlogSevPrintf(errlogMajor,
|
||||||
"readData %s: can't convert from %s to %s\n",
|
"readData %s: can't convert from %s to %s\n",
|
||||||
record->name, pamapdbfType[format->type].strvalue,
|
record->name, pamapdbfType[format->type].strvalue,
|
||||||
pamapdbfType[wf->ftvl].strvalue);
|
pamapdbfType[wf->ftvl].strvalue);
|
||||||
@ -148,9 +148,9 @@ static long readData (dbCommon *record, format_t *format)
|
|||||||
return OK;
|
return OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
static long writeData (dbCommon *record, format_t *format)
|
static long writeData(dbCommon *record, format_t *format)
|
||||||
{
|
{
|
||||||
waveformRecord *wf = (waveformRecord *) record;
|
waveformRecord *wf = (waveformRecord *)record;
|
||||||
double dval;
|
double dval;
|
||||||
long lval;
|
long lval;
|
||||||
unsigned long nowd;
|
unsigned long nowd;
|
||||||
@ -197,12 +197,12 @@ static long writeData (dbCommon *record, format_t *format)
|
|||||||
dval = ((epicsUInt8 *)wf->bptr)[nowd];
|
dval = ((epicsUInt8 *)wf->bptr)[nowd];
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
errlogSevPrintf (errlogFatal,
|
errlogSevPrintf(errlogFatal,
|
||||||
"writeData %s: can't convert from %s to double\n",
|
"writeData %s: can't convert from %s to double\n",
|
||||||
record->name, pamapdbfType[wf->ftvl].strvalue);
|
record->name, pamapdbfType[wf->ftvl].strvalue);
|
||||||
return ERROR;
|
return ERROR;
|
||||||
}
|
}
|
||||||
if (streamPrintf (record, format, dval))
|
if (streamPrintf(record, format, dval))
|
||||||
return ERROR;
|
return ERROR;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
@ -240,12 +240,12 @@ static long writeData (dbCommon *record, format_t *format)
|
|||||||
lval = ((epicsUInt8 *)wf->bptr)[nowd];
|
lval = ((epicsUInt8 *)wf->bptr)[nowd];
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
errlogSevPrintf (errlogFatal,
|
errlogSevPrintf(errlogFatal,
|
||||||
"writeData %s: can't convert from %s to long\n",
|
"writeData %s: can't convert from %s to long\n",
|
||||||
record->name, pamapdbfType[wf->ftvl].strvalue);
|
record->name, pamapdbfType[wf->ftvl].strvalue);
|
||||||
return ERROR;
|
return ERROR;
|
||||||
}
|
}
|
||||||
if (streamPrintf (record, format, lval))
|
if (streamPrintf(record, format, lval))
|
||||||
return ERROR;
|
return ERROR;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
@ -254,7 +254,7 @@ static long writeData (dbCommon *record, format_t *format)
|
|||||||
switch (wf->ftvl)
|
switch (wf->ftvl)
|
||||||
{
|
{
|
||||||
case DBF_STRING:
|
case DBF_STRING:
|
||||||
if (streamPrintf (record, format,
|
if (streamPrintf(record, format,
|
||||||
((char *)wf->bptr) + nowd * MAX_STRING_SIZE))
|
((char *)wf->bptr) + nowd * MAX_STRING_SIZE))
|
||||||
return ERROR;
|
return ERROR;
|
||||||
break;
|
break;
|
||||||
@ -269,12 +269,12 @@ static long writeData (dbCommon *record, format_t *format)
|
|||||||
{
|
{
|
||||||
((char *)wf->bptr)[wf->nelm-1] = 0;
|
((char *)wf->bptr)[wf->nelm-1] = 0;
|
||||||
}
|
}
|
||||||
if (streamPrintf (record, format,
|
if (streamPrintf(record, format,
|
||||||
((char *)wf->bptr)))
|
((char *)wf->bptr)))
|
||||||
return ERROR;
|
return ERROR;
|
||||||
return OK;
|
return OK;
|
||||||
default:
|
default:
|
||||||
errlogSevPrintf (errlogFatal,
|
errlogSevPrintf(errlogFatal,
|
||||||
"writeData %s: can't convert from %s to string\n",
|
"writeData %s: can't convert from %s to string\n",
|
||||||
record->name, pamapdbfType[wf->ftvl].strvalue);
|
record->name, pamapdbfType[wf->ftvl].strvalue);
|
||||||
return ERROR;
|
return ERROR;
|
||||||
@ -283,7 +283,7 @@ static long writeData (dbCommon *record, format_t *format)
|
|||||||
}
|
}
|
||||||
default:
|
default:
|
||||||
{
|
{
|
||||||
errlogSevPrintf (errlogFatal,
|
errlogSevPrintf(errlogFatal,
|
||||||
"writeData %s: can't convert from %s to %s\n",
|
"writeData %s: can't convert from %s to %s\n",
|
||||||
record->name, pamapdbfType[wf->ftvl].strvalue,
|
record->name, pamapdbfType[wf->ftvl].strvalue,
|
||||||
pamapdbfType[format->type].strvalue);
|
pamapdbfType[format->type].strvalue);
|
||||||
@ -294,11 +294,11 @@ static long writeData (dbCommon *record, format_t *format)
|
|||||||
return OK;
|
return OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
static long initRecord (dbCommon *record)
|
static long initRecord(dbCommon *record)
|
||||||
{
|
{
|
||||||
waveformRecord *wf = (waveformRecord *) record;
|
waveformRecord *wf = (waveformRecord *)record;
|
||||||
|
|
||||||
return streamInitRecord (record, &wf->inp, readData, writeData) == ERROR ?
|
return streamInitRecord(record, &wf->inp, readData, writeData) == ERROR ?
|
||||||
ERROR : OK;
|
ERROR : OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user