Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
N
NQontrol
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Wiki
Requirements
Automate
Agent sessions
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Deploy
Releases
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
This project is archived. Its data is
read-only
.
Show more breadcrumbs
las-nq
NQontrol
Commits
b0b76c41
Commit
b0b76c41
authored
Jan 7, 2019
by
lab 29
Browse files
Options
Downloads
Patches
Plain Diff
change update interval for feedback server
parent
36444247
No related branches found
No related tags found
No related merge requests found
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/adwin_control/servo.py
+5
-4
5 additions, 4 deletions
src/adwin_control/servo.py
with
5 additions
and
4 deletions
src/adwin_control/servo.py
+
5
−
4
View file @
b0b76c41
...
...
@@ -1057,8 +1057,8 @@ class Servo:
########################################
# Temperature feedback
########################################
def
tempFeedbackStart
(
self
,
dT
,
mtd
,
voltage_limit
=
5
,
server
=
settings
.
DEFAULT_TEMP_HOST
,
port
=
settings
.
DEFAULT_TEMP_PORT
):
self
.
_tempFeedback
=
FeedbackController
(
self
,
dT
,
mtd
,
voltage_limit
,
server
,
port
)
def
tempFeedbackStart
(
self
,
dT
,
mtd
,
voltage_limit
=
5
,
server
=
settings
.
DEFAULT_TEMP_HOST
,
port
=
settings
.
DEFAULT_TEMP_PORT
,
update_interval
=
1
):
self
.
_tempFeedback
=
FeedbackController
(
self
,
dT
,
mtd
,
voltage_limit
,
server
,
port
,
update_interval
)
self
.
_tempFeedback
.
start
()
def
tempFeedbackStop
(
self
):
...
...
@@ -1157,7 +1157,7 @@ class Servo:
class
FeedbackController
(
Thread
):
def
__init__
(
self
,
servo
,
dT
,
mtd
,
voltage_limit
,
server
,
port
):
def
__init__
(
self
,
servo
,
dT
,
mtd
,
voltage_limit
,
server
,
port
,
update_interval
=
1
):
if
not
isinstance
(
mtd
,
tuple
):
raise
ValueError
(
'
The parameter mtd must be a tuple with port and mtd number.
'
)
...
...
@@ -1170,6 +1170,7 @@ class FeedbackController(Thread):
self
.
_voltage_limit
=
voltage_limit
self
.
enabled
=
True
self
.
last_answer
=
''
self
.
_update_interval
=
update_interval
def
_send
(
self
,
feedback
):
socket
=
create_connection
(
f
'
ws://
{
self
.
_server
}
:
{
self
.
_port
}
'
)
...
...
@@ -1200,4 +1201,4 @@ class FeedbackController(Thread):
log
.
info
(
answer
)
else
:
log
.
warning
(
answer
)
sleep
(
1
)
sleep
(
self
.
_update_interval
)
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
sign in
to comment