use of com.cburch.logisim.circuit.Circuit in project logisim-evolution by reds-heig.
the class FileStatistics method doUniqueCounts.
private static void doUniqueCounts(Map<ComponentFactory, Count> counts, Map<Circuit, Map<ComponentFactory, Count>> circuitCounts) {
for (Count count : counts.values()) {
ComponentFactory factory = count.getFactory();
int unique = 0;
for (Circuit circ : circuitCounts.keySet()) {
Count subcount = circuitCounts.get(circ).get(factory);
if (subcount != null) {
unique += subcount.simpleCount;
}
}
count.uniqueCount = unique;
}
}
use of com.cburch.logisim.circuit.Circuit in project logisim-evolution by reds-heig.
the class LoadedLibrary method replaceAll.
private static void replaceAll(Map<ComponentFactory, ComponentFactory> compMap, Map<Tool, Tool> toolMap) {
for (Project proj : Projects.getOpenProjects()) {
Tool oldTool = proj.getTool();
Circuit oldCircuit = proj.getCurrentCircuit();
if (toolMap.containsKey(oldTool)) {
proj.setTool(toolMap.get(oldTool));
}
SubcircuitFactory oldFactory = oldCircuit.getSubcircuitFactory();
if (compMap.containsKey(oldFactory)) {
SubcircuitFactory newFactory;
newFactory = (SubcircuitFactory) compMap.get(oldFactory);
proj.setCurrentCircuit(newFactory.getSubcircuit());
}
replaceAll(proj.getLogisimFile(), compMap, toolMap);
}
for (LogisimFile file : LibraryManager.instance.getLogisimLibraries()) {
replaceAll(file, compMap, toolMap);
}
}
use of com.cburch.logisim.circuit.Circuit in project logisim-evolution by reds-heig.
the class FileStatistics method getTotal.
private static Count getTotal(List<Count> counts, Set<Circuit> exclude) {
Count ret = new Count(null);
for (Count count : counts) {
ComponentFactory factory = count.getFactory();
Circuit factoryCirc = null;
if (factory instanceof SubcircuitFactory) {
factoryCirc = ((SubcircuitFactory) factory).getSubcircuit();
}
if (exclude == null || !exclude.contains(factoryCirc)) {
ret.simpleCount += count.simpleCount;
ret.uniqueCount += count.uniqueCount;
ret.recursiveCount += count.recursiveCount;
}
}
return ret;
}
use of com.cburch.logisim.circuit.Circuit in project logisim-evolution by reds-heig.
the class Project method removeCircuitListener.
public void removeCircuitListener(CircuitListener value) {
circuitListeners.remove(value);
Circuit current = getCurrentCircuit();
if (current != null)
current.removeCircuitListener(value);
}
use of com.cburch.logisim.circuit.Circuit in project logisim-evolution by reds-heig.
the class Project method doTestVector.
public int doTestVector(String vectorname, String name) {
Circuit circuit = (name == null ? file.getMainCircuit() : file.getCircuit(name));
if (circuit == null) {
System.err.println("Circuit '" + name + "' not found.");
return -1;
}
setCurrentCircuit(circuit);
return TestThread.doTestVector(this, circuit, vectorname);
}
Aggregations