- All symbols are rectangular, with curved edges for aesthetic purposes.
- Non-selected symbols are grey.
- Selected symbols are green, with their port widths displayed.
- Symbols are labelled internally, with a maximum string length of up to 10 characters depending on the component type.
- Symbol titles have a maximum string length of 15 characters.
- Symbol port labels have a maximum string length 8 characters.
The preview state is an intermediate stage operation that enables the user to find out where they can place their symbols while dragging them. This is visualised by the symbols being translucent.
- Symbols enter preview state when they are
- Newly created
- Newly pasted
- Overlapping another symbol while being dragged
- When symbols in preview states are overlapping other symbols they will turn red, and the state cannot be exited unless forced.
- To exit preview state, ensure that the symbols in preview state are not red, before performing
left-click
. esc
force-exits the preview state.- Newly created/pasted symbols will be deleted
- Symbols originally existing will be snapped back to their original positions
alt+n
creates a new random symbol (for Demo Purposes) in preview state.
- Symbols are automatically selected when they are newly created or pasted.
- To select a desired symbol, perform
left-click
with the cursor within the symbol. - To select multiple symbols individually, hold
ctrl
while performingleft-click
on the desired symbols. - To select an area of symbols, hold
left-click
in blank space and drag it to intersect the desired area of symbols. - To select multiple areas of symbols, hold
ctrl
and perform the previous step. alt+a
selects all symbols.
del
deletes all selected symbols and their wires.
- To drag a symbol, hold
left-click
on a symbol and move the mouse. Doing this will also drag all other selected symbols.
- Works on all selected symbols.
alt+c
to copy andalt+v
paste. - All pasted symbols are in preview mode.
- All wires connected between the copied symbols will be carried over to the pasted symbols.
- Symbols with ports that have no predefined widths (in this section we call them undefined ports) include
- Bus Select (Input port 0)
- Split Wire (Input port 0, Output port 0)
- Merge Wires (Input port 0, Input port 1, Output port 0)
- Wire Label (Input port 0, Output Port 0)
- When a defined output port of another symbol is connected to an undefined input port
- Width inferrence is performed and the input port is now defined.
- Output ports of the same symbol that are affected by this input port will have their widths updated.
- Width inference will be propagated to other undefined ports connected to this updated output port.
- When a connection is removed from a previously undefined input port
- Width inferrence is performed and the input port will revert back to being undefined.
- Output ports of the same symbol that are affected by this input port will have their widths updated.
- Width inference will be propagated to other undefined ports connected to this updated output port.
- Protection against circular port-width definitions have been implemented. This prevents cases like
- Merge wires connecting to itself
- Merge wires connecting to another merge wires and then connecting to itself
- Single-bit wires are blue, while buses are purple.
- Buses have their width labelled, and are thicker than single-bit wires.
- Wires have their corners curved to be aesthetically pleasing.
- The preview wire is an intermediate stage operation that enables the user to find out where they can connect their wires while dragging them. This is visualised by a dotted line emerging from the source port.
- To exit the preview state, release
left-click
. esc
forcefully exits the preview state.
- To create a wire, hold
left-click
on a port and release it on another port.- Before
left-click
is released, a preview wire is generated. - Both ports must be of opposite polarity or the wire will not be created.
- Only ports that satisfy this criterion will be highlighted.
- Before
ins
creates a random wire between two ports of opposite polarity.
- To only delete a wire, click on the wire to select it, then press
del
.
- Wires are auto-routed whenever
- the positions of their parent symbols are being updated
- a foreign symbol attempts to overlap with the wire
- Wire auto-routing performs the shortest-path algorithm, which implements bi-directional recursion to avoid symbols in the horizontal or vertical direction based on the orientation of the wire segment.
- If no optimal correct paths exists, then the algorithm tries its best to reduce collisions with symbols.
- Wires can be manually routed by selecting the desired wire at its non-terminal segments, then dragging it to the desired position.
- Wires that have been manually routed will have their positions locked, and will no longer be auto-routed.
- These positions can be unlocked by moving the parent symbols.
- The source or target ports of a wire can be changed by selecting the desired wire at its terminal segments, then dragging it to the new desired port.
- The previous and the new ports must be of the same polarity.
Wires with errornous connections will be highlighed red. These include
- Port width mismatch
- No driver (when a port of currently undefined width is connected to another port)
- Multiple wires connected to the same target port
alt+shift+d
enables the bounding boxes of wires to be seen.
- The entire sheet is (practically) infinite.
- The sheet is divided into grids of 10px by 10px.
- 100 of these grids are encapsulated by a larger grid of bigger thickness.
- All wires and symbols are snapped to the grids of the sheet.
- To pan the sheet, hold
mousewheel
and drag accordingly.
alt+z
performs the undo.alt+shift+z
performs the redo.
ctrl+shift+=
zooms inctrl+-
zooms outctrl+=
resets the zoom
esc
cancels all intermediate-stage operations
To ensure that our programme is smooth even for extremely large libraries, we have implemented these improvements:
- Only symbols that are in the current screen are rendered (They will still be updated nonetheless).
- Put a cap on auto-routing path searches
Currently our programme supports up to 100 symbols and 100 wires moving concurrently, before lag starts to kick in. The speed tests are also conducted to see check for perfomance:
- Select All
- 400 Symbols : 5.5s
- Copy/Paste
- Only Symbols : Instantaneous
- 50 Symbols, 50 Wires : 7.28s
- 50 Symbols, 100 Wires : 21.43s