7
mirror of https://gitlab.com/kicad/code/kicad.git synced 2025-04-19 09:51:43 +00:00

bug in move pad fixed (could crash pcbnew).Other minor changes

This commit is contained in:
CHARRAS 2007-10-07 18:24:15 +00:00
parent 88ef06efe2
commit 1f842ae14c
50 changed files with 397 additions and 268 deletions

View File

@ -150,7 +150,7 @@ glEnable(GL_FOG);
glVertex3f( sx, -sy , zpos);
glEnd();
glBegin(GL_QUADS);
SetGLColor(g_Parm_3D_Visu.m_BoardSettings->m_LayerColor[CUIVRE_N]);
SetGLColor(g_Parm_3D_Visu.m_BoardSettings->m_LayerColor[COPPER_LAYER_N]);
glNormal3f( 0.0, 0.0, -1.0); // Normal is -Z axis
glVertex3f( -sx, -sy , 0);
glVertex3f( -sx, sy , 0);
@ -213,7 +213,7 @@ double w;
zpos = g_Parm_3D_Visu.m_LayerZcoord[layer];
SetGLColor(color);
glNormal3f( 0.0, 0.0, (layer == CUIVRE_N) ? -1.0 : 1.0);
glNormal3f( 0.0, 0.0, (layer == COPPER_LAYER_N) ? -1.0 : 1.0);
w = track->m_Width * g_Parm_3D_Visu.m_BoardScale;
ox = track->m_Start.x * g_Parm_3D_Visu.m_BoardScale;
@ -250,7 +250,7 @@ int color;
else color = g_Parm_3D_Visu.m_BoardSettings->m_LayerColor[CMP_N];
if ( color & ITEM_NOT_SHOW ) continue;
SetGLColor(color);
glNormal3f( 0.0, 0.0, (layer == CUIVRE_N) ? -1.0 : 1.0);
glNormal3f( 0.0, 0.0, (layer == COPPER_LAYER_N) ? -1.0 : 1.0);
Draw3D_FilledCircle(x, -y, r, hole, zpos);
if ( layer >= top_layer) break;
@ -284,7 +284,7 @@ int color = g_Parm_3D_Visu.m_BoardSettings->m_LayerColor[segment->GetLayer()];
{
for ( layer = 0; layer < g_Parm_3D_Visu.m_Layers; layer++ )
{
glNormal3f( 0.0, 0.0, (layer == CUIVRE_N) ? -1.0 : 1.0);
glNormal3f( 0.0, 0.0, (layer == COPPER_LAYER_N) ? -1.0 : 1.0);
zpos = g_Parm_3D_Visu.m_LayerZcoord[layer];
Draw3D_FilledSegment( x, -y, xf, -yf, w, zpos);
}
@ -312,7 +312,7 @@ D_PAD * pad = m_Pads;
}
if( ! DisplayOpt.Show_Modules_Cu )
{
if(m_Layer == CUIVRE_N) return;
if(m_Layer == COPPER_LAYER_N) return;
}
#endif
@ -335,7 +335,7 @@ bool As3dShape = FALSE;
{
glRotatef( (double)m_Orient / 10, 0.0, 0.0, 1.0 );
}
if ( m_Layer == CUIVRE_N )
if ( m_Layer == COPPER_LAYER_N )
{
glRotatef( 180.0, 0.0, 1.0, 0.0 );
glRotatef( 180.0, 0.0, 0.0, 1.0 );
@ -384,7 +384,7 @@ int color = g_Parm_3D_Visu.m_BoardSettings->m_LayerColor[m_Layer];
if ( color & ITEM_NOT_SHOW ) return;
SetGLColor(color);
glNormal3f( 0.0, 0.0, (m_Layer == CUIVRE_N) ? -1.0 : 1.0);
glNormal3f( 0.0, 0.0, (m_Layer == COPPER_LAYER_N) ? -1.0 : 1.0);
scale = g_Parm_3D_Visu.m_BoardScale;
ux0 = m_Start.x;
@ -477,16 +477,16 @@ int color;
x = xc * scale;
y = yc * scale;
r = (double)dx * scale;
for ( layer = CUIVRE_N; layer <= CMP_N; layer ++)
for ( layer = COPPER_LAYER_N; layer <= CMP_N; layer ++)
{
if (layer && (layer == nlmax) ) layer = CMP_N;
if ( (layer == CMP_N) && ! Oncmp ) continue;
if ( (layer == CUIVRE_N) && ! Oncu ) continue;
if ( (layer > CUIVRE_N) && (layer < CMP_N) && !Both) continue;
if ( (layer == COPPER_LAYER_N) && ! Oncu ) continue;
if ( (layer > COPPER_LAYER_N) && (layer < CMP_N) && !Both) continue;
color = g_Parm_3D_Visu.m_BoardSettings->m_LayerColor[layer];
if ( color & ITEM_NOT_SHOW ) continue;
SetGLColor(color);
glNormal3f( 0.0, 0.0, (layer == CUIVRE_N) ? -1.0 : 1.0);
glNormal3f( 0.0, 0.0, (layer == COPPER_LAYER_N) ? -1.0 : 1.0);
zpos = g_Parm_3D_Visu.m_LayerZcoord[layer];
Draw3D_FilledCircle(x, -y, r, hole, zpos);
}
@ -513,14 +513,14 @@ int color;
oy = (double)(uy0 + delta_cy) * scale;
fx = (double)(ux0 - delta_cx) * scale;
fy = (double)(uy0 - delta_cy) * scale;
for ( layer = CUIVRE_N; layer <= CMP_N; layer ++)
for ( layer = COPPER_LAYER_N; layer <= CMP_N; layer ++)
{
if (layer && (layer == nlmax) ) layer = CMP_N;
if ( (layer == CMP_N) && ! Oncmp ) continue;
if ( (layer == CUIVRE_N) && ! Oncu ) continue;
if ( (layer > CUIVRE_N) && (layer < CMP_N) && !Both) continue;
if ( (layer == COPPER_LAYER_N) && ! Oncu ) continue;
if ( (layer > COPPER_LAYER_N) && (layer < CMP_N) && !Both) continue;
color = g_Parm_3D_Visu.m_BoardSettings->m_LayerColor[layer];
glNormal3f( 0.0, 0.0, (layer == CUIVRE_N) ? -1.0 : 1.0);
glNormal3f( 0.0, 0.0, (layer == COPPER_LAYER_N) ? -1.0 : 1.0);
if ( color & ITEM_NOT_SHOW ) continue;
SetGLColor(color);
zpos = g_Parm_3D_Visu.m_LayerZcoord[layer];
@ -574,14 +574,14 @@ int color;
f_hole_coord[ii][1] += drilly;
}
for ( layer = CUIVRE_N; layer <= CMP_N; layer ++)
for ( layer = COPPER_LAYER_N; layer <= CMP_N; layer ++)
{
if (layer && (layer == nlmax) ) layer = CMP_N;
if ( (layer == CMP_N) && ! Oncmp ) continue;
if ( (layer == CUIVRE_N) && ! Oncu ) continue;
if ( (layer > CUIVRE_N) && (layer < CMP_N) && !Both) continue;
if ( (layer == COPPER_LAYER_N) && ! Oncu ) continue;
if ( (layer > COPPER_LAYER_N) && (layer < CMP_N) && !Both) continue;
color = g_Parm_3D_Visu.m_BoardSettings->m_LayerColor[layer];
glNormal3f( 0.0, 0.0, (layer == CUIVRE_N) ? -1.0 : 1.0);
glNormal3f( 0.0, 0.0, (layer == COPPER_LAYER_N) ? -1.0 : 1.0);
if ( color & ITEM_NOT_SHOW ) continue;
SetGLColor(color);
zpos = g_Parm_3D_Visu.m_LayerZcoord[layer];

View File

@ -4,6 +4,21 @@ Started 2007-June-11
Please add newer entries at the top, list the date and your name with
email address.
2007-Oct-7 UPDATE Jean-Pierre Charras <jean-pierre.charras@inpg.fr>
================================================================================
+ eeschema
create new file cross-probing.cpp
move RemoteCommand() to cross-probing.cpp and create SendMessageToPCBNEW()
+ pcbnew
bug in move pad fixed (could crash pcbnew)
Small change in selection clarification (side effect removed):
- Escape or click on title does not show the next popup menu.
- the title is displayed under linux
- definition CUIVRE_N translated into COPPER_LAYER_N
2007-Oct-07 UPDATE Geoff Harland <gharlandau@yahoo.com.au>
================================================================================
+ all

View File

@ -192,7 +192,7 @@ public:
void RecreateMenuBar();
void OnLeftClick(wxDC * DC, const wxPoint& MousePos);
void OnLeftDClick(wxDC * DC, const wxPoint& MousePos);
void OnRightClick(const wxPoint& MousePos, wxMenu * PopMenu);
bool OnRightClick(const wxPoint& MousePos, wxMenu * PopMenu);
void SetToolbars();
void InstallOptionsDisplay(wxCommandEvent& event);
MODULE * Get_Module(const wxString & CmpName);

View File

@ -144,18 +144,25 @@ void WinEDA_DisplayFrame::SetToolbars()
}
/*************************************************************************/
void WinEDA_DisplayFrame::OnLeftClick( wxDC* DC, const wxPoint& MousePos )
/*************************************************************************/
{
}
/*************************************************************************/
void WinEDA_DisplayFrame::OnLeftDClick( wxDC* DC, const wxPoint& MousePos )
/*************************************************************************/
{
}
void WinEDA_DisplayFrame::OnRightClick( const wxPoint& MousePos, wxMenu* PopMenu )
/*********************************************************************************/
bool WinEDA_DisplayFrame::OnRightClick( const wxPoint& MousePos, wxMenu* PopMenu )
/*********************************************************************************/
{
return true;
}

View File

@ -17,79 +17,6 @@
#include "protos.h"
/* Routines locales */
/* variables externes */
/***************************************************************/
void RemoteCommand( const char* cmdline )
/***************************************************************/
/** Read a remote command sent by pcbnew (via a socket connection) , so when user selects a module
* or pin in pcbnew, eeschema shows that same component or pin.
* The cursor is put on the item
* @param cmdline = received command from pcbnew
* commands are:
* $PART: "reference" put cursor on component
* $PART: "reference" $REF: "ref" put cursor on reference component
* $PART: "reference" $VAL: "value" put cursor on value component
* $PART: "reference" $PAD: "pin name" put cursor on the component pin
*/
{
char line[1024];
char* idcmd;
char* text;
WinEDA_SchematicFrame* frame = EDA_Appl->m_SchematicFrame;
wxString part_ref, msg;
strncpy( line, cmdline, sizeof(line) - 1 );
idcmd = strtok( line, " \n\r" );
text = strtok( NULL, "\"\n\r" );
if( (idcmd == NULL) || (text == NULL) )
return;
if( strcmp( idcmd, "$PART:" ) != 0 )
return;
part_ref = CONV_FROM_UTF8( text );
/* look for a complement */
idcmd = strtok( NULL, " \n\r" );
if( idcmd == NULL ) // component only
{
frame->FindComponentAndItem( part_ref, true, 0, wxEmptyString, false );
return;
}
text = strtok( NULL, "\"\n\r" );
if( text == NULL )
return;
msg = CONV_FROM_UTF8( text );
if( strcmp( idcmd, "$REF:" ) == 0 )
{
frame->FindComponentAndItem( part_ref, true, 2, msg, false );
}
else if( strcmp( idcmd, "$VAL:" ) == 0 )
{
frame->FindComponentAndItem( part_ref, true, 3, msg, false );
}
else if( strcmp( idcmd, "$PAD:" ) == 0 )
{
frame->FindComponentAndItem( part_ref, true, 1, msg, false );
}
else
frame->FindComponentAndItem( part_ref, true, 0, wxEmptyString, false );
}
/**************************************************************/
EDA_BaseStruct* WinEDA_SchematicFrame::
SchematicGeneralLocateAndDisplay( bool IncludePin )
@ -114,7 +41,6 @@ SchematicGeneralLocateAndDisplay( bool IncludePin )
wxPoint mouse_position = GetScreen()->m_MousePosition;
LibDrawPin* Pin = NULL;
EDA_SchComponentStruct* LibItem = NULL;
char Line[1024];
DrawStruct = SchematicGeneralLocateAndDisplay( mouse_position, IncludePin );
if( !DrawStruct && ( mouse_position != GetScreen()->m_Curseur) )
@ -128,21 +54,14 @@ SchematicGeneralLocateAndDisplay( bool IncludePin )
switch( DrawStruct->Type() )
{
case COMPONENT_FIELD_DRAW_TYPE:
{
PartTextStruct* Field = (PartTextStruct*) DrawStruct;
LibItem = (EDA_SchComponentStruct*) Field->m_Parent;
sprintf( Line, "$PART: %s", CONV_TO_UTF8( LibItem->m_Field[REFERENCE].m_Text ) );
SendCommand( MSG_TO_PCB, Line );
}
SendMessageToPCBNEW( DrawStruct );
break;
case DRAW_LIB_ITEM_STRUCT_TYPE:
Pin = LocateAnyPin( m_CurrentScreen->EEDrawList, GetScreen()->m_Curseur, &LibItem );
if( Pin )
break; // Priority is probing a pin first
LibItem = (EDA_SchComponentStruct*) DrawStruct;
sprintf( Line, "$PART: %s", CONV_TO_UTF8( LibItem->m_Field[REFERENCE].m_Text ) );
SendCommand( MSG_TO_PCB, Line );
SendMessageToPCBNEW( DrawStruct );
break;
default:
@ -165,14 +84,7 @@ SchematicGeneralLocateAndDisplay( bool IncludePin )
CYAN );
// Cross probing:2 - pin found, and send a locate pin command to pcbnew (hightlight net)
if( Pin->m_PinNum )
{
wxString pinnum;
Pin->ReturnPinStringNum( pinnum );
sprintf( Line, "$PIN: %s $PART: %s", CONV_TO_UTF8( pinnum ),
CONV_TO_UTF8( LibItem->m_Field[REFERENCE].m_Text ) );
SendCommand( MSG_TO_PCB, Line );
}
SendMessageToPCBNEW( Pin );
}
return DrawStruct;
}

