minor bugs fixed

This commit is contained in:
charras 2009-05-21 12:45:21 +00:00
parent bfb84e25e9
commit b256efc50e
13 changed files with 102 additions and 83 deletions

View File

@ -25,7 +25,7 @@ const wxString RetroFileExtension( wxT( "stf" ) );
const wxString FootprintAliasFileExtension( wxT( "equ" ) ); const wxString FootprintAliasFileExtension( wxT( "equ" ) );
// Wildcard for schematic retroannotation (import footprint names in schematic): // Wildcard for schematic retroannotation (import footprint names in schematic):
const wxString RetroFileWildcard( _( "Kicad component list files " \ const wxString RetroFileWildcard( _( "Kicad retroannotation files " \
"(*.stf)|*.stf" ) ); "(*.stf)|*.stf" ) );
const wxString FootprintAliasFileWildcard( _( "Kicad footprint alias files " \ const wxString FootprintAliasFileWildcard( _( "Kicad footprint alias files " \
"(*.equ)|*.equ" ) ); "(*.equ)|*.equ" ) );

View File

@ -195,7 +195,7 @@ void WinEDA_LibeditFrame::PlacePin( wxDC* DC )
continue; continue;
if( Pin->m_Flags ) if( Pin->m_Flags )
continue; continue;
if( ask_for_pin ) if( ask_for_pin && !g_EditPinByPinIsOn )
{ {
DrawPanel->m_IgnoreMouseEvents = true; DrawPanel->m_IgnoreMouseEvents = true;
status = IsOK( this, _( "Occupied by other pin. Continue?" ) ); status = IsOK( this, _( "Occupied by other pin. Continue?" ) );

View File

@ -214,7 +214,7 @@ void WinEDA_LibeditFrame::ReCreateHToolbar()
m_HToolBar->AddSeparator(); m_HToolBar->AddSeparator();
m_HToolBar->AddTool( ID_LIBEDIT_EDIT_PIN_BY_PIN, wxEmptyString, m_HToolBar->AddTool( ID_LIBEDIT_EDIT_PIN_BY_PIN, wxEmptyString,
wxBitmap( pin2pin_xpm ), wxBitmap( pin2pin_xpm ),
_( "Edit pins part per part (Carefully use!)" ) ); _( "Edit pins part per part (Carefully use!)" ), wxITEM_CHECK );
m_HToolBar->ToggleTool( ID_LIBEDIT_EDIT_PIN_BY_PIN, g_EditPinByPinIsOn ); m_HToolBar->ToggleTool( ID_LIBEDIT_EDIT_PIN_BY_PIN, g_EditPinByPinIsOn );
// after adding the buttons to the toolbar, must call Realize() to reflect the changes // after adding the buttons to the toolbar, must call Realize() to reflect the changes

View File

@ -242,7 +242,7 @@ public:
// Pads sur modules // Pads sur modules
void AddPad( MODULE* Module, bool draw ); void AddPad( MODULE* Module, bool draw );
void DeletePad( D_PAD* Pad, wxDC* DC ); void DeletePad( D_PAD* Pad );
void StartMovePad( D_PAD* Pad, wxDC* DC ); void StartMovePad( D_PAD* Pad, wxDC* DC );
void RotatePad( D_PAD* Pad, wxDC* DC ); void RotatePad( D_PAD* Pad, wxDC* DC );
void PlacePad( D_PAD* Pad, wxDC* DC ); void PlacePad( D_PAD* Pad, wxDC* DC );
@ -322,7 +322,7 @@ public:
* Defined separately in pcbnew and gerbview * Defined separately in pcbnew and gerbview
* *
* @param DC A device context to draw on. * @param DC A device context to draw on.
*/ */
void Block_Delete( wxDC* DC ); void Block_Delete( wxDC* DC );
void Block_Rotate( wxDC* DC ); void Block_Rotate( wxDC* DC );
void Block_Invert( wxDC* DC ); void Block_Invert( wxDC* DC );
@ -344,7 +344,7 @@ public:
void Block_Mirror_X( wxDC* DC ); void Block_Mirror_X( wxDC* DC );
/** /**
* Function Block_Duplicate * Function Block_Duplicate
* copies-and-moves all tracks and segments within the selected block. * copies-and-moves all tracks and segments within the selected block.
* New location is determined by the current offset from the selected block's original location. * New location is determined by the current offset from the selected block's original location.
* Defined separately in pcbnew and gerbview * Defined separately in pcbnew and gerbview
* *

Binary file not shown.

View File

@ -2,8 +2,8 @@ msgid ""
msgstr "" msgstr ""
"Project-Id-Version: kicad\n" "Project-Id-Version: kicad\n"
"Report-Msgid-Bugs-To: \n" "Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2009-05-16 07:41+0100\n" "POT-Creation-Date: 2009-05-16 20:42+0100\n"
"PO-Revision-Date: 2009-05-16 07:57+0100\n" "PO-Revision-Date: 2009-05-16 20:51+0100\n"
"Last-Translator: \n" "Last-Translator: \n"
"Language-Team: kicad team <jean-pierre.charras@ujf-grenoble.fr>\n" "Language-Team: kicad team <jean-pierre.charras@ujf-grenoble.fr>\n"
"MIME-Version: 1.0\n" "MIME-Version: 1.0\n"
@ -5628,20 +5628,19 @@ msgstr "Chemins de recherche défini par l'utilisateur"
#: pcbnew/dialog_pcbnew_config_libs_and_paths_fbp.cpp:74 #: pcbnew/dialog_pcbnew_config_libs_and_paths_fbp.cpp:74
msgid "Additional paths used in this project. The priority is highter than default Kicad paths." msgid "Additional paths used in this project. The priority is highter than default Kicad paths."
msgstr "" msgstr "Chemins additionnels utilisés dans ce projet. La priorité est plus haute que les chemins par défaut de Kicad."
#: pcbnew/dialog_pcbnew_config_libs_and_paths_fbp.cpp:97 #: pcbnew/dialog_pcbnew_config_libs_and_paths_fbp.cpp:97
#, fuzzy
msgid "Current search path list" msgid "Current search path list"
msgstr "" msgstr "Liste des chemins de recherche courrants"
"Liste des Hotkeys courantes:\n"
"\n"
#: pcbnew/dialog_pcbnew_config_libs_and_paths_fbp.cpp:105 #: pcbnew/dialog_pcbnew_config_libs_and_paths_fbp.cpp:105
msgid "" msgid ""
"Paths (system paths and user paths) used to search and load libraries files and component doc files.\n" "Paths (system paths and user paths) used to search and load libraries files and component doc files.\n"
"Sorted by decreasing priority order." "Sorted by decreasing priority order."
msgstr "" msgstr ""
"Chemins (chemins système et chemins utilisateurs) utilisés pour chercher et charger les fichiers libriries et documentation des composants.\n"
"Triés par ordre de priorité décroissante."
#: eeschema/lib_export.cpp:47 #: eeschema/lib_export.cpp:47
msgid "Import Component" msgid "Import Component"
@ -6457,7 +6456,7 @@ msgstr "Noir"
msgid "Background Color:" msgid "Background Color:"
msgstr "Couleur du Fond:" msgstr "Couleur du Fond:"
#: eeschema/dialog_eeschema_config.cpp:247 #: eeschema/dialog_eeschema_config.cpp:224
msgid "Library files:" msgid "Library files:"
msgstr "Fichiers Librairies:" msgstr "Fichiers Librairies:"
@ -8530,15 +8529,10 @@ msgid "New FootprintFilter:"
msgstr "Nouveau Filtre de Modules:" msgstr "Nouveau Filtre de Modules:"
#: eeschema/dialog_eeschema_config_fbp.cpp:20 #: eeschema/dialog_eeschema_config_fbp.cpp:20
msgid "Default netlist format"
msgstr "Format netlistes par défaut"
#: eeschema/dialog_eeschema_config_fbp.cpp:31
#, fuzzy
msgid "Component library files" msgid "Component library files"
msgstr "Couche composant" msgstr "Fichiers librairies de composants"
#: eeschema/dialog_eeschema_config_fbp.cpp:34 #: eeschema/dialog_eeschema_config_fbp.cpp:23
msgid "" msgid ""
"List of active library files.\n" "List of active library files.\n"
"Only library files in this list are loaded by Eeschema.\n" "Only library files in this list are loaded by Eeschema.\n"
@ -8549,7 +8543,7 @@ msgstr ""
"Seuls les fichiers librairie dans cette liste sont chargés par eeschema.\n" "Seuls les fichiers librairie dans cette liste sont chargés par eeschema.\n"
"L'ordre de cette liste est important:Eeschema cherche un composant donné en utilisant cette liste par ordre de priorité." "L'ordre de cette liste est important:Eeschema cherche un composant donné en utilisant cette liste par ordre de priorité."
#: eeschema/dialog_eeschema_config_fbp.cpp:62 #: eeschema/dialog_eeschema_config_fbp.cpp:51
msgid "User defined search path" msgid "User defined search path"
msgstr "Chemin de recherche défini par l'utilisateur" msgstr "Chemin de recherche défini par l'utilisateur"
@ -9162,7 +9156,7 @@ msgstr "Impossible de créer le fichier netliste "
#: cvpcb/listlib.cpp:56 #: cvpcb/listlib.cpp:56
msgid "No PCB foot print libraries are listed in the current project file." msgid "No PCB foot print libraries are listed in the current project file."
msgstr "" msgstr "Aucune librairie de modules PCB listée dans le fichier projet courant."
#: cvpcb/listlib.cpp:57 #: cvpcb/listlib.cpp:57
msgid "Project File Error" msgid "Project File Error"
@ -9183,12 +9177,12 @@ msgstr "Ne peut ouvrir le fichier librairie de modules PCB <%s>."
#: cvpcb/listlib.cpp:95 #: cvpcb/listlib.cpp:95
#, c-format #, c-format
msgid "<%s> is not a valid Kicad PCB foot print library" msgid "<%s> is not a valid Kicad PCB foot print library"
msgstr "" msgstr "<%s> n'est pas un fichier librairie module Kicad PCB valide."
#: cvpcb/listlib.cpp:127 #: cvpcb/listlib.cpp:127
#, c-format #, c-format
msgid "Unexpected end of file occurred while parsing PCB foot print library <%s>." msgid "Unexpected end of file occurred while parsing PCB foot print library <%s>."
msgstr "" msgstr "Fin de fichier inattendue lors de l'analyse de la librairie de modules PCB <%s>."
#: cvpcb/listlib.cpp:162 #: cvpcb/listlib.cpp:162
#, c-format #, c-format
@ -9198,12 +9192,12 @@ msgstr ""
#: cvpcb/listlib.cpp:171 #: cvpcb/listlib.cpp:171
#, c-format #, c-format
msgid "<%s> is not a valid PCB foot print library document file." msgid "<%s> is not a valid PCB foot print library document file."
msgstr "" msgstr "<%s> n'est pas un fichier librairie documentation module PCB valide."
#: cvpcb/loadcmp.cpp:74 #: cvpcb/loadcmp.cpp:74
#, c-format #, c-format
msgid "<%s> is not a valid Kicad PCB foot print library." msgid "<%s> is not a valid Kicad PCB foot print library."
msgstr "" msgstr "<%s> in'est pas un fichier de module PCB Kicad valide."
#: cvpcb/loadcmp.cpp:137 #: cvpcb/loadcmp.cpp:137
#, c-format #, c-format
@ -9224,8 +9218,8 @@ msgid "Component %s %s pin %s : Different Nets"
msgstr "Composant %s %s pin %s : Nets Differents" msgstr "Composant %s %s pin %s : Nets Differents"
#: cvpcb/cvpcb.cpp:28 #: cvpcb/cvpcb.cpp:28
msgid "Kicad component list files (*.stf)|*.stf" msgid "Kicad retroannotation files (*.stf)|*.stf"
msgstr "" msgstr "Fichiers de retroannotaion Kicad (*.stf)|*.stf"
#: cvpcb/cvpcb.cpp:30 #: cvpcb/cvpcb.cpp:30
msgid "Kicad footprint alias files (*.equ)|*.equ" msgid "Kicad footprint alias files (*.equ)|*.equ"
@ -9255,9 +9249,9 @@ msgid "%d footprint aliases found."
msgstr "%d alias de modules trouvés." msgstr "%d alias de modules trouvés."
#: cvpcb/autosel.cpp:169 #: cvpcb/autosel.cpp:169
#, fuzzy, c-format #, c-format
msgid "Component %s: footprint %s not found in any of the project footprint libraries." msgid "Component %s: footprint %s not found in any of the project footprint libraries."
msgstr "Composant %s: Module %s non trouvé en librairies" msgstr "Composant %s: Module %s non trouvé dans les librairies de modules du projet"
#: cvpcb/autosel.cpp:173 #: cvpcb/autosel.cpp:173
msgid "CVPcb Error" msgid "CVPcb Error"
@ -9443,9 +9437,8 @@ msgid "Netlist error: %s"
msgstr "Erreur Netliste: %s" msgstr "Erreur Netliste: %s"
#: cvpcb/savecmp.cpp:24 #: cvpcb/savecmp.cpp:24
#, fuzzy
msgid "Component Library Error" msgid "Component Library Error"
msgstr "Couche composant" msgstr "Erreur en Librairie de Composanr"
#: cvpcb/savecmp.cpp:87 #: cvpcb/savecmp.cpp:87
#, c-format #, c-format
@ -9455,7 +9448,7 @@ msgstr "Ne peut pas ouvrir le fichier librairie <%s>."
#: cvpcb/savecmp.cpp:96 #: cvpcb/savecmp.cpp:96
#, c-format #, c-format
msgid " <%s> does not appear to be a valid Kicad component library." msgid " <%s> does not appear to be a valid Kicad component library."
msgstr "" msgstr " <%s>ne semble pas être une librairie de composants de Kicad valide."
#: cvpcb/savecmp.cpp:105 #: cvpcb/savecmp.cpp:105
#, c-format #, c-format
@ -11419,6 +11412,8 @@ msgstr "DCodes id."
msgid "Page Settings" msgid "Page Settings"
msgstr "Ajustage opt Page" msgstr "Ajustage opt Page"
#~ msgid "Default netlist format"
#~ msgstr "Format netlistes par défaut"
#~ msgid "Loading schematic component libraries" #~ msgid "Loading schematic component libraries"
#~ msgstr "Chargement des librairies de composants schématiques" #~ msgstr "Chargement des librairies de composants schématiques"

View File

@ -280,7 +280,7 @@ SEARCH_RESULT TRACK::Visit( INSPECTOR* inspector, const void* testData,
{ {
KICAD_T stype = *scanTypes; KICAD_T stype = *scanTypes;
#if 0 && defined (DEBUG) #if 0 && defined(DEBUG)
std::cout << GetClass().mb_str() << ' '; std::cout << GetClass().mb_str() << ' ';
#endif #endif
@ -363,9 +363,7 @@ void SEGVIA::SetLayerPair( int top_layer, int bottom_layer )
* @param bottom_layer = last layer connected by the via * @param bottom_layer = last layer connected by the via
*/ */
{ {
int via_type = Shape(); if( Shape() == VIA_THROUGH )
if( via_type == VIA_THROUGH )
{ {
top_layer = LAYER_CMP_N; top_layer = LAYER_CMP_N;
bottom_layer = COPPER_LAYER_N; bottom_layer = COPPER_LAYER_N;
@ -390,11 +388,16 @@ void SEGVIA::ReturnLayerPair( int* top_layer, int* bottom_layer ) const
* @param bottom_layer = pointer to the last layer (can be null) * @param bottom_layer = pointer to the last layer (can be null)
*/ */
{ {
int b_layer = (m_Layer >> 4) & 15; int b_layer = COPPER_LAYER_N;
int t_layer = m_Layer & 15; int t_layer = LAYER_CMP_N;
if( b_layer > t_layer ) if( Shape() != VIA_THROUGH )
EXCHG( b_layer, t_layer ); {
b_layer = (m_Layer >> 4) & 15;
t_layer = m_Layer & 15;
if( b_layer > t_layer )
EXCHG( b_layer, t_layer );
}
if( top_layer ) if( top_layer )
*top_layer = t_layer; *top_layer = t_layer;
@ -516,11 +519,11 @@ bool TRACK::Save( FILE* aFile ) const
return true; return true;
fprintf( aFile, "Po %d %d %d %d %d %d %d\n", m_Shape, fprintf( aFile, "Po %d %d %d %d %d %d %d\n", m_Shape,
m_Start.x, m_Start.y, m_End.x, m_End.y, m_Width, m_Drill ); m_Start.x, m_Start.y, m_End.x, m_End.y, m_Width, m_Drill );
fprintf( aFile, "De %d %d %d %lX %X\n", fprintf( aFile, "De %d %d %d %lX %X\n",
m_Layer, type, GetNet(), m_Layer, type, GetNet(),
m_TimeStamp, ReturnStatus() ); m_TimeStamp, ReturnStatus() );
return true; return true;
} }
@ -582,7 +585,7 @@ void TRACK::Draw( WinEDA_DrawPanel* panel, wxDC* DC, int draw_mode, const wxPoin
if( m_Shape == S_CIRCLE ) if( m_Shape == S_CIRCLE )
{ {
rayon = (int) hypot( (double) ( m_End.x - m_Start.x ), rayon = (int) hypot( (double) ( m_End.x - m_Start.x ),
(double) ( m_End.y - m_Start.y ) ); (double) ( m_End.y - m_Start.y ) );
if( panel->GetScreen()->Scale( l_piste ) < L_MIN_DESSIN ) if( panel->GetScreen()->Scale( l_piste ) < L_MIN_DESSIN )
{ {
GRCircle( &panel->m_ClipBox, DC, m_Start.x, m_Start.y, rayon, color ); GRCircle( &panel->m_ClipBox, DC, m_Start.x, m_Start.y, rayon, color );
@ -601,7 +604,7 @@ void TRACK::Draw( WinEDA_DrawPanel* panel, wxDC* DC, int draw_mode, const wxPoin
else else
{ {
GRCircle( &panel->m_ClipBox, DC, m_Start.x, m_Start.y, rayon, GRCircle( &panel->m_ClipBox, DC, m_Start.x, m_Start.y, rayon,
m_Width, color ); m_Width, color );
} }
} }
return; return;
@ -610,19 +613,19 @@ void TRACK::Draw( WinEDA_DrawPanel* panel, wxDC* DC, int draw_mode, const wxPoin
if( panel->GetScreen()->Scale( l_piste ) < L_MIN_DESSIN ) if( panel->GetScreen()->Scale( l_piste ) < L_MIN_DESSIN )
{ {
GRLine( &panel->m_ClipBox, DC, m_Start.x, m_Start.y, GRLine( &panel->m_ClipBox, DC, m_Start.x, m_Start.y,
m_End.x, m_End.y, 0, color ); m_End.x, m_End.y, 0, color );
return; return;
} }
if( !DisplayOpt.DisplayPcbTrackFill || GetState( FORCE_SKETCH ) ) if( !DisplayOpt.DisplayPcbTrackFill || GetState( FORCE_SKETCH ) )
{ {
GRCSegm( &panel->m_ClipBox, DC, m_Start.x, m_Start.y, GRCSegm( &panel->m_ClipBox, DC, m_Start.x, m_Start.y,
m_End.x, m_End.y, m_Width, color ); m_End.x, m_End.y, m_Width, color );
} }
else else
{ {
GRFillCSegm( &panel->m_ClipBox, DC, m_Start.x, m_Start.y, GRFillCSegm( &panel->m_ClipBox, DC, m_Start.x, m_Start.y,
m_End.x, m_End.y, m_Width, color ); m_End.x, m_End.y, m_Width, color );
} }
if( panel->GetScreen()->m_IsPrinting ) if( panel->GetScreen()->m_IsPrinting )
@ -645,7 +648,7 @@ void TRACK::Draw( WinEDA_DrawPanel* panel, wxDC* DC, int draw_mode, const wxPoin
if( Type() == TYPE_ZONE ) if( Type() == TYPE_ZONE )
return; return;
if ( DisplayOpt.DisplayNetNamesMode == 0 || DisplayOpt.DisplayNetNamesMode == 1 ) if( DisplayOpt.DisplayNetNamesMode == 0 || DisplayOpt.DisplayNetNamesMode == 1 )
return; return;
#define THRESHOLD 10 #define THRESHOLD 10
@ -670,21 +673,21 @@ void TRACK::Draw( WinEDA_DrawPanel* panel, wxDC* DC, int draw_mode, const wxPoin
if( textlen > 0 ) if( textlen > 0 )
{ {
// calculate a good size for the text // calculate a good size for the text
int tsize = MIN( m_Width, len / textlen ); int tsize = MIN( m_Width, len / textlen );
wxPoint tpos = m_Start + m_End; wxPoint tpos = m_Start + m_End;
tpos.x /= 2; tpos.x /= 2;
tpos.y /= 2; tpos.y /= 2;
// Calculate angle: if the track segment is vertical, angle = 90 degrees // Calculate angle: if the track segment is vertical, angle = 90 degrees
int angle = 0; int angle = 0;
if ( (m_End.x - m_Start.x) == 0 ) // Vertical segment if( (m_End.x - m_Start.x) == 0 ) // Vertical segment
angle = 900; // angle is in 0.1 degree angle = 900; // angle is in 0.1 degree
if( panel->GetScreen()->Scale( tsize ) >= 6 ) if( panel->GetScreen()->Scale( tsize ) >= 6 )
{ {
tsize = (tsize * 8) / 10; // small reduction to give a better look tsize = (tsize * 8) / 10; // small reduction to give a better look
DrawGraphicText( panel, DC, tpos, DrawGraphicText( panel, DC, tpos,
WHITE, net->GetShortNetname(), angle, wxSize( tsize, tsize ), WHITE, net->GetShortNetname(), angle, wxSize( tsize, tsize ),
GR_TEXT_HJUSTIFY_CENTER, GR_TEXT_VJUSTIFY_CENTER, tsize / 7 ); GR_TEXT_HJUSTIFY_CENTER, GR_TEXT_VJUSTIFY_CENTER, tsize / 7 );
} }
} }
} }
@ -752,14 +755,14 @@ void SEGVIA::Draw( WinEDA_DrawPanel* panel, wxDC* DC, int draw_mode, const wxPoi
if( drill_rayon < inner_rayon ) // We can show the via hole if( drill_rayon < inner_rayon ) // We can show the via hole
{ {
GRCircle( &panel->m_ClipBox, DC, m_Start.x, m_Start.y, GRCircle( &panel->m_ClipBox, DC, m_Start.x, m_Start.y,
drill_rayon, color ); drill_rayon, color );
} }
} }
} }
if( DisplayOpt.DisplayTrackIsol ) if( DisplayOpt.DisplayTrackIsol )
GRCircle( &panel->m_ClipBox, DC, m_Start.x, m_Start.y, GRCircle( &panel->m_ClipBox, DC, m_Start.x, m_Start.y,
rayon + g_DesignSettings.m_TrackClearence, color ); rayon + g_DesignSettings.m_TrackClearence, color );
// for Micro Vias, draw a partial cross : // for Micro Vias, draw a partial cross :
// X on component layer, or + on copper layer // X on component layer, or + on copper layer
@ -781,15 +784,15 @@ void SEGVIA::Draw( WinEDA_DrawPanel* panel, wxDC* DC, int draw_mode, const wxPoi
/* lines | or \ */ /* lines | or \ */
GRLine( &panel->m_ClipBox, DC, m_Start.x - ax, m_Start.y - ay, GRLine( &panel->m_ClipBox, DC, m_Start.x - ax, m_Start.y - ay,
m_Start.x - bx, m_Start.y - by, 0, color ); m_Start.x - bx, m_Start.y - by, 0, color );
GRLine( &panel->m_ClipBox, DC, m_Start.x + bx, m_Start.y + by, GRLine( &panel->m_ClipBox, DC, m_Start.x + bx, m_Start.y + by,
m_Start.x + ax, m_Start.y + ay, 0, color ); m_Start.x + ax, m_Start.y + ay, 0, color );
/* lines - or / */ /* lines - or / */
GRLine( &panel->m_ClipBox, DC, m_Start.x + ay, m_Start.y - ax, GRLine( &panel->m_ClipBox, DC, m_Start.x + ay, m_Start.y - ax,
m_Start.x + by, m_Start.y - bx, 0, color ); m_Start.x + by, m_Start.y - bx, 0, color );
GRLine( &panel->m_ClipBox, DC, m_Start.x - by, m_Start.y + bx, GRLine( &panel->m_ClipBox, DC, m_Start.x - by, m_Start.y + bx,
m_Start.x - ay, m_Start.y + ax, 0, color ); m_Start.x - ay, m_Start.y + ax, 0, color );
} }
// for Buried Vias, draw a partial line : // for Buried Vias, draw a partial line :
@ -806,20 +809,20 @@ void SEGVIA::Draw( WinEDA_DrawPanel* panel, wxDC* DC, int draw_mode, const wxPoi
RotatePoint( &ax, &ay, layer_top * 3600 / g_DesignSettings.m_CopperLayerCount ); RotatePoint( &ax, &ay, layer_top * 3600 / g_DesignSettings.m_CopperLayerCount );
RotatePoint( &bx, &by, layer_top * 3600 / g_DesignSettings.m_CopperLayerCount ); RotatePoint( &bx, &by, layer_top * 3600 / g_DesignSettings.m_CopperLayerCount );
GRLine( &panel->m_ClipBox, DC, m_Start.x - ax, m_Start.y - ay, GRLine( &panel->m_ClipBox, DC, m_Start.x - ax, m_Start.y - ay,
m_Start.x - bx, m_Start.y - by, 0, color ); m_Start.x - bx, m_Start.y - by, 0, color );
/* lines for the bottom layer */ /* lines for the bottom layer */
ax = 0; ay = rayon; bx = 0; by = drill_rayon; ax = 0; ay = rayon; bx = 0; by = drill_rayon;
RotatePoint( &ax, &ay, layer_bottom * 3600 / g_DesignSettings.m_CopperLayerCount ); RotatePoint( &ax, &ay, layer_bottom * 3600 / g_DesignSettings.m_CopperLayerCount );
RotatePoint( &bx, &by, layer_bottom * 3600 / g_DesignSettings.m_CopperLayerCount ); RotatePoint( &bx, &by, layer_bottom * 3600 / g_DesignSettings.m_CopperLayerCount );
GRLine( &panel->m_ClipBox, DC, m_Start.x - ax, m_Start.y - ay, GRLine( &panel->m_ClipBox, DC, m_Start.x - ax, m_Start.y - ay,
m_Start.x - bx, m_Start.y - by, 0, color ); m_Start.x - bx, m_Start.y - by, 0, color );
} }
// Display the short netname: // Display the short netname:
if( GetNet() == 0 ) if( GetNet() == 0 )
return; return;
if ( DisplayOpt.DisplayNetNamesMode == 0 || DisplayOpt.DisplayNetNamesMode == 1 ) if( DisplayOpt.DisplayNetNamesMode == 0 || DisplayOpt.DisplayNetNamesMode == 1 )
return; return;
EQUIPOT* net = ( (BOARD*) GetParent() )->FindNet( GetNet() ); EQUIPOT* net = ( (BOARD*) GetParent() )->FindNet( GetNet() );
if( net == NULL ) if( net == NULL )
@ -834,8 +837,8 @@ void SEGVIA::Draw( WinEDA_DrawPanel* panel, wxDC* DC, int draw_mode, const wxPoi
{ {
tsize = (tsize * 8) / 10; // small reduction to give a better look, inside via tsize = (tsize * 8) / 10; // small reduction to give a better look, inside via
DrawGraphicText( panel, DC, m_Start, DrawGraphicText( panel, DC, m_Start,
WHITE, net->GetShortNetname(), 0, wxSize( tsize, tsize ), WHITE, net->GetShortNetname(), 0, wxSize( tsize, tsize ),
GR_TEXT_HJUSTIFY_CENTER, GR_TEXT_VJUSTIFY_CENTER, tsize / 7 ); GR_TEXT_HJUSTIFY_CENTER, GR_TEXT_VJUSTIFY_CENTER, tsize / 7 );
} }
} }
} }
@ -950,19 +953,24 @@ void TRACK::DisplayInfo( WinEDA_DrawFrame* frame )
if( Type() == TYPE_VIA ) // Display Diam and Drill values if( Type() == TYPE_VIA ) // Display Diam and Drill values
{ {
// Display diameter value:
Affiche_1_Parametre( frame, text_pos, _( "Diam" ), msg, DARKCYAN ); Affiche_1_Parametre( frame, text_pos, _( "Diam" ), msg, DARKCYAN );
text_pos += 8; text_pos += 8;
// Display drill value
int drill_value = GetDrillValue(); int drill_value = GetDrillValue();
valeur_param( (unsigned) drill_value, msg ); valeur_param( (unsigned) drill_value, msg );
wxString title = _( "Drill" ); wxString title = _( "Drill" );
title += wxT(" ");
if( g_DesignSettings.m_ViaDrill >= 0 ) if( m_Drill >= 0 )
title += wxT( "*" ); title += _( "(Specific)" );
else
title += _( "(Default)" );
Affiche_1_Parametre( frame, text_pos, _( "Drill" ), msg, RED ); Affiche_1_Parametre( frame, text_pos, title, msg, RED );
} }
else else
Affiche_1_Parametre( frame, text_pos, _( "Width" ), msg, DARKCYAN ); Affiche_1_Parametre( frame, text_pos, _( "Width" ), msg, DARKCYAN );
@ -1019,7 +1027,7 @@ bool TRACK::HitTest( EDA_Rect& refArea )
} }
#if defined (DEBUG) #if defined(DEBUG)
/** /**
* Function Show * Function Show

View File

@ -734,7 +734,7 @@ void WinEDA_PcbFrame::Process_Special_Functions( wxCommandEvent& event )
break; break;
case ID_POPUP_PCB_DELETE_PAD: case ID_POPUP_PCB_DELETE_PAD:
DeletePad( (D_PAD*) GetCurItem(), &dc ); DeletePad( (D_PAD*) GetCurItem() );
SetCurItem( NULL ); SetCurItem( NULL );
DrawPanel->MouseToCursorSchema(); DrawPanel->MouseToCursorSchema();
break; break;

View File

@ -136,7 +136,7 @@ void WinEDA_ModuleEditFrame::RemoveStruct( EDA_BaseStruct* Item, wxDC* DC )
switch( Item->Type() ) switch( Item->Type() )
{ {
case TYPE_PAD: case TYPE_PAD:
DeletePad( (D_PAD*) Item, DC ); DeletePad( (D_PAD*) Item );
break; break;
case TYPE_TEXTE_MODULE: case TYPE_TEXTE_MODULE:

View File

@ -160,6 +160,13 @@ int WinEDA_BasePcbFrame::ReadListeSegmentDescr( FILE* File,
newTrack->SetDrillValue(drill); newTrack->SetDrillValue(drill);
newTrack->SetLayer( layer ); newTrack->SetLayer( layer );
if ( makeType == TYPE_VIA )
{ // Ensure layers are OK when possible:
if( newTrack->Shape() == VIA_THROUGH )
((SEGVIA*)newTrack)->SetLayerPair( LAYER_CMP_N, COPPER_LAYER_N );
}
newTrack->SetNet( net_code ); newTrack->SetNet( net_code );
newTrack->SetState( flags, ON ); newTrack->SetState( flags, ON );
} }

View File

@ -163,7 +163,8 @@ MODULE* WinEDA_BasePcbFrame::Load_Module_From_Library( const wxString& library,
GetBoard()->m_Status_Pcb = 0; GetBoard()->m_Status_Pcb = 0;
module->SetPosition( curspos ); module->SetPosition( curspos );
build_liste_pads(); build_liste_pads();
module->Draw( DrawPanel, DC, GR_OR ); if ( DC )
module->Draw( DrawPanel, DC, GR_OR );
} }
return module; return module;

View File

@ -131,6 +131,7 @@ void WinEDA_ModuleEditFrame::Process_Special_Functions( wxCommandEvent& event )
{ {
int id = event.GetId(); int id = event.GetId();
wxPoint pos; wxPoint pos;
bool redraw = false;
wxClientDC dc( DrawPanel ); wxClientDC dc( DrawPanel );
DrawPanel->CursorOff( &dc ); DrawPanel->CursorOff( &dc );
@ -358,7 +359,8 @@ void WinEDA_ModuleEditFrame::Process_Special_Functions( wxCommandEvent& event )
SetCurItem( NULL ); SetCurItem( NULL );
Clear_Pcb( true ); Clear_Pcb( true );
GetScreen()->m_Curseur = wxPoint( 0, 0 ); GetScreen()->m_Curseur = wxPoint( 0, 0 );
Load_Module_From_Library( full_libraryfilename, &dc ); Load_Module_From_Library( full_libraryfilename, NULL );
redraw = true;
} }
if( GetBoard()->m_Modules ) if( GetBoard()->m_Modules )
GetBoard()->m_Modules->m_Flags = 0; GetBoard()->m_Modules->m_Flags = 0;
@ -440,7 +442,7 @@ void WinEDA_ModuleEditFrame::Process_Special_Functions( wxCommandEvent& event )
case ID_POPUP_PCB_ROTATE_MODULE_COUNTERCLOCKWISE: case ID_POPUP_PCB_ROTATE_MODULE_COUNTERCLOCKWISE:
DrawPanel->MouseToCursorSchema(); DrawPanel->MouseToCursorSchema();
Rotate_Module( &dc, (MODULE*) GetScreen()->GetCurItem(), 900, true ); Rotate_Module( NULL, (MODULE*) GetScreen()->GetCurItem(), 900, true );
break; break;
case ID_POPUP_PCB_ROTATE_MODULE_CLOCKWISE: case ID_POPUP_PCB_ROTATE_MODULE_CLOCKWISE:
@ -468,7 +470,7 @@ void WinEDA_ModuleEditFrame::Process_Special_Functions( wxCommandEvent& event )
case ID_POPUP_PCB_DELETE_PAD: case ID_POPUP_PCB_DELETE_PAD:
SaveCopyInUndoList( GetBoard()->m_Modules ); SaveCopyInUndoList( GetBoard()->m_Modules );
DeletePad( (D_PAD*) GetScreen()->GetCurItem(), &dc ); DeletePad( (D_PAD*) GetScreen()->GetCurItem() );
SetCurItem( NULL ); SetCurItem( NULL );
DrawPanel->MouseToCursorSchema(); DrawPanel->MouseToCursorSchema();
break; break;
@ -658,6 +660,8 @@ void WinEDA_ModuleEditFrame::Process_Special_Functions( wxCommandEvent& event )
SetToolbars(); SetToolbars();
DrawPanel->CursorOn( &dc ); DrawPanel->CursorOn( &dc );
if ( redraw )
DrawPanel->Refresh();
} }

View File

@ -243,7 +243,7 @@ void WinEDA_BasePcbFrame::AddPad( MODULE* Module, bool draw )
/*********************************************************/ /*********************************************************/
void WinEDA_BasePcbFrame::DeletePad( D_PAD* Pad, wxDC* DC ) void WinEDA_BasePcbFrame::DeletePad( D_PAD* Pad )
/*********************************************************/ /*********************************************************/
/* Function to delete the pad "pad" */ /* Function to delete the pad "pad" */
{ {
@ -336,7 +336,8 @@ void WinEDA_BasePcbFrame::PlacePad( D_PAD* Pad, wxDC* DC )
Pad->m_Flags = 0; Pad->m_Flags = 0;
Pad->Draw( DrawPanel, DC, GR_OR ); if ( DC )
Pad->Draw( DrawPanel, DC, GR_OR );
Module->Set_Rectangle_Encadrement(); Module->Set_Rectangle_Encadrement();
Module->m_LastEdit_Time = time( NULL ); Module->m_LastEdit_Time = time( NULL );
@ -347,7 +348,8 @@ void WinEDA_BasePcbFrame::PlacePad( D_PAD* Pad, wxDC* DC )
{ {
Track = pt_drag->m_Segm; Track = pt_drag->m_Segm;
Track->SetState( EDIT, OFF ); Track->SetState( EDIT, OFF );
Track->Draw( DrawPanel, DC, GR_OR ); if ( DC )
Track->Draw( DrawPanel, DC, GR_OR );
} }
EraseDragListe(); EraseDragListe();
@ -377,7 +379,8 @@ void WinEDA_BasePcbFrame::RotatePad( D_PAD* Pad, wxDC* DC )
GetScreen()->SetModify(); GetScreen()->SetModify();
Module->Draw( DrawPanel, DC, GR_XOR ); if ( DC )
Module->Draw( DrawPanel, DC, GR_XOR );
EXCHG( Pad->m_Size.x, Pad->m_Size.y ); EXCHG( Pad->m_Size.x, Pad->m_Size.y );
EXCHG( Pad->m_Drill.x, Pad->m_Drill.y ); EXCHG( Pad->m_Drill.x, Pad->m_Drill.y );
@ -391,5 +394,6 @@ void WinEDA_BasePcbFrame::RotatePad( D_PAD* Pad, wxDC* DC )
Module->Set_Rectangle_Encadrement(); Module->Set_Rectangle_Encadrement();
Pad->DisplayInfo( this ); Pad->DisplayInfo( this );
Module->Draw( DrawPanel, DC, GR_OR ); if ( DC )
Module->Draw( DrawPanel, DC, GR_OR );
} }