sharpie7 / circuitjs1

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

Request for relay symbol update according to IEC-60617 #618

Closed tito125 closed 3 years ago

tito125 commented 3 years ago

Hello,

I have made a circuit with relays and time relays, only it becomes unreadable with this type of symbol. Would it be possible to modify the relay and timer symbols to the international standard IEC-60617.

Relay with NO and NC contact

Symbol link :

https://help.autodesk.com/view/ACAD_E/2019/FRA/?guid=GUID-DA927086-EEAF-48CB-B9B1-634A4B48C8C7

And

https://help.autodesk.com/view/ACAD_E/2019/FRA/?guid=GUID-2729322A-CC84-4ADD-AF7C-A651DCA7CE02

Many thanks in advance

nulldg commented 3 years ago

Unless I'm not being very imaginative, the relevant symbols prescribed by IEC-60617 don't appear to be very good for illustrating the internal state of the relay, which is important for the circuit simulation. We can mitigate the ambiguity of the current symbols by adding some kind of rectangle around the relay. What do you think? image

pfalstad commented 3 years ago

The IEC symbols are all two- or three-terminal devices, also. As far as I can tell, the time delay relay symbols don't show the power connections, and the relay symbols don't show the coil.

tito125 commented 3 years ago

Hello, Yes, indeed, it looks like that for simple relays, I modified the image and put an example of a typical relay that would correspond more to the standard.

Cordially ohdakekmcfnllgpk

nulldg commented 3 years ago

We've already created and added the change (https://github.com/pfalstad/circuitjs1/pull/13). It's now on paul's public build of circuitjs if you'd like to play with it. We could probably further improve it by:

But this might be getting rather excessive. I think the way it looks now is quite nice. image image

pfalstad commented 3 years ago

Well we should try to look like the standard symbol as much as possible. The relays need work anyway so these would be good changes to make.

nulldg commented 3 years ago

I think we should replace the "Swap Coil Direction" checkbox with a listbox for the different coil styles: default, flipped, and straight. We might need to replace the FLAG_SWAP_COIL flag with a style integer to accept more than 2 styles. Or maybe not. I'm not entirely sure how to write this cleanly without changing the FLAG_SHOW_BOX's value we added very recently to your branch (which doesn't yet exist in sharpie's build)

pfalstad commented 3 years ago

yes we should have a listbox (though I would make straight the default). Internally though, I'd just keep FLAG_SWAP_COIL and add another flag for straight.

nulldg commented 3 years ago

What happens if both flags are high? What if we want to add more styles?

pfalstad commented 3 years ago

well the UI code will make sure only valid combinations of flags are allowed.

there's plenty of room for more flags. how many coil styles can there be? we're already stuck with FLAG_SWAP_COIL so sticking with flags seems the simplest.

nulldg commented 3 years ago

Fair enough, I agree. I'm just thinking ahead, because I doubt this was anticipated when the "swap coil direction" option was added. Once we make a change to the dump format, we can't undo it without adding legacy code, but if we ever do need to add another in the future, we could just treat the flags as the bits of a 2-bit integer.

K0rrid0r commented 3 years ago

This was a great update, thanks!