本文整理汇总了C++中ZONE_SETTINGS类的典型用法代码示例。如果您正苦于以下问题:C++ ZONE_SETTINGS类的具体用法?C++ ZONE_SETTINGS怎么用?C++ ZONE_SETTINGS使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了ZONE_SETTINGS类的11个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。
示例1: ZONE_CONTAINER
void PCB_EDIT_FRAME::duplicateZone( wxDC* aDC, ZONE_CONTAINER* aZone )
{
ZONE_CONTAINER* newZone = new ZONE_CONTAINER( GetBoard() );
newZone->Copy( aZone );
newZone->UnFill();
ZONE_SETTINGS zoneSettings;
zoneSettings << *aZone;
bool success;
if( aZone->GetIsKeepout() )
success = InvokeKeepoutAreaEditor( this, &zoneSettings );
else if( aZone->IsOnCopperLayer() )
success = InvokeCopperZonesEditor( this, &zoneSettings );
else
success = InvokeNonCopperZonesEditor( this, aZone, &zoneSettings );
if( success )
{
zoneSettings.ExportSetting( *newZone );
newZone->m_Poly->Hatch();
s_AuxiliaryList.ClearListAndDeleteItems();
s_PickedList.ClearListAndDeleteItems();
SaveCopyOfZones( s_PickedList, GetBoard(), newZone->GetNet(), newZone->GetLayer() );
GetBoard()->Add( newZone );
ITEM_PICKER picker( newZone, UR_NEW );
s_PickedList.PushItem( picker );
GetScreen()->SetCurItem( NULL ); // This outline may be deleted when merging outlines
// Combine zones if possible
GetBoard()->OnAreaPolygonModified( &s_AuxiliaryList, newZone );
// Redraw zones
GetBoard()->RedrawAreasOutlines( m_canvas, aDC, GR_OR, newZone->GetLayer() );
GetBoard()->RedrawFilledAreas( m_canvas, aDC, GR_OR, newZone->GetLayer() );
if( GetBoard()->GetAreaIndex( newZone ) >= 0
&& GetBoard()->Test_Drc_Areas_Outlines_To_Areas_Outlines( newZone, true ) )
{
DisplayError( this, _( "Duplicate Zone: The outline of the duplicated zone fails DRC check!" ) );
}
UpdateCopyOfZonesList( s_PickedList, s_AuxiliaryList, GetBoard() );
SaveCopyInUndoList( s_PickedList, UR_UNSPECIFIED );
s_PickedList.ClearItemsList();
OnModify();
}
else
delete newZone;
}
开发者ID:james-sakalaukus,项目名称:kicad,代码行数:54,代码来源:zones_by_polygon.cpp
示例2: ZoneDuplicate
int PCB_EDITOR_CONTROL::ZoneDuplicate( const TOOL_EVENT& aEvent )
{
auto selTool = m_toolMgr->GetTool<SELECTION_TOOL>();
const auto& selection = selTool->GetSelection();
// because this pops up the zone editor, it would be confusing
// to handle multiple zones, so just handle single selections
// containing exactly one zone
if( selection.Size() != 1 )
return 0;
auto oldZone = dyn_cast<ZONE_CONTAINER*>( selection[0] );
if( !oldZone )
return 0;
auto newZone = std::make_unique<ZONE_CONTAINER>( *oldZone );
newZone->ClearSelected();
newZone->UnFill();
ZONE_SETTINGS zoneSettings;
zoneSettings << *oldZone;
bool success = false;
if( oldZone->GetIsKeepout() )
success = InvokeKeepoutAreaEditor( m_frame, &zoneSettings );
else if( oldZone->IsOnCopperLayer() )
success = InvokeCopperZonesEditor( m_frame, &zoneSettings );
else
success = InvokeNonCopperZonesEditor( m_frame, oldZone, &zoneSettings );
// If the new zone is on the same layer as the the initial zone,
// do nothing
if( success && ( oldZone->GetLayer() == zoneSettings.m_CurrentZone_Layer ) )
{
DisplayError( m_frame,
_( "The duplicated zone cannot be on the same layer as the original zone." ) );
success = false;
}
// duplicate the zone
if( success )
{
BOARD_COMMIT commit( m_frame );
zoneSettings.ExportSetting( *newZone );
commit.Add( newZone.release() );
commit.Push( _( "Duplicate zone" ) );
}
return 0;
}
开发者ID:hyOzd,项目名称:kicad-source-mirror,代码行数:52,代码来源:pcb_editor_control.cpp
示例3: TransferDataFromWindow
bool DIALOG_NON_COPPER_ZONES_EDITOR::TransferDataFromWindow()
{
m_settings.SetCornerSmoothingType( m_cornerSmoothingChoice->GetSelection() );
m_settings.SetCornerRadius( m_settings.GetCornerSmoothingType() == ZONE_SETTINGS::SMOOTHING_NONE
? 0 : m_cornerRadius.GetValue() );
if( !m_gridStyleRotation.Validate( -1800, 1800 ) )
return false;
m_settings.m_ZoneMinThickness = m_minWidth.GetValue();
switch( m_OutlineAppearanceCtrl->GetSelection() )
{
case 0: m_settings.m_Zone_HatchingStyle = ZONE_CONTAINER::NO_HATCH; break;
case 1: m_settings.m_Zone_HatchingStyle = ZONE_CONTAINER::DIAGONAL_EDGE; break;
case 2: m_settings.m_Zone_HatchingStyle = ZONE_CONTAINER::DIAGONAL_FULL; break;
}
if( m_GridStyleCtrl->GetSelection() > 0 )
m_settings.m_FillMode = ZFM_HATCH_PATTERN;
else
m_settings.m_FillMode = ZFM_POLYGONS;
if( m_settings.m_FillMode == ZFM_HATCH_PATTERN )
{
int minThickness = m_minWidth.GetValue();
if( !m_gridStyleThickness.Validate( minThickness, INT_MAX ) )
return false;
if( !m_gridStyleGap.Validate( minThickness, INT_MAX ) )
return false;
}
m_settings.m_HatchFillTypeOrientation = m_gridStyleRotation.GetValue()/10.0; // value is returned in deci-degree
m_settings.m_HatchFillTypeThickness = m_gridStyleThickness.GetValue();
m_settings.m_HatchFillTypeGap = m_gridStyleGap.GetValue();
m_settings.m_HatchFillTypeSmoothingLevel = m_spinCtrlSmoothLevel->GetValue();
m_settings.m_HatchFillTypeSmoothingValue = m_spinCtrlSmoothValue->GetValue();
wxConfigBase* cfg = Kiface().KifaceSettings();
wxASSERT( cfg );
cfg->Write( ZONE_NET_OUTLINES_STYLE_KEY, (long) m_settings.m_Zone_HatchingStyle );
m_settings.m_Zone_45_Only = m_ConstrainOpt->GetValue();
// Get the layer selection for this zone
int layer = -1;
for( int ii = 0; ii < m_layers->GetItemCount(); ++ii )
{
if( m_layers->GetToggleValue( (unsigned) ii, 0 ) )
{
layer = ii;
break;
}
}
if( layer < 0 )
{
DisplayError( this, _( "No layer selected." ) );
return false;
}
*m_ptr = m_settings;
return true;
}
开发者ID:KiCad,项目名称:kicad-source-mirror,代码行数:70,代码来源:dialog_non_copper_zones_properties.cpp
示例4: GetZoneSettings
void PCB_EDIT_FRAME::Edit_Zone_Params( wxDC* DC, ZONE_CONTAINER* aZone )
{
ZONE_EDIT_T edited;
ZONE_SETTINGS zoneInfo = GetZoneSettings();
m_canvas->SetIgnoreMouseEvents( true );
// Save initial zones configuration, for undo/redo, before adding new zone
// note the net name and the layer can be changed, so we must save all zones
s_AuxiliaryList.ClearListAndDeleteItems();
s_PickedList.ClearListAndDeleteItems();
SaveCopyOfZones(s_PickedList, GetBoard(), -1, -1 );
if( aZone->GetIsKeepout() )
{
// edit a keepout area on a copper layer
zoneInfo << *aZone;
edited = InvokeKeepoutAreaEditor( this, &zoneInfo );
}
else if( aZone->GetLayer() < FIRST_NO_COPPER_LAYER )
{
// edit a zone on a copper layer
zoneInfo << *aZone;
edited = InvokeCopperZonesEditor( this, &zoneInfo );
}
else
{
edited = InvokeNonCopperZonesEditor( this, aZone, &zoneInfo );
}
m_canvas->MoveCursorToCrossHair();
m_canvas->SetIgnoreMouseEvents( false );
if( edited == ZONE_ABORT )
{
s_AuxiliaryList.ClearListAndDeleteItems();
s_PickedList.ClearListAndDeleteItems();
return;
}
SetZoneSettings( zoneInfo );
if( edited == ZONE_EXPORT_VALUES )
{
UpdateCopyOfZonesList( s_PickedList, s_AuxiliaryList, GetBoard() );
SaveCopyInUndoList(s_PickedList, UR_UNSPECIFIED);
s_PickedList.ClearItemsList(); // s_ItemsListPicker is no more owner of picked items
return;
}
// Undraw old zone outlines
for( int ii = 0; ii < GetBoard()->GetAreaCount(); ii++ )
{
ZONE_CONTAINER* edge_zone = GetBoard()->GetArea( ii );
edge_zone->Draw( m_canvas, DC, GR_XOR );
}
zoneInfo.ExportSetting( *aZone );
NETINFO_ITEM* net = GetBoard()->FindNet( zoneInfo.m_NetcodeSelection );
if( net ) // net == NULL should not occur
aZone->SetNetName( net->GetNetname() );
// Combine zones if possible
GetBoard()->OnAreaPolygonModified( &s_AuxiliaryList, aZone );
// Redraw the real new zone outlines
GetBoard()->RedrawAreasOutlines( m_canvas, DC, GR_OR, -1 );
UpdateCopyOfZonesList( s_PickedList, s_AuxiliaryList, GetBoard() );
SaveCopyInUndoList(s_PickedList, UR_UNSPECIFIED);
s_PickedList.ClearItemsList(); // s_ItemsListPicker is no longer owner of picked items
OnModify();
}
开发者ID:james-sakalaukus,项目名称:kicad,代码行数:79,代码来源:zones_by_polygon.cpp
示例5: assert
//.........这里部分代码省略.........
zone->ViewUpdate( KIGFX::VIEW_ITEM::GEOMETRY );
m_board->GetRatsnest()->Update( zone );
m_frame->OnModify();
m_frame->SaveCopyInUndoList( zone, UR_NEW );
zone = NULL;
}
else
{
delete zone;
zone = NULL;
}
numPoints = 0;
m_controls->SetAutoPan( false );
m_controls->CaptureCursor( false );
if( direction45 )
{
preview.Remove( &line45 );
direction45 = false;
}
preview.FreeItems();
updatePreview = true;
}
else
{
if( numPoints == 0 ) // it's the first click
{
// Get the current default settings for zones
ZONE_SETTINGS zoneInfo = m_frame->GetZoneSettings();
zoneInfo.m_CurrentZone_Layer = m_frame->GetScreen()->m_Active_Layer;
m_controls->SetAutoPan( true );
m_controls->CaptureCursor( true );
// Show options dialog
ZONE_EDIT_T dialogResult;
if( aKeepout )
dialogResult = InvokeKeepoutAreaEditor( m_frame, &zoneInfo );
else
{
if( IsCopperLayer( zoneInfo.m_CurrentZone_Layer ) )
dialogResult = InvokeCopperZonesEditor( m_frame, &zoneInfo );
else
dialogResult = InvokeNonCopperZonesEditor( m_frame, NULL, &zoneInfo );
}
if( dialogResult == ZONE_ABORT )
{
m_controls->SetAutoPan( false );
m_controls->CaptureCursor( false );
continue;
}
// Apply the selected settings
zone = new ZONE_CONTAINER( m_board );
zoneInfo.ExportSetting( *zone );
m_frame->GetGalCanvas()->SetTopLayer( zoneInfo.m_CurrentZone_Layer );
// Add the first point
zone->Outline()->Start( zoneInfo.m_CurrentZone_Layer,
开发者ID:hzeller,项目名称:kicad-source-mirror,代码行数:67,代码来源:drawing_tool.cpp
示例6: TransferDataToWindow
bool DIALOG_NON_COPPER_ZONES_EDITOR::TransferDataToWindow()
{
m_cornerSmoothingChoice->SetSelection( m_settings.GetCornerSmoothingType() );
m_cornerRadius.SetValue( m_settings.GetCornerRadius() );
m_minWidth.SetValue( m_settings.m_ZoneMinThickness );
m_ConstrainOpt->SetValue( m_settings.m_Zone_45_Only );
switch( m_settings.m_Zone_HatchingStyle )
{
case ZONE_CONTAINER::NO_HATCH: m_OutlineAppearanceCtrl->SetSelection( 0 ); break;
case ZONE_CONTAINER::DIAGONAL_EDGE: m_OutlineAppearanceCtrl->SetSelection( 1 ); break;
case ZONE_CONTAINER::DIAGONAL_FULL: m_OutlineAppearanceCtrl->SetSelection( 2 ); break;
}
SetInitialFocus( m_OutlineAppearanceCtrl );
switch( m_settings.m_FillMode )
{
case ZFM_HATCH_PATTERN:
m_GridStyleCtrl->SetSelection( 1 ); break;
default:
m_GridStyleCtrl->SetSelection( 0 ); break;
}
m_gridStyleRotation.SetUnits( DEGREES );
m_gridStyleRotation.SetValue( m_settings.m_HatchFillTypeOrientation*10 ); // IU is decidegree
// Gives a reasonable value to grid style parameters, if currently there are no defined
// parameters for grid pattern thickness and gap (if the value is 0)
// the grid pattern thickness default value is (arbitrary) m_ZoneMinThickness * 4
// or 1mm
// the grid pattern gap default value is (arbitrary) m_ZoneMinThickness * 6
// or 1.5 mm
int bestvalue = m_settings.m_HatchFillTypeThickness;
if( bestvalue <= 0 ) // No defined value for m_HatchFillTypeThickness
bestvalue = std::max( m_settings.m_ZoneMinThickness * 4, Millimeter2iu( 1.0 ) );
m_gridStyleThickness.SetValue( std::max( bestvalue, m_settings.m_ZoneMinThickness ) );
bestvalue = m_settings.m_HatchFillTypeGap;
if( bestvalue <= 0 ) // No defined value for m_HatchFillTypeGap
bestvalue = std::max( m_settings.m_ZoneMinThickness * 6, Millimeter2iu( 1.5 ) );
m_gridStyleGap.SetValue( std::max( bestvalue, m_settings.m_ZoneMinThickness ) );
m_spinCtrlSmoothLevel->SetValue( m_settings.m_HatchFillTypeSmoothingLevel );
m_spinCtrlSmoothValue->SetValue( m_settings.m_HatchFillTypeSmoothingValue );
// Enable/Disable some widgets
wxCommandEvent event;
OnStyleSelection( event );
return true;
}
开发者ID:KiCad,项目名称:kicad-source-mirror,代码行数:57,代码来源:dialog_non_copper_zones_properties.cpp
示例7: TransferDataToWindow
bool DIALOG_KEEPOUT_AREA_PROPERTIES::TransferDataToWindow()
{
// Init keepout parameters:
m_cbTracksCtrl->SetValue( m_zonesettings.GetDoNotAllowTracks() );
m_cbViasCtrl->SetValue( m_zonesettings.GetDoNotAllowVias() );
m_cbCopperPourCtrl->SetValue( m_zonesettings.GetDoNotAllowCopperPour() );
m_cbConstrainCtrl->SetValue( m_zonesettings.m_Zone_45_Only );
switch( m_zonesettings.m_Zone_HatchingStyle )
{
case ZONE_CONTAINER::NO_HATCH: m_OutlineAppearanceCtrl->SetSelection( 0 ); break;
case ZONE_CONTAINER::DIAGONAL_EDGE: m_OutlineAppearanceCtrl->SetSelection( 1 ); break;
case ZONE_CONTAINER::DIAGONAL_FULL: m_OutlineAppearanceCtrl->SetSelection( 2 ); break;
}
SetInitialFocus( m_OutlineAppearanceCtrl );
return true;
}
开发者ID:KiCad,项目名称:kicad-source-mirror,代码行数:20,代码来源:dialog_keepout_area_properties.cpp
示例8: ExportSetupToOtherCopperZones
void DIALOG_COPPER_ZONE::ExportSetupToOtherCopperZones( wxCommandEvent& event )
{
if( !AcceptOptions( true, true ) )
return;
// Export settings ( but layer and netcode ) to others copper zones
BOARD* pcb = m_Parent->GetBoard();
for( int ii = 0; ii < pcb->GetAreaCount(); ii++ )
{
ZONE_CONTAINER* zone = pcb->GetArea( ii );
// Cannot export settings from a copper zone
// to a zone keepout:
if( zone->GetIsKeepout() )
continue;
m_settings.ExportSetting( *zone, false ); // false = partial export
m_Parent->OnModify();
}
m_OnExitCode = ZONE_EXPORT_VALUES; // values are exported to others zones
}
开发者ID:p12tic,项目名称:kicad-source-mirror,代码行数:21,代码来源:dialog_copper_zones.cpp
示例9: TransferDataFromWindow
bool DIALOG_KEEPOUT_AREA_PROPERTIES::TransferDataFromWindow()
{
// Init keepout parameters:
m_zonesettings.SetIsKeepout( true );
m_zonesettings.SetDoNotAllowTracks( m_cbTracksCtrl->GetValue() );
m_zonesettings.SetDoNotAllowVias( m_cbViasCtrl->GetValue() );
m_zonesettings.SetDoNotAllowCopperPour( m_cbCopperPourCtrl->GetValue() );
// Test for not allowed items: should have at least one item not allowed:
if( ! m_zonesettings.GetDoNotAllowTracks() &&
! m_zonesettings.GetDoNotAllowVias() &&
! m_zonesettings.GetDoNotAllowCopperPour() )
{
DisplayError( NULL, _("Tracks, vias, and pads are allowed. The keepout will have no effect." ) );
return false;
}
if( m_zonesettings.m_Layers.count() == 0 )
{
DisplayError( NULL, _( "No layers selected." ) );
return false;
}
switch( m_OutlineAppearanceCtrl->GetSelection() )
{
case 0: m_zonesettings.m_Zone_HatchingStyle = ZONE_CONTAINER::NO_HATCH; break;
case 1: m_zonesettings.m_Zone_HatchingStyle = ZONE_CONTAINER::DIAGONAL_EDGE; break;
case 2: m_zonesettings.m_Zone_HatchingStyle = ZONE_CONTAINER::DIAGONAL_FULL; break;
}
if( m_config )
m_config->Write( ZONE_NET_OUTLINES_STYLE_KEY, (long) m_zonesettings.m_Zone_HatchingStyle );
m_zonesettings.m_Zone_45_Only = m_cbConstrainCtrl->GetValue();
m_zonesettings.m_ZonePriority = 0; // for a keepout, this param is not used.
*m_ptr = m_zonesettings;
return true;
}
开发者ID:KiCad,项目名称:kicad-source-mirror,代码行数:39,代码来源:dialog_keepout_area_properties.cpp
示例10: AcceptOptions
bool DIALOG_COPPER_ZONE::AcceptOptions( bool aPromptForErrors, bool aUseExportableSetupOnly )
{
switch( m_PadInZoneOpt->GetSelection() )
{
case 3:
// Pads are not covered
m_settings.SetPadConnection( PAD_NOT_IN_ZONE );
break;
case 2:
// Use thermal relief for THT pads
m_settings.SetPadConnection( THT_THERMAL );
break;
case 1:
// Use thermal relief for pads
m_settings.SetPadConnection( THERMAL_PAD );
break;
case 0:
// pads are covered by copper
m_settings.SetPadConnection( PAD_IN_ZONE );
break;
}
switch( m_OutlineAppearanceCtrl->GetSelection() )
{
case 0:
m_settings.m_Zone_HatchingStyle = CPolyLine::NO_HATCH;
break;
case 1:
m_settings.m_Zone_HatchingStyle = CPolyLine::DIAGONAL_EDGE;
break;
case 2:
m_settings.m_Zone_HatchingStyle = CPolyLine::DIAGONAL_FULL;
break;
}
m_settings.m_ArcToSegmentsCount = m_ArcApproximationOpt->GetSelection() == 1 ?
ARC_APPROX_SEGMENTS_COUNT_HIGHT_DEF :
ARC_APPROX_SEGMENTS_COUNT_LOW_DEF;
if( m_Config )
{
m_Config->Write( ZONE_NET_OUTLINES_HATCH_OPTION_KEY,
(long) m_settings.m_Zone_HatchingStyle );
wxString filter = m_DoNotShowNetNameFilter->GetValue();
m_Config->Write( ZONE_NET_FILTER_STRING_KEY, filter );
}
m_netNameShowFilter = m_ShowNetNameFilter->GetValue();
m_settings.m_FillMode = (m_FillModeCtrl->GetSelection() == 0) ? 0 : 1;
wxString txtvalue = m_ZoneClearanceCtrl->GetValue();
m_settings.m_ZoneClearance = ReturnValueFromString( g_UserUnit, txtvalue );
// Test if this is a reasonable value for this parameter
// A too large value can hang Pcbnew
#define CLEARANCE_MAX_VALUE ZONE_CLEARANCE_MAX_VALUE_MIL*IU_PER_MILS
if( m_settings.m_ZoneClearance > CLEARANCE_MAX_VALUE )
{
wxString msg;
msg.Printf( _( "Clearance must be smaller than %f\" / %f mm." ),
ZONE_CLEARANCE_MAX_VALUE_MIL / 1000.0, ZONE_CLEARANCE_MAX_VALUE_MIL * 0.0254 );
DisplayError( this, msg );
return false;
}
txtvalue = m_ZoneMinThicknessCtrl->GetValue();
m_settings.m_ZoneMinThickness = ReturnValueFromString( g_UserUnit, txtvalue );
if( m_settings.m_ZoneMinThickness < (ZONE_THICKNESS_MIN_VALUE_MIL*IU_PER_MILS) )
{
wxString msg;
msg.Printf( _( "Minimum width must be larger than %f\" / %f mm." ),
ZONE_THICKNESS_MIN_VALUE_MIL / 1000.0, ZONE_THICKNESS_MIN_VALUE_MIL * 0.0254 );
DisplayError( this, msg );
return false;
}
m_settings.SetCornerSmoothingType( m_cornerSmoothingChoice->GetSelection() );
txtvalue = m_cornerSmoothingCtrl->GetValue();
m_settings.SetCornerRadius( ReturnValueFromString( g_UserUnit, txtvalue ) );
m_settings.m_ZonePriority = m_PriorityLevelCtrl->GetValue();
if( m_OrientEdgesOpt->GetSelection() == 0 )
m_settings.m_Zone_45_Only = false;
else
m_settings.m_Zone_45_Only = true;
m_settings.m_ThermalReliefGap = ReturnValueFromTextCtrl( *m_AntipadSizeValue );
m_settings.m_ThermalReliefCopperBridge = ReturnValueFromTextCtrl( *m_CopperWidthValue );
if( m_Config )
{
ConfigBaseWriteDouble( m_Config, ZONE_CLEARANCE_WIDTH_STRING_KEY,
(double) m_settings.m_ZoneClearance / IU_PER_MILS );
//.........这里部分代码省略.........
开发者ID:p12tic,项目名称:kicad-source-mirror,代码行数:101,代码来源:dialog_copper_zones.cpp
示例11: initDialog
void DIALOG_COPPER_ZONE::initDialog()
{
BOARD* board = m_Parent->GetBoard();
wxString msg;
if( m_settings.m_Zone_45_Only )
m_OrientEdgesOpt->SetSelection( 1 );
m_FillModeCtrl->SetSelection( m_settings.m_FillMode ? 1 : 0 );
AddUnitSymbol( *m_ClearanceValueTitle, g_UserUnit );
msg = ReturnStringFromValue( g_UserUnit, m_settings.m_ZoneClearance );
m_ZoneClearanceCtrl->SetValue( msg );
AddUnitSymbol( *m_MinThicknessValueTitle, g_UserUnit );
msg = ReturnStringFromValue( g_UserUnit, m_settings.m_ZoneMinThickness );
m_ZoneMinThicknessCtrl->SetValue( msg );
switch( m_settings.GetPadConnection() )
{
case THT_THERMAL: // Thermals only for THT pads
m_PadInZoneOpt->SetSelection( 2 );
break;
case PAD_NOT_IN_ZONE: // Pads are not covered
m_PadInZoneOpt->SetSelection( 3 );
break;
default:
case THERMAL_PAD: // Use thermal relief for pads
m_PadInZoneOpt->SetSelection( 1 );
break;
case PAD_IN_ZONE: // pads are covered by copper
m_PadInZoneOpt->SetSelection( 0 );
break;
}
// Antipad and spokes are significant only for thermals
if( m_settings.GetPadConnection() != THERMAL_PAD &&
m_settings.GetPadConnection() != THT_THERMAL )
{
m_AntipadSizeValue->Enable( false );
m_CopperWidthValue->Enable( false );
}
else
{
m_AntipadSizeValue->Enable( true );
m_CopperWidthValue->Enable( true );
}
m_PriorityLevelCtrl->SetValue( m_settings.m_ZonePriority );
AddUnitSymbol( *m_AntipadSizeText, g_UserUnit );
AddUnitSymbol( *m_CopperBridgeWidthText, g_UserUnit );
PutValueInLocalUnits( *m_AntipadSizeValue, m_settings.m_ThermalReliefGap );
PutValueInLocalUnits( *m_CopperWidthValue, m_settings.m_ThermalReliefCopperBridge );
m_cornerSmoothingChoice->SetSelection( m_settings.GetCornerSmoothingType() );
PutValueInLocalUnits( *m_cornerSmoothingCtrl, m_settings.GetCornerRadius() );
switch( m_settings.m_Zone_HatchingStyle )
{
case CPolyLine::NO_HATCH:
m_OutlineAppearanceCtrl->SetSelection( 0 );
break;
case CPolyLine::DIAGONAL_EDGE:
m_OutlineAppearanceCtrl->SetSelection( 1 );
break;
case CPolyLine::DIAGONAL_FULL:
m_OutlineAppearanceCtrl->SetSelection( 2 );
break;
}
m_ArcApproximationOpt->SetSelection(
m_settings.m_ArcToSegmentsCount == ARC_APPROX_SEGMENTS_COUNT_HIGHT_DEF ? 1 : 0 );
// Create one column in m_LayerSelectionCtrl
wxListItem column0;
column0.SetId( 0 );
m_LayerSelectionCtrl->InsertColumn( 0, column0 );
// Build copper layer list and append to layer widget
int layerCount = board->GetCopperLayerCount();
wxImageList* imageList = new wxImageList( LAYER_BITMAP_SIZE_X, LAYER_BITMAP_SIZE_Y );
m_LayerSelectionCtrl->AssignImageList( imageList, wxIMAGE_LIST_SMALL );
int ctrlWidth = 0; // Min width for m_LayerSelectionCtrl to show the layers names
for( LAYER_NUM ii = FIRST_LAYER; ii < layerCount; ++ii )
{
LAYER_NUM layerNumber = LAYER_N_BACK;
if( layerCount <= 1 || ii < layerCount - 1 )
layerNumber = ii;
else if( ii == layerCount - 1 )
layerNumber = LAYER_N_FRONT;
m_LayerId.insert( m_LayerId.begin(), layerNumber );
//.........这里部分代码省略.........
开发者ID:p12tic,项目名称:kicad-source-mirror,代码行数:101,代码来源:dialog_copper_zones.cpp
注:本文中的ZONE_SETTINGS类示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论