[Ktechlab-devel] logic refactoring.

P Zoltan zoltan.padrah at gmail.com
Sun Sep 20 17:28:53 UTC 2009


On Fri, 18 Sep 2009 04:05:07 +0200, Alan Grimes <agrimes at speakeasy.net>  
wrote:

> I could really use some help with logicin/out. =\
>
> Basically what you have is four classes doing the work of a fifth,
> creating a nice big mess in the process.
>
> The other two classes are Simulator (which we REALLY want to keep
> simple), and circuitDocument.
>
> Here's what's going on.
>
> You have a "slow" simulator in ElementSet which simulates the analog
> part of the circuit. You also have a fast (and grossly inaccurate),
> simulator that is a thousand times faster (runs a thousand times more
> often) that processes logic circuits.

  Why inaccurate? Logic should be easily simulated. There could be problems  
with broken circuits (like loops in logic). I think the main issue is  
connecting analog and digital together.

>
> There are two parts to this fast simulator. First there's the part which
> distributes voltage states to all connected parts. Second, since there
> are no cnodes involved, there's a set of pins which must be updated for
> the UI to work. (these are stored in logicOut even though logicOut has
> no code which uses them).
>

  We should separate the GUI update from the simulator voltage/current  
update. Maybe run it in 2 different threads. Also ideally there shoud be a  
well defined interface between the simulator and GUI.


> So I'm working on a class called logicSet which I could use some help
> with. =P
>
> My last few days worth of commits mainly dealt with removing as much
> functionality as I could from logicin/out. Now the main task is
> refactoring. After that it might pay to refactor logicin/out so they
> aren't stacked on each other, but in the mean time we need to get
> logicSet working.
>

  What should logicSet do? Represent a part of the circuit which contains  
only logic components?

> The next biggest problems have to do with the connection router which
> still is extremely problematic. =\
>

  We should find some good algorithms for that. The implementation  
shouldn't be that big problem.





More information about the Ktechlab-devel mailing list