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

Improve Svc/CmdSequencer alignment #484

Open
timcanham opened this issue Apr 19, 2021 · 1 comment
Open

Improve Svc/CmdSequencer alignment #484

timcanham opened this issue Apr 19, 2021 · 1 comment

Comments

@timcanham
Copy link
Collaborator

timcanham commented Apr 19, 2021

F´ Version 1.5.3
Affected Component Svc/CmdSequencer

Feature Description

Revisit time alignment on relative commands.

Rationale

A R00:00:0X typically delays X+1 seconds if the sequencer is called at 1Hz, so the R is not accurate.

@matt392code
Copy link
Contributor

cmdseq-fix.txt
Propsed fix for the CmdSequencer timing alignment issue.
Here are the key changes:

  1. Added microsecond-level compensation:
    • Convert timing to microseconds for precise adjustment
    • Subtract one second (1,000,000 microseconds) to compensate for the 1Hz execution offset
    • Only apply compensation when there's enough time margin (>= 1 second)
  2. Enhanced execution precision:
    • Added a precision threshold (100 microseconds) for timing comparisons
    • Improved time comparison logic in isExecuteTime()
    • Separate handling for seconds and microseconds components
  3. Maintained original functionality:
    • Preserved command serialization and execution logic
    • Kept activity logging and sequence state management
    • Retained time source and sequence validation checks
      The fix adjusts the relative time calculation to account for the 1Hz execution rate while ensuring we don't introduce negative timing when dealing with very short delays. This should make the R00:00:0X notation behave as expected, delaying exactly X seconds rather than X+1.

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

No branches or pull requests

3 participants