projects
/
slipway.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
checkpoint
[slipway.git]
/
src
/
edu
/
berkeley
/
slipway
/
gui
/
Gui.java
diff --git
a/src/edu/berkeley/slipway/gui/Gui.java
b/src/edu/berkeley/slipway/gui/Gui.java
index
56953c5
..
829479f
100644
(file)
--- a/
src/edu/berkeley/slipway/gui/Gui.java
+++ b/
src/edu/berkeley/slipway/gui/Gui.java
@@
-59,6
+59,7
@@
public class Gui extends ZoomingPanel implements KeyListener, MouseMotionListene
this(at40k, drone, 24, 24);
}
public Gui(Fpslic at40k, FtdiBoard drone, int width, int height) {
this(at40k, drone, 24, 24);
}
public Gui(Fpslic at40k, FtdiBoard drone, int width, int height) {
+ super(drone);
this.at40k = at40k;
this.drone = drone;
for(int i=0; i<ca.length; i++)
this.at40k = at40k;
this.drone = drone;
for(int i=0; i<ca.length; i++)
@@
-68,11
+69,16
@@
public class Gui extends ZoomingPanel implements KeyListener, MouseMotionListene
new Cell(x,y, at40k.cell(x, y));
new Cell(x,y, at40k.cell(x, y));
- new Thread() {
+
+ /*
+ new Thread() {
public void run() {
public void run() {
+ try { Thread.sleep(2000); } catch (Exception e) { }
while(true) scan();
}
while(true) scan();
}
- }.start();
+ }.start();
+ */
+
/*
Fpslic.Cell c = at40k.cell(0,0);
/*
Fpslic.Cell c = at40k.cell(0,0);
@@
-99,13
+105,16
@@
public class Gui extends ZoomingPanel implements KeyListener, MouseMotionListene
this.cell = cell;
cells.add(this);
}
this.cell = cell;
cells.add(this);
}
+ public boolean scanme() {
+ return cell.relevant();
+ }
public void clear() {
public void clear() {
- gg.color(in ? selectedcell : (scanme ? new Color(0xbb, 0xbb, 0xbb) : nonselectedcell));
+ gg.color(in ? selectedcell : (scanme() ? new Color(0xbb, 0xbb, 0xbb) : nonselectedcell));
g.fillRect(0, 0, SIZE, SIZE);
}
public void draw() {
g.fillRect(0, 0, SIZE, SIZE);
}
public void draw() {
- if (cell.relevant() || scanme) {
+ if (cell.relevant() || scanme()) {
drawWires();
drawLocal();
drawWires();
drawLocal();
@@
-424,7
+433,7
@@
public class Gui extends ZoomingPanel implements KeyListener, MouseMotionListene
g.translate(2, 5f);
g.translate(2, 5f);
- if (xlut_relevant(cell) || scanme) {
+ if (xlut_relevant(cell) || scanme()) {
Gate gate = getGate(cell.xlut(), true);
gate.draw(g,
!xknown ? Color.gray : xon ? Color.red : Color.white,
Gate gate = getGate(cell.xlut(), true);
gate.draw(g,
!xknown ? Color.gray : xon ? Color.red : Color.white,
@@
-434,7
+443,7
@@
public class Gui extends ZoomingPanel implements KeyListener, MouseMotionListene
}
g.translate(34f, 0f);
}
g.translate(34f, 0f);
- if (cell.ylut_relevant() || scanme) {
+ if (cell.ylut_relevant() || scanme()) {
Gate gate = getGate(cell.ylut(), false);
gate.draw(g,
!yknown ? Color.gray : yon ? Color.blue : Color.white,
Gate gate = getGate(cell.ylut(), false);
gate.draw(g,
!yknown ? Color.gray : yon ? Color.blue : Color.white,
@@
-750,7
+759,7
@@
public class Gui extends ZoomingPanel implements KeyListener, MouseMotionListene
for(int x=0; x<at40k.getWidth(); x++)
for(int y=0; y<at40k.getHeight(); y++)
if (ca[x][y] != null)
for(int x=0; x<at40k.getWidth(); x++)
for(int y=0; y<at40k.getHeight(); y++)
if (ca[x][y] != null)
- if (ca[x][y].scanme)
+ if (ca[x][y].scanme())
scan(ca[x][y]);
}
public void scan(final Gui.Cell c) {
scan(ca[x][y]);
}
public void scan(final Gui.Cell c) {
@@
-786,6
+795,7
@@
public class Gui extends ZoomingPanel implements KeyListener, MouseMotionListene
} else {
drone.readBus(new BCB(c, XLUT));
}
} else {
drone.readBus(new BCB(c, XLUT));
}
+ /*
if (!cell.yo())
for(Fpslic.Cell c2 : new Fpslic.Cell[] { cell.north(), cell.south(), cell.east(), cell.west() })
if (c2!=null && !c2.relevant()) {
if (!cell.yo())
for(Fpslic.Cell c2 : new Fpslic.Cell[] { cell.north(), cell.south(), cell.east(), cell.west() })
if (c2!=null && !c2.relevant()) {
@@
-798,6
+808,7
@@
public class Gui extends ZoomingPanel implements KeyListener, MouseMotionListene
c2.yi(NONE);
return;
}
c2.yi(NONE);
return;
}
+ */
c.yknown = false;
break;
case YLUT:
c.yknown = false;
break;
case YLUT:
@@
-806,6
+817,7
@@
public class Gui extends ZoomingPanel implements KeyListener, MouseMotionListene
} else {
drone.readBus(new BCB(c, YLUT));
}
} else {
drone.readBus(new BCB(c, YLUT));
}
+ /*
if (!cell.xo())
for(Fpslic.Cell c2 : new Fpslic.Cell[] { cell.nw(), cell.sw(), cell.ne(), cell.se() })
if (c2!=null && !c2.relevant()) {
if (!cell.xo())
for(Fpslic.Cell c2 : new Fpslic.Cell[] { cell.nw(), cell.sw(), cell.ne(), cell.se() })
if (c2!=null && !c2.relevant()) {
@@
-818,9
+830,11
@@
public class Gui extends ZoomingPanel implements KeyListener, MouseMotionListene
c2.xi(NONE);
return;
}
c2.xi(NONE);
return;
}
+ */
c.xknown = false;
break;
case ZMUX: {
c.xknown = false;
break;
case ZMUX: {
+ /*
scan(at40k, cell, NONE, false);
c.xknown = false;
c.yknown = false;
scan(at40k, cell, NONE, false);
c.xknown = false;
c.yknown = false;
@@
-848,6
+862,7
@@
public class Gui extends ZoomingPanel implements KeyListener, MouseMotionListene
break;
}
return;
break;
}
return;
+ */
}
}
}
}