r/cpp • u/VinceMiguel • Nov 20 '20
An open-source, real-time logic gates simulator in C++ (plus Qt)! Meet Wired Panda.
Here's a sample circuit in it!
EDIT: in action, a simple animated counter (in binary) looks like this
Wired Panda was developed to be used by students of the Federal University of São Paulo in several courses, but could be useful for so much more people!
It is lightweight enough to run flawlessly on a Raspberry Pi 3, implements many logic gates (And, Or, Not, Nand, Nor, Xor, Xnor, Mux, Demux) as well as other concepts such as flip-flops (D, JK, SR and T) and more!
In many ways it's similar to logic.ly, with the exception of being fully free.
Besides the real-time simulation, Wired Panda allows you to export your circuits as an image or a PDF as well as visualizing (and saving) its waveform!
If you want to know more, please access our GitHub repo or our website.
Binaries for Windows are available (in portable packages, no installer or dependencies), for Linux (as AppImages) and for macOS (currently as a simple dynamically-linked binary, thus needing a Qt installation to work)
13
11
u/shado4568 Nov 21 '20
This looks amazing! You did all this with the qt gui framework?
16
u/VinceMiguel Nov 21 '20
Yup :D
It uses 'only' C++11 and Qt5.
8
u/shado4568 Nov 21 '20
Thats amazing. I've been looking for a good gui for a robotics project of mine. I think I will look into qt for it. Thank you
6
u/INeedAFreeUsername Nov 21 '20
Awesome! Can the user group a part of the circuit and put it in an "IC" for reusability ? This was a feature I reallt liked in logicly
9
u/VinceMiguel Nov 21 '20
Sure :D
I don't know how similar the way we do it is similar to logic.ly's but we can load up files as boxes.
For instance, here's a circuit named dlatch.panda.
Once that's saved, we can use File -> Open file as box (or use the Ctrl + Shift + O shortcut), which will put the reusable circuit in the Box tab.
Once a box is in there, we can simply drag it into the canvas, which would then look like something like this. If we double-click the box, we open a new window with the original circuit. If we hover over each of the four small red boxes, we can see what it represents in relation to the original circuit. For example, I'm hovering over the top-right red box, which tells us that's one of the outputs that the circuit gives us.
Here's an example of a larger circuit using two other boxes. Boxes inside boxes are not a problem, so this entire circuit could be reused too, if so wished
7
u/RealHuman3001 Nov 21 '20
This is really cool! I wish I had this a few years ago when I was looking for one
3
u/Tylnesh Nov 21 '20
Awesome! I was looking for a something like that just yesterday. I don’t like to force my students to use MultiSim to try out circuitry.
3
u/alexppetrov Nov 21 '20
I was just looking for a program to illustrate for my technical informatics course! I will include the name, hopefully my professor will also spread the word. Really useful
2
1
1
-15
u/shooshx Nov 21 '20
Why not a web UI?
5
u/VinceMiguel Nov 21 '20
We definitely want to host it on the Web once Qt on WebAssembly matures more.
I've tried compiling it on two versions of Qt and their respective known-good Emscripten toolchains but with either case the end result is very, very buggy ;/
2
u/disperso Nov 21 '20
What issues you had? I just compiled today my project with the latest Qt for web assembly and it works as expected. I will need to add paths to adjust for the QSettings and and file dialog usage, but otherwise it's fine.
I found a very weird linking error on my branch with TOML support, but outside that, it's fine.
There are a lot of limitations, though, that's for sure.
16
u/Coffee_and_Code Nov 21 '20
What a weird question; surely a native application is preferable in every case.
0
Nov 21 '20
[deleted]
4
u/VinceMiguel Nov 21 '20
How is the open software and free software movement in your collegue?
Ah, até que é fortinho (poderia ser mais). Basicamente todos os projetos de extensão ou de pesquisa acabam publicando os códigos.
Os computadores nos laboratórios geralmente são windows licensiado ou de alguma distribuição linux?
A maior parte dos computadores roda Linux, sim. Existe só um laboratório com dual-boot entre Ubuntu e W10 pq existem alguns programas que o pessoal da engenharia biomédica usa que não rodam em Linux e (supostamente) nem em Wine. Tem também uns dois iMacs por algum motivo.
Vocês utilizam mais software de patente ou open source?
Em geral é tudo open-source sim, com a exceção do MATLAB, do Intel Quartus e desses programas de eng. biomédica que citei acima (não sei quais :/ )
E usam muitos softwares desenvolvidos pelos próprios estudantes?
Acho que o Wired Panda é o maior projeto de estudantes (mas que também envolve um professor), existem outros projetos menores que aparecem de vez em quando, como o Sala Planejada. Agora, projetos de professores são mais usados. Em Lógica de Programação, por exemplo, todo mundo usa no início um interpretador de Portugol que um professor nosso escreveu
0
Nov 21 '20
[deleted]
2
u/VinceMiguel Nov 21 '20
Ah simm, mas acho que isso acaba variando bastante entre as universidades também. Aqui na Unifesp é mais raro ver muito projeto de código aberto de estudante, mas na Unicamp ou na USP é beeem comum, talvez a gente é que incentive pouco.
Sobre a FEI, legal :D
Todo ano vem (ou, bom, vinha) gente da FEI pra disputa de corrida de Baja ao lado da univ. aqui
22
u/nryhajlo Nov 20 '20
That's pretty cool! Nice work!