Skip to content

barsukon/electronic-circuit-simulator

Repository files navigation

Welcome to Electronic Circuit Simulator 🔋👋

Table of contents

  1. Technologies
  2. Getting Started
    1. Pre-reqs
    2. Building and Running
    3. Embedding
  3. Available Scripts
  4. Contributing
  5. Code of Conduct
  6. License

Technologies

Made with: Java Made with: GWT Made with: HTML5 Made with: CSS3 Made with: Nginx

Getting Started

ECS is an electronic circuit simulator that runs in the browser.

You can try the hosted version of the application:

Pre-reqs

Make sure you have git installed.

To build and run this app locally you will need a few things:

  • Use Unix-like OS;
  • Install JDK version 8 (tested with OpenJDK 8);
  • Install Ant;
  • Install Nginx (tested with 1.20.2);

Clone this repository:

git clone [email protected]:barsukon/electronic-circuit-simulator.git

Setup dependencies:

./bin/dev setup

Building and Running

The web application can be compiled and run locally with:

./bin/dev setup
./bin/dev compile # This will put the artifacts in to the "war" directory
./bin/dev start

Just for reference the files you'll deploy should look like this:

-+ Directory containing the front page (eg "ecs")
  +- ecs.html - full page version of application
  +- iframe.html - see notes above
  ++ ecs (directory)
   +- various files built by GWT
   +- circuits (directory, containing example circuits)
   +- setuplist.txt (index in to example circuit directory)

Embedding

You can link to the full page version of the application using the link shown above.

If you want to embed the application in another page then use an iframe with the src being the full-page version.

You can add query parameters to link to change the applications startup behaviour. The following are supported:

.../ecs.html?cct=<string> // Load the circuit from the URL (like the # in the Java version)
.../ecs.html?ctz=<string> // Load the circuit from compressed data in the URL
.../ecs.html?startCircuit=<filename> // Loads the circuit named "filename" from the "Circuits" directory
.../ecs.html?running=<true|false> // Start the app without the simulation running, default true
.../ecs.html?hideSidebar=<true|false> // Hide the sidebar, default false
.../ecs.html?hideMenu=<true|false> // Hide the menu, default false
.../ecs.html?editable=<true|false> // Allow circuit editing, default true

Available Scripts

  • ./bin/dev setup – download JDK, Ant and GWT, generate build.xml;
  • ./bin/dev compile – compile project;
  • ./bin/dev package – make package from your war;
  • ./bin/dev codeserver – run GWT code server;
  • ./bin/dev webserver – run Python's http.server to host your app;
  • ./bin/dev start – run both of codeserver and webserver.

Contributing

Bug reports and pull requests are welcome on GitHub at https://github.com/barsukon/electronic-circuit-simulator. This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the code of conduct.

Code of Conduct

Everyone interacting in the ECS project's codebases, issue trackers, chat rooms and mailing lists is expected to follow the code of conduct.

License

License

The application is available as open source under the terms of the GNU General Public License version 2.

Copyright 2023 barsukon team

Leave a star ⭐ if you find this project useful.