[RFC] DefaultDevice: Add Generic Nickname support#2343
Conversation
|
@knro @tbowers7 Here is a Request For Comments for indilib/indi-3rdparty#1226 It builds and I've tested the XML parsing in a separate test program, but I have not finished integrating it into Also regarding the XML, I wonder if it is better to have |
|
Great! Yes, if it is similar to ParkData.xml, it's best. I also think this feature should be disabled by default until enabled by the child driver via addNicknameControl or similar. Please let me know once you are able to test if full with the ASI driver as well so we know it works for 3rd party drivers. |
|
@perfinion Were you able to update this and test it thoroughly with ZWO drivers? |
|
Hey, no not completely yet. I had a work trip this week. I'm hoping to finish it up this weekend tho |
9cea646 to
1916304
Compare
|
@perfinion How is it going? |
This extends the DefaultDevice class to support nicknames. Nicknames are stored in ~/.indi/INDINicknames.xml in a format like the below. Nicknames are assoicated with a driver and stable device identifier. The device identifier must be stable across boots and not dependent on which port the device is plugged into. Usually this will be some form of serial number of the device, but specifics are left up to each driver. Since each identifier is per-driver, devices from different drivers can share the same nickname. The INDI framework must not try to interpret the identifier, only compare for equality since different devices might have serial numbers in different formats. Since the device-name can't be changed once the driver is running, changes to nicknames can only take effect at the next INDI startup. The NicknameTP should be added with addNicknameControl(). <INDINicknames> <nickname driver="AcmeFocuser" identifier="SN123">MainScope</nickname> <nickname driver="AcmeFocuser" identifier="SN456">GuideScope</nickname> <nickname driver="AcmeDustCap" identifier="CAP-1-2-3">MainScope</nickname> </INDINicknames> Signed-off-by: Jason Zaman <jason@perfinion.com>
Nesting the <nickname> inside the <device> makes the saving code much simpler too.
1916304 to
3a5a584
Compare
|
@knro I implemented it for ZWO asi_ccd and the focuser, that lead me to find a few things lacking in the base class. I added a virtual function so that the driver can see nickname updates and then save the result. I finally had a few clear nights after months of clouds so I have not deployed the latest version on my stellarmate yet, I will test it tomorrow and let you know how things go. Please let me know if you find any issues in the structure you'd like me to change too. :) |
This extends the DefaultDevice class to support nicknames.
Nicknames are stored in ~/.indi/INDINicknames.xml in a format like the below. Nicknames are assoicated with a driver and stable device identifier.
The device identifier must be stable across boots and not dependent on which port the device is plugged into. Usually this will be some form of serial number of the device, but specifics are left up to each driver.
Since each identifier is per-driver, devices from different drivers can share the same nickname. The INDI framework must not try to interpret the identifier, only compare for equality since different devices might have serial numbers in different formats.
Since the device-name can't be changed once the driver is running, changes to nicknames can only take effect at the next INDI startup.
The NicknameTP should be added with addNicknameControl().