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

Move more functionality into the ADDriver base class #251

Open
MarkRivers opened this issue Feb 26, 2017 · 1 comment
Open

Move more functionality into the ADDriver base class #251

MarkRivers opened this issue Feb 26, 2017 · 1 comment
Assignees
Milestone

Comments

@MarkRivers
Copy link
Member

The ADDriver base class currently mostly just provides parameter definitions but very few methods. This means that derived driver classes all need to implement writeInt32 and writeFloat64 to handle all parameters like ADAcquire, ADExposureTime, etc.

The base class could detect many of these parameters and call methods in the derived classes, for example new methods like AcquireStart(), AcquireStop, setExposureTime(), etc. This would simplify derived classes and make their implementation more uniform.

It would need to be done in a backwards compatible manner so that existing drivers that do not implement these methods continue to work.

One method that would be very useful would be for handling NDArray callbacks where all drivers currently need to do:
- setUniqueID()
- setTimeStamp()
- setAttributes()
- callPlugins()
A method that does all 4 of the above steps, plus more in the future would be very useful.

@MarkRivers MarkRivers added this to the Release 3-0 milestone Feb 26, 2017
@MarkRivers MarkRivers self-assigned this Feb 26, 2017
@ulrikpedersen
Copy link
Member

I've been thinking about this as well. In order to provide a new and simpler interface to write new drivers/plugins against - but without breaking all existing drivers, we could consider an Adaptor pattern. See for instance section 3.4.2: http://www.apibook.com/Chapter_3.pdf

That way we can retain the old interface and provide a new one. Over time we can then move drivers to the new interface and eventually retire the current one.

@MarkRivers MarkRivers modified the milestones: R4-0, Release 3-0 Apr 28, 2017
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

2 participants