class name changes, XOR artifacts
This commit is contained in:
parent
bd77c9f2e6
commit
c406eed135
|
@ -5,6 +5,27 @@ Started 2007-June-11
|
|||
Please add newer entries at the top, list the date and your name with
|
||||
email address.
|
||||
|
||||
2008-Mar-19 UPDATE Dick Hollenbeck <dick@softplc.com>
|
||||
================================================================================
|
||||
+eeschema
|
||||
Renamed some classes and their corresponding KICAD_T types so they are both
|
||||
simpler, shorter and more closely match each other: the type and the classname.
|
||||
Wedged a class SCH_ITEM underneath most eeschema drawable items, and this
|
||||
class came from DrawPartStruct which was largely disfunctional. Eeschema
|
||||
now more closely matches what we have in pcbnew with the BOARD_ITEM base class.
|
||||
The corresponding class in eeschema is now SCH_ITEM. Put in some of Jonas'
|
||||
patch for the dragging of a block. Needs testing, especially dragging
|
||||
text since there is no GetBoundingBox() for that yet. As an interrim solution
|
||||
we could make SCH_ITEM::GetBoundingBox() return a HUGE rectangle so that any class
|
||||
not implementing GetBoundingBox() in eeschema will get properly re-drawn,
|
||||
in theory.
|
||||
|
||||
We are currently using XORing for dragging a single object and using full
|
||||
redraws for dragging a block. I suppose this can be an experiment for a
|
||||
week or so. I would not expect that dragging a block of labels with no
|
||||
other object to work currently.
|
||||
|
||||
|
||||
2008-Mar-19 UPDATE Igor Plyatov <plyatov@mail.ru>
|
||||
================================================================================
|
||||
* Support for Gnome/KDE menu added.
|
||||
|
|
|
@ -805,8 +805,9 @@ EDA_Rect& EDA_Rect::Inflate( wxCoord dx, wxCoord dy )
|
|||
}
|
||||
|
||||
|
||||
/** Function Merge
|
||||
* Modify Position and Size of this in order to contain the given rect
|
||||
/**
|
||||
* Function Merge
|
||||
* modifies Position and Size of this in order to contain the given rect
|
||||
* mainly used to calculate bounding boxes
|
||||
* @param aRect = given rect to merge with this
|
||||
*/
|
||||
|
@ -840,7 +841,7 @@ void EDA_Rect::Merge( const EDA_Rect& aRect )
|
|||
|
||||
/*******************************************************************/
|
||||
DrawPickedStruct::DrawPickedStruct( EDA_BaseStruct* pickedstruct ) :
|
||||
EDA_BaseStruct( DRAW_PICK_ITEM_STRUCT_TYPE )
|
||||
SCH_ITEM( NULL, DRAW_PICK_ITEM_STRUCT_TYPE )
|
||||
/*******************************************************************/
|
||||
{
|
||||
m_PickedStruct = pickedstruct;
|
||||
|
@ -851,6 +852,41 @@ DrawPickedStruct::~DrawPickedStruct()
|
|||
{
|
||||
}
|
||||
|
||||
#if defined(DEBUG)
|
||||
void DrawPickedStruct::Show( int nestLevel, std::ostream& os )
|
||||
{
|
||||
NestedSpace( nestLevel, os ) << '<' << GetClass().Lower().mb_str() << "/>\n";
|
||||
}
|
||||
#endif
|
||||
|
||||
|
||||
EDA_Rect DrawPickedStruct::GetBoundingBox()
|
||||
{
|
||||
if( m_PickedStruct )
|
||||
return m_PickedStruct->GetBoundingBox();
|
||||
else
|
||||
{
|
||||
return EDA_Rect(); // empty rectangle
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
EDA_Rect DrawPickedStruct::GetBoundingBoxUnion()
|
||||
{
|
||||
EDA_Rect ret;
|
||||
|
||||
DrawPickedStruct* cur = this;
|
||||
EDA_BaseStruct* item;
|
||||
while( cur && (item = cur->m_PickedStruct) != NULL )
|
||||
{
|
||||
ret.Merge( item->GetBoundingBox() );
|
||||
|
||||
cur = cur->Next();
|
||||
}
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
|
||||
/*********************************************/
|
||||
void DrawPickedStruct::DeleteWrapperList()
|
||||
|
|
|
@ -27,7 +27,7 @@ void DrawSheetStruct::Display_Infos( WinEDA_DrawFrame* frame )
|
|||
|
||||
|
||||
/***************************************************************/
|
||||
void EDA_SchComponentStruct::Display_Infos( WinEDA_DrawFrame* frame )
|
||||
void SCH_COMPONENT::Display_Infos( WinEDA_DrawFrame* frame )
|
||||
/***************************************************************/
|
||||
{
|
||||
EDA_LibComponentStruct* Entry = FindLibPart( m_ChipName.GetData(), wxEmptyString, FIND_ROOT );;
|
||||
|
|
|
@ -90,10 +90,10 @@ void ReAnnotatePowerSymbolsOnly( void )
|
|||
EDA_BaseStruct* DrawList = sheet->LastDrawList();
|
||||
for( ; DrawList != NULL; DrawList = DrawList->Pnext )
|
||||
{
|
||||
if( DrawList->Type() != DRAW_LIB_ITEM_STRUCT_TYPE )
|
||||
if( DrawList->Type() != TYPE_SCH_COMPONENT )
|
||||
continue;
|
||||
EDA_SchComponentStruct* DrawLibItem =
|
||||
(EDA_SchComponentStruct*) DrawList;
|
||||
SCH_COMPONENT* DrawLibItem =
|
||||
(SCH_COMPONENT*) DrawList;
|
||||
EDA_LibComponentStruct* Entry =
|
||||
FindLibPart(
|
||||
DrawLibItem->m_ChipName.GetData(), wxEmptyString,
|
||||
|
@ -303,14 +303,14 @@ int ListeComposants( CmpListStruct* BaseListeCmp, DrawSheetPath* sheet )
|
|||
{
|
||||
int NbrCmp = 0;
|
||||
EDA_BaseStruct* DrawList = sheet->LastDrawList();
|
||||
EDA_SchComponentStruct* DrawLibItem;
|
||||
SCH_COMPONENT* DrawLibItem;
|
||||
EDA_LibComponentStruct* Entry;
|
||||
|
||||
for( ; DrawList; DrawList = DrawList->Pnext )
|
||||
{
|
||||
if( DrawList->Type() == DRAW_LIB_ITEM_STRUCT_TYPE )
|
||||
if( DrawList->Type() == TYPE_SCH_COMPONENT )
|
||||
{
|
||||
DrawLibItem = (EDA_SchComponentStruct*) DrawList;
|
||||
DrawLibItem = (SCH_COMPONENT*) DrawList;
|
||||
Entry = FindLibPart( DrawLibItem->m_ChipName.GetData(),
|
||||
wxEmptyString,
|
||||
FIND_ROOT );
|
||||
|
@ -361,7 +361,7 @@ static void ReAnnotateComponents( CmpListStruct* BaseListeCmp, int NbOfCmp )
|
|||
{
|
||||
int ii;
|
||||
char* Text;
|
||||
EDA_SchComponentStruct* DrawLibItem;
|
||||
SCH_COMPONENT* DrawLibItem;
|
||||
|
||||
/* Reattribution des numeros */
|
||||
for( ii = 0; ii < NbOfCmp; ii++ )
|
||||
|
|
|
@ -24,7 +24,7 @@ static EDA_BaseStruct* CopyStruct( WinEDA_DrawPanel* panel, wxDC* DC, BASE_
|
|||
EDA_BaseStruct* DrawStruct );
|
||||
static void CollectStructsToDrag( SCH_SCREEN* screen );
|
||||
static void AddPickedItem( SCH_SCREEN* screen, wxPoint position );
|
||||
static LibEDA_BaseStruct* GetNextPinPosition( EDA_SchComponentStruct* DrawLibItem,
|
||||
static LibEDA_BaseStruct* GetNextPinPosition( SCH_COMPONENT* DrawLibItem,
|
||||
wxPoint& position );
|
||||
static void DrawMovingBlockOutlines( WinEDA_DrawPanel* panel, wxDC* DC, bool erase );
|
||||
static EDA_BaseStruct* SaveStructListForPaste( EDA_BaseStruct* DrawStruct );
|
||||
|
@ -555,27 +555,28 @@ static void DrawMovingBlockOutlines( WinEDA_DrawPanel* panel, wxDC* DC,
|
|||
*****************************************************************************/
|
||||
bool MoveStruct( WinEDA_DrawPanel* panel, wxDC* DC, EDA_BaseStruct* DrawStruct )
|
||||
{
|
||||
DrawPickedStruct* PickedList = NULL;
|
||||
|
||||
if( !DrawStruct )
|
||||
return FALSE;
|
||||
|
||||
if( DrawStruct->Type() == DRAW_PICK_ITEM_STRUCT_TYPE )
|
||||
{
|
||||
if( DC )
|
||||
RedrawStructList( panel, DC, DrawStruct, g_XorMode );
|
||||
PlaceStruct( panel->GetScreen(), DrawStruct ); /* Place it in its new position. */
|
||||
if( DC )
|
||||
RedrawStructList( panel, DC, DrawStruct, GR_DEFAULT_DRAWMODE );
|
||||
DrawPickedStruct* pickedList = (DrawPickedStruct*) DrawStruct;
|
||||
|
||||
/* Free the wrapper DrawPickedStruct chain: */
|
||||
PickedList = (DrawPickedStruct*) DrawStruct;
|
||||
PickedList->DeleteWrapperList();
|
||||
if( DC )
|
||||
panel->PostDirtyRect( pickedList->GetBoundingBoxUnion() );
|
||||
|
||||
PlaceStruct( panel->GetScreen(), pickedList); // Place it in its new position.
|
||||
|
||||
if( DC )
|
||||
RedrawStructList( panel, DC, pickedList, GR_DEFAULT_DRAWMODE );
|
||||
|
||||
// Free the wrapper DrawPickedStruct chain
|
||||
pickedList->DeleteWrapperList();
|
||||
}
|
||||
else
|
||||
{
|
||||
if( DC )
|
||||
RedrawOneStruct( panel, DC, DrawStruct, g_XorMode );
|
||||
panel->PostDirtyRect( DrawStruct->GetBoundingBox());
|
||||
PlaceStruct( panel->GetScreen(), DrawStruct ); /* Place it in its new position. */
|
||||
if( DC )
|
||||
RedrawOneStruct( panel, DC, DrawStruct, GR_DEFAULT_DRAWMODE );
|
||||
|
@ -604,12 +605,12 @@ void MirrorOneStruct( EDA_BaseStruct* DrawStruct, wxPoint& Center )
|
|||
DrawJunctionStruct* DrawConnect;
|
||||
EDA_DrawLineStruct* DrawSegment;
|
||||
DrawBusEntryStruct* DrawRaccord;
|
||||
EDA_SchComponentStruct* DrawLibItem;
|
||||
SCH_COMPONENT* DrawLibItem;
|
||||
DrawSheetStruct* DrawSheet;
|
||||
DrawSheetLabelStruct* DrawSheetLabel;
|
||||
DrawMarkerStruct* DrawMarker;
|
||||
DrawNoConnectStruct* DrawNoConnect;
|
||||
DrawTextStruct* DrawText;
|
||||
SCH_TEXT* DrawText;
|
||||
wxPoint px;
|
||||
|
||||
if( !DrawStruct )
|
||||
|
@ -665,13 +666,13 @@ void MirrorOneStruct( EDA_BaseStruct* DrawStruct, wxPoint& Center )
|
|||
MirrorYPoint( DrawNoConnect->m_Pos, Center );
|
||||
break;
|
||||
|
||||
case DRAW_TEXT_STRUCT_TYPE:
|
||||
case DRAW_LABEL_STRUCT_TYPE:
|
||||
case TYPE_SCH_TEXT:
|
||||
case TYPE_SCH_LABEL:
|
||||
|
||||
// Text is not really mirrored; it is moved to a suitable position
|
||||
// which is the closest position for a true mirrored text
|
||||
// The center position is mirrored and the text is moved for half horizontal len
|
||||
DrawText = (DrawTextStruct*) DrawStruct;
|
||||
DrawText = (SCH_TEXT*) DrawStruct;
|
||||
px = DrawText->m_Pos;
|
||||
if( DrawText->m_Orient == 0 ) /* horizontal text */
|
||||
dx = DrawText->Len_Size() / 2;
|
||||
|
@ -687,11 +688,11 @@ void MirrorOneStruct( EDA_BaseStruct* DrawStruct, wxPoint& Center )
|
|||
DrawText->m_Pos.x = px.x;
|
||||
break;
|
||||
|
||||
case DRAW_HIER_LABEL_STRUCT_TYPE:
|
||||
case DRAW_GLOBAL_LABEL_STRUCT_TYPE:
|
||||
case TYPE_SCH_HIERLABEL:
|
||||
case TYPE_SCH_GLOBALLABEL:
|
||||
|
||||
// Text is not really mirrored: Orientation is changed
|
||||
DrawText = (DrawLabelStruct*) DrawStruct;
|
||||
DrawText = (SCH_LABEL*) DrawStruct;
|
||||
if( DrawText->m_Orient == 0 ) /* horizontal text */
|
||||
DrawText->m_Orient = 2;
|
||||
else if( DrawText->m_Orient == 2 ) /* invert horizontal text*/
|
||||
|
@ -703,8 +704,8 @@ void MirrorOneStruct( EDA_BaseStruct* DrawStruct, wxPoint& Center )
|
|||
DrawText->m_Pos.x = px.x;
|
||||
break;
|
||||
|
||||
case DRAW_LIB_ITEM_STRUCT_TYPE:
|
||||
DrawLibItem = (EDA_SchComponentStruct*) DrawStruct;
|
||||
case TYPE_SCH_COMPONENT:
|
||||
DrawLibItem = (SCH_COMPONENT*) DrawStruct;
|
||||
dx = DrawLibItem->m_Pos.x;
|
||||
g_EDA_Appl->m_SchematicFrame->CmpRotationMiroir( DrawLibItem,
|
||||
NULL, CMP_MIROIR_Y );
|
||||
|
@ -753,43 +754,42 @@ void MirrorOneStruct( EDA_BaseStruct* DrawStruct, wxPoint& Center )
|
|||
*****************************************************************************/
|
||||
bool MirrorStruct( WinEDA_DrawPanel* panel, wxDC* DC, EDA_BaseStruct* DrawStruct, wxPoint& Center )
|
||||
{
|
||||
DrawPickedStruct* PickedList = NULL;
|
||||
DrawPickedStruct* DrawStructs;
|
||||
|
||||
if( !DrawStruct )
|
||||
return FALSE;
|
||||
|
||||
if( DrawStruct->Type() == DRAW_PICK_ITEM_STRUCT_TYPE )
|
||||
{
|
||||
DrawPickedStruct* pickedList = (DrawPickedStruct*) DrawStruct;
|
||||
|
||||
if( DC )
|
||||
RedrawStructList( panel, DC, DrawStruct, g_XorMode );
|
||||
DrawStructs = (DrawPickedStruct*) DrawStruct;
|
||||
while( DrawStructs )
|
||||
panel->PostDirtyRect( pickedList->GetBoundingBoxUnion() );
|
||||
|
||||
for( DrawPickedStruct* cur = pickedList; cur; cur=cur->Next() )
|
||||
{
|
||||
MirrorOneStruct( DrawStructs->m_PickedStruct, Center );
|
||||
DrawStructs->m_PickedStruct->m_Flags = 0;
|
||||
DrawStructs = (DrawPickedStruct*) DrawStructs->Pnext;
|
||||
MirrorOneStruct( cur->m_PickedStruct, Center );
|
||||
cur->m_PickedStruct->m_Flags = 0;
|
||||
}
|
||||
|
||||
if( DC )
|
||||
RedrawStructList( panel, DC, DrawStruct, GR_DEFAULT_DRAWMODE );
|
||||
RedrawStructList( panel, DC, pickedList, GR_DEFAULT_DRAWMODE );
|
||||
|
||||
/* Free the wrapper DrawPickedStruct chain: */
|
||||
PickedList = (DrawPickedStruct*) DrawStruct;
|
||||
PickedList->DeleteWrapperList();
|
||||
// Free the wrapper DrawPickedStruct chain
|
||||
pickedList->DeleteWrapperList();
|
||||
}
|
||||
else
|
||||
{
|
||||
if( DC )
|
||||
RedrawOneStruct( panel, DC, DrawStruct, g_XorMode );
|
||||
MirrorOneStruct( DrawStruct, Center ); /* Place it in its new position. */
|
||||
panel->PostDirtyRect( DrawStruct->GetBoundingBox() );
|
||||
|
||||
MirrorOneStruct( DrawStruct, Center ); // Place it in its new position.
|
||||
|
||||
if( DC )
|
||||
RedrawOneStruct( panel, DC, DrawStruct, GR_DEFAULT_DRAWMODE );
|
||||
|
||||
DrawStruct->m_Flags = 0;
|
||||
}
|
||||
|
||||
|
||||
return TRUE;
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
|
@ -825,10 +825,10 @@ static EDA_BaseStruct* CopyStruct( WinEDA_DrawPanel* panel, wxDC* DC, BASE_SCREE
|
|||
|
||||
switch( Struct->Type() )
|
||||
{
|
||||
case DRAW_LIB_ITEM_STRUCT_TYPE:
|
||||
case TYPE_SCH_COMPONENT:
|
||||
{
|
||||
( (EDA_SchComponentStruct*) Struct )->m_TimeStamp = GetTimeStamp();
|
||||
( (EDA_SchComponentStruct*) Struct )->ClearAnnotation();
|
||||
( (SCH_COMPONENT*) Struct )->m_TimeStamp = GetTimeStamp();
|
||||
( (SCH_COMPONENT*) Struct )->ClearAnnotation();
|
||||
}
|
||||
break;
|
||||
|
||||
|
@ -872,10 +872,10 @@ static EDA_BaseStruct* CopyStruct( WinEDA_DrawPanel* panel, wxDC* DC, BASE_SCREE
|
|||
case DRAW_JUNCTION_STRUCT_TYPE:
|
||||
case DRAW_SEGMENT_STRUCT_TYPE:
|
||||
case DRAW_BUSENTRY_STRUCT_TYPE:
|
||||
case DRAW_TEXT_STRUCT_TYPE:
|
||||
case DRAW_LABEL_STRUCT_TYPE:
|
||||
case DRAW_GLOBAL_LABEL_STRUCT_TYPE:
|
||||
case DRAW_HIER_LABEL_STRUCT_TYPE:
|
||||
case TYPE_SCH_TEXT:
|
||||
case TYPE_SCH_LABEL:
|
||||
case TYPE_SCH_GLOBALLABEL:
|
||||
case TYPE_SCH_HIERLABEL:
|
||||
case DRAW_SHEETLABEL_STRUCT_TYPE:
|
||||
case DRAW_PICK_ITEM_STRUCT_TYPE:
|
||||
case DRAW_MARKER_STRUCT_TYPE:
|
||||
|
@ -891,9 +891,9 @@ static EDA_BaseStruct* CopyStruct( WinEDA_DrawPanel* panel, wxDC* DC, BASE_SCREE
|
|||
break;
|
||||
}
|
||||
|
||||
case DRAW_LIB_ITEM_STRUCT_TYPE:
|
||||
( (EDA_SchComponentStruct*) NewDrawStruct )->m_TimeStamp = GetTimeStamp();
|
||||
( (EDA_SchComponentStruct*) NewDrawStruct )->ClearAnnotation();
|
||||
case TYPE_SCH_COMPONENT:
|
||||
( (SCH_COMPONENT*) NewDrawStruct )->m_TimeStamp = GetTimeStamp();
|
||||
( (SCH_COMPONENT*) NewDrawStruct )->ClearAnnotation();
|
||||
break;
|
||||
}
|
||||
|
||||
|
@ -924,13 +924,11 @@ void DeleteStruct( WinEDA_DrawPanel* panel, wxDC* DC, EDA_BaseStruct* DrawStruct
|
|||
*/
|
||||
{
|
||||
SCH_SCREEN* screen = (SCH_SCREEN*) panel->GetScreen();
|
||||
DrawPickedStruct* PickedList = NULL;
|
||||
WinEDA_SchematicFrame* frame = (WinEDA_SchematicFrame*) panel->m_Parent;
|
||||
|
||||
if( !DrawStruct )
|
||||
return;
|
||||
|
||||
|
||||
if( DrawStruct->Type() == DRAW_SHEETLABEL_STRUCT_TYPE )
|
||||
{
|
||||
/* Cette stucture est rattachee a une feuille, et n'est pas
|
||||
|
@ -942,34 +940,34 @@ void DeleteStruct( WinEDA_DrawPanel* panel, wxDC* DC, EDA_BaseStruct* DrawStruct
|
|||
|
||||
if( DrawStruct->Type() == DRAW_PICK_ITEM_STRUCT_TYPE )
|
||||
{
|
||||
/* Unlink all picked structs from current EEDrawList */
|
||||
PickedList = (DrawPickedStruct*) DrawStruct;
|
||||
while( PickedList )
|
||||
// Unlink all picked structs from current EEDrawList
|
||||
|
||||
for( DrawPickedStruct* cur = (DrawPickedStruct*) DrawStruct; cur; cur=cur->Next() )
|
||||
{
|
||||
screen->RemoveFromDrawList( PickedList->m_PickedStruct );
|
||||
PickedList->m_PickedStruct->Pnext =
|
||||
PickedList->m_PickedStruct->Pback = NULL;
|
||||
PickedList->m_PickedStruct->m_Flags = IS_DELETED;
|
||||
PickedList = PickedList->Next();
|
||||
EDA_BaseStruct* item = cur->m_PickedStruct;
|
||||
screen->RemoveFromDrawList( item );
|
||||
panel->PostDirtyRect( item->GetBoundingBox() );
|
||||
item->Pnext = item->Pback = NULL;
|
||||
item->m_Flags = IS_DELETED;
|
||||
}
|
||||
|
||||
RedrawStructList( panel, DC, DrawStruct, g_XorMode );
|
||||
|
||||
/* Removed items are put to the Undo list */
|
||||
// Removed items are put onto the Undo list
|
||||
frame->SaveCopyInUndoList( DrawStruct, IS_DELETED );
|
||||
}
|
||||
else /* structure classique */
|
||||
{
|
||||
screen->RemoveFromDrawList( DrawStruct );
|
||||
|
||||
if( (DrawStruct->Type() == DRAW_SEGMENT_STRUCT_TYPE) ||
|
||||
(DrawStruct->Type() == DRAW_JUNCTION_STRUCT_TYPE) ||
|
||||
(DrawStruct->Type() == DRAW_LIB_ITEM_STRUCT_TYPE) )
|
||||
switch( DrawStruct->Type() )
|
||||
{
|
||||
case DRAW_SEGMENT_STRUCT_TYPE:
|
||||
case DRAW_JUNCTION_STRUCT_TYPE:
|
||||
case TYPE_SCH_COMPONENT:
|
||||
panel->PostDirtyRect( DrawStruct->GetBoundingBox() );
|
||||
}
|
||||
else
|
||||
{
|
||||
break;
|
||||
|
||||
// other classes do not yet have GetBoundingBox() implementations
|
||||
default:
|
||||
D( DrawStruct->Show( 0, std::cout ); ) // tell me which classes still need GetBoundingBox support
|
||||
RedrawOneStruct( panel, DC, DrawStruct, g_XorMode );
|
||||
}
|
||||
|
@ -1062,10 +1060,10 @@ void WinEDA_SchematicFrame::PasteStruct( wxDC* DC )
|
|||
for( PickedList = (DrawPickedStruct*) DrawStruct; PickedList != NULL; ) // Clear annotation for new components
|
||||
{
|
||||
EDA_BaseStruct* Struct = PickedList->m_PickedStruct;
|
||||
if( Struct->Type() == DRAW_LIB_ITEM_STRUCT_TYPE )
|
||||
if( Struct->Type() == TYPE_SCH_COMPONENT )
|
||||
{
|
||||
( (EDA_SchComponentStruct*) Struct )->m_TimeStamp = GetTimeStamp();
|
||||
( (EDA_SchComponentStruct*) Struct )->ClearAnnotation();
|
||||
( (SCH_COMPONENT*) Struct )->m_TimeStamp = GetTimeStamp();
|
||||
( (SCH_COMPONENT*) Struct )->ClearAnnotation();
|
||||
SetStructFather( Struct, GetScreen() );
|
||||
}
|
||||
PickedList = (DrawPickedStruct*) PickedList->Pnext;
|
||||
|
@ -1086,10 +1084,10 @@ void WinEDA_SchematicFrame::PasteStruct( wxDC* DC )
|
|||
}
|
||||
else
|
||||
{
|
||||
if( DrawStruct->Type() == DRAW_LIB_ITEM_STRUCT_TYPE )
|
||||
if( DrawStruct->Type() == TYPE_SCH_COMPONENT )
|
||||
{
|
||||
( (EDA_SchComponentStruct*) DrawStruct )->m_TimeStamp = GetTimeStamp();
|
||||
( (EDA_SchComponentStruct*) DrawStruct )->ClearAnnotation();
|
||||
( (SCH_COMPONENT*) DrawStruct )->m_TimeStamp = GetTimeStamp();
|
||||
( (SCH_COMPONENT*) DrawStruct )->ClearAnnotation();
|
||||
}
|
||||
SetStructFather( DrawStruct, GetScreen() );
|
||||
RedrawOneStruct( DrawPanel, DC, DrawStruct, GR_DEFAULT_DRAWMODE );
|
||||
|
@ -1135,11 +1133,11 @@ bool PlaceStruct( BASE_SCREEN* screen, EDA_BaseStruct* DrawStruct )
|
|||
case DRAW_JUNCTION_STRUCT_TYPE:
|
||||
case DRAW_SEGMENT_STRUCT_TYPE:
|
||||
case DRAW_BUSENTRY_STRUCT_TYPE:
|
||||
case DRAW_TEXT_STRUCT_TYPE:
|
||||
case DRAW_LABEL_STRUCT_TYPE:
|
||||
case DRAW_GLOBAL_LABEL_STRUCT_TYPE:
|
||||
case DRAW_HIER_LABEL_STRUCT_TYPE:
|
||||
case DRAW_LIB_ITEM_STRUCT_TYPE:
|
||||
case TYPE_SCH_TEXT:
|
||||
case TYPE_SCH_LABEL:
|
||||
case TYPE_SCH_GLOBALLABEL:
|
||||
case TYPE_SCH_HIERLABEL:
|
||||
case TYPE_SCH_COMPONENT:
|
||||
case DRAW_SHEET_STRUCT_TYPE:
|
||||
case DRAW_SHEETLABEL_STRUCT_TYPE:
|
||||
case DRAW_MARKER_STRUCT_TYPE:
|
||||
|
@ -1174,7 +1172,7 @@ void MoveOneStruct( EDA_BaseStruct* DrawStruct, const wxPoint& move_vector )
|
|||
DrawJunctionStruct* DrawConnect;
|
||||
EDA_DrawLineStruct* DrawSegment;
|
||||
DrawBusEntryStruct* DrawRaccord;
|
||||
EDA_SchComponentStruct* DrawLibItem;
|
||||
SCH_COMPONENT* DrawLibItem;
|
||||
DrawSheetStruct* DrawSheet;
|
||||
DrawSheetLabelStruct* DrawSheetLabel;
|
||||
DrawMarkerStruct* DrawMarker;
|
||||
|
@ -1231,24 +1229,24 @@ void MoveOneStruct( EDA_BaseStruct* DrawStruct, const wxPoint& move_vector )
|
|||
DrawNoConnect->m_Pos += move_vector;
|
||||
break;
|
||||
|
||||
case DRAW_TEXT_STRUCT_TYPE:
|
||||
#define DrawText ( (DrawTextStruct*) DrawStruct )
|
||||
case TYPE_SCH_TEXT:
|
||||
#define DrawText ( (SCH_TEXT*) DrawStruct )
|
||||
DrawText->m_Pos += move_vector;
|
||||
break;
|
||||
|
||||
case DRAW_LABEL_STRUCT_TYPE:
|
||||
#define DrawLabel ( (DrawLabelStruct*) DrawStruct )
|
||||
case TYPE_SCH_LABEL:
|
||||
#define DrawLabel ( (SCH_LABEL*) DrawStruct )
|
||||
DrawLabel->m_Pos += move_vector;
|
||||
break;
|
||||
|
||||
case DRAW_HIER_LABEL_STRUCT_TYPE:
|
||||
case DRAW_GLOBAL_LABEL_STRUCT_TYPE:
|
||||
#define DrawGHLabel ( (DrawLabelStruct*) DrawStruct )
|
||||
case TYPE_SCH_HIERLABEL:
|
||||
case TYPE_SCH_GLOBALLABEL:
|
||||
#define DrawGHLabel ( (SCH_LABEL*) DrawStruct )
|
||||
DrawGHLabel->m_Pos += move_vector;
|
||||
break;
|
||||
|
||||
case DRAW_LIB_ITEM_STRUCT_TYPE:
|
||||
DrawLibItem = (EDA_SchComponentStruct*) DrawStruct;
|
||||
case TYPE_SCH_COMPONENT:
|
||||
DrawLibItem = (SCH_COMPONENT*) DrawStruct;
|
||||
DrawLibItem->m_Pos += move_vector;
|
||||
for( ii = 0; ii < NUMBER_OF_FIELDS; ii++ )
|
||||
{
|
||||
|
@ -1325,24 +1323,24 @@ EDA_BaseStruct* DuplicateStruct( EDA_BaseStruct* DrawStruct )
|
|||
NewDrawStruct = ( (DrawNoConnectStruct*) DrawStruct )->GenCopy();
|
||||
break;
|
||||
|
||||
case DRAW_TEXT_STRUCT_TYPE:
|
||||
NewDrawStruct = ( (DrawTextStruct*) DrawStruct )->GenCopy();
|
||||
case TYPE_SCH_TEXT:
|
||||
NewDrawStruct = ( (SCH_TEXT*) DrawStruct )->GenCopy();
|
||||
break;
|
||||
|
||||
case DRAW_LABEL_STRUCT_TYPE:
|
||||
NewDrawStruct = ( (DrawLabelStruct*) DrawStruct )->GenCopy();
|
||||
case TYPE_SCH_LABEL:
|
||||
NewDrawStruct = ( (SCH_LABEL*) DrawStruct )->GenCopy();
|
||||
break;
|
||||
|
||||
case DRAW_HIER_LABEL_STRUCT_TYPE:
|
||||
NewDrawStruct = ( (DrawHierLabelStruct*) DrawStruct )->GenCopy();
|
||||
case TYPE_SCH_HIERLABEL:
|
||||
NewDrawStruct = ( (SCH_HIERLABEL*) DrawStruct )->GenCopy();
|
||||
break;
|
||||
|
||||
case DRAW_GLOBAL_LABEL_STRUCT_TYPE:
|
||||
NewDrawStruct = ( (DrawGlobalLabelStruct*) DrawStruct )->GenCopy();
|
||||
case TYPE_SCH_GLOBALLABEL:
|
||||
NewDrawStruct = ( (SCH_GLOBALLABEL*) DrawStruct )->GenCopy();
|
||||
break;
|
||||
|
||||
case DRAW_LIB_ITEM_STRUCT_TYPE:
|
||||
NewDrawStruct = ( (EDA_SchComponentStruct*) DrawStruct )->GenCopy();
|
||||
case TYPE_SCH_COMPONENT:
|
||||
NewDrawStruct = ( (SCH_COMPONENT*) DrawStruct )->GenCopy();
|
||||
break;
|
||||
|
||||
case DRAW_SHEET_STRUCT_TYPE:
|
||||
|
@ -1465,11 +1463,11 @@ static void CollectStructsToDrag( SCH_SCREEN* screen )
|
|||
{
|
||||
Struct = DrawStructs->m_PickedStruct;
|
||||
DrawStructs = (DrawPickedStruct*) DrawStructs->Pnext;
|
||||
if( Struct->Type() == DRAW_LIB_ITEM_STRUCT_TYPE )
|
||||
if( Struct->Type() == TYPE_SCH_COMPONENT )
|
||||
{
|
||||
LibEDA_BaseStruct* DrawItem;
|
||||
wxPoint pos;
|
||||
DrawItem = GetNextPinPosition( (EDA_SchComponentStruct*) Struct, pos );
|
||||
DrawItem = GetNextPinPosition( (SCH_COMPONENT*) Struct, pos );
|
||||
while( DrawItem )
|
||||
{
|
||||
if( (pos.x < ox) || (pos.x > fx) || (pos.y < oy) || (pos.y > fy) )
|
||||
|
@ -1587,12 +1585,12 @@ static void AddPickedItem( SCH_SCREEN* screen, wxPoint position )
|
|||
case DRAW_BUSENTRY_STRUCT_TYPE:
|
||||
break;
|
||||
|
||||
case DRAW_TEXT_STRUCT_TYPE:
|
||||
case TYPE_SCH_TEXT:
|
||||
break;
|
||||
|
||||
case DRAW_LABEL_STRUCT_TYPE:
|
||||
case TYPE_SCH_LABEL:
|
||||
#undef STRUCT
|
||||
#define STRUCT ( (DrawLabelStruct*) Struct )
|
||||
#define STRUCT ( (SCH_LABEL*) Struct )
|
||||
if( Struct->m_Flags & SELECTED )
|
||||
break; /* Already in list */
|
||||
if( STRUCT->m_Pos != position )
|
||||
|
@ -1604,10 +1602,10 @@ static void AddPickedItem( SCH_SCREEN* screen, wxPoint position )
|
|||
Struct->m_Flags |= SELECTED;
|
||||
break;
|
||||
|
||||
case DRAW_HIER_LABEL_STRUCT_TYPE:
|
||||
case DRAW_GLOBAL_LABEL_STRUCT_TYPE:
|
||||
case TYPE_SCH_HIERLABEL:
|
||||
case TYPE_SCH_GLOBALLABEL:
|
||||
#undef STRUCT
|
||||
#define STRUCT ( (DrawLabelStruct*) Struct )
|
||||
#define STRUCT ( (SCH_LABEL*) Struct )
|
||||
if( Struct->m_Flags & SELECTED )
|
||||
break; /* Already in list */
|
||||
if( STRUCT->m_Pos != position )
|
||||
|
@ -1619,7 +1617,7 @@ static void AddPickedItem( SCH_SCREEN* screen, wxPoint position )
|
|||
Struct->m_Flags |= SELECTED;
|
||||
break;
|
||||
|
||||
case DRAW_LIB_ITEM_STRUCT_TYPE:
|
||||
case TYPE_SCH_COMPONENT:
|
||||
break;
|
||||
|
||||
case DRAW_SHEET_STRUCT_TYPE:
|
||||
|
@ -1668,7 +1666,7 @@ static void AddPickedItem( SCH_SCREEN* screen, wxPoint position )
|
|||
|
||||
|
||||
/*********************************************************************************/
|
||||
static LibEDA_BaseStruct* GetNextPinPosition( EDA_SchComponentStruct* DrawLibItem,
|
||||
static LibEDA_BaseStruct* GetNextPinPosition( SCH_COMPONENT* DrawLibItem,
|
||||
wxPoint& position )
|
||||
/*********************************************************************************/
|
||||
{
|
||||
|
|
|
@ -642,9 +642,9 @@ void WinEDA_SchematicFrame::RepeatDrawItem( wxDC* DC )
|
|||
new_pos = STRUCT->m_Pos;
|
||||
break;
|
||||
|
||||
case DRAW_TEXT_STRUCT_TYPE:
|
||||
case TYPE_SCH_TEXT:
|
||||
#undef STRUCT
|
||||
#define STRUCT ( (DrawTextStruct*) g_ItemToRepeat )
|
||||
#define STRUCT ( (SCH_TEXT*) g_ItemToRepeat )
|
||||
g_ItemToRepeat = STRUCT->GenCopy();
|
||||
STRUCT->m_Pos += g_RepeatStep;
|
||||
new_pos = STRUCT->m_Pos;
|
||||
|
@ -653,9 +653,9 @@ void WinEDA_SchematicFrame::RepeatDrawItem( wxDC* DC )
|
|||
break;
|
||||
|
||||
|
||||
case DRAW_LABEL_STRUCT_TYPE:
|
||||
case TYPE_SCH_LABEL:
|
||||
#undef STRUCT
|
||||
#define STRUCT ( (DrawLabelStruct*) g_ItemToRepeat )
|
||||
#define STRUCT ( (SCH_LABEL*) g_ItemToRepeat )
|
||||
g_ItemToRepeat = STRUCT->GenCopy();
|
||||
STRUCT->m_Pos += g_RepeatStep;
|
||||
new_pos = STRUCT->m_Pos;
|
||||
|
@ -664,9 +664,9 @@ void WinEDA_SchematicFrame::RepeatDrawItem( wxDC* DC )
|
|||
break;
|
||||
|
||||
|
||||
case DRAW_HIER_LABEL_STRUCT_TYPE:
|
||||
case TYPE_SCH_HIERLABEL:
|
||||
#undef STRUCT
|
||||
#define STRUCT ( (DrawHierLabelStruct*) g_ItemToRepeat )
|
||||
#define STRUCT ( (SCH_HIERLABEL*) g_ItemToRepeat )
|
||||
g_ItemToRepeat = STRUCT->GenCopy();
|
||||
STRUCT->m_Pos += g_RepeatStep;
|
||||
new_pos = STRUCT->m_Pos;
|
||||
|
@ -674,9 +674,9 @@ void WinEDA_SchematicFrame::RepeatDrawItem( wxDC* DC )
|
|||
IncrementLabelMember( STRUCT->m_Text );
|
||||
break;
|
||||
|
||||
case DRAW_GLOBAL_LABEL_STRUCT_TYPE:
|
||||
case TYPE_SCH_GLOBALLABEL:
|
||||
#undef STRUCT
|
||||
#define STRUCT ( (DrawGlobalLabelStruct*) g_ItemToRepeat )
|
||||
#define STRUCT ( (SCH_GLOBALLABEL*) g_ItemToRepeat )
|
||||
g_ItemToRepeat = STRUCT->GenCopy();
|
||||
STRUCT->m_Pos += g_RepeatStep;
|
||||
new_pos = STRUCT->m_Pos;
|
||||
|
@ -701,9 +701,9 @@ void WinEDA_SchematicFrame::RepeatDrawItem( wxDC* DC )
|
|||
new_pos = STRUCT->m_Pos;
|
||||
break;
|
||||
|
||||
case DRAW_LIB_ITEM_STRUCT_TYPE: // In repeat command the new component is put in move mode
|
||||
case TYPE_SCH_COMPONENT: // In repeat command the new component is put in move mode
|
||||
#undef STRUCT
|
||||
#define STRUCT ( (EDA_SchComponentStruct*) g_ItemToRepeat )
|
||||
#define STRUCT ( (SCH_COMPONENT*) g_ItemToRepeat )
|
||||
|
||||
// Create the duplicate component, position = mouse cursor
|
||||
g_ItemToRepeat = STRUCT->GenCopy();
|
||||
|
@ -790,7 +790,7 @@ static bool IsTerminalPoint( SCH_SCREEN* screen, const wxPoint& pos, int layer )
|
|||
{
|
||||
EDA_BaseStruct* item;
|
||||
LibDrawPin* pin;
|
||||
EDA_SchComponentStruct* LibItem = NULL;
|
||||
SCH_COMPONENT* LibItem = NULL;
|
||||
DrawSheetLabelStruct* pinsheet;
|
||||
wxPoint itempos;
|
||||
|
||||
|
@ -837,9 +837,9 @@ static bool IsTerminalPoint( SCH_SCREEN* screen, const wxPoint& pos, int layer )
|
|||
return TRUE;
|
||||
|
||||
item = PickStruct( pos, screen, LABELITEM );
|
||||
if( item && (item->Type() != DRAW_TEXT_STRUCT_TYPE)
|
||||
&& ( ( (DrawGlobalLabelStruct*) item )->m_Pos.x == pos.x )
|
||||
&& ( ( (DrawGlobalLabelStruct*) item )->m_Pos.y == pos.y ) )
|
||||
if( item && (item->Type() != TYPE_SCH_TEXT)
|
||||
&& ( ( (SCH_GLOBALLABEL*) item )->m_Pos.x == pos.x )
|
||||
&& ( ( (SCH_GLOBALLABEL*) item )->m_Pos.y == pos.y ) )
|
||||
return TRUE;
|
||||
|
||||
pinsheet = LocateAnyPinSheet( pos, screen );
|
||||
|
|
|
@ -184,12 +184,12 @@ void DrawSheetStruct::CleanupSheet( WinEDA_SchematicFrame* frame, wxDC* DC )
|
|||
/* Search Hlabel corresponding to this Pinsheet */
|
||||
|
||||
EDA_BaseStruct* DrawStruct = m_AssociatedScreen->EEDrawList;
|
||||
DrawHierLabelStruct* HLabel = NULL;
|
||||
SCH_HIERLABEL* HLabel = NULL;
|
||||
for( ; DrawStruct != NULL; DrawStruct = DrawStruct->Pnext )
|
||||
{
|
||||
if( DrawStruct->Type() != DRAW_HIER_LABEL_STRUCT_TYPE )
|
||||
if( DrawStruct->Type() != TYPE_SCH_HIERLABEL )
|
||||
continue;
|
||||
HLabel = (DrawHierLabelStruct*) DrawStruct;
|
||||
HLabel = (SCH_HIERLABEL*) DrawStruct;
|
||||
if( Pinsheet->m_Text.CmpNoCase( HLabel->m_Text ) == 0 )
|
||||
break; // Found!
|
||||
HLabel = NULL;
|
||||
|
@ -282,9 +282,9 @@ void DrawSheetStruct::DeleteAnnotation( bool recurse )
|
|||
EDA_BaseStruct* comp = m_AssociatedScreen->EEDrawList;
|
||||
for( ; comp; comp = comp->Pnext )
|
||||
{
|
||||
if( comp->Type() == DRAW_LIB_ITEM_STRUCT_TYPE )
|
||||
if( comp->Type() == TYPE_SCH_COMPONENT )
|
||||
{
|
||||
( (EDA_SchComponentStruct*) comp )->ClearAnnotation();
|
||||
( (SCH_COMPONENT*) comp )->ClearAnnotation();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -305,9 +305,9 @@ int DrawSheetStruct::ComponentCount()
|
|||
EDA_BaseStruct* bs;
|
||||
for( bs = m_AssociatedScreen->EEDrawList; bs != NULL; bs = bs->Pnext )
|
||||
{
|
||||
if( bs->Type() == DRAW_LIB_ITEM_STRUCT_TYPE )
|
||||
if( bs->Type() == TYPE_SCH_COMPONENT )
|
||||
{
|
||||
DrawPartStruct* Cmp = (DrawPartStruct*) bs;
|
||||
SCH_COMPONENT* Cmp = (SCH_COMPONENT*) bs;
|
||||
if( Cmp->m_Field[VALUE].m_Text.GetChar( 0 ) != '#' )
|
||||
n++;
|
||||
}
|
||||
|
@ -803,9 +803,9 @@ void DrawSheetPath::UpdateAllScreenReferences()
|
|||
|
||||
while( t )
|
||||
{
|
||||
if( t->Type() == DRAW_LIB_ITEM_STRUCT_TYPE )
|
||||
if( t->Type() == TYPE_SCH_COMPONENT )
|
||||
{
|
||||
EDA_SchComponentStruct* d = (EDA_SchComponentStruct*) t;
|
||||
SCH_COMPONENT* d = (SCH_COMPONENT*) t;
|
||||
d->m_Field[REFERENCE].m_Text = d->GetRef( this );
|
||||
}
|
||||
t = t->Pnext;
|
||||
|
|
|
@ -19,11 +19,11 @@ void SetStructFather( EDA_BaseStruct* Struct, BASE_SCREEN* Screen )
|
|||
{
|
||||
case DRAW_POLYLINE_STRUCT_TYPE:
|
||||
case DRAW_JUNCTION_STRUCT_TYPE:
|
||||
case DRAW_TEXT_STRUCT_TYPE:
|
||||
case DRAW_LABEL_STRUCT_TYPE:
|
||||
case DRAW_GLOBAL_LABEL_STRUCT_TYPE:
|
||||
case DRAW_HIER_LABEL_STRUCT_TYPE:
|
||||
case DRAW_LIB_ITEM_STRUCT_TYPE:
|
||||
case TYPE_SCH_TEXT:
|
||||
case TYPE_SCH_LABEL:
|
||||
case TYPE_SCH_GLOBALLABEL:
|
||||
case TYPE_SCH_HIERLABEL:
|
||||
case TYPE_SCH_COMPONENT:
|
||||
case DRAW_SEGMENT_STRUCT_TYPE:
|
||||
case DRAW_BUSENTRY_STRUCT_TYPE:
|
||||
case DRAW_SHEET_STRUCT_TYPE:
|
||||
|
|
|
@ -18,15 +18,15 @@
|
|||
|
||||
|
||||
/************************/
|
||||
/* class DrawTextStruct */
|
||||
/* class DrawLabelStruct */
|
||||
/* class DrawGlobalLabelStruct */
|
||||
/* class DrawHierLabelStruct */
|
||||
/* class SCH_TEXT */
|
||||
/* class SCH_LABEL */
|
||||
/* class SCH_GLOBALLABEL */
|
||||
/* class SCH_HIERLABEL */
|
||||
/************************/
|
||||
|
||||
/**************************************************************************/
|
||||
DrawTextStruct::DrawTextStruct( const wxPoint& pos, const wxString& text, KICAD_T aType ) :
|
||||
EDA_BaseStruct( aType )
|
||||
SCH_TEXT::SCH_TEXT( const wxPoint& pos, const wxString& text, KICAD_T aType ) :
|
||||
SCH_ITEM( NULL, aType )
|
||||
, EDA_TextStruct( text )
|
||||
/**************************************************************************/
|
||||
{
|
||||
|
@ -38,28 +38,28 @@ DrawTextStruct::DrawTextStruct( const wxPoint& pos, const wxString& text, KICAD_
|
|||
|
||||
|
||||
/*********************************************/
|
||||
DrawTextStruct* DrawTextStruct::GenCopy()
|
||||
SCH_TEXT* SCH_TEXT::GenCopy()
|
||||
/*********************************************/
|
||||
{
|
||||
DrawTextStruct* newitem;
|
||||
SCH_TEXT* newitem;
|
||||
|
||||
switch( Type() )
|
||||
{
|
||||
default:
|
||||
case DRAW_TEXT_STRUCT_TYPE:
|
||||
newitem = new DrawTextStruct( m_Pos, m_Text );
|
||||
case TYPE_SCH_TEXT:
|
||||
newitem = new SCH_TEXT( m_Pos, m_Text );
|
||||
break;
|
||||
|
||||
case DRAW_GLOBAL_LABEL_STRUCT_TYPE:
|
||||
newitem = new DrawGlobalLabelStruct( m_Pos, m_Text );
|
||||
case TYPE_SCH_GLOBALLABEL:
|
||||
newitem = new SCH_GLOBALLABEL( m_Pos, m_Text );
|
||||
break;
|
||||
|
||||
case DRAW_HIER_LABEL_STRUCT_TYPE:
|
||||
newitem = new DrawHierLabelStruct( m_Pos, m_Text );
|
||||
case TYPE_SCH_HIERLABEL:
|
||||
newitem = new SCH_HIERLABEL( m_Pos, m_Text );
|
||||
break;
|
||||
|
||||
case DRAW_LABEL_STRUCT_TYPE:
|
||||
newitem = new DrawLabelStruct( m_Pos, m_Text );
|
||||
case TYPE_SCH_LABEL:
|
||||
newitem = new SCH_LABEL( m_Pos, m_Text );
|
||||
break;
|
||||
}
|
||||
|
||||
|
@ -77,7 +77,7 @@ DrawTextStruct* DrawTextStruct::GenCopy()
|
|||
|
||||
|
||||
/********************************************************/
|
||||
void DrawTextStruct::SwapData( DrawTextStruct* copyitem )
|
||||
void SCH_TEXT::SwapData( SCH_TEXT* copyitem )
|
||||
/********************************************************/
|
||||
{
|
||||
EXCHG( m_Text, copyitem->m_Text );
|
||||
|
@ -95,20 +95,20 @@ void DrawTextStruct::SwapData( DrawTextStruct* copyitem )
|
|||
|
||||
|
||||
/***************************************************************/
|
||||
void DrawTextStruct::Place( WinEDA_DrawFrame* frame, wxDC* DC )
|
||||
void SCH_TEXT::Place( WinEDA_DrawFrame* frame, wxDC* DC )
|
||||
/***************************************************************/
|
||||
{
|
||||
/* save old text in undo list */
|
||||
if( g_ItemToUndoCopy && ( (m_Flags & IS_NEW) == 0 ) )
|
||||
{
|
||||
/* restore old values and save new ones */
|
||||
SwapData( (DrawTextStruct*) g_ItemToUndoCopy );
|
||||
SwapData( (SCH_TEXT*) g_ItemToUndoCopy );
|
||||
|
||||
/* save in undo list */
|
||||
( (WinEDA_SchematicFrame*) frame )->SaveCopyInUndoList( this, IS_CHANGED );
|
||||
|
||||
/* restore new values */
|
||||
SwapData( (DrawTextStruct*) g_ItemToUndoCopy );
|
||||
SwapData( (SCH_TEXT*) g_ItemToUndoCopy );
|
||||
|
||||
SAFE_DELETE( g_ItemToUndoCopy );
|
||||
}
|
||||
|
@ -118,8 +118,8 @@ void DrawTextStruct::Place( WinEDA_DrawFrame* frame, wxDC* DC )
|
|||
|
||||
|
||||
/****************************************************************************/
|
||||
DrawLabelStruct::DrawLabelStruct( const wxPoint& pos, const wxString& text ) :
|
||||
DrawTextStruct( pos, text, DRAW_LABEL_STRUCT_TYPE )
|
||||
SCH_LABEL::SCH_LABEL( const wxPoint& pos, const wxString& text ) :
|
||||
SCH_TEXT( pos, text, TYPE_SCH_LABEL )
|
||||
/****************************************************************************/
|
||||
{
|
||||
m_Layer = LAYER_LOCLABEL;
|
||||
|
@ -129,8 +129,8 @@ DrawLabelStruct::DrawLabelStruct( const wxPoint& pos, const wxString& text ) :
|
|||
|
||||
|
||||
/***********************************************************************************/
|
||||
DrawGlobalLabelStruct::DrawGlobalLabelStruct( const wxPoint& pos, const wxString& text ) :
|
||||
DrawTextStruct( pos, text, DRAW_GLOBAL_LABEL_STRUCT_TYPE )
|
||||
SCH_GLOBALLABEL::SCH_GLOBALLABEL( const wxPoint& pos, const wxString& text ) :
|
||||
SCH_TEXT( pos, text, TYPE_SCH_GLOBALLABEL )
|
||||
/***********************************************************************************/
|
||||
{
|
||||
m_Layer = LAYER_GLOBLABEL;
|
||||
|
@ -140,8 +140,8 @@ DrawGlobalLabelStruct::DrawGlobalLabelStruct( const wxPoint& pos, const wxString
|
|||
|
||||
|
||||
/***********************************************************************************/
|
||||
DrawHierLabelStruct::DrawHierLabelStruct( const wxPoint& pos, const wxString& text ) :
|
||||
DrawTextStruct( pos, text, DRAW_HIER_LABEL_STRUCT_TYPE )
|
||||
SCH_HIERLABEL::SCH_HIERLABEL( const wxPoint& pos, const wxString& text ) :
|
||||
SCH_TEXT( pos, text, TYPE_SCH_HIERLABEL )
|
||||
/***********************************************************************************/
|
||||
{
|
||||
m_Layer = LAYER_HIERLABEL;
|
||||
|
@ -151,7 +151,7 @@ DrawHierLabelStruct::DrawHierLabelStruct( const wxPoint& pos, const wxString& te
|
|||
|
||||
|
||||
/*******************************************************************************************/
|
||||
void DrawTextStruct::Draw( WinEDA_DrawPanel* panel, wxDC* DC, const wxPoint& offset,
|
||||
void SCH_TEXT::Draw( WinEDA_DrawPanel* panel, wxDC* DC, const wxPoint& offset,
|
||||
int DrawMode, int Color )
|
||||
/*******************************************************************************************/
|
||||
|
||||
|
@ -211,16 +211,16 @@ void DrawTextStruct::Draw( WinEDA_DrawPanel* panel, wxDC* DC, const wxPoint& off
|
|||
|
||||
|
||||
/*********************************************************************************************/
|
||||
void DrawLabelStruct::Draw( WinEDA_DrawPanel* panel, wxDC* DC, const wxPoint& offset,
|
||||
void SCH_LABEL::Draw( WinEDA_DrawPanel* panel, wxDC* DC, const wxPoint& offset,
|
||||
int DrawMode, int Color )
|
||||
/*********************************************************************************************/
|
||||
{
|
||||
DrawTextStruct::Draw( panel, DC, offset, DrawMode, Color );
|
||||
SCH_TEXT::Draw( panel, DC, offset, DrawMode, Color );
|
||||
}
|
||||
|
||||
|
||||
/*******************************************************************************************/
|
||||
void DrawHierLabelStruct::Draw( WinEDA_DrawPanel* panel, wxDC* DC, const wxPoint& offset,
|
||||
void SCH_HIERLABEL::Draw( WinEDA_DrawPanel* panel, wxDC* DC, const wxPoint& offset,
|
||||
int DrawMode, int Color )
|
||||
/******************************************************************************************/
|
||||
|
||||
|
@ -288,7 +288,7 @@ void DrawHierLabelStruct::Draw( WinEDA_DrawPanel* panel, wxDC* DC, const wxPoint
|
|||
* format list is
|
||||
* corner_count, x0, y0, ... xn, yn
|
||||
*/
|
||||
void DrawHierLabelStruct::CreateGraphicShape( int* corner_list, const wxPoint& Pos )
|
||||
void SCH_HIERLABEL::CreateGraphicShape( int* corner_list, const wxPoint& Pos )
|
||||
{
|
||||
int* Template = TemplateShape[m_Shape][m_Orient];
|
||||
int HalfSize = m_Size.x / 2;
|
||||
|
@ -307,7 +307,7 @@ void DrawHierLabelStruct::CreateGraphicShape( int* corner_list, const wxPoint& P
|
|||
|
||||
|
||||
/*******************************************************************************************/
|
||||
void DrawGlobalLabelStruct::Draw( WinEDA_DrawPanel* panel, wxDC* DC, const wxPoint& draw_offset,
|
||||
void SCH_GLOBALLABEL::Draw( WinEDA_DrawPanel* panel, wxDC* DC, const wxPoint& draw_offset,
|
||||
int DrawMode, int Color )
|
||||
/******************************************************************************************/
|
||||
|
||||
|
@ -392,7 +392,7 @@ void DrawGlobalLabelStruct::Draw( WinEDA_DrawPanel* panel, wxDC* DC, const wxPoi
|
|||
* format list is
|
||||
* <corner_count>, x0, y0, ... xn, yn
|
||||
*/
|
||||
void DrawGlobalLabelStruct::CreateGraphicShape( int* corner_list, const wxPoint& Pos )
|
||||
void SCH_GLOBALLABEL::CreateGraphicShape( int* corner_list, const wxPoint& Pos )
|
||||
{
|
||||
int HalfSize = m_Size.x / 2;
|
||||
int width = MAX( m_Width, g_DrawMinimunLineWidth );
|
||||
|
|
|
@ -76,7 +76,7 @@ int* TemplateShape[5][4] =
|
|||
extern int* TemplateShape[5][4];
|
||||
#endif
|
||||
|
||||
class DrawTextStruct : public EDA_BaseStruct
|
||||
class SCH_TEXT : public SCH_ITEM
|
||||
, public EDA_TextStruct
|
||||
{
|
||||
public:
|
||||
|
@ -85,31 +85,31 @@ public:
|
|||
bool m_IsDangling; // TRUE si non connect<63>
|
||||
|
||||
public:
|
||||
DrawTextStruct( const wxPoint& pos = wxPoint( 0, 0 ), const wxString& text = wxEmptyString,
|
||||
KICAD_T aType = DRAW_TEXT_STRUCT_TYPE );
|
||||
~DrawTextStruct() { }
|
||||
SCH_TEXT( const wxPoint& pos = wxPoint( 0, 0 ), const wxString& text = wxEmptyString,
|
||||
KICAD_T aType = TYPE_SCH_TEXT );
|
||||
~SCH_TEXT() { }
|
||||
|
||||
virtual wxString GetClass() const
|
||||
{
|
||||
return wxT( "DrawText" );
|
||||
return wxT( "SCH_TEXT" );
|
||||
}
|
||||
|
||||
|
||||
DrawTextStruct* GenCopy();
|
||||
SCH_TEXT* GenCopy();
|
||||
virtual void Draw( WinEDA_DrawPanel* panel, wxDC* DC, const wxPoint& offset, int draw_mode,
|
||||
int Color = -1 );
|
||||
|
||||
void SwapData( DrawTextStruct* copyitem );
|
||||
void SwapData( SCH_TEXT* copyitem );
|
||||
|
||||
virtual void Place( WinEDA_DrawFrame* frame, wxDC* DC );
|
||||
};
|
||||
|
||||
|
||||
class DrawLabelStruct : public DrawTextStruct
|
||||
class SCH_LABEL : public SCH_TEXT
|
||||
{
|
||||
public:
|
||||
DrawLabelStruct( const wxPoint& pos = wxPoint( 0, 0 ), const wxString& text = wxEmptyString );
|
||||
~DrawLabelStruct() { }
|
||||
SCH_LABEL( const wxPoint& pos = wxPoint( 0, 0 ), const wxString& text = wxEmptyString );
|
||||
~SCH_LABEL() { }
|
||||
virtual void Draw( WinEDA_DrawPanel* panel, wxDC* DC, const wxPoint& offset, int draw_mode,
|
||||
int Color = -1 );
|
||||
|
||||
|
@ -120,12 +120,12 @@ public:
|
|||
};
|
||||
|
||||
|
||||
class DrawGlobalLabelStruct : public DrawTextStruct
|
||||
class SCH_GLOBALLABEL : public SCH_TEXT
|
||||
{
|
||||
public:
|
||||
DrawGlobalLabelStruct( const wxPoint& pos = wxPoint( 0, 0 ),
|
||||
SCH_GLOBALLABEL( const wxPoint& pos = wxPoint( 0, 0 ),
|
||||
const wxString& text = wxEmptyString );
|
||||
~DrawGlobalLabelStruct() { }
|
||||
~SCH_GLOBALLABEL() { }
|
||||
virtual void Draw( WinEDA_DrawPanel* panel, wxDC* DC, const wxPoint& offset, int draw_mode,
|
||||
int Color = -1 );
|
||||
|
||||
|
@ -147,12 +147,12 @@ public:
|
|||
|
||||
|
||||
|
||||
class DrawHierLabelStruct : public DrawTextStruct
|
||||
class SCH_HIERLABEL : public SCH_TEXT
|
||||
{
|
||||
public:
|
||||
DrawHierLabelStruct( const wxPoint& pos = wxPoint( 0, 0 ),
|
||||
SCH_HIERLABEL( const wxPoint& pos = wxPoint( 0, 0 ),
|
||||
const wxString& text = wxEmptyString );
|
||||
~DrawHierLabelStruct() { }
|
||||
~SCH_HIERLABEL() { }
|
||||
virtual void Draw( WinEDA_DrawPanel* panel, wxDC* DC, const wxPoint& offset, int draw_mode,
|
||||
int Color = -1 );
|
||||
|
||||
|
|
|
@ -105,14 +105,14 @@ void BreakSegmentOnJunction( SCH_SCREEN* Screen )
|
|||
|
||||
case DRAW_SEGMENT_STRUCT_TYPE:
|
||||
case DRAW_NOCONNECT_STRUCT_TYPE:
|
||||
case DRAW_LABEL_STRUCT_TYPE:
|
||||
case DRAW_GLOBAL_LABEL_STRUCT_TYPE:
|
||||
case DRAW_HIER_LABEL_STRUCT_TYPE:
|
||||
case DRAW_LIB_ITEM_STRUCT_TYPE:
|
||||
case TYPE_SCH_LABEL:
|
||||
case TYPE_SCH_GLOBALLABEL:
|
||||
case TYPE_SCH_HIERLABEL:
|
||||
case TYPE_SCH_COMPONENT:
|
||||
case DRAW_PICK_ITEM_STRUCT_TYPE:
|
||||
case DRAW_POLYLINE_STRUCT_TYPE:
|
||||
case DRAW_MARKER_STRUCT_TYPE:
|
||||
case DRAW_TEXT_STRUCT_TYPE:
|
||||
case TYPE_SCH_TEXT:
|
||||
case DRAW_SHEET_STRUCT_TYPE:
|
||||
case DRAW_SHEETLABEL_STRUCT_TYPE:
|
||||
break;
|
||||
|
|
|
@ -269,7 +269,7 @@ EDA_Rect DrawJunctionStruct::GetBoundingBox()
|
|||
};
|
||||
|
||||
|
||||
EDA_Rect EDA_SchComponentStruct::GetBoundingBox()
|
||||
EDA_Rect SCH_COMPONENT::GetBoundingBox()
|
||||
{
|
||||
const int PADDING = 40;
|
||||
|
||||
|
|
|
@ -22,28 +22,9 @@
|
|||
WX_DEFINE_OBJARRAY( ArrayOfSheetLists );
|
||||
|
||||
/***************************/
|
||||
/* class DrawPartStruct */
|
||||
/* class EDA_SchComponentStruct */
|
||||
/* class SCH_COMPONENT */
|
||||
/***************************/
|
||||
|
||||
/***********************************************************************************/
|
||||
DrawPartStruct::DrawPartStruct( KICAD_T struct_type, const wxPoint& pos ) :
|
||||
EDA_BaseStruct( struct_type )
|
||||
/***********************************************************************************/
|
||||
{
|
||||
m_Layer = 0;
|
||||
m_Pos = pos;
|
||||
m_TimeStamp = 0;
|
||||
}
|
||||
|
||||
|
||||
/************************************/
|
||||
DrawPartStruct::~DrawPartStruct()
|
||||
/************************************/
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
/****************************************************************/
|
||||
const wxString& ReturnDefaultFieldName( int aFieldNdx )
|
||||
/****************************************************************/
|
||||
|
@ -78,7 +59,7 @@ const wxString& ReturnDefaultFieldName( int aFieldNdx )
|
|||
|
||||
|
||||
/****************************************************************/
|
||||
const wxString& EDA_SchComponentStruct::ReturnFieldName( int aFieldNdx ) const
|
||||
const wxString& SCH_COMPONENT::ReturnFieldName( int aFieldNdx ) const
|
||||
/****************************************************************/
|
||||
|
||||
/* Return the Field name from its index (REFERENCE, VALUE ..)
|
||||
|
@ -94,7 +75,7 @@ const wxString& EDA_SchComponentStruct::ReturnFieldName( int aFieldNdx ) const
|
|||
|
||||
|
||||
/****************************************************************/
|
||||
wxString EDA_SchComponentStruct::GetPath( DrawSheetPath* sheet )
|
||||
wxString SCH_COMPONENT::GetPath( DrawSheetPath* sheet )
|
||||
/****************************************************************/
|
||||
{
|
||||
wxString str;
|
||||
|
@ -105,7 +86,7 @@ wxString EDA_SchComponentStruct::GetPath( DrawSheetPath* sheet )
|
|||
|
||||
|
||||
/********************************************************************/
|
||||
const wxString EDA_SchComponentStruct::GetRef( DrawSheetPath* sheet )
|
||||
const wxString SCH_COMPONENT::GetRef( DrawSheetPath* sheet )
|
||||
/********************************************************************/
|
||||
{
|
||||
wxString path = GetPath( sheet );
|
||||
|
@ -137,7 +118,7 @@ const wxString EDA_SchComponentStruct::GetRef( DrawSheetPath* sheet )
|
|||
|
||||
|
||||
/***********************************************************************/
|
||||
void EDA_SchComponentStruct::SetRef( DrawSheetPath* sheet, wxString ref )
|
||||
void SCH_COMPONENT::SetRef( DrawSheetPath* sheet, wxString ref )
|
||||
/***********************************************************************/
|
||||
{
|
||||
//check to see if it is already there before inserting it
|
||||
|
@ -176,7 +157,7 @@ void EDA_SchComponentStruct::SetRef( DrawSheetPath* sheet, wxString ref )
|
|||
|
||||
|
||||
/**************************************/
|
||||
void EDA_SchComponentStruct::ClearRefs()
|
||||
void SCH_COMPONENT::ClearRefs()
|
||||
/**************************************/
|
||||
{
|
||||
m_Paths.Empty();
|
||||
|
@ -184,7 +165,7 @@ void EDA_SchComponentStruct::ClearRefs()
|
|||
}
|
||||
|
||||
|
||||
const wxString& EDA_SchComponentStruct::GetFieldValue( int aFieldNdx ) const
|
||||
const wxString& SCH_COMPONENT::GetFieldValue( int aFieldNdx ) const
|
||||
{
|
||||
// avoid unnecessarily copying wxStrings.
|
||||
static const wxString myEmpty = wxEmptyString;
|
||||
|
@ -197,14 +178,16 @@ const wxString& EDA_SchComponentStruct::GetFieldValue( int aFieldNdx ) const
|
|||
|
||||
|
||||
/*******************************************************************/
|
||||
EDA_SchComponentStruct::EDA_SchComponentStruct( const wxPoint& pos ) :
|
||||
DrawPartStruct( DRAW_LIB_ITEM_STRUCT_TYPE, pos )
|
||||
SCH_COMPONENT::SCH_COMPONENT( const wxPoint& aPos ) :
|
||||
SCH_ITEM( NULL, TYPE_SCH_COMPONENT )
|
||||
/*******************************************************************/
|
||||
{
|
||||
int ii;
|
||||
|
||||
m_Multi = 0; /* In multi unit chip - which unit to draw. */
|
||||
|
||||
m_Pos = aPos;
|
||||
|
||||
//m_FlagControlMulti = 0;
|
||||
m_UsedOnSheets.Clear();
|
||||
m_Convert = 0; /* Gestion des mutiples representations (conversion De Morgan) */
|
||||
|
@ -234,7 +217,7 @@ EDA_SchComponentStruct::EDA_SchComponentStruct( const wxPoint& pos ) :
|
|||
|
||||
|
||||
/************************************************/
|
||||
EDA_Rect EDA_SchComponentStruct::GetBoundaryBox() const
|
||||
EDA_Rect SCH_COMPONENT::GetBoundaryBox() const
|
||||
/************************************************/
|
||||
{
|
||||
EDA_LibComponentStruct* Entry = FindLibPart( m_ChipName.GetData(), wxEmptyString, FIND_ROOT );
|
||||
|
@ -309,7 +292,7 @@ void PartTextStruct::SwapData( PartTextStruct* copyitem )
|
|||
|
||||
|
||||
/**************************************************************************/
|
||||
void EDA_SchComponentStruct::SwapData( EDA_SchComponentStruct* copyitem )
|
||||
void SCH_COMPONENT::SwapData( SCH_COMPONENT* copyitem )
|
||||
/**************************************************************************/
|
||||
|
||||
/* Used if undo / redo command:
|
||||
|
@ -332,7 +315,7 @@ void EDA_SchComponentStruct::SwapData( EDA_SchComponentStruct* copyitem )
|
|||
|
||||
|
||||
/***********************************************************************/
|
||||
void EDA_SchComponentStruct::Place( WinEDA_DrawFrame* frame, wxDC* DC )
|
||||
void SCH_COMPONENT::Place( WinEDA_DrawFrame* frame, wxDC* DC )
|
||||
/***********************************************************************/
|
||||
{
|
||||
/* save old text in undo list */
|
||||
|
@ -341,13 +324,13 @@ void EDA_SchComponentStruct::Place( WinEDA_DrawFrame* frame, wxDC* DC )
|
|||
&& ( (m_Flags & IS_NEW) == 0 ) )
|
||||
{
|
||||
/* restore old values and save new ones */
|
||||
SwapData( (EDA_SchComponentStruct*) g_ItemToUndoCopy );
|
||||
SwapData( (SCH_COMPONENT*) g_ItemToUndoCopy );
|
||||
|
||||
/* save in undo list */
|
||||
( (WinEDA_SchematicFrame*) frame )->SaveCopyInUndoList( this, IS_CHANGED );
|
||||
|
||||
/* restore new values */
|
||||
SwapData( (EDA_SchComponentStruct*) g_ItemToUndoCopy );
|
||||
SwapData( (SCH_COMPONENT*) g_ItemToUndoCopy );
|
||||
|
||||
SAFE_DELETE( g_ItemToUndoCopy );
|
||||
}
|
||||
|
@ -357,7 +340,7 @@ void EDA_SchComponentStruct::Place( WinEDA_DrawFrame* frame, wxDC* DC )
|
|||
|
||||
|
||||
/***************************************************/
|
||||
void EDA_SchComponentStruct::ClearAnnotation()
|
||||
void SCH_COMPONENT::ClearAnnotation()
|
||||
/***************************************************/
|
||||
|
||||
/* Suppress annotation ( i.i IC23 changed to IC? and part reset to 1)
|
||||
|
@ -386,10 +369,10 @@ void EDA_SchComponentStruct::ClearAnnotation()
|
|||
|
||||
|
||||
/**************************************************************/
|
||||
EDA_SchComponentStruct* EDA_SchComponentStruct::GenCopy()
|
||||
SCH_COMPONENT* SCH_COMPONENT::GenCopy()
|
||||
/**************************************************************/
|
||||
{
|
||||
EDA_SchComponentStruct* new_item = new EDA_SchComponentStruct( m_Pos );
|
||||
SCH_COMPONENT* new_item = new SCH_COMPONENT( m_Pos );
|
||||
|
||||
int ii;
|
||||
|
||||
|
@ -418,7 +401,7 @@ EDA_SchComponentStruct* EDA_SchComponentStruct::GenCopy()
|
|||
|
||||
|
||||
/*****************************************************************/
|
||||
void EDA_SchComponentStruct::SetRotationMiroir( int type_rotate )
|
||||
void SCH_COMPONENT::SetRotationMiroir( int type_rotate )
|
||||
/******************************************************************/
|
||||
|
||||
/* Compute the new matrix transform for a schematic component
|
||||
|
@ -561,7 +544,7 @@ void EDA_SchComponentStruct::SetRotationMiroir( int type_rotate )
|
|||
|
||||
|
||||
/****************************************************/
|
||||
int EDA_SchComponentStruct::GetRotationMiroir()
|
||||
int SCH_COMPONENT::GetRotationMiroir()
|
||||
/****************************************************/
|
||||
{
|
||||
int type_rotate = CMP_ORIENT_0;
|
||||
|
@ -626,7 +609,7 @@ int EDA_SchComponentStruct::GetRotationMiroir()
|
|||
|
||||
|
||||
/***********************************************************************/
|
||||
wxPoint EDA_SchComponentStruct::GetScreenCoord( const wxPoint& coord )
|
||||
wxPoint SCH_COMPONENT::GetScreenCoord( const wxPoint& coord )
|
||||
/***********************************************************************/
|
||||
|
||||
/* Renvoie la coordonn<6E>e du point coord, en fonction de l'orientation
|
||||
|
@ -651,7 +634,7 @@ wxPoint EDA_SchComponentStruct::GetScreenCoord( const wxPoint& coord )
|
|||
* of nesting of this object within the overall tree.
|
||||
* @param os The ostream& to output to.
|
||||
*/
|
||||
void EDA_SchComponentStruct::Show( int nestLevel, std::ostream& os )
|
||||
void SCH_COMPONENT::Show( int nestLevel, std::ostream& os )
|
||||
{
|
||||
// for now, make it look like XML:
|
||||
NestedSpace( nestLevel, os ) << '<' << GetClass().Lower().mb_str() <<
|
||||
|
@ -748,7 +731,7 @@ EDA_Rect PartTextStruct::GetBoundaryBox() const
|
|||
int orient;
|
||||
int dx, dy, x1, y1, x2, y2;
|
||||
|
||||
EDA_SchComponentStruct* DrawLibItem = (EDA_SchComponentStruct*) m_Parent;
|
||||
SCH_COMPONENT* DrawLibItem = (SCH_COMPONENT*) m_Parent;
|
||||
|
||||
orient = m_Orient;
|
||||
wxPoint pos = DrawLibItem->m_Pos;
|
||||
|
|
|
@ -65,36 +65,22 @@ public:
|
|||
};
|
||||
|
||||
|
||||
/* the class DrawPartStruct describes a basic virtual component
|
||||
* Not used directly:
|
||||
* used classes are EDA_SchComponentStruct (the "classic" schematic component, below)
|
||||
* and the Pseudo component DrawSheetStruct
|
||||
*/
|
||||
class DrawPartStruct : public EDA_BaseStruct
|
||||
{
|
||||
public:
|
||||
int m_Layer;
|
||||
wxString m_ChipName; /* Key to look for in the library, i.e. "74LS00". */
|
||||
PartTextStruct m_Field[NUMBER_OF_FIELDS];
|
||||
wxPoint m_Pos; /* Exact position of part. */
|
||||
|
||||
public:
|
||||
DrawPartStruct( KICAD_T struct_type, const wxPoint& pos );
|
||||
~DrawPartStruct();
|
||||
|
||||
virtual wxString GetClass() const
|
||||
{
|
||||
return wxT( "DrawPart" );
|
||||
}
|
||||
};
|
||||
|
||||
WX_DECLARE_OBJARRAY( DrawSheetPath, ArrayOfSheetLists );
|
||||
/* the class EDA_SchComponentStruct describes a real component */
|
||||
class EDA_SchComponentStruct : public DrawPartStruct
|
||||
|
||||
/**
|
||||
* Class SCH_COMPONENT
|
||||
* describes a real schematic component
|
||||
*/
|
||||
class SCH_COMPONENT : public SCH_ITEM
|
||||
{
|
||||
public:
|
||||
int m_Multi; /* In multi unit chip - which unit to draw. */
|
||||
|
||||
wxPoint m_Pos;
|
||||
|
||||
wxString m_ChipName; /* Key to look for in the library, i.e. "74LS00". */
|
||||
PartTextStruct m_Field[NUMBER_OF_FIELDS];
|
||||
|
||||
//int m_FlagControlMulti;
|
||||
ArrayOfSheetLists m_UsedOnSheets;
|
||||
int m_Convert; /* Gestion (management) des mutiples representations (ex: conversion De Morgan) */
|
||||
|
@ -108,16 +94,16 @@ public:
|
|||
* determined, upon file load, by the first non-digits in the reference fields. */
|
||||
|
||||
public:
|
||||
EDA_SchComponentStruct( const wxPoint& pos = wxPoint( 0, 0 ) );
|
||||
~EDA_SchComponentStruct( void ) { }
|
||||
SCH_COMPONENT( const wxPoint& pos = wxPoint( 0, 0 ) );
|
||||
~SCH_COMPONENT() { }
|
||||
|
||||
virtual wxString GetClass() const
|
||||
{
|
||||
return wxT( "EDA_SchComponent" );
|
||||
return wxT( "SCH_COMPONENT" );
|
||||
}
|
||||
|
||||
|
||||
EDA_SchComponentStruct* GenCopy();
|
||||
SCH_COMPONENT* GenCopy();
|
||||
void SetRotationMiroir( int type );
|
||||
int GetRotationMiroir();
|
||||
wxPoint GetScreenCoord( const wxPoint& coord );
|
||||
|
@ -143,7 +129,7 @@ public:
|
|||
const wxPoint& offset,
|
||||
int draw_mode,
|
||||
int Color = -1 );
|
||||
void SwapData( EDA_SchComponentStruct* copyitem );
|
||||
void SwapData( SCH_COMPONENT* copyitem );
|
||||
|
||||
virtual void Place( WinEDA_DrawFrame* frame, wxDC* DC );
|
||||
|
||||
|
|
|
@ -42,7 +42,7 @@ SchematicGeneralLocateAndDisplay( bool IncludePin )
|
|||
wxString msg;
|
||||
wxPoint mouse_position = GetScreen()->m_MousePosition;
|
||||
LibDrawPin* Pin = NULL;
|
||||
EDA_SchComponentStruct* LibItem = NULL;
|
||||
SCH_COMPONENT* LibItem = NULL;
|
||||
|
||||
DrawStruct = SchematicGeneralLocateAndDisplay( mouse_position, IncludePin );
|
||||
if( !DrawStruct && ( mouse_position != GetScreen()->m_Curseur) )
|
||||
|
@ -57,15 +57,15 @@ SchematicGeneralLocateAndDisplay( bool IncludePin )
|
|||
{
|
||||
case DRAW_PART_TEXT_STRUCT_TYPE:
|
||||
case COMPONENT_FIELD_DRAW_TYPE:
|
||||
LibItem = (EDA_SchComponentStruct*) DrawStruct->m_Parent;
|
||||
LibItem = (SCH_COMPONENT*) DrawStruct->m_Parent;
|
||||
SendMessageToPCBNEW( DrawStruct,LibItem );
|
||||
break;
|
||||
|
||||
case DRAW_LIB_ITEM_STRUCT_TYPE:
|
||||
case TYPE_SCH_COMPONENT:
|
||||
Pin = LocateAnyPin( GetScreen()->EEDrawList, GetScreen()->m_Curseur, &LibItem );
|
||||
if( Pin )
|
||||
break; // Priority is probing a pin first
|
||||
LibItem = (EDA_SchComponentStruct*) DrawStruct;
|
||||
LibItem = (SCH_COMPONENT*) DrawStruct;
|
||||
SendMessageToPCBNEW( DrawStruct, LibItem );
|
||||
break;
|
||||
|
||||
|
@ -118,7 +118,7 @@ SchematicGeneralLocateAndDisplay( const wxPoint& refpoint, bool IncludePin )
|
|||
{
|
||||
EDA_BaseStruct* DrawStruct;
|
||||
LibDrawPin* Pin;
|
||||
EDA_SchComponentStruct* LibItem;
|
||||
SCH_COMPONENT* LibItem;
|
||||
wxString Text;
|
||||
wxString msg;
|
||||
int ii;
|
||||
|
@ -175,7 +175,7 @@ SchematicGeneralLocateAndDisplay( const wxPoint& refpoint, bool IncludePin )
|
|||
if( DrawStruct )
|
||||
{
|
||||
PartTextStruct* Field = (PartTextStruct*) DrawStruct;
|
||||
LibItem = (EDA_SchComponentStruct*) Field->m_Parent;
|
||||
LibItem = (SCH_COMPONENT*) Field->m_Parent;
|
||||
LibItem->Display_Infos( this );
|
||||
|
||||
return DrawStruct;
|
||||
|
@ -199,7 +199,7 @@ SchematicGeneralLocateAndDisplay( const wxPoint& refpoint, bool IncludePin )
|
|||
if( DrawStruct )
|
||||
{
|
||||
DrawStruct = LocateSmallestComponent( (SCH_SCREEN*)GetScreen() );
|
||||
LibItem = (EDA_SchComponentStruct*) DrawStruct;
|
||||
LibItem = (SCH_COMPONENT*) DrawStruct;
|
||||
LibItem->Display_Infos( this );
|
||||
return DrawStruct;
|
||||
}
|
||||
|
|
|
@ -86,7 +86,7 @@ void RemoteCommand( const char* cmdline )
|
|||
|
||||
/*****************************************************************************/
|
||||
void WinEDA_SchematicFrame::SendMessageToPCBNEW( EDA_BaseStruct* objectToSync,
|
||||
EDA_SchComponentStruct* LibItem )
|
||||
SCH_COMPONENT* LibItem )
|
||||
/*****************************************************************************/
|
||||
|
||||
/** Send a remote command to eeschema via a socket,
|
||||
|
@ -116,8 +116,8 @@ void WinEDA_SchematicFrame::SendMessageToPCBNEW( EDA_BaseStruct* objectT
|
|||
}
|
||||
break;
|
||||
|
||||
case DRAW_LIB_ITEM_STRUCT_TYPE:
|
||||
LibItem = (EDA_SchComponentStruct*) objectToSync;
|
||||
case TYPE_SCH_COMPONENT:
|
||||
LibItem = (SCH_COMPONENT*) objectToSync;
|
||||
sprintf( Line, "$PART: %s", CONV_TO_UTF8( LibItem->m_Field[REFERENCE].m_Text ) );
|
||||
SendCommand( MSG_TO_PCB, Line );
|
||||
break;
|
||||
|
|
|
@ -47,7 +47,7 @@ DanglingEndHandle* ItemList;
|
|||
|
||||
static void TestWireForDangling( EDA_DrawLineStruct* DrawRef,
|
||||
WinEDA_SchematicFrame* frame, wxDC* DC );
|
||||
void TestLabelForDangling( DrawTextStruct* label,
|
||||
void TestLabelForDangling( SCH_TEXT* label,
|
||||
WinEDA_SchematicFrame* frame, wxDC* DC );
|
||||
DanglingEndHandle* RebuildEndList( EDA_BaseStruct* DrawList );
|
||||
|
||||
|
@ -111,11 +111,11 @@ void WinEDA_SchematicFrame::TestDanglingEnds( EDA_BaseStruct* DrawList, wxDC* DC
|
|||
{
|
||||
switch( DrawItem->Type() )
|
||||
{
|
||||
case DRAW_GLOBAL_LABEL_STRUCT_TYPE:
|
||||
case DRAW_HIER_LABEL_STRUCT_TYPE:
|
||||
case DRAW_LABEL_STRUCT_TYPE:
|
||||
case TYPE_SCH_GLOBALLABEL:
|
||||
case TYPE_SCH_HIERLABEL:
|
||||
case TYPE_SCH_LABEL:
|
||||
#undef STRUCT
|
||||
#define STRUCT ( (DrawLabelStruct*) DrawItem )
|
||||
#define STRUCT ( (SCH_LABEL*) DrawItem )
|
||||
TestLabelForDangling( STRUCT, this, DC );
|
||||
break;
|
||||
break;
|
||||
|
@ -155,7 +155,7 @@ LibDrawPin* WinEDA_SchematicFrame::LocatePinEnd( EDA_BaseStruct* DrawList,
|
|||
* NULL sinon
|
||||
*/
|
||||
{
|
||||
EDA_SchComponentStruct* DrawLibItem;
|
||||
SCH_COMPONENT* DrawLibItem;
|
||||
LibDrawPin* Pin;
|
||||
wxPoint pinpos;
|
||||
|
||||
|
@ -223,7 +223,7 @@ void TestWireForDangling( EDA_DrawLineStruct* DrawRef,
|
|||
|
||||
|
||||
/********************************************************/
|
||||
void TestLabelForDangling( DrawTextStruct* label,
|
||||
void TestLabelForDangling( SCH_TEXT* label,
|
||||
WinEDA_SchematicFrame* frame, wxDC* DC )
|
||||
/********************************************************/
|
||||
{
|
||||
|
@ -281,7 +281,7 @@ void TestLabelForDangling( DrawTextStruct* label,
|
|||
|
||||
/****************************************************/
|
||||
wxPoint ReturnPinPhysicalPosition( LibDrawPin* Pin,
|
||||
EDA_SchComponentStruct* DrawLibItem )
|
||||
SCH_COMPONENT* DrawLibItem )
|
||||
/****************************************************/
|
||||
|
||||
/* Retourne la position physique de la pin, qui d<>pend de l'orientation
|
||||
|
@ -316,13 +316,13 @@ DanglingEndHandle* RebuildEndList( EDA_BaseStruct* DrawList )
|
|||
{
|
||||
switch( DrawItem->Type() )
|
||||
{
|
||||
case DRAW_LABEL_STRUCT_TYPE:
|
||||
case TYPE_SCH_LABEL:
|
||||
break;
|
||||
|
||||
case DRAW_GLOBAL_LABEL_STRUCT_TYPE:
|
||||
case DRAW_HIER_LABEL_STRUCT_TYPE:
|
||||
case TYPE_SCH_GLOBALLABEL:
|
||||
case TYPE_SCH_HIERLABEL:
|
||||
#undef STRUCT
|
||||
#define STRUCT ( (DrawLabelStruct*) DrawItem )
|
||||
#define STRUCT ( (SCH_LABEL*) DrawItem )
|
||||
item = new DanglingEndHandle( LABEL_END );
|
||||
|
||||
item->m_Item = DrawItem;
|
||||
|
@ -395,10 +395,10 @@ DanglingEndHandle* RebuildEndList( EDA_BaseStruct* DrawList )
|
|||
lastitem = item;
|
||||
break;
|
||||
|
||||
case DRAW_LIB_ITEM_STRUCT_TYPE:
|
||||
case TYPE_SCH_COMPONENT:
|
||||
{
|
||||
#undef STRUCT
|
||||
#define STRUCT ( (EDA_SchComponentStruct*) DrawItem )
|
||||
#define STRUCT ( (SCH_COMPONENT*) DrawItem )
|
||||
EDA_LibComponentStruct* Entry;
|
||||
Entry = FindLibPart( STRUCT->m_ChipName, wxEmptyString, FIND_ROOT );
|
||||
if( Entry == NULL )
|
||||
|
|
|
@ -280,10 +280,10 @@ void WinEDA_SchematicFrame::DeleteConnection( wxDC* DC, bool DeleteFullConnectio
|
|||
if( DelStruct->m_Flags & STRUCT_DELETED )
|
||||
continue;
|
||||
|
||||
if( DelStruct->Type() != DRAW_LABEL_STRUCT_TYPE )
|
||||
if( DelStruct->Type() != TYPE_SCH_LABEL )
|
||||
continue;
|
||||
|
||||
GetScreen()->m_Curseur = ( (DrawTextStruct*) DelStruct )->m_Pos;
|
||||
GetScreen()->m_Curseur = ( (SCH_TEXT*) DelStruct )->m_Pos;
|
||||
EDA_BaseStruct* TstStruct =
|
||||
PickStruct( GetScreen()->m_Curseur, GetScreen(), WIREITEM | BUSITEM );
|
||||
|
||||
|
|
|
@ -845,7 +845,7 @@ int GenListeCmp( ListComponent* List )
|
|||
{
|
||||
int ItemCount = 0;
|
||||
EDA_BaseStruct* DrawList;
|
||||
EDA_SchComponentStruct* DrawLibItem;
|
||||
SCH_COMPONENT* DrawLibItem;
|
||||
DrawSheetPath* sheet;
|
||||
|
||||
/* Build the sheet (not screen) list */
|
||||
|
@ -858,9 +858,9 @@ int GenListeCmp( ListComponent* List )
|
|||
{
|
||||
switch( DrawList->Type() )
|
||||
{
|
||||
case DRAW_LIB_ITEM_STRUCT_TYPE:
|
||||
case TYPE_SCH_COMPONENT:
|
||||
ItemCount++;
|
||||
DrawLibItem = (EDA_SchComponentStruct*) DrawList;
|
||||
DrawLibItem = (SCH_COMPONENT*) DrawList;
|
||||
DrawLibItem->m_Parent = sheet->LastScreen();
|
||||
if( List )
|
||||
{
|
||||
|
@ -910,8 +910,8 @@ static int GenListeGLabels( ListLabel* List )
|
|||
{
|
||||
switch( DrawList->Type() )
|
||||
{
|
||||
case DRAW_HIER_LABEL_STRUCT_TYPE:
|
||||
case DRAW_GLOBAL_LABEL_STRUCT_TYPE:
|
||||
case TYPE_SCH_HIERLABEL:
|
||||
case TYPE_SCH_GLOBALLABEL:
|
||||
ItemCount++;
|
||||
if( List )
|
||||
{
|
||||
|
@ -1063,12 +1063,12 @@ static int ListTriGLabelByVal( ListLabel* Objet1, ListLabel* Objet2 )
|
|||
if( Objet1->m_LabelType == DRAW_SHEETLABEL_STRUCT_TYPE )
|
||||
Text1 = &( (DrawSheetLabelStruct*) Objet1->m_Label )->m_Text;
|
||||
else
|
||||
Text1 = &( (DrawTextStruct*) Objet1->m_Label )->m_Text;
|
||||
Text1 = &( (SCH_TEXT*) Objet1->m_Label )->m_Text;
|
||||
|
||||
if( Objet2->m_LabelType == DRAW_SHEETLABEL_STRUCT_TYPE )
|
||||
Text2 = &( (DrawSheetLabelStruct*) Objet2->m_Label )->m_Text;
|
||||
else
|
||||
Text2 = &( (DrawTextStruct*) Objet2->m_Label )->m_Text;
|
||||
Text2 = &( (SCH_TEXT*) Objet2->m_Label )->m_Text;
|
||||
|
||||
ii = Text1->CmpNoCase( *Text2 );
|
||||
|
||||
|
@ -1102,12 +1102,12 @@ static int ListTriGLabelBySheet( ListLabel* Objet1, ListLabel* Objet2 )
|
|||
if( Objet1->m_LabelType == DRAW_SHEETLABEL_STRUCT_TYPE )
|
||||
Text1 = &( (DrawSheetLabelStruct*) Objet1->m_Label )->m_Text;
|
||||
else
|
||||
Text1 = &( (DrawTextStruct*) Objet1->m_Label )->m_Text;
|
||||
Text1 = &( (SCH_TEXT*) Objet1->m_Label )->m_Text;
|
||||
|
||||
if( Objet2->m_LabelType == DRAW_SHEETLABEL_STRUCT_TYPE )
|
||||
Text2 = &( (DrawSheetLabelStruct*) Objet2->m_Label )->m_Text;
|
||||
else
|
||||
Text2 = &( (DrawTextStruct*) Objet2->m_Label )->m_Text;
|
||||
Text2 = &( (SCH_TEXT*) Objet2->m_Label )->m_Text;
|
||||
|
||||
ii = Text1->CmpNoCase( *Text2 );
|
||||
}
|
||||
|
@ -1125,7 +1125,7 @@ static void DeleteSubCmp( ListComponent* List, int NbItems )
|
|||
*/
|
||||
{
|
||||
int ii;
|
||||
EDA_SchComponentStruct* LibItem;
|
||||
SCH_COMPONENT* LibItem;
|
||||
wxString OldName, CurrName;
|
||||
|
||||
for( ii = 0; ii < NbItems; ii++ )
|
||||
|
@ -1149,7 +1149,7 @@ static void DeleteSubCmp( ListComponent* List, int NbItems )
|
|||
|
||||
|
||||
/*******************************************************************************************/
|
||||
void WinEDA_Build_BOM_Frame::PrintFieldData( FILE* f, EDA_SchComponentStruct* DrawLibItem,
|
||||
void WinEDA_Build_BOM_Frame::PrintFieldData( FILE* f, SCH_COMPONENT* DrawLibItem,
|
||||
bool CompactForm )
|
||||
/*******************************************************************************************/
|
||||
{
|
||||
|
@ -1198,7 +1198,7 @@ int WinEDA_Build_BOM_Frame::PrintListeCmpByRef( FILE* f, ListComponent* List, in
|
|||
{
|
||||
int ii, Multi, Unit;
|
||||
EDA_BaseStruct* DrawList;
|
||||
EDA_SchComponentStruct* DrawLibItem;
|
||||
SCH_COMPONENT* DrawLibItem;
|
||||
EDA_LibComponentStruct* Entry;
|
||||
char NameCmp[80];
|
||||
wxString msg;
|
||||
|
@ -1254,10 +1254,10 @@ int WinEDA_Build_BOM_Frame::PrintListeCmpByRef( FILE* f, ListComponent* List, in
|
|||
|
||||
if( DrawList == NULL )
|
||||
continue;
|
||||
if( DrawList->Type() != DRAW_LIB_ITEM_STRUCT_TYPE )
|
||||
if( DrawList->Type() != TYPE_SCH_COMPONENT )
|
||||
continue;
|
||||
|
||||
DrawLibItem = (EDA_SchComponentStruct*) DrawList;
|
||||
DrawLibItem = (SCH_COMPONENT*) DrawList;
|
||||
if( List[ii].m_Ref[0] == '#' )
|
||||
continue;
|
||||
|
||||
|
@ -1313,7 +1313,7 @@ int WinEDA_Build_BOM_Frame::PrintListeCmpByVal( FILE* f, ListComponent* List, in
|
|||
int ii, Multi;
|
||||
wxChar Unit;
|
||||
EDA_BaseStruct* DrawList;
|
||||
EDA_SchComponentStruct* DrawLibItem;
|
||||
SCH_COMPONENT* DrawLibItem;
|
||||
EDA_LibComponentStruct* Entry;
|
||||
wxString msg;
|
||||
|
||||
|
@ -1331,10 +1331,10 @@ int WinEDA_Build_BOM_Frame::PrintListeCmpByVal( FILE* f, ListComponent* List, in
|
|||
|
||||
if( DrawList == NULL )
|
||||
continue;
|
||||
if( DrawList->Type() != DRAW_LIB_ITEM_STRUCT_TYPE )
|
||||
if( DrawList->Type() != TYPE_SCH_COMPONENT )
|
||||
continue;
|
||||
|
||||
DrawLibItem = (EDA_SchComponentStruct*) DrawList;
|
||||
DrawLibItem = (SCH_COMPONENT*) DrawList;
|
||||
if( List[ii].m_Ref[0] == '#' )
|
||||
continue;
|
||||
|
||||
|
@ -1377,7 +1377,7 @@ static int PrintListeGLabel( FILE* f, ListLabel* List, int NbItems )
|
|||
/******************************************************************/
|
||||
{
|
||||
int ii, jj;
|
||||
DrawLabelStruct* DrawTextItem;
|
||||
SCH_LABEL* DrawTextItem;
|
||||
DrawSheetLabelStruct* DrawSheetLabel;
|
||||
ListLabel* LabelItem;
|
||||
wxString msg, sheetpath;
|
||||
|
@ -1389,10 +1389,10 @@ static int PrintListeGLabel( FILE* f, ListLabel* List, int NbItems )
|
|||
|
||||
switch( LabelItem->m_LabelType )
|
||||
{
|
||||
case DRAW_HIER_LABEL_STRUCT_TYPE:
|
||||
case DRAW_GLOBAL_LABEL_STRUCT_TYPE:
|
||||
DrawTextItem = (DrawLabelStruct*) (LabelItem->m_Label);
|
||||
if( LabelItem->m_LabelType == DRAW_HIER_LABEL_STRUCT_TYPE )
|
||||
case TYPE_SCH_HIERLABEL:
|
||||
case TYPE_SCH_GLOBALLABEL:
|
||||
DrawTextItem = (SCH_LABEL*) (LabelItem->m_Label);
|
||||
if( LabelItem->m_LabelType == TYPE_SCH_HIERLABEL )
|
||||
labeltype = wxT("Hierarchical");
|
||||
else
|
||||
labeltype = wxT("Global ");
|
||||
|
|
|
@ -133,7 +133,7 @@ public:
|
|||
void CreateExportList(const wxString & FullFileName);
|
||||
int PrintListeCmpByRef( FILE * f, ListComponent * List, int NbItems, bool CompactForm = FALSE );
|
||||
int PrintListeCmpByVal( FILE *f, ListComponent * List, int NbItems);
|
||||
void PrintFieldData(FILE * f, EDA_SchComponentStruct * DrawLibItem, bool CompactForm = FALSE);
|
||||
void PrintFieldData(FILE * f, SCH_COMPONENT * DrawLibItem, bool CompactForm = FALSE);
|
||||
void SavePreferences();
|
||||
|
||||
|
||||
|
|
|
@ -54,7 +54,7 @@ WinEDA_ComponentPropertiesFrame::WinEDA_ComponentPropertiesFrame( )
|
|||
}
|
||||
|
||||
WinEDA_ComponentPropertiesFrame::WinEDA_ComponentPropertiesFrame( WinEDA_SchematicFrame* parent,
|
||||
EDA_SchComponentStruct * cmp,
|
||||
SCH_COMPONENT * cmp,
|
||||
wxWindowID id, const wxString& caption, const wxPoint& pos, const wxSize& size, long style )
|
||||
{
|
||||
m_Parent = parent;
|
||||
|
|
|
@ -76,7 +76,7 @@ public:
|
|||
/// Constructors
|
||||
WinEDA_ComponentPropertiesFrame( );
|
||||
WinEDA_ComponentPropertiesFrame( WinEDA_SchematicFrame* parent,
|
||||
EDA_SchComponentStruct * cmp,
|
||||
SCH_COMPONENT * cmp,
|
||||
wxWindowID id = SYMBOL_WINEDA_COMPONENTPROPERTIESFRAME_IDNAME, const wxString& caption = SYMBOL_WINEDA_COMPONENTPROPERTIESFRAME_TITLE, const wxPoint& pos = SYMBOL_WINEDA_COMPONENTPROPERTIESFRAME_POSITION, const wxSize& size = SYMBOL_WINEDA_COMPONENTPROPERTIESFRAME_SIZE, long style = SYMBOL_WINEDA_COMPONENTPROPERTIESFRAME_STYLE );
|
||||
|
||||
/// Creation
|
||||
|
@ -137,7 +137,7 @@ public:
|
|||
////@end WinEDA_ComponentPropertiesFrame member variables
|
||||
|
||||
WinEDA_SchematicFrame * m_Parent;
|
||||
EDA_SchComponentStruct * m_Cmp;
|
||||
SCH_COMPONENT * m_Cmp;
|
||||
EDA_LibComponentStruct * m_LibEntry;
|
||||
int m_CurrentFieldId;
|
||||
|
||||
|
|
|
@ -51,7 +51,7 @@ WinEDA_LabelPropertiesFrame::WinEDA_LabelPropertiesFrame( )
|
|||
}
|
||||
|
||||
WinEDA_LabelPropertiesFrame::WinEDA_LabelPropertiesFrame( WinEDA_SchematicFrame* parent,
|
||||
DrawTextStruct * CurrentText,
|
||||
SCH_TEXT * CurrentText,
|
||||
const wxPoint& pos,
|
||||
wxWindowID id, const wxString& caption, const wxSize& size, long style )
|
||||
{
|
||||
|
@ -64,15 +64,15 @@ wxString msg;
|
|||
m_TextLabel->SetFocus();
|
||||
switch( m_CurrentText->Type() )
|
||||
{
|
||||
case DRAW_GLOBAL_LABEL_STRUCT_TYPE:
|
||||
case TYPE_SCH_GLOBALLABEL:
|
||||
SetTitle(_("Global Label properties"));
|
||||
break;
|
||||
|
||||
case DRAW_HIER_LABEL_STRUCT_TYPE:
|
||||
case TYPE_SCH_HIERLABEL:
|
||||
SetTitle(_("Hierarchal Label properties"));
|
||||
break;
|
||||
|
||||
case DRAW_LABEL_STRUCT_TYPE:
|
||||
case TYPE_SCH_LABEL:
|
||||
SetTitle(_("Label properties"));
|
||||
break;
|
||||
|
||||
|
@ -189,8 +189,8 @@ void WinEDA_LabelPropertiesFrame::CreateControls()
|
|||
m_TextShape->SetValidator( wxGenericValidator(& m_CurrentText->m_Shape) );
|
||||
////@end WinEDA_LabelPropertiesFrame content construction
|
||||
|
||||
if (m_CurrentText->Type() == DRAW_GLOBAL_LABEL_STRUCT_TYPE ||
|
||||
m_CurrentText->Type() == DRAW_HIER_LABEL_STRUCT_TYPE)
|
||||
if (m_CurrentText->Type() == TYPE_SCH_GLOBALLABEL ||
|
||||
m_CurrentText->Type() == TYPE_SCH_HIERLABEL)
|
||||
m_TextShape->Show(true);
|
||||
}
|
||||
|
||||
|
|
|
@ -68,7 +68,7 @@ public:
|
|||
/// Constructors
|
||||
WinEDA_LabelPropertiesFrame( );
|
||||
WinEDA_LabelPropertiesFrame( WinEDA_SchematicFrame* parent,
|
||||
DrawTextStruct * CurrentText,
|
||||
SCH_TEXT * CurrentText,
|
||||
const wxPoint& pos = SYMBOL_WINEDA_LABELPROPERTIESFRAME_POSITION,
|
||||
wxWindowID id = SYMBOL_WINEDA_LABELPROPERTIESFRAME_IDNAME, const wxString& caption = SYMBOL_WINEDA_LABELPROPERTIESFRAME_TITLE, const wxSize& size = SYMBOL_WINEDA_LABELPROPERTIESFRAME_SIZE, long style = SYMBOL_WINEDA_LABELPROPERTIESFRAME_STYLE );
|
||||
|
||||
|
@ -110,7 +110,7 @@ public:
|
|||
////@end WinEDA_LabelPropertiesFrame member variables
|
||||
|
||||
WinEDA_SchematicFrame * m_Parent;
|
||||
DrawTextStruct * m_CurrentText;
|
||||
SCH_TEXT * m_CurrentText;
|
||||
|
||||
};
|
||||
|
||||
|
|
|
@ -39,14 +39,14 @@ static wxPoint OldPos;
|
|||
|
||||
/**********************************************************************/
|
||||
void InstallCmpeditFrame( WinEDA_SchematicFrame* parent, wxPoint& pos,
|
||||
EDA_SchComponentStruct* cmp )
|
||||
SCH_COMPONENT* cmp )
|
||||
/*********************************************************************/
|
||||
|
||||
/* Create the dialog box for the current component edition
|
||||
*/
|
||||
{
|
||||
parent->DrawPanel->m_IgnoreMouseEvents = TRUE;
|
||||
if( cmp->Type() != DRAW_LIB_ITEM_STRUCT_TYPE )
|
||||
if( cmp->Type() != TYPE_SCH_COMPONENT )
|
||||
{
|
||||
DisplayError( parent,
|
||||
wxT( "InstallCmpeditFrame() error: This struct is not a component" ) );
|
||||
|
@ -458,7 +458,7 @@ void WinEDA_SchematicFrame::StartMoveCmpField( PartTextStruct* Field, wxDC* DC )
|
|||
|
||||
wxPoint pos, newpos;
|
||||
int x1, y1;
|
||||
EDA_SchComponentStruct* Cmp = (EDA_SchComponentStruct*) CurrentField->m_Parent;
|
||||
SCH_COMPONENT* Cmp = (SCH_COMPONENT*) CurrentField->m_Parent;
|
||||
|
||||
SAFE_DELETE( g_ItemToUndoCopy );
|
||||
g_ItemToUndoCopy = Cmp->GenCopy();
|
||||
|
@ -519,7 +519,7 @@ void WinEDA_SchematicFrame::EditCmpFieldText( PartTextStruct* Field, wxDC* DC )
|
|||
return;
|
||||
}
|
||||
|
||||
EDA_SchComponentStruct* Cmp = (EDA_SchComponentStruct*) Field->m_Parent;
|
||||
SCH_COMPONENT* Cmp = (SCH_COMPONENT*) Field->m_Parent;
|
||||
|
||||
FieldNumber = Field->m_FieldId;
|
||||
if( FieldNumber == VALUE )
|
||||
|
@ -608,14 +608,14 @@ static void MoveCmpField( WinEDA_DrawPanel* panel, wxDC* DC, bool erase )
|
|||
if( CurrentField == NULL )
|
||||
return;
|
||||
|
||||
EDA_SchComponentStruct* Cmp = (EDA_SchComponentStruct*) CurrentField->m_Parent;
|
||||
SCH_COMPONENT* Cmp = (SCH_COMPONENT*) CurrentField->m_Parent;
|
||||
FieldNumber = CurrentField->m_FieldId;
|
||||
|
||||
/* Effacement: */
|
||||
if( erase )
|
||||
DrawTextField( panel, DC, CurrentField, Multiflag, g_XorMode );
|
||||
|
||||
pos = ( (EDA_SchComponentStruct*) CurrentField->m_Parent )->m_Pos;
|
||||
pos = ( (SCH_COMPONENT*) CurrentField->m_Parent )->m_Pos;
|
||||
|
||||
/* Les positions sont caculees par la matrice TRANSPOSEE de la matrice
|
||||
* de rotation-miroir */
|
||||
|
@ -658,13 +658,13 @@ void WinEDA_SchematicFrame::RotateCmpField( PartTextStruct* Field, wxDC* DC )
|
|||
if( Field->m_Text == wxEmptyString )
|
||||
return;
|
||||
|
||||
EDA_SchComponentStruct* Cmp = (EDA_SchComponentStruct*) Field->m_Parent;
|
||||
SCH_COMPONENT* Cmp = (SCH_COMPONENT*) Field->m_Parent;
|
||||
|
||||
FieldNumber = Field->m_FieldId;
|
||||
flag = 0;
|
||||
if( FieldNumber == REFERENCE )
|
||||
{
|
||||
Entry = FindLibPart( ( (EDA_SchComponentStruct*) Field->m_Parent )->m_ChipName.GetData(),
|
||||
Entry = FindLibPart( ( (SCH_COMPONENT*) Field->m_Parent )->m_ChipName.GetData(),
|
||||
wxEmptyString, FIND_ROOT );
|
||||
if( Entry != NULL )
|
||||
{
|
||||
|
@ -699,13 +699,13 @@ void PartTextStruct::Place( WinEDA_DrawFrame* frame, wxDC* DC )
|
|||
frame->DrawPanel->ManageCurseur = NULL;
|
||||
frame->DrawPanel->ForceCloseManageCurseur = NULL;
|
||||
|
||||
EDA_SchComponentStruct* Cmp = (EDA_SchComponentStruct*) m_Parent;
|
||||
SCH_COMPONENT* Cmp = (SCH_COMPONENT*) m_Parent;
|
||||
/* save old cmp in undo list */
|
||||
if( g_ItemToUndoCopy && ( g_ItemToUndoCopy->Type() == Cmp->Type()) )
|
||||
{
|
||||
Cmp->SwapData( (EDA_SchComponentStruct*) g_ItemToUndoCopy );
|
||||
Cmp->SwapData( (SCH_COMPONENT*) g_ItemToUndoCopy );
|
||||
( (WinEDA_SchematicFrame*) frame )->SaveCopyInUndoList( Cmp, IS_CHANGED );
|
||||
Cmp->SwapData( (EDA_SchComponentStruct*) g_ItemToUndoCopy );
|
||||
Cmp->SwapData( (SCH_COMPONENT*) g_ItemToUndoCopy );
|
||||
}
|
||||
|
||||
FieldNumber = m_FieldId;
|
||||
|
@ -730,7 +730,7 @@ void PartTextStruct::Place( WinEDA_DrawFrame* frame, wxDC* DC )
|
|||
|
||||
|
||||
/**************************************************************************************************/
|
||||
void WinEDA_SchematicFrame::EditComponentReference( EDA_SchComponentStruct* Cmp, wxDC* DC )
|
||||
void WinEDA_SchematicFrame::EditComponentReference( SCH_COMPONENT* Cmp, wxDC* DC )
|
||||
/**************************************************************************************************/
|
||||
/* Edit the component text reference*/
|
||||
{
|
||||
|
@ -768,7 +768,7 @@ void WinEDA_SchematicFrame::EditComponentReference( EDA_SchComponentStruct* Cmp,
|
|||
|
||||
|
||||
/*****************************************************************************************/
|
||||
void WinEDA_SchematicFrame::EditComponentValue( EDA_SchComponentStruct* Cmp, wxDC* DC )
|
||||
void WinEDA_SchematicFrame::EditComponentValue( SCH_COMPONENT* Cmp, wxDC* DC )
|
||||
/*****************************************************************************************/
|
||||
/* Routine de changement du texte selectionne */
|
||||
{
|
||||
|
@ -808,7 +808,7 @@ void WinEDA_SchematicFrame::EditComponentValue( EDA_SchComponentStruct* Cmp, wxD
|
|||
}
|
||||
|
||||
/*****************************************************************************************/
|
||||
void WinEDA_SchematicFrame::EditComponentFootprint( EDA_SchComponentStruct* Cmp, wxDC* DC )
|
||||
void WinEDA_SchematicFrame::EditComponentFootprint( SCH_COMPONENT* Cmp, wxDC* DC )
|
||||
/*****************************************************************************************/
|
||||
{
|
||||
wxString msg;
|
||||
|
|
|
@ -69,7 +69,7 @@ void WinEDA_LabelPropertiesFrame::TextPropertiesAccept( wxCommandEvent& event )
|
|||
|
||||
|
||||
/********************************************************************************/
|
||||
void WinEDA_SchematicFrame::StartMoveTexte( DrawTextStruct* TextStruct, wxDC* DC )
|
||||
void WinEDA_SchematicFrame::StartMoveTexte( SCH_TEXT* TextStruct, wxDC* DC )
|
||||
/********************************************************************************/
|
||||
{
|
||||
if( TextStruct == NULL )
|
||||
|
@ -87,10 +87,10 @@ void WinEDA_SchematicFrame::StartMoveTexte( DrawTextStruct* TextStruct, wxDC* DC
|
|||
|
||||
switch( TextStruct->Type() )
|
||||
{
|
||||
case DRAW_LABEL_STRUCT_TYPE:
|
||||
case DRAW_GLOBAL_LABEL_STRUCT_TYPE:
|
||||
case DRAW_HIER_LABEL_STRUCT_TYPE:
|
||||
case DRAW_TEXT_STRUCT_TYPE:
|
||||
case TYPE_SCH_LABEL:
|
||||
case TYPE_SCH_GLOBALLABEL:
|
||||
case TYPE_SCH_HIERLABEL:
|
||||
case TYPE_SCH_TEXT:
|
||||
ItemInitialPosition = TextStruct->m_Pos;
|
||||
OldSize = TextStruct->m_Size;
|
||||
OldOrient = TextStruct->m_Orient;
|
||||
|
@ -115,7 +115,7 @@ void WinEDA_SchematicFrame::StartMoveTexte( DrawTextStruct* TextStruct, wxDC* DC
|
|||
|
||||
|
||||
/*************************************************************************/
|
||||
void WinEDA_SchematicFrame::EditSchematicText( DrawTextStruct* TextStruct,
|
||||
void WinEDA_SchematicFrame::EditSchematicText( SCH_TEXT* TextStruct,
|
||||
wxDC* DC )
|
||||
/*************************************************************************/
|
||||
|
||||
|
@ -140,11 +140,11 @@ void WinEDA_SchematicFrame::EditSchematicText( DrawTextStruct* TextStruct,
|
|||
|
||||
|
||||
/***********************************************************************************/
|
||||
void WinEDA_SchematicFrame::ChangeTextOrient( DrawTextStruct* TextStruct, wxDC* DC )
|
||||
void WinEDA_SchematicFrame::ChangeTextOrient( SCH_TEXT* TextStruct, wxDC* DC )
|
||||
/***********************************************************************************/
|
||||
{
|
||||
if( TextStruct == NULL )
|
||||
TextStruct = (DrawTextStruct*) PickStruct( GetScreen()->m_Curseur,
|
||||
TextStruct = (SCH_TEXT*) PickStruct( GetScreen()->m_Curseur,
|
||||
GetScreen(), TEXTITEM | LABELITEM );
|
||||
if( TextStruct == NULL )
|
||||
return;
|
||||
|
@ -160,10 +160,10 @@ void WinEDA_SchematicFrame::ChangeTextOrient( DrawTextStruct* TextStruct, wxDC*
|
|||
/* Rotation du texte */
|
||||
switch( TextStruct->Type() )
|
||||
{
|
||||
case DRAW_LABEL_STRUCT_TYPE:
|
||||
case DRAW_GLOBAL_LABEL_STRUCT_TYPE:
|
||||
case DRAW_HIER_LABEL_STRUCT_TYPE:
|
||||
case DRAW_TEXT_STRUCT_TYPE:
|
||||
case TYPE_SCH_LABEL:
|
||||
case TYPE_SCH_GLOBALLABEL:
|
||||
case TYPE_SCH_HIERLABEL:
|
||||
case TYPE_SCH_TEXT:
|
||||
TextStruct->m_Orient++;
|
||||
TextStruct->m_Orient &= 3;
|
||||
break;
|
||||
|
@ -187,28 +187,28 @@ EDA_BaseStruct* WinEDA_SchematicFrame::CreateNewText( wxDC* DC, int type )
|
|||
/* Routine to create new text struct (GraphicText, label or Glabel).
|
||||
*/
|
||||
{
|
||||
DrawTextStruct* NewText = NULL;
|
||||
SCH_TEXT* NewText = NULL;
|
||||
|
||||
g_ItemToRepeat = NULL;
|
||||
|
||||
switch( type )
|
||||
{
|
||||
case LAYER_NOTES:
|
||||
NewText = new DrawTextStruct( GetScreen()->m_Curseur );
|
||||
NewText = new SCH_TEXT( GetScreen()->m_Curseur );
|
||||
break;
|
||||
|
||||
case LAYER_LOCLABEL:
|
||||
NewText = new DrawLabelStruct( GetScreen()->m_Curseur );
|
||||
NewText = new SCH_LABEL( GetScreen()->m_Curseur );
|
||||
break;
|
||||
|
||||
case LAYER_HIERLABEL:
|
||||
NewText = new DrawHierLabelStruct(GetScreen()->m_Curseur );
|
||||
NewText = new SCH_HIERLABEL(GetScreen()->m_Curseur );
|
||||
NewText->m_Shape = s_DefaultShapeGLabel;
|
||||
NewText->m_Orient = s_DefaultOrientGLabel;
|
||||
break;
|
||||
|
||||
case LAYER_GLOBLABEL:
|
||||
NewText = new DrawGlobalLabelStruct(GetScreen()->m_Curseur );
|
||||
NewText = new SCH_GLOBALLABEL(GetScreen()->m_Curseur );
|
||||
NewText->m_Shape = s_DefaultShapeGLabel;
|
||||
NewText->m_Orient = s_DefaultOrientGLabel;
|
||||
break;
|
||||
|
@ -260,11 +260,11 @@ static void ShowWhileMoving( WinEDA_DrawPanel* panel, wxDC* DC, bool erase )
|
|||
/* redraw the text */
|
||||
switch( TextStruct->Type() )
|
||||
{
|
||||
case DRAW_LABEL_STRUCT_TYPE:
|
||||
case DRAW_GLOBAL_LABEL_STRUCT_TYPE:
|
||||
case DRAW_HIER_LABEL_STRUCT_TYPE:
|
||||
case DRAW_TEXT_STRUCT_TYPE:
|
||||
( (DrawTextStruct*) TextStruct )->m_Pos = panel->GetScreen()->m_Curseur;
|
||||
case TYPE_SCH_LABEL:
|
||||
case TYPE_SCH_GLOBALLABEL:
|
||||
case TYPE_SCH_HIERLABEL:
|
||||
case TYPE_SCH_TEXT:
|
||||
( (SCH_TEXT*) TextStruct )->m_Pos = panel->GetScreen()->m_Curseur;
|
||||
break;
|
||||
|
||||
default:
|
||||
|
@ -304,12 +304,12 @@ static void ExitMoveTexte( WinEDA_DrawPanel* Panel, wxDC* DC )
|
|||
{
|
||||
switch( Struct->Type() )
|
||||
{
|
||||
case DRAW_LABEL_STRUCT_TYPE:
|
||||
case DRAW_GLOBAL_LABEL_STRUCT_TYPE:
|
||||
case DRAW_HIER_LABEL_STRUCT_TYPE:
|
||||
case DRAW_TEXT_STRUCT_TYPE:
|
||||
case TYPE_SCH_LABEL:
|
||||
case TYPE_SCH_GLOBALLABEL:
|
||||
case TYPE_SCH_HIERLABEL:
|
||||
case TYPE_SCH_TEXT:
|
||||
{
|
||||
DrawTextStruct* Text = (DrawTextStruct*) Struct;
|
||||
SCH_TEXT* Text = (SCH_TEXT*) Struct;
|
||||
Text->m_Pos = ItemInitialPosition;
|
||||
Text->m_Size = OldSize;
|
||||
Text->m_Orient = OldOrient;
|
||||
|
@ -327,7 +327,7 @@ static void ExitMoveTexte( WinEDA_DrawPanel* Panel, wxDC* DC )
|
|||
|
||||
|
||||
/*****************************************************************************/
|
||||
void WinEDA_SchematicFrame::ConvertTextType( DrawTextStruct* Text,
|
||||
void WinEDA_SchematicFrame::ConvertTextType( SCH_TEXT* Text,
|
||||
wxDC* DC, int newtype )
|
||||
/*****************************************************************************/
|
||||
|
||||
|
@ -339,22 +339,22 @@ void WinEDA_SchematicFrame::ConvertTextType( DrawTextStruct* Text,
|
|||
if( Text == NULL )
|
||||
return;
|
||||
|
||||
DrawTextStruct* newtext;
|
||||
SCH_TEXT* newtext;
|
||||
|
||||
switch( newtype )
|
||||
{
|
||||
case DRAW_LABEL_STRUCT_TYPE:
|
||||
newtext = new DrawLabelStruct( Text->m_Pos, Text->m_Text );
|
||||
case TYPE_SCH_LABEL:
|
||||
newtext = new SCH_LABEL( Text->m_Pos, Text->m_Text );
|
||||
break;
|
||||
|
||||
case DRAW_GLOBAL_LABEL_STRUCT_TYPE:
|
||||
newtext = new DrawGlobalLabelStruct(Text->m_Pos, Text->m_Text );
|
||||
case TYPE_SCH_GLOBALLABEL:
|
||||
newtext = new SCH_GLOBALLABEL(Text->m_Pos, Text->m_Text );
|
||||
break;
|
||||
case DRAW_HIER_LABEL_STRUCT_TYPE:
|
||||
newtext = new DrawHierLabelStruct(Text->m_Pos, Text->m_Text );
|
||||
case TYPE_SCH_HIERLABEL:
|
||||
newtext = new SCH_HIERLABEL(Text->m_Pos, Text->m_Text );
|
||||
break;
|
||||
case DRAW_TEXT_STRUCT_TYPE:
|
||||
newtext = new DrawTextStruct( Text->m_Pos, Text->m_Text );
|
||||
case TYPE_SCH_TEXT:
|
||||
newtext = new SCH_TEXT( Text->m_Pos, Text->m_Text );
|
||||
break;
|
||||
|
||||
default:
|
||||
|
|
|
@ -376,9 +376,9 @@ void WinEDA_SchematicFrame::RepeatDrawItem( wxDC* DC )
|
|||
STRUCT->m_Pos.y += g_RepeatStep.y; oy = STRUCT->m_Pos.y;
|
||||
break;
|
||||
|
||||
case DRAW_TEXT_STRUCT_TYPE:
|
||||
case TYPE_SCH_TEXT:
|
||||
#undef STRUCT
|
||||
#define STRUCT ( (DrawTextStruct*) g_ItemToRepeat )
|
||||
#define STRUCT ( (SCH_TEXT*) g_ItemToRepeat )
|
||||
g_ItemToRepeat = STRUCT->GenCopy();
|
||||
STRUCT->m_Pos.x += g_RepeatStep.x; ox = STRUCT->m_Pos.x;
|
||||
STRUCT->m_Pos.y += g_RepeatStep.y; oy = STRUCT->m_Pos.y;
|
||||
|
@ -389,11 +389,11 @@ void WinEDA_SchematicFrame::RepeatDrawItem( wxDC* DC )
|
|||
break;
|
||||
|
||||
|
||||
case DRAW_LABEL_STRUCT_TYPE:
|
||||
case DRAW_GLOBAL_LABEL_STRUCT_TYPE:
|
||||
case DRAW_HIER_LABEL_STRUCT_TYPE:
|
||||
case TYPE_SCH_LABEL:
|
||||
case TYPE_SCH_GLOBALLABEL:
|
||||
case TYPE_SCH_HIERLABEL:
|
||||
#undef STRUCT
|
||||
#define STRUCT ( (DrawLabelStruct*) g_ItemToRepeat )
|
||||
#define STRUCT ( (SCH_LABEL*) g_ItemToRepeat )
|
||||
g_ItemToRepeat = STRUCT->GenCopy();
|
||||
STRUCT->m_Pos.x += g_RepeatStep.x; ox = STRUCT->m_Pos.x;
|
||||
STRUCT->m_Pos.y += g_RepeatStep.y; oy = STRUCT->m_Pos.y;
|
||||
|
@ -528,9 +528,9 @@ static bool IsTerminalPoint( SCH_SCREEN* screen, const wxPoint& pos, int layer )
|
|||
return TRUE;
|
||||
|
||||
item = PickStruct( screen, LABELITEM );
|
||||
if( item && (item->Type() != DRAW_TEXT_STRUCT_TYPE)
|
||||
&& ( ( (DrawGlobalLabelStruct*) item )->m_Pos.x == pos.x )
|
||||
&& ( ( (DrawGlobalLabelStruct*) item )->m_Pos.y == pos.y ) )
|
||||
if( item && (item->Type() != TYPE_SCH_TEXT)
|
||||
&& ( ( (SCH_GLOBALLABEL*) item )->m_Pos.x == pos.x )
|
||||
&& ( ( (SCH_GLOBALLABEL*) item )->m_Pos.y == pos.y ) )
|
||||
return TRUE;
|
||||
|
||||
pinsheet = LocateAnyPinSheet( pos, screen->EEDrawList );
|
||||
|
|
|
@ -40,7 +40,7 @@ static int s_ItemSelectColor = BROWN;
|
|||
static EDA_LibComponentStruct* DummyCmp;
|
||||
static int* Buf_Poly_Drawings, Buf_Poly_Size; // Used fo polyline drawings
|
||||
static void DrawLibPartAux( WinEDA_DrawPanel* panel, wxDC* DC,
|
||||
EDA_SchComponentStruct* Component,
|
||||
SCH_COMPONENT* Component,
|
||||
EDA_LibComponentStruct* Entry,
|
||||
const wxPoint& Pos,
|
||||
int TransMat[2][2],
|
||||
|
@ -204,7 +204,7 @@ void DrawLibEntry( WinEDA_DrawPanel* panel, wxDC* DC,
|
|||
* Routine to draw the given part at given position, transformed/mirror as *
|
||||
* specified, and in the given drawing mode. Only this one is visible... *
|
||||
*****************************************************************************/
|
||||
void EDA_SchComponentStruct::Draw( WinEDA_DrawPanel* panel, wxDC* DC,
|
||||
void SCH_COMPONENT::Draw( WinEDA_DrawPanel* panel, wxDC* DC,
|
||||
const wxPoint& offset, int DrawMode, int Color )
|
||||
{
|
||||
EDA_LibComponentStruct* Entry;
|
||||
|
@ -262,7 +262,7 @@ void DrawTextField( WinEDA_DrawPanel* panel, wxDC* DC,
|
|||
{
|
||||
int orient, color;
|
||||
wxPoint pos; /* Position des textes */
|
||||
EDA_SchComponentStruct* DrawLibItem = (EDA_SchComponentStruct*) Field->m_Parent;
|
||||
SCH_COMPONENT* DrawLibItem = (SCH_COMPONENT*) Field->m_Parent;
|
||||
int hjustify, vjustify;
|
||||
int LineWidth = MAX( Field->m_Width, g_DrawMinimunLineWidth );
|
||||
|
||||
|
@ -404,7 +404,7 @@ EDA_LibComponentStruct* FindLibPart( const wxChar* Name, const wxString& LibName
|
|||
*****************************************************************************/
|
||||
/* DrawMode = GrXOR, GrOR ..*/
|
||||
void DrawLibPartAux( WinEDA_DrawPanel* panel, wxDC* DC,
|
||||
EDA_SchComponentStruct* Component,
|
||||
SCH_COMPONENT* Component,
|
||||
EDA_LibComponentStruct* Entry,
|
||||
const wxPoint& Pos,
|
||||
int TransMat[2][2],
|
||||
|
@ -896,7 +896,7 @@ bool MapAngles( int* Angle1, int* Angle2, int TransMat[2][2] )
|
|||
*****************************************************************************/
|
||||
void DrawingLibInGhost( WinEDA_DrawPanel* panel, wxDC* DC,
|
||||
EDA_LibComponentStruct* LibEntry,
|
||||
EDA_SchComponentStruct* DrawLibItem, int PartX, int PartY,
|
||||
SCH_COMPONENT* DrawLibItem, int PartX, int PartY,
|
||||
int multi, int convert, int Color, bool DrawPinText )
|
||||
{
|
||||
int DrawMode = g_XorMode;
|
||||
|
|
|
@ -459,22 +459,22 @@ void DrawStructsInGhost( WinEDA_DrawPanel* panel, wxDC* DC,
|
|||
break;
|
||||
}
|
||||
|
||||
case DRAW_TEXT_STRUCT_TYPE:
|
||||
case TYPE_SCH_TEXT:
|
||||
{
|
||||
DrawTextStruct* Struct;
|
||||
Struct = (DrawTextStruct*) DrawStruct;
|
||||
SCH_TEXT* Struct;
|
||||
Struct = (SCH_TEXT*) DrawStruct;
|
||||
Struct->m_Pos.x += dx; Struct->m_Pos.y += dy;
|
||||
Struct->Draw( panel, DC, wxPoint( 0, 0 ), DrawMode, g_GhostColor );
|
||||
Struct->m_Pos.x -= dx; Struct->m_Pos.y -= dy;
|
||||
break;
|
||||
}
|
||||
|
||||
case DRAW_LABEL_STRUCT_TYPE:
|
||||
case DRAW_GLOBAL_LABEL_STRUCT_TYPE:
|
||||
case DRAW_HIER_LABEL_STRUCT_TYPE:
|
||||
case TYPE_SCH_LABEL:
|
||||
case TYPE_SCH_GLOBALLABEL:
|
||||
case TYPE_SCH_HIERLABEL:
|
||||
{
|
||||
DrawLabelStruct* Struct;
|
||||
Struct = (DrawLabelStruct*) DrawStruct;
|
||||
SCH_LABEL* Struct;
|
||||
Struct = (SCH_LABEL*) DrawStruct;
|
||||
Struct->m_Pos.x += dx; Struct->m_Pos.y += dy;
|
||||
Struct->Draw( panel, DC, wxPoint( 0, 0 ), DrawMode, g_GhostColor );
|
||||
Struct->m_Pos.x -= dx; Struct->m_Pos.y -= dy;
|
||||
|
@ -491,11 +491,11 @@ void DrawStructsInGhost( WinEDA_DrawPanel* panel, wxDC* DC,
|
|||
break;
|
||||
}
|
||||
|
||||
case DRAW_LIB_ITEM_STRUCT_TYPE:
|
||||
case TYPE_SCH_COMPONENT:
|
||||
{
|
||||
EDA_LibComponentStruct* LibEntry;
|
||||
EDA_SchComponentStruct* Struct;
|
||||
Struct = (EDA_SchComponentStruct*) DrawStruct;
|
||||
SCH_COMPONENT* Struct;
|
||||
Struct = (SCH_COMPONENT*) DrawStruct;
|
||||
LibEntry = FindLibPart( Struct->m_ChipName.GetData(), wxEmptyString, FIND_ROOT );
|
||||
if( LibEntry == NULL )
|
||||
break;
|
||||
|
|
|
@ -303,7 +303,7 @@ int CountCmpNumber()
|
|||
{
|
||||
for( Phead = Window->EEDrawList; Phead != NULL; Phead = Phead->Pnext )
|
||||
{
|
||||
if( Phead->Type() == DRAW_LIB_ITEM_STRUCT_TYPE )
|
||||
if( Phead->Type() == TYPE_SCH_COMPONENT )
|
||||
{
|
||||
DrawPartStruct* Cmp = (DrawPartStruct*) Phead;
|
||||
if( Cmp->m_Field[VALUE].m_Text.GetChar( 0 ) != '#' )
|
||||
|
|
|
@ -72,7 +72,7 @@ EDA_BaseStruct* WinEDA_SchematicFrame::FindComponentAndItem(
|
|||
{
|
||||
DrawSheetPath* sheet, * SheetWithComponentFound = NULL;
|
||||
EDA_BaseStruct* DrawList = NULL;
|
||||
EDA_SchComponentStruct* Component = NULL;
|
||||
SCH_COMPONENT* Component = NULL;
|
||||
wxSize DrawAreaSize = DrawPanel->GetClientSize();
|
||||
wxPoint pos, curpos;
|
||||
bool DoCenterAndRedraw = FALSE;
|
||||
|
@ -91,10 +91,10 @@ EDA_BaseStruct* WinEDA_SchematicFrame::FindComponentAndItem(
|
|||
DrawList = sheet->LastDrawList();
|
||||
for( ; (DrawList != NULL) && (NotFound == true); DrawList = DrawList->Pnext )
|
||||
{
|
||||
if( DrawList->Type() == DRAW_LIB_ITEM_STRUCT_TYPE )
|
||||
if( DrawList->Type() == TYPE_SCH_COMPONENT )
|
||||
{
|
||||
EDA_SchComponentStruct* pSch;
|
||||
pSch = (EDA_SchComponentStruct*) DrawList;
|
||||
SCH_COMPONENT* pSch;
|
||||
pSch = (SCH_COMPONENT*) DrawList;
|
||||
if( component_reference.CmpNoCase( pSch->GetRef(sheet) ) == 0 )
|
||||
{
|
||||
Component = pSch;
|
||||
|
@ -465,9 +465,9 @@ EDA_BaseStruct* WinEDA_SchematicFrame::FindSchematicItem(
|
|||
{
|
||||
switch( DrawList->Type() )
|
||||
{
|
||||
case DRAW_LIB_ITEM_STRUCT_TYPE:
|
||||
EDA_SchComponentStruct * pSch;
|
||||
pSch = (EDA_SchComponentStruct*) DrawList;
|
||||
case TYPE_SCH_COMPONENT:
|
||||
SCH_COMPONENT * pSch;
|
||||
pSch = (SCH_COMPONENT*) DrawList;
|
||||
if( WildCompareString( WildText, pSch->GetRef(Sheet), FALSE ) )
|
||||
{
|
||||
NotFound = FALSE;
|
||||
|
@ -481,12 +481,12 @@ EDA_BaseStruct* WinEDA_SchematicFrame::FindSchematicItem(
|
|||
}
|
||||
break;
|
||||
|
||||
case DRAW_LABEL_STRUCT_TYPE:
|
||||
case DRAW_GLOBAL_LABEL_STRUCT_TYPE:
|
||||
case DRAW_HIER_LABEL_STRUCT_TYPE:
|
||||
case DRAW_TEXT_STRUCT_TYPE:
|
||||
DrawTextStruct * pDraw;
|
||||
pDraw = (DrawTextStruct*) DrawList;
|
||||
case TYPE_SCH_LABEL:
|
||||
case TYPE_SCH_GLOBALLABEL:
|
||||
case TYPE_SCH_HIERLABEL:
|
||||
case TYPE_SCH_TEXT:
|
||||
SCH_TEXT * pDraw;
|
||||
pDraw = (SCH_TEXT*) DrawList;
|
||||
if( WildCompareString( WildText, pDraw->m_Text, FALSE ) )
|
||||
{
|
||||
NotFound = FALSE;
|
||||
|
@ -551,12 +551,12 @@ EDA_BaseStruct* WinEDA_SchematicFrame::FindSchematicItem(
|
|||
DoCenterAndRedraw = TRUE;
|
||||
}
|
||||
|
||||
/* the struct is a DRAW_LIB_ITEM_STRUCT_TYPE type,
|
||||
/* the struct is a TYPE_SCH_COMPONENT type,
|
||||
* coordinates must be computed according to its orientation matrix
|
||||
*/
|
||||
if( Struct->Type() == DRAW_LIB_ITEM_STRUCT_TYPE )
|
||||
if( Struct->Type() == TYPE_SCH_COMPONENT )
|
||||
{
|
||||
EDA_SchComponentStruct* pSch = (EDA_SchComponentStruct*) Struct;
|
||||
SCH_COMPONENT* pSch = (SCH_COMPONENT*) Struct;
|
||||
|
||||
pos.x -= pSch->m_Pos.x;
|
||||
pos.y -= pSch->m_Pos.y;
|
||||
|
|
|
@ -59,7 +59,7 @@ wxString SelectFromLibBrowser( WinEDA_DrawFrame* parent )
|
|||
|
||||
|
||||
/**************************************************************************/
|
||||
EDA_SchComponentStruct* WinEDA_SchematicFrame::Load_Component( wxDC* DC,
|
||||
SCH_COMPONENT* WinEDA_SchematicFrame::Load_Component( wxDC* DC,
|
||||
const wxString& libname,
|
||||
wxArrayString& HistoryList,
|
||||
bool UseLibBrowser )
|
||||
|
@ -73,7 +73,7 @@ EDA_SchComponentStruct* WinEDA_SchematicFrame::Load_Component( wxDC* DC,
|
|||
int ii, CmpCount = 0;
|
||||
LibDrawField* Field;
|
||||
EDA_LibComponentStruct* Entry = NULL;
|
||||
EDA_SchComponentStruct* DrawLibItem = NULL;
|
||||
SCH_COMPONENT* DrawLibItem = NULL;
|
||||
LibraryStruct* Library = NULL;
|
||||
wxString Name, keys, msg;
|
||||
bool AllowWildSeach = TRUE;
|
||||
|
@ -180,7 +180,7 @@ EDA_SchComponentStruct* WinEDA_SchematicFrame::Load_Component( wxDC* DC,
|
|||
DrawPanel->ManageCurseur = ShowWhileMoving;
|
||||
DrawPanel->ForceCloseManageCurseur = ExitPlaceCmp;
|
||||
|
||||
DrawLibItem = new EDA_SchComponentStruct( GetScreen()->m_Curseur );
|
||||
DrawLibItem = new SCH_COMPONENT( GetScreen()->m_Curseur );
|
||||
DrawLibItem->m_Multi = 1;/* Selection de l'unite 1 dans le boitier */
|
||||
DrawLibItem->m_Convert = 1;
|
||||
DrawLibItem->m_ChipName = Name;
|
||||
|
@ -257,7 +257,7 @@ static void ShowWhileMoving( WinEDA_DrawPanel* panel, wxDC* DC, bool erase )
|
|||
{
|
||||
wxPoint move_vector;
|
||||
|
||||
EDA_SchComponentStruct* DrawLibItem = (EDA_SchComponentStruct*)
|
||||
SCH_COMPONENT* DrawLibItem = (SCH_COMPONENT*)
|
||||
panel->m_Parent->GetScreen()->GetCurItem();
|
||||
|
||||
/* Effacement du composant */
|
||||
|
@ -276,7 +276,7 @@ static void ShowWhileMoving( WinEDA_DrawPanel* panel, wxDC* DC, bool erase )
|
|||
|
||||
/**************************************************************************/
|
||||
void WinEDA_SchematicFrame::CmpRotationMiroir(
|
||||
EDA_SchComponentStruct* DrawComponent, wxDC* DC, int type_rotate )
|
||||
SCH_COMPONENT* DrawComponent, wxDC* DC, int type_rotate )
|
||||
/**************************************************************************/
|
||||
|
||||
/* Routine permettant les rotations et les miroirs d'un composant
|
||||
|
@ -293,7 +293,9 @@ void WinEDA_SchematicFrame::CmpRotationMiroir(
|
|||
if( DrawComponent->m_Flags )
|
||||
DrawStructsInGhost( DrawPanel, DC, DrawComponent, 0, 0 );
|
||||
else
|
||||
DrawComponent->Draw( DrawPanel, DC, wxPoint( 0, 0 ), g_XorMode );
|
||||
{
|
||||
DrawPanel->PostDirtyRect( DrawComponent->GetBoundingBox());
|
||||
}
|
||||
}
|
||||
|
||||
DrawComponent->SetRotationMiroir( type_rotate );
|
||||
|
@ -320,7 +322,7 @@ static void ExitPlaceCmp( WinEDA_DrawPanel* Panel, wxDC* DC )
|
|||
/* Routine de sortie de la fonction de placement de composant
|
||||
*/
|
||||
{
|
||||
EDA_SchComponentStruct* DrawLibItem = (EDA_SchComponentStruct*)
|
||||
SCH_COMPONENT* DrawLibItem = (SCH_COMPONENT*)
|
||||
Panel->m_Parent->GetScreen()->GetCurItem();
|
||||
|
||||
if( DrawLibItem->m_Flags & IS_NEW ) /* Nouveau Placement en cours, on l'efface */
|
||||
|
@ -352,7 +354,7 @@ static void ExitPlaceCmp( WinEDA_DrawPanel* Panel, wxDC* DC )
|
|||
|
||||
|
||||
/************************************************************************/
|
||||
void WinEDA_SchematicFrame::SelPartUnit( EDA_SchComponentStruct* DrawComponent,
|
||||
void WinEDA_SchematicFrame::SelPartUnit( SCH_COMPONENT* DrawComponent,
|
||||
int unit, wxDC* DC )
|
||||
/************************************************************************/
|
||||
/* Selection de l'unite dans les boitiers a multiples Parts */
|
||||
|
@ -400,7 +402,7 @@ void WinEDA_SchematicFrame::SelPartUnit( EDA_SchComponentStruct* DrawComponent,
|
|||
|
||||
|
||||
/************************************************************************/
|
||||
void WinEDA_SchematicFrame::ConvertPart( EDA_SchComponentStruct* DrawComponent,
|
||||
void WinEDA_SchematicFrame::ConvertPart( SCH_COMPONENT* DrawComponent,
|
||||
wxDC* DC )
|
||||
/************************************************************************/
|
||||
{
|
||||
|
@ -469,13 +471,13 @@ int LookForConvertPart( EDA_LibComponentStruct* LibEntry )
|
|||
|
||||
|
||||
/***********************************************************************************/
|
||||
void WinEDA_SchematicFrame::StartMovePart( EDA_SchComponentStruct* Component,
|
||||
void WinEDA_SchematicFrame::StartMovePart( SCH_COMPONENT* Component,
|
||||
wxDC* DC )
|
||||
/***********************************************************************************/
|
||||
{
|
||||
if( Component == NULL )
|
||||
return;
|
||||
if( Component->Type() != DRAW_LIB_ITEM_STRUCT_TYPE )
|
||||
if( Component->Type() != TYPE_SCH_COMPONENT )
|
||||
return;
|
||||
|
||||
if( Component->m_Flags == 0 )
|
||||
|
|
|
@ -281,7 +281,7 @@ void WinEDA_SchematicFrame::OnHotKey( wxDC* DC, int hotkey,
|
|||
GetScreen(), LIBITEM | TEXTITEM | LABELITEM );
|
||||
if( DrawStruct == NULL )
|
||||
break;
|
||||
if( DrawStruct->Type() == DRAW_LIB_ITEM_STRUCT_TYPE )
|
||||
if( DrawStruct->Type() == TYPE_SCH_COMPONENT )
|
||||
DrawStruct = LocateSmallestComponent( (SCH_SCREEN*)GetScreen() );
|
||||
if( DrawStruct == NULL )
|
||||
break;
|
||||
|
@ -289,7 +289,7 @@ void WinEDA_SchematicFrame::OnHotKey( wxDC* DC, int hotkey,
|
|||
|
||||
switch( DrawStruct->Type() )
|
||||
{
|
||||
case DRAW_LIB_ITEM_STRUCT_TYPE:
|
||||
case TYPE_SCH_COMPONENT:
|
||||
if( DrawStruct->m_Flags == 0 )
|
||||
{
|
||||
SaveCopyInUndoList( DrawStruct, IS_CHANGED );
|
||||
|
@ -297,19 +297,19 @@ void WinEDA_SchematicFrame::OnHotKey( wxDC* DC, int hotkey,
|
|||
}
|
||||
|
||||
CmpRotationMiroir(
|
||||
(EDA_SchComponentStruct*) DrawStruct, DC, CMP_ROTATE_COUNTERCLOCKWISE );
|
||||
(SCH_COMPONENT*) DrawStruct, DC, CMP_ROTATE_COUNTERCLOCKWISE );
|
||||
break;
|
||||
|
||||
case DRAW_TEXT_STRUCT_TYPE:
|
||||
case DRAW_LABEL_STRUCT_TYPE:
|
||||
case DRAW_GLOBAL_LABEL_STRUCT_TYPE:
|
||||
case DRAW_HIER_LABEL_STRUCT_TYPE:
|
||||
case TYPE_SCH_TEXT:
|
||||
case TYPE_SCH_LABEL:
|
||||
case TYPE_SCH_GLOBALLABEL:
|
||||
case TYPE_SCH_HIERLABEL:
|
||||
if( DrawStruct->m_Flags == 0 )
|
||||
{
|
||||
SaveCopyInUndoList( DrawStruct, IS_CHANGED );
|
||||
RefreshToolBar = TRUE;
|
||||
}
|
||||
ChangeTextOrient( (DrawTextStruct*) DrawStruct, DC );
|
||||
ChangeTextOrient( (SCH_TEXT*) DrawStruct, DC );
|
||||
break;
|
||||
|
||||
default:
|
||||
|
@ -329,7 +329,7 @@ void WinEDA_SchematicFrame::OnHotKey( wxDC* DC, int hotkey,
|
|||
RefreshToolBar = TRUE;
|
||||
}
|
||||
CmpRotationMiroir(
|
||||
(EDA_SchComponentStruct*) DrawStruct, DC, CMP_MIROIR_Y );
|
||||
(SCH_COMPONENT*) DrawStruct, DC, CMP_MIROIR_Y );
|
||||
}
|
||||
break;
|
||||
|
||||
|
@ -344,7 +344,7 @@ void WinEDA_SchematicFrame::OnHotKey( wxDC* DC, int hotkey,
|
|||
RefreshToolBar = TRUE;
|
||||
}
|
||||
CmpRotationMiroir(
|
||||
(EDA_SchComponentStruct*) DrawStruct, DC, CMP_MIROIR_X );
|
||||
(SCH_COMPONENT*) DrawStruct, DC, CMP_MIROIR_X );
|
||||
}
|
||||
break;
|
||||
|
||||
|
@ -359,7 +359,7 @@ void WinEDA_SchematicFrame::OnHotKey( wxDC* DC, int hotkey,
|
|||
RefreshToolBar = TRUE;
|
||||
}
|
||||
CmpRotationMiroir(
|
||||
(EDA_SchComponentStruct*) DrawStruct, DC, CMP_NORMAL );
|
||||
(SCH_COMPONENT*) DrawStruct, DC, CMP_NORMAL );
|
||||
TestDanglingEnds( (SCH_SCREEN*)GetScreen()->EEDrawList, DC );
|
||||
}
|
||||
break;
|
||||
|
@ -386,7 +386,7 @@ void WinEDA_SchematicFrame::OnHotKey( wxDC* DC, int hotkey,
|
|||
if(DrawStruct)
|
||||
{
|
||||
EditComponentValue(
|
||||
(EDA_SchComponentStruct*) DrawStruct, DC );
|
||||
(SCH_COMPONENT*) DrawStruct, DC );
|
||||
}
|
||||
break;
|
||||
|
||||
|
@ -398,7 +398,7 @@ void WinEDA_SchematicFrame::OnHotKey( wxDC* DC, int hotkey,
|
|||
if(DrawStruct)
|
||||
{
|
||||
EditComponentFootprint(
|
||||
(EDA_SchComponentStruct*) DrawStruct, DC );
|
||||
(SCH_COMPONENT*) DrawStruct, DC );
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
|
|
@ -378,16 +378,16 @@ bool WinEDA_SchematicFrame::LoadOneEEFile( SCH_SCREEN* screen, const wxString& F
|
|||
|
||||
if( Name1[0] == 'L' )
|
||||
{
|
||||
DrawLabelStruct* TextStruct =
|
||||
new DrawLabelStruct( pos, CONV_FROM_UTF8( text ) );
|
||||
SCH_LABEL* TextStruct =
|
||||
new SCH_LABEL( pos, CONV_FROM_UTF8( text ) );
|
||||
TextStruct->m_Size.x = TextStruct->m_Size.y = size;
|
||||
TextStruct->m_Orient = orient;
|
||||
Struct = (EDA_BaseStruct*) TextStruct;
|
||||
}
|
||||
else if( Name1[0] == 'G' && version > '1')
|
||||
{
|
||||
DrawGlobalLabelStruct* TextStruct =
|
||||
new DrawGlobalLabelStruct(pos, CONV_FROM_UTF8( text ) );
|
||||
SCH_GLOBALLABEL* TextStruct =
|
||||
new SCH_GLOBALLABEL(pos, CONV_FROM_UTF8( text ) );
|
||||
Struct = (EDA_BaseStruct*) TextStruct;
|
||||
TextStruct->m_Size.x = TextStruct->m_Size.y = size;
|
||||
TextStruct->m_Orient = orient;
|
||||
|
@ -403,8 +403,8 @@ bool WinEDA_SchematicFrame::LoadOneEEFile( SCH_SCREEN* screen, const wxString& F
|
|||
}
|
||||
else if( (Name1[0] == 'H') || (Name1[0] == 'G' && version == '1'))
|
||||
{ //in schematic file version 1, glabels were actually hierarchal labels.
|
||||
DrawHierLabelStruct* TextStruct =
|
||||
new DrawHierLabelStruct(pos, CONV_FROM_UTF8( text ) );
|
||||
SCH_HIERLABEL* TextStruct =
|
||||
new SCH_HIERLABEL(pos, CONV_FROM_UTF8( text ) );
|
||||
Struct = (EDA_BaseStruct*) TextStruct;
|
||||
TextStruct->m_Size.x = TextStruct->m_Size.y = size;
|
||||
TextStruct->m_Orient = orient;
|
||||
|
@ -420,8 +420,8 @@ bool WinEDA_SchematicFrame::LoadOneEEFile( SCH_SCREEN* screen, const wxString& F
|
|||
}
|
||||
else
|
||||
{
|
||||
DrawTextStruct* TextStruct =
|
||||
new DrawTextStruct( pos, CONV_FROM_UTF8( text ) );
|
||||
SCH_TEXT* TextStruct =
|
||||
new SCH_TEXT( pos, CONV_FROM_UTF8( text ) );
|
||||
TextStruct->m_Size.x = TextStruct->m_Size.y = size;
|
||||
TextStruct->m_Orient = orient;
|
||||
Struct = (EDA_BaseStruct*) TextStruct;
|
||||
|
@ -489,11 +489,11 @@ static int ReadPartDescr( wxWindow* frame, char* Line, FILE* f,
|
|||
int ii, fieldref;
|
||||
char Name1[256], Name2[256],
|
||||
Char1[256], Char2[256], Char3[256];
|
||||
EDA_SchComponentStruct* LibItemStruct;
|
||||
SCH_COMPONENT* LibItemStruct;
|
||||
int Failed = 0, newfmt = 0;
|
||||
char* ptcar;
|
||||
|
||||
LibItemStruct = new EDA_SchComponentStruct();
|
||||
LibItemStruct = new SCH_COMPONENT();
|
||||
LibItemStruct->m_Convert = 1;
|
||||
|
||||
if( Line[0] == '$' )
|
||||
|
|
|
@ -31,14 +31,14 @@ static bool SnapPoint2( const wxPoint& PosRef, int SearchMask,
|
|||
|
||||
|
||||
/*********************************************************************/
|
||||
EDA_SchComponentStruct* LocateSmallestComponent( SCH_SCREEN* Screen )
|
||||
SCH_COMPONENT* LocateSmallestComponent( SCH_SCREEN* Screen )
|
||||
/*********************************************************************/
|
||||
|
||||
/* Search the smaller (considering its area) component under the mouse cursor or the pcb cursor
|
||||
* If more than 1 component is found, a pointer to the smaller component is returned
|
||||
*/
|
||||
{
|
||||
EDA_SchComponentStruct* DrawLibItem = NULL, * LastDrawLibItem = NULL;
|
||||
SCH_COMPONENT* DrawLibItem = NULL, * LastDrawLibItem = NULL;
|
||||
EDA_BaseStruct* DrawList;
|
||||
EDA_Rect BoundaryBox;
|
||||
float sizeref = 0, sizecurr;
|
||||
|
@ -54,7 +54,7 @@ EDA_SchComponentStruct* LocateSmallestComponent( SCH_SCREEN* Screen )
|
|||
DrawList, NULL, Screen->GetZoom() ) ) == FALSE )
|
||||
break;
|
||||
}
|
||||
DrawLibItem = (EDA_SchComponentStruct*) LastSnappedStruct;
|
||||
DrawLibItem = (SCH_COMPONENT*) LastSnappedStruct;
|
||||
DrawList = DrawLibItem->Pnext;
|
||||
if( LastDrawLibItem == NULL ) // First time a component is located
|
||||
{
|
||||
|
@ -341,10 +341,10 @@ bool SnapPoint2( const wxPoint& PosRef, int SearchMask,
|
|||
}
|
||||
break;
|
||||
|
||||
case DRAW_LABEL_STRUCT_TYPE:
|
||||
case DRAW_TEXT_STRUCT_TYPE:
|
||||
case TYPE_SCH_LABEL:
|
||||
case TYPE_SCH_TEXT:
|
||||
#undef STRUCT
|
||||
#define STRUCT ( (DrawTextStruct*) DrawList )
|
||||
#define STRUCT ( (SCH_TEXT*) DrawList )
|
||||
if( !( SearchMask & (TEXTITEM | LABELITEM) ) )
|
||||
break;
|
||||
dx = STRUCT->m_Size.x * STRUCT->GetLength();
|
||||
|
@ -379,10 +379,10 @@ bool SnapPoint2( const wxPoint& PosRef, int SearchMask,
|
|||
break;
|
||||
|
||||
|
||||
case DRAW_GLOBAL_LABEL_STRUCT_TYPE:
|
||||
case DRAW_HIER_LABEL_STRUCT_TYPE:
|
||||
case TYPE_SCH_GLOBALLABEL:
|
||||
case TYPE_SCH_HIERLABEL:
|
||||
#undef STRUCT
|
||||
#define STRUCT ( (DrawLabelStruct*) DrawList )
|
||||
#define STRUCT ( (SCH_LABEL*) DrawList )
|
||||
if( !(SearchMask & LABELITEM) )
|
||||
break;
|
||||
dx = STRUCT->m_Size.x * ( STRUCT->GetLength() + 1 ); /* longueur */
|
||||
|
@ -416,14 +416,14 @@ bool SnapPoint2( const wxPoint& PosRef, int SearchMask,
|
|||
}
|
||||
break;
|
||||
|
||||
case DRAW_LIB_ITEM_STRUCT_TYPE:
|
||||
case TYPE_SCH_COMPONENT:
|
||||
if( !( SearchMask & (LIBITEM | FIELDCMPITEM) ) )
|
||||
break;
|
||||
|
||||
if( SearchMask & FIELDCMPITEM )
|
||||
{
|
||||
PartTextStruct* Field;
|
||||
EDA_SchComponentStruct* DrawLibItem = (EDA_SchComponentStruct*) DrawList;
|
||||
SCH_COMPONENT* DrawLibItem = (SCH_COMPONENT*) DrawList;
|
||||
for( i = REFERENCE; i < NUMBER_OF_FIELDS; i++ )
|
||||
{
|
||||
Field = &DrawLibItem->m_Field[i];
|
||||
|
@ -442,7 +442,7 @@ bool SnapPoint2( const wxPoint& PosRef, int SearchMask,
|
|||
else
|
||||
{
|
||||
#undef STRUCT
|
||||
#define STRUCT ( (EDA_SchComponentStruct*) DrawList )
|
||||
#define STRUCT ( (SCH_COMPONENT*) DrawList )
|
||||
EDA_Rect BoundaryBox = STRUCT->GetBoundaryBox();
|
||||
if( BoundaryBox.Inside( x, y ) )
|
||||
{
|
||||
|
@ -564,10 +564,10 @@ bool DrawStructInBox( int x1, int y1, int x2, int y2,
|
|||
return TRUE;
|
||||
break;
|
||||
|
||||
case DRAW_LABEL_STRUCT_TYPE:
|
||||
case DRAW_TEXT_STRUCT_TYPE:
|
||||
case TYPE_SCH_LABEL:
|
||||
case TYPE_SCH_TEXT:
|
||||
#undef STRUCT
|
||||
#define STRUCT ( (DrawTextStruct*) DrawStruct )
|
||||
#define STRUCT ( (SCH_TEXT*) DrawStruct )
|
||||
dx = STRUCT->m_Size.x * STRUCT->GetLength();
|
||||
dy = STRUCT->m_Size.y;
|
||||
xt1 = xt2 = STRUCT->m_Pos.x;
|
||||
|
@ -596,10 +596,10 @@ bool DrawStructInBox( int x1, int y1, int x2, int y2,
|
|||
return TRUE;
|
||||
break;
|
||||
|
||||
case DRAW_HIER_LABEL_STRUCT_TYPE:
|
||||
case DRAW_GLOBAL_LABEL_STRUCT_TYPE:
|
||||
case TYPE_SCH_HIERLABEL:
|
||||
case TYPE_SCH_GLOBALLABEL:
|
||||
#undef STRUCT
|
||||
#define STRUCT ( (DrawLabelStruct*) DrawStruct )
|
||||
#define STRUCT ( (SCH_LABEL*) DrawStruct )
|
||||
dx = STRUCT->m_Size.x * ( STRUCT->GetLength() + 1); /* longueur totale */
|
||||
dy = STRUCT->m_Size.y / 2; /* Demi hauteur */
|
||||
xt1 = xt2 = STRUCT->m_Pos.x;
|
||||
|
@ -628,10 +628,10 @@ bool DrawStructInBox( int x1, int y1, int x2, int y2,
|
|||
return TRUE;
|
||||
break;
|
||||
|
||||
case DRAW_LIB_ITEM_STRUCT_TYPE:
|
||||
case TYPE_SCH_COMPONENT:
|
||||
{
|
||||
#undef STRUCT
|
||||
#define STRUCT ( (EDA_SchComponentStruct*) DrawStruct )
|
||||
#define STRUCT ( (SCH_COMPONENT*) DrawStruct )
|
||||
EDA_Rect BoundaryBox = STRUCT->GetBoundaryBox();
|
||||
xt1 = BoundaryBox.GetX();
|
||||
yt1 = BoundaryBox.GetY();
|
||||
|
@ -1043,7 +1043,7 @@ int distance( int dx, int dy, int spot_cX, int spot_cY, int seuil )
|
|||
|
||||
/*******************************************************************/
|
||||
LibDrawPin* LocatePinByNumber( const wxString & ePin_Number,
|
||||
EDA_SchComponentStruct* eComponent )
|
||||
SCH_COMPONENT* eComponent )
|
||||
/*******************************************************************/
|
||||
|
||||
/** Find a PIN in a component
|
||||
|
@ -1096,7 +1096,7 @@ LibDrawPin* LocatePinByNumber( const wxString & ePin_Number,
|
|||
/*******************************************************************/
|
||||
LibEDA_BaseStruct* LocatePin( const wxPoint& RefPos,
|
||||
EDA_LibComponentStruct* Entry,
|
||||
int Unit, int convert, EDA_SchComponentStruct* DrawLibItem )
|
||||
int Unit, int convert, SCH_COMPONENT* DrawLibItem )
|
||||
/*******************************************************************/
|
||||
|
||||
/* Routine de localisation d'une PIN de la PartLib pointee par Entry
|
||||
|
@ -1198,19 +1198,19 @@ DrawSheetLabelStruct* LocateSheetLabel( DrawSheetStruct* Sheet, const wxPoint& p
|
|||
|
||||
/**************************************************************************/
|
||||
LibDrawPin* LocateAnyPin( EDA_BaseStruct* DrawList, const wxPoint& RefPos,
|
||||
EDA_SchComponentStruct** libpart )
|
||||
SCH_COMPONENT** libpart )
|
||||
/**************************************************************************/
|
||||
{
|
||||
EDA_BaseStruct* DrawStruct;
|
||||
EDA_LibComponentStruct* Entry;
|
||||
EDA_SchComponentStruct* LibItem = NULL;
|
||||
SCH_COMPONENT* LibItem = NULL;
|
||||
LibDrawPin* Pin = NULL;
|
||||
|
||||
for( DrawStruct = DrawList; DrawStruct != NULL; DrawStruct = DrawStruct->Pnext )
|
||||
{
|
||||
if( DrawStruct->Type() != DRAW_LIB_ITEM_STRUCT_TYPE )
|
||||
if( DrawStruct->Type() != TYPE_SCH_COMPONENT )
|
||||
continue;
|
||||
LibItem = (EDA_SchComponentStruct*) DrawStruct;
|
||||
LibItem = (SCH_COMPONENT*) DrawStruct;
|
||||
Entry = FindLibPart( LibItem->m_ChipName.GetData(), wxEmptyString, FIND_ROOT );
|
||||
if( Entry == NULL )
|
||||
continue;
|
||||
|
|
|
@ -24,10 +24,10 @@ static void WriteListOfNetsCADSTAR( FILE* f, ObjetNetListStruct* ObjNet );
|
|||
static void WriteNetListPspice( WinEDA_SchematicFrame* frame, FILE* f, bool use_netnames );
|
||||
|
||||
static void WriteGENERICListOfNets( FILE* f, ObjetNetListStruct* ObjNet );
|
||||
static void AddPinToComponentPinList( EDA_SchComponentStruct* Component,
|
||||
static void AddPinToComponentPinList( SCH_COMPONENT* Component,
|
||||
DrawSheetPath* sheet,
|
||||
LibDrawPin* PinEntry );
|
||||
static void FindOthersUnits( EDA_SchComponentStruct* Component, DrawSheetPath* Sheet_in);
|
||||
static void FindOthersUnits( SCH_COMPONENT* Component, DrawSheetPath* Sheet_in);
|
||||
static int SortPinsByNum( ObjetNetListStruct** Pin1, ObjetNetListStruct** Pin2 );
|
||||
static void EraseDuplicatePins( ObjetNetListStruct** TabPin, int NbrPin );
|
||||
|
||||
|
@ -92,7 +92,7 @@ void WriteNetList( WinEDA_SchematicFrame* frame, const wxString& FileNameNL,
|
|||
|
||||
|
||||
/****************************************************************************/
|
||||
static EDA_SchComponentStruct* FindNextComponentAndCreatPinList(
|
||||
static SCH_COMPONENT* FindNextComponentAndCreatPinList(
|
||||
EDA_BaseStruct* DrawList, DrawSheetPath* sheet)
|
||||
/****************************************************************************/
|
||||
|
||||
|
@ -105,7 +105,7 @@ static EDA_SchComponentStruct* FindNextComponentAndCreatPinList(
|
|||
* Must be deallocated by the user
|
||||
*/
|
||||
{
|
||||
EDA_SchComponentStruct* Component = NULL;
|
||||
SCH_COMPONENT* Component = NULL;
|
||||
EDA_LibComponentStruct* Entry;
|
||||
LibEDA_BaseStruct* DEntry;
|
||||
|
||||
|
@ -113,9 +113,9 @@ static EDA_SchComponentStruct* FindNextComponentAndCreatPinList(
|
|||
|
||||
for( ; DrawList != NULL; DrawList = DrawList->Next() )
|
||||
{
|
||||
if( DrawList->Type() != DRAW_LIB_ITEM_STRUCT_TYPE )
|
||||
if( DrawList->Type() != TYPE_SCH_COMPONENT )
|
||||
continue;
|
||||
Component = (EDA_SchComponentStruct*) DrawList;
|
||||
Component = (SCH_COMPONENT*) DrawList;
|
||||
|
||||
/* already tested ? : */
|
||||
bool found = false;
|
||||
|
@ -247,7 +247,7 @@ void Write_GENERIC_NetList( WinEDA_SchematicFrame* frame,
|
|||
wxString Line, FootprintName;
|
||||
DrawSheetPath* sheet;
|
||||
EDA_BaseStruct* DrawList;
|
||||
EDA_SchComponentStruct* Component;
|
||||
SCH_COMPONENT* Component;
|
||||
wxString netname;
|
||||
int ii;
|
||||
FILE* tmpfile;
|
||||
|
@ -363,9 +363,9 @@ static void ClearUsedFlags( WinEDA_SchematicFrame* frame )
|
|||
DrawList = screen->EEDrawList;
|
||||
while( DrawList )
|
||||
{
|
||||
if( DrawList->Type() == DRAW_LIB_ITEM_STRUCT_TYPE )
|
||||
if( DrawList->Type() == TYPE_SCH_COMPONENT )
|
||||
{
|
||||
EDA_SchComponentStruct* Component = (EDA_SchComponentStruct*) DrawList;
|
||||
SCH_COMPONENT* Component = (SCH_COMPONENT*) DrawList;
|
||||
//Component->m_FlagControlMulti = 0;
|
||||
Component->m_UsedOnSheets.Clear();
|
||||
}
|
||||
|
@ -394,7 +394,7 @@ static void WriteNetListPspice( WinEDA_SchematicFrame* frame, FILE* f,
|
|||
char Line[1024];
|
||||
DrawSheetPath* sheet;
|
||||
EDA_BaseStruct* DrawList;
|
||||
EDA_SchComponentStruct* Component;
|
||||
SCH_COMPONENT* Component;
|
||||
int ii, nbitems;
|
||||
wxString text;
|
||||
wxArrayString SpiceCommandAtBeginFile, SpiceCommandAtEndFile;
|
||||
|
@ -416,9 +416,9 @@ static void WriteNetListPspice( WinEDA_SchematicFrame* frame, FILE* f,
|
|||
for( DrawList = sheet->LastDrawList(); DrawList != NULL; DrawList = DrawList->Pnext )
|
||||
{
|
||||
wxChar ident;
|
||||
if( DrawList->Type() != DRAW_TEXT_STRUCT_TYPE )
|
||||
if( DrawList->Type() != TYPE_SCH_TEXT )
|
||||
continue;
|
||||
#define DRAWTEXT ( (DrawTextStruct*) DrawList )
|
||||
#define DRAWTEXT ( (SCH_TEXT*) DrawList )
|
||||
text = DRAWTEXT->m_Text; if( text.IsEmpty() )
|
||||
continue;
|
||||
ident = text.GetChar( 0 );
|
||||
|
@ -536,7 +536,7 @@ static void WriteNetListPCBNEW( WinEDA_SchematicFrame* frame, FILE* f, bool with
|
|||
char Buf[256];
|
||||
DrawSheetPath* sheet;
|
||||
EDA_BaseStruct* DrawList;
|
||||
EDA_SchComponentStruct* Component;
|
||||
SCH_COMPONENT* Component;
|
||||
int ii;
|
||||
ListComponent* CmpList = NULL;
|
||||
int CmpListCount = 0, CmpListSize = 1000;
|
||||
|
@ -675,7 +675,7 @@ static void WriteNetListPCBNEW( WinEDA_SchematicFrame* frame, FILE* f, bool with
|
|||
|
||||
|
||||
/*************************************************************************************/
|
||||
static void AddPinToComponentPinList( EDA_SchComponentStruct* Component,
|
||||
static void AddPinToComponentPinList( SCH_COMPONENT* Component,
|
||||
DrawSheetPath* sheetlist, LibDrawPin* Pin )
|
||||
/*************************************************************************************/
|
||||
|
||||
|
@ -742,7 +742,7 @@ static void EraseDuplicatePins( ObjetNetListStruct** TabPin, int NbrPin )
|
|||
|
||||
|
||||
/**********************************************************************/
|
||||
static void FindOthersUnits( EDA_SchComponentStruct* Component_in, DrawSheetPath* Sheet_in)
|
||||
static void FindOthersUnits( SCH_COMPONENT* Component_in, DrawSheetPath* Sheet_in)
|
||||
/**********************************************************************/
|
||||
|
||||
/* Recherche les autres parts du boitier auquel appartient la part Component,
|
||||
|
@ -751,7 +751,7 @@ static void FindOthersUnits( EDA_SchComponentStruct* Component_in, DrawSheetPath
|
|||
*/
|
||||
{
|
||||
EDA_BaseStruct* DrawList;
|
||||
EDA_SchComponentStruct* Component2;
|
||||
SCH_COMPONENT* Component2;
|
||||
EDA_LibComponentStruct* Entry;
|
||||
LibEDA_BaseStruct* DEntry;
|
||||
DrawSheetPath* sheet;
|
||||
|
@ -767,8 +767,8 @@ static void FindOthersUnits( EDA_SchComponentStruct* Component_in, DrawSheetPath
|
|||
{
|
||||
switch( DrawList->Type() )
|
||||
{
|
||||
case DRAW_LIB_ITEM_STRUCT_TYPE:
|
||||
Component2 = (EDA_SchComponentStruct*) DrawList;
|
||||
case TYPE_SCH_COMPONENT:
|
||||
Component2 = (SCH_COMPONENT*) DrawList;
|
||||
|
||||
found = false;
|
||||
for( i =0; i<Component2->m_UsedOnSheets.GetCount(); i++){
|
||||
|
@ -853,7 +853,7 @@ static void WriteGENERICListOfNets( FILE* f, ObjetNetListStruct* ObjNet )
|
|||
int ii, jj;
|
||||
int NetCode, LastNetCode = -1;
|
||||
int SameNetcodeCount = 0;
|
||||
EDA_SchComponentStruct* Cmp;
|
||||
SCH_COMPONENT* Cmp;
|
||||
wxString NetName, CmpRef;
|
||||
wxString NetcodeName;
|
||||
char FirstItemInNet[1024];
|
||||
|
@ -896,7 +896,7 @@ static void WriteGENERICListOfNets( FILE* f, ObjetNetListStruct* ObjNet )
|
|||
if( ObjNet[ii].m_Type != NET_PIN )
|
||||
continue;
|
||||
|
||||
Cmp = (EDA_SchComponentStruct*) ObjNet[ii].m_Link;
|
||||
Cmp = (SCH_COMPONENT*) ObjNet[ii].m_Link;
|
||||
CmpRef = Cmp->GetRef(&ObjNet[ii].m_SheetList); //is this correct?
|
||||
if( CmpRef.StartsWith( wxT( "#" ) ) )
|
||||
continue; // Pseudo component (Like Power symbol)
|
||||
|
@ -962,7 +962,7 @@ static void WriteNetListCADSTAR( WinEDA_SchematicFrame* frame, FILE* f )
|
|||
char Line[1024];
|
||||
DrawSheetPath* sheet;
|
||||
EDA_BaseStruct* DrawList;
|
||||
EDA_SchComponentStruct* Component;
|
||||
SCH_COMPONENT* Component;
|
||||
wxString Title = g_Main_Title + wxT( " " ) + GetBuildVersion();
|
||||
|
||||
fprintf( f, "%sHEA\n", CONV_TO_UTF8( StartLine ) );
|
||||
|
@ -1031,7 +1031,7 @@ static void WriteListOfNetsCADSTAR( FILE* f, ObjetNetListStruct* ObjNet )
|
|||
wxString NetcodeName, InitNetDescLine;
|
||||
int ii, jj, print_ter = 0;
|
||||
int NetCode, LastNetCode = -1;
|
||||
EDA_SchComponentStruct* Cmp;
|
||||
SCH_COMPONENT* Cmp;
|
||||
wxString NetName;
|
||||
|
||||
for( ii = 0; ii < g_NbrObjNet; ii++ )
|
||||
|
@ -1080,7 +1080,7 @@ static void WriteListOfNetsCADSTAR( FILE* f, ObjetNetListStruct* ObjNet )
|
|||
if( ObjNet[ii].m_Flag != 0 )
|
||||
continue;
|
||||
|
||||
Cmp = (EDA_SchComponentStruct*) ObjNet[ii].m_Link;
|
||||
Cmp = (SCH_COMPONENT*) ObjNet[ii].m_Link;
|
||||
wxString refstr = Cmp->GetRef(&(ObjNet[ii].m_SheetList));
|
||||
if( refstr[0] == '#' )
|
||||
continue; // Pseudo composant (symboles d'alims)
|
||||
|
@ -1127,8 +1127,8 @@ static void WriteListOfNetsCADSTAR( FILE* f, ObjetNetListStruct* ObjNet )
|
|||
break;
|
||||
if( ObjNet[jj].m_Type != NET_PIN )
|
||||
continue;
|
||||
EDA_SchComponentStruct* tstcmp =
|
||||
(EDA_SchComponentStruct*) ObjNet[jj].m_Link;
|
||||
SCH_COMPONENT* tstcmp =
|
||||
(SCH_COMPONENT*) ObjNet[jj].m_Link;
|
||||
wxString p = Cmp->GetPath( &( ObjNet[ii].m_SheetList ) );
|
||||
wxString tstp = tstcmp->GetPath( &( ObjNet[jj].m_SheetList ) );
|
||||
if( p.Cmp(tstp) != 0 )
|
||||
|
|
|
@ -449,7 +449,7 @@ static int ListeObjetConnection( WinEDA_SchematicFrame* frame, DrawSheetPath* sh
|
|||
{
|
||||
int ii, NbrItem = 0;
|
||||
EDA_BaseStruct* DrawList;
|
||||
EDA_SchComponentStruct* DrawLibItem;
|
||||
SCH_COMPONENT* DrawLibItem;
|
||||
int TransMat[2][2], PartX, PartY, x2, y2;
|
||||
EDA_LibComponentStruct* Entry;
|
||||
LibEDA_BaseStruct* DEntry;
|
||||
|
@ -517,9 +517,9 @@ static int ListeObjetConnection( WinEDA_SchematicFrame* frame, DrawSheetPath* sh
|
|||
NbrItem++;
|
||||
break;
|
||||
|
||||
case DRAW_LABEL_STRUCT_TYPE:
|
||||
case TYPE_SCH_LABEL:
|
||||
#undef STRUCT
|
||||
#define STRUCT ( (DrawLabelStruct*) DrawList )
|
||||
#define STRUCT ( (SCH_LABEL*) DrawList )
|
||||
ii = IsBusLabel( STRUCT->m_Text );
|
||||
if( ObjNet )
|
||||
{
|
||||
|
@ -542,10 +542,10 @@ static int ListeObjetConnection( WinEDA_SchematicFrame* frame, DrawSheetPath* sh
|
|||
NbrItem += ii + 1;
|
||||
break;
|
||||
|
||||
case DRAW_GLOBAL_LABEL_STRUCT_TYPE:
|
||||
case DRAW_HIER_LABEL_STRUCT_TYPE:
|
||||
case TYPE_SCH_GLOBALLABEL:
|
||||
case TYPE_SCH_HIERLABEL:
|
||||
#undef STRUCT
|
||||
#define STRUCT ( (DrawLabelStruct*) DrawList )
|
||||
#define STRUCT ( (SCH_LABEL*) DrawList )
|
||||
ii = IsBusLabel( STRUCT->m_Text );
|
||||
if( ObjNet )
|
||||
{
|
||||
|
@ -568,8 +568,8 @@ static int ListeObjetConnection( WinEDA_SchematicFrame* frame, DrawSheetPath* sh
|
|||
NbrItem += ii + 1;
|
||||
break;
|
||||
|
||||
case DRAW_LIB_ITEM_STRUCT_TYPE:
|
||||
DrawLibItem = (EDA_SchComponentStruct*) DrawList;
|
||||
case TYPE_SCH_COMPONENT:
|
||||
DrawLibItem = (SCH_COMPONENT*) DrawList;
|
||||
|
||||
memcpy( TransMat, DrawLibItem->m_Transform, sizeof(TransMat) );
|
||||
|
||||
|
@ -645,7 +645,7 @@ static int ListeObjetConnection( WinEDA_SchematicFrame* frame, DrawSheetPath* sh
|
|||
case DRAW_POLYLINE_STRUCT_TYPE:
|
||||
case DRAW_BUSENTRY_STRUCT_TYPE:
|
||||
case DRAW_MARKER_STRUCT_TYPE:
|
||||
case DRAW_TEXT_STRUCT_TYPE:
|
||||
case TYPE_SCH_TEXT:
|
||||
break;
|
||||
|
||||
case DRAW_SHEET_STRUCT_TYPE:
|
||||
|
|
|
@ -99,7 +99,7 @@ typedef struct ListLabel
|
|||
} ListLabel;
|
||||
typedef struct ListComponent
|
||||
{
|
||||
EDA_SchComponentStruct * m_Comp;
|
||||
SCH_COMPONENT * m_Comp;
|
||||
char m_Ref[32];
|
||||
//have to store it here since the object refrerences will be duplicated.
|
||||
DrawSheetPath m_SheetList; //composed of UIDs
|
||||
|
@ -109,7 +109,7 @@ typedef struct ListComponent
|
|||
struct CmpListStruct
|
||||
{
|
||||
public:
|
||||
EDA_SchComponentStruct* m_Cmp; /* Pointeur sur le composant */
|
||||
SCH_COMPONENT* 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 */
|
||||
|
|
|
@ -39,15 +39,15 @@ void WinEDA_SchematicFrame::OnLeftClick( wxDC* DC, const wxPoint& MousePos )
|
|||
{
|
||||
switch( DrawStruct->Type() )
|
||||
{
|
||||
case DRAW_LABEL_STRUCT_TYPE:
|
||||
case DRAW_GLOBAL_LABEL_STRUCT_TYPE:
|
||||
case DRAW_HIER_LABEL_STRUCT_TYPE:
|
||||
case DRAW_TEXT_STRUCT_TYPE:
|
||||
case TYPE_SCH_LABEL:
|
||||
case TYPE_SCH_GLOBALLABEL:
|
||||
case TYPE_SCH_HIERLABEL:
|
||||
case TYPE_SCH_TEXT:
|
||||
case DRAW_SHEETLABEL_STRUCT_TYPE:
|
||||
case DRAW_SHEET_STRUCT_TYPE:
|
||||
case DRAW_BUSENTRY_STRUCT_TYPE:
|
||||
case DRAW_JUNCTION_STRUCT_TYPE:
|
||||
case DRAW_LIB_ITEM_STRUCT_TYPE:
|
||||
case TYPE_SCH_COMPONENT:
|
||||
case DRAW_PART_TEXT_STRUCT_TYPE:
|
||||
DrawStruct->Place( this, DC );
|
||||
GetScreen()->SetCurItem( NULL );
|
||||
|
@ -354,16 +354,16 @@ void WinEDA_SchematicFrame::OnLeftDClick( wxDC* DC, const wxPoint& MousePos )
|
|||
InstallNextScreen( (DrawSheetStruct*) DrawStruct );
|
||||
break;
|
||||
|
||||
case DRAW_LIB_ITEM_STRUCT_TYPE:
|
||||
InstallCmpeditFrame( this, pos, (EDA_SchComponentStruct*) DrawStruct );
|
||||
case TYPE_SCH_COMPONENT:
|
||||
InstallCmpeditFrame( this, pos, (SCH_COMPONENT*) DrawStruct );
|
||||
DrawPanel->MouseToCursorSchema();
|
||||
break;
|
||||
|
||||
case DRAW_TEXT_STRUCT_TYPE:
|
||||
case DRAW_LABEL_STRUCT_TYPE:
|
||||
case DRAW_GLOBAL_LABEL_STRUCT_TYPE:
|
||||
case DRAW_HIER_LABEL_STRUCT_TYPE:
|
||||
EditSchematicText( (DrawTextStruct*) DrawStruct, DC );
|
||||
case TYPE_SCH_TEXT:
|
||||
case TYPE_SCH_LABEL:
|
||||
case TYPE_SCH_GLOBALLABEL:
|
||||
case TYPE_SCH_HIERLABEL:
|
||||
EditSchematicText( (SCH_TEXT*) DrawStruct, DC );
|
||||
break;
|
||||
|
||||
case DRAW_PART_TEXT_STRUCT_TYPE:
|
||||
|
|
|
@ -55,11 +55,11 @@ static void AddMenusForBus( wxMenu* PopMenu, EDA_DrawLineStruct* Bus,
|
|||
WinEDA_SchematicFrame* frame );
|
||||
static void AddMenusForHierchicalSheet( wxMenu* PopMenu, DrawSheetStruct* Sheet );
|
||||
static void AddMenusForPinSheet( wxMenu* PopMenu, DrawSheetLabelStruct* PinSheet );
|
||||
static void AddMenusForText( wxMenu* PopMenu, DrawTextStruct* Text );
|
||||
static void AddMenusForLabel( wxMenu* PopMenu, DrawLabelStruct* Label );
|
||||
static void AddMenusForGLabel( wxMenu* PopMenu, DrawGlobalLabelStruct* GLabel );
|
||||
static void AddMenusForHLabel( wxMenu* PopMenu, DrawHierLabelStruct* GLabel );
|
||||
static void AddMenusForComponent( wxMenu* PopMenu, EDA_SchComponentStruct* Component );
|
||||
static void AddMenusForText( wxMenu* PopMenu, SCH_TEXT* Text );
|
||||
static void AddMenusForLabel( wxMenu* PopMenu, SCH_LABEL* Label );
|
||||
static void AddMenusForGLabel( wxMenu* PopMenu, SCH_GLOBALLABEL* GLabel );
|
||||
static void AddMenusForHLabel( wxMenu* PopMenu, SCH_HIERLABEL* GLabel );
|
||||
static void AddMenusForComponent( wxMenu* PopMenu, SCH_COMPONENT* Component );
|
||||
static void AddMenusForComponentField( wxMenu* PopMenu, PartTextStruct* Field );
|
||||
static void AddMenusForJunction( wxMenu* PopMenu, DrawJunctionStruct* Junction,
|
||||
WinEDA_SchematicFrame* frame );
|
||||
|
@ -182,20 +182,20 @@ bool WinEDA_SchematicFrame::OnRightClick( const wxPoint& MousePos,
|
|||
ADD_MENUITEM( PopMenu, ID_POPUP_SCH_DELETE, _( "delete Marker" ), delete_xpm );
|
||||
break;
|
||||
|
||||
case DRAW_TEXT_STRUCT_TYPE:
|
||||
AddMenusForText( PopMenu, (DrawTextStruct*) DrawStruct );
|
||||
case TYPE_SCH_TEXT:
|
||||
AddMenusForText( PopMenu, (SCH_TEXT*) DrawStruct );
|
||||
break;
|
||||
|
||||
case DRAW_LABEL_STRUCT_TYPE:
|
||||
AddMenusForLabel( PopMenu, (DrawLabelStruct*) DrawStruct );
|
||||
case TYPE_SCH_LABEL:
|
||||
AddMenusForLabel( PopMenu, (SCH_LABEL*) DrawStruct );
|
||||
break;
|
||||
|
||||
case DRAW_GLOBAL_LABEL_STRUCT_TYPE:
|
||||
AddMenusForGLabel( PopMenu, (DrawGlobalLabelStruct*) DrawStruct );
|
||||
case TYPE_SCH_GLOBALLABEL:
|
||||
AddMenusForGLabel( PopMenu, (SCH_GLOBALLABEL*) DrawStruct );
|
||||
break;
|
||||
|
||||
case DRAW_HIER_LABEL_STRUCT_TYPE:
|
||||
AddMenusForHLabel( PopMenu, (DrawHierLabelStruct*) DrawStruct );
|
||||
case TYPE_SCH_HIERLABEL:
|
||||
AddMenusForHLabel( PopMenu, (SCH_HIERLABEL*) DrawStruct );
|
||||
break;
|
||||
|
||||
case DRAW_PART_TEXT_STRUCT_TYPE:
|
||||
|
@ -205,17 +205,17 @@ bool WinEDA_SchematicFrame::OnRightClick( const wxPoint& MousePos,
|
|||
break;
|
||||
|
||||
// Many fields are inside a component. If this is the case, add the component menu
|
||||
EDA_SchComponentStruct* Component = LocateSmallestComponent( (SCH_SCREEN*)GetScreen() );
|
||||
SCH_COMPONENT* Component = LocateSmallestComponent( (SCH_SCREEN*)GetScreen() );
|
||||
if( Component )
|
||||
{
|
||||
PopMenu->AppendSeparator();
|
||||
AddMenusForComponent( PopMenu, (EDA_SchComponentStruct*) DrawStruct );
|
||||
AddMenusForComponent( PopMenu, (SCH_COMPONENT*) DrawStruct );
|
||||
}
|
||||
}
|
||||
break;
|
||||
|
||||
case DRAW_LIB_ITEM_STRUCT_TYPE:
|
||||
AddMenusForComponent( PopMenu, (EDA_SchComponentStruct*) DrawStruct );
|
||||
case TYPE_SCH_COMPONENT:
|
||||
AddMenusForComponent( PopMenu, (SCH_COMPONENT*) DrawStruct );
|
||||
break;
|
||||
|
||||
case DRAW_SEGMENT_STRUCT_TYPE:
|
||||
|
@ -278,7 +278,7 @@ void AddMenusForComponentField( wxMenu* PopMenu, PartTextStruct* Field )
|
|||
|
||||
|
||||
/**************************************************************************/
|
||||
void AddMenusForComponent( wxMenu* PopMenu, EDA_SchComponentStruct* Component )
|
||||
void AddMenusForComponent( wxMenu* PopMenu, SCH_COMPONENT* Component )
|
||||
/**************************************************************************/
|
||||
|
||||
/* Add menu commands for a component
|
||||
|
@ -363,7 +363,7 @@ void AddMenusForComponent( wxMenu* PopMenu, EDA_SchComponentStruct* Component )
|
|||
|
||||
|
||||
/*******************************************************************/
|
||||
void AddMenusForGLabel( wxMenu* PopMenu, DrawGlobalLabelStruct* GLabel )
|
||||
void AddMenusForGLabel( wxMenu* PopMenu, SCH_GLOBALLABEL* GLabel )
|
||||
/*******************************************************************/
|
||||
|
||||
/* Add menu commands for a Global Label
|
||||
|
@ -388,7 +388,7 @@ void AddMenusForGLabel( wxMenu* PopMenu, DrawGlobalLabelStruct* GLabel )
|
|||
ID_POPUP_SCH_CHANGE_TYPE_TEXT, _( "Change Type" ), gl_change_xpm );
|
||||
}
|
||||
/*******************************************************************/
|
||||
void AddMenusForHLabel( wxMenu* PopMenu, DrawHierLabelStruct* HLabel )
|
||||
void AddMenusForHLabel( wxMenu* PopMenu, SCH_HIERLABEL* HLabel )
|
||||
/*******************************************************************/
|
||||
/* Add menu commands for a hierarchal Label
|
||||
*/
|
||||
|
@ -414,7 +414,7 @@ void AddMenusForHLabel( wxMenu* PopMenu, DrawHierLabelStruct* HLabel )
|
|||
|
||||
|
||||
/*****************************************************************/
|
||||
void AddMenusForLabel( wxMenu* PopMenu, DrawLabelStruct* Label )
|
||||
void AddMenusForLabel( wxMenu* PopMenu, SCH_LABEL* Label )
|
||||
/*****************************************************************/
|
||||
|
||||
/* Add menu commands for a Label
|
||||
|
@ -441,7 +441,7 @@ void AddMenusForLabel( wxMenu* PopMenu, DrawLabelStruct* Label )
|
|||
|
||||
|
||||
/*****************************************************************/
|
||||
void AddMenusForText( wxMenu* PopMenu, DrawTextStruct* Text )
|
||||
void AddMenusForText( wxMenu* PopMenu, SCH_TEXT* Text )
|
||||
/*****************************************************************/
|
||||
|
||||
/* Add menu commands for a Text (a comment)
|
||||
|
|
|
@ -16,7 +16,7 @@
|
|||
|
||||
/* Variables locales : */
|
||||
static void PlotSheetLabelStruct( DrawSheetLabelStruct* Struct );
|
||||
static void PlotTextField( EDA_SchComponentStruct* DrawLibItem,
|
||||
static void PlotTextField( SCH_COMPONENT* DrawLibItem,
|
||||
int FieldNumber, int IsMulti, int DrawMode );
|
||||
static void PlotPinSymbol( int posX, int posY, int len, int orient, int Shape );
|
||||
|
||||
|
@ -164,7 +164,7 @@ void PlotNoConnectStruct( DrawNoConnectStruct* Struct )
|
|||
|
||||
|
||||
/*************************************************/
|
||||
void PlotLibPart( EDA_SchComponentStruct* DrawLibItem )
|
||||
void PlotLibPart( SCH_COMPONENT* DrawLibItem )
|
||||
/*************************************************/
|
||||
/* Genere le trace d'un composant */
|
||||
{
|
||||
|
@ -342,7 +342,7 @@ void PlotLibPart( EDA_SchComponentStruct* DrawLibItem )
|
|||
|
||||
|
||||
/*************************************************************/
|
||||
static void PlotTextField( EDA_SchComponentStruct* DrawLibItem,
|
||||
static void PlotTextField( SCH_COMPONENT* DrawLibItem,
|
||||
int FieldNumber, int IsMulti, int DrawMode )
|
||||
/**************************************************************/
|
||||
|
||||
|
@ -553,22 +553,22 @@ void PlotTextStruct( EDA_BaseStruct* Struct )
|
|||
|
||||
switch( Struct->Type() )
|
||||
{
|
||||
case DRAW_GLOBAL_LABEL_STRUCT_TYPE:
|
||||
case DRAW_HIER_LABEL_STRUCT_TYPE:
|
||||
case DRAW_LABEL_STRUCT_TYPE:
|
||||
case DRAW_TEXT_STRUCT_TYPE:
|
||||
Text = ( (DrawTextStruct*) Struct )->m_Text;
|
||||
Size = ( (DrawTextStruct*) Struct )->m_Size;
|
||||
Orient = ( (DrawTextStruct*) Struct )->m_Orient;
|
||||
Shape = ( (DrawTextStruct*) Struct )->m_Shape;
|
||||
pX = ( (DrawTextStruct*) Struct )->m_Pos.x;
|
||||
pY = ( (DrawTextStruct*) Struct )->m_Pos.y;
|
||||
case TYPE_SCH_GLOBALLABEL:
|
||||
case TYPE_SCH_HIERLABEL:
|
||||
case TYPE_SCH_LABEL:
|
||||
case TYPE_SCH_TEXT:
|
||||
Text = ( (SCH_TEXT*) Struct )->m_Text;
|
||||
Size = ( (SCH_TEXT*) Struct )->m_Size;
|
||||
Orient = ( (SCH_TEXT*) Struct )->m_Orient;
|
||||
Shape = ( (SCH_TEXT*) Struct )->m_Shape;
|
||||
pX = ( (SCH_TEXT*) Struct )->m_Pos.x;
|
||||
pY = ( (SCH_TEXT*) Struct )->m_Pos.y;
|
||||
offset = TXTMARGE;
|
||||
if( Struct->Type() == DRAW_GLOBAL_LABEL_STRUCT_TYPE
|
||||
|| Struct->Type() == DRAW_HIER_LABEL_STRUCT_TYPE )
|
||||
if( Struct->Type() == TYPE_SCH_GLOBALLABEL
|
||||
|| Struct->Type() == TYPE_SCH_HIERLABEL )
|
||||
offset += Size.x; // We must draw the Glabel graphic symbol
|
||||
if( (g_PlotFormat == PLOT_FORMAT_POST) && g_PlotPSColorOpt )
|
||||
color = ReturnLayerColor( ( (DrawTextStruct*) Struct )->m_Layer );
|
||||
color = ReturnLayerColor( ( (SCH_TEXT*) Struct )->m_Layer );
|
||||
break;
|
||||
|
||||
default:
|
||||
|
@ -580,9 +580,9 @@ void PlotTextStruct( EDA_BaseStruct* Struct )
|
|||
|
||||
SetCurrentLineWidth( -1 );
|
||||
|
||||
if ( Struct->Type() == DRAW_GLOBAL_LABEL_STRUCT_TYPE )
|
||||
if ( Struct->Type() == TYPE_SCH_GLOBALLABEL )
|
||||
{
|
||||
offset = ( (DrawGlobalLabelStruct*) Struct )->m_Width;
|
||||
offset = ( (SCH_GLOBALLABEL*) Struct )->m_Width;
|
||||
switch( Shape )
|
||||
{
|
||||
case NET_INPUT:
|
||||
|
@ -604,7 +604,7 @@ void PlotTextStruct( EDA_BaseStruct* Struct )
|
|||
switch( Orient )
|
||||
{
|
||||
case 0: /* Orientation horiz normale */
|
||||
if( Struct->Type() == DRAW_GLOBAL_LABEL_STRUCT_TYPE || Struct->Type() == DRAW_HIER_LABEL_STRUCT_TYPE )
|
||||
if( Struct->Type() == TYPE_SCH_GLOBALLABEL || Struct->Type() == TYPE_SCH_HIERLABEL )
|
||||
PlotGraphicText( g_PlotFormat, wxPoint( pX - offset, pY ),
|
||||
color, Text, TEXT_ORIENT_HORIZ, Size,
|
||||
GR_TEXT_HJUSTIFY_RIGHT, GR_TEXT_VJUSTIFY_CENTER );
|
||||
|
@ -615,7 +615,7 @@ void PlotTextStruct( EDA_BaseStruct* Struct )
|
|||
break;
|
||||
|
||||
case 1: /* Orientation vert UP */
|
||||
if( Struct->Type() == DRAW_GLOBAL_LABEL_STRUCT_TYPE || Struct->Type() == DRAW_HIER_LABEL_STRUCT_TYPE )
|
||||
if( Struct->Type() == TYPE_SCH_GLOBALLABEL || Struct->Type() == TYPE_SCH_HIERLABEL )
|
||||
PlotGraphicText( g_PlotFormat, wxPoint( pX, pY + offset ),
|
||||
color, Text, TEXT_ORIENT_VERT, Size,
|
||||
GR_TEXT_HJUSTIFY_CENTER, GR_TEXT_VJUSTIFY_TOP );
|
||||
|
@ -626,7 +626,7 @@ void PlotTextStruct( EDA_BaseStruct* Struct )
|
|||
break;
|
||||
|
||||
case 2: /* Horiz Orientation - Right justified */
|
||||
if( Struct->Type() == DRAW_GLOBAL_LABEL_STRUCT_TYPE || Struct->Type() == DRAW_HIER_LABEL_STRUCT_TYPE )
|
||||
if( Struct->Type() == TYPE_SCH_GLOBALLABEL || Struct->Type() == TYPE_SCH_HIERLABEL )
|
||||
PlotGraphicText( g_PlotFormat, wxPoint( pX + offset, pY ),
|
||||
color, Text, TEXT_ORIENT_HORIZ, Size,
|
||||
GR_TEXT_HJUSTIFY_LEFT, GR_TEXT_VJUSTIFY_CENTER );
|
||||
|
@ -637,7 +637,7 @@ void PlotTextStruct( EDA_BaseStruct* Struct )
|
|||
break;
|
||||
|
||||
case 3: /* Orientation vert BOTTOM */
|
||||
if( Struct->Type() == DRAW_GLOBAL_LABEL_STRUCT_TYPE || Struct->Type() == DRAW_HIER_LABEL_STRUCT_TYPE )
|
||||
if( Struct->Type() == TYPE_SCH_GLOBALLABEL || Struct->Type() == TYPE_SCH_HIERLABEL )
|
||||
PlotGraphicText( g_PlotFormat, wxPoint( pX, pY - offset ),
|
||||
color, Text, TEXT_ORIENT_VERT, Size,
|
||||
GR_TEXT_HJUSTIFY_CENTER, GR_TEXT_VJUSTIFY_BOTTOM );
|
||||
|
@ -649,14 +649,14 @@ void PlotTextStruct( EDA_BaseStruct* Struct )
|
|||
}
|
||||
|
||||
/* Draw graphic symbol for global or hierachical labels */
|
||||
if( Struct->Type() == DRAW_GLOBAL_LABEL_STRUCT_TYPE )
|
||||
if( Struct->Type() == TYPE_SCH_GLOBALLABEL )
|
||||
{
|
||||
( (DrawGlobalLabelStruct*) Struct )->CreateGraphicShape( Poly, wxPoint(pX, pY) );
|
||||
( (SCH_GLOBALLABEL*) Struct )->CreateGraphicShape( Poly, wxPoint(pX, pY) );
|
||||
PlotPoly( Poly[0], Poly + 1, NOFILL );
|
||||
}
|
||||
if( Struct->Type() == DRAW_HIER_LABEL_STRUCT_TYPE )
|
||||
if( Struct->Type() == TYPE_SCH_HIERLABEL )
|
||||
{
|
||||
( (DrawHierLabelStruct*) Struct )->CreateGraphicShape( Poly, wxPoint(pX, pY) );
|
||||
( (SCH_HIERLABEL*) Struct )->CreateGraphicShape( Poly, wxPoint(pX, pY) );
|
||||
PlotPoly( Poly[0], Poly + 1, NOFILL );
|
||||
}
|
||||
}
|
||||
|
|
|
@ -552,7 +552,7 @@ void WinEDA_PlotHPGLFrame::Plot_1_Page_HPGL(const wxString & FullFileName,
|
|||
*/
|
||||
{
|
||||
EDA_BaseStruct *DrawList;
|
||||
EDA_SchComponentStruct *DrawLibItem;
|
||||
SCH_COMPONENT *DrawLibItem;
|
||||
int x1=0, y1=0, x2=0, y2=0, layer;
|
||||
wxString msg;
|
||||
|
||||
|
@ -635,15 +635,15 @@ wxString msg;
|
|||
PlotCercle( wxPoint(x1,y1), DRAWJUNCTION_SIZE * 2);
|
||||
break;
|
||||
|
||||
case DRAW_TEXT_STRUCT_TYPE :
|
||||
case DRAW_LABEL_STRUCT_TYPE :
|
||||
case DRAW_GLOBAL_LABEL_STRUCT_TYPE :
|
||||
case DRAW_HIER_LABEL_STRUCT_TYPE :
|
||||
case TYPE_SCH_TEXT :
|
||||
case TYPE_SCH_LABEL :
|
||||
case TYPE_SCH_GLOBALLABEL :
|
||||
case TYPE_SCH_HIERLABEL :
|
||||
PlotTextStruct(DrawList);
|
||||
break;
|
||||
|
||||
case DRAW_LIB_ITEM_STRUCT_TYPE :
|
||||
DrawLibItem = (EDA_SchComponentStruct *) DrawList;
|
||||
case TYPE_SCH_COMPONENT :
|
||||
DrawLibItem = (SCH_COMPONENT *) DrawList;
|
||||
PlotLibPart( DrawLibItem );
|
||||
break;
|
||||
|
||||
|
|
|
@ -380,7 +380,7 @@ void WinEDA_PlotPSFrame::PlotOneSheetPS(const wxString & FileName,
|
|||
{
|
||||
wxString Line;
|
||||
EDA_BaseStruct *DrawList;
|
||||
EDA_SchComponentStruct *DrawLibItem;
|
||||
SCH_COMPONENT *DrawLibItem;
|
||||
int layer;
|
||||
wxPoint StartPos, EndPos;
|
||||
|
||||
|
@ -471,15 +471,15 @@ wxPoint StartPos, EndPos;
|
|||
PlotCercle( STRUCT->m_Pos, DRAWJUNCTION_SIZE);
|
||||
break;
|
||||
|
||||
case DRAW_TEXT_STRUCT_TYPE :
|
||||
case DRAW_LABEL_STRUCT_TYPE :
|
||||
case DRAW_GLOBAL_LABEL_STRUCT_TYPE :
|
||||
case DRAW_HIER_LABEL_STRUCT_TYPE :
|
||||
case TYPE_SCH_TEXT :
|
||||
case TYPE_SCH_LABEL :
|
||||
case TYPE_SCH_GLOBALLABEL :
|
||||
case TYPE_SCH_HIERLABEL :
|
||||
PlotTextStruct(DrawList);
|
||||
break;
|
||||
|
||||
case DRAW_LIB_ITEM_STRUCT_TYPE :
|
||||
DrawLibItem = (EDA_SchComponentStruct *) DrawList;
|
||||
case TYPE_SCH_COMPONENT :
|
||||
DrawLibItem = (SCH_COMPONENT *) DrawList;
|
||||
PlotLibPart( DrawLibItem );
|
||||
break;
|
||||
|
||||
|
|
|
@ -5,7 +5,7 @@ void FreeLibraryEntry(LibCmpEntry * Entry);
|
|||
|
||||
LibEDA_BaseStruct * LocatePin(const wxPoint & RefPos,
|
||||
EDA_LibComponentStruct * Entry,
|
||||
int Unit, int Convert, EDA_SchComponentStruct * DrawItem = NULL);
|
||||
int Unit, int Convert, SCH_COMPONENT * DrawItem = NULL);
|
||||
/* Routine de localisation d'une PIN de la PartLib pointee par Entry */
|
||||
|
||||
const wxString& ReturnDefaultFieldName( int aFieldNdx );
|
||||
|
@ -36,7 +36,7 @@ void IncrementLabelMember(wxString & name);
|
|||
/* EDITPART.CPP */
|
||||
/****************/
|
||||
void InstallCmpeditFrame(WinEDA_SchematicFrame * parent, wxPoint & pos,
|
||||
EDA_SchComponentStruct * m_Cmp);
|
||||
SCH_COMPONENT * m_Cmp);
|
||||
|
||||
|
||||
/**************/
|
||||
|
@ -49,7 +49,7 @@ int NumOfLibraries();
|
|||
EDA_LibComponentStruct *FindLibPart(const wxChar *Name, const wxString & LibName, int Alias);
|
||||
|
||||
void DrawingLibInGhost(WinEDA_DrawPanel * panel, wxDC * DC, EDA_LibComponentStruct *LibEntry,
|
||||
EDA_SchComponentStruct * DrawLibItem, int PartX, int PartY,
|
||||
SCH_COMPONENT * DrawLibItem, int PartX, int PartY,
|
||||
int Multi, int convert,
|
||||
int Color, bool DrawPinText);
|
||||
|
||||
|
@ -84,9 +84,9 @@ void FreeCmpLibrary(wxWindow * frame, const wxString & LibName);
|
|||
const wxChar **GetLibNames();
|
||||
|
||||
void SnapLibItemPoint(int OrigX, int OrigY, int *ClosestX, int *ClosestY,
|
||||
EDA_SchComponentStruct *DrawLibItem);
|
||||
SCH_COMPONENT *DrawLibItem);
|
||||
bool LibItemInBox(int x1, int y1, int x2, int y2,
|
||||
EDA_SchComponentStruct *DrawLibItem);
|
||||
SCH_COMPONENT *DrawLibItem);
|
||||
void DrawTextField(WinEDA_DrawPanel * panel, wxDC * DC, PartTextStruct * Field, int IsMulti, int DrawMode);
|
||||
/* Routine de trace des textes type Field du composant.
|
||||
entree:
|
||||
|
@ -117,9 +117,9 @@ bool DrawStructInBox(int x1, int y1, int x2, int y2,
|
|||
/* LOCATE.CPP */
|
||||
/*************/
|
||||
LibDrawPin* LocatePinByNumber( const wxString & ePin_Number,
|
||||
EDA_SchComponentStruct* eComponent );
|
||||
SCH_COMPONENT* eComponent );
|
||||
|
||||
EDA_SchComponentStruct * LocateSmallestComponent( SCH_SCREEN * Screen );
|
||||
SCH_COMPONENT * LocateSmallestComponent( SCH_SCREEN * Screen );
|
||||
/* Recherche du plus petit (en surface) composant pointe par la souris */
|
||||
|
||||
EDA_BaseStruct * PickStruct(EDA_Rect & block,
|
||||
|
@ -168,7 +168,7 @@ LibEDA_BaseStruct * LocateDrawItem(SCH_SCREEN * Screen, const wxPoint & refpoint
|
|||
|
||||
DrawSheetLabelStruct * LocateSheetLabel(DrawSheetStruct *Sheet, const wxPoint & pos);
|
||||
LibDrawPin * LocateAnyPin(EDA_BaseStruct *DrawList, const wxPoint & RefPos,
|
||||
EDA_SchComponentStruct ** libpart = NULL );
|
||||
SCH_COMPONENT ** libpart = NULL );
|
||||
|
||||
DrawSheetLabelStruct * LocateAnyPinSheet(const wxPoint & RefPos,
|
||||
EDA_BaseStruct *DrawList);
|
||||
|
@ -315,7 +315,7 @@ void PlotCercle(wxPoint centre, int diametre, int width = -1);
|
|||
void PlotPoly( int nb, int * coord, int fill, int width = -1);
|
||||
|
||||
void PlotNoConnectStruct(DrawNoConnectStruct * Struct);
|
||||
void PlotLibPart( EDA_SchComponentStruct *DrawLibItem );
|
||||
void PlotLibPart( SCH_COMPONENT *DrawLibItem );
|
||||
/* Genere le trace d'un composant */
|
||||
void PlotSheetStruct(DrawSheetStruct *Struct);
|
||||
/* Routine de dessin du bloc type hierarchie */
|
||||
|
|
|
@ -20,7 +20,7 @@
|
|||
/* Fonctions externes */
|
||||
|
||||
/* Fonctions Locales */
|
||||
static int SavePartDescr( FILE *f, EDA_SchComponentStruct * LibItemStruct);
|
||||
static int SavePartDescr( FILE *f, SCH_COMPONENT * LibItemStruct);
|
||||
static int SaveSheetDescr( FILE *f, DrawSheetStruct * SheetStruct);
|
||||
static void SaveLayers(FILE *f);
|
||||
|
||||
|
@ -145,8 +145,8 @@ bool WinEDA_SchematicFrame::SaveEEFile(SCH_SCREEN *screen, int FileSave)
|
|||
{
|
||||
switch(Phead->Type())
|
||||
{
|
||||
case DRAW_LIB_ITEM_STRUCT_TYPE: /* Its a library item. */
|
||||
SavePartDescr( f, (EDA_SchComponentStruct *) Phead);
|
||||
case TYPE_SCH_COMPONENT: /* Its a library item. */
|
||||
SavePartDescr( f, (SCH_COMPONENT *) Phead);
|
||||
break;
|
||||
|
||||
case DRAW_SHEET_STRUCT_TYPE: /* Its a Sheet item. */
|
||||
|
@ -237,9 +237,9 @@ bool WinEDA_SchematicFrame::SaveEEFile(SCH_SCREEN *screen, int FileSave)
|
|||
}
|
||||
break;
|
||||
|
||||
case DRAW_TEXT_STRUCT_TYPE: /* Its a text item. */
|
||||
case TYPE_SCH_TEXT: /* Its a text item. */
|
||||
#undef STRUCT
|
||||
#define STRUCT ((DrawTextStruct *) Phead)
|
||||
#define STRUCT ((SCH_TEXT *) Phead)
|
||||
if (fprintf(f, "Text Notes %-4d %-4d %-4d %-4d ~\n%s\n",
|
||||
STRUCT->m_Pos.x, STRUCT->m_Pos.y,
|
||||
STRUCT->m_Orient, STRUCT->m_Size.x,
|
||||
|
@ -248,9 +248,9 @@ bool WinEDA_SchematicFrame::SaveEEFile(SCH_SCREEN *screen, int FileSave)
|
|||
break;
|
||||
|
||||
|
||||
case DRAW_LABEL_STRUCT_TYPE: /* Its a label item. */
|
||||
case TYPE_SCH_LABEL: /* Its a label item. */
|
||||
#undef STRUCT
|
||||
#define STRUCT ((DrawLabelStruct *) Phead)
|
||||
#define STRUCT ((SCH_LABEL *) Phead)
|
||||
shape = '~';
|
||||
if (fprintf(f, "Text Label %-4d %-4d %-4d %-4d %c\n%s\n",
|
||||
STRUCT->m_Pos.x, STRUCT->m_Pos.y,
|
||||
|
@ -259,9 +259,9 @@ bool WinEDA_SchematicFrame::SaveEEFile(SCH_SCREEN *screen, int FileSave)
|
|||
Failed = TRUE;
|
||||
break;
|
||||
|
||||
case DRAW_GLOBAL_LABEL_STRUCT_TYPE: /* Its a Global label item. */
|
||||
case TYPE_SCH_GLOBALLABEL: /* Its a Global label item. */
|
||||
#undef STRUCT
|
||||
#define STRUCT ((DrawGlobalLabelStruct *) Phead)
|
||||
#define STRUCT ((SCH_GLOBALLABEL *) Phead)
|
||||
shape = STRUCT->m_Shape;
|
||||
if (fprintf(f, "Text GLabel %-4d %-4d %-4d %-4d %s\n%s\n",
|
||||
STRUCT->m_Pos.x, STRUCT->m_Pos.y,
|
||||
|
@ -271,9 +271,9 @@ bool WinEDA_SchematicFrame::SaveEEFile(SCH_SCREEN *screen, int FileSave)
|
|||
Failed = TRUE;
|
||||
break;
|
||||
|
||||
case DRAW_HIER_LABEL_STRUCT_TYPE: /* Its a Hierarchical label item. */
|
||||
case TYPE_SCH_HIERLABEL: /* Its a Hierarchical label item. */
|
||||
#undef STRUCT
|
||||
#define STRUCT ((DrawHierLabelStruct *) Phead)
|
||||
#define STRUCT ((SCH_HIERLABEL *) Phead)
|
||||
shape = STRUCT->m_Shape;
|
||||
if (fprintf(f, "Text HLabel %-4d %-4d %-4d %-4d %s\n%s\n",
|
||||
STRUCT->m_Pos.x, STRUCT->m_Pos.y,
|
||||
|
@ -324,7 +324,7 @@ bool WinEDA_SchematicFrame::SaveEEFile(SCH_SCREEN *screen, int FileSave)
|
|||
|
||||
|
||||
/*******************************************************************/
|
||||
static int SavePartDescr( FILE *f, EDA_SchComponentStruct * LibItemStruct)
|
||||
static int SavePartDescr( FILE *f, SCH_COMPONENT * LibItemStruct)
|
||||
/*******************************************************************/
|
||||
/* Routine utilisee dans la routine precedente.
|
||||
Assure la sauvegarde de la structure LibItemStruct
|
||||
|
|
|
@ -273,36 +273,36 @@ void WinEDA_SchematicFrame::Process_Special_Functions( wxCommandEvent& event )
|
|||
break;
|
||||
|
||||
case ID_POPUP_SCH_EDIT_TEXT:
|
||||
EditSchematicText( (DrawTextStruct*) GetScreen()->GetCurItem(), &dc );
|
||||
EditSchematicText( (SCH_TEXT*) GetScreen()->GetCurItem(), &dc );
|
||||
break;
|
||||
|
||||
case ID_POPUP_SCH_ROTATE_TEXT:
|
||||
DrawPanel->MouseToCursorSchema();
|
||||
ChangeTextOrient( (DrawTextStruct*) GetScreen()->GetCurItem(), &dc );
|
||||
ChangeTextOrient( (SCH_TEXT*) GetScreen()->GetCurItem(), &dc );
|
||||
break;
|
||||
|
||||
case ID_POPUP_SCH_CHANGE_TYPE_TEXT_TO_LABEL:
|
||||
DrawPanel->MouseToCursorSchema();
|
||||
ConvertTextType( (DrawTextStruct*) GetScreen()->GetCurItem(),
|
||||
&dc, DRAW_LABEL_STRUCT_TYPE );
|
||||
ConvertTextType( (SCH_TEXT*) GetScreen()->GetCurItem(),
|
||||
&dc, TYPE_SCH_LABEL );
|
||||
break;
|
||||
|
||||
case ID_POPUP_SCH_CHANGE_TYPE_TEXT_TO_GLABEL:
|
||||
DrawPanel->MouseToCursorSchema();
|
||||
ConvertTextType( (DrawTextStruct*) GetScreen()->GetCurItem(),
|
||||
&dc, DRAW_GLOBAL_LABEL_STRUCT_TYPE );
|
||||
ConvertTextType( (SCH_TEXT*) GetScreen()->GetCurItem(),
|
||||
&dc, TYPE_SCH_GLOBALLABEL );
|
||||
break;
|
||||
|
||||
case ID_POPUP_SCH_CHANGE_TYPE_TEXT_TO_HLABEL:
|
||||
DrawPanel->MouseToCursorSchema();
|
||||
ConvertTextType( (DrawTextStruct*) GetScreen()->GetCurItem(),
|
||||
&dc, DRAW_HIER_LABEL_STRUCT_TYPE );
|
||||
ConvertTextType( (SCH_TEXT*) GetScreen()->GetCurItem(),
|
||||
&dc, TYPE_SCH_HIERLABEL );
|
||||
break;
|
||||
|
||||
case ID_POPUP_SCH_CHANGE_TYPE_TEXT_TO_COMMENT:
|
||||
DrawPanel->MouseToCursorSchema();
|
||||
ConvertTextType( (DrawTextStruct*) GetScreen()->GetCurItem(),
|
||||
&dc, DRAW_TEXT_STRUCT_TYPE );
|
||||
ConvertTextType( (SCH_TEXT*) GetScreen()->GetCurItem(),
|
||||
&dc, TYPE_SCH_TEXT );
|
||||
break;
|
||||
|
||||
case ID_POPUP_SCH_SET_SHAPE_TEXT:
|
||||
|
@ -347,7 +347,7 @@ void WinEDA_SchematicFrame::Process_Special_Functions( wxCommandEvent& event )
|
|||
|
||||
// Ensure the struct is a component (could be a struct of a
|
||||
// component, like Field, text..)
|
||||
if( GetScreen()->GetCurItem()->Type() != DRAW_LIB_ITEM_STRUCT_TYPE )
|
||||
if( GetScreen()->GetCurItem()->Type() != TYPE_SCH_COMPONENT )
|
||||
GetScreen()->SetCurItem( LocateSmallestComponent( (SCH_SCREEN*)
|
||||
GetScreen() ) );
|
||||
|
||||
|
@ -403,7 +403,7 @@ void WinEDA_SchematicFrame::Process_Special_Functions( wxCommandEvent& event )
|
|||
|
||||
// Ensure the struct is a component (could be a struct of a
|
||||
// component, like Field, text..)
|
||||
if( GetScreen()->GetCurItem()->Type() != DRAW_LIB_ITEM_STRUCT_TYPE )
|
||||
if( GetScreen()->GetCurItem()->Type() != TYPE_SCH_COMPONENT )
|
||||
GetScreen()->SetCurItem( LocateSmallestComponent( (SCH_SCREEN*)
|
||||
GetScreen() ) );
|
||||
if( GetScreen()->GetCurItem() == NULL )
|
||||
|
@ -431,13 +431,13 @@ void WinEDA_SchematicFrame::Process_Special_Functions( wxCommandEvent& event )
|
|||
|
||||
// Ensure the struct is a component (could be a struct of a
|
||||
// component, like Field, text..)
|
||||
if( GetScreen()->GetCurItem()->Type() != DRAW_LIB_ITEM_STRUCT_TYPE )
|
||||
if( GetScreen()->GetCurItem()->Type() != TYPE_SCH_COMPONENT )
|
||||
GetScreen()->SetCurItem( LocateSmallestComponent( (SCH_SCREEN*)
|
||||
GetScreen() ) );
|
||||
if( GetScreen()->GetCurItem() == NULL )
|
||||
break;
|
||||
InstallCmpeditFrame( this, pos,
|
||||
(EDA_SchComponentStruct*) GetScreen()->GetCurItem() );
|
||||
(SCH_COMPONENT*) GetScreen()->GetCurItem() );
|
||||
break;
|
||||
|
||||
case ID_POPUP_SCH_MIROR_X_CMP:
|
||||
|
@ -448,7 +448,7 @@ void WinEDA_SchematicFrame::Process_Special_Functions( wxCommandEvent& event )
|
|||
|
||||
// Ensure the struct is a component (could be a struct of a
|
||||
// component, like Field, text..)
|
||||
if( GetScreen()->GetCurItem()->Type() != DRAW_LIB_ITEM_STRUCT_TYPE )
|
||||
if( GetScreen()->GetCurItem()->Type() != TYPE_SCH_COMPONENT )
|
||||
GetScreen()->SetCurItem( LocateSmallestComponent( (SCH_SCREEN*)
|
||||
GetScreen() ) );
|
||||
if( GetScreen()->GetCurItem() == NULL )
|
||||
|
@ -480,7 +480,7 @@ void WinEDA_SchematicFrame::Process_Special_Functions( wxCommandEvent& event )
|
|||
SaveCopyInUndoList( GetScreen()->GetCurItem(), IS_CHANGED );
|
||||
|
||||
CmpRotationMiroir(
|
||||
(EDA_SchComponentStruct*) GetScreen()->GetCurItem(),
|
||||
(SCH_COMPONENT*) GetScreen()->GetCurItem(),
|
||||
&dc, option );
|
||||
break;
|
||||
}
|
||||
|
@ -493,41 +493,41 @@ void WinEDA_SchematicFrame::Process_Special_Functions( wxCommandEvent& event )
|
|||
|
||||
// Ensure the struct is a component (could be a struct of a
|
||||
// component, like Field, text..)
|
||||
if( GetScreen()->GetCurItem()->Type() != DRAW_LIB_ITEM_STRUCT_TYPE )
|
||||
if( GetScreen()->GetCurItem()->Type() != TYPE_SCH_COMPONENT )
|
||||
GetScreen()->SetCurItem( LocateSmallestComponent( (SCH_SCREEN*)
|
||||
GetScreen() ) );
|
||||
if( GetScreen()->GetCurItem() == NULL )
|
||||
break;
|
||||
|
||||
EditComponentValue(
|
||||
(EDA_SchComponentStruct*) GetScreen()->GetCurItem(), &dc );
|
||||
(SCH_COMPONENT*) GetScreen()->GetCurItem(), &dc );
|
||||
break;
|
||||
|
||||
case ID_POPUP_SCH_EDIT_REF_CMP:
|
||||
|
||||
// Ensure the struct is a component (could be a struct of a
|
||||
// component, like Field, text..)
|
||||
if( GetScreen()->GetCurItem()->Type() != DRAW_LIB_ITEM_STRUCT_TYPE )
|
||||
if( GetScreen()->GetCurItem()->Type() != TYPE_SCH_COMPONENT )
|
||||
GetScreen()->SetCurItem( LocateSmallestComponent( (SCH_SCREEN*)
|
||||
GetScreen() ) );
|
||||
if( GetScreen()->GetCurItem() == NULL )
|
||||
break;
|
||||
|
||||
EditComponentReference(
|
||||
(EDA_SchComponentStruct*) GetScreen()->GetCurItem(), &dc );
|
||||
(SCH_COMPONENT*) GetScreen()->GetCurItem(), &dc );
|
||||
break;
|
||||
|
||||
case ID_POPUP_SCH_EDIT_FOOTPRINT_CMP:
|
||||
|
||||
// Ensure the struct is a component (could be a struct of a
|
||||
// component, like Field, text..)
|
||||
if( GetScreen()->GetCurItem()->Type() != DRAW_LIB_ITEM_STRUCT_TYPE )
|
||||
if( GetScreen()->GetCurItem()->Type() != TYPE_SCH_COMPONENT )
|
||||
GetScreen()->SetCurItem( LocateSmallestComponent( (SCH_SCREEN*)
|
||||
GetScreen() ) );
|
||||
if( GetScreen()->GetCurItem() == NULL )
|
||||
break;
|
||||
EditComponentFootprint(
|
||||
(EDA_SchComponentStruct*) GetScreen()->GetCurItem(), &dc );
|
||||
(SCH_COMPONENT*) GetScreen()->GetCurItem(), &dc );
|
||||
break;
|
||||
|
||||
|
||||
|
@ -535,25 +535,25 @@ void WinEDA_SchematicFrame::Process_Special_Functions( wxCommandEvent& event )
|
|||
|
||||
// Ensure the struct is a component (could be a struct of a
|
||||
// component, like Field, text..)
|
||||
if( GetScreen()->GetCurItem()->Type() != DRAW_LIB_ITEM_STRUCT_TYPE )
|
||||
if( GetScreen()->GetCurItem()->Type() != TYPE_SCH_COMPONENT )
|
||||
GetScreen()->SetCurItem( LocateSmallestComponent( (SCH_SCREEN*)
|
||||
GetScreen() ) );
|
||||
if( GetScreen()->GetCurItem() == NULL )
|
||||
break;
|
||||
DrawPanel->MouseToCursorSchema();
|
||||
ConvertPart(
|
||||
(EDA_SchComponentStruct*) GetScreen()->GetCurItem(),
|
||||
(SCH_COMPONENT*) GetScreen()->GetCurItem(),
|
||||
&dc );
|
||||
break;
|
||||
|
||||
case ID_POPUP_SCH_COPY_COMPONENT_CMP:
|
||||
DrawPanel->MouseToCursorSchema();
|
||||
{
|
||||
EDA_SchComponentStruct* olditem, * newitem;
|
||||
if( GetScreen()->GetCurItem()->Type() != DRAW_LIB_ITEM_STRUCT_TYPE )
|
||||
SCH_COMPONENT* olditem, * newitem;
|
||||
if( GetScreen()->GetCurItem()->Type() != TYPE_SCH_COMPONENT )
|
||||
GetScreen()->SetCurItem( LocateSmallestComponent( (SCH_SCREEN*)
|
||||
GetScreen() ) );
|
||||
olditem = (EDA_SchComponentStruct*) GetScreen()->GetCurItem();
|
||||
olditem = (SCH_COMPONENT*) GetScreen()->GetCurItem();
|
||||
if( olditem == NULL )
|
||||
break;
|
||||
newitem = olditem->GenCopy();
|
||||
|
@ -597,14 +597,14 @@ void WinEDA_SchematicFrame::Process_Special_Functions( wxCommandEvent& event )
|
|||
|
||||
// Ensure the struct is a component (could be a struct of a
|
||||
// component, like Field, text..)
|
||||
if( GetScreen()->GetCurItem()->Type() != DRAW_LIB_ITEM_STRUCT_TYPE )
|
||||
if( GetScreen()->GetCurItem()->Type() != TYPE_SCH_COMPONENT )
|
||||
GetScreen()->SetCurItem( LocateSmallestComponent( (SCH_SCREEN*)
|
||||
GetScreen() ) );
|
||||
if( GetScreen()->GetCurItem() == NULL )
|
||||
break;
|
||||
DrawPanel->MouseToCursorSchema();
|
||||
SelPartUnit(
|
||||
(EDA_SchComponentStruct*) GetScreen()->GetCurItem(),
|
||||
(SCH_COMPONENT*) GetScreen()->GetCurItem(),
|
||||
id + 1 - ID_POPUP_SCH_SELECT_UNIT1,
|
||||
&dc );
|
||||
break;
|
||||
|
@ -613,7 +613,7 @@ void WinEDA_SchematicFrame::Process_Special_Functions( wxCommandEvent& event )
|
|||
|
||||
// Ensure the struct is a component (could be a piece of a
|
||||
// component, like Field, text..)
|
||||
if( GetScreen()->GetCurItem()->Type() != DRAW_LIB_ITEM_STRUCT_TYPE )
|
||||
if( GetScreen()->GetCurItem()->Type() != TYPE_SCH_COMPONENT )
|
||||
GetScreen()->SetCurItem( LocateSmallestComponent( (SCH_SCREEN*)
|
||||
GetScreen() ) );
|
||||
if( GetScreen()->GetCurItem() == NULL )
|
||||
|
@ -621,7 +621,7 @@ void WinEDA_SchematicFrame::Process_Special_Functions( wxCommandEvent& event )
|
|||
{
|
||||
EDA_LibComponentStruct* LibEntry;
|
||||
LibEntry = FindLibPart(
|
||||
( (EDA_SchComponentStruct*) GetScreen()->GetCurItem() )->m_ChipName,
|
||||
( (SCH_COMPONENT*) GetScreen()->GetCurItem() )->m_ChipName,
|
||||
wxEmptyString,
|
||||
FIND_ALIAS );
|
||||
if( LibEntry && LibEntry->m_DocFile != wxEmptyString )
|
||||
|
@ -755,15 +755,15 @@ void WinEDA_SchematicFrame::Process_Move_Item( EDA_BaseStruct* DrawStruct,
|
|||
StartMoveBusEntry( (DrawBusEntryStruct*) DrawStruct, DC );
|
||||
break;
|
||||
|
||||
case DRAW_LABEL_STRUCT_TYPE:
|
||||
case DRAW_GLOBAL_LABEL_STRUCT_TYPE:
|
||||
case DRAW_HIER_LABEL_STRUCT_TYPE:
|
||||
case DRAW_TEXT_STRUCT_TYPE:
|
||||
StartMoveTexte( (DrawTextStruct*) DrawStruct, DC );
|
||||
case TYPE_SCH_LABEL:
|
||||
case TYPE_SCH_GLOBALLABEL:
|
||||
case TYPE_SCH_HIERLABEL:
|
||||
case TYPE_SCH_TEXT:
|
||||
StartMoveTexte( (SCH_TEXT*) DrawStruct, DC );
|
||||
break;
|
||||
|
||||
case DRAW_LIB_ITEM_STRUCT_TYPE:
|
||||
StartMovePart( (EDA_SchComponentStruct*) DrawStruct, DC );
|
||||
case TYPE_SCH_COMPONENT:
|
||||
StartMovePart( (SCH_COMPONENT*) DrawStruct, DC );
|
||||
break;
|
||||
|
||||
case DRAW_SEGMENT_STRUCT_TYPE:
|
||||
|
|
|
@ -90,22 +90,22 @@ void SwapData( EDA_BaseStruct* Item )
|
|||
EXCHG( SOURCE->m_Pos, DEST->m_Pos );
|
||||
break;
|
||||
|
||||
case DRAW_LABEL_STRUCT_TYPE:
|
||||
case DRAW_GLOBAL_LABEL_STRUCT_TYPE:
|
||||
case DRAW_HIER_LABEL_STRUCT_TYPE:
|
||||
case DRAW_TEXT_STRUCT_TYPE:
|
||||
case TYPE_SCH_LABEL:
|
||||
case TYPE_SCH_GLOBALLABEL:
|
||||
case TYPE_SCH_HIERLABEL:
|
||||
case TYPE_SCH_TEXT:
|
||||
#undef SOURCE
|
||||
#undef DEST
|
||||
#define SOURCE ( (DrawTextStruct*) Item )
|
||||
#define DEST ( (DrawTextStruct*) image )
|
||||
#define SOURCE ( (SCH_TEXT*) Item )
|
||||
#define DEST ( (SCH_TEXT*) image )
|
||||
DEST->SwapData( SOURCE );
|
||||
break;
|
||||
|
||||
case DRAW_LIB_ITEM_STRUCT_TYPE:
|
||||
case TYPE_SCH_COMPONENT:
|
||||
#undef SOURCE
|
||||
#undef DEST
|
||||
#define SOURCE ( (EDA_SchComponentStruct*) Item )
|
||||
#define DEST ( (EDA_SchComponentStruct*) image )
|
||||
#define SOURCE ( (SCH_COMPONENT*) Item )
|
||||
#define DEST ( (SCH_COMPONENT*) image )
|
||||
DEST->SwapData( SOURCE );
|
||||
break;
|
||||
|
||||
|
|
|
@ -71,7 +71,7 @@ public:
|
|||
|
||||
/* Cross probing with pcbnew */
|
||||
void SendMessageToPCBNEW( EDA_BaseStruct* objectToSync,
|
||||
EDA_SchComponentStruct* LibItem );
|
||||
SCH_COMPONENT* LibItem );
|
||||
|
||||
/* netlist generation */
|
||||
void* BuildNetListBase();
|
||||
|
@ -144,10 +144,10 @@ private:
|
|||
|
||||
// Text ,label, glabel
|
||||
EDA_BaseStruct* CreateNewText( wxDC* DC, int type );
|
||||
void EditSchematicText( DrawTextStruct* TextStruct, wxDC* DC );
|
||||
void ChangeTextOrient( DrawTextStruct* TextStruct, wxDC* DC );
|
||||
void StartMoveTexte( DrawTextStruct* TextStruct, wxDC* DC );
|
||||
void ConvertTextType( DrawTextStruct* Text, wxDC* DC, int newtype );
|
||||
void EditSchematicText( SCH_TEXT* TextStruct, wxDC* DC );
|
||||
void ChangeTextOrient( SCH_TEXT* TextStruct, wxDC* DC );
|
||||
void StartMoveTexte( SCH_TEXT* TextStruct, wxDC* DC );
|
||||
void ConvertTextType( SCH_TEXT* Text, wxDC* DC, int newtype );
|
||||
|
||||
// Wire, Bus
|
||||
void BeginSegment( wxDC* DC, int type );
|
||||
|
@ -188,25 +188,25 @@ public:
|
|||
private:
|
||||
|
||||
// Component
|
||||
EDA_SchComponentStruct* Load_Component( wxDC* DC,
|
||||
SCH_COMPONENT* Load_Component( wxDC* DC,
|
||||
const wxString& libname,
|
||||
wxArrayString& List,
|
||||
bool UseLibBrowser );
|
||||
void StartMovePart( EDA_SchComponentStruct* DrawLibItem, wxDC* DC );
|
||||
void StartMovePart( SCH_COMPONENT* DrawLibItem, wxDC* DC );
|
||||
|
||||
public:
|
||||
void CmpRotationMiroir( EDA_SchComponentStruct* DrawComponent,
|
||||
void CmpRotationMiroir( SCH_COMPONENT* DrawComponent,
|
||||
wxDC* DC, int type_rotate );
|
||||
|
||||
private:
|
||||
void SelPartUnit( EDA_SchComponentStruct* DrawComponent,
|
||||
void SelPartUnit( SCH_COMPONENT* DrawComponent,
|
||||
int unit, wxDC* DC );
|
||||
void ConvertPart( EDA_SchComponentStruct* DrawComponent, wxDC* DC );
|
||||
void SetInitCmp( EDA_SchComponentStruct* DrawComponent, wxDC* DC );
|
||||
void EditComponentReference( EDA_SchComponentStruct* DrawLibItem,
|
||||
void ConvertPart( SCH_COMPONENT* DrawComponent, wxDC* DC );
|
||||
void SetInitCmp( SCH_COMPONENT* DrawComponent, wxDC* DC );
|
||||
void EditComponentReference( SCH_COMPONENT* DrawLibItem,
|
||||
wxDC* DC );
|
||||
void EditComponentValue( EDA_SchComponentStruct* DrawLibItem, wxDC* DC );
|
||||
void EditComponentFootprint( EDA_SchComponentStruct* DrawLibItem,
|
||||
void EditComponentValue( SCH_COMPONENT* DrawLibItem, wxDC* DC );
|
||||
void EditComponentFootprint( SCH_COMPONENT* DrawLibItem,
|
||||
wxDC* DC );
|
||||
void StartMoveCmpField( PartTextStruct* Field, wxDC* DC );
|
||||
void EditCmpFieldText( PartTextStruct* Field, wxDC* DC );
|
||||
|
|
|
@ -359,16 +359,16 @@ DrawSheetLabelStruct* WinEDA_SchematicFrame::Import_PinSheet( DrawSheetStruct* S
|
|||
{
|
||||
EDA_BaseStruct* DrawStruct;
|
||||
DrawSheetLabelStruct* NewSheetLabel, * SheetLabel = NULL;
|
||||
DrawHierLabelStruct* HLabel = NULL;
|
||||
SCH_HIERLABEL* HLabel = NULL;
|
||||
|
||||
if(!Sheet->m_AssociatedScreen) return NULL;
|
||||
DrawStruct = Sheet->m_AssociatedScreen->EEDrawList;
|
||||
HLabel = NULL;
|
||||
for( ; DrawStruct != NULL; DrawStruct = DrawStruct->Pnext )
|
||||
{
|
||||
if( DrawStruct->Type() != DRAW_HIER_LABEL_STRUCT_TYPE )
|
||||
if( DrawStruct->Type() != TYPE_SCH_HIERLABEL )
|
||||
continue;
|
||||
HLabel = (DrawHierLabelStruct*) DrawStruct;
|
||||
HLabel = (SCH_HIERLABEL*) DrawStruct;
|
||||
|
||||
/* Ici un G-Label a ete trouve: y a t-il un SheetLabel correspondant */
|
||||
SheetLabel = Sheet->m_Label;
|
||||
|
|
|
@ -47,11 +47,11 @@ enum KICAD_T {
|
|||
// Draw Items in schematic
|
||||
DRAW_POLYLINE_STRUCT_TYPE,
|
||||
DRAW_JUNCTION_STRUCT_TYPE,
|
||||
DRAW_TEXT_STRUCT_TYPE,
|
||||
DRAW_LABEL_STRUCT_TYPE,
|
||||
DRAW_GLOBAL_LABEL_STRUCT_TYPE,
|
||||
DRAW_HIER_LABEL_STRUCT_TYPE,
|
||||
DRAW_LIB_ITEM_STRUCT_TYPE,
|
||||
TYPE_SCH_TEXT,
|
||||
TYPE_SCH_LABEL,
|
||||
TYPE_SCH_GLOBALLABEL,
|
||||
TYPE_SCH_HIERLABEL,
|
||||
TYPE_SCH_COMPONENT,
|
||||
DRAW_PICK_ITEM_STRUCT_TYPE,
|
||||
DRAW_SEGMENT_STRUCT_TYPE,
|
||||
DRAW_BUSENTRY_STRUCT_TYPE,
|
||||
|
@ -357,6 +357,10 @@ public:
|
|||
*/
|
||||
virtual EDA_Rect GetBoundingBox()
|
||||
{
|
||||
#if defined (DEBUG)
|
||||
printf("Missing GetBoundingBox() -> no good! :-)\n");
|
||||
Show( 0, std::cout ); // tell me which classes still need GetBoundingBox support
|
||||
#endif
|
||||
// return a zero-sized box per default. derived classes should override this
|
||||
EDA_Rect ret( wxPoint( 0, 0 ), wxSize( 0, 0 ) );
|
||||
return ret;
|
||||
|
@ -668,18 +672,44 @@ public:
|
|||
};
|
||||
|
||||
|
||||
/**************************/
|
||||
/* class DrawPickedStruct */
|
||||
/**************************/
|
||||
/**
|
||||
* Class SCH_ITEM
|
||||
* is a base class for any item which can be embedded within the SCHEMATIC
|
||||
* container class, and therefore instances of derived classes should only be
|
||||
* found in EESCHEMA or other programs that use class SCHEMATIC and its contents.
|
||||
* The corresponding class in PCBNEW is BOARD_ITEM.
|
||||
*/
|
||||
class SCH_ITEM : public EDA_BaseStruct
|
||||
{
|
||||
protected:
|
||||
int m_Layer;
|
||||
|
||||
/* Class to hold structures picked by pick events (like block selection)
|
||||
|
||||
public:
|
||||
SCH_ITEM( EDA_BaseStruct* aParent, KICAD_T aType ) :
|
||||
EDA_BaseStruct( aParent, aType ),
|
||||
m_Layer( 0 )
|
||||
{
|
||||
}
|
||||
|
||||
~SCH_ITEM(){}
|
||||
|
||||
virtual wxString GetClass() const
|
||||
{
|
||||
return wxT( "SCH_ITEM" );
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
/**
|
||||
* Class DrawPickedStruct
|
||||
* holds structures picked by pick events (like block selection).
|
||||
* This class has only one useful member: .m_PickedStruct, used as a link.
|
||||
* It does not describe really an item.
|
||||
* It is used to create a linked list of selected items (in block selection).
|
||||
* Each DrawPickedStruct item has is member: .m_PickedStruct pointing the
|
||||
* real selected item
|
||||
* real selected item.
|
||||
*/
|
||||
class DrawPickedStruct : public EDA_BaseStruct
|
||||
class DrawPickedStruct : public SCH_ITEM
|
||||
{
|
||||
public:
|
||||
EDA_BaseStruct* m_PickedStruct;
|
||||
|
@ -691,6 +721,22 @@ public:
|
|||
void DeleteWrapperList();
|
||||
|
||||
DrawPickedStruct* Next() { return (DrawPickedStruct*) Pnext; }
|
||||
|
||||
EDA_Rect GetBoundingBox();
|
||||
|
||||
/**
|
||||
* Function GetBoundingBoxUnion
|
||||
* returns the union of all the BoundingBox rectangles of all held items
|
||||
* in the picklist whose list head is this DrawPickedStruct.
|
||||
* @return EDA_Rect - The combined, composite, bounding box.
|
||||
*/
|
||||
EDA_Rect GetBoundingBoxUnion();
|
||||
|
||||
wxString GetClass() const { return wxT( "DrawPickedStruct" ); }
|
||||
|
||||
#if defined(DEBUG)
|
||||
void Show( int nestLevel, std::ostream& os );
|
||||
#endif
|
||||
};
|
||||
|
||||
#endif /* BASE_STRUCT_H */
|
||||
|
|
|
@ -71,13 +71,13 @@ class EDA_LibComponentStruct;
|
|||
class LibEDA_BaseStruct;
|
||||
class EDA_BaseStruct;
|
||||
class DrawBusEntryStruct;
|
||||
class DrawGlobalLabelStruct;
|
||||
class DrawTextStruct;
|
||||
class SCH_GLOBALLABEL;
|
||||
class SCH_TEXT;
|
||||
class EDA_DrawLineStruct;
|
||||
class DrawSheetStruct;
|
||||
class DrawSheetPath;
|
||||
class DrawSheetLabelStruct;
|
||||
class EDA_SchComponentStruct;
|
||||
class SCH_COMPONENT;
|
||||
class LibDrawField;
|
||||
class PartTextStruct;
|
||||
class LibDrawPin;
|
||||
|
|
|
@ -934,7 +934,7 @@ typedef boost::ptr_vector<WINDOW> WINDOWS;
|
|||
|
||||
/**
|
||||
* Class KEEPOUT
|
||||
* is used for <keepout_descriptor> and <plane_descriptor>.
|
||||
* is used for <keepout_descriptor> and <plane_descriptor>.
|
||||
*/
|
||||
class KEEPOUT : public ELEM
|
||||
{
|
||||
|
|
Loading…
Reference in New Issue