Commit eeebb2b8 authored by flechsig's avatar flechsig
Browse files

add average counter

parent 2e04fd65
......@@ -395,7 +395,21 @@ record(ai, "$(P)$(R)Averages_RBV")
field(SCAN, "I/O Intr")
}
record(ao, "$(P)$(R)AverCount")
{
field(DTYP, "asynInt32")
field(OUT, "@asyn($(PORT),$(ADDR),$(TIMEOUT))XGI_AVERCOUNT")
field(PREC, "0")
field(PINI, "YES")
}
record(ai, "$(P)$(R)AverCount_RBV")
{
field(DTYP, "asynInt32")
field(INP, "@asyn($(PORT),$(ADDR),$(TIMEOUT))XGI_AVERCOUNT")
field(PREC, "0")
field(SCAN, "I/O Intr")
}
record(bo, "$(P)$(R)Logscale")
{
......
// Time-stamp: <20 Feb 19 16:28:02 flechsig>
// Time-stamp: <20 Feb 19 17:15:19 flechsig>
/*
* NDPluginXGI.cpp
*
......@@ -54,6 +54,7 @@ static const char *driverName="NDPluginXGI";
#define XGIPluginLogscaleString "XGI_LOGSCALE" /* (asynInt32, r/w) logscale */
#define XGIPluginOutPhaseString "XGI_OUTPHASE" /* (asynInt32, r/w) phase output */
#define XGIPluginAveragesString "XGI_AVERAGES" /* (asynInt32, r/w) averages */
#define XGIPluginAverCountString "XGI_AVERCOUNT" /* (asynInt32, r/w) averages counter */
/** Base class for XGI analysis plugin. */
class NDPluginXGI : public NDPluginDriver {
......@@ -104,9 +105,11 @@ private:
int XGIPluginLogscale;
int XGIPluginOutPhase;
int XGIPluginAverages;
int XGIPluginAverCount;
// UF end
int XGIPluginROC;
#define LAST_NDPLUGIN_XGI_PARAM XGIPluginROC
struct ConfigStruct XGIconfig; // UF config structure defined in algorithms.h
};
#define NUM_NDPLUGIN_XGI_PARAMS ((int)(&LAST_NDPLUGIN_XGI_PARAM - &FIRST_NDPLUGIN_XGI_PARAM + 1))
......@@ -310,6 +313,7 @@ void NDPluginXGI::processCallbacks(NDArray *pArray)
this->lock();
arrayCounter++;
setIntegerParam(NDArrayCounter, arrayCounter);
//setIntegerParam(XGIPluginAverCount, arrayCounter); // uf
setDoubleParam(XGIPluginROC, output.roc);
doCallbacksFloat64Array(output.laxis.data, output.laxis.width*output.laxis.height, XGIPluginProfileAxis, 0);
doCallbacksFloat64Array(output.hp.data, output.hp.width*output.hp.height, XGIPluginProfileData, 0);
......@@ -458,12 +462,13 @@ NDPluginXGI::NDPluginXGI(const char *portName, int queueSize, int blockingCallba
createParam(XGIPluginProfileDataString, asynParamFloat64Array, &XGIPluginProfileData);
createParam(XGIPluginROCString, asynParamFloat64, &XGIPluginROC);
// UF
createParam(XGIPluginMinorString, asynParamInt32, &XGIPluginMinor);
createParam(XGIPluginCenterString, asynParamInt32, &XGIPluginCenter);
createParam(XGIPluginWidthString, asynParamInt32, &XGIPluginWidth);
createParam(XGIPluginLogscaleString, asynParamInt32, &XGIPluginLogscale);
createParam(XGIPluginOutPhaseString, asynParamInt32, &XGIPluginOutPhase);
createParam(XGIPluginAveragesString, asynParamInt32, &XGIPluginAverages);
createParam(XGIPluginMinorString, asynParamInt32, &XGIPluginMinor);
createParam(XGIPluginCenterString, asynParamInt32, &XGIPluginCenter);
createParam(XGIPluginWidthString, asynParamInt32, &XGIPluginWidth);
createParam(XGIPluginLogscaleString, asynParamInt32, &XGIPluginLogscale);
createParam(XGIPluginOutPhaseString, asynParamInt32, &XGIPluginOutPhase);
createParam(XGIPluginAveragesString, asynParamInt32, &XGIPluginAverages);
createParam(XGIPluginAverCountString, asynParamInt32, &XGIPluginAverCount);
/* Set the plugin type string */
setStringParam(NDPluginDriverPluginType, driverName);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment