see my 2007-Sep-20 change_log.txt

This commit is contained in:
dickelbeck 2007-09-20 21:06:49 +00:00
parent 33939aebd9
commit 664a1f727b
20 changed files with 5187 additions and 4471 deletions

View File

@ -4,12 +4,20 @@ Started 2007-June-11
Please add newer entries at the top, list the date and your name with
email address.
2007-Sep-20 UPDATE Dick Hollenbeck <dick@softplc.com>
================================================================================
+ eeschema
* beautify, add debug Show() functions, changed ReturnFieldName()
to return "const wxString&" for speed, added GetFieldValue().
* tracking down questionable behavior (a bug?) in erc regarding pwr_flag, still looking
2007-sept-20 UPDATE Jean-Pierre Charras <jean-pierre.charras@inpg.fr>
================================================================================
+ all
* hotkeys handling finished
* hotkeys handling finished
+ pcbnew
* bug fix: a subtle bug in place via : partial drc only was made.
* bug fix: a subtle bug in place via : partial drc only was made.
2007-Sep-14 UPDATE Dick Hollenbeck <dick@softplc.com>
@ -42,11 +50,11 @@ email address.
2007-sept-13 UPDATE Jean-Pierre Charras <jean-pierre.charras@inpg.fr>
================================================================================
+ all
* EDA_BaseStruct.SetType() removed.
The m_StructType member of class EDA_BaseStruct is no more modified in kicad.
Now Virtual functions can be widely used.
* The old EDA_BaseStruct.ReturnClassName() was removed.
the virtual EDA_BaseStruct.GetClass() is used instead.
* EDA_BaseStruct.SetType() removed.
The m_StructType member of class EDA_BaseStruct is no more modified in kicad.
Now Virtual functions can be widely used.
* The old EDA_BaseStruct.ReturnClassName() was removed.
the virtual EDA_BaseStruct.GetClass() is used instead.
+ gerbview: hotkeys Ok.
@ -106,9 +114,9 @@ email address.
================================================================================
+ eeschema & pcbnew
Programmable hotkeys update.
some features are still subject to change (mainly path for config files: see 2007-aug-30 UPDATE))
The preference menu has a command to create and reread config hotkey files.
the hotkey ? lists the current hotkeys.
some features are still subject to change (mainly path for config files: see 2007-aug-30 UPDATE))
The preference menu has a command to create and reread config hotkey files.
the hotkey ? lists the current hotkeys.
2007-Sep-4 UPDATE Dick Hollenbeck <dick@softplc.com>
@ -125,7 +133,7 @@ email address.
2007-sept-04 UPDATE Jean-Pierre Charras <jean-pierre.charras@inpg.fr>
================================================================================
+ pcbnew
better comments in editrack-part2 (the todo remark solved)
better comments in editrack-part2 (the todo remark solved)
+ todo.txt: note about editrack-part2 modified (problem solved)

View File

@ -555,3 +555,29 @@ EDA_BaseStruct* BASE_SCREEN::GetItemFromRedoList()
return item;
}
#if defined(DEBUG)
/**
* Function Show
* is used to output the object tree, currently for debugging only.
* @param nestLevel An aid to prettier tree indenting, and is the level
* of nesting of this object within the overall tree.
* @param os The ostream& to output to.
*/
void BASE_SCREEN::Show( int nestLevel, std::ostream& os )
{
EDA_BaseStruct* item = EEDrawList;
// for now, make it look like XML, expand on this later.
NestedSpace( nestLevel, os ) << '<' << GetClass().Lower().mb_str() <<
">\n";
for( ; item; item = item->Next() )
{
item->Show( nestLevel+1, os );
}
NestedSpace( nestLevel, os ) << "</" << GetClass().Lower().mb_str() << ">\n";
}
#endif

View File

@ -188,11 +188,14 @@ void EDA_BaseStruct::Show( int nestLevel, std::ostream& os )
// for now, make it look like XML:
NestedSpace( nestLevel, os ) << '<' << GetClass().Lower().mb_str() << ">\n";
/*
EDA_BaseStruct* kid = m_Son;
for( ; kid; kid = kid->Pnext )
{
kid->Show( nestLevel+1, os );
}
*/
NestedSpace( nestLevel+1, os ) << "Need ::Show() override, shown class is using EDA_BaseStruct::Show()\n";
NestedSpace( nestLevel, os ) << "</" << GetClass().Lower().mb_str() << ">\n";
}

File diff suppressed because it is too large Load Diff

View File

@ -90,12 +90,12 @@ class SCH_SCREEN : public BASE_SCREEN
public:
SCH_SCREEN( int idtype, KICAD_T aType = SCREEN_STRUCT_TYPE );
~SCH_SCREEN();
virtual wxString GetClass() const
{
return wxT("SCH_SCREEN");
}
void FreeDrawList(); // Free EESchema drawing list (does not delete the sub hierarchies)
void Place( WinEDA_DrawFrame* frame, wxDC* DC ) { };

View File

