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 (C) 2023 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 PCB_EDIT_FRAME;
26
28{
29public:
31 DIALOG_EXPORT_2581( JOB_EXPORT_PCB_IPC2581* aJob, PCB_EDIT_FRAME* aEditFrame, wxWindow* aParent );
32
33 wxString GetOutputPath() const
34 {
35 return m_outputFileName->GetValue();
36 }
37
38 wxString GetUnitsString() const
39 {
40 if( m_choiceUnits->GetSelection() == 0 )
41 return wxT( "mm" );
42 else
43 return wxT( "inch" );
44 }
45
46 wxString GetPrecision() const
47 {
48 return wxString::Format( "%d", m_precision->GetValue() );
49 }
50
51 char GetVersion() const
52 {
53 return m_versionChoice->GetSelection() == 0 ? 'B' : 'C';
54 }
55
56 wxString GetOEM() const
57 {
58 if( m_oemRef->GetSelection() == 0 )
59 return wxEmptyString;
60 else
61 return m_oemRef->GetStringSelection();
62 }
63
64 bool GetCompress() const
65 {
66 return m_cbCompress->GetValue();
67 }
68
69 wxString GetMPN() const
70 {
71 if( !m_choiceMPN->IsEnabled() || m_choiceMPN->GetSelection() == 0 )
72 return wxEmptyString;
73 else
74 return m_choiceMPN->GetStringSelection();
75 }
76
77 wxString GetMfg() const
78 {
79 if( !m_choiceMfg->IsEnabled() || m_choiceMfg->GetSelection() == 0 )
80 return wxEmptyString;
81 else
82 return m_choiceMfg->GetStringSelection();
83 }
84
85 wxString GetDistPN() const
86 {
87 if( !m_choiceDistPN->IsEnabled() || m_choiceDistPN->GetSelection() == 0 )
88 return wxEmptyString;
89 else
90 return m_choiceDistPN->GetStringSelection();
91 }
92
93 wxString GetDist() const
94 {
95 if( !m_textDistributor->IsEnabled() || m_textDistributor->GetValue() == _( "N/A" ) )
96 return wxEmptyString;
97 else
98 return m_textDistributor->GetValue();
99 }
100
101private:
102 void onBrowseClicked( wxCommandEvent& event ) override;
103 void onOKClick( wxCommandEvent& event ) override;
104 void onCompressCheck( wxCommandEvent& event ) override;
105 void onMfgPNChange( wxCommandEvent& event ) override;
106 void onDistPNChange( wxCommandEvent& event ) override;
107
108
109 bool Init();
110 bool TransferDataFromWindow() override;
111
114};
115
116#endif // IPC2581_EXPORT_DIALOG_H
Class DIALOG_EXPORT_2581_BASE.
void onMfgPNChange(wxCommandEvent &event) override
wxString GetOEM() const
wxString GetPrecision() const
bool GetCompress() const
void onCompressCheck(wxCommandEvent &event) override
void onOKClick(wxCommandEvent &event) override
wxString GetMPN() const
void onDistPNChange(wxCommandEvent &event) override
bool TransferDataFromWindow() override
wxString GetDistPN() const
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.
#define _(s)