Plot option in GERBER format Plot (Exclude Edge Pcb layer) modification (now, default = off, and saved in config)

This commit is contained in:
CHARRAS 2008-01-23 08:01:38 +00:00
parent f3fcfce609
commit bbae2b12b1
14 changed files with 1022 additions and 965 deletions

View File

@ -4,6 +4,14 @@ Started 2007-June-11
Please add newer entries at the top, list the date and your name with
email address.
2008-Jan-23 UPDATE Jean-Pierre Charras <jean-pierre.charras@inpg.fr>
================================================================================
+pcbnew:
Plot option in GERBER format Plot (Exclude Edge Pcb layer) modification:
- the default is OFF (like odl pcbnew versions)
- this setup is now save in config (is persistant)
In Zone creation, now delete last created corner works.
2008-Jan-22 UPDATE Dick Hollenbeck <dick@softplc.com>
================================================================================

View File

@ -5,7 +5,7 @@
COMMON_GLOBL wxString g_BuildVersion
#ifdef EDA_BASE
(wxT("(2008-01-06)"))
(wxT("(2008-01-22)"))
#endif
;

View File

@ -554,7 +554,7 @@ enum main_id {
ID_POPUP_PCB_ADD_ZONE_CORNER,
ID_POPUP_PCB_DELETE_ZONE_CORNER,
ID_POPUP_PCB_STOP_CURRENT_EDGE_ZONE,
ID_POPUP_PCB_DELETE_EDGE_ZONE,
ID_POPUP_PCB_DELETE_ZONE_LAST_CREATED_CORNER,
ID_POPUP_PCB_FILL_ALL_ZONES,
ID_POPUP_PCB_FILL_ZONE,
ID_POPUP_PCB_DELETE_ZONE_CONTAINER,
@ -564,6 +564,9 @@ enum main_id {
ID_POPUP_PCB_DELETE_ZONE_CUTOUT,
ID_POPUP_PCB_MOVE_ZONE_OUTLINES,
ID_POPUP_PCB_PLACE_ZONE_OUTLINES,
ID_POPUP_ZONE_UNUSED1,
ID_POPUP_ZONE_UNUSED2,
ID_POPUP_ZONE_UNUSED3,
ID_POPUP_ZONE_UNUSED4,
ID_POPUP_PCB_DELETE_MARKER,

View File

@ -488,7 +488,7 @@ public:
*/
void Delete_Zone_Fill( wxDC* DC, SEGZONE* Track, long aTimestamp = 0 );
EDGE_ZONE* Del_SegmEdgeZone( wxDC* DC, EDGE_ZONE* edge_zone );
EDGE_ZONE* Del_LastSegmEdgeZone( wxDC* DC );
/**
* Function Begin_Zone

Binary file not shown.

File diff suppressed because it is too large Load Diff

View File

@ -879,6 +879,24 @@ out:
return rc;
}
/***********************************************************************************************/
void BOARD::RedrawAreasOutlines(WinEDA_DrawPanel* panel, wxDC * aDC, int aDrawMode, int aLayer)
/***********************************************************************************************/
/**
* Function RedrawAreasOutlines
* Redraw all areas outlines on layer aLayer ( redraw all if aLayer < 0 )
*/
{
if ( ! aDC ) return;
for( int ii = 0; ii < GetAreaCount(); ii++ )
{
ZONE_CONTAINER* edge_zone = GetArea(ii);
if( (aLayer < 0) || (aLayer == edge_zone->GetLayer()) )
edge_zone->Draw( panel, aDC, wxPoint( 0, 0 ), aDrawMode );
}
}
#if defined(DEBUG)

View File

@ -250,6 +250,12 @@ public:
/* Copper Areas handling */
/*************************/
/**
* Function RedrawAreasOutlines
* Redraw all areas outlines on layer aLayer ( redraw all if aLayer < 0 )
*/
void RedrawAreasOutlines(WinEDA_DrawPanel* panel, wxDC * aDC, int aDrawMode, int aLayer);
/**
* Function SetAreasNetCodesFromNetNames
* Set the .m_NetCode member of all copper areas, according to the area Net Name

View File

@ -66,7 +66,7 @@ void WinEDA_PcbFrame::Process_Special_Functions( wxCommandEvent& event )
case ID_POPUP_PCB_EXPORT_PAD_SETTINGS:
case ID_POPUP_PCB_GLOBAL_IMPORT_PAD_SETTINGS:
case ID_POPUP_PCB_STOP_CURRENT_EDGE_ZONE:
case ID_POPUP_PCB_DELETE_EDGE_ZONE:
case ID_POPUP_PCB_DELETE_ZONE_LAST_CREATED_CORNER:
case ID_POPUP_PCB_FILL_ALL_ZONES:
case ID_POPUP_PCB_PLACE_ZONE_CORNER:
case ID_POPUP_PCB_PLACE_ZONE_OUTLINES:
@ -815,12 +815,11 @@ void WinEDA_PcbFrame::Process_Special_Functions( wxCommandEvent& event )
}
break;
case ID_POPUP_PCB_DELETE_EDGE_ZONE:
case ID_POPUP_PCB_DELETE_ZONE_LAST_CREATED_CORNER:
DrawPanel->MouseToCursorSchema();
if( GetCurItem() && (GetCurItem()->m_Flags & IS_NEW) )
{
SetCurItem( Del_SegmEdgeZone( &dc,
(EDGE_ZONE*) GetCurItem() ) );
SetCurItem( Del_LastSegmEdgeZone( &dc ) );
}
break;

View File

@ -275,8 +275,8 @@ bool WinEDA_PcbFrame::OnRightClick( const wxPoint& aMousePos, wxMenu* aPopMenu )
ADD_MENUITEM( aPopMenu, ID_POPUP_PCB_STOP_CURRENT_EDGE_ZONE,
_( "End edge zone" ), apply_xpm );
}
ADD_MENUITEM( aPopMenu, ID_POPUP_PCB_DELETE_EDGE_ZONE,
_( "Delete edge zone" ), delete_xpm );
ADD_MENUITEM( aPopMenu, ID_POPUP_PCB_DELETE_ZONE_LAST_CREATED_CORNER,
_( "Delete Current Edge" ), delete_xpm );
break;
case TYPEZONE_CONTAINER: // Item used to handle a zone area (outlines, holes ...)

View File

@ -16,6 +16,11 @@
#define PLOT_DEFAULT_MARGE 300 // mils
/* Keywords to r/w options in config */
#define EDGELAYER_GERBER_OPT_KEY wxT("EdgeLayerGerberOpt")
#define PLOT_XFINESCALE_ADJ_KEY wxT("PlotXFineScaleAdj")
#define PLOT_YFINESCALE_ADJ_KEY wxT("PlotYFineScaleAdj")
// variables locale :
static long s_SelectedLayers = CUIVRE_LAYER | CMP_LAYER |
SILKSCREEN_LAYER_CMP | SILKSCREEN_LAYER_CU;
@ -222,8 +227,9 @@ wxString choice_plot_offset_msg[] =
m_XScaleAdjust = m_YScaleAdjust = 1.0;
if( m_Parent->m_Parent->m_EDA_Config )
{
m_Parent->m_Parent->m_EDA_Config->Read(wxT("PlotXFineScaleAdj"), &m_XScaleAdjust);
m_Parent->m_Parent->m_EDA_Config->Read(wxT("PlotYFineScaleAdj"), &m_YScaleAdjust);
m_Parent->m_Parent->m_EDA_Config->Read( EDGELAYER_GERBER_OPT_KEY, &g_Exclude_Edges_Pcb);
m_Parent->m_Parent->m_EDA_Config->Read( PLOT_XFINESCALE_ADJ_KEY, &m_XScaleAdjust);
m_Parent->m_Parent->m_EDA_Config->Read( PLOT_XFINESCALE_ADJ_KEY, &m_YScaleAdjust);
}
m_FineAdjustXscaleOpt = new WinEDA_DFloatValueCtrl(this, _("X Scale Adjust"), m_XScaleAdjust, RightBoxSizer);
m_FineAdjustXscaleOpt->SetToolTip(_("Set X scale adjust for exact scale plotting"));
@ -253,9 +259,10 @@ wxString choice_plot_offset_msg[] =
}
// Option for excluding contents of "Edges Pcb" layer
m_Exclude_Edges_Pcb = new wxCheckBox(this,
ID_EXCLUDE_EDGES_PCB, _("Exclude Edges Pcb layer") );
m_Exclude_Edges_Pcb->SetValue(Exclude_Edges_Pcb);
ID_EXCLUDE_EDGES_PCB, _("Exclude Edges Pcb Layer") );
m_Exclude_Edges_Pcb->SetValue(g_Exclude_Edges_Pcb);
m_Exclude_Edges_Pcb->SetToolTip(
_("Exclude contents of Edges Pcb layer from all other layers") );
LeftBoxSizer->Add(m_Exclude_Edges_Pcb, 0, wxGROW|wxALL, 1);
@ -480,7 +487,7 @@ int format_list[] =
void WinEDA_PlotFrame::SaveOptPlot(wxCommandEvent & event)
/*********************************************************/
{
Exclude_Edges_Pcb = m_Exclude_Edges_Pcb->GetValue();
g_Exclude_Edges_Pcb = m_Exclude_Edges_Pcb->GetValue();
if( m_Plot_Sheet_Ref )
Plot_Sheet_Ref = m_Plot_Sheet_Ref->GetValue();
@ -516,8 +523,9 @@ void WinEDA_PlotFrame::SaveOptPlot(wxCommandEvent & event)
if( m_Parent->m_Parent->m_EDA_Config )
{
m_Parent->m_Parent->m_EDA_Config->Write(wxT("PlotXFineScaleAdj"), m_XScaleAdjust);
m_Parent->m_Parent->m_EDA_Config->Write(wxT("PlotYFineScaleAdj"), m_YScaleAdjust);
m_Parent->m_Parent->m_EDA_Config->Write( EDGELAYER_GERBER_OPT_KEY, g_Exclude_Edges_Pcb);
m_Parent->m_Parent->m_EDA_Config->Write( PLOT_XFINESCALE_ADJ_KEY, m_XScaleAdjust);
m_Parent->m_Parent->m_EDA_Config->Write( PLOT_YFINESCALE_ADJ_KEY, m_YScaleAdjust);
}
g_Plot_PS_Negative = m_Plot_PS_Negative->GetValue();

View File

@ -18,9 +18,9 @@
#define SCALE_HPGL 0.102041
/* Options : */
eda_global bool Exclude_Edges_Pcb // True to exclude contents of Edges Pcb layer
eda_global bool g_Exclude_Edges_Pcb // True to exclude contents of Edges Pcb layer
#ifdef MAIN
= TRUE
= FALSE
#endif
;
eda_global bool Plot_Sheet_Ref;

View File

@ -90,7 +90,7 @@ int tracevia = 1;
int layer_mask = g_TabOneLayerMask[Layer];
// Specify that the contents of the "Edges Pcb" layer are also to be
// plotted, unless the option of excluding that layer has been selected.
if( ! Exclude_Edges_Pcb )
if( ! g_Exclude_Edges_Pcb )
layer_mask |= EDGE_LAYER;
switch( Layer )

View File

@ -150,19 +150,14 @@ void WinEDA_PcbFrame::Delete_Zone_Fill( wxDC* DC, SEGZONE* aZone, long aTimestam
/*****************************************************************************/
EDGE_ZONE* WinEDA_PcbFrame::Del_SegmEdgeZone( wxDC* DC, EDGE_ZONE* edge_zone )
EDGE_ZONE* WinEDA_PcbFrame::Del_LastSegmEdgeZone( wxDC* DC)
/*****************************************************************************/
/* Used only while creating a new zone outline
* Remove and delete the current outline segment in progress
*/
{
EDGE_ZONE* segm;
if( m_Pcb->m_CurrentLimitZone )
segm = m_Pcb->m_CurrentLimitZone;
else
segm = edge_zone;
EDGE_ZONE* segm = m_Pcb->m_CurrentLimitZone;
if( segm == NULL )
return NULL;
@ -178,6 +173,7 @@ EDGE_ZONE* WinEDA_PcbFrame::Del_SegmEdgeZone( wxDC* DC, EDGE_ZONE* edge_zone )
if( segm )
{
segm->Pback = NULL;
segm->m_Flags |= IS_NEW | IS_MOVED;
if( DrawPanel->ManageCurseur )
DrawPanel->ManageCurseur( DrawPanel, DC, TRUE );
}
@ -334,20 +330,9 @@ void WinEDA_PcbFrame::End_Move_Zone_Corner_Or_Outlines( wxDC* DC, ZONE_CONTAINER
int layer = zone_container->GetLayer();
for( int ii = 0; ii < m_Pcb->GetAreaCount(); ii++ )
{
ZONE_CONTAINER* edge_zone = m_Pcb->GetArea(ii);
if( layer == edge_zone->GetLayer() && DC)
edge_zone->Draw( DrawPanel, DC, wxPoint( 0, 0 ), GR_XOR );
}
m_Pcb->RedrawAreasOutlines(DrawPanel, DC, GR_XOR, layer);
m_Pcb->AreaPolygonModified( zone_container, true, verbose );
for( int ii = 0; ii < m_Pcb->GetAreaCount(); ii++ )
{
ZONE_CONTAINER* edge_zone = m_Pcb->GetArea(ii);
if( layer == edge_zone->GetLayer() && DC)
edge_zone->Draw( DrawPanel, DC, wxPoint( 0, 0 ), GR_OR );
}
m_Pcb->RedrawAreasOutlines(DrawPanel, DC, GR_OR, layer);
int ii = m_Pcb->GetAreaIndex(zone_container); // test if zone_container exists
if ( ii < 0 ) zone_container = NULL; // was removed by combining zones
@ -379,29 +364,13 @@ void WinEDA_PcbFrame::Remove_Zone_Corner( wxDC* DC, ZONE_CONTAINER * zone_contai
int layer = zone_container->GetLayer();
if ( DC )
{
for( int ii = 0; ii < m_Pcb->GetAreaCount(); ii++ )
{
ZONE_CONTAINER* edge_zone = m_Pcb->GetArea(ii);
if( layer == edge_zone->GetLayer() )
edge_zone->Draw( DrawPanel, DC, wxPoint( 0, 0 ), GR_XOR );
}
}
m_Pcb->RedrawAreasOutlines(DrawPanel, DC, GR_XOR, layer);
zone_container->m_Poly->DeleteCorner(zone_container->m_CornerSelection);
// modify zones outlines according to the new zone_container shape
m_Pcb->AreaPolygonModified( zone_container, true, verbose );
if ( DC )
{
for( int ii = 0; ii < m_Pcb->GetAreaCount(); ii++ )
{
ZONE_CONTAINER* edge_zone = m_Pcb->GetArea(ii);
if( layer == edge_zone->GetLayer() )
edge_zone->Draw( DrawPanel, DC, wxPoint( 0, 0 ), GR_OR );
}
}
m_Pcb->RedrawAreasOutlines(DrawPanel, DC, GR_OR, layer);
int ii = m_Pcb->GetAreaIndex(zone_container); // test if zone_container exists
if ( ii < 0 ) zone_container = NULL; // was removed by combining zones
@ -678,12 +647,7 @@ bool WinEDA_PcbFrame::End_Zone( wxDC* DC )
DrawPanel->ForceCloseManageCurseur = NULL;
// Undraw old drawings, because they can have important changes
for( int ii = 0; ii < m_Pcb->GetAreaCount(); ii++ )
{
ZONE_CONTAINER* area = m_Pcb->GetArea(ii);
if( layer == area->GetLayer() )
area->Draw( DrawPanel, DC, wxPoint( 0, 0 ), GR_XOR );
}
m_Pcb->RedrawAreasOutlines(DrawPanel, DC, GR_XOR, layer);
/* Put edges in list */
ZONE_CONTAINER* new_zone_container;
@ -739,12 +703,7 @@ bool WinEDA_PcbFrame::End_Zone( wxDC* DC )
m_Pcb->AreaPolygonModified( new_zone_container, true, verbose );
// Redraw the real edge zone :
for( int ii = 0; ii < m_Pcb->GetAreaCount(); ii++ )
{
ZONE_CONTAINER* edge_zone = m_Pcb->GetArea(ii);
if( layer == edge_zone->GetLayer() )
edge_zone->Draw( DrawPanel, DC, wxPoint( 0, 0 ), GR_OR );
}
m_Pcb->RedrawAreasOutlines(DrawPanel, DC, GR_OR, layer);
int ii = m_Pcb->GetAreaIndex(new_zone_container); // test if zone_container exists
if ( ii < 0 ) new_zone_container = NULL; // was removed by combining zones
@ -845,12 +804,7 @@ void WinEDA_PcbFrame::Edit_Zone_Params( wxDC* DC, ZONE_CONTAINER* zone_container
m_Pcb->AreaPolygonModified( zone_container, true, verbose );
// Redraw the real new zone outlines:
for( int ii = 0; ii < m_Pcb->GetAreaCount(); ii++ )
{
ZONE_CONTAINER* edge_zone = m_Pcb->GetArea(ii);
edge_zone->m_Flags = 0;
edge_zone->Draw( DrawPanel, DC, wxPoint( 0, 0 ), GR_OR );
}
m_Pcb->RedrawAreasOutlines(DrawPanel, DC, GR_OR, -1);
GetScreen()->SetModify();
}