Giter Club home page Giter Club logo

circuit-sandbox's People

Contributors

btzy avatar xsot avatar

Stargazers

 avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

circuit-sandbox's Issues

Notification display system

Notification display system

Display notification messages at the bottom-left of the play area. They have a translucent black background, and do not capture mouse events (i.e. mouse events pass through the notification display and are received by the play area).

There are two types of notifications:

  1. Those that disappear automatically after 5 seconds
  2. Those that are removed explicitly

Messages should be displayable in colour, just like the button bar description.

The notification display should support having multiple messages on display at the same time, and perhaps have simple animation like fade-out when the message needs to disappear.

(Type 1) Those that disappear automatically after 5 seconds include:

  • "Saved to default clipboard" / "Saved to clipboard X"
  • "Simulation reset"
  • Error messages, e.g. "Can't redo" / "File already saved"

(Type 2) Those that are removed explicitly include:

  • "Default view active"
  • "Hold 'Shift' to add to selection; hold 'Alt' to subtract from selection"
  • "Hold 'Shift' to draw a polyline"

Notification mode

We might want certain notifications to be only displayed in beginner mode. Two possible designs:

  • The callers (e.g. SelectionAction) need to check if beginner mode in enabled, and thus decide whether to submit the notification
  • The callers submit notifications with a 'notification mode' parameter, and the notification manager decides whether to display the notification, based on the notification mode and whether beginner mode is enabled

Type 2 notifications with RAII

It is useful for callers to use RAII to manage Type 2 notifications. Callers should construct a notification object to display the notification and destruct it to remove the notification. In this way, callers can never forget to remove a notification.

Intelligent movement of selection

Have an "intelligent dragging" mode:
When moving a selection, extend or erase connecting wires as necessary to retain connectivity of connected components.

Translate viewport when undo/redo change lies outside visible area

If undoing/redoing results in a change made to the circuit that lies outside the visible area, the viewport should be translated such that it can be seen. This behavior is implemented in various text editors, where the cursor is always kept within view and undoing/redoing positions the cursor to where the change was made.

Quick way to convert logic gate or relay to signal

Drawing over an element with the same element is a no-op but there is potential for more useful behavior. One possibility is to convert a logic gate or relay to a signal when clicking on it with the same tool. I suggest restricting this behavior to clicking so there is less chance of accidental conversions. As a bonus, double-clicking becomes an alternative way to draw signals.

File Communicators

  • Need to design a protocol for reading and writing to files
  • Should the bit-rate be adjustable (using Interact tool or something)?

Loading directly to a clipboard

Ctrl-Shift-O can launch the clipboard dialog, followed by the file dialog if a clipboard is selected, to load a circuit file directly to a clipboard.

Requiring a reset to load files into file input communicators might be awkward

Currently, after selecting a file for the file input communicator, a reset is required to start reading from the selected file.

This is because:

  • Circuits should be allowed to assume that once the file communicator reports an EOF, there cannot be any more data from the file communicator;
  • So the file communicator should not be allowed to load a new file while the circuit is in progress.

The most straightforward way to satisfy these requirements is to only load the selected files on reset, which is the current implementation.

Some possible alternatives that could be considered:

  • Only allow loading a new file if the circuit has not received an EOF. (Issue: This behaviour might be unexpected by the user.)
  • Have some way to signal the circuit about a new file being loaded. (Issue: More complex protocol means that the circuit has to be more complicated.)

Various mouse-related bugs caused by window switching

  1. It is possible to change the cursor position without triggering mousemotion events by switching windows. This breaks several mousedown/mouseup events that depend on mousemotion updating the cursor position and functions like processMouseHover().
  2. Mouseup events can be missed if the window loses focus from switching.

UI to reveal type of element under cursor

As more elements are implemented, it gets harder to identify a particular element in the play area by its color. Possible UI changes to make it easier to identify the hovered element:

  • Display the name of the element in the button bar
  • Highlight the name of the corresponding tool in the toolbar

Allow dragging when pasting from clipboard

