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 "util/uuid_provider.hpp"
11 #include "pool/pool.hpp"
12 #include <vector>
13 #include <map>
14 #include <fstream>
15 
16 namespace horizon {
17 using json = nlohmann::json;
18 
19 class SchematicSymbol : public UUIDProvider {
20 public:
21  SchematicSymbol(const UUID &uu, const json &, Pool &pool, Block *block = nullptr);
22  SchematicSymbol(const UUID &uu, const Symbol *sym);
23  UUID uuid;
24  const Symbol *pool_symbol;
25  Symbol symbol;
26  uuid_ptr<Component> component;
28  Placement placement;
29  std::vector<uuid_ptr<Text>> texts;
30  bool smashed = false;
31  enum class PinDisplayMode { SELECTED_ONLY, BOTH, ALL };
32  PinDisplayMode pin_display_mode = PinDisplayMode::SELECTED_ONLY;
33  bool display_directions = false;
34  bool display_all_pads = true;
35 
36  std::string replace_text(const std::string &t, bool *replaced = nullptr) const;
37 
38  UUID get_uuid() const override;
39  json serialize() const;
40 };
41 } // namespace horizon
a class to store JSON values
Definition: json.hpp:161
Definition: placement.hpp:8
Interface for objects that have a UUID.
Definition: uuid_provider.hpp:9
A block is one level of hierarchy in the netlist.
Definition: block.hpp:26
Definition: uuid_ptr.hpp:9
This class encapsulates a UUID and allows it to be uses as a value type.
Definition: uuid.hpp:16
Definition: symbol.hpp:74
Stores objects (Unit, Entity, Symbol, Part, etc.) from the pool.
Definition: pool.hpp:19
Definition: block.cpp:9
basic_json<> json
default JSON class
Definition: json_fwd.hpp:61
Definition: schematic_symbol.hpp:19