Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add end count to send periodic in BCM #995

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

zorce
Copy link
Contributor

@zorce zorce commented Mar 24, 2021

Add possibility to send periodic messages with a stop count as a criteria to facilitate one of sequences.

Closes #992

@mergify mergify bot requested a review from hardbyte March 24, 2021 11:08
@codecov
Copy link

codecov bot commented Mar 24, 2021

Codecov Report

Merging #995 (f1dbfef) into develop (63c60af) will decrease coverage by 0.92%.
The diff coverage is 87.50%.

@@             Coverage Diff             @@
##           develop     #995      +/-   ##
===========================================
- Coverage    70.38%   69.45%   -0.93%     
===========================================
  Files           70       76       +6     
  Lines         6841     7403     +562     
===========================================
+ Hits          4815     5142     +327     
- Misses        2026     2261     +235     

Copy link
Owner

@hardbyte hardbyte left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It would be good to connect the socketcan CyclicSendTask too if you're up for it?

A new test in simplecyclic_test.py would be appreciated too

@@ -104,6 +104,7 @@ def __init__(
messages: Union[Sequence[Message], Message],
period: float,
duration: Optional[float],
count: Optional[int],
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
count: Optional[int],
count: Optional[int] = None,

self.bus = bus
self.send_lock = lock
self.stopped = True
self.thread = None
self.end_time = time.perf_counter() + duration if duration else None
self.end_count = count if count else None
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
self.end_count = count if count else None
self.end_count = count

@zorce
Copy link
Contributor Author

zorce commented Mar 25, 2021

Sure will modify your suggestions and try to add a test aswell.
And also see if I could add it for socketcan interface.

@felixdivo
Copy link
Collaborator

@zorce You can also just click on "Commit Suggestion" right from the GUI to apply the changes by hardbyte.

@felixdivo
Copy link
Collaborator

@zorce Some conflicts have popped up by now.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

send periodic a list of messages without wrapping
3 participants