mirror of
https://github.com/hneemann/Digital.git
synced 2025-09-26 14:31:02 -04:00
added some documentation
This commit is contained in:
parent
2dcebd49b7
commit
8180fa3990
File diff suppressed because it is too large
Load Diff
@ -15,8 +15,8 @@ import java.util.HashSet;
|
||||
*/
|
||||
public final class BusModelStateObserver implements ModelStateObserver {
|
||||
private final ArrayList<AbstractBusHandler> busList;
|
||||
private final HashSet<Switch.RealSwitch> closedSwitches;
|
||||
private int version;
|
||||
private HashSet<Switch.RealSwitch> closedSwitches;
|
||||
|
||||
BusModelStateObserver() {
|
||||
busList = new ArrayList<>();
|
||||
@ -68,6 +68,12 @@ public final class BusModelStateObserver implements ModelStateObserver {
|
||||
reconfigureNets();
|
||||
}
|
||||
|
||||
/**
|
||||
* Reconfiguration of the nets.
|
||||
* If a switch is closed the nets on both contacts of the switch are connected to a single
|
||||
* common net, After that the state of the new merged nets are updated.
|
||||
* Needs to be called every time a switch has changed.
|
||||
*/
|
||||
private void reconfigureNets() {
|
||||
busList.removeIf(abstractBusHandler -> abstractBusHandler instanceof ConnectedBusHandler);
|
||||
HashMap<CommonBusValue, ConnectedBusHandler> netMap = new HashMap<>();
|
||||
|
Loading…
x
Reference in New Issue
Block a user