Horizon
Loading...
Searching...
No Matches
fab_output_window.hpp
1#pragma once
2#include <array>
3#include <gtkmm.h>
4#include <set>
5#include "util/window_state_store.hpp"
6#include "util/export_file_chooser.hpp"
7#include "util/changeable.hpp"
8#include "util/done_revealer_controller.hpp"
9
10namespace horizon {
11
12class FabOutputWindow : public Gtk::Window, public Changeable {
13 friend class GerberLayerEditor;
14 friend class DrillEditor;
15
16public:
17 FabOutputWindow(BaseObjectType *cobject, const Glib::RefPtr<Gtk::Builder> &x, class IDocumentBoard &c,
18 const std::string &project_dir);
19 static FabOutputWindow *create(Gtk::Window *p, class IDocumentBoard &c, const std::string &project_dir);
20
21 void set_can_generate(bool v);
22 void reload_layers();
23 void generate();
24
25private:
26 class IDocumentBoard &core;
27 class Board &brd;
28 class GerberOutputSettings &settings;
29 class ODBOutputSettings &odb_settings;
30 Gtk::ListBox *gerber_layers_box = nullptr;
31 Gtk::Entry *npth_filename_entry = nullptr;
32 Gtk::Entry *pth_filename_entry = nullptr;
33 Gtk::Label *npth_filename_label = nullptr;
34 Gtk::Label *pth_filename_label = nullptr;
35 Gtk::Entry *prefix_entry = nullptr;
36 Gtk::Entry *directory_entry = nullptr;
37 class SpinButtonDim *outline_width_sp = nullptr;
38 Gtk::Button *generate_button = nullptr;
39 Gtk::Button *directory_button = nullptr;
40 Gtk::ComboBoxText *drill_mode_combo = nullptr;
41 Gtk::TextView *log_textview = nullptr;
42 Gtk::Switch *zip_output_switch = nullptr;
43 bool can_export = true;
44 void update_export_button();
45
46 Gtk::Box *blind_buried_box = nullptr;
47 Gtk::ListBox *blind_buried_drills_box = nullptr;
48
49 Gtk::Entry *odb_filename_entry = nullptr;
50 Gtk::Button *odb_filename_button = nullptr;
51 Gtk::Box *odb_filename_box = nullptr;
52 Gtk::Label *odb_filename_label = nullptr;
53
54 Gtk::Entry *odb_directory_entry = nullptr;
55 Gtk::Button *odb_directory_button = nullptr;
56 Gtk::Box *odb_directory_box = nullptr;
57 Gtk::Label *odb_directory_label = nullptr;
58
59 Gtk::RadioButton *odb_format_tgz_rb = nullptr;
60 Gtk::RadioButton *odb_format_directory_rb = nullptr;
61 Gtk::RadioButton *odb_format_zip_rb = nullptr;
62
63 Gtk::Entry *odb_job_name_entry = nullptr;
64
65 Gtk::Stack *stack = nullptr;
66
67 ExportFileChooser export_filechooser;
68 class ODBExportFileChooserFilename : public ExportFileChooser {
69 public:
70 ODBExportFileChooserFilename(const ODBOutputSettings &settings);
71
72 protected:
73 void prepare_chooser(Glib::RefPtr<Gtk::FileChooser> chooser) override;
74 void prepare_filename(std::string &filename) override;
75
76 const ODBOutputSettings &settings;
77 };
78 ODBExportFileChooserFilename odb_export_filechooser_filename;
79
80 ExportFileChooser odb_export_filechooser_directory;
81
82 Gtk::Revealer *done_revealer = nullptr;
83 Gtk::Label *done_label = nullptr;
84 Gtk::Button *done_close_button = nullptr;
85 DoneRevealerController done_revealer_controller;
86
87 Gtk::Revealer *odb_done_revealer = nullptr;
88 Gtk::Label *odb_done_label = nullptr;
89 Gtk::Button *odb_done_close_button = nullptr;
90 DoneRevealerController odb_done_revealer_controller;
91
92 Glib::RefPtr<Gtk::SizeGroup> sg_layer_name;
93 Glib::RefPtr<Gtk::SizeGroup> sg_drill_span_name;
94
95 WindowStateStore state_store;
96
97 void update_drill_visibility();
98 void update_odb_visibility();
99
100 void update_blind_buried_drills();
101 void reload_drills();
102
103 unsigned int n_layers = 0;
104};
105} // namespace horizon
Definition board.hpp:47
Definition changeable.hpp:5
Definition done_revealer_controller.hpp:5
Definition fab_output_window.cpp:54
Definition export_file_chooser.hpp:7
Definition fab_output_window.hpp:12
Definition fab_output_window.cpp:15
Definition gerber_output_settings.hpp:11
Definition idocument_board.hpp:5
Definition odb_output_settings.hpp:10
Definition spin_button_dim.hpp:5
Definition window_state_store.hpp:25