Horizon
imp_schematic.hpp
1 #pragma once
2 #include "imp.hpp"
3 #include "core/core_schematic.hpp"
4 
5 namespace horizon {
6 class ImpSchematic : public ImpBase {
7  friend class ImpInterface;
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 Core::SearchResult &res) override;
30  std::pair<ActionID, ToolID> get_doubleclick_action(ObjectType type, const UUID &uu) override;
31 
32 private:
33  void canvas_update() override;
34  CoreSchematic core_schematic;
35  const std::string project_dir;
36 
37  int handle_ask_net_merge(class Net *net, class Net *into);
38  int handle_ask_delete_component(class Component *comp);
39  void handle_select_sheet(Sheet *sh);
40  void handle_remove_sheet(Sheet *sh);
41  void handle_core_rebuilt();
42  void handle_tool_change(ToolID id) override;
43  void handle_move_to_other_sheet(const ActionConnection &conn);
44  void handle_highlight_group_tag(const ActionConnection &conn);
45  std::string last_pdf_filename;
46 
47  std::map<UUID, std::pair<float, Coordf>> sheet_views;
48  class SheetBox *sheet_box;
49  void handle_selection_cross_probe();
50  bool cross_probing_enabled = false;
51 
52  Coordf cursor_pos_drag_begin;
53  Target target_drag_begin;
54 
55  class BOMExportWindow *bom_export_window;
56  class PDFExportWindow *pdf_export_window;
57 
58  void handle_drag();
59 
60  int get_board_pid();
61 };
62 } // namespace horizon
horizon::ImpInterface
Definition: imp_interface.hpp:7
horizon::Core::SearchResult
Definition: core.hpp:358
horizon::BOMExportWindow
Definition: bom_export_window.hpp:13
horizon::Net
Definition: net.hpp:16
horizon::Coord
Your typical coordinate class.
Definition: common.hpp:72
horizon::PDFExportWindow
Definition: pdf_export_window.hpp:12
horizon::CoreSchematic
Definition: core_schematic.hpp:11
horizon::PoolParams
Definition: imp.hpp:25
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:161
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:6
horizon::ImpBase
Definition: imp.hpp:36
horizon::ActionConnection
Definition: action.hpp:106