I have been working on this for far too long now. But it is very close to being done. As I explained in this post, I am consolidating the LED Styles and Features. This means common code in the PC, Android and the PIC. This makes software maintenance much simpler and if I expand the LED Styles and/or Features, it will happen in one place and then ripple out to all the software and hardware.
But there is a lot exclusion. By that I mean for any given style, only certain features may be available. Then certain features are mutually exclusive. Finally certain features and the Brightness selection are mutually exclusive.
Now writing "spaghetti code" to handle this is quite simple. The problem becomes keeping it running and finding all the loops that were not planned for. Thus I have been working on leveraging the features of OOP in the Delphi compiler to build simple but highly structured code. Also I have been building an abstraction layer that the PC/Android can interface with that will control the LED channels on all of the hardware devices. Again when I make a change, this should ripple through all the devices.
Simply put, I need a Combo Box with check boxes. These exist, but the components are not free. I went with a CheckList Box that was part of the Delphi component pallet. I only needed one, since only one can be shown at any time. Each time the CheckList Box is shown, the data structure holding the LED channel information, populates the CheckList Box with the correct features that can be used (grayed out those that cannot be used) and fills the check boxes that are selected. When a feature is selected by the user, any Features that are mutually exclusive are unchecked and the Brightness selection is checked for availability. Sounds simple enough, but at least for me it proved time consuming. Half the battle was just writing down the program flow.
I finally have a working version for the Brick Buddy 3. Now I need to port this to the Light Buddy 2. Then this concept moves to the Scripting language. How long will this take, not sure. Up til now it has been slow going. The brain is not as sharp as it used to be😊. But progress is made and I suspect moving this to the other hardware platforms will be easier than the first go around. The scripting language will have some road blocks on the first one, but after that it should go fairly fast.
No comments:
Post a Comment