Hello all. I've been working on a SPICE program which is open-source written in C++ with GTK (GTKmm). The project is essentially an open-source LTSpice-like program, ideally with compatibility with other SPICE programs. To-date, I've been working (on and off) about 2 years on the project, but I've also been learning about software design in that time so the project has been rewritten a few times. I've been very lax with the git so far, so the README is bare-bones and there's no information about e.g. building and dependencies. It's just been a pet-project of mine.
Here's a screenshot I just took:
The code which generated this view at the schematic-level (for testing):
The generated netlist is then (from std out):
C0 2 3 C
C1 3 0 C
C2 3 0 C
R0 2 1 R
So you can see a few things going on here. First, there was a voltage source, and it was then removed. Second, all elements are added through a SchematicSheet object, which is owned by a Schematic object within a Workspace. Adding an element involves simply giving a file path (I used absolute paths to LTSpice symbol files), then the symbol file is parsed, the objects required are created, the element is autonamed according to its prefix, and connections for the element to wires underneath its ports are updated.
Wires, associated with nodes, can be added, and their connections are also automatically updated, and the node management is hidden from view (node merges, checking for ports like ground, etc have been taken care of).
The viewing environment allows you to pan and zoom like you'd expect, with the mouse position fixed during zooms to allow zooming into a particular location. It's very smooth.
In addition to the drawing environment, there's also the backend stuff, which has an action stack, tool management, and GUI elements, among other things.
The git repository is here: https://github.com/sjgallagher2/GTKSpice
You can see the implemented features and the TODO list there.
So there is still a lot to do. Everything has grown fairly significantly in the last few months, up to several tens of source files, which is larger than any project I've yet been a part of. As well, the program rests on the core which I've been writing, but considering my inexperience with such large projects, things can get shakey. (I once had to remove many Singleton classes that I'd used as a crutch to help access to common classes...).
So my usefulness is growing limited. I'm still working on the project actively, but as the project grows so does my ability to manage it on my own.
I'm looking for someone (anyone!) interested in contributing to the project, who has a lot of experience in C/C++ and preferably GTK (it doesn't come up too often though) to work on this project with me. You can reply here, or email me at sjgallagher2@gmail.com. Thanks everyone!
Here's a screenshot I just took:
The code which generated this view at the schematic-level (for testing):
C++:
std::shared_ptr<SchematicSheet> sheet = _schem->get_active_sheet();
sheet->add_element("/home/sam/Documents/Electronics/SPICE/lib/sym/voltage.asy",Coordinate(10,10));
Glib::ustring res1name = sheet->add_element("/home/sam/Documents/Electronics/SPICE/lib/sym/res.asy",Coordinate(80,0));
sheet->get_element_list()->find_element(res1name)->rotate90();
sheet->add_element("/home/sam/Documents/Electronics/SPICE/lib/sym/cap.asy",Coordinate(80,8));
sheet->add_wire(Coordinate(10,18),Coordinate(10,8));
sheet->add_wire(Coordinate(10,8),Coordinate(32,8));
sheet->add_wire(Coordinate(72,8),Coordinate(88,8));
sheet->add_wire(Coordinate(88,40),Coordinate(88,55));
sheet->add_wire(Coordinate(10,58),Coordinate(10,68));
sheet->add_element("/home/sam/Documents/Electronics/SPICE/lib/sym/cap.asy",Coordinate(80,55));
sheet->add_wire(Coordinate(88,45),Coordinate(98,45));
sheet->add_wire(Coordinate(98,45),Coordinate(98,55));
sheet->add_element("/home/sam/Documents/Electronics/SPICE/lib/sym/cap.asy",Coordinate(90,45));
sheet->add_wire(Coordinate(88,87),Coordinate(98,87));
sheet->add_wire(Coordinate(98,77),Coordinate(98,87));
sheet->add_gnd_port(Coordinate(10,48));
sheet->add_gnd_port(Coordinate(88,71));
sheet->remove_element("V0");
std::string spicelines = _schem->get_spice_lines();
std::cout << spicelines;
C0 2 3 C
C1 3 0 C
C2 3 0 C
R0 2 1 R
So you can see a few things going on here. First, there was a voltage source, and it was then removed. Second, all elements are added through a SchematicSheet object, which is owned by a Schematic object within a Workspace. Adding an element involves simply giving a file path (I used absolute paths to LTSpice symbol files), then the symbol file is parsed, the objects required are created, the element is autonamed according to its prefix, and connections for the element to wires underneath its ports are updated.
Wires, associated with nodes, can be added, and their connections are also automatically updated, and the node management is hidden from view (node merges, checking for ports like ground, etc have been taken care of).
The viewing environment allows you to pan and zoom like you'd expect, with the mouse position fixed during zooms to allow zooming into a particular location. It's very smooth.
In addition to the drawing environment, there's also the backend stuff, which has an action stack, tool management, and GUI elements, among other things.
The git repository is here: https://github.com/sjgallagher2/GTKSpice
You can see the implemented features and the TODO list there.
So there is still a lot to do. Everything has grown fairly significantly in the last few months, up to several tens of source files, which is larger than any project I've yet been a part of. As well, the program rests on the core which I've been writing, but considering my inexperience with such large projects, things can get shakey. (I once had to remove many Singleton classes that I'd used as a crutch to help access to common classes...).
So my usefulness is growing limited. I'm still working on the project actively, but as the project grows so does my ability to manage it on my own.
I'm looking for someone (anyone!) interested in contributing to the project, who has a lot of experience in C/C++ and preferably GTK (it doesn't come up too often though) to work on this project with me. You can reply here, or email me at sjgallagher2@gmail.com. Thanks everyone!
Attachments
-
17.4 KB Views: 0