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.core
/
src
/
net
/
mograsim
/
logic
/
core
/
components
/
BasicCoreComponent.java
diff --git
a/net.mograsim.logic.core/src/net/mograsim/logic/core/components/BasicCoreComponent.java
b/net.mograsim.logic.core/src/net/mograsim/logic/core/components/BasicCoreComponent.java
index
9f3da4a
..
c82f2b3
100644
(file)
--- a/
net.mograsim.logic.core/src/net/mograsim/logic/core/components/BasicCoreComponent.java
+++ b/
net.mograsim.logic.core/src/net/mograsim/logic/core/components/BasicCoreComponent.java
@@
-3,6
+3,7
@@
package net.mograsim.logic.core.components;
import net.mograsim.logic.core.LogicObservable;
import net.mograsim.logic.core.LogicObserver;
import net.mograsim.logic.core.timeline.Timeline;
import net.mograsim.logic.core.LogicObservable;
import net.mograsim.logic.core.LogicObserver;
import net.mograsim.logic.core.timeline.Timeline;
+import net.mograsim.logic.core.timeline.TimelineEventHandler;
/**
* A basic component that recomputes all outputs (with a delay), when it is updated.
/**
* A basic component that recomputes all outputs (with a delay), when it is updated.
@@
-26,10
+27,17
@@
public abstract class BasicCoreComponent extends CoreComponent implements LogicO
}
@Override
}
@Override
- public void update(LogicObservable initiator)
+ public
final
void update(LogicObservable initiator)
{
{
-
timeline.addEvent(e -> compute(), processTime
);
+
update(
);
}
}
- protected abstract void compute();
+ public void update()
+ {
+ TimelineEventHandler delayedUpdates = compute();
+ if (delayedUpdates != null)
+ timeline.addEvent(delayedUpdates, processTime);
+ }
+
+ protected abstract TimelineEventHandler compute();
}
}