Commit 1f842ae1 authored by CHARRAS's avatar CHARRAS
Browse files

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

parent 88ef06ef
Loading
Loading
Loading
Loading
+19 −19
Original line number Original line Diff line number Diff line
@@ -150,7 +150,7 @@ glEnable(GL_FOG);
	glVertex3f( sx, -sy , zpos);
	glVertex3f( sx, -sy , zpos);
	glEnd();
	glEnd();
	glBegin(GL_QUADS);
	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
	glNormal3f( 0.0, 0.0, -1.0);	// Normal is -Z axis
	glVertex3f( -sx, -sy , 0);
	glVertex3f( -sx, -sy , 0);
	glVertex3f( -sx, sy , 0);
	glVertex3f( -sx, sy , 0);
@@ -213,7 +213,7 @@ double w;
	zpos = g_Parm_3D_Visu.m_LayerZcoord[layer];
	zpos = g_Parm_3D_Visu.m_LayerZcoord[layer];


	SetGLColor(color);
	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;
	w = track->m_Width * g_Parm_3D_Visu.m_BoardScale;
	ox = track->m_Start.x * 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];
		else color = g_Parm_3D_Visu.m_BoardSettings->m_LayerColor[CMP_N];
		if ( color & ITEM_NOT_SHOW ) continue;
		if ( color & ITEM_NOT_SHOW ) continue;
		SetGLColor(color);
		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);
		Draw3D_FilledCircle(x, -y, r, hole, zpos);
		if ( layer >= top_layer) break;
		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++ )
		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];
			zpos = g_Parm_3D_Visu.m_LayerZcoord[layer];
			Draw3D_FilledSegment( x, -y, xf, -yf, w, zpos);
			Draw3D_FilledSegment( x, -y, xf, -yf, w, zpos);
		}
		}
@@ -312,7 +312,7 @@ D_PAD * pad = m_Pads;
	}
	}
	if( ! DisplayOpt.Show_Modules_Cu )
	if( ! DisplayOpt.Show_Modules_Cu )
	{
	{
		if(m_Layer == CUIVRE_N) return;
		if(m_Layer == COPPER_LAYER_N) return;
	}
	}
#endif
#endif


@@ -335,7 +335,7 @@ bool As3dShape = FALSE;
	{
	{
		glRotatef( (double)m_Orient / 10, 0.0, 0.0, 1.0 );
		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, 1.0, 0.0 );
		glRotatef( 180.0, 0.0, 0.0, 1.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;
	if ( color & ITEM_NOT_SHOW ) return;


	SetGLColor(color);
	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;
	scale = g_Parm_3D_Visu.m_BoardScale;


	ux0 = m_Start.x;
	ux0 = m_Start.x;
@@ -477,16 +477,16 @@ int color;
			x = xc * scale;
			x = xc * scale;
			y = yc * scale;
			y = yc * scale;
			r = (double)dx * 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 && (layer == nlmax) ) layer = CMP_N;
				if ( (layer == CMP_N) && ! Oncmp ) continue;
				if ( (layer == CMP_N) && ! Oncmp ) continue;
				if ( (layer == CUIVRE_N) && ! Oncu ) continue;
				if ( (layer == COPPER_LAYER_N) && ! Oncu ) continue;
				if ( (layer > CUIVRE_N) && (layer < CMP_N) && !Both) continue;
				if ( (layer > COPPER_LAYER_N) && (layer < CMP_N) && !Both) continue;
				color = g_Parm_3D_Visu.m_BoardSettings->m_LayerColor[layer];
				color = g_Parm_3D_Visu.m_BoardSettings->m_LayerColor[layer];
				if ( color & ITEM_NOT_SHOW ) continue;
				if ( color & ITEM_NOT_SHOW ) continue;
				SetGLColor(color);
				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];
				zpos = g_Parm_3D_Visu.m_LayerZcoord[layer];
				Draw3D_FilledCircle(x, -y, r, hole, zpos);
				Draw3D_FilledCircle(x, -y, r, hole, zpos);
			}
			}
@@ -513,14 +513,14 @@ int color;
			oy = (double)(uy0 + delta_cy) * scale;
			oy = (double)(uy0 + delta_cy) * scale;
			fx = (double)(ux0 - delta_cx) * scale;
			fx = (double)(ux0 - delta_cx) * scale;
			fy = (double)(uy0 - delta_cy) * 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 && (layer == nlmax) ) layer = CMP_N;
				if ( (layer == CMP_N) && ! Oncmp ) continue;
				if ( (layer == CMP_N) && ! Oncmp ) continue;
				if ( (layer == CUIVRE_N) && ! Oncu ) continue;
				if ( (layer == COPPER_LAYER_N) && ! Oncu ) continue;
				if ( (layer > CUIVRE_N) && (layer < CMP_N) && !Both) continue;
				if ( (layer > COPPER_LAYER_N) && (layer < CMP_N) && !Both) continue;
				color = g_Parm_3D_Visu.m_BoardSettings->m_LayerColor[layer];
				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;
				if ( color & ITEM_NOT_SHOW ) continue;
				SetGLColor(color);
				SetGLColor(color);
				zpos = g_Parm_3D_Visu.m_LayerZcoord[layer];
				zpos = g_Parm_3D_Visu.m_LayerZcoord[layer];