Often, after pasting (Ctrl-V), the selection is not at the proper location and the user would need to move it. To move the selection, the user would need to click the Selector tool (if not already selected) and needs to click and drag the object.

It is much easier if the following behaviour is implemented: While the 'V' key is still held down, movement of the mouse will move the selection (similar to dragging when in selection mode), regardless of whether any mouse button is bound to the Selector tool.

This might lessen the need for #7. However, Ctrl-A probably shouldn't exhibit this behaviour because users expect a "select all" operation to preserve the state of the circuit, and it is easy to accidentally move the mouse. (On the other hand, Ctrl-V pastes from the clipboard, which doesn't have a 'proper' position on the circuit until it is pasted, so this behaviour will not surprise a user who accidentally moves the mouse.)

Reset button

The reset button is missing from the button bar.

Double clicking in the file open dialog to open a file draws on the canvas

To reproduce:

  1. Select an element from the toolbox using the primary mouse button
  2. Draw something on the canvas (so that opening a file will launch a new instance)
  3. Press Ctrl-O
  4. Double click a file to open
  5. Original canvas has a pixel drawn at the location that was double clicked

Single click, then press the "Open" button does not cause this issue.

Tool to toggle element state

This tool should toggle element state immediately, regardless of whether the simulator is running.

Tool should be able to:

  • Toggle logic level or logic gate or communicator
  • Toggle conductiveness of relay

Combine stop and play buttons

The new button should be functionally equivalent to what space currently does. Clicking on the button should also toggle its icon.

Standardized message dialog box, instead of the native SDL_ShowSimpleMessageBox()?

Currently SDL_ShowSimpleMessageBox is used in the simulation speed dialog to report input errors. There might be other places where such a message box might be useful. It might be nicer to fit the theme of Circuit Sandbox, and have such message box look like the simulation speed dialog, instead of using the OS native dialog.

Application icon for Circuit Sandbox

Circuit Sandbox needs an application icon. Application icons range from 1616 to 256256 or more, and are displayed in several places (e.g. title bar, desktop shortcut). It is possible for larger/smaller icons to use a different image.

History states and savefiles when there are communicators

Currently, communicator instances are shared across all history canvases. It might be necessary for the CanvasState stored in the history to have a different type from the current CanvasState.

Also, we might want to review the current CanvasState and savefile data to align with immediate propagation. In immediate propagation, we only use the logic levels of logic gates/sources/communicators and relay state of relays. For display purposes we also use the transmit state of communicators. All other logic states are not used at all. Currently, logic levels of all elements are saved, but relay state and communicator transmit state is not saved.

Build

Add build instruction

Intelligent and extended selection area

  • Select logically connected areas (that need not be a rectangle), instead of selecting a whole rectangle. Selection area need not be a rectangle.
  • Support Shift-Click to select multiple areas?

Files are held open solely by communicators that exist in the clipboard

As clipboards (both the default and numbered ones) hold CanvasState to represent their the clipboard data, file referenced by communicators that only exist in the clipboards are held open. This might be un-intuitive to the user.

Possible fix: Make the clipboards store HistoryCanvasState instead of CanvasState. The file communicators in HistoryCanvasState will lose their backing communicators (and referenced files) if no CanvasState holds the same backing communicator (which means that the current canvas does not contain that backing communicator.

Straight line pencil tool

The current pencil tool which enables free form drawing is not ergonomic for circuit design. We should optimize the pencil tool for drawing horizontal and vertical lines.

Awkward workflow in selection mode when selector is not bound

There are two ways to enter selection mode without needing the selector to be bound (ctrl-V and ctrl-A).

If a user wanted to move the selection in this situation, they would have to

  1. explicitly bind the selector
  2. move the selection
  3. and optionally rebind the previous tool
    which is quite troublesome for such a simple and common operation.

Possible solution:
Temporarily bind m1 and m2 to selector and panner and restore the previous tools when exiting selection mode. There are some interactions that have to be sorted out before this solution is implemented. For example, what should happen if the user tries to bind another tool before exiting selection mode? What if the selector or panner is already bound to m3?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.