sharpie7 / circuitjs1

Electronic Circuit Simulator in the Browser
GNU General Public License v2.0
2.23k stars 622 forks source link

Feature request: Being able to group switches #834

Open K0rrid0r opened 1 year ago

K0rrid0r commented 1 year ago

I'm trying to recall if I have seen this before or not in falstad. I do have a vague memory of seeing that it was possible to have switches grouped so when one closes (or opens) all the other switches linked to that group are also affected.

This is true for bigger switches in the real world, here is an example from my job.

image

and here it is in the schematic:

image

So yeah, it would be cool if this was also possible in falstad like in this example:

image

Close the top switch and the lower one follows. This could be done in the edit window by applying a group name to a bunch of switches i guess.

/F

pfalstad commented 1 year ago

This is possible for SPDT switches but not SPST switches.

K0rrid0r commented 1 year ago

How is that possible for SPDT switches? As i understand it i can only switch an SPDT with applying power to the trigger.

Alright well maybe there could be an addition of a DPST switch, but as you see in the example there are physical switches that switch much more by physically moving a main switch (this you know of course)

image

I think grouping was a much easier solution.

K0rrid0r commented 1 year ago

maybe you mean something like this

image

EDIT: yeah i guess in the context of falstad this works fine as a hacky solution hehe

pfalstad commented 1 year ago

Yes.

So a two SPDT linked switches would be a DPDT switch.

K0rrid0r commented 1 year ago

Yeah

I saw it the other day in a schematic like this, that's a physical on off switch for a power supply

image

But just like in the relay component window it could also be possible to add more switches to that switch configuration and then i guess it dosen't really have name except a big multilinked switch.

K0rrid0r commented 1 year ago

Commenting here again, i think falstad really needs a way to group switches or at least have these three available.

image

(SPST already there of course)

The DPST have many real world usages, also in simulation id say, im just making a simulation right now where the only solution to a problem is a DPST.

pfalstad commented 1 year ago

An DPDT is a solution.

I was looking again at the "hacky solution" picture you posted above and I'm not sure we're talking about the same thing. Are those relays? I was talking about linked SPDT switches.

You can create several SPDT switches and right click each one, edit, and change the "Switch Group" to a shared value. Sorry if I wasn't clear about that.

https://tinyurl.com/2m37kpe7

DPDT switches can be used as DPST. Just ignore the extra terminals.

K0rrid0r commented 1 year ago

Ahhhh there it was, i had been looking for that function for ages, remember seeing it in some other simulation long ago. Thanks. Consider adding this "Switch Group" window to the SPST also. ( just for correctness ;) )

And also that hacky solution was completely wrong since that was cmos analog switches.

Thanks!