byucc.jhdl.apps.util
Class ClockThread
java.lang.Object
byucc.jhdl.apps.util.SwingWorker
byucc.jhdl.apps.util.SimulatorThread
byucc.jhdl.apps.util.ClockThread
- public class ClockThread
- extends SimulatorThread
This thread should be used from GUIs to execute steps or cycles of
the simulator. This is important especially for long simulation
runs that would otherwise lock up the GUI. If this Thread is used
for any of the simulation control, it should be used for all of
it. Also, to be sure that Stimulator events (puts to wires) are
executed in the proper order relative to Clock events, make sure
that you use StimulatorThreads as well.
It is crucial to note that ClockThreads are queued (in the
SimulatorThread queue) in the order they are created, not
necessarily in the order they are started by the creating thread.
- Author:
- Anthony L. Slade
- See Also:
StimulatorThread
Constructor Summary |
ClockThread(HWSystem hwsystem,
boolean cycle,
int number)
Creates and queues up a new ClockThread. |
Method Summary |
java.lang.Object |
construct()
This is the SwingWorker method that gets called to do the work
of this thread |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
ClockThread
public ClockThread(HWSystem hwsystem,
boolean cycle,
int number)
- Creates and queues up a new ClockThread.
- Parameters:
hwsystem
- the HWSystem to clock or stepcycle
- If true, then the action will be to cycle,
otherwise, it will be to step the simulator.number
- the number cycles or steps to perform.
construct
public java.lang.Object construct()
- This is the SwingWorker method that gets called to do the work
of this thread
- Specified by:
construct
in class SwingWorker
- Returns:
- some object representative of the work of this thread,
in this case it is simply a successful message
Copyright ? 2006 Brigham Young University, Configurable Computing Laboratory. All Rights Reserved.