/**
 * This class is a PICDebugger entry point for TcpDBAKeyboard, that is to say for a circuit similar
 * to DBA's keyboard through a TCP connection. It needs TcpRemotedTIServer to work with.
 * <BR>You can read the source of this class <A HREF="./TCPDBAKeyboard.java.html"> here</A>.
 */
public class TcpDBAKeyboard extends PICDebugger {

	public TcpDBAKeyboard(String host) {
		super();

		DigitalComponentUI dui;
		PIC pic = deb.getPIC();

		TcpIpComponent tic = new TcpIpComponent(4, 4950, host, false);
		tic.connectPin(1, pic, 12, false);
		tic.connectPin(2, pic, 13, false);
		tic.connectPin(3, pic, 10, false);
		tic.connectPin(4, pic, 11, false);
		pic.addComponentToNotify(tic);

		dui = new DigitalComponentUI("Matricial Keyboard");
		MatricialKeyboard mk = new MatricialKeyboard(dui);
		mk.connectPin(1, pic, 6, false);
		mk.connectPin(2, pic, 7, false);
		mk.connectPin(3, pic, 8, false);
		mk.connectPin(4, pic, 17, false);
		mk.connectPin(5, pic, 18, false);
		mk.connectPin(6, pic, 1, false);
		mk.connectPin(7, pic, 2, false);
		mk.connectPin(8, pic, 3, true);
	}

	/**
	 * PICDebugger entry point.
	 */
	public static void main(String args[]) {
		if(args.length >= 1)
			new TcpDBAKeyboard(args[0]);
		else
			new TcpDBAKeyboard("localhost");
	}
}