Commit f98fd09f authored by charras's avatar charras

minor changes in pcbnew (see changelog)

parent 90721d13
......@@ -5,6 +5,15 @@ Started 2007-June-11
Please add newer entries at the top, list the date and your name with
email address.
2008-Aug-06 UPDATE Jean-Pierre Charras <jean-pierre.charras@inpg.fr>
================================================================================
+pcbnew:
Removed an obsolete option in the plot menu, in gerber format.
Cleanup code.
Solved a minor bug: rastnest was not displayed after a move module
and if the command was aborted
2008-Juil-31 UPDATE Jean-Pierre Charras <jean-pierre.charras@inpg.fr>
================================================================================
+eeschema:
......
......@@ -406,10 +406,6 @@ wxString ReturnPcbLayerName( int layer_number, bool is_filename = FAL
* (not internatinalized, no space)*/
/*********************/
/* PROJET_CONFIG.CPP */
/*********************/
/**************/
/* DRAWTXT.CPP */
/**************/
......
......@@ -19,7 +19,7 @@
enum PlotFormat {
PLOT_FORMAT_HPGL,
PLOT_FORMAT_GERBER,
PLOT_FORMAT_POST,
PLOT_FORMAT_POST
};
......
No preview for this file type
This diff is collapsed.
......@@ -20,7 +20,7 @@
/* Fonctions locales */
static int ChangeSideMaskLayer( int masque );
static void Exit_Module( WinEDA_DrawPanel* Panel, wxDC* DC );
static void Abort_MoveOrCopyModule( WinEDA_DrawPanel* Panel, wxDC* DC );
/* Variables locales : */
static int ModuleInitOrient; // Lors des moves, val init de l'orient (pour annulation)
......@@ -122,11 +122,11 @@ void WinEDA_PcbFrame::StartMove_Module( MODULE* module, wxDC* DC )
m_Pcb->m_Status_Pcb |= DO_NOT_SHOW_GENERAL_RASTNEST;
DrawPanel->ManageCurseur = Montre_Position_Empreinte;
DrawPanel->ForceCloseManageCurseur = Exit_Module;
DrawPanel->ForceCloseManageCurseur = Abort_MoveOrCopyModule;
DrawPanel->m_AutoPAN_Request = TRUE;
// effacement module a l'ecran:
if ( DC )
if( DC )
{
int tmp = module->m_Flags;
module->m_Flags |= DO_NOT_DRAW;
......@@ -139,10 +139,12 @@ void WinEDA_PcbFrame::StartMove_Module( MODULE* module, wxDC* DC )
}
/**************************************************/
void Exit_Module( WinEDA_DrawPanel* Panel, wxDC* DC )
/***************************************************/
/* fonction de sortie de l'application */
/**************************************************************/
void Abort_MoveOrCopyModule( WinEDA_DrawPanel* Panel, wxDC* DC )
/****************************************************************/
/* Called on a move or copy module command abort
*/
{
DRAG_SEGM* pt_drag;
TRACK* pt_segm;
......@@ -154,15 +156,17 @@ void Exit_Module( WinEDA_DrawPanel* Panel, wxDC* DC )
if( module )
{
// effacement module a l'ecran:
// Erase the current footprint on screen
DrawModuleOutlines( Panel, DC, module );
/* restitution de l'empreinte si move ou effacement copie*/
if( module->m_Flags & IS_MOVED )
/* If a move command: return to old position
* If a copy command, delete the new footprint
*/
if( module->m_Flags & IS_MOVED ) // Move command
{
/* Move en cours : remise a l'etat d'origine */
if( g_Drag_Pistes_On )
{
/* Effacement des segments dragges */
/* Erase on screen dragged tracks */
pt_drag = g_DragSegmentList;
for( ; pt_drag != NULL; pt_drag = pt_drag->Pnext )
{
......@@ -171,7 +175,7 @@ void Exit_Module( WinEDA_DrawPanel* Panel, wxDC* DC )
}
}
/* Remise en etat d'origine des segments dragges */
/* Go to old position for dragged tracks */
pt_drag = g_DragSegmentList;
for( ; pt_drag != NULL; pt_drag = pt_drag->Pnext )
{
......@@ -184,9 +188,9 @@ void Exit_Module( WinEDA_DrawPanel* Panel, wxDC* DC )
module->m_Flags = 0;
}
if( module->m_Flags & IS_NEW )
if( module->m_Flags & IS_NEW ) // Copy command: delete new footprint
{
module ->DeleteStructure();
module->DeleteStructure();
module = NULL;
pcbframe->m_Pcb->m_Status_Pcb = 0;
pcbframe->build_liste_pads();
......@@ -206,13 +210,23 @@ void Exit_Module( WinEDA_DrawPanel* Panel, wxDC* DC )
Panel->ManageCurseur = NULL;
Panel->ForceCloseManageCurseur = NULL;
pcbframe->SetCurItem( NULL );
pcbframe->m_Pcb->m_Status_Pcb &= ~DO_NOT_SHOW_GENERAL_RASTNEST; // Display ratsnest is allowed
if( g_Show_Ratsnest )
pcbframe->DrawGeneralRatsnest( DC );
}
/**********************************************************/
MODULE* WinEDA_BasePcbFrame::Copie_Module( MODULE* module )
/**********************************************************/
/* copie le module "module" en position courante */
/**
* Function Copie_Module
* Copy an existing footprint. The ne footprint is added in module list
* @param module = footprint to copy
* @return a pointer on the new footprint (the copy of the existing footprint)
*/
{
MODULE* newmodule;
......@@ -286,7 +300,7 @@ bool WinEDA_PcbFrame::Delete_Module( MODULE* module, wxDC* DC, bool aAskBeforeDe
/* Confirmation de l'effacement */
module->Display_Infos( this );
if ( aAskBeforeDeleting )
if( aAskBeforeDeleting )
{
msg << _( "Delete Module" ) << wxT( " " ) << module->m_Reference->m_Text
<< wxT( " (" ) << _( "Value " ) << module->m_Value->m_Text
......@@ -325,8 +339,9 @@ bool WinEDA_PcbFrame::Delete_Module( MODULE* module, wxDC* DC, bool aAskBeforeDe
m_Pcb->m_Status_Pcb = 0;
build_liste_pads();
ReCompile_Ratsnest_After_Changes( DC );
// redraw the area where the module was
if ( DC )
if( DC )
DrawPanel->PostDirtyRect( module->GetBoundingBox() );
return TRUE;
}
......@@ -497,8 +512,8 @@ void BOARD::Change_Side_Module( MODULE* Module, wxDC* DC )
pt_texte->SetLayer( SILKSCREEN_N_CMP );
if( Module->GetLayer() == SILKSCREEN_N_CU
|| Module->GetLayer() == ADHESIVE_N_CU
|| Module->GetLayer() == COPPER_LAYER_N )
|| Module->GetLayer() == ADHESIVE_N_CU
|| Module->GetLayer() == COPPER_LAYER_N )
{
pt_texte->m_Miroir = 0;
}
......@@ -513,7 +528,7 @@ void BOARD::Change_Side_Module( MODULE* Module, wxDC* DC )
/* calcul du rectangle d'encadrement */
Module->Set_Rectangle_Encadrement();
if ( m_PcbFrame )
if( m_PcbFrame )
Module->Display_Infos( m_PcbFrame );
if( !(Module->m_Flags & IS_MOVED) ) /* Inversion simple */
......
......@@ -688,14 +688,6 @@ static PARAM_CFG_BOOL HPGLcenterCfg //HPGL Org Coord ( 0 normal, 1 Centre)
FALSE /* Default value */
);
static PARAM_CFG_INT GERBERSpotMiniCfg //Aperture Mini (mils)
(
wxT( "GERBmin" ), /* Keyword */
&spot_mini, /* Parameter address */
15, /* Default value */
1, 100 /* Min and max values*/
);
static PARAM_CFG_INT VernisEpargneGardeCfg
(
wxT( "VEgarde" ), /* Keyword */
......@@ -736,14 +728,6 @@ static PARAM_CFG_INT ModuleSegmWidthCfg
0, 0xFFFF /* Min and max values*/
);
static PARAM_CFG_INT FormatPlotCfg
(
wxT( "ForPlot" ), /* Keyword */
&format_plot, /* Parameter address */
1, /* Default value */
0, 3 /* Min and max values*/
);
static PARAM_CFG_INT WTraitSerigraphiePlotCfg
(
wxT( "WpenSer" ), /* Keyword */
......@@ -926,13 +910,11 @@ PARAM_CFG_BASE* ParamCfgList[] =
&HPGLspeedCfg,
&HPGLrecouvrementCfg,
&HPGLcenterCfg,
&GERBERSpotMiniCfg,
&VernisEpargneGardeCfg,
&DrawSegmLargeurCfg,
&EdgeSegmLargeurCfg,
&TexteSegmLargeurCfg,
&ModuleSegmWidthCfg,
&FormatPlotCfg,
&WTraitSerigraphiePlotCfg,
&UserGrilleXCfg,
&UserGrilleYCfg,
......
......@@ -12,6 +12,7 @@
#include "common.h"
#include "pcbnew.h"
#include "plot_common.h"
#include "pcbplot.h"
#include "autorout.h"
#include "trigo.h"
......
This diff is collapsed.
......@@ -80,9 +80,6 @@ eda_global int g_HPGL_Pen_Speed /* vitesse en cm/s */
eda_global int g_HPGL_Pen_Diam; /* diametre en mils */
eda_global int g_HPGL_Pen_Recouvrement; /* recouvrement en mils ( pour remplissages */
/* Gestion des ouvertures GERBER */
eda_global int spot_mini; /* Diametre mini de l'ouverture pour trace GERBER */
/* Gestion des cadrages et echelles de trace */
eda_global float Scale_X, Scale_Y ; /* coeff d'agrandissement en X et Y demandes */
eda_global wxPoint g_PlotOffset; /* Offset de trace modifies par l'echelle */
......@@ -91,7 +88,12 @@ eda_global int nb_plot_erreur ;
eda_global int nb_items; /* utilise pour decompter les objets traces */
eda_global int g_PlotLine_Width; /* Largeur du trait en mode filaire (utilise en serigraphie,
pour traces en mode sketch et filaire) */
eda_global int format_plot; /* numero de code du format de sortie */
eda_global int g_PlotFormat /* id for plot format (see enum PlotFormat in plot_common.h) */
#ifdef MAIN
= PLOT_FORMAT_GERBER
#endif
;
eda_global int g_PlotOrient; /* numero de code de l'orientation du trace ( voir
defines precedents):
0 = normal
......@@ -160,7 +162,7 @@ void PlotMirePcb( MIREPCB* PtMire, int format_plot,int masque_layer );
void Plot_1_EdgeModule(int format_plot, EDGE_MODULE * PtEdge);
/* PLOTGERB.CPP */
void PlotGERBERLine(wxPoint start, wxPoint end, int hauteur);
void PlotGERBERLine(wxPoint start, wxPoint end, int width);
void PlotCircle_GERBER( wxPoint centre, int rayon, int width);
void PlotPolygon_GERBER(int nb_segm, int * coord, bool fill);
void trace_1_contour_GERBER(wxPoint pos, wxSize size, wxSize delta,
......
......@@ -330,7 +330,7 @@ static void PlotTextModule( TEXTE_MODULE* pt_texte )
if( no_miroir == 0 )
size.x = -size.x; // Text is mirrored
Plot_1_texte( format_plot, pt_texte->m_Text,
Plot_1_texte( g_PlotFormat, pt_texte->m_Text,
orient, thickness,
pos.x, pos.y, size.x, size.y );
}
......
......@@ -17,7 +17,6 @@
/* Variables locales : */
static int s_Last_D_code;
static float Gerb_scale_plot; // Coeff de conversion d'unites des traces
static int scale_spot_mini; // Ouverture mini (pour remplissages)
static D_CODE* s_DCodeList; // Pointeur sur la zone de stockage des D_CODES
wxString GerberFullFileName;
static double scale_x, scale_y; // echelles de convertion en X et Y (compte tenu
......@@ -58,7 +57,6 @@ void WinEDA_BasePcbFrame::Genere_GERBER( const wxString& FullFileName, int Layer
/* Calcul des echelles de conversion */
Gerb_scale_plot = 1.0; /* pour unites gerber en 0,1 Mils, format 3.4 */
scale_spot_mini = (int) (10 * spot_mini * Gerb_scale_plot);
scale_x = Scale_X * Gerb_scale_plot;
scale_y = Scale_Y * Gerb_scale_plot;
g_PlotOffset.x = 0;
......@@ -615,10 +613,11 @@ void trace_1_pad_TRAPEZE_GERBER( wxPoint pos, wxSize size, wxSize delta,
if( modetrace != FILLED )
{
PlotGERBERLine( polygone[0], polygone[1], scale_spot_mini );
PlotGERBERLine( polygone[1], polygone[2], scale_spot_mini );
PlotGERBERLine( polygone[2], polygone[3], scale_spot_mini );
PlotGERBERLine( polygone[3], polygone[0], scale_spot_mini );
int plotLine_width = (int) (10 * g_PlotLine_Width * Gerb_scale_plot);
PlotGERBERLine( polygone[0], polygone[1], plotLine_width );
PlotGERBERLine( polygone[1], polygone[2], plotLine_width );
PlotGERBERLine( polygone[2], polygone[3], plotLine_width );
PlotGERBERLine( polygone[3], polygone[0], plotLine_width );
}
else
PlotPolygon_GERBER( 4, coord, TRUE );
......@@ -626,7 +625,7 @@ void trace_1_pad_TRAPEZE_GERBER( wxPoint pos, wxSize size, wxSize delta,
/**********************************************************/
void PlotGERBERLine( wxPoint start, wxPoint end, int large )
void PlotGERBERLine( wxPoint start, wxPoint end, int width )
/**********************************************************/
/* Trace 1 segment de piste :
......@@ -638,7 +637,7 @@ void PlotGERBERLine( wxPoint start, wxPoint end, int large )
UserToDeviceCoordinate( start );
UserToDeviceCoordinate( end );
dcode_ptr = get_D_code( large, large, GERB_LINE, 0 );
dcode_ptr = get_D_code( width, width, GERB_LINE, 0 );
if( dcode_ptr->m_NumDcode != s_Last_D_code )
{
sprintf( cbuf, "G54D%d*\n", dcode_ptr->m_NumDcode );
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment