Skip to content
abetusk edited this page Nov 23, 2014 · 1 revision

Developers Notes

This wiki is meant to be notes on the implementation of bleepsix (and MeowCAD). The project has become big and if I don't start documentation portions of it, I'm going to have a hard time remembering what I've done and how I've solved each of the issues that've come up.

sch

brd

Code Base

Bleepsix is the core component of MeowCAD that includes the HTML5 application for schematic and board editing.

The main directory has some css, cgi, etc. directories that hold basic HTML auxiliary files.

  • bleepsix/eeschema holds the json files for the schematic components
  • bleepsix/pcb holds the json files for the footprint components
  • bleepsix/json holds the json config files for fonts, schematic/footprint locations etc.
  • bleepsix/data holds the peg file for the BGL language

Where BGL is an aborted attempt at making a more general geometry language to manipulate the 2D polygons that were showing up all over the place.

Roughly speaking, the bleepsix/js subdirectory can be partitioned into three main concepts: the board component, the schematic component and the auxiliary libraries, both third parties and libraries created for bleepsix specifically.

  • bleepsix/js/sch main schematic classes
  • bleepsix/js/schtool schematic tools

  • bleepsix/js/brd main board classes
  • bleepsix/js/brdtool board tools

  • bleepsix/js/core/bleepsixRender.js the main rendering engine
  • bleepsix/js/tool/toolScrollbar.js common scrollbar class
  • bleepsix/js/gui GUI elements, like windows, lists, and other elements
  • bleepsix/js/lib All the rest, including clipperlib, jquery, etc.

There are also some other miscellaneous JavaScript files littered around as helpers in the base bleepsix/js directory.

Overview

The main job of each of the schematic and board portions of the application is to place parts. Parts can be chosen from one of teh GUI elements that exposes components/footprints. Tools can be chosen from another GUI element. Snapshots can be taken of the window and the project can be downloaded by clicking on one of the icons at the top.

From a development perspective, the 'controller' class takes care of handling the flow of the input. The controller class hands control over to the tool class currently activiated and pushes state changes through to the underlying schematic or board class through a 'command pattern'.

Changes in state are pushed over the network via a websocket (or whatever socket.io decides is best) to a central server. Configuration files are loaded at the beginning asynchronously. Cross tab communication is needed for cross tab net highlighting and is handled by communicating through cookies.

Each of the bleepsix/bleepsix_sch.html and bleepsix/bleepsix_brd.html expose an HTML5 canvas element that allows for rendering of the main schematic or board portion of the application (respectively). There are various hacks that were required to make file upload and download work, along with allowing for the schematic/board snapshot functionality. Thes appear as iframes, div elements, etc.

Clone this wiki locally