Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
B
Beam Positoning Monitor - Software
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
Wiki
Wiki
image/svg+xml
Discourse
Discourse
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
Projects
Beam Positoning Monitor - Software
Commits
c3d15068
Commit
c3d15068
authored
Feb 10, 2015
by
Lucas Russo
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
examples/plot_data.sh: add bpm/board selection
parent
28f6ce4c
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
33 additions
and
15 deletions
+33
-15
dsp_swap.c
examples/dsp_swap.c
+11
-2
plot_data.sh
examples/plot_data.sh
+22
-13
No files found.
examples/dsp_swap.c
View file @
c3d15068
...
...
@@ -62,9 +62,18 @@ int main (int argc, char *argv [])
bpm_client_t
*
bpm_client
=
bpm_client_new
(
broker_endp
,
verbose
,
NULL
);
uint32_t
trig_dir
=
0
;
fprintf
(
stdout
,
"[client:dsp]: trig_dir = %u
\n
"
,
trig_dir
);
bpm_client_err_e
err
=
bpm_set_trig_dir
(
bpm_client
,
"BPM0:DEVIO:FMC130M_4CH0"
,
trig_dir
);
if
(
err
!=
BPM_CLIENT_SUCCESS
){
fprintf
(
stderr
,
"[client:dsp]: bpm_set_trig_dir failed
\n
"
);
goto
err_bpm_set
;
}
fprintf
(
stdout
,
"[client:dsp]: bpm_set_trig_dir was successfully executed
\n
"
);
uint32_t
kx_set
=
10000000
;
fprintf
(
stdout
,
"[client:dsp]: kx = %u
\n
"
,
kx_set
);
bpm_client_err_e
err
=
bpm_set_kx
(
bpm_client
,
"BPM0:DEVIO:DSP0"
,
kx_set
);
err
=
bpm_set_kx
(
bpm_client
,
"BPM0:DEVIO:DSP0"
,
kx_set
);
if
(
err
!=
BPM_CLIENT_SUCCESS
){
fprintf
(
stderr
,
"[client:dsp]: bpm_set_kx failed
\n
"
);
goto
err_bpm_set
;
...
...
@@ -134,7 +143,7 @@ int main (int argc, char *argv [])
fprintf
(
stdout
,
"[client:swap]: bpm_set_sw = %u was successfully executed
\n
"
,
sw
);
uint32_t
sw_en
=
0
;
uint32_t
sw_en
=
1
;
err
=
bpm_set_sw_en
(
bpm_client
,
"BPM0:DEVIO:SWAP0"
,
sw_en
);
if
(
err
!=
BPM_CLIENT_SUCCESS
){
fprintf
(
stderr
,
"[client:swap]: bpm_set_sw_en failed
\n
"
);
...
...
examples/plot_data.sh
View file @
c3d15068
#!/bin/bash
EXPECTED_ARGS
=
4
EXPECTED_ARGS
=
5
DATAPLOT_FILE
=
".feedgnuplot_data"
DFLT_SLEEP_INTERV
=
2
# in seconds
if
[
$#
-
ne
$EXPECTED_ARGS
]
if
[
$#
-
lt
$EXPECTED_ARGS
]
then
echo
"Usage:
`
basename
$0
`
{broker endpoint} {number of samples} {channel number} {b
pm number}
"
echo
"Usage:
`
basename
$0
`
{broker endpoint} {number of samples} {channel number} {b
oard number} {bpm number} [sleep interval]
"
exit
1
;
fi
broker_endp
=
$1
nsamples
=
$2
ch_number
=
$3
bpm_number
=
$4
board_number
=
$4
bpm_number
=
$5
DATAPLOT_FILE
=
".feedgnuplot_data"
if
[
-z
"
$6
"
]
then
sleep_interval
=
$DFLT_SLEEP_INTERV
else
sleep_interval
=
$6
fi
acquire_samples
()
{
if
[
$#
-
ne
4
]
if
[
$#
-
lt
5
]
then
echo
"acquire_samples usage: {broker endpoint} {number of samples} {channel number} {b
pm number}
"
echo
"acquire_samples usage: {broker endpoint} {number of samples} {channel number} {b
oard number} {bpm number} [sleep_interval]
"
exit
1
;
fi
while
:
do
./acq
-b
$1
-s
$2
-ch
$3
-b
pm
$4
>
${
DATAPLOT_FILE
}
.
$4
sleep
2
./acq
-b
$1
-s
$2
-ch
$3
-b
oard
$4
-bpm
$5
>
${
DATAPLOT_FILE
}
.
$4
.
$5
sleep
$6
done
}
plot_data
()
{
tail
-n
$1
-f
${
DATAPLOT_FILE
}
.
$2
|
tail
-n
$1
-f
${
DATAPLOT_FILE
}
.
$2
.
$3
2> /dev/null
|
feedgnuplot
--lines
\
--stream
\
--stream
$4
\
--domain
\
--title
'Data'
\
--ylabel
'Counts [arb. units]'
\
...
...
@@ -43,7 +51,8 @@ plot_data () {
--legend
3
'D'
}
acquire_samples
$broker_endp
$nsamples
$ch_number
$bpm_number
&
acquire_samples
$broker_endp
$nsamples
$ch_number
$board_number
$bpm_number
$sleep_interval
&
sleep
2
plot_data
$nsamples
$b
pm_number
plot_data
$nsamples
$b
oard_number
$bpm_number
$sleep_interval
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