@ -1,6 +1,6 @@
/*********************************/
/* Module de nettoyage du schema */
/*********************************/
/*********************************/
/* Module de nettoyage du schema */
/*********************************/
#include "fctsys.h"
#include "gr_basic.h"
@ -15,243 +15,254 @@
/* Routines locales */
static int TstAlignSegment(EDA_DrawLineStruct* RefSegm, EDA_DrawLineStruct* TstSegm);
static int TstAlignSegment( EDA_DrawLineStruct* RefSegm, EDA_DrawLineStruct* TstSegm );
/* Variable locales */
/*******************************************/
bool SCH_SCREEN::SchematicCleanUp(wxDC * DC)
bool SCH_SCREEN::SchematicCleanUp( wxDC* DC )
/*******************************************/
/* Routine de nettoyage:
- regroupe les segments de fils (ou de bus) alignes en 1 seul segment
- Detecte les objets identiques superposes
*/
{
EDA_BaseStruct *DrawList, * TstDrawList;
int flag;
bool Modify = FALSE;
DrawList = EEDrawList;
for ( ;DrawList != NULL; DrawList = DrawList->Pnext )
{
if( DrawList->Type() == DRAW_SEGMENT_STRUCT_TYPE )
{
TstDrawList = DrawList->Pnext;
while ( TstDrawList )
{
if( TstDrawList->Type() == DRAW_SEGMENT_STRUCT_TYPE )
{
flag = TstAlignSegment( (EDA_DrawLineStruct*)DrawList,
(EDA_DrawLineStruct*)TstDrawList);
if (flag ) /* Suppression de TstSegm */
{
/* keep the bits set in .m_Flags, because the deleted segment can be flagged */
DrawList->m_Flags |= TstDrawList->m_Flags;
EraseStruct(TstDrawList, this);
SetRefreshReq();
TstDrawList = EEDrawList;
Modify = TRUE;
}
else TstDrawList = TstDrawList->Pnext;
}
else TstDrawList = TstDrawList->Pnext;
}
}
}
EDA_Appl->SchematicFrame->TestDanglingEnds(EEDrawList, DC);
return Modify;
/* Routine de nettoyage:
* - regroupe les segments de fils (ou de bus) alignes en 1 seul segment
* - Detecte les objets identiques superposes
*/
{
EDA_BaseStruct* DrawList, * TstDrawList;
int flag;
bool Modify = FALSE;
DrawList = EEDrawList;
for( ; DrawList != NULL; DrawList = DrawList->Pnext )
{
if( DrawList->Type() == DRAW_SEGMENT_STRUCT_TYPE )
{
TstDrawList = DrawList->Pnext;
while( TstDrawList )
{
if( TstDrawList->Type() == DRAW_SEGMENT_STRUCT_TYPE )
{
flag = TstAlignSegment( (EDA_DrawLineStruct*) DrawList,
(EDA_DrawLineStruct*) TstDrawList );
if( flag ) /* Suppression de TstSegm */
{
/* keep the bits set in .m_Flags, because the deleted segment can be flagged */
DrawList->m_Flags |= TstDrawList->m_Flags;
EraseStruct( TstDrawList, this );
SetRefreshReq();
TstDrawList = EEDrawList;
Modify = TRUE;
}
else
TstDrawList = TstDrawList->Pnext;
}
else
TstDrawList = TstDrawList->Pnext;
}
}
}
EDA_Appl->SchematicFrame->TestDanglingEnds( EEDrawList, DC );
return Modify;
}
/***********************************************/
void BreakSegmentOnJunction( SCH_SCREEN * Screen )
void BreakSegmentOnJunction( SCH_SCREEN* Screen )
/************************************************/
/* Routine creant des debuts / fin de segment (BUS ou WIRES) sur les jonctions
et les raccords
*/
* et les raccords
*/
{
EDA_BaseStruct *DrawList;
EDA_BaseStruct* DrawList;
if( Screen == NULL )
{
DisplayError(NULL, wxT("BreakSegmentOnJunction() error: NULL screen"));
return;
}
if( Screen == NULL )
{
DisplayError( NULL, wxT( "BreakSegmentOnJunction() error: NULL screen" ) );
return;
}
DrawList = Screen->EEDrawList;
while ( DrawList )
{
switch( DrawList->Type() )
{
case DRAW_JUNCTION_STRUCT_TYPE :
#undef STRUCT
#define STRUCT ((DrawJunctionStruct*)DrawList)
BreakSegment(Screen, STRUCT->m_Pos);
break;
DrawList = Screen->EEDrawList;
while( DrawList )
{
switch( DrawList->Type() )
{
case DRAW_JUNCTION_STRUCT_TYPE:
#undef STRUCT
#define STRUCT ( (DrawJunctionStruct*) DrawList )
BreakSegment( Screen, STRUCT->m_Pos );
break;
case DRAW_BUSENTRY_STRUCT_TYPE :
#undef STRUCT
#define STRUCT ((DrawBusEntryStruct*)DrawList)
BreakSegment(Screen, STRUCT->m_Pos);
BreakSegment(Screen, STRUCT->m_End());
break;
case DRAW_BUSENTRY_STRUCT_TYPE:
#undef STRUCT
#define STRUCT ( (DrawBusEntryStruct*) DrawList )
BreakSegment( Screen, STRUCT->m_Pos );
BreakSegment( Screen, STRUCT->m_End() );
break;
case DRAW_SEGMENT_STRUCT_TYPE :
case DRAW_NOCONNECT_STRUCT_TYPE :
case DRAW_LABEL_STRUCT_TYPE :
case DRAW_GLOBAL_LABEL_STRUCT_TYPE :
case DRAW_LIB_ITEM_STRUCT_TYPE :
case DRAW_PICK_ITEM_STRUCT_TYPE :
case DRAW_POLYLINE_STRUCT_TYPE :
case DRAW_MARKER_STRUCT_TYPE :
case DRAW_TEXT_STRUCT_TYPE :
case DRAW_SHEET_STRUCT_TYPE :
case DRAW_SHEETLABEL_STRUCT_TYPE :
break;
case DRAW_SEGMENT_STRUCT_TYPE:
case DRAW_NOCONNECT_STRUCT_TYPE:
case DRAW_LABEL_STRUCT_TYPE:
case DRAW_GLOBAL_LABEL_STRUCT_TYPE:
case DRAW_LIB_ITEM_STRUCT_TYPE:
case DRAW_PICK_ITEM_STRUCT_TYPE:
case DRAW_POLYLINE_STRUCT_TYPE:
case DRAW_MARKER_STRUCT_TYPE:
case DRAW_TEXT_STRUCT_TYPE:
case DRAW_SHEET_STRUCT_TYPE:
case DRAW_SHEETLABEL_STRUCT_TYPE:
break;
default :
break;
}
DrawList = DrawList->Pnext;
}
default:
break;
}
DrawList = DrawList->Pnext;
}
}
/*********************************************************/
DrawPickedStruct * BreakSegment(SCH_SCREEN * screen,
wxPoint breakpoint, bool PutInUndoList)
DrawPickedStruct* BreakSegment( SCH_SCREEN* screen,
wxPoint breakpoint, bool PutInUndoList )
/*********************************************************/
/* Coupe un segment ( BUS, WIRE ) en 2 au point breakpoint,
- si ce point est sur le segment
- extremites non comprises
If PutInUndoList == TRUE, create a list of modifictions, for undo command
*/
* - si ce point est sur le segment
* - extremites non comprises
* If PutInUndoList == TRUE, create a list of modifictions, for undo command
*/
{
EDA_BaseStruct *DrawList;
EDA_DrawLineStruct * segment, * NewSegment;
int ox, oy, fx, fy;
DrawPickedStruct * List = NULL;
EDA_BaseStruct* DrawList;
EDA_DrawLineStruct* segment, * NewSegment;
int ox, oy, fx, fy;
DrawPickedStruct* List = NULL;
DrawList = screen->EEDrawList;
while ( DrawList )
{
switch( DrawList->Type() )
{
case DRAW_SEGMENT_STRUCT_TYPE :
segment = (EDA_DrawLineStruct*)DrawList;
ox = segment->m_Start.x; oy = segment->m_Start.y;
fx = segment->m_End.x; fy = segment->m_End.y;
if( distance( fx - ox, fy - oy, breakpoint.x - ox, breakpoint.y - oy, 0 ) == 0 )
break;
/* Segment connecte: doit etre coupe en 2 si px,py n'est
pas une extremite */
if( (ox == breakpoint.x) && (oy == breakpoint.y ) ) break;
if( (fx == breakpoint.x) && (fy == breakpoint.y ) ) break;
/* Ici il faut couper le segment en 2 */
if ( PutInUndoList ) // First: put copy of the old segment in undo list
{
DrawPickedStruct * wrapper = new DrawPickedStruct();
wrapper->m_Flags = IS_CHANGED;
wrapper->m_PickedStruct = segment->GenCopy();
wrapper->m_Image = segment;
wrapper->m_PickedStruct->m_Image = segment;
wrapper->Pnext = List;
List = wrapper;
}
NewSegment = segment->GenCopy();
NewSegment->m_Start = breakpoint;
segment->m_End = NewSegment->m_Start;
NewSegment->Pnext = segment->Pnext;
segment->Pnext = NewSegment;
DrawList = NewSegment;
if ( PutInUndoList )
{
DrawPickedStruct * wrapper = new DrawPickedStruct();
wrapper->m_Flags = IS_NEW;
wrapper->m_Image = NewSegment;
wrapper->Pnext = List;
List = wrapper;
}
break;
DrawList = screen->EEDrawList;
while( DrawList )
{
switch( DrawList->Type() )
{
case DRAW_SEGMENT_STRUCT_TYPE:
segment = (EDA_DrawLineStruct*) DrawList;
ox = segment->m_Start.x; oy = segment->m_Start.y;
fx = segment->m_End.x; fy = segment->m_End.y;
if( distance( fx - ox, fy - oy, breakpoint.x - ox, breakpoint.y - oy, 0 ) == 0 )
break;
case DRAW_JUNCTION_STRUCT_TYPE :
case DRAW_BUSENTRY_STRUCT_TYPE :
case DRAW_POLYLINE_STRUCT_TYPE :
break;
/* Segment connecte: doit etre coupe en 2 si px,py n'est
* pas une extremite */
if( (ox == breakpoint.x) && (oy == breakpoint.y ) )
break;
if( (fx == breakpoint.x) && (fy == breakpoint.y ) )
break;
/* Ici il faut couper le segment en 2 */
if( PutInUndoList ) // First: put copy of the old segment in undo list
{
DrawPickedStruct* wrapper = new DrawPickedStruct();
default :
break;
}
DrawList = DrawList->Pnext;
}
wrapper->m_Flags = IS_CHANGED;
wrapper->m_PickedStruct = segment->GenCopy();
wrapper->m_Image = segment;
wrapper->m_PickedStruct->m_Image = segment;
wrapper->Pnext = List;
List = wrapper;
}
NewSegment = segment->GenCopy();
NewSegment->m_Start = breakpoint;
segment->m_End = NewSegment->m_Start;
NewSegment->Pnext = segment->Pnext;
segment->Pnext = NewSegment;
DrawList = NewSegment;
if( PutInUndoList )
{
DrawPickedStruct* wrapper = new DrawPickedStruct();
return List;
wrapper->m_Flags = IS_NEW;
wrapper->m_Image = NewSegment;
wrapper->Pnext = List;
List = wrapper;
}
break;
case DRAW_JUNCTION_STRUCT_TYPE:
case DRAW_BUSENTRY_STRUCT_TYPE:
case DRAW_POLYLINE_STRUCT_TYPE:
break;
default:
break;
}
DrawList = DrawList->Pnext;
}
return List;
}
/***********************************************************/
static int TstAlignSegment( EDA_DrawLineStruct* RefSegm,
EDA_DrawLineStruct* TstSegm)
EDA_DrawLineStruct* TstSegm )
/***********************************************************/
/* Search if the 2 segments RefSegm and TstSegm are on a line.
Retourn 0 if no
1 if yes, and RefSegm is modified to be the equivalent segment
*/
* Retourn 0 if no
* 1 if yes, and RefSegm is modified to be the equivalent segment
*/
{
if( RefSegm == TstSegm ) return(0);
if( RefSegm->m_Layer != TstSegm->m_Layer ) return(0);
if( RefSegm == TstSegm )
return 0;
if( RefSegm->m_Layer != TstSegm->m_Layer )
return 0;
// search for a common end, and modify coordinates to ensure RefSegm->m_End == TstSegm->m_Start
if ( RefSegm->m_Start == TstSegm->m_Start )
{
if ( RefSegm->m_End == TstSegm->m_End ) // trivial case: RefSegm and TstSegm are identical
return 1;
EXCHG(RefSegm->m_Start, RefSegm->m_End); // at this point, RefSegm->m_End == TstSegm->m_Start
}
else if ( RefSegm->m_Start == TstSegm->m_End )
{
EXCHG(RefSegm->m_Start, RefSegm->m_End);
EXCHG(TstSegm->m_Start, TstSegm->m_End); // at this point, RefSegm->m_End == TstSegm->m_Start
}
else if ( RefSegm->m_End == TstSegm->m_End )
{
EXCHG(TstSegm->m_Start, TstSegm->m_End); // at this point, RefSegm->m_End == TstSegm->m_Start
}
else if ( RefSegm->m_End != TstSegm->m_Start ) // No common end point, segments cannot be merged
return 0;
// search for a common end, and modify coordinates to ensure RefSegm->m_End == TstSegm->m_Start
if( RefSegm->m_Start == TstSegm->m_Start )
{
if( RefSegm->m_End == TstSegm->m_End ) // trivial case: RefSegm and TstSegm are identical
return 1;
EXCHG( RefSegm->m_Start, RefSegm->m_End ); // at this point, RefSegm->m_End == TstSegm->m_Start
}
else if( RefSegm->m_Start == TstSegm->m_End )
{
EXCHG( RefSegm->m_Start, RefSegm->m_End );
EXCHG( TstSegm->m_Start, TstSegm->m_End ); // at this point, RefSegm->m_End == TstSegm->m_Start
}
else if( RefSegm->m_End == TstSegm->m_End )
{
EXCHG( TstSegm->m_Start, TstSegm->m_End ); // at this point, RefSegm->m_End == TstSegm->m_Start
}
else if( RefSegm->m_End != TstSegm->m_Start ) // No common end point, segments cannot be merged
return 0;
/* Test alignment: */
if ( RefSegm->m_Start.y == RefSegm->m_End.y ) // Horizontal segment
{
if ( TstSegm->m_Start.y == TstSegm->m_End.y )
{
RefSegm->m_End = TstSegm->m_End;
return 1;
}
}
/* Test alignment: */
if( RefSegm->m_Start.y == RefSegm->m_End.y ) // Horizontal segment
{
if( TstSegm->m_Start.y == TstSegm->m_End.y )
{
RefSegm->m_End = TstSegm->m_End;
return 1;
}
}
else if( RefSegm->m_Start.x == RefSegm->m_End.x ) // Vertical segment
{
if( TstSegm->m_Start.x == TstSegm->m_End.x )
{
RefSegm->m_End = TstSegm->m_End;
return 1;
}
}
else
{
if( atan2( RefSegm->m_Start.x - RefSegm->m_End.x, RefSegm->m_Start.y -
RefSegm->m_End.y ) ==
atan2( TstSegm->m_Start.x - TstSegm->m_End.x, TstSegm->m_Start.y - TstSegm->m_End.y ) )
{
RefSegm->m_End = TstSegm->m_End;
return 1;
}
}
else if ( RefSegm->m_Start.x == RefSegm->m_End.x ) // Vertical segment
{
if ( TstSegm->m_Start.x == TstSegm->m_End.x )
{
RefSegm->m_End = TstSegm->m_End;
return 1;
}
}
else
{
if (atan2(RefSegm->m_Start.x - RefSegm->m_End.x, RefSegm->m_Start.y - RefSegm->m_End.y) ==
atan2(TstSegm->m_Start.x - TstSegm->m_End.x, TstSegm->m_Start.y - TstSegm->m_End.y) )
{
RefSegm->m_End = TstSegm->m_End;
return 1;
}
}
return(0);
return 0;
}

