KiCad PCB EDA Suite
Loading...
Searching...
No Matches
dialog_export_2581.h
Go to the documentation of this file.
1/*
2 * This program source code file is part of KiCad, a free EDA CAD application.
3 *
4 * Copyright The KiCad Developers, see AUTHORS.txt for contributors.
5 *
6 * This program is free software: you can redistribute it and/or modify it
7 * under the terms of the GNU General Public License as published by the
8 * Free Software Foundation, either version 3 of the License, or (at your
9 * option) any later version.
10 *
11 * This program is distributed in the hope that it will be useful, but
12 * WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 * General Public License for more details.
15 *
16 * You should have received a copy of the GNU General Public License along
17 * with this program. If not, see <http://www.gnu.org/licenses/>.
18 */
19
20#ifndef IPC2581_EXPORT_DIALOG_H
21#define IPC2581_EXPORT_DIALOG_H
23
24class BOARD;
25class PCB_EDIT_FRAME;
27class REPORTER;
29
31{
32public:
34 DIALOG_EXPORT_2581( JOB_EXPORT_PCB_IPC2581* aJob, PCB_EDIT_FRAME* aEditFrame, wxWindow* aParent );
35
36 // Generate the actual IPC-2581 file; shared between dialog and CLI
37 static bool GenerateFile( JOB_EXPORT_PCB_IPC2581& aJob, BOARD* aBoard,
38 PROGRESS_REPORTER* aProgressReporter, REPORTER* aReporter );
39
40 wxString GetOutputPath() const
41 {
42 return m_outputFileName->GetValue();
43 }
44
45 wxString GetUnitsString() const
46 {
47 if( m_choiceUnits->GetSelection() == 0 )
48 return wxT( "mm" );
49 else
50 return wxT( "inch" );
51 }
52
53 wxString GetPrecision() const
54 {
55 return wxString::Format( "%d", m_precision->GetValue() );
56 }
57
58 char GetVersion() const
59 {
60 return m_versionChoice->GetSelection() == 0 ? 'B' : 'C';
61 }
62
63 wxString GetOEM() const
64 {
65 if( m_oemRef->GetSelection() == 0 )
66 return wxEmptyString;
67 else
68 return m_oemRef->GetStringSelection();
69 }
70
71 bool GetCompress() const
72 {
73 return m_cbCompress->GetValue();
74 }
75
76 wxString GetMPN() const
77 {
78 if( !m_choiceMPN->IsEnabled() || m_choiceMPN->GetSelection() == 0 )
79 return wxEmptyString;
80 else
81 return m_choiceMPN->GetStringSelection();
82 }
83
84 wxString GetMfg() const
85 {
86 if( !m_choiceMfg->IsEnabled() || m_choiceMfg->GetSelection() == 0 )
87 return wxEmptyString;
88 else
89 return m_choiceMfg->GetStringSelection();
90 }
91
92 wxString GetDistPN() const
93 {
94 if( !m_choiceDistPN->IsEnabled() || m_choiceDistPN->GetSelection() == 0 )
95 return wxEmptyString;
96 else
97 return m_choiceDistPN->GetStringSelection();
98 }
99
100 wxString GetDist() const
101 {
102 if( !m_textDistributor->IsEnabled() || m_textDistributor->GetValue() == _( "N/A" ) )
103 return wxEmptyString;
104 else
105 return m_textDistributor->GetValue();
106 }
107
108private:
109 void onBrowseClicked( wxCommandEvent& event ) override;
110 void onCompressCheck( wxCommandEvent& event ) override;
111 void onMfgPNChange( wxCommandEvent& event ) override;
112 void onDistPNChange( wxCommandEvent& event ) override;
113 void onOKClick( wxCommandEvent& event ) override;
114
115 void init();
116
117 bool TransferDataToWindow() override;
118 bool TransferDataFromWindow() override;
119
122};
123
124#endif // IPC2581_EXPORT_DIALOG_H
Information pertinent to a Pcbnew printed circuit board.
Definition board.h:323
DIALOG_EXPORT_2581_BASE(wxWindow *parent, wxWindowID id=wxID_ANY, const wxString &title=_("Export IPC-2581"), const wxPoint &pos=wxDefaultPosition, const wxSize &size=wxSize(-1,-1), long style=wxDEFAULT_DIALOG_STYLE|wxRESIZE_BORDER)
void onMfgPNChange(wxCommandEvent &event) override
wxString GetOEM() const
static bool GenerateFile(JOB_EXPORT_PCB_IPC2581 &aJob, BOARD *aBoard, PROGRESS_REPORTER *aProgressReporter, REPORTER *aReporter)
wxString GetPrecision() const
bool TransferDataToWindow() override
void onCompressCheck(wxCommandEvent &event) override
void onOKClick(wxCommandEvent &event) override
wxString GetMPN() const
void onDistPNChange(wxCommandEvent &event) override
bool TransferDataFromWindow() override
wxString GetDistPN() const
DIALOG_EXPORT_2581(PCB_EDIT_FRAME *aParent)
PCB_EDIT_FRAME * m_parent
wxString GetDist() const
wxString GetMfg() const
void onBrowseClicked(wxCommandEvent &event) override
wxString GetUnitsString() const
JOB_EXPORT_PCB_IPC2581 * m_job
wxString GetOutputPath() const
The main frame for Pcbnew.
A progress reporter interface for use in multi-threaded environments.
A pure virtual class used to derive REPORTER objects from.
Definition reporter.h:73
#define _(s)