3 #include "common/common.hpp"
4 #include "pool/unit.hpp"
5 #include "pool/part.hpp"
6 #include "pool/entity.hpp"
7 #include "../pool_notebook.hpp"
8 #include "util/window_state_store.hpp"
21 PartWizard(BaseObjectType *cobject,
const Glib::RefPtr<Gtk::Builder> &x,
const UUID &pkg_uuid,
23 static PartWizard *create(
const UUID &pkg_uuid,
const std::string &pool_base_path,
class Pool &po,
25 std::vector<std::string> get_files_saved()
const;
31 const class Package *pkg =
nullptr;
33 std::string pool_base_path;
36 Gtk::HeaderBar *header =
nullptr;
37 Gtk::Button *button_back =
nullptr;
38 Gtk::Button *button_next =
nullptr;
39 Gtk::Button *button_finish =
nullptr;
40 Gtk::Button *button_select =
nullptr;
41 Gtk::Stack *stack =
nullptr;
44 Gtk::Allocation canvas_alloc;
46 Gtk::ListBox *pads_lb =
nullptr;
47 Gtk::ToolButton *button_link_pads =
nullptr;
48 Gtk::ToolButton *button_unlink_pads =
nullptr;
49 Gtk::ToolButton *button_import_pads =
nullptr;
51 Glib::RefPtr<Gtk::SizeGroup> sg_name;
52 Gtk::Box *page_assign =
nullptr;
53 Gtk::Box *page_edit =
nullptr;
54 Gtk::Box *edit_left_box =
nullptr;
56 Gtk::Entry *entity_name_entry =
nullptr;
57 Gtk::Button *entity_name_from_mpn_button =
nullptr;
58 Gtk::Entry *entity_prefix_entry =
nullptr;
59 class TagEntry *entity_tags_entry =
nullptr;
61 Gtk::Entry *part_mpn_entry =
nullptr;
62 Gtk::Entry *part_value_entry =
nullptr;
63 Gtk::Entry *part_manufacturer_entry =
nullptr;
64 Gtk::Entry *part_datasheet_entry =
nullptr;
65 Gtk::Entry *part_description_entry =
nullptr;
66 class TagEntry *part_tags_entry =
nullptr;
67 Gtk::Button *part_autofill_button =
nullptr;
72 Gtk::Grid *steps_grid =
nullptr;
77 class ListColumns :
public Gtk::TreeModelColumnRecord {
81 Gtk::TreeModelColumnRecord::add(name);
83 Gtk::TreeModelColumn<Glib::ustring> name;
85 ListColumns list_columns;
87 Glib::RefPtr<Gtk::ListStore> gate_name_store;
88 void update_gate_names();
89 void update_pin_warnings();
90 std::map<std::pair<std::string, std::string>, std::set<class PadEditor *>> get_pin_names();
99 std::string gate =
"Main";
100 std::vector<std::string> alt;
101 Pin::Direction direction = Pin::Direction::INPUT;
103 void import_pads(
const json &j);
105 void import_pads(
const std::map<std::string, PadImportItem> &items);
107 void create_pad_editors();
108 void autolink_pads();
109 void link_pads(
const std::deque<class PadEditor *> &eds);
112 enum class Mode { PACKAGE, ASSIGN, EDIT };
116 void handle_finish();
117 void handle_select();
120 std::string get_rel_part_filename();
121 void update_can_finish();
125 bool mpn_valid =
false;
126 bool part_filename_valid =
false;
127 bool gates_valid =
false;
128 std::vector<std::string> get_filenames();
129 std::vector<std::string> files_saved;
131 Mode mode = Mode::ASSIGN;
132 void set_mode(Mode mo);
134 std::map<std::string, Unit> units;
135 std::map<UUID, UUID> symbols;
136 std::map<UUID, unsigned int> symbol_pins_mapped;
137 void update_symbol_pins_mapped();
139 std::map<std::string, class PoolProjectManagerProcess *> processes;
140 std::set<UUID> symbols_open;
144 class LocationEntry *pack_location_entry(
const Glib::RefPtr<Gtk::Builder> &x,
const std::string &w,
145 Gtk::Button **button_other =
nullptr);
Definition: entity.hpp:13
Definition: gate_editor.hpp:10
Definition: location_entry.hpp:6
Definition: package.hpp:30
Definition: pad_editor.hpp:8
Definition: part_wizard.hpp:16
Definition: pool_browser_package.hpp:5
Definition: pool-prj-mgr-app_win.hpp:21
Stores objects (Unit, Entity, Symbol, Part, etc.) from the pool.
Definition: pool.hpp:22
Definition: preview_canvas.hpp:7
Definition: tag_entry.hpp:9
This class encapsulates a UUID and allows it to be uses as a value type.
Definition: uuid.hpp:16
Definition: window_state_store.hpp:25
a class to store JSON values
Definition: json.hpp:177