Would you like to react to this message? Create an account in a few clicks or log in to continue.

You are not connected. Please login or register

Special color for tristate output during animation.

2 posters

Go down  Message [Page 1 of 1]

frits



When I animate a circuit with a counter or latch with tristate outputs then I see blue for 0 volts and red for 5 volts, but would it be possible to have a different colour when the outputs are in tristate ?

I did have a look in the source code but I have no clue as to what the correct place should be except for the function which does the painting of a connection:
ConnectorLine::paint()

Frits

arcachofo

arcachofo

The problem is that wires only know about their voltages, an output in tristate mode means nothing for them.
And several output could be connected to that node, ussually one of them driving the voltage.
Or it could be an output in tristate mode but the node at high state voltage due to pullup resistor.
And so on.

I think something like this should be done in the output pins, not in the wires.
Probably coloring the pins depending on their state regarless the voltage of the node they are connected to.

This would require diferentiating pins in diferent types, perhaps: logic input, logic output, analog.
Then defining the pin type for each component (indeed just in some of them), and then  implemmenting the coloring in Pin paint event, based on the pin type, state and impedance (in the case of logic inputs/outputs).

What do you think?

frits



Ok, that's probably the way to go, but it does not sound like a small change.
What I really want is to see which logic component is driving the line and if no logic component is driving the line then it has a special color.
Is it not possible to do something with the current ?
If no logic component is driving the line then the current will be low ?

Frits.

arcachofo

arcachofo

What I really want is to see which logic component is driving the line and if no logic component is driving the line then it has a special color.
Ok, I understand.

Is it not possible to do something with the current ?
If no logic component is driving the line then the current will be low ?
I don't see it.
When an output is driving the line to 0 Volt then there is no current unless there is a pullup.
I'm thinking about this, but i can't find a way...


When you posted this request i realized that it would be helpful for some changes i'm doing right now.
So I'm implementing the logic output coloring:
Red for High state low impedance.
Blue for Low state low impedance.
Green for high impedance.

Something like this:

Special color for tristate output during animation. Pin-co10


I probably will do the same for logic inputs but with diferent color variants: maybe orange for High and pale blue for Low.
This way it is possible to diferentiate inputs, outputs and states.

Fizik_S likes this post

frits



Looks good. Can I already test it ?

Frits.

arcachofo

arcachofo

Sources are here: https://launchpad.net/simulide/trunk

If you can compile from sources, then you can test.
It is not guaranteed that it will be stable at this point.

Sponsored content



Back to top  Message [Page 1 of 1]

Permissions in this forum:
You cannot reply to topics in this forum