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

PrawnBlaster runviewer parser drops first instruction after a wait with timeout #109

Open
dihm opened this issue Dec 20, 2023 · 0 comments
Labels
bug Something isn't working

Comments

@dihm
Copy link
Contributor

dihm commented Dec 20, 2023

Issue is in this if-elif-else block

for row in pulse_program:
if row["reps"] == 0 and not last_instruction_was_wait: # WAIT
last_instruction_was_wait = True
if clock is not None:
t = clock_ticks[trigger_index] + self.trigger_delay
trigger_index += 1
else:
t += self.wait_delay
elif last_instruction_was_wait:
# two waits in a row means an indefinite wait, so we just skip this
# instruction.
last_instruction_was_wait = False
continue
else:
last_instruction_was_wait = False
for i in range(row["reps"]):
for j in range(1, -1, -1):
time.append(t)
states.append(j)
t += row["half_period"] * clock_factor

The elif block always triggers on the next instruction after a wait, even if the current instruction is not also a wait (the proper indication of an indefinite wait).

Pretty sure the elif check should be elif row["reps"] == 0 and last_instruction_was_wait:

@dihm dihm added the bug Something isn't working label Dec 20, 2023
@dihm dihm changed the title PrawnBlaster runviewer drops first instruction after a wait with timeout PrawnBlaster runviewer parser drops first instruction after a wait with timeout Dec 21, 2023
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

No branches or pull requests

1 participant