142
eeschema/cross-probing.cpp Normal file
View File

@ -0,0 +1,142 @@
/*********************/
/* cross-probing.cpp */
/*********************/
#include "fctsys.h"
#include "common.h"
#include "program.h"
#include "libcmp.h"
#include "general.h"
#include "eda_dde.h"
#include "id.h"
#include "protos.h"
/***************************************************************/
void RemoteCommand( const char* cmdline )
/***************************************************************/
/** Read a remote command sent by pcbnew (via a socket connection) ,
* so when user selects a module or pin in pcbnew,
* eeschema shows that same component or pin.
* The cursor is put on the item
* port KICAD_SCH_PORT_SERVICE_NUMBER (currently 4243)
* @param cmdline = received command from pcbnew
* commands are:
* $PART: "reference" put cursor on component
* $PART: "reference" $REF: "ref" put cursor on reference component
* $PART: "reference" $VAL: "value" put cursor on value component
* $PART: "reference" $PAD: "pin name" put cursor on the component pin
*/
{
char line[1024];
char* idcmd;
char* text;
WinEDA_SchematicFrame* frame = EDA_Appl->m_SchematicFrame;
wxString part_ref, msg;
strncpy( line, cmdline, sizeof(line) - 1 );
idcmd = strtok( line, " \n\r" );
text = strtok( NULL, "\"\n\r" );
if( (idcmd == NULL) || (text == NULL) )
return;
if( strcmp( idcmd, "$PART:" ) != 0 )
return;
part_ref = CONV_FROM_UTF8( text );
/* look for a complement */
idcmd = strtok( NULL, " \n\r" );
if( idcmd == NULL ) // component only
{
frame->FindComponentAndItem( part_ref, true, 0, wxEmptyString, false );
return;
}
text = strtok( NULL, "\"\n\r" );
if( text == NULL )
return;
msg = CONV_FROM_UTF8( text );
if( strcmp( idcmd, "$REF:" ) == 0 )
{
frame->FindComponentAndItem( part_ref, true, 2, msg, false );
}
else if( strcmp( idcmd, "$VAL:" ) == 0 )
{
frame->FindComponentAndItem( part_ref, true, 3, msg, false );
}
else if( strcmp( idcmd, "$PAD:" ) == 0 )
{
frame->FindComponentAndItem( part_ref, true, 1, msg, false );
}
else
frame->FindComponentAndItem( part_ref, true, 0, wxEmptyString, false );
}
/*****************************************************************************/
void WinEDA_SchematicFrame::SendMessageToPCBNEW( EDA_BaseStruct* objectToSync )
/*****************************************************************************/
/** Send a remote command to eeschema via a socket,
* @param objectToSync = item to be located on board (footprint, pad or text)
* Commands are
* $PART: reference put cursor on footprint anchor
* $PIN: number $PART: reference put cursor on the footprint pad
*/
{
if ( objectToSync == NULL )return;
LibDrawPin* Pin = NULL;
EDA_SchComponentStruct* LibItem = NULL;
char Line[1024];
/* Cross probing to pcbnew if a pin or a component is found */
switch( objectToSync->Type() )
{
case COMPONENT_FIELD_DRAW_TYPE:
{
PartTextStruct* Field = (PartTextStruct*) objectToSync;
LibItem = (EDA_SchComponentStruct*) Field->m_Parent;
if( LibItem == NULL ) break;
sprintf( Line, "$PART: %s", CONV_TO_UTF8( LibItem->m_Field[REFERENCE].m_Text ) );
SendCommand( MSG_TO_PCB, Line );
}
break;
case DRAW_LIB_ITEM_STRUCT_TYPE:
LibItem = (EDA_SchComponentStruct*) objectToSync;
sprintf( Line, "$PART: %s", CONV_TO_UTF8( LibItem->m_Field[REFERENCE].m_Text ) );
SendCommand( MSG_TO_PCB, Line );
break;
case COMPONENT_PIN_DRAW_TYPE:
Pin = (LibDrawPin*) objectToSync;
LibItem = (EDA_SchComponentStruct *) Pin->m_Parent;
if( LibItem == NULL ) break;
if ( Pin->m_PinNum )
{
wxString pinnum;
Pin->ReturnPinStringNum( pinnum );
sprintf( Line, "$PIN: %s $PART: %s", CONV_TO_UTF8( pinnum ),
CONV_TO_UTF8( LibItem->m_Field[REFERENCE].m_Text ) );
}
else
sprintf( Line, "$PART: %s", CONV_TO_UTF8( LibItem->m_Field[REFERENCE].m_Text ) );
SendCommand( MSG_TO_PCB, Line );
break;
default:
break;
}
}

