Horizon
imp_schematic.hpp
1 #pragma once
2 #include "imp.hpp"
3 #include "core/core_schematic.hpp"
4 #include "search/searcher_schematic.hpp"
5 
6 namespace horizon {
7 class ImpSchematic : public ImpBase {
8 
9 public:
10  ImpSchematic(const std::string &schematic_filename, const std::string &block_filename, const PoolParams &params);
11  void update_highlights() override;
12 
13 protected:
14  void construct() override;
15  bool handle_broadcast(const json &j) override;
16  void handle_maybe_drag() override;
17  void update_action_sensitivity() override;
18 
19  ActionCatalogItem::Availability get_editor_type_for_action() const override
20  {
21  return ActionCatalogItem::AVAILABLE_IN_SCHEMATIC;
22  };
23  ObjectType get_editor_type() const override
24  {
25  return ObjectType::SCHEMATIC;
26  }
27 
28  std::string get_hud_text(std::set<SelectableRef> &sel) override;
29  void search_center(const Searcher::SearchResult &res) override;
30  std::pair<ActionID, ToolID> get_doubleclick_action(ObjectType type, const UUID &uu) override;
31  void expand_selection_for_property_panel(std::set<SelectableRef> &sel_extra,
32  const std::set<SelectableRef> &sel) override;
33 
34  Searcher *get_searcher_ptr() override
35  {
36  return &searcher;
37  }
38 
39 private:
40  void canvas_update() override;
41  CoreSchematic core_schematic;
42  const std::string project_dir;
43  SearcherSchematic searcher;
44 
45  int handle_ask_net_merge(class Net *net, class Net *into);
46  int handle_ask_delete_component(class Component *comp);
47  void handle_select_sheet(Sheet *sh);
48  void handle_remove_sheet(Sheet *sh);
49  void handle_core_rebuilt();
50  void handle_tool_change(ToolID id) override;
51  void handle_move_to_other_sheet(const ActionConnection &conn);
52  void handle_highlight_group_tag(const ActionConnection &conn);
53  std::string last_pdf_filename;
54 
55  std::map<UUID, std::pair<float, Coordf>> sheet_views;
56  class SheetBox *sheet_box;
57  void handle_selection_cross_probe();
58  bool cross_probing_enabled = false;
59 
60  Coordf cursor_pos_drag_begin;
61  Target target_drag_begin;
62 
63  class BOMExportWindow *bom_export_window;
64  class PDFExportWindow *pdf_export_window;
65  class UnplacedBox *unplaced_box = nullptr;
66  void update_unplaced();
67 
68  void handle_drag();
69 
70  int get_board_pid();
71 };
72 } // namespace horizon
horizon::UnplacedBox
Definition: unplaced_box.hpp:9
horizon::Searcher::SearchResult
Definition: searcher.hpp:55
horizon::BOMExportWindow
Definition: bom_export_window.hpp:14
horizon::Net
Definition: net.hpp:16
horizon::SearcherSchematic
Definition: searcher_schematic.hpp:5
horizon::Coord
Your typical coordinate class.
Definition: common.hpp:74
horizon::PDFExportWindow
Definition: pdf_export_window.hpp:12
horizon::CoreSchematic
Definition: core_schematic.hpp:12
horizon::PoolParams
Definition: imp.hpp:27
horizon::Component
A Component is an instanced Entity in a Block.
Definition: component.hpp:39
horizon::Sheet
Definition: sheet.hpp:37
horizon::Target
Definition: target.hpp:6
horizon::SheetBox
Definition: sheet_box.hpp:6
nlohmann::basic_json
a class to store JSON values
Definition: json.hpp:165
horizon::Searcher
Definition: searcher.hpp:8
horizon::UUID
This class encapsulates a UUID and allows it to be uses as a value type.
Definition: uuid.hpp:16
horizon::ImpSchematic
Definition: imp_schematic.hpp:7
horizon::ImpBase
Definition: imp.hpp:38
horizon::ActionConnection
Definition: action.hpp:115