[Ktechlab-devel] changing the data in IDocumentModel

P Zoltan zoltan.padrah at gmail.com
Thu Sep 9 09:09:57 UTC 2010


  Hello,

In this email I'd like to point out 2 problems with the current  
IDocumentModel interface:
1. components and connectors cannot be removed from the model
2. data residing in the model cannot be changed, for example by the  
simulator

About 1:
  Removing components is useful in the unit tests about the simulator. The  
simulator with minimal features is essentially implemented, but when I  
want to make tests that place some components/elements in the test-model,  
I cannot remove them. The next major work with the simulator is to port  
all the elements to it.

About 2:
  As I see in the interface, all the methods return QVariantMap values, and  
not references.
  I'd like to modify the model in order to store there the state of the  
simulated circuit: voltages and currents in the nodes. As a way of storing  
this information, I've thought about placing new keys in the QVariantMaps  
representing the components, with the name being the name of a pin  
appended with "_v" and "_i". For example, for a resistor with pins "A" and  
"B", I'd like to add "A_v", "A_i", "B_v" and "B_i" values, each storing  
the voltage and current for a given pin. Note that we have to agree on the  
names of the pins, because both the model, and the simulation part needs  
to use them.

Opinions, ideas, suggestions?

  Zoltan




More information about the Ktechlab-devel mailing list