Hello everyone
I am working on adding support for the radio mentioned in the subject because the Alinco programming software is quite crusty and Windows only. I currently have basic support running, which means that I can reliably read from and write to the radio. I am now trying to tackle memory banks. I can read and write the memory bank allocation but I'm struggling with integrating that into chirp. I have studied a few examples of how this is implemented in chirp, in particular for the FT60. Yet I am not quite sure how to approach this and I am looking for general pointers (example code, documentation or hints of any kind are welcome).
The radio in question has 50 user defined banks. Those banks do not have names, but the user can set the number of channels contained in each bank dynamically. The number of such channels must add up to 1000. It's kind of an overlay to struct { ...} memory[1000]. The bank assignment is implied by the sizes of the banks defined in another uint16_t[50]. A user could therefore decide to set the first 10 banks to 100 channels each and set the remaining banks to a size of zero. Or have a first bank with 50 channels, then a second bank with 150 channels and 8 more banks with 100 channels as before. A particular channel in a fixed memory position would be transferred from bank 1 to bank 2 if bank 1 is reduced in size and bank 2 is increased accordingly. There are a few more special banks of fixed size that I want to ignore for now. I do understand how to read and write the bank sizes from and to the radio, but what I do not understand is how to modify my current class to integrate the bank feature.
As far as I can see, I need to set the "has_bank" feature to true and I need a get_bank_model() method that returns an instance that inherits from chirp_common.BankModel. I am however not entirely sure what methods that custom BankModel has to implement and how all the bits piece together. I'm also concerned that this doesn't quite fit the usual bank paradigm employed in chirp.
I'd like to worry with the GUI in a follow-up step. I guess that would be a new tab where the bank sizes can be allocated. Any info on that is welcome too of course.
Best regards and thank you
Matt