Compare commits

...

3 Commits

2 changed files with 17 additions and 7 deletions

View File

@ -1,12 +1,10 @@
include /ioc/tools/driver.makefile
EXCLUDE_VERSIONS = 3.13.2
PROJECT=stream2
PROJECT=stream
BUILDCLASSES += Linux
#DOCUDIR = doc
DBDS = stream.dbd
BUSSES += AsynDriver
BUSSES += Dummy
@ -42,9 +40,9 @@ HEADERS += StreamBuffer.h
HEADERS += StreamError.h
ifeq (${EPICS_BASETYPE},3.13)
USR_INCLUDES += -include $(INSTALL_INCLUDE)/compat3_13.h
endif
ifeq (${EPICS_BASETYPE},3.14)
# old gcc needs full path for -include
CXXFLAGS += -include $(foreach d,${INCLUDES:-I%=%},$(wildcard $d/compat3_13.h))
else
RECORDTYPES += calcout
endif
@ -54,5 +52,7 @@ streamReferences:
perl ../src/makeref.pl Interface $(BUSSES) > $@
perl ../src/makeref.pl Converter $(FORMATS) >> $@
stream.dbd:
# have to hack a bit to work with both versions of driver.makefile
DBDFILES = O.$${EPICSVERSION}_$${T_A}/streamSup.dbd
../O.${EPICSVERSION}_${T_A}/streamSup.dbd:
perl ../src/makedbd.pl $(RECORDTYPES) > $@

View File

@ -20,6 +20,7 @@
#include "devStream.h"
#include <aiRecord.h>
#include <menuConvert.h>
#include <epicsExport.h>
static long readData (dbCommon *record, format_t *format)
@ -45,6 +46,11 @@ static long readData (dbCommon *record, format_t *format)
{
long rval;
if (streamScanf (record, format, &rval)) return ERROR;
if (ai->linr == menuConvertNO_CONVERSION)
{
ai->val = (double) rval;
return DO_NOT_CONVERT;
}
ai->rval = rval;
return OK;
}
@ -67,6 +73,10 @@ static long writeData (dbCommon *record, format_t *format)
}
case DBF_LONG:
{
if (ai->linr == menuConvertNO_CONVERSION)
{
return streamPrintf (record, format, (long) ai->val);
}
return streamPrintf (record, format, (long) ai->rval);
}
}