Frequently Asked Questions
Frequently Asked Questions
- What is a plug-in?
- Plug-ins are Java-based extensions to DLSim 3's primitive element
set. Plug-ins can add considerable functionality to a DLSim 3 circuit,
and because they may contain any Java Swing control, they can be
highly interactive.
- Simply put, what does it do?
- A simple plug-in resembles a DLSim 3 abstract circuit (card or
chip), with a set of input and output pins. It may act as a
combinatorial circuit or (more likely) maintain some internal
state. A plug-in without controls is activated by a change in
input.
- How are plug-ins constructed?
- A plug-in "document" is
constructed as an extension to the DLPlugIn class. Plug-ins
may have their own customized "view", or use the default "purple
box" view. Customized views may have a user-defined polygonal shape
and pin configuration. The default view uses the standard pin
configuration and is limited to at most displaying a row of
numerical LEDs.
- How are plug-ins added to the DLSim 3 environment?
- A plug-in library consists of a set of related plug-ins distributed
together in a Java JAR archive. This archive must have one of the
following filenames: Plugins.jar, Plugins0.jar, Plugins1.jar,
... Plugins9.jar. Any such archives residing in the same
directory as the DLSim 3 archive DLSim3.jar (we'll call it the
home directory) will be loaded when DLSim 3 is launched. When
one or more plug-in library is loaded the Elements | Add
Plug-in menu and toolbar items are activated, permitting elements
from the libraries to be added to the circuit board. See
Plug-in Environment
- How is plug-in development supported?
- To facilitate
plug-in development we've distributed a software development kit
(SDK) in the form of an Apache "ant" environment. With modifications
this should be sufficient to manage plug-in development projects. See Software Development Kit.
- How difficult is it to write a plug-in?
- A simple plug-in is presented in Tutorial 1. It has
less than 20 lines of code.
- What part do I have to write?
- At the very least you must
specify the input/output configuration in the constructor, and you
must implement the call-back method evalState. See
Document API.
- How are the pins configured?
- Pins can either be simple
binary connections or grouped into bundles to represent integer or
long integer values. See Document Architecture: Input/Output.
- What is a LED?
- LEDs are a feature of the default view that
allow you to display hexidecimal values without having to create a
customized view. See Document Architecutre: LEDs.
- How do I create a customized view?
- Extend the UserPluginView class. See API: View API.
- How do I build a customized footprint and pin configuration?
- The customized footprint is specified using a polygon. You specify
the coordinates of the vertices. The customized pin configuration
is defined by arrays of type dlsim.view.util.ProtoPluginView.PinDesc . See
View Architecture: Nonstandard Footprint.
- How do I create customized controls?
- Swing controls may be
added to the face of the plug-in by overriding the method public
void panelSetup(). The default implementation of this method sets up
the LED array. Inasmuch as your view class extends UserPluginView,
which is itself an extension of javax.swing.JPanel, use panelSetup() to add components as you would for any GUI application. See
View Architecture: Customized Controls.