mirror of
https://github.com/bancika/diy-layout-creator
synced 2026-11-10 17:22:09 +10:00
fixes for ascii
This commit is contained in:
@@ -41,6 +41,7 @@ public abstract class AbstractNetlistAnalyzer {
|
|||||||
}
|
}
|
||||||
|
|
||||||
List<Summary> res = new ArrayList<Summary>(summaries.values());
|
List<Summary> res = new ArrayList<Summary>(summaries.values());
|
||||||
|
res.forEach(summary -> NetlistBuilder.cleanupRedundantSwitches(summary.getNetlist().getSwitchSetup()));
|
||||||
Collections.sort(res);
|
Collections.sort(res);
|
||||||
return res;
|
return res;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -18,10 +18,7 @@
|
|||||||
*/
|
*/
|
||||||
package org.diylc.netlist;
|
package org.diylc.netlist;
|
||||||
|
|
||||||
import java.util.ArrayList;
|
import java.util.*;
|
||||||
import java.util.Collections;
|
|
||||||
import java.util.List;
|
|
||||||
import java.util.Set;
|
|
||||||
import javax.swing.JLabel;
|
import javax.swing.JLabel;
|
||||||
import org.diylc.common.INetlistAnalyzer;
|
import org.diylc.common.INetlistAnalyzer;
|
||||||
import org.diylc.components.connectivity.MultimeterProbe;
|
import org.diylc.components.connectivity.MultimeterProbe;
|
||||||
@@ -61,10 +58,15 @@ public class MultimeterAnalyzer extends AbstractNetlistAnalyzer implements INetl
|
|||||||
|
|
||||||
String asciiTree = tree.toAsciiString();
|
String asciiTree = tree.toAsciiString();
|
||||||
|
|
||||||
sb.append("<br><br>")
|
if (asciiTree.trim().isEmpty()) {
|
||||||
.append("<font face='Courier New'>")
|
notes.add("No connection detected");
|
||||||
.append(asciiTree)
|
} else {
|
||||||
.append("</font>");
|
sb.append("<br><br>")
|
||||||
|
.append("<font face='Courier New'>")
|
||||||
|
.append(asciiTree)
|
||||||
|
.append("</font>");
|
||||||
|
}
|
||||||
|
|
||||||
if (!notes.isEmpty()) {
|
if (!notes.isEmpty()) {
|
||||||
Collections.sort(notes);
|
Collections.sort(notes);
|
||||||
sb.append("<br><br>");
|
sb.append("<br><br>");
|
||||||
@@ -85,6 +87,7 @@ public class MultimeterAnalyzer extends AbstractNetlistAnalyzer implements INetl
|
|||||||
throw new TreeException(
|
throw new TreeException(
|
||||||
"Place exactly two multimeter probes on the circuit in order to run the analysis.");
|
"Place exactly two multimeter probes on the circuit in order to run the analysis.");
|
||||||
} else {
|
} else {
|
||||||
|
probeNodes.sort(Comparator.comparing(n -> n.getDisplayName()));
|
||||||
return constructTreeBetween(netlist, probeNodes.get(0), probeNodes.get(1));
|
return constructTreeBetween(netlist, probeNodes.get(0), probeNodes.get(1));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user