Closed conorhughmcfadden closed 1 month ago
I found a bug...
In the proposed feature list using multiposition above, the stage will not go back to the first position after the first iteration. It just repeatedly stacks the last position.
I'll investigate why and report back.
Attention: Patch coverage is 9.09091%
with 30 lines
in your changes missing coverage. Please review.
Project coverage is 53.08%. Comparing base (
4b37039
) to head (cc2e20c
).
Files | Patch % | Lines |
---|---|---|
src/navigate/model/devices/daq/ni.py | 0.00% | 18 Missing :warning: |
src/navigate/model/features/common_features.py | 20.00% | 12 Missing :warning: |
:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.
I found a bug...
In the proposed feature list using multiposition above, the stage will not go back to the first position after the first iteration. It just repeatedly stacks the last position.
I'll investigate why and report back.
I found the issue! There appears to have been a bug in MoveToNextPositionInMultiPositionTable. At least when I ran this feature list without my new triggering block, just a normal loop, I got the same issue:
[({"name": PrepareNextChannel, },({"name": MoveToNextPositionInMultiPositionTable, },{"name": ZStackAcquisition, "args": (False,False,"z-stack",),},{"name": WaitToContinue, },{"name": LoopByCount, "args": ("experiment.MicroscopeState.multiposition_count",),},),{"name": LoopByCount, "args": (3,),},),]
It turns out current_idx needs to be reset in the signal_func in order for it to work with LoopByCount. Making this bug fix allows it to return to the original position using a nested loop. I tested it with my WaitForExternalTrigger and it works properly now!
This is a great addition. Before we merge, I think it would be a good idea to have the calls to the data acquisition card go through the device abstraction layer. This way, should we add additional ways to receive external signals (e.g., Tiger Controller, TriggerScope), it will be more modular.
Put this feature in your feature list to wait for an external digital trigger before moving on to the next block.
Example feature list which worked:
[{"name": PrepareNextChannel,},({"name": WaitForExternalTrigger,"args": ("/PCIe-6738/PFI4",-1,),},({"name": MoveToNextPositionInMultiPositionTable,},{"name": ZStackAcquisition,"args": (True,True,),},{"name": WaitToContinue,},{"name": LoopByCount,"args": ("experiment.MicroscopeState.multiposition_count",),},),{"name": LoopByCount,"args": (5,),},),]
Option to set a timeout to break the loop if no trigger is incoming.
Tested with a function generator hooked up to PFI4 and it seemed to work well.