public static void connectFrom(IOPoint sender) { if (!Connecting) { conn = new Connector(); CrossConnect(conn.InputPoint, sender, true); /* if (Support.IsLogicGate1(ctl)) { CrossConnect(conn.InputPoint, ((LogicGate1)ctl).OutputPoint, true); } else if (Support.IsLogicGate2(ctl)) { CrossConnect(conn.InputPoint, ((LogicGate2)ctl).OutputPoint, true); } else if (Support.IsNibble(ctl)) { Nibble g = (Nibble)ctl; switch (type) { case "output1": CrossConnect(conn.InputPoint, g.OutputPoint1, true); break; case "output2": CrossConnect(conn.InputPoint, g.OutputPoint2, true); break; case "output3": CrossConnect(conn.InputPoint, g.OutputPoint3, true); break; case "output4": CrossConnect(conn.InputPoint, g.OutputPoint4, true); break; } } */ Connecting = true; } }
public static void CancelConnection() { foreach (IOPoint iop in conn.InputPoint.Connected) { iop.Connecting = false; iop.Connected.Remove(conn.InputPoint); //((Bit)iop.Parent).CancelConnection(); } conn = null; Connecting = false; }
public static void connectTo(IOPoint sender) { if (Connecting) { /* if (Support.IsLogicGate1(ctl)) { CrossConnect(((LogicGate1)ctl).InputPoint, conn.OutputPoint); } else if (Support.IsLogicGate2(ctl)) { switch (type) { case "input1": CrossConnect(((LogicGate2)ctl).InputPoint1, conn.OutputPoint); break; case "input2": CrossConnect(((LogicGate2)ctl).InputPoint2, conn.OutputPoint); break; } } else if (Support.IsNibble(ctl)) { switch (type) { case "input1": CrossConnect(((Nibble)ctl).InputPoint1, conn.OutputPoint); break; case "input2": CrossConnect(((Nibble)ctl).InputPoint2, conn.OutputPoint); break; case "input3": CrossConnect(((Nibble)ctl).InputPoint3, conn.OutputPoint); break; case "input4": CrossConnect(((Nibble)ctl).InputPoint4, conn.OutputPoint); break; } ((Nibble)ctl).CheckConnections(); } */ CrossConnect(conn.OutputPoint, sender); foreach (IOPoint iop in conn.InputPoint.Connected) { iop.Connecting = false; } connections.Add(conn); conn.Input = conn.InputPoint.Connected[0].IO; conn = null; Connecting = false; } }