fixed eeschema crash when using the hotkey m (move) command.

Pcbnew :added option to show/hide footprints values and/or references
This commit is contained in:
charras 2010-01-28 13:10:46 +00:00
parent 3962e4430a
commit f6656e0384
14 changed files with 85 additions and 102 deletions

View File

@ -4,6 +4,12 @@ KiCad ChangeLog 2010
Please add newer entries at the top, list the date and your name with Please add newer entries at the top, list the date and your name with
email address. email address.
2010-Jan-28 UPDATE Jean-Pierre Charras <jean-pierre.charras@gipsa-lab.inpg.fr>
================================================================================
*fixed eeschema crash when using the hotkey m (move) command.
* Pcbnew :added option to show/hide footprints values and/or references
See if show/hide footprints texts option is now always useful.
2010-Jan-27 UPDATE Jean-Pierre Charras <jean-pierre.charras@gipsa-lab.inpg.fr> 2010-Jan-27 UPDATE Jean-Pierre Charras <jean-pierre.charras@gipsa-lab.inpg.fr>
================================================================================ ================================================================================
++ Pcbnew: ++ Pcbnew:

View File

@ -83,7 +83,6 @@ set(PCB_COMMON_SRCS
../pcbnew/classpcb.cpp ../pcbnew/classpcb.cpp
../pcbnew/collectors.cpp ../pcbnew/collectors.cpp
../pcbnew/sel_layer.cpp ../pcbnew/sel_layer.cpp
../pcbnew/tracemod.cpp
) )
add_library(pcbcommon ${PCB_COMMON_SRCS}) add_library(pcbcommon ${PCB_COMMON_SRCS})

View File

@ -5,10 +5,6 @@
/* Set up color Layers for EESchema /* Set up color Layers for EESchema
*/ */
#if defined(__GNUG__) && !defined(__APPLE__)
#pragma implementation "eelayer.h"
#endif
#include "fctsys.h" #include "fctsys.h"
#include "gr_basic.h" #include "gr_basic.h"
#include "common.h" #include "common.h"

View File

@ -5,10 +5,6 @@
#ifndef _EELAYER_H_ #ifndef _EELAYER_H_
#define _EELAYER_H_ #define _EELAYER_H_
#if defined(__GNUG__) && !defined(__APPLE__)
#pragma interface "eelayer.cpp"
#endif
#include "wx/statline.h" #include "wx/statline.h"
class wxBoxSizer; class wxBoxSizer;

View File

@ -468,6 +468,8 @@ void WinEDA_SchematicFrame::OnHotKey( wxDC* DC, int hotkey,
break; break;
if( DrawStruct->Type() == TYPE_SCH_COMPONENT ) if( DrawStruct->Type() == TYPE_SCH_COMPONENT )
DrawStruct = LocateSmallestComponent( GetScreen() ); DrawStruct = LocateSmallestComponent( GetScreen() );
if( DrawStruct == NULL )
break;
if( DrawStruct->Type() == DRAW_SHEET_STRUCT_TYPE ){ if( DrawStruct->Type() == DRAW_SHEET_STRUCT_TYPE ){
// If it's a sheet, then check if a pinsheet is under the cursor // If it's a sheet, then check if a pinsheet is under the cursor
SCH_SHEET_PIN* slabel = LocateSheetLabel( (SCH_SHEET*) DrawStruct, SCH_SHEET_PIN* slabel = LocateSheetLabel( (SCH_SHEET*) DrawStruct,
@ -477,10 +479,8 @@ void WinEDA_SchematicFrame::OnHotKey( wxDC* DC, int hotkey,
} }
if (DrawStruct->Type() == DRAW_JUNCTION_STRUCT_TYPE){ if (DrawStruct->Type() == DRAW_JUNCTION_STRUCT_TYPE){
// If it's a junction, pick the underlying wire instead // If it's a junction, pick the underlying wire instead
DrawStruct = PickStruct( GetScreen()->m_Curseur, DrawStruct = PickStruct( GetScreen()->m_Curseur, GetScreen(), WIREITEM);
GetScreen(), WIREITEM);
} }
if( DrawStruct == NULL ) if( DrawStruct == NULL )
break; break;
} }

View File

@ -178,6 +178,8 @@ enum PCB_VISIBLE
NO_CONNECTS_VISIBLE, ///< show a marker on pads with no nets NO_CONNECTS_VISIBLE, ///< show a marker on pads with no nets
MOD_FR_VISIBLE, ///< show modules on front MOD_FR_VISIBLE, ///< show modules on front
MOD_BK_VISIBLE, ///< show modules on back MOD_BK_VISIBLE, ///< show modules on back
MOD_VALUES_VISIBLE, ///< show modules values (when texts are visibles)
MOD_REFERENCES_VISIBLE, ///< show modules references (when texts are visibles)
END_VISIBLE // sentinel END_VISIBLE // sentinel
}; };

