Commit 4fcaf4c5 authored by Maciej Suminski's avatar Maciej Suminski
Browse files

Minor BOARD_DESIGN_SETTINGS refactoring.

Removed SetCurrentClassName() (it was not used anywhere and less safe than SetCurrentClass()).
Added BOARD_DESIGN_SETTIGNS::GetDefault() to make some pieces of shorter and clearer.
parent b2a5b2f3
Loading
Loading
Loading
Loading
+10 −8
Original line number Original line Diff line number Diff line
@@ -102,18 +102,22 @@ public:
    BOARD_DESIGN_SETTINGS();
    BOARD_DESIGN_SETTINGS();


    /**
    /**
     * Function SetCurrentNetClassName
     * Function GetDefault
     * sets the current net class name to \a aName.
     * @return the default netclass.
     *
     * @param aName is a reference to a wxString object containing the current net class name.
     */
     */
    void SetCurrentNetClassName( const wxString& aName ) { m_currentNetClassName = aName; }
    inline NETCLASS* GetDefault() const
    {
        return m_NetClasses.GetDefault();
    }


    /**
    /**
     * Function GetCurrentNetClassName
     * Function GetCurrentNetClassName
     * @return the current net class name.
     * @return the current net class name.
     */
     */
    const wxString& GetCurrentNetClassName() const { return m_currentNetClassName; }
    const wxString& GetCurrentNetClassName() const
    {
        return m_currentNetClassName;
    }


    /**
    /**
     * Function SetCurrentNetClass
     * Function SetCurrentNetClass
@@ -275,8 +279,6 @@ public:
        return m_customViaSize.m_Drill;
        return m_customViaSize.m_Drill;
    }
    }


    // TODO microvia methods should go here

    /**
    /**
     * Function UseCustomTrackViaSize
     * Function UseCustomTrackViaSize
     * Enables/disables custom track/via size settings. If enabled, values set with
     * Enables/disables custom track/via size settings. If enabled, values set with
+1 −1
Original line number Original line Diff line number Diff line
@@ -201,7 +201,7 @@ void PlaceCells( BOARD* aPcb, int net_code, int flag )
    LAYER_MSK layerMask;
    LAYER_MSK layerMask;


    // use the default NETCLASS?
    // use the default NETCLASS?
    NETCLASS* nc = aPcb->GetDesignSettings().m_NetClasses.GetDefault();
    NETCLASS* nc = aPcb->GetDesignSettings().GetDefault();


    int       trackWidth = nc->GetTrackWidth();
    int       trackWidth = nc->GetTrackWidth();
    int       clearance  = nc->GetClearance();
    int       clearance  = nc->GetClearance();
+1 −1
Original line number Original line Diff line number Diff line
@@ -280,7 +280,7 @@ int PCB_EDIT_FRAME::Solve( wxDC* DC, int aLayersCount )


    m_canvas->SetAbortRequest( false );
    m_canvas->SetAbortRequest( false );


    s_Clearance = GetBoard()->GetDesignSettings().m_NetClasses.GetDefault()->GetClearance();
    s_Clearance = GetBoard()->GetDesignSettings().GetDefault()->GetClearance();


    // Prepare the undo command info
    // Prepare the undo command info
    s_ItemsListPicker.ClearListAndDeleteItems();  // Should not be necessary, but...
    s_ItemsListPicker.ClearListAndDeleteItems();  // Should not be necessary, but...
+1 −1
Original line number Original line Diff line number Diff line
@@ -91,7 +91,7 @@ BOARD::BOARD() :
            m_Layer[layer].m_Type = LT_UNDEFINED;
            m_Layer[layer].m_Type = LT_UNDEFINED;
    }
    }


    NETCLASS* defaultClass = m_designSettings.m_NetClasses.GetDefault();
    NETCLASS* defaultClass = m_designSettings.GetDefault();
    defaultClass->SetDescription( _( "This is the default net class." ) );
    defaultClass->SetDescription( _( "This is the default net class." ) );


    // Initialize default values in default netclass.
    // Initialize default values in default netclass.
+2 −2
Original line number Original line Diff line number Diff line
@@ -144,7 +144,7 @@ NETCLASS* BOARD_CONNECTED_ITEM::GetNetClass() const
    if( netclass )
    if( netclass )
        return netclass;
        return netclass;
    else
    else
        return board->GetDesignSettings().m_NetClasses.GetDefault();
        return board->GetDesignSettings().GetDefault();
}
}




@@ -158,7 +158,7 @@ wxString BOARD_CONNECTED_ITEM::GetNetClassName() const
    else
    else
    {
    {
        BOARD*  board = GetBoard();
        BOARD*  board = GetBoard();
        name = board->GetDesignSettings().m_NetClasses.GetDefault()->GetName();
        name = NETCLASS::Default;
    }
    }


    return name;
    return name;
Loading