View File

@ -143,6 +143,23 @@ wxString DrawMarkerStruct::GetComment()
}
#if defined(DEBUG)
/**
* Function Show
* is used to output the object tree, currently for debugging only.
* @param nestLevel An aid to prettier tree indenting, and is the level
* of nesting of this object within the overall tree.
* @param os The ostream& to output to.
*/
void DrawMarkerStruct::Show( int nestLevel, std::ostream& os )
{
// for now, make it look like XML:
NestedSpace( nestLevel, os ) << '<' << GetClass().Lower().mb_str() << m_Pos
<< "/>\n";
}
#endif
/***************************/
/* Class EDA_DrawLineStruct */
/***************************/
@ -201,6 +218,28 @@ bool EDA_DrawLineStruct::IsOneEndPointAt( const wxPoint& pos )
}
#if defined(DEBUG)
/**
* Function Show
* is used to output the object tree, currently for debugging only.
* @param nestLevel An aid to prettier tree indenting, and is the level
* of nesting of this object within the overall tree.
* @param os The ostream& to output to.
*/
void EDA_DrawLineStruct::Show( int nestLevel, std::ostream& os )
{
NestedSpace( nestLevel, os ) << '<' << GetClass().Lower().mb_str() <<
" layer=\"" << m_Layer << '"' <<
" width=\"" << m_Width << '"' <<
" startIsDangling=\"" << m_StartIsDangling << '"' <<
" endIsDangling=\"" << m_EndIsDangling << '"' << ">" <<
" <start" << m_Start << "/>" <<
" <end" << m_End << "/>" <<
"</" << GetClass().Lower().mb_str() << ">\n";
}
#endif
/****************************/
/* Class DrawPolylineStruct */
/****************************/

