X-Git-Url: http://git.megacz.com/?a=blobdiff_plain;f=src%2Fedu%2Fberkeley%2Fslipway%2Fgui%2FGui.java;h=c218649765da9a92d8262d32dd14a78aea0bf1e9;hb=daff49a8da20b577ab7af4a2e52b5901fbcbf9a9;hp=37bfaf54248095f42c98d1d6bb0eb8ca6699b551;hpb=57f6ad104a6e2bf0433a86f5c8e1f31c1715dab9;p=slipway.git diff --git a/src/edu/berkeley/slipway/gui/Gui.java b/src/edu/berkeley/slipway/gui/Gui.java index 37bfaf5..c218649 100644 --- a/src/edu/berkeley/slipway/gui/Gui.java +++ b/src/edu/berkeley/slipway/gui/Gui.java @@ -60,11 +60,17 @@ public class Gui extends ZoomingPanel implements KeyListener, MouseMotionListene this.drone = drone; for(int i=0; i (12 & ~0x3) && sw.north()!=null && sw.north().drives(sw)) + sw.north().drives(sw, false); + while(sw.row > (12 & ~0x3) && sw.south() != null) { + //System.out.println(sw + " -> " + sw.south()); + if (sw.drives(sw.south())!=setup) sw.drives(sw.south(), setup); + sw = sw.south(); + } + if (sw.row < (12 & ~0x3) && sw.south() != null && sw.south().drives(sw)) + sw.north().drives(sw, false); + while(sw.row < (12 & ~0x3) && sw.north() != null) { + //System.out.println(sw + " -> " + sw.north()); + if (sw.drives(sw.north())!=setup) sw.drives(sw.north(), setup); + sw = sw.north(); + } + + //cell = dev.cell(19, 15); + cell = dev.cell(cell.col, 15); + /* + System.out.println("cell is " + cell); + cell.xlut(0xff); + cell.ylut(0xff); + cell.b(false); + cell.f(false); + cell.c(XLUT); + cell.out(L3, true); + cell.oe(NONE); + */ + if (cell.hx(L3) != setup) cell.h(L3, setup); + if (cell.vx(L3) != setup) cell.v(L3, setup); + sw = cell.hwire(L3); + + if (sw.west()!=null && sw.west().drives(sw)) { sw.west().drives(sw, false); } + while(sw.east() != null) { + //System.out.println(sw + " -> " + sw.east()); + if (sw.drives(sw.east())!=setup) sw.drives(sw.east(), setup); + sw = sw.east(); + } + + } + int made = 0; private class BCB extends FtdiBoard.ByteCallback { @@ -761,13 +860,9 @@ public class Gui extends ZoomingPanel implements KeyListener, MouseMotionListene public BCB(Gui.Cell c, int who) { this.who = who; this.c = c; made++; - System.out.println("made="+made); } public void call(byte b) throws Exception { - System.out.println("callback: " + b); boolean on = (b & 0x80) != 0; - c.xknown = false; - c.yknown = false; switch(who) { case YLUT: c.yknown = true; @@ -781,8 +876,6 @@ public class Gui extends ZoomingPanel implements KeyListener, MouseMotionListene break; } made--; - System.out.println("made="+made); - if (made==0) scan(); } }