added common anode seven segment displays, see #298

This commit is contained in:
hneemann 2019-08-13 16:13:13 +02:00
parent e62b7d80f8
commit 27f4f49ac1

View File

@ -102,19 +102,18 @@ public class SevenSegShape extends SevenShape {
if (inputValues == null)
return true;
if (persistence && commonConnection) {
if (!ccin.isHighZ() && !ccin.getBool())
data[i] = inputs[i].getBool();
return data[i];
} else {
if (commonConnection && (ccin.isHighZ() || (ccin.getBool() ^ anode)))
return false;
if (commonConnection) {
boolean isHighZ = inputs[i].isHighZ() || ccin.isHighZ();
boolean on = (inputs[i].getBool() != ccin.getBool()) && (inputs[i].getBool() ^ anode);
if (persistence) {
if (!isHighZ)
data[i] = on;
return data[i];
} else
return !isHighZ && on;
} else
return !inputs[i].isHighZ() && inputs[i].getBool();
if (inputs[i].isHighZ())
return false;
return inputs[i].getBool() ^ anode;
}
}
}