File: dialog_track_via_properties.h

package info (click to toggle)
kicad 9.0.2%2Bdfsg-1
  • links: PTS, VCS
  • area: main
  • in suites: trixie
  • size: 769,124 kB
  • sloc: cpp: 960,330; ansic: 121,001; xml: 66,428; python: 18,382; sh: 1,010; awk: 301; asm: 292; makefile: 227; javascript: 167; perl: 10
file content (94 lines) | stat: -rw-r--r-- 3,642 bytes parent folder | download | duplicates (4)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
/*
 * This program source code file is part of KiCad, a free EDA CAD application.
 *
 * Copyright (C) 2015 CERN
 * Copyright The KiCad Developers, see AUTHORS.txt for contributors.
 * @author Maciej Suminski <maciej.suminski@cern.ch>
 *
 * This program is free software; you can redistribute it and/or
 * modify it under the terms of the GNU General Public License
 * as published by the Free Software Foundation; either version 2
 * of the License, or (at your option) any later version.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with this program; if not, you may find one here:
 * http://www.gnu.org/licenses/old-licenses/gpl-2.0.html
 * or you may search the http://www.gnu.org website for the version 2 license,
 * or you may write to the Free Software Foundation, Inc.,
 * 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA
 */

#include <dialogs/dialog_track_via_properties_base.h>
#include <widgets/unit_binder.h>
#include <optional>
#include <layer_ids.h>

class PCB_SELECTION;
class PCB_BASE_EDIT_FRAME;
class PAD;
class PADSTACK;

class DIALOG_TRACK_VIA_PROPERTIES : public DIALOG_TRACK_VIA_PROPERTIES_BASE
{
public:
    DIALOG_TRACK_VIA_PROPERTIES( PCB_BASE_EDIT_FRAME* aParent, const PCB_SELECTION& aItems );

    ~DIALOG_TRACK_VIA_PROPERTIES();

    bool TransferDataFromWindow() override;

private:
    void onNetSelector( wxCommandEvent& aEvent );
    void onViaNotFreeClicked( wxCommandEvent& aEvent ) override;
    void onWidthSelect( wxCommandEvent& aEvent ) override;
    void onWidthEdit( wxCommandEvent& aEvent ) override;
    void onViaSelect( wxCommandEvent& aEvent ) override;
    void onViaEdit( wxCommandEvent& aEvent ) override;
    void onTentingLinkToggle( wxCommandEvent& event ) override;
    void onFrontTentingChanged( wxCommandEvent& event ) override;
    void onTrackEdit( wxCommandEvent& aEvent ) override;
    void onPadstackModeChanged( wxCommandEvent& aEvent ) override;
    void onEditLayerChanged( wxCommandEvent& aEvent ) override;

    void onUnitsChanged( wxCommandEvent& aEvent );
    void onTeardropsUpdateUi( wxUpdateUIEvent& event ) override;

    bool confirmShortingNets( int aNet, const std::set<int>& shortingNets );
    bool confirmPadChange( const std::set<PAD*>& connectedPads );

    int getLayerDepth();
    void afterPadstackModeChanged();

private:
    PCB_BASE_EDIT_FRAME* m_frame;
    const PCB_SELECTION& m_items;      // List of items to be modified.

    UNIT_BINDER          m_trackStartX, m_trackStartY;
    UNIT_BINDER          m_trackEndX, m_trackEndY;
    UNIT_BINDER          m_trackWidth;
    UNIT_BINDER          m_trackMaskMargin;

    UNIT_BINDER          m_viaX, m_viaY;
    UNIT_BINDER          m_viaDiameter, m_viaDrill;

    UNIT_BINDER          m_teardropHDPercent;
    UNIT_BINDER          m_teardropLenPercent;
    UNIT_BINDER          m_teardropMaxLen;
    UNIT_BINDER          m_teardropWidthPercent;
    UNIT_BINDER          m_teardropMaxWidth;

    bool                 m_tracks;     // True if dialog displays any track properties.
    bool                 m_vias;       // True if dialog displays any via properties.

    /// Temporary padstack of the edited via(s)
    std::unique_ptr<PADSTACK> m_viaStack;

    /// The currently-shown copper layer of the edited via(s)
    PCB_LAYER_ID m_editLayer;
    std::map<int, PCB_LAYER_ID> m_editLayerCtrlMap;
};