Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
T
tango
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Wiki
Requirements
Jira issues
Open 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
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
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
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
LOFAR2.0
tango
Commits
e7ab011e
Commit
e7ab011e
authored
2 years ago
by
Jan David Mol
Browse files
Options
Downloads
Patches
Plain Diff
L2SS-769
: Fix interface to BeamTracker
parent
887269a8
No related branches found
Branches containing commit
No related tags found
Tags containing commit
1 merge request
!317
Resolve L2SS-769 "Implement digital beam"
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
tangostationcontrol/tangostationcontrol/devices/beam_device.py
+7
-5
7 additions, 5 deletions
...stationcontrol/tangostationcontrol/devices/beam_device.py
with
7 additions
and
5 deletions
tangostationcontrol/tangostationcontrol/devices/beam_device.py
+
7
−
5
View file @
e7ab011e
...
@@ -174,7 +174,7 @@ class beam_device(lofar_device):
...
@@ -174,7 +174,7 @@ class beam_device(lofar_device):
self
.
_tracking_enabled_rw
=
True
self
.
_tracking_enabled_rw
=
True
# Create a thread object to update beam weights
# Create a thread object to update beam weights
self
.
Beam_tracker
=
BeamTracker
(
self
.
update_pointing
,
self
.
Fault
)
self
.
Beam_tracker
=
BeamTracker
(
self
.
Beam_tracking_interval
,
self
.
Beam_tracking_preparation_period
,
self
.
update_pointing
,
self
.
Fault
)
@log_exceptions
()
@log_exceptions
()
def
configure_for_on
(
self
):
def
configure_for_on
(
self
):
...
@@ -309,8 +309,10 @@ class BeamTracker():
...
@@ -309,8 +309,10 @@ class BeamTracker():
DISCONNECT_TIMEOUT
=
3.0
DISCONNECT_TIMEOUT
=
3.0
"""
Object that encapsulates a Thread, resposible for beam tracking operations
"""
"""
Object that encapsulates a Thread, resposible for beam tracking operations
"""
def
__init__
(
self
,
update_pointing_callback
,
fault_callback
):
def
__init__
(
self
,
interval
,
preparation_period
,
update_pointing_callback
,
fault_callback
):
self
.
thread
=
None
self
.
thread
=
None
self
.
interval
=
interval
self
.
preparation_period
=
preparation_period
self
.
update_pointing_callback
=
update_pointing_callback
self
.
update_pointing_callback
=
update_pointing_callback
self
.
fault_callback
=
fault_callback
self
.
fault_callback
=
fault_callback
...
@@ -374,13 +376,13 @@ class BeamTracker():
...
@@ -374,13 +376,13 @@ class BeamTracker():
now
=
datetime
.
datetime
.
now
().
timestamp
()
now
=
datetime
.
datetime
.
now
().
timestamp
()
# Computes the left seconds before the next update
# Computes the left seconds before the next update
next_update_in
=
self
.
device
.
Beam_tracking_
interval
-
(
now
%
self
.
device
.
Beam_tracking_
interval
)
next_update_in
=
self
.
interval
-
(
now
%
self
.
interval
)
# Computes the needed sleep time before the next update
# Computes the needed sleep time before the next update
sleep_time
=
next_update_in
-
self
.
device
.
Beam_tracking_
preparation_period
sleep_time
=
next_update_in
-
self
.
preparation_period
# If sleep time is negative, add the tracking interval for the next update
# If sleep time is negative, add the tracking interval for the next update
if
sleep_time
<
0
:
if
sleep_time
<
0
:
return
sleep_time
+
self
.
device
.
Beam_tracking_
interval
return
sleep_time
+
self
.
interval
else
:
else
:
return
sleep_time
return
sleep_time
...
...
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