Class PIC_std

java.lang.Object
  |
  +--DigitalComponent_std
        |
        +--PIC_std
Direct Known Subclasses:
DebuggablePIC_std

public class PIC_std
extends DigitalComponent_std
implements PIC

This interface is the standard implementation of intreface PIC, but a lot of other classes implementing it could be written (to have better emulation algorithms for instance).
You can read the source of this class here.


Constructor Summary
PIC_std()
          Creates a new PIC_std without any program.
PIC_std(CompiledProgram prog)
          Creates a new PIC_std with a program.
PIC_std(DigitalComponentUI dui)
          Creates a new PIC_std without any program with an UI.
 
Method Summary
 void addComponentToNotify(DigitalComponent c)
          Tells the PIC to notify c at each instruction cycle.
 boolean connectPin(int LocalPin, DigitalComponent c, int RemotePin, boolean InitialState)
          Connects pin LocalPin of the component to pin RemotePin of an other component.
 void ExecInstruction()
          Executes one instruction.
 java.lang.String getState()
          Returns the state of the component.
 void notifyOneCycle()
          This method is called by a PIC at each instruction execution if the component asked so.
 void ReprogramFlash(CompiledProgram prog)
          Reprograms the PIC.
 void Reset()
          Resets the PIC.
 void Run()
          Runs the PIC.
 void setPinStateDontNotify(int p, boolean state)
          Sets pin p of the component to the requested state without notifying the caller, this is used by the notifying routine of the Pin, so you should add here the code handling the response of the DigitalComponent to a change on its pins.
 
Methods inherited from class DigitalComponent_std
isPinConnected, refreshDisplay, setPinState
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

PIC_std

public PIC_std(CompiledProgram prog)
Creates a new PIC_std with a program.
Parameters:
prog - The program.

PIC_std

public PIC_std()
Creates a new PIC_std without any program.

PIC_std

public PIC_std(DigitalComponentUI dui)
Creates a new PIC_std without any program with an UI.
Method Detail

connectPin

public boolean connectPin(int LocalPin,
                          DigitalComponent c,
                          int RemotePin,
                          boolean InitialState)
Description copied from interface: DigitalComponent
Connects pin LocalPin of the component to pin RemotePin of an other component.
Overrides:
connectPin in class DigitalComponent_std
Tags copied from interface: DigitalComponent
Returns:
false if the requested pin is already connected on one of the components.

setPinStateDontNotify

public void setPinStateDontNotify(int p,
                                  boolean state)
Description copied from interface: DigitalComponent
Sets pin p of the component to the requested state without notifying the caller, this is used by the notifying routine of the Pin, so you should add here the code handling the response of the DigitalComponent to a change on its pins.
Overrides:
setPinStateDontNotify in class DigitalComponent_std

notifyOneCycle

public void notifyOneCycle()
Description copied from interface: DigitalComponent
This method is called by a PIC at each instruction execution if the component asked so.
Overrides:
notifyOneCycle in class DigitalComponent_std

getState

public java.lang.String getState()
Description copied from interface: DigitalComponent
Returns the state of the component.
Overrides:
getState in class DigitalComponent_std

ReprogramFlash

public void ReprogramFlash(CompiledProgram prog)
Description copied from interface: PIC
Reprograms the PIC.
Specified by:
ReprogramFlash in interface PIC
Tags copied from interface: PIC
Parameters:
prog - The new program.

Run

public void Run()
Description copied from interface: PIC
Runs the PIC.
Specified by:
Run in interface PIC

Reset

public void Reset()
Description copied from interface: PIC
Resets the PIC.
Specified by:
Reset in interface PIC

ExecInstruction

public void ExecInstruction()
Description copied from interface: PIC
Executes one instruction.
Specified by:
ExecInstruction in interface PIC

addComponentToNotify

public void addComponentToNotify(DigitalComponent c)
Description copied from interface: PIC
Tells the PIC to notify c at each instruction cycle.
Specified by:
addComponentToNotify in interface PIC