diff options
author | Trygve Laugstøl <trygvis@inamo.no> | 2016-08-07 22:20:45 +0200 |
---|---|---|
committer | Trygve Laugstøl <trygvis@inamo.no> | 2016-08-07 22:21:31 +0200 |
commit | fd0e6e3aa0e7523a36011a2f0264737772aa5e24 (patch) | |
tree | 9ada25e6f4d072e2fc01ca62120cc416af8fc716 /core/include | |
parent | 535d856a39b177642724bcfe6009985bf4262dbd (diff) | |
download | kicad-utils-fd0e6e3aa0e7523a36011a2f0264737772aa5e24.tar.gz kicad-utils-fd0e6e3aa0e7523a36011a2f0264737772aa5e24.tar.bz2 kicad-utils-fd0e6e3aa0e7523a36011a2f0264737772aa5e24.tar.xz kicad-utils-fd0e6e3aa0e7523a36011a2f0264737772aa5e24.zip |
templates: nodemcu-arduino: NodeMCU with Arduino.
o Moving headers so they match the namespace they declare.
o Reducing debug logging.
Diffstat (limited to 'core/include')
-rw-r--r-- | core/include/trygvis/kicad.h | 94 |
1 files changed, 0 insertions, 94 deletions
diff --git a/core/include/trygvis/kicad.h b/core/include/trygvis/kicad.h index bae250b..4b76868 100644 --- a/core/include/trygvis/kicad.h +++ b/core/include/trygvis/kicad.h @@ -1,10 +1,6 @@ #pragma once #include <experimental/optional> -#include <ostream> -#include <stdexcept> -#include <string> -#include <vector> namespace trygvis { namespace kicad { @@ -13,93 +9,3 @@ 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) {} - - explicit kicad_parse_exception(const std::string &message) : - runtime_error("Parse error"), messages({message}) {} - - ~kicad_parse_exception() {} - - const std::vector<std::string> messages; -}; - -class kicad_net_loader { -public: - kicad_net_loader(); - - virtual ~kicad_net_loader(); - - netlist load(std::string path, std::ostream &err); - - void setDebug(bool debug); - -private: - bool debug_; -}; - -} // namespace netlist -} // namespace kicad -} // namespace trygvis |