projects
/
Mograsim.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Merged SampleERCP into master
[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
c56d802
..
0ad4a76
100644
(file)
--- a/
era.mi/src/era/mi/logic/components/ManualSwitch.java
+++ b/
era.mi/src/era/mi/logic/components/ManualSwitch.java
@@
-2,9
+2,8
@@
package era.mi.logic.components;
import java.util.List;
import java.util.List;
-import era.mi.logic.Bit;
-import era.mi.logic.wires.WireArray;
-import era.mi.logic.wires.WireArray.WireArrayEnd;
+import era.mi.logic.types.Bit;
+import era.mi.logic.wires.Wire.WireEnd;
/**
* 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.
@@
-14,16
+13,14
@@
import era.mi.logic.wires.WireArray.WireArrayEnd;
*/
public class ManualSwitch implements Component
{
*/
public class ManualSwitch implements Component
{
- private WireArray output;
- private WireArrayEnd outputI;
+ private WireEnd output;
private boolean isOn;
private boolean isOn;
- public ManualSwitch(Wire
Array
output)
+ public ManualSwitch(Wire
End
output)
{
{
- if (output.length != 1)
+ if (output.length
()
!= 1)
throw new IllegalArgumentException("Switch output can be only a single wire");
this.output = output;
throw new IllegalArgumentException("Switch output can be only a single wire");
this.output = output;
- this.outputI = output.createInput();
}
public void switchOn()
}
public void switchOn()
@@
-46,7
+43,7
@@
public class ManualSwitch implements Component
if (this.isOn == isOn)
return;
this.isOn = isOn;
if (this.isOn == isOn)
return;
this.isOn = isOn;
- output
I
.feedSignals(getValue());
+ output.feedSignals(getValue());
}
public boolean isOn()
}
public boolean isOn()
@@
-60,13
+57,13
@@
public class ManualSwitch implements Component
}
@Override
}
@Override
- public List<Wire
Array
> getAllInputs()
+ public List<Wire
End
> getAllInputs()
{
return List.of();
}
@Override
{
return List.of();
}
@Override
- public List<Wire
Array
> getAllOutputs()
+ public List<Wire
End
> getAllOutputs()
{
return List.of(output);
}
{
return List.of(output);
}