Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Open sidebar
optics
WFI
Commits
bc6d6bc0
Commit
bc6d6bc0
authored
Feb 20, 2019
by
flechsig
Browse files
add variable averages
parent
1b1cb283
Changes
6
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
282 additions
and
226 deletions
+282
-226
Db/NDXGI.template
Db/NDXGI.template
+18
-0
Db/NDXGI_settings.req
Db/NDXGI_settings.req
+1
-0
op/adl/NDPluginXGI_extension.adl
op/adl/NDPluginXGI_extension.adl
+254
-223
src/NDPluginXGI.cpp
src/NDPluginXGI.cpp
+5
-1
src/algorithms.cpp
src/algorithms.cpp
+2
-1
src/algorithms.h
src/algorithms.h
+2
-1
No files found.
Db/NDXGI.template
View file @
bc6d6bc0
...
...
@@ -379,6 +379,24 @@ 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
(
bo,
"
$(
P
)$(
R
)
Logscale"
)
{
field
(
DTYP,
"asynInt32"
)
...
...
Db/NDXGI_settings.req
View file @
bc6d6bc0
...
...
@@ -20,4 +20,5 @@ $(P)$(R)Center
$(
P
)$(
R
)
Width
$(
P
)$(
R
)
Logscale
$(
P
)$(
R
)
OutputPhase
$(
P
)$(
R
)
Averages
file
"NDPluginBase_settings.req"
,
P
=
$(
P
)
,
R
=
$(
R
)
op/adl/NDPluginXGI_extension.adl
View file @
bc6d6bc0
...
...
@@ -8,7 +8,7 @@ display {
x=60
y=235
width=469
height=1
5
9
height=19
1
}
clr=14
bclr=4
...
...
@@ -101,231 +101,262 @@ text {
chan="$(P)$(R)Width"
}
}
composit
e {
rectangl
e {
object {
x=4
y=6
width=459
height=150
}
"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
y=24
width=110
height=20
}
monitor {
chan="$(P)$(R)Minor_RBV"
clr=14
bclr=5
}
limits {
}
}
"text update" {
object {
x=322
y=49
width=110
height=20
}
monitor {
chan="$(P)$(R)OutputPhase_RBV"
clr=14
bclr=5
}
limits {
}
}
"text update" {
object {
x=320
y=74
width=110
height=20
}
monitor {
chan="$(P)$(R)Logscale_RBV"
clr=14
bclr=5
}
limits {
}
}
"text update" {
object {
x=320
y=99
width=110
height=20
}
monitor {
chan="$(P)$(R)Center_RBV"
clr=14
bclr=5
}
limits {
}
}
"text update" {
object {
x=320
y=124
width=110
height=20
}
monitor {
chan="$(P)$(R)Width_RBV"
clr=14
bclr=5
}
limits {
}
}
height=180
}
"basic attribute" {
clr=14
fill="outline"
}
}
text {
object {
x=8
y=24
width=200
height=20
}
"basic attribute" {
clr=14
}
textix="Minor Mode"
}
text {
object {
x=8
y=49
width=200
height=20
}
"basic attribute" {
clr=14
}
textix="OutputPhase"
}
text {
object {
x=8
y=74
width=200
height=20
}
"basic attribute" {
clr=14
}
textix="Logscale"
}
text {
object {
x=8
y=99
width=200
height=20
}
"basic attribute" {
clr=14
}
textix="Center"
}
text {
object {
x=8
y=123
width=200
height=20
}
"basic attribute" {
clr=14
}
textix="Width"
}
menu {
object {
x=213
y=24
width=101
height=20
}
control {
chan="$(P)$(R)Minor"
clr=14
bclr=51
}
}
menu {
object {
x=213
y=49
width=101
height=20
}
control {
chan="$(P)$(R)OutputPhase"
clr=14
bclr=51
}
}
"choice button" {
object {
x=213
y=74
width=101
height=20
}
control {
chan="$(P)$(R)Logscale"
clr=14
bclr=51
}
stacking="column"
}
"text entry" {
object {
x=213
y=99
width=101
height=20
}
control {
chan="$(P)$(R)Center"
clr=14
bclr=51
}
limits {
}
}
"text entry" {
object {
x=213
y=124
width=101
height=20
}
control {
chan="$(P)$(R)Width"
clr=14
bclr=51
}
limits {
}
}
"text update" {
object {
x=318
y=24
width=110
height=20
}
monitor {
chan="$(P)$(R)Minor_RBV"
clr=14
bclr=5
}
limits {
}
}
"text update" {
object {
x=318
y=49
width=110
height=20
}
monitor {
chan="$(P)$(R)OutputPhase_RBV"
clr=14
bclr=5
}
limits {
}
}
"text update" {
object {
x=318
y=74
width=110
height=20
}
monitor {
chan="$(P)$(R)Logscale_RBV"
clr=14
bclr=5
}
limits {
}
}
"text update" {
object {
x=318
y=99
width=110
height=20
}
monitor {
chan="$(P)$(R)Center_RBV"
clr=14
bclr=5
}
limits {
}
}
"text update" {
object {
x=318
y=124
width=110
height=20
}
monitor {
chan="$(P)$(R)Width_RBV"
clr=14
bclr=5
}
limits {
}
}
text {
object {
x=8
y=150
width=200
height=20
}
"basic attribute" {
clr=14
}
textix="Averages"
}
"text entry" {
object {
x=213
y=151
width=101
height=20
}
control {
chan="$(P)$(R)Averages"
clr=14
bclr=51
}
limits {
}
}
"text update" {
object {
x=318
y=151
width=110
height=20
}
monitor {
chan="$(P)$(R)Averages_RBV"
clr=14
bclr=5
}
limits {
}
}
src/NDPluginXGI.cpp
View file @
bc6d6bc0
// Time-stamp: <20 Feb 19 1
4:52:43
flechsig>
// Time-stamp: <20 Feb 19 1
6:28:02
flechsig>
/*
* NDPluginXGI.cpp
*
...
...
@@ -53,6 +53,7 @@ static const char *driverName="NDPluginXGI";
#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 XGIPluginAveragesString "XGI_AVERAGES"
/* (asynInt32, r/w) averages */
/** Base class for XGI analysis plugin. */
class
NDPluginXGI
:
public
NDPluginDriver
{
...
...
@@ -102,6 +103,7 @@ private:
int
XGIPluginWidth
;
int
XGIPluginLogscale
;
int
XGIPluginOutPhase
;
int
XGIPluginAverages
;
// UF end
int
XGIPluginROC
;
#define LAST_NDPLUGIN_XGI_PARAM XGIPluginROC
...
...
@@ -164,6 +166,7 @@ void NDPluginXGI::processCallbacks(NDArray *pArray)
getIntegerParam
(
XGIPluginWidth
,
&
this
->
XGIconfig
.
width
);
getIntegerParam
(
XGIPluginLogscale
,
&
this
->
XGIconfig
.
logscale
);
getIntegerParam
(
XGIPluginOutPhase
,
&
this
->
XGIconfig
.
outphase
);
getIntegerParam
(
XGIPluginAverages
,
&
this
->
XGIconfig
.
averages
);
/* Release the lock; this is computationally intensive and does not access any shared data */
this
->
unlock
();
...
...
@@ -460,6 +463,7 @@ NDPluginXGI::NDPluginXGI(const char *portName, int queueSize, int blockingCallba
createParam
(
XGIPluginWidthString
,
asynParamInt32
,
&
XGIPluginWidth
);
createParam
(
XGIPluginLogscaleString
,
asynParamInt32
,
&
XGIPluginLogscale
);
createParam
(
XGIPluginOutPhaseString
,
asynParamInt32
,
&
XGIPluginOutPhase
);
createParam
(
XGIPluginAveragesString
,
asynParamInt32
,
&
XGIPluginAverages
);
/* Set the plugin type string */
setStringParam
(
NDPluginDriverPluginType
,
driverName
);
...
...
src/algorithms.cpp
View file @
bc6d6bc0
// File : /afs/psi.ch/user/f/flechsig/git/WFI/src/algorithms.cpp
// Date : <11 Feb 19 10:02:46 flechsig>
// Time-stamp: <20 Feb 19 1
2
:32:
0
3 flechsig>
// Time-stamp: <20 Feb 19 1
6
:32:
4
3 flechsig>
// Author : Flechsig Uwe, uwe.flechsig@psi.ch
#include <iostream>
...
...
@@ -963,6 +963,7 @@ void ReadConfig(struct ConfigStruct *cs)
cs
->
mytestdouble
=
2.1
;
cs
->
outphase
=
0
;
cs
->
logscale
=
0
;
cs
->
averages
=
1
;
if
(
!
is_file_exist
(
CONFIGFILENAME
))
{
...
...
src/algorithms.h
View file @
bc6d6bc0
/* File : /afs/psi.ch/user/f/flechsig/git/WFI/src/algorithms.h */
/* Date : <11 Feb 19 10:03:58 flechsig> */
/* Time-stamp: <
13
Feb 19 1
4:12:5
6 flechsig> */
/* Time-stamp: <
20
Feb 19 1
6:33:3
6 flechsig> */
/* Author : Flechsig Uwe, uwe.flechsig@psi.ch */
#ifndef ALGORITMS_H
...
...
@@ -20,6 +20,7 @@
// configuration structure type
// to pass parameters by file
struct
ConfigStruct
{
int
averages
;
int
center
;
int
direction
;
int
logscale
;
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment