KiCad PCB EDA Suite
Loading...
Searching...
No Matches
panel_fab_export_content.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
17 * along with this program. If not, see <https://www.gnu.org/licenses/>.
18 */
19
20#pragma once
21
23
24#include <functional>
25#include <optional>
26#include <vector>
27
31
32class BOARD;
33
39
40
42{
43public:
44 PANEL_FAB_EXPORT_CONTENT( wxWindow* aParent, wxWindowID aId = wxID_ANY, const wxPoint& aPos = wxDefaultPosition,
45 const wxSize& aSize = wxDefaultSize, long aStyle = wxTAB_TRAVERSAL,
46 const wxString& aName = wxEmptyString );
47
48 void Configure( FAB_CONTENT_FORMAT aFormat, BOARD* aBoard );
49 void SetContentChanged( std::function<void()> aCallback ) { m_contentChanged = std::move( aCallback ); }
50
51 FAB::MODE GetDataSet() const;
52 void SetDataSet( FAB::MODE aMode );
57 const std::optional<wxString>& GetSectionKey() const { return m_sectionKey; }
58 void SetSectionKey( const std::optional<wxString>& aKey );
59 bool GetBoardMetadata() const { return m_boardMetadata; }
60 void SetBoardMetadata( bool aValue );
61 std::vector<wxString> GetVariantNames() const;
62 void SetVariantNames( const std::vector<wxString>& aNames );
63 bool IsCombinedVariantOutput() const { return m_variantOutput->GetSelection() == 1; }
64 void SetCombinedVariantOutput( bool aCombined );
65 const IPC2581_BOM_FIELDS& GetBomFields() const { return m_bomFields; }
66 void SetBomFields( const IPC2581_BOM_FIELDS& aFields ) { m_bomFields = aFields; }
67
69
70private:
71 void onDataSetChange( wxCommandEvent& aEvent ) override;
72 void onVariantChange( wxCommandEvent& aEvent ) override;
73 void onVariantOutputChange( wxCommandEvent& aEvent ) override;
74 void onCustomizeClick( wxCommandEvent& aEvent ) override;
75 void onBomFieldsClick( wxCommandEvent& aEvent ) override;
77 void updateSummary();
79 void changed();
80
82 BOARD* m_board = nullptr;
84 std::vector<FAB::MODE> m_modes;
85 std::vector<wxString> m_selectedVariants;
87 std::optional<wxString> m_sectionKey;
88 bool m_boardMetadata = true;
89 std::function<void()> m_contentChanged;
91};
Information pertinent to a Pcbnew printed circuit board.
Definition board.h:410
Set of schema sections.
NET_NAMES
An anonymous name keeps the connections.
PANEL_FAB_EXPORT_CONTENT_BASE(wxWindow *parent, wxWindowID id=wxID_ANY, const wxPoint &pos=wxDefaultPosition, const wxSize &size=wxSize(-1,-1), long style=wxTAB_TRAVERSAL, const wxString &name=wxEmptyString)
void onBomFieldsClick(wxCommandEvent &aEvent) override
std::function< void()> m_contentChanged
void SetBomFields(const IPC2581_BOM_FIELDS &aFields)
void SetContentChanged(std::function< void()> aCallback)
const IPC2581_BOM_FIELDS & GetBomFields() const
void onVariantOutputChange(wxCommandEvent &aEvent) override
void SetSectionKey(const std::optional< wxString > &aKey)
void SetRefDes(JOB_EXPORT_PCB_IPC2581::REF_DES aRefDes)
void onVariantChange(wxCommandEvent &aEvent) override
PANEL_FAB_EXPORT_CONTENT(wxWindow *aParent, wxWindowID aId=wxID_ANY, const wxPoint &aPos=wxDefaultPosition, const wxSize &aSize=wxDefaultSize, long aStyle=wxTAB_TRAVERSAL, const wxString &aName=wxEmptyString)
void onDataSetChange(wxCommandEvent &aEvent) override
void SetVariantNames(const std::vector< wxString > &aNames)
void onCustomizeClick(wxCommandEvent &aEvent) override
std::vector< wxString > GetVariantNames() const
void updateSummary()
Set the Includes line and BOM Fields button from the function mode.
std::optional< wxString > m_sectionKey
Set after Customize An empty IPC-2581 key is a true empty selection.
void SetNetNames(JOB_EXPORT_PCB_FAB::NET_NAMES aNetNames)
JOB_EXPORT_PCB_FAB::NET_NAMES GetNetNames() const
const std::optional< wxString > & GetSectionKey() const
JOB_EXPORT_PCB_IPC2581::REF_DES GetRefDes() const
FAB::SECTION_SET ResolvedSections() const
void SetCombinedVariantOutput(bool aCombined)
void Configure(FAB_CONTENT_FORMAT aFormat, BOARD *aBoard)
std::vector< FAB::MODE > m_modes
std::vector< wxString > m_selectedVariants
JOB_EXPORT_PCB_FAB::DATA_SET MODE
Columns of Table 4 The job owns the enum so that every layer shares one type.
Fields that supply the IPC-2581 BOM section.