Improve clarity of default zone settings.
This commit is contained in:
parent
d9737a39bf
commit
0890ac57dd
|
@ -182,9 +182,6 @@ public:
|
|||
*/
|
||||
void SetDisplayOptions( const PCB_DISPLAY_OPTIONS& aOptions, bool aRefresh = true );
|
||||
|
||||
const ZONE_SETTINGS& GetZoneSettings() const;
|
||||
void SetZoneSettings( const ZONE_SETTINGS& aSettings );
|
||||
|
||||
/**
|
||||
* Return the #PCB_PLOT_PARAMS for the BOARD owned by this frame.
|
||||
*/
|
||||
|
|
|
@ -771,17 +771,6 @@ BOARD_DESIGN_SETTINGS& BOARD::GetDesignSettings() const
|
|||
}
|
||||
|
||||
|
||||
const ZONE_SETTINGS& BOARD::GetZoneSettings() const
|
||||
{
|
||||
return GetDesignSettings().GetDefaultZoneSettings();
|
||||
}
|
||||
|
||||
|
||||
void BOARD::SetZoneSettings( const ZONE_SETTINGS& aSettings )
|
||||
{
|
||||
GetDesignSettings().SetDefaultZoneSettings( aSettings );
|
||||
}
|
||||
|
||||
int BOARD::GetMaxClearanceValue() const
|
||||
{
|
||||
int worstClearance = m_designSettings->GetBiggestClearanceValue();
|
||||
|
|
|
@ -642,10 +642,6 @@ public:
|
|||
*/
|
||||
BOARD_DESIGN_SETTINGS& GetDesignSettings() const;
|
||||
|
||||
const ZONE_SETTINGS& GetZoneSettings() const override;
|
||||
|
||||
void SetZoneSettings( const ZONE_SETTINGS& aSettings ) override;
|
||||
|
||||
// Tented vias are vias covered by solder mask. So because the solder mask is a negative
|
||||
// layer, tented vias are NOT plotted on solder mask layers
|
||||
bool GetTentVias() const { return !m_plotOptions.GetPlotViaOnMaskLayer(); }
|
||||
|
|
|
@ -79,26 +79,6 @@ public:
|
|||
Remove( aItem );
|
||||
delete aItem;
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Fetch the zone settings for this container
|
||||
*/
|
||||
virtual const ZONE_SETTINGS& GetZoneSettings() const
|
||||
{
|
||||
return m_zoneSettings;
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Set the zone settings for this container
|
||||
* @param aSettings new Zone settings for this container
|
||||
*/
|
||||
virtual void SetZoneSettings( const ZONE_SETTINGS& aSettings )
|
||||
{
|
||||
m_zoneSettings = aSettings;
|
||||
}
|
||||
|
||||
private:
|
||||
ZONE_SETTINGS m_zoneSettings;
|
||||
};
|
||||
|
||||
#endif /* BOARD_ITEM_CONTAINER_H */
|
||||
|
|
|
@ -29,6 +29,7 @@
|
|||
#include <pcb_edit_frame.h>
|
||||
#include <pcbnew_settings.h>
|
||||
#include <board_commit.h>
|
||||
#include <board_design_settings.h>
|
||||
#include <tool/tool_manager.h>
|
||||
#include <tool/actions.h>
|
||||
#include <zone.h>
|
||||
|
@ -40,7 +41,7 @@
|
|||
void PCB_EDIT_FRAME::Edit_Zone_Params( ZONE* aZone )
|
||||
{
|
||||
int dialogResult;
|
||||
ZONE_SETTINGS zoneInfo = GetZoneSettings();
|
||||
ZONE_SETTINGS zoneInfo = m_pcb->GetDesignSettings().GetDefaultZoneSettings();
|
||||
PICKED_ITEMS_LIST pickedList; // zones for undo/redo command
|
||||
PICKED_ITEMS_LIST deletedList; // zones that have been deleted when combined
|
||||
BOARD_COMMIT commit( this );
|
||||
|
@ -74,7 +75,7 @@ void PCB_EDIT_FRAME::Edit_Zone_Params( ZONE* aZone )
|
|||
return;
|
||||
}
|
||||
|
||||
SetZoneSettings( zoneInfo );
|
||||
m_pcb->GetDesignSettings().SetDefaultZoneSettings( zoneInfo );
|
||||
OnModify();
|
||||
|
||||
if( dialogResult == ZONE_EXPORT_VALUES )
|
||||
|
|
|
@ -581,18 +581,6 @@ void PCB_BASE_FRAME::SetDrawBgColor( const COLOR4D& aColor )
|
|||
}
|
||||
|
||||
|
||||
const ZONE_SETTINGS& PCB_BASE_FRAME::GetZoneSettings() const
|
||||
{
|
||||
return m_pcb->GetDesignSettings().GetDefaultZoneSettings();
|
||||
}
|
||||
|
||||
|
||||
void PCB_BASE_FRAME::SetZoneSettings( const ZONE_SETTINGS& aSettings )
|
||||
{
|
||||
m_pcb->GetDesignSettings().SetDefaultZoneSettings( aSettings );
|
||||
}
|
||||
|
||||
|
||||
const PCB_PLOT_PARAMS& PCB_BASE_FRAME::GetPlotSettings() const
|
||||
{
|
||||
return m_pcb->GetPlotOptions();
|
||||
|
|
|
@ -905,7 +905,7 @@ void PCB_IO_KICAD_LEGACY::loadSHEET()
|
|||
void PCB_IO_KICAD_LEGACY::loadSETUP()
|
||||
{
|
||||
BOARD_DESIGN_SETTINGS& bds = m_board->GetDesignSettings();
|
||||
ZONE_SETTINGS zoneSettings = m_board->GetZoneSettings();
|
||||
ZONE_SETTINGS zoneSettings = bds.GetDefaultZoneSettings();
|
||||
std::shared_ptr<NETCLASS> defaultNetclass = bds.m_NetSettings->m_DefaultNetClass;
|
||||
char* line;
|
||||
char* saveptr;
|
||||
|
@ -1146,7 +1146,7 @@ void PCB_IO_KICAD_LEGACY::loadSETUP()
|
|||
}
|
||||
else if( TESTLINE( "$EndSETUP" ) )
|
||||
{
|
||||
m_board->SetZoneSettings( zoneSettings );
|
||||
bds.SetDefaultZoneSettings( zoneSettings );
|
||||
|
||||
// Very old *.brd file does not have NETCLASSes
|
||||
// "TrackWidth", "ViaSize", "ViaDrill", "ViaMinSize", and "TrackClearence" were
|
||||
|
|
|
@ -468,7 +468,7 @@ int CONVERT_TOOL::CreatePolys( const TOOL_EVENT& aEvent )
|
|||
// Creating zone or keepout
|
||||
PCB_BASE_EDIT_FRAME* frame = getEditFrame<PCB_BASE_EDIT_FRAME>();
|
||||
BOARD_ITEM_CONTAINER* parent = frame->GetModel();
|
||||
ZONE_SETTINGS zoneInfo = frame->GetZoneSettings();
|
||||
ZONE_SETTINGS zoneInfo = bds.GetDefaultZoneSettings();
|
||||
|
||||
bool nonCopper = IsNonCopperLayer( destLayer );
|
||||
zoneInfo.m_Layers.reset().set( destLayer );
|
||||
|
|
|
@ -92,7 +92,7 @@ std::unique_ptr<ZONE> ZONE_CREATE_HELPER::createNewZone( bool aKeepout )
|
|||
std::set<int> highlightedNets = board->GetHighLightNetCodes();
|
||||
|
||||
// Get the current default settings for zones
|
||||
ZONE_SETTINGS zoneInfo = frame->GetZoneSettings();
|
||||
ZONE_SETTINGS zoneInfo = board->GetDesignSettings().GetDefaultZoneSettings();
|
||||
zoneInfo.m_Layers.reset().set( m_params.m_layer ); // TODO(JE) multilayer defaults?
|
||||
zoneInfo.m_NetcodeSelection = highlightedNets.empty() ? -1 : *highlightedNets.begin();
|
||||
zoneInfo.SetIsRuleArea( m_params.m_keepout );
|
||||
|
|
|
@ -73,7 +73,7 @@ ZONE::ZONE( BOARD_ITEM_CONTAINER* aParent ) :
|
|||
m_hatchThickness = m_ZoneMinThickness;
|
||||
m_hatchGap = m_ZoneMinThickness;
|
||||
|
||||
aParent->GetZoneSettings().ExportSetting( *this );
|
||||
aParent->GetBoard()->GetDesignSettings().GetDefaultZoneSettings().ExportSetting( *this );
|
||||
|
||||
m_needRefill = false; // True only after edits.
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue