Rustrician / rustrician-public

Public Issue Tracker for the Rustrician web application.
https://rustrician.io
3 stars 1 forks source link

Custom Components / Sub Circuits #5

Open DerekRies opened 2 years ago

DerekRies commented 2 years ago

Overview

Often when building out large projects / circuits you need to think about breaking the whole thing down into smaller constituent parts, or reusing circuits. A feature along these lines would allow users to Save a Circuit as a Custom Component. Custom components should have defined input and output ports, and potentially some configurable parameters. Then consumers of this component can build out large scale circuits without worrying about the internal implementation of said component. Even the visual representation of the component internals should probably be toggleable to be completely hidden, or show the internal circuitry.

Custom Visual Displays

Taking this idea a little bit further there's also the potential to think about side effects of the circuit rather than strict input/output. An example of this would be an IO component like a 7-segment display. This component takes in a 7-segment code, but provides no output. It does however display a series of lights as a useful side effect, a visual output. Now we could just make the visual display of this circuit show the internals but that's probably not the best User Experience, as the visual display that users care most about here would be the actual lights, not the circuitry to drive those lights.

As an example of what the IO component would like:

7 Segment Display Component vs Group

The example on the left would be the 7-segment display as an actual custom component, with its own set of inputs and a nice visual display as it's output. The example on the right is the display purely as a group of components.

Constraints

Custom visual displays that are user-driven would be exceptionally hard to do without some sort of plugin interface to write code. So maybe it only makes sense that custom components with custom visual displays are just premade things that come with Rustrician in the same way that Logisim and others provide.

With that in mind user-created custom components would probably be limited to a black-boxed display (no internals), and a full internals display (similar to the current groups, only with defined input/output ports).

Equivalent functionality:

DerekRies commented 2 years ago

As a follow up to the visual display constraints, it may be possible to just allow users to provide a custom image, or series of custom images, and conditionally render those images. This might allow a user created 7-segment display with a custom visual display to just use subsets of the following image and require zero code.

image