@@ -574,14 +574,14 @@ int color;
				f_hole_coord[ii][1] += drilly;
				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 && (layer == nlmax) ) layer = CMP_N;
				if ( (layer == CMP_N) && ! Oncmp ) continue;
				if ( (layer == CMP_N) && ! Oncmp ) continue;
				if ( (layer == CUIVRE_N) && ! Oncu ) continue;
				if ( (layer == COPPER_LAYER_N) && ! Oncu ) continue;
				if ( (layer > CUIVRE_N) && (layer < CMP_N) && !Both) continue;
				if ( (layer > COPPER_LAYER_N) && (layer < CMP_N) && !Both) continue;
				color = g_Parm_3D_Visu.m_BoardSettings->m_LayerColor[layer];
				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;
				if ( color & ITEM_NOT_SHOW ) continue;
				SetGLColor(color);
				SetGLColor(color);
				zpos = g_Parm_3D_Visu.m_LayerZcoord[layer];
				zpos = g_Parm_3D_Visu.m_LayerZcoord[layer];
+15 −0
Original line number Original line Diff line number Diff line
@@ -4,6 +4,21 @@ Started 2007-June-11
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.


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>
2007-Oct-07 UPDATE   Geoff Harland <gharlandau@yahoo.com.au>
================================================================================
================================================================================
+ all
+ all
+1 −1
Original line number Original line Diff line number Diff line
@@ -192,7 +192,7 @@ public:
	void RecreateMenuBar();
	void RecreateMenuBar();
	void OnLeftClick(wxDC * DC, const wxPoint& MousePos);
	void OnLeftClick(wxDC * DC, const wxPoint& MousePos);
	void OnLeftDClick(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 SetToolbars();
	void InstallOptionsDisplay(wxCommandEvent& event);
	void InstallOptionsDisplay(wxCommandEvent& event);
	MODULE * Get_Module(const wxString & CmpName);
	MODULE * Get_Module(const wxString & CmpName);
+8 −1
Original line number Original line Diff line number Diff line
@@ -144,18 +144,25 @@ void WinEDA_DisplayFrame::SetToolbars()
}
}




/*************************************************************************/
void WinEDA_DisplayFrame::OnLeftClick( wxDC* DC, const wxPoint& MousePos )
void WinEDA_DisplayFrame::OnLeftClick( wxDC* DC, const wxPoint& MousePos )
/*************************************************************************/
{
{
}
}




/*************************************************************************/
void WinEDA_DisplayFrame::OnLeftDClick( 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;
}
}




+3 −91
Original line number Original line Diff line number Diff line
@@ -17,79 +17,6 @@


#include "protos.h"
#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::
EDA_BaseStruct* WinEDA_SchematicFrame::
SchematicGeneralLocateAndDisplay( bool IncludePin )
SchematicGeneralLocateAndDisplay( bool IncludePin )
@@ -114,7 +41,6 @@ SchematicGeneralLocateAndDisplay( bool IncludePin )
    wxPoint                 mouse_position = GetScreen()->m_MousePosition;
    wxPoint                 mouse_position = GetScreen()->m_MousePosition;
    LibDrawPin*             Pin     = NULL;
    LibDrawPin*             Pin     = NULL;
    EDA_SchComponentStruct* LibItem = NULL;
    EDA_SchComponentStruct* LibItem = NULL;
    char Line[1024];


    DrawStruct = SchematicGeneralLocateAndDisplay( mouse_position, IncludePin );
    DrawStruct = SchematicGeneralLocateAndDisplay( mouse_position, IncludePin );
    if( !DrawStruct && ( mouse_position != GetScreen()->m_Curseur) )
    if( !DrawStruct && ( mouse_position != GetScreen()->m_Curseur) )
@@ -128,21 +54,14 @@ SchematicGeneralLocateAndDisplay( bool IncludePin )
    switch( DrawStruct->Type() )
    switch( DrawStruct->Type() )
    {
    {
    case COMPONENT_FIELD_DRAW_TYPE:
    case COMPONENT_FIELD_DRAW_TYPE:
    {
		SendMessageToPCBNEW( DrawStruct );
        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 );
    }
        break;
        break;


    case DRAW_LIB_ITEM_STRUCT_TYPE:
    case DRAW_LIB_ITEM_STRUCT_TYPE:
        Pin = LocateAnyPin( m_CurrentScreen->EEDrawList, GetScreen()->m_Curseur, &LibItem );
        Pin = LocateAnyPin( m_CurrentScreen->EEDrawList, GetScreen()->m_Curseur, &LibItem );
        if( Pin )
        if( Pin )
            break; // Priority is probing a pin first
            break; // Priority is probing a pin first
        LibItem = (EDA_SchComponentStruct*) DrawStruct;
		SendMessageToPCBNEW( DrawStruct );
        sprintf( Line, "$PART: %s", CONV_TO_UTF8( LibItem->m_Field[REFERENCE].m_Text ) );
        SendCommand( MSG_TO_PCB, Line );
        break;
        break;


    default:
    default:
@@ -165,14 +84,7 @@ SchematicGeneralLocateAndDisplay( bool IncludePin )
                                 CYAN );
                                 CYAN );


        // Cross probing:2 - pin found, and send a locate pin command to pcbnew (hightlight net)
        // Cross probing:2 - pin found, and send a locate pin command to pcbnew (hightlight net)
        if( Pin->m_PinNum )
		SendMessageToPCBNEW( Pin );
        {
            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 );
        }
    }
    }
    return DrawStruct;
    return DrawStruct;
}
}
Loading