open-ephys / bonsai-onix1

Bonsai library for the Open Ephys Onix Acquisition System
https://open-ephys.github.io/onix1-bonsai-docs
MIT License
4 stars 3 forks source link

Remove `Breakout` from names of static hardware definition classes within `Configure<>` classes #297

Closed jonnew closed 2 weeks ago

jonnew commented 2 weeks ago

For example, remove the Breakout prefix here

https://github.com/open-ephys/onix-bonsai-onix1/blob/f48d2f2f7a3af84d840c6a5d696bf5cb99d5616c/OpenEphys.Onix1/ConfigureBreakoutAnalogIO.cs#L282C18-L282C34

Why? Because it was wrong to add Breakout all over the place in the first place, including to ConfigureBreakoutAnalogIO and ConfigureBreakoutDigitalIO. The addition of this breakout grouping information should always have come from inclusion of these configuration types in the BreakoutBoard MutiDeviceFractory. This was correct because these devices dont actually even exist on the breakout board and that situation is perectly modeled by the MultiDeviceFactory which is a logical grouping of components that dont actually need to correspond to anything physical. Further, when Breakout is added to the type name, you end up with stupid looking DeviceNames like BreakoutBoard/BreakoutAnalogIO. Doing the full change will break the public API. In the meantime, at least the inner, static static hardware definition classes within Configure<> classes can be changed dos that the drop down list items don't look so bad.

jonnew commented 2 weeks ago

A nice tip from @glopesdev

If you want to “rename” an operator in a backwards compatible way just rename the type directly and make a “mock” deprecated with the old name inherited from the renamed, i.e.:

class NewName
{
}

[Obsolete]
class OldName : NewName
{
}