Project:SimCir

SimCir is a circuit simulator that provides "live" schematic diagrams containing logic elements. In design mode (the class Main, not used inside the applet) it is possible to add, remove, move and connect components, assembling the desired circuit. Applet normally preloads one diagram that it illustrates.

This code is highly unusual in providing its own layout managers and event handling, even when it only contains three major components (board, toolbar and palette) in the most complex configuration. These may be relicts of some very old project that has been started when standard Swing was not mature or even not yet part of the standard Java.

The code was originally written by Kazuhiko Arase and presented at http://www.d-project.com/simcir/index.html, making it available under MIT license. We added "mountpoints" to make diagrams easier to view, introduced delay element that is needed to explain how triggers and other similar circuits work and made switches "one output" devices, capable to produce logical 1 or 0 depending on the user input, but without external power source connected. Let's assume they have tiny batteries instead. Explicitly painted power source just obscures the diagram without explaining anything notable.

The applet supports following parameters:

  • edit - if true, the applet starts in edit mode, presenting the palette of the available elements, and allows some manipulation. If false (default) the user can only manipulate switches but cannot edit the diagram wiring.
  • pre=file - if specified, the applet loads the prepared diagram that must be internally present inside archive itself (in the samples folder). This allows to bundle the simplest diagrams directly with the applet.
  • file=url - if specified, the applet should load the diagram directly from the site. This allows to deploy diagrams without doing the release iteration of the all applet code.

When running as application, the code can save the designed diagrams in the XML based format .cml format. If you have designed a new interesting diagram, contact us to include it (direct upload of .xml files is currently limited to barista role). The user friendly design works in general but is not as stable and polished as demo capabilities, most important initial state preset (required for diagrams like flip-plops and latches) only works when manually configured in editing XML file.