aboutsummaryrefslogtreecommitdiff
path: root/include/trygvis
diff options
context:
space:
mode:
authorTrygve Laugstøl <trygvis@inamo.no>2016-08-01 08:20:23 +0200
committerTrygve Laugstøl <trygvis@inamo.no>2016-08-01 08:20:23 +0200
commitbfeeac6e4889d1e9a1083b3c7efc59652981b168 (patch)
treea937d844a59da7c509685dcd1ddd9933772e526f /include/trygvis
parentc307e9f234e544386fa3ae53083c7510668e1716 (diff)
downloadkicad-utils-bfeeac6e4889d1e9a1083b3c7efc59652981b168.tar.gz
kicad-utils-bfeeac6e4889d1e9a1083b3c7efc59652981b168.tar.bz2
kicad-utils-bfeeac6e4889d1e9a1083b3c7efc59652981b168.tar.xz
kicad-utils-bfeeac6e4889d1e9a1083b3c7efc59652981b168.zip
o Moving the generation logic to Python, embedding a Python interpreter with the help of pybind11.
o Adding install configuration to CMake to make it easier to reuse the project later on. o Splitting out the examples into its own project to make it easier to test the whole installation setup and python/template loading. o Trying to reorganize the code a bit, not very much better yet.
Diffstat (limited to 'include/trygvis')
-rw-r--r--include/trygvis/kicad.h99
1 files changed, 0 insertions, 99 deletions
diff --git a/include/trygvis/kicad.h b/include/trygvis/kicad.h
deleted file mode 100644
index e555e9c..0000000
--- a/include/trygvis/kicad.h
+++ /dev/null
@@ -1,99 +0,0 @@
-#pragma once
-
-#include <string>
-#include <vector>
-#include <stdexcept>
-#include <experimental/optional>
-
-namespace trygvis {
-namespace kicad {
-template<typename T>
-using opt = std::experimental::optional<T>;
-using std::experimental::nullopt;
-} // namespace kicad
-} // namespace trygvis
-
-namespace trygvis {
-namespace kicad {
-namespace netlist {
-
-struct lib_source {
- const std::string lib;
- const std::string part;
-
- lib_source(const std::string &lib, const std::string &part) : lib(lib), part(part) { }
-};
-
-struct component {
- const std::string ref;
- const std::string value;
- const lib_source _lib_source;
-
- component(const std::string &ref, const std::string &value, const lib_source &_lib_source) :
- ref(ref), value(value), _lib_source(_lib_source) { }
-};
-
-struct pin {
- int num;
- std::string name;
- std::string type;
-};
-
-struct part {
- std::vector<pin> pins;
-};
-
-class node {
-public:
- const std::string ref;
- const int pin;
-
- node(const std::string &ref, int pin) : ref(ref), pin(pin) { }
-};
-
-class net {
-public:
- const int code;
- const std::string name;
- const std::vector<node> nodes;
-
- net(int code, const std::string &name, const std::vector<node> &nodes) : code(code), name(name), nodes(nodes) { }
-
- const node * node_for_ref(const std::string &ref) const;
-};
-
-struct netlist {
- std::vector<component> components;
- std::vector<part> parts;
- std::vector<net> nets;
-
- opt<const component *> find_component(const std::string &ref) const;
-
- std::vector<const net *> find_usage_of(const std::string &ref) const;
-};
-
-class kicad_parse_exception : public std::runtime_error {
-public:
- explicit kicad_parse_exception(const std::vector<std::string> &messages) :
- runtime_error("Parse error"), messages(messages) { }
-
- const std::vector<std::string> messages;
-};
-
-class kicad_net_loader {
-public:
- kicad_net_loader();
-
- virtual ~kicad_net_loader();
-
- netlist load(std::string path);
-
- void setDebug(bool debug);
-
-private:
- bool debug_;
-};
-
-} // namespace netlist
-} // namespace kicad
-} // namespace trygvis