Closed nulldg closed 3 years ago
I'd go with the line over.
Whenever I add a boolean flag, I always store it as a bit in "flags" which is already dumped and undumped. See FLAG_CLOCK_INHIBIT for an example (although that flag is not editable), or FLAG_RESET and FLAG_SET in DFlipFlopElm.java
Also when changing something that affects the pins I just call setupPins() again.
Good idea. I copied this from the way CounterElm does it, but that file is an absolute monstrosity.
I believe someone contributed that code.
Changes are complete now, everything seems to work.
This breaks existing circuits like Circuits->Sequential Logic->Traffic Light and LED Flasher.
the flag should be FLAG_RESET_HIGH or something like that instead, meaning if the flag is not present, it will work as before.
I thought it would be automatically raised by default per flags |= FLAG_INVERT_RESET;
in the constructor. Well, I can fix that too. Good catch!
That constructor is only called when the user creates a new ring counter. When loading from a file, we use the other constructor, which takes a StringTokenizer argument. But you can't set the flag there because then it will always get set, even if you create a new circuit with reset high.
Sure, that was kinda boneheaded of me anyway.
Oh wow, I feel stupid. Sorry for creating such a buggy mess!
Your changes are all merged already. Don't know why this is still here.
At line 156 of RingCounterElm.java, there are two different proposed visuals styles. Feel free to choose whichever one you like more.