File diff suppressed because it is too large Load Diff

View File

@ -15,7 +15,7 @@
/* Definition de la representation du composant */
#define NUMBER_OF_FIELDS 12 /* Nombre de champs de texte affectes au composant */
typedef enum {
enum NumFieldType {
REFERENCE = 0, /* Champ Reference of part, i.e. "IC21" */
VALUE, /* Champ Value of part, i.e. "3.3K" */
FOOTPRINT, /* Champ Name Module PCB, i.e. "16DIP300" */
@ -28,7 +28,7 @@ typedef enum {
FIELD6,
FIELD7,
FIELD8
} NumFieldType;
};
/* Class to manage component fields.
@ -46,9 +46,10 @@ public:
public:
PartTextStruct( const wxPoint& pos = wxPoint( 0, 0 ), const wxString& text = wxEmptyString );
~PartTextStruct();
virtual wxString GetClass() const
{
return wxT( "PartTextStruct" );
return wxT( "PartText" );
}
@ -77,10 +78,18 @@ public:
public:
DrawPartStruct( KICAD_T struct_type, const wxPoint &pos );
~DrawPartStruct();
virtual wxString GetClass() const
{
return wxT( "DrawPartStruct" );
return wxT( "DrawPart" );
}
/**
* Function GetReference
* returns a reference to the Reference
*/
const wxString& GetReference() { return m_Field[REFERENCE].m_Text; }
};
@ -101,18 +110,29 @@ public:
virtual wxString GetClass() const
{
return wxT( "EDA_SchComponentStruct" );
return wxT( "EDA_SchComponent" );
}
EDA_SchComponentStruct* GenCopy( void );
EDA_SchComponentStruct* GenCopy();
void SetRotationMiroir( int type );
int GetRotationMiroir();
wxPoint GetScreenCoord( const wxPoint& coord );
void Display_Infos( WinEDA_DrawFrame* frame );
void ClearAnnotation();
EDA_Rect GetBoundaryBox();
wxString ReturnFieldName( int FieldNumber );
const wxString& ReturnFieldName( int aFieldNdx ) const;
/**
* Function GetFieldValue
* returns a reference to the field value.
* @param aFieldNdx An index into the array of fields, 0 - FIELD8
* @return const wxString& - the field value or wxEmptyString
*/
const wxString& GetFieldValue( int aFieldNdx ) const;
virtual void Draw( WinEDA_DrawPanel* panel,
wxDC* DC,
@ -122,6 +142,17 @@ public:
void SwapData( EDA_SchComponentStruct* copyitem );
virtual void Place( WinEDA_DrawFrame* frame, wxDC* DC );
#if defined(DEBUG)
/**
* Function Show
* is used to output the object tree, currently for debugging only.
* @param nestLevel An aid to prettier tree indenting, and is the level
* of nesting of this object within the overall tree.
* @param os The ostream& to output to.
*/
void Show( int nestLevel, std::ostream& os );
#endif
};

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@ -272,8 +272,7 @@ bool WinEDA_SchematicFrame::LoadOneEEFile( SCH_SCREEN* screen, const wxString& F
if( !Failed )
{
PolylineStruct->Pnext = screen->EEDrawList;
screen->EEDrawList = (EDA_BaseStruct*)
PolylineStruct;
screen->EEDrawList = (EDA_BaseStruct*) PolylineStruct;
}
break;
@ -441,6 +440,10 @@ bool WinEDA_SchematicFrame::LoadOneEEFile( SCH_SCREEN* screen, const wxString& F
screen->EEDrawList = Phead;
#if defined(DEBUG)
screen->Show( 0, std::cout );
#endif
fclose( f );
TestDanglingEnds( screen->EEDrawList, NULL );

File diff suppressed because it is too large Load Diff

View File

@ -1,6 +1,6 @@
/**********************************************/
/* Module de calcul de la Netliste: netlist.h */
/**********************************************/
/**********************************************/
/* Module de calcul de la Netliste: netlist.h */
/**********************************************/
#ifndef _NETLIST_H_
#define _NETLIST_H_
@ -15,98 +15,99 @@
/* Indicateurs de type de netliste generee */
typedef enum
{
NET_TYPE_NOT_INIT = 0,
NET_TYPE_PCBNEW,
NET_TYPE_ORCADPCB2,
NET_TYPE_CADSTAR,
NET_TYPE_SPICE,
NET_TYPE_CUSTOM1,
NET_TYPE_CUSTOM2,
NET_TYPE_CUSTOM3,
NET_TYPE_CUSTOM4,
NET_TYPE_CUSTOM5,
NET_TYPE_CUSTOM6,
NET_TYPE_CUSTOM7,
NET_TYPE_CUSTOM8,
NET_TYPE_MAX
} TypeNetForm ;
typedef enum {
NET_TYPE_NOT_INIT = 0,
NET_TYPE_PCBNEW,
NET_TYPE_ORCADPCB2,
NET_TYPE_CADSTAR,
NET_TYPE_SPICE,
NET_TYPE_CUSTOM1,
NET_TYPE_CUSTOM2,
NET_TYPE_CUSTOM3,
NET_TYPE_CUSTOM4,
NET_TYPE_CUSTOM5,
NET_TYPE_CUSTOM6,
NET_TYPE_CUSTOM7,
NET_TYPE_CUSTOM8,
NET_TYPE_MAX
} TypeNetForm;
/* Max pin number per component and footprint */
#define MAXPIN 5000
typedef enum { /* Type des objets de Net */
NET_SEGMENT,
NET_BUS,
NET_JONCTION,
NET_LABEL,
NET_GLOBLABEL,
NET_BUSLABELMEMBER,
NET_GLOBBUSLABELMEMBER,
NET_SHEETBUSLABELMEMBER,
NET_SHEETLABEL,
NET_PINLABEL,
NET_PIN,
NET_NOCONNECT
typedef enum { /* Type des objets de Net */
NET_SEGMENT,
NET_BUS,
NET_JONCTION,
NET_LABEL,
NET_GLOBLABEL,
NET_BUSLABELMEMBER,
NET_GLOBBUSLABELMEMBER,
NET_SHEETBUSLABELMEMBER,
NET_SHEETLABEL,
NET_PINLABEL,
NET_PIN,
NET_NOCONNECT
} NetObjetType;
typedef enum { /* Valeur du Flag de connection */
UNCONNECT, /* Pin ou Label non connecte */
NOCONNECT, /* Pin volontairement non connectee (Symb. NoConnect utilise) */
CONNECT /* connexion normale */
typedef enum { /* Valeur du Flag de connection */
UNCONNECT, /* Pin ou Label non connecte */
NOCONNECT, /* Pin volontairement non connectee (Symb. NoConnect utilise) */
CONNECT /* connexion normale */
} IsConnectType;
/* Structure decrivant 1 element de connexion (pour netlist ) */
class ObjetNetListStruct
{
public:
void * m_Comp; /* Pointeur sur la definition de l'objet */
void * m_Link; /* Pour SheetLabelStruct: Pointeur sur la feuille de hierarchie
Pour les Pins: pointeur sur le composant */
int m_Flag; /* flag pour calculs internes */
SCH_SCREEN * m_Screen; /* Ecran d'appartenance */
NetObjetType m_Type;
int m_ElectricalType; /* Pour Pins et sheet labels: type electrique */
int m_NetCode; /* pour elements simples */
int m_BusNetCode; /* pour connexions type bus */
int m_Member; /* pour les labels type BUSWIRE ( labels de bus eclate )
numero de membre */
IsConnectType m_FlagOfConnection;
int m_SheetNumber; /* Sheet number for this item */
int m_NumInclude; /* Numero de sous schema correpondant a la sheet (Gestion des GLabels et Pin Sheet)*/
long m_PinNum; /* numero de pin( 4 octets -> 4 codes ascii) */
const wxString * m_Label; /* Tous types Labels:pointeur sur la wxString definissant le label */
wxPoint m_Start, m_End;
void* m_Comp; /* Pointeur sur la definition de l'objet */
void* m_Link; /* Pour SheetLabelStruct: Pointeur sur la feuille de hierarchie
* Pour les Pins: pointeur sur le composant */
int m_Flag; /* flag pour calculs internes */
SCH_SCREEN* m_Screen; /* Ecran d'appartenance */
NetObjetType m_Type;
int m_ElectricalType; /* Pour Pins et sheet labels: type electrique */
int m_NetCode; /* pour elements simples */
int m_BusNetCode; /* pour connexions type bus */
int m_Member; /* pour les labels type BUSWIRE ( labels de bus eclate )
* numero de membre */
IsConnectType m_FlagOfConnection;
int m_SheetNumber; /* Sheet number for this item */
int m_NumInclude; /* Numero de sous schema correpondant a la sheet (Gestion des GLabels et Pin Sheet)*/
long m_PinNum; /* numero de pin( 4 octets -> 4 codes ascii) */
const wxString* m_Label; /* Tous types Labels:pointeur sur la wxString definissant le label */
wxPoint m_Start, m_End;
};
/* Structure decrivant 1 composant de la schematique (pour annotation ) */
struct CmpListStruct
{
public:
EDA_SchComponentStruct * m_Cmp; /* Pointeur sur le composant */
int m_NbParts; /* Nombre de parts par boitier */
bool m_PartsLocked; // For multi part components: True if the part cannot be changed
int m_Unit; /* Numero de part */
int m_Sheet; /* Numero de hierarchie */
unsigned long m_TimeStamp; /* Signature temporelle */
int m_IsNew; /* != 0 pour composants non annotes */
char m_TextValue[32]; /* Valeur */
char m_TextRef[32]; /* Reference ( hors numero ) */
int m_NumRef; /* Numero de reference */
int m_Flag; /* flag pour calculs internes */
wxPoint m_Pos; /* position components */
EDA_SchComponentStruct* m_Cmp; /* Pointeur sur le composant */
int m_NbParts; /* Nombre de parts par boitier */
bool m_PartsLocked; // For multi part components: True if the part cannot be changed
int m_Unit; /* Numero de part */
int m_Sheet; /* Numero de hierarchie */
unsigned long m_TimeStamp; /* Signature temporelle */
int m_IsNew; /* != 0 pour composants non annotes */
char m_TextValue[32]; /* Valeur */
char m_TextRef[32]; /* Reference ( hors numero ) */
int m_NumRef; /* Numero de reference */
int m_Flag; /* flag pour calculs internes */
wxPoint m_Pos; /* position components */
};
/* Global Variables */
eda_global int g_NbrObjNet;
eda_global ObjetNetListStruct *g_TabObjNet;
eda_global ObjetNetListStruct* g_TabObjNet;
/* Prototypes: */
void WriteNetList(WinEDA_SchematicFrame * frame, const wxString & FileNameNL, bool use_netnames);
void FreeTabNetList(ObjetNetListStruct * TabNetItems, int NbrNetItems);
void WriteNetList( WinEDA_SchematicFrame* frame, const wxString& FileNameNL, bool use_netnames );
void FreeTabNetList( ObjetNetListStruct* TabNetItems, int NbrNetItems );
#endif

View File

@ -75,9 +75,10 @@ public:
public:
EDA_DrawLineStruct( const wxPoint& pos, int layer );
~EDA_DrawLineStruct() { }
virtual wxString GetClass() const
{
return wxT( "EDA_DrawLineStruct" );
return wxT( "EDA_DrawLine" );
}
@ -92,6 +93,17 @@ public:
virtual void Draw( WinEDA_DrawPanel* panel, wxDC* DC, const wxPoint& offset, int draw_mode,
int Color = -1 );
#if defined(DEBUG)
/**
* Function Show
* is used to output the object tree, currently for debugging only.
* @param nestLevel An aid to prettier tree indenting, and is the level
* of nesting of this object within the overall tree.
* @param os The ostream& to output to.
*/
void Show( int nestLevel, std::ostream& os );
#endif
};
@ -108,7 +120,7 @@ public:
~DrawMarkerStruct();
virtual wxString GetClass() const
{
return wxT( "DrawMarkerStruct" );
return wxT( "DrawMarker" );
}
@ -116,6 +128,16 @@ public:
wxString GetComment();
virtual void Draw( WinEDA_DrawPanel* panel, wxDC* DC, const wxPoint& offset,
int draw_mode, int Color = -1 );
#if defined(DEBUG)
/**
* Function Show
* is used to output the object tree, currently for debugging only.
* @param nestLevel An aid to prettier tree indenting, and is the level
* of nesting of this object within the overall tree.
* @param os The ostream& to output to.
*/
void Show( int nestLevel, std::ostream& os );
#endif
};
@ -129,7 +151,7 @@ public:
~DrawNoConnectStruct() { }
virtual wxString GetClass() const
{
return wxT( "DrawNoConnectStruct" );
return wxT( "DrawNoConnect" );
}
@ -154,9 +176,10 @@ public:
public:
DrawBusEntryStruct( const wxPoint& pos, int shape, int id );
~DrawBusEntryStruct() { }
virtual wxString GetClass() const
{
return wxT( "DrawBusEntryStruct" );
return wxT( "DrawBusEntry" );
}
@ -177,9 +200,10 @@ public:
public:
DrawPolylineStruct( int layer );
~DrawPolylineStruct();
virtual wxString GetClass() const
{
return wxT( "DrawPolylineStruct" );
return wxT( "DrawPolyline" );
}
@ -197,9 +221,10 @@ public:
public:
DrawJunctionStruct( const wxPoint& pos );
~DrawJunctionStruct() { }
virtual wxString GetClass() const
{
return wxT( "DrawJunctionStruct" );
return wxT( "DrawJunction" );
}
@ -209,8 +234,7 @@ public:
};
class DrawTextStruct : public EDA_BaseStruct
, public EDA_TextStruct
class DrawTextStruct : public EDA_BaseStruct, public EDA_TextStruct
{
public:
int m_Layer;
@ -224,7 +248,7 @@ public:
virtual wxString GetClass() const
{
return wxT( "DrawTextStruct" );
return wxT( "DrawText" );
}
@ -248,7 +272,7 @@ public:
virtual wxString GetClass() const
{
return wxT( "DrawLabelStruct" );
return wxT( "DrawLabel" );
}
};
@ -264,7 +288,7 @@ public:
virtual wxString GetClass() const
{
return wxT( "DrawGlobalLabelStruct" );
return wxT( "DrawGlobalLabel" );
}
};

