/**
 * <BR>You can read the source of this class <A HREF="./DigitalAnalyser.java.html"> here</A>.
 */
public class DigitalAnalyser extends DigitalComponent_std implements DigitalComponent {

	public DigitalAnalyser(int n) {
		super(n);
	}

	public DigitalAnalyser(int n, DigitalComponentUI dui) {
		super(n, dui);
	}

	public boolean connectPin(int LocalPin, DigitalComponent c, int RemotePin, boolean InitialState) {
		boolean r = super.connectPin(LocalPin, c, RemotePin, InitialState);
		refreshDisplay();
		return r;
	}	

	public void setPinStateDontNotify(int p, boolean state) {
		super.setPinStateDontNotify(p, state);
		refreshDisplay();
	}

	public String getState() {
		String r = "";
		int i;

		for(i = 0 ; i < NbPins ; i++)
			if(Pins[i] != null)
				r += "Pins[" + (i + 1) + "] = " + (Pins[i].getState() ? 1 : 0) + "\n";
			else
				r += "Pins[" + (i + 1) + "] = not yet connected\n";

		return r;
	}
}