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::ListBox *pads_lb =
nullptr;
45 Gtk::ToolButton *button_link_pads =
nullptr;
46 Gtk::ToolButton *button_unlink_pads =
nullptr;
47 Gtk::ToolButton *button_import_pads =
nullptr;
49 Glib::RefPtr<Gtk::SizeGroup> sg_name;
50 Gtk::Box *page_assign =
nullptr;
51 Gtk::Box *page_edit =
nullptr;
52 Gtk::Box *edit_left_box =
nullptr;
54 Gtk::Entry *entity_name_entry =
nullptr;
55 Gtk::Button *entity_name_from_mpn_button =
nullptr;
56 Gtk::Entry *entity_prefix_entry =
nullptr;
57 class TagEntry *entity_tags_entry =
nullptr;
59 Gtk::Entry *part_mpn_entry =
nullptr;
60 Gtk::Entry *part_value_entry =
nullptr;
61 Gtk::Entry *part_manufacturer_entry =
nullptr;
62 Gtk::Entry *part_datasheet_entry =
nullptr;
63 Gtk::Entry *part_description_entry =
nullptr;
64 class TagEntry *part_tags_entry =
nullptr;
65 Gtk::Button *part_autofill_button =
nullptr;
70 Gtk::Grid *steps_grid =
nullptr;
75 class ListColumns :
public Gtk::TreeModelColumnRecord {
79 Gtk::TreeModelColumnRecord::add(name);
81 Gtk::TreeModelColumn<Glib::ustring> name;
83 ListColumns list_columns;
85 Glib::RefPtr<Gtk::ListStore> gate_name_store;
86 void update_gate_names();
87 void update_pin_warnings();
88 std::map<std::pair<std::string, std::string>, std::set<class PadEditor *>> get_pin_names();
97 std::string gate =
"Main";
98 std::vector<std::string> alt;
99 Pin::Direction direction = Pin::Direction::INPUT;
101 void import_pads(
const json &j);
103 void import_pads(
const std::map<std::string, PadImportItem> &items);
105 void create_pad_editors();
106 void autolink_pads();
107 void link_pads(
const std::deque<class PadEditor *> &eds);
110 enum class Mode { PACKAGE, ASSIGN, EDIT };
114 void handle_finish();
115 void handle_select();
118 std::string get_rel_part_filename();
119 void update_can_finish();
123 bool mpn_valid =
false;
124 bool part_filename_valid =
false;
125 bool gates_valid =
false;
126 std::vector<std::string> get_filenames();
127 std::vector<std::string> files_saved;
129 Mode mode = Mode::ASSIGN;
130 void set_mode(Mode mo);
132 std::map<std::string, Unit> units;
133 std::map<UUID, UUID> symbols;
134 std::map<UUID, unsigned int> symbol_pins_mapped;
135 void update_symbol_pins_mapped();
137 std::map<std::string, class PoolProjectManagerProcess *> processes;
138 std::set<UUID> symbols_open;
142 class LocationEntry *pack_location_entry(
const Glib::RefPtr<Gtk::Builder> &x,
const std::string &w,
143 Gtk::Button **button_other =
nullptr);