Commit 24ce9409 authored by charras's avatar charras
Browse files

more about Netclasses work

parent 9b4d215b
Loading
Loading
Loading
Loading
+6 −6
Original line number Original line Diff line number Diff line
@@ -51,11 +51,11 @@ class GENERAL_COLLECTORS_GUIDE;
class WinEDA_PcbFrame: public WinEDA_BasePcbFrame
class WinEDA_PcbFrame: public WinEDA_BasePcbFrame
{
{
public:
public:
    WinEDAChoiceBox* m_SelLayerBox;
    WinEDAChoiceBox* m_SelLayerBox;         // a combo box to display and select active layer
    WinEDAChoiceBox* m_SelTrackWidthBox;
    WinEDAChoiceBox* m_SelTrackWidthBox;    // a combo box to display and select current track width
    wxTextCtrl* m_ClearanceBox;
    WinEDAChoiceBox* m_SelViaSizeBox;       // a combo box to display and select current via diameter
    wxTextCtrl* m_NetClassSelectedBox;
    wxTextCtrl* m_ClearanceBox;             // a text ctrl to display the current tracks and vias clearance
    WinEDAChoiceBox* m_SelViaSizeBox;
    wxTextCtrl* m_NetClassSelectedBox;      // a text ctrl to display the current NetClass


private:
private:
    bool             m_TrackAndViasSizesList_Changed;
    bool             m_TrackAndViasSizesList_Changed;
@@ -90,6 +90,7 @@ public:


    void             OnCloseWindow( wxCloseEvent& Event );
    void             OnCloseWindow( wxCloseEvent& Event );
    void             Process_Special_Functions( wxCommandEvent& event );
    void             Process_Special_Functions( wxCommandEvent& event );
    void             Tracks_and_Vias_Size_Event( wxCommandEvent& event );


    void             ProcessMuWaveFunctions( wxCommandEvent& event );
    void             ProcessMuWaveFunctions( wxCommandEvent& event );
    void             MuWaveCommand( wxDC* DC, const wxPoint& MousePos );
    void             MuWaveCommand( wxDC* DC, const wxPoint& MousePos );
@@ -388,7 +389,6 @@ public:


    // Track and via edition:
    // Track and via edition:
    void             Via_Edit_Control( wxCommandEvent& event );
    void             Via_Edit_Control( wxCommandEvent& event );
    void             DisplayTrackSettings();


    /**
    /**
     * Function Other_Layer_Route
     * Function Other_Layer_Route
−196 B (192 KiB)

File changed.

No diff preview for this file type.

+730 −687

File changed.

Preview size limit exceeded, changes collapsed.

+1 −0
Original line number Original line Diff line number Diff line
@@ -79,6 +79,7 @@ set(PCBNEW_SRCS
    edit_pcb_text.cpp
    edit_pcb_text.cpp
    edit_track_width.cpp
    edit_track_width.cpp
    edtxtmod.cpp
    edtxtmod.cpp
    event_handlers_tracks_vias_sizes.cpp
    export_gencad.cpp
    export_gencad.cpp
    files.cpp
    files.cpp
    find.cpp
    find.cpp
+26 −1
Original line number Original line Diff line number Diff line
@@ -81,10 +81,13 @@ BOARD::~BOARD()
 * Must be called after a netclass selection (or after a netclass parameter change
 * Must be called after a netclass selection (or after a netclass parameter change
 * Initialise vias and tracks values displayed in comb boxs of the auxiliary toolbar
 * Initialise vias and tracks values displayed in comb boxs of the auxiliary toolbar
 * and some others parametres (netclass name ....)
 * and some others parametres (netclass name ....)
 * @param aNetClassName = the new netclass name
 * @return true if lists of tracks and vias sizes are modified
 */
 */
 void BOARD::SetCurrentNetClass( const wxString & aNetClassName)
 bool BOARD::SetCurrentNetClass( const wxString & aNetClassName)
{
{
    NETCLASS * netClass = m_NetClasses.Find(aNetClassName);
    NETCLASS * netClass = m_NetClasses.Find(aNetClassName);
    bool lists_sizes_modified = false;


    // if not found (should not happen) use the default
    // if not found (should not happen) use the default
    if ( netClass == NULL )
    if ( netClass == NULL )
@@ -94,12 +97,34 @@ BOARD::~BOARD()


    // Initialize others values:
    // Initialize others values:
    if( m_ViaSizeHistory.size() == 0 )
    if( m_ViaSizeHistory.size() == 0 )
    {
        lists_sizes_modified = true;
        m_ViaSizeHistory.push_back(0);
        m_ViaSizeHistory.push_back(0);
    }
    if( m_TrackWidthHistory.size() == 0 )
    if( m_TrackWidthHistory.size() == 0 )
    {
        lists_sizes_modified = true;
        m_TrackWidthHistory.push_back(0);
        m_TrackWidthHistory.push_back(0);
    }


    if( m_ViaSizeHistory[0] != netClass->GetViaDiameter() )
        lists_sizes_modified = true;
    m_ViaSizeHistory[0] = netClass->GetViaDiameter();
    m_ViaSizeHistory[0] = netClass->GetViaDiameter();

    if( m_TrackWidthHistory[0] != netClass->GetTrackWidth() )
        lists_sizes_modified = true;
    m_TrackWidthHistory[0] = netClass->GetTrackWidth();
    m_TrackWidthHistory[0] = netClass->GetTrackWidth();

    if( m_ViaSizeSelector >= m_ViaSizeHistory.size() )
        m_ViaSizeSelector = m_ViaSizeHistory.size();
    if( m_TrackWidthSelector >= m_TrackWidthHistory.size() )
        m_TrackWidthSelector = m_TrackWidthHistory.size();

    //Initialize track and via current size:
    g_DesignSettings.m_CurrentViaSize = m_ViaSizeHistory[m_ViaSizeSelector];
    g_DesignSettings.m_CurrentTrackWidth = m_TrackWidthHistory[m_TrackWidthSelector];

    return lists_sizes_modified;
}
}


wxString BOARD::GetLayerName( int aLayerIndex ) const
wxString BOARD::GetLayerName( int aLayerIndex ) const
Loading