View File

@ -8,7 +8,7 @@ LibEDA_BaseStruct * LocatePin(const wxPoint & RefPos,
int Unit, int Convert, EDA_SchComponentStruct * DrawItem = NULL);
/* Routine de localisation d'une PIN de la PartLib pointee par Entry */
wxString ReturnDefaultFieldName(int FieldNumber);
const wxString& ReturnDefaultFieldName( int aFieldNdx );
/***************/

View File

@ -215,7 +215,7 @@ private:
char m_FlagRefreshReq; /* indique que l'ecran doit redessine */
char m_FlagModified; // indique modif du PCB,utilise pour eviter une sortie sans sauvegarde
char m_FlagSave; // indique sauvegarde auto faite
EDA_BaseStruct* m_CurrentItem; ///< Current selected object
EDA_BaseStruct* m_CurrentItem; ///< Currently selected object
/* Valeurs du pas de grille et du zoom */
public:
@ -260,17 +260,12 @@ public:
/**
* Function SetCurItem
* sets the currently selected object, m_CurrentItem.
* This is intentionally not inlined so we can set breakpoints on the
* activity easier in base_screen.cpp.
* @param current Any object derived from EDA_BaseStruct
*/
void SetCurItem( EDA_BaseStruct* current )
{
m_CurrentItem = current;
}
void SetCurItem( EDA_BaseStruct* current ) { m_CurrentItem = current; }
EDA_BaseStruct* GetCurItem() const { return m_CurrentItem; }
/* fonctions relatives au zoom */
int GetZoom(); /* retourne le coeff de zoom */
void SetZoom( int coeff ); /* ajuste le coeff de zoom a coeff */
@ -313,6 +308,18 @@ public:
{
return wxT( "BASE_SCREEN" );
}
#if defined(DEBUG)
/**
* Function Show
* is used to output the object tree, currently for debugging only.
* @param nestLevel An aid to prettier tree indenting, and is the level
* of nesting of this object within the overall tree.
* @param os The ostream& to output to.
*/
void Show( int nestLevel, std::ostream& os );
#endif
};

