Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
S
sdptr
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Wiki
Requirements
Jira
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Container registry
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
LOFAR2.0
sdptr
Commits
f203d3fd
Commit
f203d3fd
authored
3 years ago
by
Eric Kooistra
Browse files
Options
Downloads
Plain Diff
Merge branch '
L2SDP-474
' into 'master'
Resolve
L2SDP-474
Closes
L2SDP-474
See merge request
!55
parents
93daba95
b7fab30a
Branches
Branches containing commit
No related tags found
1 merge request
!55
Resolve L2SDP-474
Pipeline
#26736
failed
3 years ago
Stage: run-opc-ua-test
Changes
2
Pipelines
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
src/constants.h
+3
-1
3 additions, 1 deletion
src/constants.h
test/py/control/wg.py
+6
-5
6 additions, 5 deletions
test/py/control/wg.py
with
9 additions
and
6 deletions
src/constants.h
+
3
−
1
View file @
f203d3fd
...
@@ -29,6 +29,8 @@
...
@@ -29,6 +29,8 @@
#ifndef CONSTANTS_H
#ifndef CONSTANTS_H
#define CONSTANTS_H
#define CONSTANTS_H
#define PI 3.141592653589793
#define FPGAS_PER_BOARD 4
#define FPGAS_PER_BOARD 4
#define C_S_pn 12
#define C_S_pn 12
...
@@ -39,7 +41,7 @@
...
@@ -39,7 +41,7 @@
#define C_WG_MODE_OFF 0
#define C_WG_MODE_OFF 0
#define C_WG_MODE_CALC 1
#define C_WG_MODE_CALC 1
#define C_WG_AMPL_UNIT 65536 // 2^16
#define C_WG_AMPL_UNIT 65536 // 2^16
#define C_WG_PHASE_UNIT (65536.0 /
360.0
) // 2^16 /
360
#define C_WG_PHASE_UNIT (65536.0 /
(2 * PI)
) // 2^16 /
2*pi
#define C_WG_FREQ_UNIT 2147483648 // 2^31
#define C_WG_FREQ_UNIT 2147483648 // 2^31
#define C_BSN_LATENCY 20000 // 1 period = 5.12us, 20000 = +/- 100ms
#define C_BSN_LATENCY 20000 // 1 period = 5.12us, 20000 = +/- 100ms
...
...
This diff is collapsed.
Click to expand it.
test/py/control/wg.py
+
6
−
5
View file @
f203d3fd
...
@@ -36,6 +36,7 @@ import traceback
...
@@ -36,6 +36,7 @@ import traceback
import
argparse
import
argparse
import
time
import
time
import
pprint
import
pprint
import
math
from
base
import
*
from
base
import
*
...
@@ -64,10 +65,10 @@ class WaveformGenerator(object):
...
@@ -64,10 +65,10 @@ class WaveformGenerator(object):
return
self
.
_ampl
return
self
.
_ampl
def
set_phase
(
self
,
value
,
mode
=
None
):
def
set_phase
(
self
,
value
,
mode
=
None
):
phase
=
value
phase
=
value
/
(
360
/
(
2
*
math
.
pi
))
mode
=
'
sinus
'
if
mode
is
None
else
mode
.
lower
()
mode
=
'
sinus
'
if
mode
is
None
else
mode
.
lower
()
if
mode
==
'
xst
'
:
if
mode
==
'
xst
'
:
self
.
client
.
write
(
'
wg_phase
'
,
([
i
*
(
360
/
self
.
S_PN
)
for
i
in
range
(
self
.
S_PN
)]
*
self
.
n_nodes
))
self
.
client
.
write
(
'
wg_phase
'
,
([
i
*
(
(
2
*
math
.
pi
)
/
self
.
S_PN
)
for
i
in
range
(
self
.
S_PN
)]
*
self
.
n_nodes
))
else
:
else
:
# must be for sinus
# must be for sinus
self
.
client
.
write
(
'
wg_phase
'
,
([
phase
]
*
self
.
S_PN
*
self
.
n_nodes
))
self
.
client
.
write
(
'
wg_phase
'
,
([
phase
]
*
self
.
S_PN
*
self
.
n_nodes
))
...
@@ -75,7 +76,7 @@ class WaveformGenerator(object):
...
@@ -75,7 +76,7 @@ class WaveformGenerator(object):
def
get_phase
(
self
):
def
get_phase
(
self
):
self
.
_phase
=
self
.
client
.
read
(
'
wg_phase
'
)
self
.
_phase
=
self
.
client
.
read
(
'
wg_phase
'
)
return
self
.
_phase
return
[
i
*
(
360
/
(
2
*
math
.
pi
))
for
i
in
self
.
_phase
]
def
set_freq
(
self
,
value
,
mode
=
None
):
def
set_freq
(
self
,
value
,
mode
=
None
):
freq
=
value
freq
=
value
...
@@ -160,10 +161,10 @@ if __name__ == "__main__":
...
@@ -160,10 +161,10 @@ if __name__ == "__main__":
parser
.
add_argument
(
'
--mode
'
,
type
=
str
,
choices
=
[
'
xst
'
,
'
sinus
'
],
help
=
"
select wg mode
"
)
parser
.
add_argument
(
'
--mode
'
,
type
=
str
,
choices
=
[
'
xst
'
,
'
sinus
'
],
help
=
"
select wg mode
"
)
parser
.
add_argument
(
'
--setfreq
'
,
type
=
float
,
help
=
"
set wg freq
"
)
parser
.
add_argument
(
'
--setfreq
'
,
type
=
float
,
help
=
"
set wg freq
"
)
parser
.
add_argument
(
'
--setampl
'
,
type
=
float
,
help
=
"
set wg ampl
"
)
parser
.
add_argument
(
'
--setampl
'
,
type
=
float
,
help
=
"
set wg ampl
"
)
parser
.
add_argument
(
'
--setphase
'
,
type
=
float
,
help
=
"
set wg phase
"
)
parser
.
add_argument
(
'
--setphase
'
,
type
=
float
,
help
=
"
set wg phase
in degrees
"
)
parser
.
add_argument
(
'
--getfreq
'
,
action
=
'
store_true
'
,
help
=
"
get wg freq
"
)
parser
.
add_argument
(
'
--getfreq
'
,
action
=
'
store_true
'
,
help
=
"
get wg freq
"
)
parser
.
add_argument
(
'
--getampl
'
,
action
=
'
store_true
'
,
help
=
"
get wg ampl
"
)
parser
.
add_argument
(
'
--getampl
'
,
action
=
'
store_true
'
,
help
=
"
get wg ampl
"
)
parser
.
add_argument
(
'
--getphase
'
,
action
=
'
store_true
'
,
help
=
"
get wg phase
"
)
parser
.
add_argument
(
'
--getphase
'
,
action
=
'
store_true
'
,
help
=
"
get wg phase
in degrees
"
)
parser
.
add_argument
(
'
--enable
'
,
action
=
'
store_true
'
,
help
=
"
turn on wg signal
"
)
parser
.
add_argument
(
'
--enable
'
,
action
=
'
store_true
'
,
help
=
"
turn on wg signal
"
)
parser
.
add_argument
(
'
--disable
'
,
action
=
'
store_true
'
,
help
=
"
turn off wg signal
"
)
parser
.
add_argument
(
'
--disable
'
,
action
=
'
store_true
'
,
help
=
"
turn off wg signal
"
)
parser
.
add_argument
(
'
--toggle
'
,
action
=
'
store_true
'
,
help
=
"
turn the wg signal off and on again
"
)
parser
.
add_argument
(
'
--toggle
'
,
action
=
'
store_true
'
,
help
=
"
turn the wg signal off and on again
"
)
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment