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

Added Sequencer trigger logic from ScanSpec #565

Open
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

tomtrafford
Copy link
Contributor

These changes implements a Panda Trigger Logic Flyer, setting up a PandA Seq table and resolves #448. On Prepare it takes a Spec[motor.Motor], which would describe the trajectory of the scan, and uses this to calculate the gaps in the scan. Between each gap it will setup a new set of rows in the sequencer table.

  1. Waiting for BitA to go to 0
  2. Waiting for BitA to go to 1
  3. Waiting for PosA to reach its position.
  4. A repeated (by the number of points until the next gap) line with the trigger timings.

@@ -61,6 +61,7 @@ dev = [
"pytest-rerunfailures",
"pytest-timeout",
"ruff",
"scanspec==0.7.2",
Copy link
Collaborator

Choose a reason for hiding this comment

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

Suggested change
"scanspec==0.7.2",
"scanspec>=0.7.2",

Comment on lines 82 to 83
if type(rows[0]) is tuple:
rows = rows[0]
Copy link
Collaborator

Choose a reason for hiding this comment

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

Why did you need this?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I had been meaning to ask you about this. I found some odd behaviour with the seq_table_from_rows() method - perhaps I'm not quite using it right.

seq_table_from_rows(SeqTableRow(), SeqTableRow())

The above works as expected but the below raises an error:

rows = (SeqTableRow(), SeqTableRow())
seq_table_from_rows(rows)

AttributeError: 'tuple' object has no attribute 'repeats'

When I looked into it I found that inside the method, rows gets turned into ((SeqTableRow(), SeqTableRow()),) - A tuple within a tuple. So my workaround was to check if the first element in rows was a tuple, and to use that instead.

WatchableAsyncStatus,
wait_for_value,
)
from ophyd_async.epics import motor
Copy link
Collaborator

Choose a reason for hiding this comment

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

We shouldn't import epics from fastcs. Can we use INENC1.VAL.Scale from PandA instead?

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

Successfully merging this pull request may close these issues.

Create a PandA flyer that uses a SEQ table to do time based triggers within a position based gate
2 participants