View File

@ -441,10 +441,10 @@ BOARD_ITEM* WinEDA_BasePcbFrame::PcbGeneralLocateAndDisplay()
{
wxMenu itemMenu;
int limit = MIN( MAX_ITEMS_IN_PICKER, m_Collector->GetCount() );
itemMenu.SetTitle( _("Selection Clarification") ); // does this work? not under Linux!
int limit = MIN( MAX_ITEMS_IN_PICKER, m_Collector->GetCount() );
for( int i=0; i<limit; ++i )
{
wxString text;

View File

@ -63,8 +63,8 @@ static wxMenu* Append_Track_Width_List()
* @return a pointeur to the menu
*/
{
#define TRACK_HISTORY_NUMBER_MAX 6
#define VIA_HISTORY_NUMBER_MAX 4
#define TRACK_HISTORY_NUMBER_MAX 6
#define VIA_HISTORY_NUMBER_MAX 4
int ii;
wxString msg;
wxMenu* trackwidth_menu;
@ -124,6 +124,7 @@ void WinEDA_PcbFrame::OnRightClick( const wxPoint& aMousePos, wxMenu* aPopMenu )
DrawPanel->CursorOff( &dc );
DrawPanel->m_CanStartBlock = -1; // Avoid to start a block coomand when clicking on menu
// If command in progress: Put the Cancel command (if needed) and End command
if( m_ID_current_state )
{
@ -160,14 +161,12 @@ void WinEDA_PcbFrame::OnRightClick( const wxPoint& aMousePos, wxMenu* aPopMenu )
return;
}
/* Select a proper item */
if( (item == NULL) || (item->m_Flags == 0) )
/* Select a proper item */
if( !item || !item->m_Flags )
{
item = PcbGeneralLocateAndDisplay();
SetCurItem(item);
}
item = GetCurItem();
if( item )
flags = item->m_Flags;
else
@ -183,10 +182,18 @@ void WinEDA_PcbFrame::OnRightClick( const wxPoint& aMousePos, wxMenu* aPopMenu )
if( m_HTOOL_current_state == ID_TOOLBARH_PCB_AUTOPLACE )
{
aPopMenu->AppendSeparator();
ADD_MENUITEM( aPopMenu, ID_POPUP_PCB_AUTOPLACE_FIXE_MODULE, _( "Lock Module" ),
Locked_xpm );
ADD_MENUITEM( aPopMenu, ID_POPUP_PCB_AUTOPLACE_FREE_MODULE, _( "Unlock Module" ),
Unlocked_xpm );
if( !((MODULE*)item)->IsLocked() )
{
ADD_MENUITEM( aPopMenu, ID_POPUP_PCB_AUTOPLACE_FIXE_MODULE, _( "Lock Module" ),
Locked_xpm );
}
else
{
ADD_MENUITEM( aPopMenu, ID_POPUP_PCB_AUTOPLACE_FREE_MODULE, _( "Unlock Module" ),
Unlocked_xpm );
}
if( !flags )
aPopMenu->Append( ID_POPUP_PCB_AUTOPLACE_CURRENT_MODULE,
_( "Auto place Module" ) );