Binary file not shown.

View File

@ -3,7 +3,7 @@ msgstr ""
"Project-Id-Version: kicad\n" "Project-Id-Version: kicad\n"
"Report-Msgid-Bugs-To: \n" "Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2010-01-27 21:22+0100\n" "POT-Creation-Date: 2010-01-27 21:22+0100\n"
"PO-Revision-Date: 2010-01-27 21:23+0100\n" "PO-Revision-Date: 2010-01-28 11:33+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"
@ -7484,7 +7484,7 @@ msgstr "Pin"
#: eeschema/class_pin.cpp:1609 #: eeschema/class_pin.cpp:1609
msgid "Number" msgid "Number"
msgstr "Nombre" msgstr "Numéro"
#: eeschema/database.cpp:49 #: eeschema/database.cpp:49
msgid "No components found matching " msgid "No components found matching "

View File

@ -97,12 +97,11 @@ void WinEDA_PcbFrame::RecreateBOMFileFromBoard( wxCommandEvent& aEvent )
cmp* comp = NULL; cmp* comp = NULL;
CmpList::iterator iter; CmpList::iterator iter;
int i = 1; int i = 1;
for( ; Module != NULL; Module = Module->Next() ) while (Module != NULL)
{ {
bool valExist = false; bool valExist = false;
if( comp != NULL ) // try to find component in existing list
{
for( iter = list.begin(); iter != list.end(); iter++ ) for( iter = list.begin(); iter != list.end(); iter++ )
{ {
cmp* current = *iter; cmp* current = *iter;
@ -110,15 +109,15 @@ void WinEDA_PcbFrame::RecreateBOMFileFromBoard( wxCommandEvent& aEvent )
{ {
current->m_Ref.Append( wxT( ", " ), 1 ); current->m_Ref.Append( wxT( ", " ), 1 );
current->m_Ref.Append( Module->m_Reference->m_Text ); current->m_Ref.Append( Module->m_Reference->m_Text );
comp->m_CmpCount++; current->m_CmpCount++;
valExist = true; valExist = true;
break; break;
} }
} }
}
if( !valExist || (comp == NULL) ) // If component does not exist yet, create new one and append it to the list.
if( valExist == false )
{ {
comp = new cmp(); comp = new cmp();
comp->m_Id = i++; comp->m_Id = i++;
@ -128,6 +127,9 @@ void WinEDA_PcbFrame::RecreateBOMFileFromBoard( wxCommandEvent& aEvent )
comp->m_CmpCount = 1; comp->m_CmpCount = 1;
list.Append( comp ); list.Append( comp );
} }
// increment module
Module = Module->Next();
} }
// Print list // Print list

View File