View File

@ -30,13 +30,13 @@ static void AddMenusForPin(wxMenu * PopMenu, LibDrawPin* Pin, WinEDA_LibeditFram
/********************************************************************************/
void WinEDA_LibeditFrame::OnRightClick(const wxPoint& MousePos, wxMenu * PopMenu)
bool WinEDA_LibeditFrame::OnRightClick(const wxPoint& MousePos, wxMenu * PopMenu)
/********************************************************************************/
{
LibEDA_BaseStruct* DrawEntry = CurrentDrawItem;
bool BlockActive = (m_CurrentScreen->BlockLocate.m_Command != BLOCK_IDLE);
if ( CurrentLibEntry == NULL ) return;
if ( CurrentLibEntry == NULL ) return true;
if ( (DrawEntry == NULL) || (DrawEntry->m_Flags == 0) )
{ // Simple localisation des elements
@ -86,7 +86,7 @@ bool BlockActive = (m_CurrentScreen->BlockLocate.m_Command != BLOCK_IDLE);
}
if ( DrawEntry ) DrawEntry->Display_Infos_DrawEntry(this);
else return;
else return true;
CurrentDrawItem = DrawEntry;
@ -208,6 +208,7 @@ bool BlockActive = (m_CurrentScreen->BlockLocate.m_Command != BLOCK_IDLE);
break;
}
PopMenu->AppendSeparator();
return true;
}
/**********************************************************************************/

