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

QRM stations have near-zero delay times between transmissions #320

Closed
3 tasks
w7sst opened this issue Jun 9, 2024 · 0 comments · Fixed by #321
Closed
3 tasks

QRM stations have near-zero delay times between transmissions #320

w7sst opened this issue Jun 9, 2024 · 0 comments · Fixed by #321
Assignees
Labels
bug Something isn't working

Comments

@w7sst
Copy link
Owner

w7sst commented Jun 9, 2024

Description

During code review and while working on #319, I noticed that when a QrmStation is created, the call to RndGaussLim() function result in an extremely short time (near zero) time duration. The call is attempting to create a timeout delay in the range of 2 to 6 seconds, but the result is ~0.

Details

The current code for computing the Timeout for the subsequent transmission is:

  Timeout := Round(RndGaussLim(SecondsToBlocks(4), 2));

The problem is that the second argument value, 2, is in units of seconds, not in units of blocks. The first and second arguments must be in the same units. There are ~21.5 blocks/second. Substituting blocks for seconds, we have RndGaussLim(86, 2). This will clip the result to +/-2 blocks, or +/- 0.09 seconds, which is not anywhere near to desired 2 to 6 second timeout value.

The code should be (after converting the second argument from seconds to blocks:

  Timeout := Round(RndGaussLim(SecondsToBlocks(4), SecondsToBlocks(2)));

This results in:

  Timeout := Round(RndGaussLim(86, 43);   // blocks/second

This results in a timeout delay between 2 to 6 seconds.

Steps To Reproduce

This is hard to reproduce at runtime since QrmStation's are infrequently created. When they are created, their transmission times will appear to have a non-existent time delay between transmissions.

Expected behavior

There should be a 2 to 6 second delay between transmissions from the same QRM Station.

Actual Behavior

The transmissions appear almost immediately and there is no delay between transmissions.

Version information

  • Morse Runner version: 1.84 and prior
  • OS/Version: Windows 11

Tasks

  • Coding
  • Code Review and Integration
  • Validation?
@w7sst w7sst added the bug Something isn't working label Jun 9, 2024
@w7sst w7sst added this to the v1.85 - next release milestone Jun 9, 2024
w7sst added a commit that referenced this issue Jun 9, 2024
- Previous code was creating QRM stations with ~0.1 second timeout.
- This timeout is the time between transmissions.
- timeout delay is now 2 to 6 seconds using a limited gaussian distribution
@w7sst w7sst linked a pull request Jun 9, 2024 that will close this issue
@w7sst w7sst self-assigned this Jun 9, 2024
@w7sst w7sst closed this as completed in 9a6c10e Jun 14, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant