3 #include "common/common.hpp"
4 #include "pool/unit.hpp"
5 #include "pool/part.hpp"
6 #include "pool/entity.hpp"
7 #include "pool/pool.hpp"
8 #include "../pool_notebook.hpp"
9 #include "util/window_state_store.hpp"
10 #include "util/kicad_lib_parser.hpp"
14 class KiCadSymbolImportWizard :
public Gtk::Window {
15 friend class GateEditorImportWizard;
18 KiCadSymbolImportWizard(BaseObjectType *cobject,
const Glib::RefPtr<Gtk::Builder> &x,
const UUID &pkg_uuid,
19 class Pool &po,
class PoolProjectManagerAppWindow *aw,
const std::string &lib_filename);
20 static KiCadSymbolImportWizard *create(
const UUID &pkg_uuid,
class Pool &po,
class PoolProjectManagerAppWindow *aw,
21 const std::string &lib_filename);
22 std::vector<std::string> get_files_saved()
const;
25 ~KiCadSymbolImportWizard();
30 class PoolProjectManagerAppWindow *appwin;
32 Gtk::HeaderBar *header =
nullptr;
33 Gtk::Button *button_skip =
nullptr;
34 Gtk::Button *button_next =
nullptr;
35 Gtk::Button *button_finish =
nullptr;
36 Gtk::Button *button_prev =
nullptr;
37 Gtk::Box *edit_gates_box =
nullptr;
38 Gtk::Stack *stack =
nullptr;
39 class PoolBrowserPackage *browser_package =
nullptr;
40 class PreviewCanvas *symbol_preview =
nullptr;
41 Gtk::SpinButton *preview_part_sp =
nullptr;
42 Gtk::TreeView *tv_symbols =
nullptr;
43 Gtk::Box *part_box =
nullptr;
44 Gtk::CheckButton *merge_pins_cb =
nullptr;
45 Gtk::Label *fp_info_label =
nullptr;
46 Gtk::Label *fp_info_label_sym =
nullptr;
47 static std::string get_fp_info(
const KiCadSymbol &s);
49 void update_symbol_preview();
50 void update_symbol_preview_part();
51 std::vector<Symbol> symbols_for_preview;
53 std::list<KiCadSymbol> k_symbols;
54 const KiCadSymbol *k_sym =
nullptr;
56 void import(
const Package *pkg);
58 Gtk::Button *button_part_edit =
nullptr;
59 Gtk::Button *button_autofill =
nullptr;
63 class ListColumns :
public Gtk::TreeModelColumnRecord {
67 Gtk::TreeModelColumnRecord::add(name);
68 Gtk::TreeModelColumnRecord::add(sym);
70 Gtk::TreeModelColumn<Glib::ustring> name;
71 Gtk::TreeModelColumn<const KiCadSymbol *> sym;
73 ListColumns list_columns;
75 Glib::RefPtr<Gtk::ListStore> symbols_store;
79 std::map<UUID, UUID> symbols;
86 void handle_edit_part();
87 void handle_edit_entity();
89 void update_can_finish();
91 std::vector<std::string> get_filenames();
92 std::vector<std::string> files_saved;
95 class LocationEntry *entity_location_entry =
nullptr;
96 class LocationEntry *part_location_entry =
nullptr;
97 class LocationEntry *pack_location_entry(
const Glib::RefPtr<Gtk::Builder> &x,
const std::string &w,
98 Gtk::Button **button_other =
nullptr);
100 std::map<std::string, class PoolProjectManagerProcess *> processes;
102 void update_buttons();
103 std::string get_rel_entity_filename();
105 enum class Mode { SYMBOL, PACKAGE, EDIT };
106 Mode mode = Mode::SYMBOL;
107 void set_mode(Mode mo);
109 WindowStateStore state_store;