projects
/
Mograsim.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Timeline now passed via constructor
[Mograsim.git]
/
era.mi
/
src
/
era
/
mi
/
logic
/
components
/
ManualSwitch.java
diff --git
a/era.mi/src/era/mi/logic/components/ManualSwitch.java
b/era.mi/src/era/mi/logic/components/ManualSwitch.java
index
19ece81
..
9ae08eb
100644
(file)
--- a/
era.mi/src/era/mi/logic/components/ManualSwitch.java
+++ b/
era.mi/src/era/mi/logic/components/ManualSwitch.java
@@
-2,8
+2,10
@@
package era.mi.logic.components;
import java.util.List;
import java.util.List;
-import era.mi.logic.Bit;
-import era.mi.logic.wires.Wire.WireEnd;
+import era.mi.logic.timeline.Timeline;
+import era.mi.logic.types.Bit;
+import era.mi.logic.wires.Wire.ReadEnd;
+import era.mi.logic.wires.Wire.ReadWriteEnd;
/**
* This class models a simple on/off (ONE/ZERO) switch for user interaction.
/**
* This class models a simple on/off (ONE/ZERO) switch for user interaction.
@@
-11,13
+13,14
@@
import era.mi.logic.wires.Wire.WireEnd;
* @author Christian Femers
*
*/
* @author Christian Femers
*
*/
-public class ManualSwitch
implement
s Component
+public class ManualSwitch
extend
s Component
{
{
- private
Wir
eEnd output;
+ private
ReadWrit
eEnd output;
private boolean isOn;
private boolean isOn;
- public ManualSwitch(
Wir
eEnd output)
+ public ManualSwitch(
Timeline timeline, ReadWrit
eEnd output)
{
{
+ super(timeline);
if (output.length() != 1)
throw new IllegalArgumentException("Switch output can be only a single wire");
this.output = output;
if (output.length() != 1)
throw new IllegalArgumentException("Switch output can be only a single wire");
this.output = output;
@@
-57,13
+60,13
@@
public class ManualSwitch implements Component
}
@Override
}
@Override
- public List<
Wire
End> getAllInputs()
+ public List<
Read
End> getAllInputs()
{
return List.of();
}
@Override
{
return List.of();
}
@Override
- public List<
Wir
eEnd> getAllOutputs()
+ public List<
ReadWrit
eEnd> getAllOutputs()
{
return List.of(output);
}
{
return List.of(output);
}