View File

@ -17,6 +17,7 @@ OBJECTS = eeschema.o\
libedit_onrightclick.o\
libedit_onleftclick.o\
dangling_ends.o\
cross-probing.o\
setpage.o\
cmpclass.o\
class_hierarchy_sheet.o\

View File

@ -77,7 +77,7 @@ void WinEDA_SchematicFrame::ToolOnRightClick( wxCommandEvent& event )
/*****************************************************************/
void WinEDA_SchematicFrame::OnRightClick( const wxPoint& MousePos,
bool WinEDA_SchematicFrame::OnRightClick( const wxPoint& MousePos,
wxMenu* PopMenu )
/*****************************************************************/
@ -96,7 +96,7 @@ void WinEDA_SchematicFrame::OnRightClick( const wxPoint& MousePos,
{
AddMenusForBlock( PopMenu, this );
PopMenu->AppendSeparator();
return;
return true;
}
// Simple localisation des elements si possible
@ -142,7 +142,7 @@ void WinEDA_SchematicFrame::OnRightClick( const wxPoint& MousePos,
ADD_MENUITEM( PopMenu, ID_POPUP_SCH_LEAVE_SHEET, _( "Leave Sheet" ), leave_sheet_xpm );
PopMenu->AppendSeparator();
}
return;
return true;
}
m_CurrentScreen->SetCurItem( DrawStruct );
@ -251,6 +251,7 @@ void WinEDA_SchematicFrame::OnRightClick( const wxPoint& MousePos,
}
PopMenu->AppendSeparator();
return true;
}

