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, CUSTOM_ONLY };
32  PinDisplayMode pin_display_mode = PinDisplayMode::SELECTED_ONLY;
33  bool display_directions = false;
34  bool display_all_pads = true;
35  unsigned int expand = 0;
36  void apply_expand();
37  void apply_pin_names();
38 
39  std::string replace_text(const std::string &t, bool *replaced, const class Schematic &sch) const;
40 
41  UUID get_uuid() const override;
42  json serialize() const;
43 };
44 } // namespace horizon
horizon::uuid_ptr
Definition: uuid_ptr.hpp:9
nlohmann::json
basic_json<> json
default JSON class
Definition: json_fwd.hpp:61
horizon::Block
A block is one level of hierarchy in the netlist.
Definition: block.hpp:26
horizon::SchematicSymbol
Definition: schematic_symbol.hpp:19
horizon::Symbol
Definition: symbol.hpp:74
horizon::Schematic
A Schematic is the visual representation of a Block.
Definition: schematic.hpp:27
nlohmann::basic_json
a class to store JSON values
Definition: json.hpp:161
horizon::UUID
This class encapsulates a UUID and allows it to be uses as a value type.
Definition: uuid.hpp:16
horizon::Pool
Stores objects (Unit, Entity, Symbol, Part, etc.) from the pool.
Definition: pool.hpp:21
horizon::UUIDProvider
Interface for objects that have a UUID.
Definition: uuid_provider.hpp:9
horizon::Placement
Definition: placement.hpp:8