diff options
Diffstat (limited to 'core/kicad.cpp')
-rw-r--r-- | core/kicad.cpp | 14 |
1 files changed, 4 insertions, 10 deletions
diff --git a/core/kicad.cpp b/core/kicad.cpp index a553b62..c0315e6 100644 --- a/core/kicad.cpp +++ b/core/kicad.cpp @@ -1,4 +1,4 @@ -#include "trygvis/kicad.h" +#include "trygvis/kicad/netlist.h" #include "trygvis/antlr.h" #include "trygvis/string_utils.h" #include <KicadNetLexer.h> @@ -35,7 +35,7 @@ opt<const component *> netlist::find_component(const string &ref) const { return std::experimental::nullopt; } -vector<const net *> netlist::find_usage_of(const string &ref) const { +vector<const net *> netlist::find_nets_using_ref(const string &ref) const { vector<const net *> usage; for (auto &net : nets) { @@ -91,15 +91,9 @@ public: name = name.substr(1); } -// cerr << "exitNet: " << "code=" << code << ", name=" << name << ", nodes=" << nodes.size() << endl; + bool hasName = !startsWith(name, "Net-("); -// if (nodes.size() > 1) { -// cerr << "Net#" << code << ": " << name << endl; -// for (auto &node: nodes) { -// cerr << " Node: " << node.ref << "#" << node.pin << endl; -// } -// } - nets.emplace_back(code, name, nodes); + nets.emplace_back(code, hasName ? opt<string>(name) : nullopt, nodes); nodes.clear(); } |