View File

@ -99,9 +99,10 @@ void WinEDA_ViewlibFrame::OnLeftClick(wxDC * DC, const wxPoint& MousePos)
}
/********************************************************************************/
void WinEDA_ViewlibFrame::OnRightClick(const wxPoint& MousePos, wxMenu * PopMenu)
bool WinEDA_ViewlibFrame::OnRightClick(const wxPoint& MousePos, wxMenu * PopMenu)
/********************************************************************************/
{
return true;
}

View File

@ -13,7 +13,7 @@
#include "protos.h"
/********************************************************************************/
void WinEDA_GerberFrame::OnRightClick( const wxPoint& MousePos, wxMenu* PopMenu )
bool WinEDA_GerberFrame::OnRightClick( const wxPoint& MousePos, wxMenu* PopMenu )
/********************************************************************************/
/* Prepare le menu PullUp affiché par un click sur le bouton droit
@ -62,12 +62,12 @@ void WinEDA_GerberFrame::OnRightClick( const wxPoint& MousePos, wxMenu* PopMenu
}
if( BlockActive )
return;
return true;
PopMenu->Append( ID_GERBVIEW_POPUP_DELETE_DCODE_ITEMS, _( "Delete Dcode items" ) );
if( DrawStruct == NULL )
return;
return true;
GetScreen()->SetCurItem( DrawStruct );
@ -90,4 +90,5 @@ void WinEDA_GerberFrame::OnRightClick( const wxPoint& MousePos, wxMenu* PopMenu
}
PopMenu->AppendSeparator();
return true;
}

View File

@ -90,7 +90,7 @@ public:
wxSize GetGrid();
void AddMenuZoom( wxMenu* MasterMenu );
void OnRightClick( wxMouseEvent& event );
bool OnRightClick( wxMouseEvent& event );
void Process_Popup_Zoom( wxCommandEvent& event );
void Process_Special_Functions( wxCommandEvent& event );
wxPoint CursorRealPosition( const wxPoint& ScreenPos );

View File

@ -34,10 +34,8 @@
#define CHAIN 0x01 /* segment marque */
/* Flags pour les couches cuivres */
/* numero des couches particulieres */
#define LAYER_CUIVRE_N 0
#define CUIVRE_N 0
/* Layer identification (layer number) */
#define COPPER_LAYER_N 0
#define LAYER_N_2 1 /* Numero layer 2 */
#define LAYER_N_3 2 /* Numero layer 3 */
#define LAYER_N_4 3 /* Numero layer 4 */
@ -79,7 +77,7 @@
/*************************************/
/* constantes de gestion des couches */
/*************************************/
#define CUIVRE_LAYER (1<<LAYER_CUIVRE_N) ///< bit mask for copper layer
#define CUIVRE_LAYER (1<<COPPER_LAYER_N) ///< bit mask for copper layer
#define LAYER_2 (1<<LAYER_N_2) ///< bit mask for layer 2
#define LAYER_3 (1<<LAYER_N_3) ///< bit mask for layer 3
#define LAYER_4 (1<<LAYER_N_4) ///< bit mask for layer 4

View File

