Horizon
schematic_symbol.hpp
1 #pragma once
2 #include "util/uuid.hpp"
3 #include "nlohmann/json_fwd.hpp"
4 #include "pool/unit.hpp"
5 #include "pool/symbol.hpp"
6 #include "pool/gate.hpp"
7 #include "block/block.hpp"
8 #include "util/uuid_ptr.hpp"
9 #include "util/placement.hpp"
10 #include <vector>
11 #include <map>
12 #include <fstream>
13 
14 namespace horizon {
15 using json = nlohmann::json;
16 
18 public:
19  SchematicSymbol(const UUID &uu, const json &, class IPool &pool, Block *block = nullptr);
20  SchematicSymbol(const UUID &uu, const Symbol *sym);
21  UUID uuid;
22  const Symbol *pool_symbol;
23  Symbol symbol;
24  uuid_ptr<Component> component;
26  Placement placement;
27  std::vector<uuid_ptr<Text>> texts;
28  bool smashed = false;
29  enum class PinDisplayMode { SELECTED_ONLY, BOTH, ALL, CUSTOM_ONLY };
30  PinDisplayMode pin_display_mode = PinDisplayMode::SELECTED_ONLY;
31  bool display_directions = false;
32  bool display_all_pads = true;
33  unsigned int expand = 0;
34  void apply_expand();
35  void apply_pin_names();
36 
37  std::string replace_text(const std::string &t, bool *replaced, const class Schematic &sch) const;
38 
39  UUID get_uuid() const;
40  json serialize() const;
41 };
42 } // namespace horizon
A block is one level of hierarchy in the netlist.
Definition: block.hpp:26
Definition: ipool.hpp:12
Definition: placement.hpp:8
Definition: schematic_symbol.hpp:17
A Schematic is the visual representation of a Block.
Definition: schematic.hpp:29
Definition: symbol.hpp:71
This class encapsulates a UUID and allows it to be uses as a value type.
Definition: uuid.hpp:16
Definition: uuid_ptr.hpp:8
a class to store JSON values
Definition: json.hpp:166
basic_json<> json
default JSON class
Definition: json_fwd.hpp:61