KiCad PCB EDA Suite
Loading...
Searching...
No Matches
panel_pth_size.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
22#include "panel_pth_size_base.h"
23
24#include <pth_hole_size.h>
25
26
28
29
31{
32public:
33 PANEL_PTH_SIZE( wxWindow* parent, wxWindowID id = wxID_ANY, const wxPoint& pos = wxDefaultPosition,
34 const wxSize& size = wxDefaultSize, long style = wxTAB_TRAVERSAL,
35 const wxString& name = wxEmptyString );
37
38 // Methods from CALCULATOR_PANEL that must be overridden
39 void LoadSettings( PCB_CALCULATOR_SETTINGS* aCfg ) override;
40 void SaveSettings( PCB_CALCULATOR_SETTINGS* aCfg ) override;
41 void ThemeChanged() override;
42
43 // Event handlers from PANEL_PTH_SIZE_BASE
44 void OnControlsChanged( wxCommandEvent& aEvent ) override;
45 void OnValueChanged( wxCommandEvent& aEvent ) override;
46 void OnPreviewSettingCb( wxCommandEvent& aEvent ) override;
47 void OnCopyReportText( wxCommandEvent& aEvent ) override;
48
49private:
51 void recalculate();
52 void updateLeadShapeUI();
53 void updateStandard();
54 void updateSummaryTable();
55 void refreshPreview();
56
57 const PTH_HOLE_SIZE_STANDARD* m_holeSizeStandard = nullptr; // Points into the standard registry
58
60 int m_level = 1; // KiCad libraries use IPC level B by default
61
62 // The last valid calculation, kept so the preview and report can be redrawn without
63 // recalculating (e.g. when only a preview overlay setting changes).
66 int m_lastHoleIU = 0; // Recommended hole
67 int m_lastPadIU = 0; // Pad outer diameter
68};
const char * name
PANEL_PTH_SIZE_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 populateStandardChoice()
void OnPreviewSettingCb(wxCommandEvent &aEvent) override
void ThemeChanged() override
Update UI elements of the panel when the theme changes to ensure the images and fonts/colors are appr...
void SaveSettings(PCB_CALCULATOR_SETTINGS *aCfg) override
Save the settings from the panel.
void OnControlsChanged(wxCommandEvent &aEvent) override
PANEL_PTH_SIZE(wxWindow *parent, wxWindowID id=wxID_ANY, const wxPoint &pos=wxDefaultPosition, const wxSize &size=wxDefaultSize, long style=wxTAB_TRAVERSAL, const wxString &name=wxEmptyString)
void LoadSettings(PCB_CALCULATOR_SETTINGS *aCfg) override
Load the settings into the panel.
PTH_HOLE_SIZE_RESULT m_lastRange
void OnCopyReportText(wxCommandEvent &aEvent) override
void OnValueChanged(wxCommandEvent &aEvent) override
PTH_LEAD_SHAPE m_leadShape
const PTH_HOLE_SIZE_STANDARD * m_holeSizeStandard
PTH_LEAD_DEF m_lastLead
A source of hole size rules for a plated through hole.
PTH_LEAD_SHAPE