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 class Package *p,
25 std::vector<std::string> get_files_saved()
const;
32 std::string pool_base_path;
35 Gtk::Button *button_back =
nullptr;
36 Gtk::Button *button_next =
nullptr;
37 Gtk::Button *button_finish =
nullptr;
38 Gtk::Stack *stack =
nullptr;
40 Gtk::ListBox *pads_lb =
nullptr;
41 Gtk::ToolButton *button_link_pads =
nullptr;
42 Gtk::ToolButton *button_unlink_pads =
nullptr;
43 Gtk::ToolButton *button_import_pads =
nullptr;
45 Glib::RefPtr<Gtk::SizeGroup> sg_name;
46 Gtk::Box *page_assign =
nullptr;
47 Gtk::Box *page_edit =
nullptr;
48 Gtk::Box *edit_left_box =
nullptr;
50 Gtk::Entry *entity_name_entry =
nullptr;
51 Gtk::Button *entity_name_from_mpn_button =
nullptr;
52 Gtk::Entry *entity_prefix_entry =
nullptr;
53 class TagEntry *entity_tags_entry =
nullptr;
55 Gtk::Entry *part_mpn_entry =
nullptr;
56 Gtk::Entry *part_value_entry =
nullptr;
57 Gtk::Entry *part_manufacturer_entry =
nullptr;
58 Gtk::Entry *part_datasheet_entry =
nullptr;
59 Gtk::Entry *part_description_entry =
nullptr;
60 class TagEntry *part_tags_entry =
nullptr;
61 Gtk::Button *part_autofill_button =
nullptr;
66 Gtk::Grid *steps_grid =
nullptr;
71 class ListColumns :
public Gtk::TreeModelColumnRecord {
75 Gtk::TreeModelColumnRecord::add(name);
77 Gtk::TreeModelColumn<Glib::ustring> name;
79 ListColumns list_columns;
81 Glib::RefPtr<Gtk::ListStore> gate_name_store;
82 void update_gate_names();
83 void update_pin_warnings();
84 std::map<std::pair<std::string, std::string>, std::set<class PadEditor *>> get_pin_names();
93 std::string gate =
"Main";
94 std::vector<std::string> alt;
95 Pin::Direction direction = Pin::Direction::INPUT;
97 void import_pads(
const json &j);
99 void import_pads(
const std::map<std::string, PadImportItem> &items);
101 void create_pad_editors();
102 void autolink_pads();
103 void link_pads(
const std::deque<class PadEditor *> &eds);
106 enum class Mode { ASSIGN, EDIT };
110 void handle_finish();
113 std::string get_rel_part_filename();
114 void update_can_finish();
118 bool mpn_valid =
false;
119 bool part_filename_valid =
false;
120 bool gates_valid =
false;
121 std::vector<std::string> get_filenames();
122 std::vector<std::string> files_saved;
124 Mode mode = Mode::ASSIGN;
125 void set_mode(Mode mo);
127 std::map<std::string, Unit> units;
128 std::map<UUID, UUID> symbols;
129 std::map<UUID, unsigned int> symbol_pins_mapped;
130 void update_symbol_pins_mapped();
132 std::map<std::string, class PoolProjectManagerProcess *> processes;
133 std::set<UUID> symbols_open;
137 class LocationEntry *pack_location_entry(
const Glib::RefPtr<Gtk::Builder> &x,
const std::string &w,
138 Gtk::Button **button_other =
nullptr);