use of com.cas.circuit.SignalVolt in project TeachingInSimulation by ScOrPiOzzy.
the class R method findElecComp.
private void findElecComp(List<ElecCompDef> elecCompList, List<Terminal> terminals, boolean considerEVN) {
if (voltage instanceof SignalVolt) {
return;
}
Terminal terminal = null;
ElecCompDef comp = null;
ElecCompDef toRemove = null;
Iterator<Terminal> it = terminals.iterator();
while (it.hasNext()) {
terminal = it.next();
comp = terminal.getElecComp();
if (!considerEVN || terminal.getResidualVolt().containsKey(voltage.getEnv())) {
if (comp == null) {
if (terminal.getParent() != null && terminal.getParent() instanceof Jack) {
if (terminal == startTerminal || terminal == endTerminal) {
// 针脚的parent是插孔Jack,插孔的parent是ElecCompDef
toRemove = (ElecCompDef) terminal.getParent().getParent();
}
}
}
if (comp != null && !elecCompList.contains(comp)) {
elecCompList.add(comp);
}
}
}
if (toRemove != null) {
elecCompList.remove(toRemove);
}
// System.out.println(voltage.getEnv() + "-" +elecCompList);
}
Aggregations