@ -300,7 +300,7 @@ public:
virtual void Process_Special_Functions( wxCommandEvent& event ) = 0;
virtual void OnLeftClick( wxDC* DC, const wxPoint& MousePos ) = 0;
virtual void OnLeftDClick( wxDC* DC, const wxPoint& MousePos );
virtual void OnRightClick( const wxPoint& MousePos, wxMenu* PopMenu ) = 0;
virtual bool OnRightClick( const wxPoint& MousePos, wxMenu* PopMenu ) = 0;
virtual void ToolOnRightClick( wxCommandEvent& event );
void AdjustScrollBars();
void Affiche_Status_Box(); /* Affichage des coord curseur, zoom .. */
@ -363,7 +363,7 @@ public:
virtual void ReCreateVToolbar() = 0;
virtual void OnLeftClick( wxDC* DC, const wxPoint& MousePos ) = 0;
virtual void OnLeftDClick( wxDC* DC, const wxPoint& MousePos ) = 0;
virtual void OnRightClick( const wxPoint& MousePos, wxMenu* PopMenu ) = 0;
virtual bool OnRightClick( const wxPoint& MousePos, wxMenu* PopMenu ) = 0;
virtual void ReCreateMenuBar();
PCB_SCREEN* GetScreen() { return (PCB_SCREEN*) m_CurrentScreen; }
@ -614,7 +614,7 @@ public:
* @param aMousePos The current mouse position
* @param aPopMenu The menu to add to.
*/
void OnRightClick( const wxPoint& aMousePos, wxMenu* aPopMenu );
bool OnRightClick( const wxPoint& aMousePos, wxMenu* aPopMenu );
void OnSelectOptionToolbar( wxCommandEvent& event );
void ToolOnRightClick( wxCommandEvent& event );
@ -822,7 +822,7 @@ public:
void ReCreateMenuBar();
void OnLeftClick( wxDC* DC, const wxPoint& MousePos );
void OnLeftDClick( wxDC* DC, const wxPoint& MousePos );
void OnRightClick( const wxPoint& MousePos, wxMenu* PopMenu );
bool OnRightClick( const wxPoint& MousePos, wxMenu* PopMenu );
int BestZoom(); // Retourne le meilleur zoom
void OnSelectOptionToolbar( wxCommandEvent& event );
void OnHotKey( wxDC* DC, int hotkey, EDA_BaseStruct* DrawStruct );
@ -928,7 +928,7 @@ public:
void ReCreateAuxiliaryToolbar();
void OnLeftClick( wxDC* DC, const wxPoint& MousePos );
void OnLeftDClick( wxDC* DC, const wxPoint& MousePos );
void OnRightClick( const wxPoint& MousePos, wxMenu* PopMenu );
bool OnRightClick( const wxPoint& MousePos, wxMenu* PopMenu );
void SetToolbars();
void ReCreateMenuBar();
void ToolOnRightClick( wxCommandEvent& event );
@ -1033,7 +1033,7 @@ public:
void OnLeftClick( wxDC* DC, const wxPoint& MousePos );
void OnLeftDClick( wxDC* DC, const wxPoint& MousePos );
void OnRightClick( const wxPoint& MousePos, wxMenu* PopMenu );
bool OnRightClick( const wxPoint& MousePos, wxMenu* PopMenu );
void OnSelectOptionToolbar( wxCommandEvent& event );
void ToolOnRightClick( wxCommandEvent& event );
int BestZoom(); // Retourne le meilleur zoom
@ -1043,13 +1043,16 @@ public:
EDA_BaseStruct* SchematicGeneralLocateAndDisplay(
const wxPoint& refpoint,
bool IncludePin );
EDA_BaseStruct* FindComponentAndItem(
EDA_BaseStruct* FindComponentAndItem(
const wxString& component_reference, bool Find_in_hierarchy,
int SearchType,
const wxString& text_to_find,
bool mouseWarp );
/* Cross probing with pcbnew */
void SendMessageToPCBNEW( EDA_BaseStruct* objectToSync );
/* netlist generation */
void* BuildNetListBase();
@ -1223,7 +1226,7 @@ public:
void ReCreateHToolbar();
void ReCreateVToolbar();
void OnLeftClick( wxDC* DC, const wxPoint& MousePos );
void OnRightClick( const wxPoint& MousePos, wxMenu* PopMenu );
bool OnRightClick( const wxPoint& MousePos, wxMenu* PopMenu );
int BestZoom(); // Retourne le meilleur zoom
void SetToolbars();
void OnLeftDClick( wxDC* DC, const wxPoint& MousePos );
@ -1344,7 +1347,7 @@ private:
void SelectAndViewLibraryPart( int option );
void ExportToSchematicLibraryPart( wxCommandEvent& event );
void ViewOneLibraryContent( LibraryStruct* Lib, int Flag );
void OnRightClick( const wxPoint& MousePos, wxMenu* PopMenu );
bool OnRightClick( const wxPoint& MousePos, wxMenu* PopMenu );
DECLARE_EVENT_TABLE()
};

View File

