projects
/
Mograsim.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Fixed a bug in Am2900; created dlatch8/80; relayouted some components
[Mograsim.git]
/
net.mograsim.logic.model
/
src
/
net
/
mograsim
/
logic
/
model
/
model
/
components
/
atomic
/
SimpleRectangularHardcodedModelComponent.java
diff --git
a/net.mograsim.logic.model/src/net/mograsim/logic/model/model/components/atomic/SimpleRectangularHardcodedModelComponent.java
b/net.mograsim.logic.model/src/net/mograsim/logic/model/model/components/atomic/SimpleRectangularHardcodedModelComponent.java
index
cad271c
..
8971285
100644
(file)
--- a/
net.mograsim.logic.model/src/net/mograsim/logic/model/model/components/atomic/SimpleRectangularHardcodedModelComponent.java
+++ b/
net.mograsim.logic.model/src/net/mograsim/logic/model/model/components/atomic/SimpleRectangularHardcodedModelComponent.java
@@
-7,10
+7,10
@@
import net.haspamelodica.swt.helper.gcs.GeneralGC;
import net.haspamelodica.swt.helper.swtobjectwrappers.Rectangle;
import net.mograsim.logic.core.wires.CoreWire.ReadEnd;
import net.mograsim.logic.core.wires.CoreWire.ReadWriteEnd;
import net.haspamelodica.swt.helper.swtobjectwrappers.Rectangle;
import net.mograsim.logic.core.wires.CoreWire.ReadEnd;
import net.mograsim.logic.core.wires.CoreWire.ReadWriteEnd;
-import net.mograsim.logic.model.model.
View
ModelModifiable;
+import net.mograsim.logic.model.model.
Logic
ModelModifiable;
import net.mograsim.logic.model.model.components.ModelComponent;
import net.mograsim.logic.model.model.wires.Pin;
import net.mograsim.logic.model.model.components.ModelComponent;
import net.mograsim.logic.model.model.wires.Pin;
-import net.mograsim.logic.model.modeladapter.
ViewLogicModel
Adapter;
+import net.mograsim.logic.model.modeladapter.
LogicCore
Adapter;
import net.mograsim.logic.model.modeladapter.componentadapters.SimpleRectangularHardcodedModelComponentAdapter;
import net.mograsim.logic.model.serializing.IdentifyParams;
import net.mograsim.logic.model.snippets.HighLevelStateHandler;
import net.mograsim.logic.model.modeladapter.componentadapters.SimpleRectangularHardcodedModelComponentAdapter;
import net.mograsim.logic.model.serializing.IdentifyParams;
import net.mograsim.logic.model.snippets.HighLevelStateHandler;
@@
-38,9
+38,14
@@
public abstract class SimpleRectangularHardcodedModelComponent extends ModelComp
// creation and destruction
// creation and destruction
- public SimpleRectangularHardcodedModelComponent(
View
ModelModifiable model, String id, String name, String centerText)
+ public SimpleRectangularHardcodedModelComponent(
Logic
ModelModifiable model, String id, String name, String centerText)
{
{
- super(model, name);
+ this(model, id, name, centerText, true);
+ }
+
+ public SimpleRectangularHardcodedModelComponent(LogicModelModifiable model, String id, String name, String centerText, boolean callInit)
+ {
+ super(model, name, false);
this.id = id;
this.outlineRenderer = new DefaultOutlineRenderer(this);
CenteredTextParams centeredTextParams = new CenteredTextParams();
this.id = id;
this.outlineRenderer = new DefaultOutlineRenderer(this);
CenteredTextParams centeredTextParams = new CenteredTextParams();
@@
-79,6
+84,9
@@
public abstract class SimpleRectangularHardcodedModelComponent extends ModelComp
recalculate.run();
}
});
recalculate.run();
}
});
+
+ if (callInit)
+ init();
}
// pins
}
// pins
@@
-112,9
+120,9
@@
public abstract class SimpleRectangularHardcodedModelComponent extends ModelComp
public abstract Object recalculate(Object lastState, Map<String, ReadEnd> readEnds, Map<String, ReadWriteEnd> readWriteEnds);
public abstract Object recalculate(Object lastState, Map<String, ReadEnd> readEnds, Map<String, ReadWriteEnd> readWriteEnds);
- //
logic
model binding
+ //
core
model binding
- public void set
Logic
ModelBindingAndResetState(AtomicReference<Object> state, Runnable recalculate)
+ public void set
Core
ModelBindingAndResetState(AtomicReference<Object> state, Runnable recalculate)
{
this.state = state;
this.recalculate = recalculate;
{
this.state = state;
this.recalculate = recalculate;
@@
-148,6
+156,6
@@
public abstract class SimpleRectangularHardcodedModelComponent extends ModelComp
static
{
static
{
-
ViewLogicModel
Adapter.addComponentAdapter(new SimpleRectangularHardcodedModelComponentAdapter());
+
LogicCore
Adapter.addComponentAdapter(new SimpleRectangularHardcodedModelComponentAdapter());
}
}
\ No newline at end of file
}
}
\ No newline at end of file