Commit 511c6321 authored by flechsig's avatar flechsig
Browse files

Merge branch 'uwe'

parents 1b1cb283 14a65eff
......@@ -379,6 +379,38 @@ record(ai, "$(P)$(R)Width_RBV")
field(SCAN, "I/O Intr")
}
record(ao, "$(P)$(R)Averages")
{
field(DTYP, "asynInt32")
field(OUT, "@asyn($(PORT),$(ADDR),$(TIMEOUT))XGI_AVERAGES")
field(PREC, "0")
field(PINI, "YES")
}
record(ai, "$(P)$(R)Averages_RBV")
{
field(DTYP, "asynInt32")
field(INP, "@asyn($(PORT),$(ADDR),$(TIMEOUT))XGI_AVERAGES")
field(PREC, "0")
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")
{
field(DTYP, "asynInt32")
......@@ -399,29 +431,33 @@ record(bi, "$(P)$(R)Logscale_RBV")
field(SCAN, "I/O Intr")
}
record(mbbo, "$(P)$(R)OutputPhase")
record(mbbo, "$(P)$(R)Outputs")
{
field(DTYP, "asynInt32")
field(OUT, "@asyn($(PORT),$(ADDR),$(TIMEOUT))XGI_OUTPHASE")
field(OUT, "@asyn($(PORT),$(ADDR),$(TIMEOUT))XGI_OUTPUTS")
field(ZRVL, "0")
field(ZRST, "Amplitude")
field(ZRST, "default")
field(ONVL, "1")
field(ONST, "Phase")
field(ONST, "Amplitude")
field(TWVL, "2")
field(TWST, "unwrapped Phase")
field(TWST, "raw Phase")
field(THVL, "3")
field(THST, "unwrapped Phase")
field(PINI, "YES")
}
record(mbbi, "$(P)$(R)OutputPhase_RBV")
record(mbbi, "$(P)$(R)Outputs_RBV")
{
field(DTYP, "asynInt32")
field(INP, "@asyn($(PORT),$(ADDR),$(TIMEOUT))XGI_OUTPHASE")
field(INP, "@asyn($(PORT),$(ADDR),$(TIMEOUT))XGI_OUTPUTS")
field(ZRVL, "0")
field(ZRST, "Amplitude")
field(ZRST, "default")
field(ONVL, "1")
field(ONST, "Phase")
field(ONST, "Amplitude")
field(TWVL, "2")
field(TWST, "unwrapped Phase")
field(TWST, "raw Phase")
field(THVL, "3")
field(THST, "unwrapped Phase")
field(SCAN, "I/O Intr")
}
......
......@@ -19,5 +19,6 @@ $(P)$(R)Minor
$(P)$(R)Center
$(P)$(R)Width
$(P)$(R)Logscale
$(P)$(R)OutputPhase
$(P)$(R)Outputs
$(P)$(R)Averages
file "NDPluginBase_settings.req", P=$(P), R=$(R)
......@@ -8,7 +8,7 @@ display {
x=60
y=235
width=469
height=159
height=191
}
clr=14
bclr=4
......@@ -101,162 +101,189 @@ text {
chan="$(P)$(R)Width"
}
}
composite {
rectangle {
object {
x=4
y=6
width=459
height=150
height=180
}
"basic attribute" {
clr=14
fill="outline"
}
}
text {
object {
x=8
y=24
width=100
height=20
}
"basic attribute" {
clr=14
}
textix="Minor Mode"
}
text {
object {
x=8
y=49
width=70
height=20
}
"basic attribute" {
clr=14
}
textix="Outputs"
}
text {
object {
x=8
y=74
width=80
height=20
}
"basic attribute" {
clr=14
}
textix="Logscale"
}
text {
object {
x=8
y=99
width=60
height=20
}
"basic attribute" {
clr=14
}
textix="Center"
}
text {
object {
x=8
y=123
width=50
height=20
}
"basic attribute" {
clr=14
}
textix="Width"
}
text {
object {
x=8
y=150
width=80
height=20
}
"basic attribute" {
clr=14
}
textix="Averages"
}
menu {
object {
x=123
y=25
width=140
height=20
}
control {
chan="$(P)$(R)Minor"
clr=14
bclr=51
}
}
menu {
object {
x=123
y=50
width=140
height=20
}
control {
chan="$(P)$(R)Outputs"
clr=14
bclr=51
}
}
"choice button" {
object {
x=123
y=75
width=140
height=20
}
control {
chan="$(P)$(R)Logscale"
clr=14
bclr=51
}
stacking="column"
}
"text entry" {
object {
x=123
y=100
width=140
height=20
}
control {
chan="$(P)$(R)Center"
clr=14
bclr=51
}
limits {
}
}
"text entry" {
object {
x=123
y=125
width=140
height=20
}
control {
chan="$(P)$(R)Width"
clr=14
bclr=51
}
limits {
}
}
"text entry" {
object {
x=123
y=152
width=140
height=20
}
control {
chan="$(P)$(R)Averages"
clr=14
bclr=51
}
limits {
}
}
composite {
object {
x=290
y=24
width=155
height=147
}
"composite name"=""
children {
rectangle {
object {
x=4
y=6
width=459
height=150
}
"basic attribute" {
clr=14
fill="outline"
}
}
text {
object {
x=10
y=24
width=200
height=20
}
"basic attribute" {
clr=14
}
textix="Minor Mode"
}
text {
object {
x=10
y=49
width=200
height=20
}
"basic attribute" {
clr=14
}
textix="OutputPhase"
}
text {
object {
x=10
y=74
width=200
height=20
}
"basic attribute" {
clr=14
}
textix="Logscale"
}
text {
object {
x=10
y=99
width=200
height=20
}
"basic attribute" {
clr=14
}
textix="Center"
}
text {
object {
x=10
y=124
width=200
height=20
}
"basic attribute" {
clr=14
}
textix="Width"
}
menu {
object {
x=215
y=24
width=102
height=20
}
control {
chan="$(P)$(R)Minor"
clr=14
bclr=51
}
}
menu {
object {
x=215
y=49
width=102
height=20
}
control {
chan="$(P)$(R)OutputPhase"
clr=14
bclr=51
}
}
"choice button" {
object {
x=215
y=74
width=100
height=20
}
control {
chan="$(P)$(R)Logscale"
clr=14
bclr=51
}
stacking="column"
}
"text entry" {
object {
x=215
y=99
width=100
height=20
}
control {
chan="$(P)$(R)Center"
clr=14
bclr=51
}
limits {
}
}
"text entry" {
object {
x=215
y=124
width=100
height=20
}
control {
chan="$(P)$(R)Width"
clr=14
bclr=51
}
limits {
}
}
"text update" {
object {
x=322
x=290
y=24
width=110
width=155
height=20
}
monitor {
......@@ -269,13 +296,13 @@ composite {
}
"text update" {
object {
x=322
x=290
y=49
width=110
width=155
height=20
}
monitor {
chan="$(P)$(R)OutputPhase_RBV"
chan="$(P)$(R)Outputs_RBV"
clr=14
bclr=5
}
......@@ -284,9 +311,9 @@ composite {
}
"text update" {
object {
x=320
x=290
y=74
width=110
width=155
height=20
}
monitor {
......@@ -299,9 +326,9 @@ composite {
}
"text update" {
object {
x=320
x=290
y=99
width=110
width=155
height=20
}
monitor {
......@@ -314,9 +341,9 @@ composite {
}
"text update" {
object {
x=320
x=290
y=124
width=110
width=155
height=20
}
monitor {
......@@ -327,5 +354,20 @@ composite {
limits {
}
}
"text update" {
object {
x=290
y=151
width=155
height=20
}
monitor {
chan="$(P)$(R)Averages_RBV"
clr=14
bclr=5
}
limits {
}
}
}
}
// Time-stamp: <20 Feb 19 14:52:43 flechsig>
// Time-stamp: <14 Mar 19 12:41:16 flechsig>
/*
* NDPluginXGI.cpp
*
......@@ -52,7 +52,9 @@ static const char *driverName="NDPluginXGI";
#define XGIPluginCenterString "XGI_CENTER" /* (asynInt32, r/w) FFT filter center */
#define XGIPluginWidthString "XGI_WIDTH" /* (asynInt32, r/w) FFT filter width */
#define XGIPluginLogscaleString "XGI_LOGSCALE" /* (asynInt32, r/w) logscale */
#define XGIPluginOutPhaseString "XGI_OUTPHASE" /* (asynInt32, r/w) phase output */
#define XGIPluginOutputsString "XGI_OUTPUTS" /* (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 {
......@@ -101,10 +103,13 @@ private:
int XGIPluginCenter;
int XGIPluginWidth;
int XGIPluginLogscale;
int XGIPluginOutPhase;
int XGIPluginOutputs;
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))
......@@ -131,7 +136,7 @@ void NDPluginXGI::processCallbacks(NDArray *pArray)
/* only 2d image of double data type is accepted */
if (pArray->dataType != NDFloat64 || pArray->ndims != 2) {
asynPrint(pasynUserSelf, ASYN_TRACE_ERROR,
"%s:%s: Only 2d images of double data type are accepted\n",
"%s:%s: Only 2d images of double data type are accepted - return\n",
driverName, functionName);
return;
}
......@@ -163,7 +168,8 @@ void NDPluginXGI::processCallbacks(NDArray *pArray)
getIntegerParam(XGIPluginCenter, &this->XGIconfig.center);
getIntegerParam(XGIPluginWidth, &this->XGIconfig.width);
getIntegerParam(XGIPluginLogscale, &this->XGIconfig.logscale);
getIntegerParam(XGIPluginOutPhase, &this->XGIconfig.outphase);
getIntegerParam(XGIPluginOutputs, &this->XGIconfig.outputs);
getIntegerParam(XGIPluginAverages, &this->XGIconfig.averages);
/* Release the lock; this is computationally intensive and does not access any shared data */
this->unlock();
......@@ -212,18 +218,21 @@ void NDPluginXGI::processCallbacks(NDArray *pArray)
// waveform_advanced();
break;
case 2:
#ifdef DEBUG
printf("Algorithm == %d --> call evaluf()\n", algorithm);
#endif
this->XGIconfig.direction= COLDIR;
evaluf(&image, &this->XGIconfig, &output);
break;
printf("Algorithm == %d not yet implemented\n", algorithm);
break;
case 3:
#ifdef DEBUG
printf("Algorithm == %d --> call evalfft2d()\n", algorithm);
#endif
evalfft2d(&image, &this->XGIconfig, &output);
break;
case 4:
#ifdef DEBUG
printf("Algorithm == %d --> call evaluf()\n", algorithm);
#endif
this->XGIconfig.direction= COLDIR;
evaluf(&image, &this->XGIconfig, &output);
break;
case 5:
#ifdef DEBUG
printf("Algorithm == %d --> call evaluf()\n", algorithm);
......@@ -233,10 +242,10 @@ void NDPluginXGI::processCallbacks(NDArray *pArray)
break;
case 6:
#ifdef DEBUG
printf("Algorithm == %d --> call evalfft_ifft_2d()\n", algorithm);
printf("Algorithm == %d --> call evalfft_ifft_2d()\n", algorithm);
#endif
evalfft_ifft_2d(&image, &this->XGIconfig, &output);
break;
evalfft_ifft_2d(&image, &this->XGIconfig, &output);
break;
case 7:
#ifdef DEBUG
printf("Algorithm == %d --> call evaluf()\n", algorithm);
......@@ -276,22 +285,19 @@ void NDPluginXGI::processCallbacks(NDArray *pArray)
if (arrayCallbacks) {
for (int i = 0; i < XGI_MAX_OUTPUT; i++) {
Matrix *m = NULL;
switch (i) {
/* Profile */
case 0: m = &(output.hp); break;
/* Amplitude */
case 1: m = &(output.amp); break;
/* Wrapped Phase */
case 2: m = &(output.dphi_wrap); break;
/* Unwrapped Phase */
case 3: m = &(output.dphi_unwrap); break;
default: continue;
}
switch (i) // set pointer
{
case 0: m = &(output.hp); break; // Profile
case 1: m = &(output.amp); break; // Amplitude
case 2: m = &(output.dphi_wrap); break; // Wrapped Phase
case 3: m = &(output.dphi_unwrap); break; // Unwrapped Phase
default: continue;
}
if (this->pArrays[i]) this->pArrays[i]->release();
this->pArrays[i] = matrixToNDArray(m);
if (this->pArrays[i] == NULL)
continue;
this->pArrays[i] = matrixToNDArray(m); // fills data from pointer into field
if (this->pArrays[i] == NULL) continue;
/* Copy time stamp and uniqueId from input array */
this->pArrays[i]->uniqueId = pArray->uniqueId;
this->pArrays[i]->timeStamp = pArray->timeStamp;
......@@ -307,11 +313,12 @@ 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);
callParamCallbacks();
}
} // end processCallbacks