@ -441,7 +441,7 @@ int WinEDA_PcbFrame::GenPlaceBoard()
Route_Layer_BOTTOM = CMP_N;
if( Nb_Sides == TWO_SIDES )
Route_Layer_BOTTOM = CUIVRE_N;
Route_Layer_BOTTOM = COPPER_LAYER_N;
Route_Layer_TOP = CMP_N;
/* Place the edge layer segments */
@ -538,7 +538,7 @@ void WinEDA_PcbFrame::GenModuleOnBoard( MODULE* Module )
masque_layer = 0;
if( Module->GetLayer() == CMP_N )
masque_layer = CMP_LAYER;
if( Module->GetLayer() == CUIVRE_N )
if( Module->GetLayer() == COPPER_LAYER_N )
masque_layer = CUIVRE_LAYER;
TraceFilledRectangle( m_Pcb, ox, oy, fx, fy, masque_layer,
@ -615,7 +615,7 @@ int WinEDA_PcbFrame::RecherchePlacementModule( MODULE* Module, wxDC* DC )
{
D_PAD* Pad; int masque_otherlayer;
masque_otherlayer = CUIVRE_LAYER;
if( Module->GetLayer() == CUIVRE_N )
if( Module->GetLayer() == COPPER_LAYER_N )
masque_otherlayer = CMP_LAYER;
for( Pad = Module->m_Pads; Pad != NULL; Pad = (D_PAD*) Pad->Pnext )
@ -823,7 +823,7 @@ int TstModuleOnBoard( BOARD* Pcb, MODULE* Module, bool TstOtherSide )
int error, Penalite, marge, side, otherside;
side = TOP; otherside = BOTTOM;
if( Module->GetLayer() == CUIVRE_N )
if( Module->GetLayer() == COPPER_LAYER_N )
{
side = BOTTOM; otherside = TOP;
}

View File

@ -27,9 +27,16 @@ D_PAD * Pad = NULL;
int autoroute_net_code = -1;
wxString msg;
Route_Layer_TOP = GetScreen()->m_Route_Layer_TOP;
Route_Layer_BOTTOM = GetScreen()->m_Route_Layer_BOTTOM;
if ( g_DesignSettings.m_CopperLayerCount > 1 )
{
Route_Layer_TOP = GetScreen()->m_Route_Layer_TOP;
Route_Layer_BOTTOM = GetScreen()->m_Route_Layer_BOTTOM;
}
else
{
Route_Layer_TOP =
Route_Layer_BOTTOM = COPPER_LAYER_N;
}
switch ( mode )
{

View File

@ -24,25 +24,23 @@
BEGIN_EVENT_TABLE( WinEDA_BasePcbFrame, WinEDA_DrawFrame )
COMMON_EVENTS_DRAWFRAME
EVT_MENU_RANGE( ID_POPUP_PCB_ITEM_SELECTION_START, ID_POPUP_PCB_ITEM_SELECTION_END,
WinEDA_BasePcbFrame::ProcessItemSelection )
END_EVENT_TABLE()
COMMON_EVENTS_DRAWFRAME EVT_MENU_RANGE( ID_POPUP_PCB_ITEM_SELECTION_START,
ID_POPUP_PCB_ITEM_SELECTION_END,
WinEDA_BasePcbFrame::ProcessItemSelection )
END_EVENT_TABLE()
/****************/
/* Constructeur */
/****************/
WinEDA_BasePcbFrame::WinEDA_BasePcbFrame( wxWindow* father,
WinEDA_App* parent,
int idtype,
WinEDA_BasePcbFrame::WinEDA_BasePcbFrame( wxWindow* father,
WinEDA_App* parent,
int idtype,
const wxString& title,
const wxPoint& pos,
const wxSize& size ) :
const wxPoint& pos,
const wxSize& size ) :
WinEDA_DrawFrame( father, idtype, parent, title, pos, size )
{
m_InternalUnits = 10000; // Internal unit = 1/10000 inch
@ -56,8 +54,8 @@ WinEDA_BasePcbFrame::WinEDA_BasePcbFrame( wxWindow* father,
m_DisplayModText = FILLED; // How to show module texts
m_DisplayPcbTrackFill = TRUE; /* FALSE = sketch , TRUE = filled */
m_Draw3DFrame = NULL; // Display Window in 3D mode (OpenGL)
m_Collector = new GENERAL_COLLECTOR();
m_Collector = new GENERAL_COLLECTOR();
}
@ -98,6 +96,7 @@ int WinEDA_BasePcbFrame::BestZoom( void )
/*************************************************/
void WinEDA_BasePcbFrame::ReCreateMenuBar( void )
/*************************************************/
// Virtual function
{
}
@ -154,18 +153,19 @@ void WinEDA_BasePcbFrame::GetComponentFromRedoList( void )
/****************************************************************/
void WinEDA_BasePcbFrame::SwitchLayer( wxDC* DC, int layer )
/*****************************************************************/
//Note: virtual, overridden in WinEDA_PcbFrame;
{
int preslayer = GetScreen()->m_Active_Layer;
//if there is only one layer, don't switch.
if( m_Pcb->m_BoardSettings->m_CopperLayerCount <= 1 )
layer = LAYER_CUIVRE_N; // Of course we select the copper layer
layer = COPPER_LAYER_N; // Of course we select the copper layer
//otherwise, we select the requested layer only if it is possible
if( layer != LAYER_CMP_N && layer >= m_Pcb->m_BoardSettings->m_CopperLayerCount - 1 )
return;
if( preslayer == layer )
return;
@ -176,23 +176,27 @@ void WinEDA_BasePcbFrame::SwitchLayer( wxDC* DC, int layer )
}
/**********************************************************************/
void WinEDA_BasePcbFrame::ProcessItemSelection( wxCommandEvent& event )
/**********************************************************************/
{
int id = event.GetId();
// index into the collector list:
int itemNdx = id - ID_POPUP_PCB_ITEM_SELECTION_START;
BOARD_ITEM* item = (*m_Collector)[itemNdx];
int id = event.GetId();
#if defined(DEBUG)
item->Show( 0, std::cout );
// index into the collector list:
int itemNdx = id - ID_POPUP_PCB_ITEM_SELECTION_START;
if( (id >= ID_POPUP_PCB_ITEM_SELECTION_START)
&& (id <= ID_POPUP_PCB_ITEM_SELECTION_END) )
{
BOARD_ITEM* item = (*m_Collector)[itemNdx];
DrawPanel->m_AbortRequest = false;
#if defined (DEBUG)
item->Show( 0, std::cout );
#endif
SetCurItem( item );
SetCurItem( item );
}
}
@ -202,12 +206,12 @@ void WinEDA_BasePcbFrame::SetCurItem( BOARD_ITEM* aItem )
{
m_CurrentScreen->SetCurItem( aItem );
if( aItem )
aItem->Display_Infos(this);
aItem->Display_Infos( this );
else
{
// we can use either of these:
//MsgPanel->EraseMsgBox();
m_Pcb->Display_Infos(this);
m_Pcb->Display_Infos( this );
}
}
@ -215,8 +219,8 @@ void WinEDA_BasePcbFrame::SetCurItem( BOARD_ITEM* aItem )
/*****************************************************************/
BOARD_ITEM* WinEDA_BasePcbFrame::GetCurItem()
/*****************************************************************/
{
return (BOARD_ITEM*) m_CurrentScreen->GetCurItem();
{
return (BOARD_ITEM*) m_CurrentScreen->GetCurItem();
}
@ -224,8 +228,8 @@ BOARD_ITEM* WinEDA_BasePcbFrame::GetCurItem()
GENERAL_COLLECTORS_GUIDE WinEDA_BasePcbFrame::GetCollectorsGuide()
/****************************************************************/
{
GENERAL_COLLECTORS_GUIDE guide( m_Pcb->m_BoardSettings->GetVisibleLayers(),
GetScreen()->m_Active_Layer );
GENERAL_COLLECTORS_GUIDE guide( m_Pcb->m_BoardSettings->GetVisibleLayers(),
GetScreen()->m_Active_Layer );
// account for the globals
guide.SetIgnoreMTextsMarkedNoShow( g_ModuleTextNOVColor & ITEM_NOT_SHOW );

View File

@ -940,7 +940,7 @@ void WinEDA_BasePcbFrame::Block_Invert( wxDC* DC )
/* Redessin du Texte */
INVERT( STRUCT->m_Pos.y );
INVERT_ANGLE( STRUCT->m_Orient );
if( (STRUCT->GetLayer() == CUIVRE_N) || (STRUCT->GetLayer() == CMP_N) )
if( (STRUCT->GetLayer() == COPPER_LAYER_N) || (STRUCT->GetLayer() == CMP_N) )
{
STRUCT->m_Miroir ^= 1; /* inverse miroir */
}

View File

@ -646,7 +646,7 @@ const char* BOARD::ShowLayer( int aLayer )
switch( aLayer )
{
case LAYER_CUIVRE_N: rs = "cu"; break;
case LAYER_COPPER_LAYER_N: rs = "cu"; break;
case LAYER_N_2: rs = "layer2"; break;
case LAYER_N_3: rs = "layer3"; break;
case LAYER_N_4: rs = "layer4"; break;

View File

@ -750,7 +750,7 @@ int MODULE::ReadDescr( FILE* File, int* LineNum )
else
DrawText->m_NoShow = 0;
if( layer == CUIVRE_N )
if( layer == COPPER_LAYER_N )
layer = SILKSCREEN_N_CU;
else if( layer == CMP_N )
layer = SILKSCREEN_N_CMP;

View File

@ -99,8 +99,8 @@ int TEXTE_PCB::ReadTextePcbDescr( FILE* File, int* LineNum )
{
sscanf( Line + 2, " %d %d %lX %d\n", &m_Layer, &m_Miroir,
&m_TimeStamp, &dummy );
if( m_Layer < LAYER_CUIVRE_N )
m_Layer = LAYER_CUIVRE_N;
if( m_Layer < COPPER_LAYER_N )
m_Layer = COPPER_LAYER_N;
if( m_Layer > LAST_NO_COPPER_LAYER )
m_Layer = LAST_NO_COPPER_LAYER;

View File

@ -49,7 +49,7 @@ TEXTE_MODULE::TEXTE_MODULE( MODULE* parent, int text_type ) :
int moduleLayer = Module->GetLayer();
if( moduleLayer == CUIVRE_N )
if( moduleLayer == COPPER_LAYER_N )
SetLayer( SILKSCREEN_N_CU );
else if( moduleLayer == CMP_N )
SetLayer( SILKSCREEN_N_CMP );
@ -58,7 +58,7 @@ TEXTE_MODULE::TEXTE_MODULE( MODULE* parent, int text_type ) :
if( moduleLayer == SILKSCREEN_N_CU
|| moduleLayer == ADHESIVE_N_CU
|| moduleLayer == CUIVRE_N )
|| moduleLayer == COPPER_LAYER_N )
{
m_Miroir = 0;
}
@ -257,7 +257,7 @@ void TEXTE_MODULE::Draw( WinEDA_DrawPanel* panel, wxDC* DC, wxPoint offset, int
color = g_DesignSettings.m_LayerColor[Module->GetLayer()];
if( Module && Module->GetLayer() == CUIVRE_N )
if( Module && Module->GetLayer() == COPPER_LAYER_N )
color = g_ModuleTextCUColor;
else if( Module && Module->GetLayer() == CMP_N )
@ -381,7 +381,7 @@ bool TEXTE_MODULE::IsOnLayer( int aLayer ) const
if( aLayer == GetParent()->GetLayer() )
return true;
if( aLayer == CUIVRE_N )
if( aLayer == COPPER_LAYER_N )
{
if( m_Layer==ADHESIVE_N_CU || m_Layer==SILKSCREEN_N_CU )
return true;

View File

@ -253,7 +253,7 @@ void SEGVIA::SetLayerPair( int top_layer, int bottom_layer )
if( via_type == VIA_NORMALE )
{
top_layer = LAYER_CMP_N;
bottom_layer = LAYER_CUIVRE_N;
bottom_layer = COPPER_LAYER_N;
}
if( bottom_layer > top_layer )
@ -263,9 +263,9 @@ void SEGVIA::SetLayerPair( int top_layer, int bottom_layer )
}
/***************************************************************/
/*********************************************************************/
void SEGVIA::ReturnLayerPair( int* top_layer, int* bottom_layer ) const
/***************************************************************/
/*********************************************************************/
/* Retourne les 2 couches limitant la via
* les pointeurs top_layer et bottom_layer peuvent etre NULLs

View File

@ -360,9 +360,9 @@ void PCB_SCREEN::Init()
/*************************/
{
InitDatas();
m_Active_Layer = CUIVRE_N; /* ref couche active 0.. 31 */
m_Active_Layer = COPPER_LAYER_N; /* ref couche active 0.. 31 */
m_Route_Layer_TOP = CMP_N; /* ref couches par defaut pour vias (Cu.. Cmp) */
m_Route_Layer_BOTTOM = CUIVRE_N;
m_Route_Layer_BOTTOM = COPPER_LAYER_N;
m_Zoom = 128; /* valeur */
m_Grid = wxSize( 500, 500 ); /* pas de la grille en 1/10000 "*/
}

View File

@ -82,7 +82,7 @@ void SEGVIA::SetLayerPair( int top_layer, int bottom_layer )
if( via_type == VIA_NORMALE )
{
top_layer = LAYER_CMP_N; bottom_layer = LAYER_CUIVRE_N;
top_layer = LAYER_CMP_N; bottom_layer = LAYER_COPPER_LAYER_N;
}
if( bottom_layer > top_layer )

Some files were not shown because too many files have changed in this diff Show More