projects
/
Mograsim.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
853d979
)
GUIBitDisplay, GUIManualSwitch, WCP now "directly" know their logicWidth
author
Daniel Kirschten
<daniel.kirschten@gmx.de>
Sat, 31 Aug 2019 12:22:17 +0000
(14:22 +0200)
committer
Daniel Kirschten
<daniel.kirschten@gmx.de>
Sat, 31 Aug 2019 12:22:17 +0000
(14:22 +0200)
net.mograsim.logic.model/src/net/mograsim/logic/model/model/components/atomic/GUIBitDisplay.java
patch
|
blob
|
history
net.mograsim.logic.model/src/net/mograsim/logic/model/model/components/atomic/GUIManualSwitch.java
patch
|
blob
|
history
net.mograsim.logic.model/src/net/mograsim/logic/model/model/wires/WireCrossPoint.java
patch
|
blob
|
history
diff --git
a/net.mograsim.logic.model/src/net/mograsim/logic/model/model/components/atomic/GUIBitDisplay.java
b/net.mograsim.logic.model/src/net/mograsim/logic/model/model/components/atomic/GUIBitDisplay.java
index
5574d32
..
9d6b57e
100644
(file)
--- a/
net.mograsim.logic.model/src/net/mograsim/logic/model/model/components/atomic/GUIBitDisplay.java
+++ b/
net.mograsim.logic.model/src/net/mograsim/logic/model/model/components/atomic/GUIBitDisplay.java
@@
-27,6
+27,7
@@
public class GUIBitDisplay extends GUIComponent
private static final double height = 15;
private static final double fontHeight = 5;
private static final double height = 15;
private static final double fontHeight = 5;
+ public final int logicWidth;
private final Pin inputPin;
private final LogicObserver logicObs;
private final Pin inputPin;
private final LogicObserver logicObs;
@@
-40,6
+41,7
@@
public class GUIBitDisplay extends GUIComponent
public GUIBitDisplay(ViewModelModifiable model, int logicWidth, String name)
{
super(model, name);
public GUIBitDisplay(ViewModelModifiable model, int logicWidth, String name)
{
super(model, name);
+ this.logicWidth = logicWidth;
logicObs = (i) -> model.requestRedraw();
setSize(width, height);
logicObs = (i) -> model.requestRedraw();
setSize(width, height);
@@
-93,7
+95,7
@@
public class GUIBitDisplay extends GUIComponent
@Override
public JsonElement getParamsForSerializing(IdentifierGetter idGetter)
{
@Override
public JsonElement getParamsForSerializing(IdentifierGetter idGetter)
{
- return new JsonPrimitive(
inputPin.
logicWidth);
+ return new JsonPrimitive(logicWidth);
}
static
}
static
diff --git
a/net.mograsim.logic.model/src/net/mograsim/logic/model/model/components/atomic/GUIManualSwitch.java
b/net.mograsim.logic.model/src/net/mograsim/logic/model/model/components/atomic/GUIManualSwitch.java
index
ab6e379
..
b9a09e3
100644
(file)
--- a/
net.mograsim.logic.model/src/net/mograsim/logic/model/model/components/atomic/GUIManualSwitch.java
+++ b/
net.mograsim.logic.model/src/net/mograsim/logic/model/model/components/atomic/GUIManualSwitch.java
@@
-30,6
+30,7
@@
public class GUIManualSwitch extends GUIComponent
private static final double height = 15;
private static final double fontHeight = 5;
private static final double height = 15;
private static final double fontHeight = 5;
+ public final int logicWidth;
private final Pin outputPin;
private final LogicObserver logicObs;
private final Pin outputPin;
private final LogicObserver logicObs;
@@
-44,6
+45,7
@@
public class GUIManualSwitch extends GUIComponent
public GUIManualSwitch(ViewModelModifiable model, int logicWidth, String name)
{
super(model, name);
public GUIManualSwitch(ViewModelModifiable model, int logicWidth, String name)
{
super(model, name);
+ this.logicWidth = logicWidth;
logicObs = (i) -> model.requestRedraw();
setSize(width, height);
logicObs = (i) -> model.requestRedraw();
setSize(width, height);
@@
-147,7
+149,7
@@
public class GUIManualSwitch extends GUIComponent
@Override
public JsonElement getParamsForSerializing(IdentifierGetter idGetter)
{
@Override
public JsonElement getParamsForSerializing(IdentifierGetter idGetter)
{
- return new JsonPrimitive(
outputPin.
logicWidth);
+ return new JsonPrimitive(logicWidth);
}
static
}
static
diff --git
a/net.mograsim.logic.model/src/net/mograsim/logic/model/model/wires/WireCrossPoint.java
b/net.mograsim.logic.model/src/net/mograsim/logic/model/model/wires/WireCrossPoint.java
index
ddd3493
..
c3f625c
100644
(file)
--- a/
net.mograsim.logic.model/src/net/mograsim/logic/model/model/wires/WireCrossPoint.java
+++ b/
net.mograsim.logic.model/src/net/mograsim/logic/model/model/wires/WireCrossPoint.java
@@
-29,6
+29,10
@@
public class WireCrossPoint extends GUIComponent
private static final int CIRCLE_RADIUS = 1;
private static final int CIRCLE_DIAM = CIRCLE_RADIUS * 2;
private static final int CIRCLE_RADIUS = 1;
private static final int CIRCLE_DIAM = CIRCLE_RADIUS * 2;
+ /**
+ * The logical width of this cross point.
+ */
+ public final int logicWidth;
/**
* The (single) pin of this cross point.
*/
/**
* The (single) pin of this cross point.
*/
@@
-53,6
+57,7
@@
public class WireCrossPoint extends GUIComponent
public WireCrossPoint(ViewModelModifiable model, int logicWidth, String name)
{
super(model, name);
public WireCrossPoint(ViewModelModifiable model, int logicWidth, String name)
{
super(model, name);
+ this.logicWidth = logicWidth;
logicObs = (i) -> model.requestRedraw();
setSize(CIRCLE_DIAM, CIRCLE_DIAM);
logicObs = (i) -> model.requestRedraw();
setSize(CIRCLE_DIAM, CIRCLE_DIAM);
@@
-118,7
+123,7
@@
public class WireCrossPoint extends GUIComponent
@Override
public JsonElement getParamsForSerializing(IdentifierGetter idGetter)
{
@Override
public JsonElement getParamsForSerializing(IdentifierGetter idGetter)
{
- return new JsonPrimitive(
pin.
logicWidth);
+ return new JsonPrimitive(logicWidth);
}
static
}
static