Skip to content

ContextTask.Reset() should call oni.Context.Refresh() instead of deleting and reopening context #407

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

Closed
aacuevas opened this issue Feb 6, 2025 · 1 comment · Fixed by #409
Assignees
Milestone

Comments

@aacuevas
Copy link
Collaborator

aacuevas commented Feb 6, 2025

During the initialization process, we are resetting the context multiple times to refresh the device table when conditions change (e.g.: after powering a headstage or setting passthrough mode).

At the moment ContextTask.Reset() disposes the entire oni.Context and creates a new one. This seem inefficient. The reset should instead call oni.Context.Refresh(), which issues the soft-reset command and repopulates the device table without closing the context or hardware connection itself.

This is required if we add a hardware safety that truly resets the hardware to POR conditions after the connection is closed, as suggested on #406 .

@glopesdev can you think, top of your head, of any possible downside that I might not be seeing?

@jonnew
Copy link
Member

jonnew commented Feb 10, 2025

As per our discussion today, I can give this a try to see if it has a positive effect. Hopefully for #406 as well.

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 a pull request may close this issue.

2 participants