make gate-returned events follow the structure

This commit is contained in:
Joel Beckmeyer 2017-04-24 22:36:48 -04:00
parent bf8d3c78a5
commit f7ffb392b0

View File

@ -148,11 +148,14 @@ void Simulation::simulate() {
// if the wire value changes, evaluate gates // if the wire value changes, evaluate gates
if(doesChange) { if(doesChange) {
Gate * tmpGate; Gate * tmpGate;
Event gateEvent;
int index = 0; int index = 0;
while(true){ while(true){
tmpGate = output->getGate(index++); tmpGate = output->getGate(index++);
if (tmpGate != nullptr) { if (tmpGate != nullptr) {
e.push(tmpGate->evaluate(tmpEvent.getTime())); gateEvent = tmpGate->evaluate(tmpEvent.getTime());
gateEvent.setNum(eventNum++);
e.push(gateEvent);
} }
else { else {
break; break;