@ -70,7 +70,7 @@ void MODULE::DrawAncre( WinEDA_DrawPanel* panel, wxDC* DC, const wxPoint& offset
GRSetDrawMode( DC, draw_mode ); GRSetDrawMode( DC, draw_mode );
if( g_DesignSettings.IsElementVisible( ANCHOR_VISIBLE ) ) if( ((BOARD*)m_Parent)->IsElementVisible( ANCHOR_VISIBLE ) )
{ {
GRLine( &panel->m_ClipBox, DC, GRLine( &panel->m_ClipBox, DC,
m_Pos.x - offset.x - anchor_size, m_Pos.y - offset.y, m_Pos.x - offset.x - anchor_size, m_Pos.y - offset.y,
@ -190,15 +190,22 @@ void MODULE::Draw( WinEDA_DrawPanel* panel, wxDC* DC,
pad->Draw( panel, DC, draw_mode, offset ); pad->Draw( panel, DC, draw_mode, offset );
} }
// Draws footprint anchor // Draws footprint anchor
DrawAncre( panel, DC, offset, DIM_ANCRE_MODULE, draw_mode ); DrawAncre( panel, DC, offset, DIM_ANCRE_MODULE, draw_mode );
/* Draw graphic items */ /* Draw graphic items */
if( ((BOARD*)m_Parent)->IsElementVisible( MOD_REFERENCES_VISIBLE ) )
{
if( !(m_Reference->m_Flags & IS_MOVED) ) if( !(m_Reference->m_Flags & IS_MOVED) )
m_Reference->Draw( panel, DC, draw_mode, offset ); m_Reference->Draw( panel, DC, draw_mode, offset );
}
if( ((BOARD*)m_Parent)->IsElementVisible( MOD_VALUES_VISIBLE ) )
{
if( !(m_Value->m_Flags & IS_MOVED) ) if( !(m_Value->m_Flags & IS_MOVED) )
m_Value->Draw( panel, DC, draw_mode, offset ); m_Value->Draw( panel, DC, draw_mode, offset );
}
for( BOARD_ITEM* item = m_Drawings; item; item = item->Next() ) for( BOARD_ITEM* item = m_Drawings; item; item = item->Next() )
{ {

View File

@ -106,7 +106,7 @@ PCB_LAYER_WIDGET::PCB_LAYER_WIDGET( WinEDA_PcbFrame* aParent, wxWindow* aFocusOw
// is changed before appending to the LAYER_WIDGET. This is an automatic variable // is changed before appending to the LAYER_WIDGET. This is an automatic variable
// not a static variable, change the color & state after copying from code to renderRows // not a static variable, change the color & state after copying from code to renderRows
// on the stack. // on the stack.
LAYER_WIDGET::ROW renderRows[14] = { LAYER_WIDGET::ROW renderRows[16] = {
#define RR LAYER_WIDGET::ROW // Render Row abreviation to reduce source width #define RR LAYER_WIDGET::ROW // Render Row abreviation to reduce source width
@ -128,6 +128,8 @@ PCB_LAYER_WIDGET::PCB_LAYER_WIDGET( WinEDA_PcbFrame* aParent, wxWindow* aFocusOw
RR( _( "No-Connects" ), NO_CONNECTS_VISIBLE, -1, _( "Show a marker on pads which have no net connected" ) ), RR( _( "No-Connects" ), NO_CONNECTS_VISIBLE, -1, _( "Show a marker on pads which have no net connected" ) ),
RR( _( "Modules Front" ), MOD_FR_VISIBLE, -1, _( "Show footprints that are on board's front") ), RR( _( "Modules Front" ), MOD_FR_VISIBLE, -1, _( "Show footprints that are on board's front") ),
RR( _( "Modules Back" ), MOD_BK_VISIBLE, -1, _( "Show footprints that are on board's back") ), RR( _( "Modules Back" ), MOD_BK_VISIBLE, -1, _( "Show footprints that are on board's back") ),
RR( _( "Values" ), MOD_VALUES_VISIBLE, -1, _( "Show footprints values") ),
RR( _( "References" ), MOD_REFERENCES_VISIBLE, -1, _( "Show footprints references") ),
}; };
for( unsigned row=0; row<DIM(renderRows); ++row ) for( unsigned row=0; row<DIM(renderRows); ++row )

View File

@ -76,23 +76,6 @@ void Trace_Une_Piste( WinEDA_DrawPanel* panel,
int mode_color ); int mode_color );
/****************/
/* TRACEMOD.C : */
/****************/
/* Trace the pads of a module in sketch mode.
* Used to display a module pads when it is not displayed by the display
* options Module.
* The pads must appear on the data layers by MasqueLayer
*/
void Trace_Pads_Only( WinEDA_DrawPanel* panel,
wxDC* DC,
MODULE* Module,
int ox,
int oy,
int MasqueLayer,
int mode_color );
/****************/ /****************/
/* LOCATE.CPP : */ /* LOCATE.CPP : */
/****************/ /****************/

View File

@ -1,51 +0,0 @@
/*******************/
/* Display modules */
/*******************/
#include "fctsys.h"
#include "gr_basic.h"
#include "common.h"
#include "trigo.h"
#include "class_drawpanel.h"
#include "pcbnew.h"
#include "drag.h"
/* Font of characters for the trace text routine. */
extern char* graphic_fonte_shape[];
#include "protos.h"
#define L_MIN_DESSIN 1 /* line width for segments other than traces. */
/* Trace the pads of a module in sketch mode.
* Used to display a module pads when it is not displayed by the display
* options Module setting.
*
* The pads posters must appear on the data layers by MasqueLayer
*/
void Trace_Pads_Only( WinEDA_DrawPanel* panel, wxDC* DC, MODULE* Module,
int ox, int oy, int MasqueLayer, int draw_mode )
{
int tmp;
PCB_SCREEN* screen;
WinEDA_BasePcbFrame* frame;
screen = (PCB_SCREEN*) panel->GetScreen();
frame = (WinEDA_BasePcbFrame*) panel->GetParent();
tmp = frame->m_DisplayPadFill;
frame->m_DisplayPadFill = FALSE;
/* Draw pads. */
for( D_PAD* pad = Module->m_Pads; pad; pad = pad->Next() )
{
if( (pad->m_Masque_Layer & MasqueLayer) == 0 )
continue;
pad->Draw( panel, DC, draw_mode, wxPoint( ox, oy ) );
}
frame->m_DisplayPadFill = tmp;
}

View File

@ -18,6 +18,15 @@
#include "pcbplot.h" #include "pcbplot.h"
#include "protos.h" #include "protos.h"
// Local functions:
/* Trace the pads of a module in sketch mode.
* Used to display pads when when the module visibility is set to not visible
* and we want to see pad through.
* The pads must appear on the layers selected in MasqueLayer
*/
static void Trace_Pads_Only( WinEDA_DrawPanel* panel, wxDC* DC, MODULE* Module,
int ox, int oy, int MasqueLayer, int draw_mode );
/* Draw the footprint editor BOARD, and others elements : axis, grid .. /* Draw the footprint editor BOARD, and others elements : axis, grid ..
*/ */
@ -235,3 +244,35 @@ void BOARD::DrawHighLight( WinEDA_DrawPanel* aDrawPanel, wxDC* DC, int aNetCode
} }
} }
} }
/* Trace the pads of a module in sketch mode.
* Used to display pads when when the module visibility is set to not visible
* and we want to see pad through.
* The pads must appear on the layers selected in MasqueLayer
*/
void Trace_Pads_Only( WinEDA_DrawPanel* panel, wxDC* DC, MODULE* Module,
int ox, int oy, int MasqueLayer, int draw_mode )
{
int tmp;
PCB_SCREEN* screen;
WinEDA_BasePcbFrame* frame;
screen = (PCB_SCREEN*) panel->GetScreen();
frame = (WinEDA_BasePcbFrame*) panel->GetParent();
tmp = frame->m_DisplayPadFill;
frame->m_DisplayPadFill = FALSE;
/* Draw pads. */
for( D_PAD* pad = Module->m_Pads; pad; pad = pad->Next() )
{
if( (pad->m_Masque_Layer & MasqueLayer) == 0 )
continue;
pad->Draw( panel, DC, draw_mode, wxPoint( ox, oy ) );
}
frame->m_DisplayPadFill = tmp;
}