- switch (stateID)
- {
- case "q":
- if (wireQ != null)
- {
- // TODO force this to happen without any Timeline updates in the meantime.
- // Maybe make it a requirement of setHighLevelState that the Timeline is "halted" during a call?
- Bit newStateCasted = (Bit) newState;
- BitVector newStateVector = BitVector.of(newStateCasted);
- if (wireQ.hasLogicModelBinding())
- wireQ.forceWireValues(newStateVector);
- // We set both wires because then both outputs go to their correct state at the same time, and to avoid problems when not
- // both
- // inputs are 1
- if (wire_Q.hasLogicModelBinding())
- wire_Q.forceWireValues(newStateVector.not());
- }
- break;
- default:
- // should not happen because we tell SubmodelComponent to only allow these state IDs.
- throw new IllegalStateException("Illegal atomic state ID: " + stateID);
- }