Alexander replied to the topic 'Driver OnStep (LX200 like) for INDI' in the forum. 1 year ago

Hi,

I had a deeper look into the problem of multiple focusers and stumbled upon some things I wanted to clarify before I continue.

One problem I see, when using FocuserInterface is, that it is impossible to inherit it multiple times. Because of that, it is necessary to have multiple BaseDevices which implement the FocuserInterface. I assume it would be better to use the INDI::Focuser class as a base for the Onstep Focuser. I also saw that approach in the focuslynx driver .
Unfortunately, this only works flawlessly for statically created drivers. Unfortunately, the diver tabs do not get updated when I create a new Focuser dynamically. It requires a reconnect to the indiserver within Ekos. But maybe I am still missing something.
You can see this in my basic implementation .
Furthermore the dependency on Lx200Generic restricts the implementation of a shared lx200 parser class. That's why the onstep_focuser needs access to the file descriptor PortFD and implements its own lx200 parser.
I attached a drawing to illustrate the new class hierarchy. (File: "Blank diagram Focuser Update.png")

This is quite a hacky approach and will result in some duplicated code. As I can see that there is a discussion about restructuring the driver I also made a drawing of a in my opinion better approach. (File: "Blank diagram New Structure.png") But this would mean dropping the dependency on lx200generic and writing some onstep protocol parser, that can be shared between drivers.
As a bonus, it would be also possible to make just a bare rotator driver.

Questions:

1. how to trigger a driver reload for dynamically created based devices in the indiserver and Ekos?
2. is it possible to drop the dependency on Lx200generic?
3. are there problems with concurrency when reading and writing to PortFD unprotected?
4. what do you think about the hacky approach and a complete restructuring of the driver?

regards Alex

Read More...