Loading eeschema/block.cpp +10 −2 Original line number Diff line number Diff line Loading @@ -932,7 +932,8 @@ void DeleteStruct( WinEDA_DrawPanel* panel, wxDC* DC, EDA_BaseStruct* DrawStruct if( DrawStruct->Type() == DRAW_SHEETLABEL_STRUCT_TYPE ) { /* Cette stucture est rattachee a une feuille, et n'est pas { /* Cette stucture est rattachee a une feuille, et n'est pas * accessible par la liste globale directement */ frame->SaveCopyInUndoList( ( (DrawSheetLabelStruct*) DrawStruct )->m_Parent, IS_CHANGED ); frame->DeleteSheetLabel( DC, (DrawSheetLabelStruct*) DrawStruct ); Loading Loading @@ -961,7 +962,14 @@ void DeleteStruct( WinEDA_DrawPanel* panel, wxDC* DC, EDA_BaseStruct* DrawStruct { screen->RemoveFromDrawList( DrawStruct ); if( DrawStruct->Type() == DRAW_SEGMENT_STRUCT_TYPE ) { D( printf("PostDirtyRect()\n"); ) panel->PostDirtyRect( ((EDA_DrawLineStruct*)DrawStruct)->GetBoundingBox() ); } else RedrawOneStruct( panel, DC, DrawStruct, g_XorMode ); /* Unlink the structure */ DrawStruct->Pnext = DrawStruct->Pback = NULL; // Only one struct -> no link if( DrawStruct->Type() == DRAW_SHEET_STRUCT_TYPE ) Loading eeschema/cmpclass.cpp +25 −6 Original line number Diff line number Diff line Loading @@ -240,6 +240,25 @@ void EDA_DrawLineStruct::Show( int nestLevel, std::ostream& os ) #endif EDA_Rect EDA_DrawLineStruct::GetBoundingBox() const { int width = 25; int xmin = MIN( m_Start.x, m_End.x ) - width; int ymin = MIN( m_Start.y, m_End.y ) - width; int xmax = MAX( m_Start.x, m_End.x ) + width; int ymax = MAX( m_Start.y, m_End.y ) + width; // return a rectangle which is [pos,dim) in nature. therefore the +1 EDA_Rect ret( wxPoint( xmin, ymin ), wxSize( xmax-xmin+1, ymax-ymin+1 ) ); return ret; } /****************************/ /* Class DrawPolylineStruct */ /****************************/ Loading eeschema/delete.cpp +518 −442 Original line number Diff line number Diff line Loading @@ -20,22 +20,26 @@ static int CountConnectedItems( WinEDA_SchematicFrame* frame, EDA_BaseStruct* ListStruct, wxPoint pos, bool TstJunction ) /********************************************************************************/ /* Count number of items connected to point pos : pins, end wire or bus, and junctions if TstJunction == TRUE Return this count Used by WinEDA_SchematicFrame::DeleteConnection() /* Count number of items connected to point pos : * pins, end wire or bus, and junctions if TstJunction == TRUE * Return this count * * Used by WinEDA_SchematicFrame::DeleteConnection() */ { EDA_BaseStruct* Struct; int count = 0; if ( frame->LocatePinEnd(ListStruct, pos) ) count++; if( frame->LocatePinEnd( ListStruct, pos ) ) count++; for( Struct = ListStruct; Struct != NULL; Struct = Struct->Pnext ) { if ( Struct->m_Flags & STRUCT_DELETED ) continue; if ( Struct->m_Flags & SKIP_STRUCT ) continue; if( Struct->m_Flags & STRUCT_DELETED ) continue; if( Struct->m_Flags & SKIP_STRUCT ) continue; if( TstJunction && (Struct->Type() == DRAW_JUNCTION_STRUCT_TYPE) ) Loading @@ -46,39 +50,47 @@ int count = 0; #undef JUNCTION } if ( Struct->Type() != DRAW_SEGMENT_STRUCT_TYPE ) continue; if( Struct->Type() != DRAW_SEGMENT_STRUCT_TYPE ) continue; #define SEGM ( (EDA_DrawLineStruct*) Struct ) if ( SEGM->IsOneEndPointAt(pos) ) count++; if( SEGM->IsOneEndPointAt( pos ) ) count++; #undef SEGM } return count; } /************************************************************************************/ static bool MarkConnected( WinEDA_SchematicFrame* frame, EDA_BaseStruct* ListStruct, EDA_DrawLineStruct* segment ) /************************************************************************************/ /* Mark to "CANDIDATE" all wires or junction connected to "segment" in list "ListStruct" Search wire stop at an any pin Used by WinEDA_SchematicFrame::DeleteConnection() /* Mark to "CANDIDATE" all wires or junction connected to "segment" in list "ListStruct" * Search wire stop at an any pin * * Used by WinEDA_SchematicFrame::DeleteConnection() */ { EDA_BaseStruct* Struct; for( Struct = ListStruct; Struct != NULL; Struct = Struct->Pnext ) { if ( Struct->m_Flags ) continue; if( Struct->m_Flags ) continue; if( Struct->Type() == DRAW_JUNCTION_STRUCT_TYPE ) { #define JUNCTION ( (DrawJunctionStruct*) Struct ) if ( segment->IsOneEndPointAt(JUNCTION->m_Pos) ) Struct->m_Flags |= CANDIDATE; if( segment->IsOneEndPointAt( JUNCTION->m_Pos ) ) Struct->m_Flags |= CANDIDATE; continue; #undef JUNCTION } if ( Struct->Type() != DRAW_SEGMENT_STRUCT_TYPE ) continue; if( Struct->Type() != DRAW_SEGMENT_STRUCT_TYPE ) continue; #define SEGM ( (EDA_DrawLineStruct*) Struct ) if( segment->IsOneEndPointAt( SEGM->m_Start ) ) Loading @@ -103,11 +115,13 @@ EDA_BaseStruct * Struct; return TRUE; } /********************************************************************************/ void WinEDA_SchematicFrame::DeleteConnection( wxDC* DC, bool DeleteFullConnection ) /********************************************************************************/ /* Delete a connection, i.e wires or bus connected stop on a node (more than 2 wires (bus) connected) * stop on a node (more than 2 wires (bus) connected) */ { wxPoint refpos = GetScreen()->m_Curseur; Loading @@ -122,33 +136,40 @@ DrawPickedStruct * PickedItem, *PickedList = NULL; DelStruct = GetScreen()->EEDrawList; /* Locate all the wires, bus or junction under the mouse cursor, and put them in a list of items to delete * of items to delete */ SCH_SCREEN* screen = (SCH_SCREEN*) GetScreen(); EDA_BaseStruct* savedEEDrawList = screen->EEDrawList; while ( DelStruct && (DelStruct = PickStruct(screen->m_Curseur, while( DelStruct && ( DelStruct = PickStruct( screen->m_Curseur, screen, JUNCTIONITEM | WIREITEM | BUSITEM ) ) != NULL ) { DelStruct->m_Flags = SELECTEDNODE | STRUCT_DELETED; /* Put this structure in the picked list: */ PickedItem = new DrawPickedStruct( DelStruct ); PickedItem->Pnext = PickedList; PickedList = PickedItem; DelStruct = DelStruct->Pnext; screen->EEDrawList = DelStruct; } GetScreen()->EEDrawList = savedEEDrawList; /* Mark all wires, junctions, .. connected to one of the item to delete */ if( DeleteFullConnection ) { for( DelStruct = GetScreen()->EEDrawList; DelStruct != NULL; DelStruct = DelStruct->Pnext ) { if ( ! (DelStruct->m_Flags & SELECTEDNODE) ) continue; if( !(DelStruct->m_Flags & SELECTEDNODE) ) continue; #define SEGM ( (EDA_DrawLineStruct*) DelStruct ) if ( DelStruct->Type() != DRAW_SEGMENT_STRUCT_TYPE ) continue; if( DelStruct->Type() != DRAW_SEGMENT_STRUCT_TYPE ) continue; MarkConnected( this, GetScreen()->EEDrawList, SEGM ); #undef SEGM } Loading @@ -158,34 +179,57 @@ DrawPickedStruct * PickedItem, *PickedList = NULL; { bool noconnect = FALSE; if ( DelStruct->m_Flags & STRUCT_DELETED ) continue; // Already seen if ( ! (DelStruct->m_Flags & CANDIDATE) ) continue; // Already seen if ( DelStruct->Type() != DRAW_SEGMENT_STRUCT_TYPE ) continue; if( DelStruct->m_Flags & STRUCT_DELETED ) continue; // Already seen if( !(DelStruct->m_Flags & CANDIDATE) ) continue; // Already seen if( DelStruct->Type() != DRAW_SEGMENT_STRUCT_TYPE ) continue; DelStruct->m_Flags |= SKIP_STRUCT; #define SEGM ( (EDA_DrawLineStruct*) DelStruct ) /* Test the SEGM->m_Start point: if this point was connected to an STRUCT_DELETED wire, and now is not connected, the wire can be deleted */ * and now is not connected, the wire can be deleted */ EDA_BaseStruct* removed_struct; for ( removed_struct = GetScreen()->EEDrawList; removed_struct != NULL; removed_struct = removed_struct->Pnext) for( removed_struct = GetScreen()->EEDrawList; removed_struct != NULL; removed_struct = removed_struct->Pnext ) { if( (removed_struct->m_Flags & STRUCT_DELETED) == 0 ) continue; if ( removed_struct->Type() != DRAW_SEGMENT_STRUCT_TYPE ) continue; if( (removed_struct->m_Flags & STRUCT_DELETED) == 0 ) continue; if( removed_struct->Type() != DRAW_SEGMENT_STRUCT_TYPE ) continue; #define WIRE ( (EDA_DrawLineStruct*) removed_struct ) if ( WIRE->IsOneEndPointAt(SEGM->m_Start) ) break; if( WIRE->IsOneEndPointAt( SEGM->m_Start ) ) break; } if( WIRE && !CountConnectedItems( this, GetScreen()->EEDrawList, SEGM->m_Start, TRUE ) ) noconnect = TRUE; /* Test the SEGM->m_End point: if this point was connected to an STRUCT_DELETED wire, and now is not connected, the wire can be deleted */ for ( removed_struct = GetScreen()->EEDrawList; removed_struct != NULL; removed_struct = removed_struct->Pnext) * and now is not connected, the wire can be deleted */ for( removed_struct = GetScreen()->EEDrawList; removed_struct != NULL; removed_struct = removed_struct->Pnext ) { if( (removed_struct->m_Flags & STRUCT_DELETED) == 0 ) continue; if ( removed_struct->Type() != DRAW_SEGMENT_STRUCT_TYPE ) continue; if ( WIRE->IsOneEndPointAt(SEGM->m_End) ) break; if( (removed_struct->m_Flags & STRUCT_DELETED) == 0 ) continue; if( removed_struct->Type() != DRAW_SEGMENT_STRUCT_TYPE ) continue; if( WIRE->IsOneEndPointAt( SEGM->m_End ) ) break; } if ( removed_struct && ! CountConnectedItems(this, GetScreen()->EEDrawList, SEGM->m_End, TRUE) ) if( removed_struct && !CountConnectedItems( this, GetScreen()->EEDrawList, SEGM->m_End, TRUE ) ) noconnect = TRUE; DelStruct->m_Flags &= ~SKIP_STRUCT; if( noconnect ) Loading @@ -193,6 +237,7 @@ DrawPickedStruct * PickedItem, *PickedList = NULL; DelStruct->m_Flags |= STRUCT_DELETED; /* Put this structure in the picked list: */ PickedItem = new DrawPickedStruct( DelStruct ); PickedItem->Pnext = PickedList; PickedList = PickedItem; DelStruct = GetScreen()->EEDrawList; Loading @@ -204,8 +249,12 @@ DrawPickedStruct * PickedItem, *PickedList = NULL; for( DelStruct = GetScreen()->EEDrawList; DelStruct != NULL; DelStruct = DelStruct->Pnext ) { int count; if ( DelStruct->m_Flags & STRUCT_DELETED ) continue; if ( ! (DelStruct->m_Flags & CANDIDATE) ) continue; if( DelStruct->m_Flags & STRUCT_DELETED ) continue; if( !(DelStruct->m_Flags & CANDIDATE) ) continue; if( DelStruct->Type() == DRAW_JUNCTION_STRUCT_TYPE ) { #define JUNCTION ( (DrawJunctionStruct*) DelStruct ) Loading @@ -213,8 +262,10 @@ DrawPickedStruct * PickedItem, *PickedList = NULL; if( count <= 2 ) { DelStruct->m_Flags |= STRUCT_DELETED; /* Put this structure in the picked list: */ PickedItem = new DrawPickedStruct( DelStruct ); PickedItem->Pnext = PickedList; PickedList = PickedItem; } Loading @@ -226,20 +277,28 @@ DrawPickedStruct * PickedItem, *PickedList = NULL; wxPoint pos = GetScreen()->m_Curseur; for( DelStruct = GetScreen()->EEDrawList; DelStruct != NULL; DelStruct = DelStruct->Pnext ) { if ( DelStruct->m_Flags & STRUCT_DELETED ) continue; if ( DelStruct->Type() != DRAW_LABEL_STRUCT_TYPE ) continue; if( DelStruct->m_Flags & STRUCT_DELETED ) continue; if( DelStruct->Type() != DRAW_LABEL_STRUCT_TYPE ) continue; GetScreen()->m_Curseur = ( (DrawTextStruct*) DelStruct )->m_Pos; EDA_BaseStruct* TstStruct = PickStruct( GetScreen()->m_Curseur, GetScreen(), WIREITEM | BUSITEM ); if( TstStruct && TstStruct->m_Flags & STRUCT_DELETED ) { DelStruct->m_Flags |= STRUCT_DELETED; /* Put this structure in the picked list: */ PickedItem = new DrawPickedStruct( DelStruct ); PickedItem->Pnext = PickedList; PickedList = PickedItem; } } GetScreen()->m_Curseur = pos; } Loading @@ -251,49 +310,48 @@ DrawPickedStruct * PickedItem, *PickedList = NULL; DeleteStruct( DrawPanel, DC, PickedList ); GetScreen()->SetModify(); } } /*****************************************************************/ bool LocateAndDeleteItem( WinEDA_SchematicFrame* frame, wxDC* DC ) /*****************************************************************/ /* Locate and delete the item found under the mouse cousor If more than one item found: the priority order is: 1 : MARKER 2 : JUNCTION 2 : NOCONNECT 3 : WIRE ou BUS 4 : DRAWITEM 5 : TEXT 6 : COMPOSANT 7 : SHEET return TRUE if an item was deleted * If more than one item found: the priority order is: * 1 : MARKER * 2 : JUNCTION * 2 : NOCONNECT * 3 : WIRE ou BUS * 4 : DRAWITEM * 5 : TEXT * 6 : COMPOSANT * 7 : SHEET * * return TRUE if an item was deleted */ { EDA_BaseStruct* DelStruct; SCH_SCREEN* screen = (SCH_SCREEN*) ( frame->GetScreen() ); bool item_deleted = FALSE; DelStruct = PickStruct(screen->m_Curseur, screen, MARKERITEM); if( DelStruct == NULL ) DelStruct = PickStruct(screen->m_Curseur, screen, JUNCTIONITEM); if( DelStruct == NULL ) DelStruct = PickStruct(screen->m_Curseur, screen, NOCONNECTITEM); if( DelStruct == NULL ) DelStruct = PickStruct(screen->m_Curseur, screen, RACCORDITEM); if( DelStruct == NULL ) DelStruct = PickStruct(screen->m_Curseur, screen, WIREITEM|BUSITEM); if( DelStruct == NULL ) DelStruct = PickStruct(screen->m_Curseur, screen, DRAWITEM); if( DelStruct == NULL ) DelStruct = PickStruct(screen->m_Curseur, screen, TEXTITEM|LABELITEM); if( DelStruct == NULL ) DelStruct = PickStruct(screen->m_Curseur, screen, LIBITEM); if( DelStruct == NULL ) DelStruct = PickStruct(screen->m_Curseur, screen, SHEETITEM); DelStruct = PickStruct( screen->m_Curseur, screen, MARKERITEM ); if( DelStruct == NULL ) DelStruct = PickStruct( screen->m_Curseur, screen, JUNCTIONITEM ); if( DelStruct == NULL ) DelStruct = PickStruct( screen->m_Curseur, screen, NOCONNECTITEM ); if( DelStruct == NULL ) DelStruct = PickStruct( screen->m_Curseur, screen, RACCORDITEM ); if( DelStruct == NULL ) DelStruct = PickStruct( screen->m_Curseur, screen, WIREITEM | BUSITEM ); if( DelStruct == NULL ) DelStruct = PickStruct( screen->m_Curseur, screen, DRAWITEM ); if( DelStruct == NULL ) DelStruct = PickStruct( screen->m_Curseur, screen, TEXTITEM | LABELITEM ); if( DelStruct == NULL ) DelStruct = PickStruct( screen->m_Curseur, screen, LIBITEM ); if( DelStruct == NULL ) DelStruct = PickStruct( screen->m_Curseur, screen, SHEETITEM ); if( DelStruct ) { Loading @@ -308,51 +366,61 @@ bool item_deleted = FALSE; } /***************************************************************/ void EraseStruct( EDA_BaseStruct* DrawStruct, SCH_SCREEN* Screen ) /***************************************************************/ /* Suppression definitive d'une structure dans une liste chainee d'elements de dessin DrawStruct = pointeur sur la structure Screen = pointeur sur l'ecran d'appartenance Le chainage de la liste est modifie. Remarque: pour les structures DRAW_SHEET_STRUCT_TYPE, l'ecran et les structures correspondantes ne sont pas touches. Ils doivent etre traites separement * d'elements de dessin * DrawStruct = pointeur sur la structure * Screen = pointeur sur l'ecran d'appartenance * Le chainage de la liste est modifie. * * Remarque: * pour les structures DRAW_SHEET_STRUCT_TYPE, l'ecran et les structures * correspondantes ne sont pas touches. * Ils doivent etre traites separement */ { EDA_BaseStruct* DrawList; DrawPickedStruct* PickedList = NULL; DrawSheetLabelStruct* SheetLabel, * NextLabel; if( DrawStruct == NULL ) return; if( Screen == NULL ) return; if( DrawStruct == NULL ) return; if( Screen == NULL ) return; Screen->SetModify(); if( DrawStruct->Type() == DRAW_SHEETLABEL_STRUCT_TYPE ) { /* Cette stucture est rattachee a une feuille, et n'est pas accessible par la liste globale directement */ { /* Cette stucture est rattachee a une feuille, et n'est pas * accessible par la liste globale directement */ //this structure has a sheet attached, which we must find. DrawList = Screen->EEDrawList; for( ; DrawList != NULL; DrawList = DrawList->Pnext ) { if(DrawList->Type() != DRAW_SHEET_STRUCT_TYPE) continue; if( DrawList->Type() != DRAW_SHEET_STRUCT_TYPE ) continue; /* Examen de la Sheet */ SheetLabel = ( (DrawSheetStruct*) DrawList )->m_Label; if (SheetLabel == NULL) continue; if( SheetLabel == NULL ) continue; if( SheetLabel == (DrawSheetLabelStruct*) DrawStruct ) { ( (DrawSheetStruct*) DrawList )->m_Label = (DrawSheetLabelStruct*) SheetLabel->Pnext; SAFE_DELETE( DrawStruct ); return; } else while( SheetLabel->Pnext )/* Examen de la liste dependante */ else { while( SheetLabel->Pnext ) /* Examen de la liste dependante */ { NextLabel = (DrawSheetLabelStruct*) SheetLabel->Pnext; if( NextLabel == (DrawSheetLabelStruct*) DrawStruct ) Loading @@ -364,6 +432,8 @@ DrawSheetLabelStruct* SheetLabel, *NextLabel; SheetLabel = NextLabel; } } } return; } Loading Loading @@ -419,7 +489,6 @@ DrawSheetLabelStruct* SheetLabel, *NextLabel; } /********************************/ void DeleteAllMarkers( int type ) /********************************/ Loading @@ -430,36 +499,43 @@ EDA_BaseStruct * DrawStruct, * NextStruct; DrawMarkerStruct* Marker; EDA_ScreenList ScreenList; for( screen = ScreenList.GetFirst(); screen != NULL; screen = ScreenList.GetNext() ) { for( DrawStruct = screen->EEDrawList; DrawStruct != NULL; DrawStruct = NextStruct ) { NextStruct = DrawStruct->Pnext; if(DrawStruct->Type() != DRAW_MARKER_STRUCT_TYPE ) continue; if( DrawStruct->Type() != DRAW_MARKER_STRUCT_TYPE ) continue; /* Marqueur trouve */ Marker = (DrawMarkerStruct*) DrawStruct; if( Marker->m_Type != type ) continue; if( Marker->m_Type != type ) continue; /* Suppression du marqueur */ EraseStruct( DrawStruct, screen ); } } } /********************************************************************/ void DeleteOneLibraryDrawStruct( WinEDA_DrawPanel* panel, wxDC* DC, EDA_LibComponentStruct* LibEntry, LibEDA_BaseStruct* DrawItem, int Affiche ) /********************************************************************/ /* Routine d'effacement d'un "LibraryDrawStruct" (d'un element de dessin d'un composant ) Parametres d'entree Pointeur sur le composant comportant la structure (Si NULL la structure a effacer est supposee non rattachee a un composant) Pointeur sur la structure a effacer Efface egalement le graphique correspondant de l'ecran /* Routine d'effacement d'un "LibraryDrawStruct" * (d'un element de dessin d'un composant ) * * Parametres d'entree * Pointeur sur le composant comportant la structure * (Si NULL la structure a effacer est supposee non rattachee * a un composant) * Pointeur sur la structure a effacer * * Efface egalement le graphique correspondant de l'ecran */ { LibEDA_BaseStruct* PreviousDrawItem; Loading @@ -479,23 +555,23 @@ LibEDA_BaseStruct *PreviousDrawItem; LibEntry->m_Drawings = DrawItem->Next(); SAFE_DELETE( DrawItem ); } else /* Cas des autres items */ { while( PreviousDrawItem ) { if( PreviousDrawItem->Pnext == DrawItem ) { PreviousDrawItem->Pnext = DrawItem->Pnext; SAFE_DELETE( DrawItem ); break; SAFE_DELETE( DrawItem ); break; } PreviousDrawItem = PreviousDrawItem->Next(); } } } else /* Structure non reliee a un composant */ { SAFE_DELETE( DrawItem ); } } eeschema/erc.cpp +102 −86 Original line number Diff line number Diff line Loading @@ -101,7 +101,8 @@ bool DiagErcTableInit; // go to TRUE after DiagErc init */ static int DefaultDiagErc[PIN_NMAX][PIN_NMAX] = { /* I, O, Bi, 3S, Pas, UnS,PwrI,PwrO, OC, OE, NC */ /* I */ { OK, OK, OK, OK, OK, WAR, OK, OK, OK, OK, WAR }, /* I */ { OK, OK, OK, OK, OK, WAR, OK, OK, OK, OK, WAR }, /* O */ { OK, ERR, OK, WAR, OK, WAR, OK, ERR, ERR, ERR, WAR }, /* Bi*/ { OK, OK, OK, OK, OK, WAR, OK, WAR, OK, WAR, WAR }, /* 3S*/ { OK, WAR, OK, OK, OK, WAR, WAR, ERR, WAR, WAR, WAR }, Loading Loading @@ -132,7 +133,8 @@ static int DefaultDiagErc[PIN_NMAX][PIN_NMAX] = */ static int MinimalReq[PIN_NMAX][PIN_NMAX] = { /* In, Out, Bi, 3S, Pas, UnS,PwrI,PwrO, OC, OE, NC */ /* In*/ { NOD, DRV, DRV, DRV, DRV, DRV, NOD, DRV, DRV, DRV, NOC }, /* In*/ { NOD, DRV, DRV, DRV, DRV, DRV, NOD, DRV, DRV, DRV, NOC }, /*Out*/ { DRV, DRV, DRV, DRV, DRV, DRV, DRV, DRV, DRV, DRV, NOC }, /* Bi*/ { DRV, DRV, DRV, DRV, DRV, DRV, NOD, DRV, DRV, DRV, NOC }, /* 3S*/ { DRV, DRV, DRV, DRV, DRV, DRV, NOD, DRV, DRV, DRV, NOC }, Loading @@ -146,7 +148,6 @@ static int MinimalReq[PIN_NMAX][PIN_NMAX] = }; /*********************************************/ void WinEDA_ErcFrame::ReBuildMatrixPanel() /*********************************************/ Loading Loading @@ -391,6 +392,7 @@ void WinEDA_ErcFrame::TestErc( wxCommandEvent& event ) wxString ErcFullFileName; ErcFullFileName = g_RootSheet->m_AssociatedScreen->m_FileName; ChangeFileNameExt( ErcFullFileName, wxT( ".erc" ) ); ErcFullFileName = EDA_FileSelector( _( "ERC file:" ), wxEmptyString, /* Chemin par defaut */ ErcFullFileName, /* nom fichier par defaut */ Loading Loading @@ -434,6 +436,7 @@ void WinEDA_ErcFrame::DelERCMarkers( wxCommandEvent& event ) { if( DrawStruct->Type() != DRAW_MARKER_STRUCT_TYPE ) continue; /* Marqueur trouve */ Marker = (DrawMarkerStruct*) DrawStruct; if( Marker->m_Type == MARQ_ERC ) Loading Loading @@ -573,6 +576,7 @@ static void Diagnose( WinEDA_DrawPanel* panel, wxDC* DC, Marker->m_Comment.Printf( _( "Warning Pin %s not driven (Net %d)" ), MsgPinElectricType[ii], NetItemRef->GetNet() ); if( screen == panel->GetScreen() ) RedrawOneStruct( panel, DC, Marker, GR_COPY ); return; Loading @@ -582,6 +586,7 @@ static void Diagnose( WinEDA_DrawPanel* panel, wxDC* DC, { Marker->m_Comment.Printf( _( "Warning More than 1 Pin connected to UnConnect symbol" ) ); if( screen == panel->GetScreen() ) RedrawOneStruct( panel, DC, Marker, GR_COPY ); return; Loading Loading @@ -727,9 +732,12 @@ static bool WriteDiagnosticERC( const wxString& FullFileName ) for( Sheet = SheetList.GetFirst(); Sheet != NULL; Sheet = SheetList.GetNext() ) { if(Sheet->Last() == g_RootSheet){ if( Sheet->Last() == g_RootSheet ) { msg.Printf( _( "\n***** Sheet / (Root) \n" ) ); }else{ } else { wxString str = Sheet->PathHumanReadable(); msg.Printf( _( "\n***** Sheet %s\n" ), str.GetData() ); } Loading Loading @@ -764,18 +772,24 @@ static bool WriteDiagnosticERC( const wxString& FullFileName ) return TRUE; } bool TestLabel_( ObjetNetListStruct* a, ObjetNetListStruct* b ) { int at = a->m_Type; int bt = b->m_Type; if( (at == NET_HIERLABEL || at == NET_HIERBUSLABELMEMBER) &&(bt == NET_SHEETLABEL || bt == NET_SHEETBUSLABELMEMBER) ){ if( a->m_SheetList == b->m_SheetListInclude ){ &&(bt == NET_SHEETLABEL || bt == NET_SHEETBUSLABELMEMBER) ) { if( a->m_SheetList == b->m_SheetListInclude ) { return true; //connected! } } return false; //these two are unconnected } /***********************************************************************/ void TestLabel( WinEDA_DrawPanel* panel, wxDC* DC, ObjetNetListStruct* NetItemRef, ObjetNetListStruct* StartNet ) Loading Loading @@ -804,7 +818,8 @@ void TestLabel( WinEDA_DrawPanel* panel, wxDC* DC, || ( NetItemRef->GetNet() != NetItemTst->GetNet() ) ) { /* Fin de netcode trouve */ if( erc ){ if( erc ) { /* GLabel ou SheetLabel orphelin */ Diagnose( panel, DC, NetItemRef, NULL, -1, WAR ); } Loading @@ -812,6 +827,7 @@ void TestLabel( WinEDA_DrawPanel* panel, wxDC* DC, } if( TestLabel_( NetItemRef, NetItemTst ) ) erc = 0; //same thing, different order. if( TestLabel_( NetItemTst, NetItemRef ) ) erc = 0; Loading eeschema/program.h +17 −11 Original line number Diff line number Diff line Loading @@ -92,6 +92,12 @@ public: } /** * Function GetBoundingBox * returns the bounding box of this TRACK */ EDA_Rect GetBoundingBox() const; virtual void Draw( WinEDA_DrawPanel* panel, wxDC* DC, const wxPoint& offset, int draw_mode, int Color = -1 ); Loading Loading
eeschema/block.cpp +10 −2 Original line number Diff line number Diff line Loading @@ -932,7 +932,8 @@ void DeleteStruct( WinEDA_DrawPanel* panel, wxDC* DC, EDA_BaseStruct* DrawStruct if( DrawStruct->Type() == DRAW_SHEETLABEL_STRUCT_TYPE ) { /* Cette stucture est rattachee a une feuille, et n'est pas { /* Cette stucture est rattachee a une feuille, et n'est pas * accessible par la liste globale directement */ frame->SaveCopyInUndoList( ( (DrawSheetLabelStruct*) DrawStruct )->m_Parent, IS_CHANGED ); frame->DeleteSheetLabel( DC, (DrawSheetLabelStruct*) DrawStruct ); Loading Loading @@ -961,7 +962,14 @@ void DeleteStruct( WinEDA_DrawPanel* panel, wxDC* DC, EDA_BaseStruct* DrawStruct { screen->RemoveFromDrawList( DrawStruct ); if( DrawStruct->Type() == DRAW_SEGMENT_STRUCT_TYPE ) { D( printf("PostDirtyRect()\n"); ) panel->PostDirtyRect( ((EDA_DrawLineStruct*)DrawStruct)->GetBoundingBox() ); } else RedrawOneStruct( panel, DC, DrawStruct, g_XorMode ); /* Unlink the structure */ DrawStruct->Pnext = DrawStruct->Pback = NULL; // Only one struct -> no link if( DrawStruct->Type() == DRAW_SHEET_STRUCT_TYPE ) Loading
eeschema/cmpclass.cpp +25 −6 Original line number Diff line number Diff line Loading @@ -240,6 +240,25 @@ void EDA_DrawLineStruct::Show( int nestLevel, std::ostream& os ) #endif EDA_Rect EDA_DrawLineStruct::GetBoundingBox() const { int width = 25; int xmin = MIN( m_Start.x, m_End.x ) - width; int ymin = MIN( m_Start.y, m_End.y ) - width; int xmax = MAX( m_Start.x, m_End.x ) + width; int ymax = MAX( m_Start.y, m_End.y ) + width; // return a rectangle which is [pos,dim) in nature. therefore the +1 EDA_Rect ret( wxPoint( xmin, ymin ), wxSize( xmax-xmin+1, ymax-ymin+1 ) ); return ret; } /****************************/ /* Class DrawPolylineStruct */ /****************************/ Loading
eeschema/delete.cpp +518 −442 Original line number Diff line number Diff line Loading @@ -20,22 +20,26 @@ static int CountConnectedItems( WinEDA_SchematicFrame* frame, EDA_BaseStruct* ListStruct, wxPoint pos, bool TstJunction ) /********************************************************************************/ /* Count number of items connected to point pos : pins, end wire or bus, and junctions if TstJunction == TRUE Return this count Used by WinEDA_SchematicFrame::DeleteConnection() /* Count number of items connected to point pos : * pins, end wire or bus, and junctions if TstJunction == TRUE * Return this count * * Used by WinEDA_SchematicFrame::DeleteConnection() */ { EDA_BaseStruct* Struct; int count = 0; if ( frame->LocatePinEnd(ListStruct, pos) ) count++; if( frame->LocatePinEnd( ListStruct, pos ) ) count++; for( Struct = ListStruct; Struct != NULL; Struct = Struct->Pnext ) { if ( Struct->m_Flags & STRUCT_DELETED ) continue; if ( Struct->m_Flags & SKIP_STRUCT ) continue; if( Struct->m_Flags & STRUCT_DELETED ) continue; if( Struct->m_Flags & SKIP_STRUCT ) continue; if( TstJunction && (Struct->Type() == DRAW_JUNCTION_STRUCT_TYPE) ) Loading @@ -46,39 +50,47 @@ int count = 0; #undef JUNCTION } if ( Struct->Type() != DRAW_SEGMENT_STRUCT_TYPE ) continue; if( Struct->Type() != DRAW_SEGMENT_STRUCT_TYPE ) continue; #define SEGM ( (EDA_DrawLineStruct*) Struct ) if ( SEGM->IsOneEndPointAt(pos) ) count++; if( SEGM->IsOneEndPointAt( pos ) ) count++; #undef SEGM } return count; } /************************************************************************************/ static bool MarkConnected( WinEDA_SchematicFrame* frame, EDA_BaseStruct* ListStruct, EDA_DrawLineStruct* segment ) /************************************************************************************/ /* Mark to "CANDIDATE" all wires or junction connected to "segment" in list "ListStruct" Search wire stop at an any pin Used by WinEDA_SchematicFrame::DeleteConnection() /* Mark to "CANDIDATE" all wires or junction connected to "segment" in list "ListStruct" * Search wire stop at an any pin * * Used by WinEDA_SchematicFrame::DeleteConnection() */ { EDA_BaseStruct* Struct; for( Struct = ListStruct; Struct != NULL; Struct = Struct->Pnext ) { if ( Struct->m_Flags ) continue; if( Struct->m_Flags ) continue; if( Struct->Type() == DRAW_JUNCTION_STRUCT_TYPE ) { #define JUNCTION ( (DrawJunctionStruct*) Struct ) if ( segment->IsOneEndPointAt(JUNCTION->m_Pos) ) Struct->m_Flags |= CANDIDATE; if( segment->IsOneEndPointAt( JUNCTION->m_Pos ) ) Struct->m_Flags |= CANDIDATE; continue; #undef JUNCTION } if ( Struct->Type() != DRAW_SEGMENT_STRUCT_TYPE ) continue; if( Struct->Type() != DRAW_SEGMENT_STRUCT_TYPE ) continue; #define SEGM ( (EDA_DrawLineStruct*) Struct ) if( segment->IsOneEndPointAt( SEGM->m_Start ) ) Loading @@ -103,11 +115,13 @@ EDA_BaseStruct * Struct; return TRUE; } /********************************************************************************/ void WinEDA_SchematicFrame::DeleteConnection( wxDC* DC, bool DeleteFullConnection ) /********************************************************************************/ /* Delete a connection, i.e wires or bus connected stop on a node (more than 2 wires (bus) connected) * stop on a node (more than 2 wires (bus) connected) */ { wxPoint refpos = GetScreen()->m_Curseur; Loading @@ -122,33 +136,40 @@ DrawPickedStruct * PickedItem, *PickedList = NULL; DelStruct = GetScreen()->EEDrawList; /* Locate all the wires, bus or junction under the mouse cursor, and put them in a list of items to delete * of items to delete */ SCH_SCREEN* screen = (SCH_SCREEN*) GetScreen(); EDA_BaseStruct* savedEEDrawList = screen->EEDrawList; while ( DelStruct && (DelStruct = PickStruct(screen->m_Curseur, while( DelStruct && ( DelStruct = PickStruct( screen->m_Curseur, screen, JUNCTIONITEM | WIREITEM | BUSITEM ) ) != NULL ) { DelStruct->m_Flags = SELECTEDNODE | STRUCT_DELETED; /* Put this structure in the picked list: */ PickedItem = new DrawPickedStruct( DelStruct ); PickedItem->Pnext = PickedList; PickedList = PickedItem; DelStruct = DelStruct->Pnext; screen->EEDrawList = DelStruct; } GetScreen()->EEDrawList = savedEEDrawList; /* Mark all wires, junctions, .. connected to one of the item to delete */ if( DeleteFullConnection ) { for( DelStruct = GetScreen()->EEDrawList; DelStruct != NULL; DelStruct = DelStruct->Pnext ) { if ( ! (DelStruct->m_Flags & SELECTEDNODE) ) continue; if( !(DelStruct->m_Flags & SELECTEDNODE) ) continue; #define SEGM ( (EDA_DrawLineStruct*) DelStruct ) if ( DelStruct->Type() != DRAW_SEGMENT_STRUCT_TYPE ) continue; if( DelStruct->Type() != DRAW_SEGMENT_STRUCT_TYPE ) continue; MarkConnected( this, GetScreen()->EEDrawList, SEGM ); #undef SEGM } Loading @@ -158,34 +179,57 @@ DrawPickedStruct * PickedItem, *PickedList = NULL; { bool noconnect = FALSE; if ( DelStruct->m_Flags & STRUCT_DELETED ) continue; // Already seen if ( ! (DelStruct->m_Flags & CANDIDATE) ) continue; // Already seen if ( DelStruct->Type() != DRAW_SEGMENT_STRUCT_TYPE ) continue; if( DelStruct->m_Flags & STRUCT_DELETED ) continue; // Already seen if( !(DelStruct->m_Flags & CANDIDATE) ) continue; // Already seen if( DelStruct->Type() != DRAW_SEGMENT_STRUCT_TYPE ) continue; DelStruct->m_Flags |= SKIP_STRUCT; #define SEGM ( (EDA_DrawLineStruct*) DelStruct ) /* Test the SEGM->m_Start point: if this point was connected to an STRUCT_DELETED wire, and now is not connected, the wire can be deleted */ * and now is not connected, the wire can be deleted */ EDA_BaseStruct* removed_struct; for ( removed_struct = GetScreen()->EEDrawList; removed_struct != NULL; removed_struct = removed_struct->Pnext) for( removed_struct = GetScreen()->EEDrawList; removed_struct != NULL; removed_struct = removed_struct->Pnext ) { if( (removed_struct->m_Flags & STRUCT_DELETED) == 0 ) continue; if ( removed_struct->Type() != DRAW_SEGMENT_STRUCT_TYPE ) continue; if( (removed_struct->m_Flags & STRUCT_DELETED) == 0 ) continue; if( removed_struct->Type() != DRAW_SEGMENT_STRUCT_TYPE ) continue; #define WIRE ( (EDA_DrawLineStruct*) removed_struct ) if ( WIRE->IsOneEndPointAt(SEGM->m_Start) ) break; if( WIRE->IsOneEndPointAt( SEGM->m_Start ) ) break; } if( WIRE && !CountConnectedItems( this, GetScreen()->EEDrawList, SEGM->m_Start, TRUE ) ) noconnect = TRUE; /* Test the SEGM->m_End point: if this point was connected to an STRUCT_DELETED wire, and now is not connected, the wire can be deleted */ for ( removed_struct = GetScreen()->EEDrawList; removed_struct != NULL; removed_struct = removed_struct->Pnext) * and now is not connected, the wire can be deleted */ for( removed_struct = GetScreen()->EEDrawList; removed_struct != NULL; removed_struct = removed_struct->Pnext ) { if( (removed_struct->m_Flags & STRUCT_DELETED) == 0 ) continue; if ( removed_struct->Type() != DRAW_SEGMENT_STRUCT_TYPE ) continue; if ( WIRE->IsOneEndPointAt(SEGM->m_End) ) break; if( (removed_struct->m_Flags & STRUCT_DELETED) == 0 ) continue; if( removed_struct->Type() != DRAW_SEGMENT_STRUCT_TYPE ) continue; if( WIRE->IsOneEndPointAt( SEGM->m_End ) ) break; } if ( removed_struct && ! CountConnectedItems(this, GetScreen()->EEDrawList, SEGM->m_End, TRUE) ) if( removed_struct && !CountConnectedItems( this, GetScreen()->EEDrawList, SEGM->m_End, TRUE ) ) noconnect = TRUE; DelStruct->m_Flags &= ~SKIP_STRUCT; if( noconnect ) Loading @@ -193,6 +237,7 @@ DrawPickedStruct * PickedItem, *PickedList = NULL; DelStruct->m_Flags |= STRUCT_DELETED; /* Put this structure in the picked list: */ PickedItem = new DrawPickedStruct( DelStruct ); PickedItem->Pnext = PickedList; PickedList = PickedItem; DelStruct = GetScreen()->EEDrawList; Loading @@ -204,8 +249,12 @@ DrawPickedStruct * PickedItem, *PickedList = NULL; for( DelStruct = GetScreen()->EEDrawList; DelStruct != NULL; DelStruct = DelStruct->Pnext ) { int count; if ( DelStruct->m_Flags & STRUCT_DELETED ) continue; if ( ! (DelStruct->m_Flags & CANDIDATE) ) continue; if( DelStruct->m_Flags & STRUCT_DELETED ) continue; if( !(DelStruct->m_Flags & CANDIDATE) ) continue; if( DelStruct->Type() == DRAW_JUNCTION_STRUCT_TYPE ) { #define JUNCTION ( (DrawJunctionStruct*) DelStruct ) Loading @@ -213,8 +262,10 @@ DrawPickedStruct * PickedItem, *PickedList = NULL; if( count <= 2 ) { DelStruct->m_Flags |= STRUCT_DELETED; /* Put this structure in the picked list: */ PickedItem = new DrawPickedStruct( DelStruct ); PickedItem->Pnext = PickedList; PickedList = PickedItem; } Loading @@ -226,20 +277,28 @@ DrawPickedStruct * PickedItem, *PickedList = NULL; wxPoint pos = GetScreen()->m_Curseur; for( DelStruct = GetScreen()->EEDrawList; DelStruct != NULL; DelStruct = DelStruct->Pnext ) { if ( DelStruct->m_Flags & STRUCT_DELETED ) continue; if ( DelStruct->Type() != DRAW_LABEL_STRUCT_TYPE ) continue; if( DelStruct->m_Flags & STRUCT_DELETED ) continue; if( DelStruct->Type() != DRAW_LABEL_STRUCT_TYPE ) continue; GetScreen()->m_Curseur = ( (DrawTextStruct*) DelStruct )->m_Pos; EDA_BaseStruct* TstStruct = PickStruct( GetScreen()->m_Curseur, GetScreen(), WIREITEM | BUSITEM ); if( TstStruct && TstStruct->m_Flags & STRUCT_DELETED ) { DelStruct->m_Flags |= STRUCT_DELETED; /* Put this structure in the picked list: */ PickedItem = new DrawPickedStruct( DelStruct ); PickedItem->Pnext = PickedList; PickedList = PickedItem; } } GetScreen()->m_Curseur = pos; } Loading @@ -251,49 +310,48 @@ DrawPickedStruct * PickedItem, *PickedList = NULL; DeleteStruct( DrawPanel, DC, PickedList ); GetScreen()->SetModify(); } } /*****************************************************************/ bool LocateAndDeleteItem( WinEDA_SchematicFrame* frame, wxDC* DC ) /*****************************************************************/ /* Locate and delete the item found under the mouse cousor If more than one item found: the priority order is: 1 : MARKER 2 : JUNCTION 2 : NOCONNECT 3 : WIRE ou BUS 4 : DRAWITEM 5 : TEXT 6 : COMPOSANT 7 : SHEET return TRUE if an item was deleted * If more than one item found: the priority order is: * 1 : MARKER * 2 : JUNCTION * 2 : NOCONNECT * 3 : WIRE ou BUS * 4 : DRAWITEM * 5 : TEXT * 6 : COMPOSANT * 7 : SHEET * * return TRUE if an item was deleted */ { EDA_BaseStruct* DelStruct; SCH_SCREEN* screen = (SCH_SCREEN*) ( frame->GetScreen() ); bool item_deleted = FALSE; DelStruct = PickStruct(screen->m_Curseur, screen, MARKERITEM); if( DelStruct == NULL ) DelStruct = PickStruct(screen->m_Curseur, screen, JUNCTIONITEM); if( DelStruct == NULL ) DelStruct = PickStruct(screen->m_Curseur, screen, NOCONNECTITEM); if( DelStruct == NULL ) DelStruct = PickStruct(screen->m_Curseur, screen, RACCORDITEM); if( DelStruct == NULL ) DelStruct = PickStruct(screen->m_Curseur, screen, WIREITEM|BUSITEM); if( DelStruct == NULL ) DelStruct = PickStruct(screen->m_Curseur, screen, DRAWITEM); if( DelStruct == NULL ) DelStruct = PickStruct(screen->m_Curseur, screen, TEXTITEM|LABELITEM); if( DelStruct == NULL ) DelStruct = PickStruct(screen->m_Curseur, screen, LIBITEM); if( DelStruct == NULL ) DelStruct = PickStruct(screen->m_Curseur, screen, SHEETITEM); DelStruct = PickStruct( screen->m_Curseur, screen, MARKERITEM ); if( DelStruct == NULL ) DelStruct = PickStruct( screen->m_Curseur, screen, JUNCTIONITEM ); if( DelStruct == NULL ) DelStruct = PickStruct( screen->m_Curseur, screen, NOCONNECTITEM ); if( DelStruct == NULL ) DelStruct = PickStruct( screen->m_Curseur, screen, RACCORDITEM ); if( DelStruct == NULL ) DelStruct = PickStruct( screen->m_Curseur, screen, WIREITEM | BUSITEM ); if( DelStruct == NULL ) DelStruct = PickStruct( screen->m_Curseur, screen, DRAWITEM ); if( DelStruct == NULL ) DelStruct = PickStruct( screen->m_Curseur, screen, TEXTITEM | LABELITEM ); if( DelStruct == NULL ) DelStruct = PickStruct( screen->m_Curseur, screen, LIBITEM ); if( DelStruct == NULL ) DelStruct = PickStruct( screen->m_Curseur, screen, SHEETITEM ); if( DelStruct ) { Loading @@ -308,51 +366,61 @@ bool item_deleted = FALSE; } /***************************************************************/ void EraseStruct( EDA_BaseStruct* DrawStruct, SCH_SCREEN* Screen ) /***************************************************************/ /* Suppression definitive d'une structure dans une liste chainee d'elements de dessin DrawStruct = pointeur sur la structure Screen = pointeur sur l'ecran d'appartenance Le chainage de la liste est modifie. Remarque: pour les structures DRAW_SHEET_STRUCT_TYPE, l'ecran et les structures correspondantes ne sont pas touches. Ils doivent etre traites separement * d'elements de dessin * DrawStruct = pointeur sur la structure * Screen = pointeur sur l'ecran d'appartenance * Le chainage de la liste est modifie. * * Remarque: * pour les structures DRAW_SHEET_STRUCT_TYPE, l'ecran et les structures * correspondantes ne sont pas touches. * Ils doivent etre traites separement */ { EDA_BaseStruct* DrawList; DrawPickedStruct* PickedList = NULL; DrawSheetLabelStruct* SheetLabel, * NextLabel; if( DrawStruct == NULL ) return; if( Screen == NULL ) return; if( DrawStruct == NULL ) return; if( Screen == NULL ) return; Screen->SetModify(); if( DrawStruct->Type() == DRAW_SHEETLABEL_STRUCT_TYPE ) { /* Cette stucture est rattachee a une feuille, et n'est pas accessible par la liste globale directement */ { /* Cette stucture est rattachee a une feuille, et n'est pas * accessible par la liste globale directement */ //this structure has a sheet attached, which we must find. DrawList = Screen->EEDrawList; for( ; DrawList != NULL; DrawList = DrawList->Pnext ) { if(DrawList->Type() != DRAW_SHEET_STRUCT_TYPE) continue; if( DrawList->Type() != DRAW_SHEET_STRUCT_TYPE ) continue; /* Examen de la Sheet */ SheetLabel = ( (DrawSheetStruct*) DrawList )->m_Label; if (SheetLabel == NULL) continue; if( SheetLabel == NULL ) continue; if( SheetLabel == (DrawSheetLabelStruct*) DrawStruct ) { ( (DrawSheetStruct*) DrawList )->m_Label = (DrawSheetLabelStruct*) SheetLabel->Pnext; SAFE_DELETE( DrawStruct ); return; } else while( SheetLabel->Pnext )/* Examen de la liste dependante */ else { while( SheetLabel->Pnext ) /* Examen de la liste dependante */ { NextLabel = (DrawSheetLabelStruct*) SheetLabel->Pnext; if( NextLabel == (DrawSheetLabelStruct*) DrawStruct ) Loading @@ -364,6 +432,8 @@ DrawSheetLabelStruct* SheetLabel, *NextLabel; SheetLabel = NextLabel; } } } return; } Loading Loading @@ -419,7 +489,6 @@ DrawSheetLabelStruct* SheetLabel, *NextLabel; } /********************************/ void DeleteAllMarkers( int type ) /********************************/ Loading @@ -430,36 +499,43 @@ EDA_BaseStruct * DrawStruct, * NextStruct; DrawMarkerStruct* Marker; EDA_ScreenList ScreenList; for( screen = ScreenList.GetFirst(); screen != NULL; screen = ScreenList.GetNext() ) { for( DrawStruct = screen->EEDrawList; DrawStruct != NULL; DrawStruct = NextStruct ) { NextStruct = DrawStruct->Pnext; if(DrawStruct->Type() != DRAW_MARKER_STRUCT_TYPE ) continue; if( DrawStruct->Type() != DRAW_MARKER_STRUCT_TYPE ) continue; /* Marqueur trouve */ Marker = (DrawMarkerStruct*) DrawStruct; if( Marker->m_Type != type ) continue; if( Marker->m_Type != type ) continue; /* Suppression du marqueur */ EraseStruct( DrawStruct, screen ); } } } /********************************************************************/ void DeleteOneLibraryDrawStruct( WinEDA_DrawPanel* panel, wxDC* DC, EDA_LibComponentStruct* LibEntry, LibEDA_BaseStruct* DrawItem, int Affiche ) /********************************************************************/ /* Routine d'effacement d'un "LibraryDrawStruct" (d'un element de dessin d'un composant ) Parametres d'entree Pointeur sur le composant comportant la structure (Si NULL la structure a effacer est supposee non rattachee a un composant) Pointeur sur la structure a effacer Efface egalement le graphique correspondant de l'ecran /* Routine d'effacement d'un "LibraryDrawStruct" * (d'un element de dessin d'un composant ) * * Parametres d'entree * Pointeur sur le composant comportant la structure * (Si NULL la structure a effacer est supposee non rattachee * a un composant) * Pointeur sur la structure a effacer * * Efface egalement le graphique correspondant de l'ecran */ { LibEDA_BaseStruct* PreviousDrawItem; Loading @@ -479,23 +555,23 @@ LibEDA_BaseStruct *PreviousDrawItem; LibEntry->m_Drawings = DrawItem->Next(); SAFE_DELETE( DrawItem ); } else /* Cas des autres items */ { while( PreviousDrawItem ) { if( PreviousDrawItem->Pnext == DrawItem ) { PreviousDrawItem->Pnext = DrawItem->Pnext; SAFE_DELETE( DrawItem ); break; SAFE_DELETE( DrawItem ); break; } PreviousDrawItem = PreviousDrawItem->Next(); } } } else /* Structure non reliee a un composant */ { SAFE_DELETE( DrawItem ); } }
eeschema/erc.cpp +102 −86 Original line number Diff line number Diff line Loading @@ -101,7 +101,8 @@ bool DiagErcTableInit; // go to TRUE after DiagErc init */ static int DefaultDiagErc[PIN_NMAX][PIN_NMAX] = { /* I, O, Bi, 3S, Pas, UnS,PwrI,PwrO, OC, OE, NC */ /* I */ { OK, OK, OK, OK, OK, WAR, OK, OK, OK, OK, WAR }, /* I */ { OK, OK, OK, OK, OK, WAR, OK, OK, OK, OK, WAR }, /* O */ { OK, ERR, OK, WAR, OK, WAR, OK, ERR, ERR, ERR, WAR }, /* Bi*/ { OK, OK, OK, OK, OK, WAR, OK, WAR, OK, WAR, WAR }, /* 3S*/ { OK, WAR, OK, OK, OK, WAR, WAR, ERR, WAR, WAR, WAR }, Loading Loading @@ -132,7 +133,8 @@ static int DefaultDiagErc[PIN_NMAX][PIN_NMAX] = */ static int MinimalReq[PIN_NMAX][PIN_NMAX] = { /* In, Out, Bi, 3S, Pas, UnS,PwrI,PwrO, OC, OE, NC */ /* In*/ { NOD, DRV, DRV, DRV, DRV, DRV, NOD, DRV, DRV, DRV, NOC }, /* In*/ { NOD, DRV, DRV, DRV, DRV, DRV, NOD, DRV, DRV, DRV, NOC }, /*Out*/ { DRV, DRV, DRV, DRV, DRV, DRV, DRV, DRV, DRV, DRV, NOC }, /* Bi*/ { DRV, DRV, DRV, DRV, DRV, DRV, NOD, DRV, DRV, DRV, NOC }, /* 3S*/ { DRV, DRV, DRV, DRV, DRV, DRV, NOD, DRV, DRV, DRV, NOC }, Loading @@ -146,7 +148,6 @@ static int MinimalReq[PIN_NMAX][PIN_NMAX] = }; /*********************************************/ void WinEDA_ErcFrame::ReBuildMatrixPanel() /*********************************************/ Loading Loading @@ -391,6 +392,7 @@ void WinEDA_ErcFrame::TestErc( wxCommandEvent& event ) wxString ErcFullFileName; ErcFullFileName = g_RootSheet->m_AssociatedScreen->m_FileName; ChangeFileNameExt( ErcFullFileName, wxT( ".erc" ) ); ErcFullFileName = EDA_FileSelector( _( "ERC file:" ), wxEmptyString, /* Chemin par defaut */ ErcFullFileName, /* nom fichier par defaut */ Loading Loading @@ -434,6 +436,7 @@ void WinEDA_ErcFrame::DelERCMarkers( wxCommandEvent& event ) { if( DrawStruct->Type() != DRAW_MARKER_STRUCT_TYPE ) continue; /* Marqueur trouve */ Marker = (DrawMarkerStruct*) DrawStruct; if( Marker->m_Type == MARQ_ERC ) Loading Loading @@ -573,6 +576,7 @@ static void Diagnose( WinEDA_DrawPanel* panel, wxDC* DC, Marker->m_Comment.Printf( _( "Warning Pin %s not driven (Net %d)" ), MsgPinElectricType[ii], NetItemRef->GetNet() ); if( screen == panel->GetScreen() ) RedrawOneStruct( panel, DC, Marker, GR_COPY ); return; Loading @@ -582,6 +586,7 @@ static void Diagnose( WinEDA_DrawPanel* panel, wxDC* DC, { Marker->m_Comment.Printf( _( "Warning More than 1 Pin connected to UnConnect symbol" ) ); if( screen == panel->GetScreen() ) RedrawOneStruct( panel, DC, Marker, GR_COPY ); return; Loading Loading @@ -727,9 +732,12 @@ static bool WriteDiagnosticERC( const wxString& FullFileName ) for( Sheet = SheetList.GetFirst(); Sheet != NULL; Sheet = SheetList.GetNext() ) { if(Sheet->Last() == g_RootSheet){ if( Sheet->Last() == g_RootSheet ) { msg.Printf( _( "\n***** Sheet / (Root) \n" ) ); }else{ } else { wxString str = Sheet->PathHumanReadable(); msg.Printf( _( "\n***** Sheet %s\n" ), str.GetData() ); } Loading Loading @@ -764,18 +772,24 @@ static bool WriteDiagnosticERC( const wxString& FullFileName ) return TRUE; } bool TestLabel_( ObjetNetListStruct* a, ObjetNetListStruct* b ) { int at = a->m_Type; int bt = b->m_Type; if( (at == NET_HIERLABEL || at == NET_HIERBUSLABELMEMBER) &&(bt == NET_SHEETLABEL || bt == NET_SHEETBUSLABELMEMBER) ){ if( a->m_SheetList == b->m_SheetListInclude ){ &&(bt == NET_SHEETLABEL || bt == NET_SHEETBUSLABELMEMBER) ) { if( a->m_SheetList == b->m_SheetListInclude ) { return true; //connected! } } return false; //these two are unconnected } /***********************************************************************/ void TestLabel( WinEDA_DrawPanel* panel, wxDC* DC, ObjetNetListStruct* NetItemRef, ObjetNetListStruct* StartNet ) Loading Loading @@ -804,7 +818,8 @@ void TestLabel( WinEDA_DrawPanel* panel, wxDC* DC, || ( NetItemRef->GetNet() != NetItemTst->GetNet() ) ) { /* Fin de netcode trouve */ if( erc ){ if( erc ) { /* GLabel ou SheetLabel orphelin */ Diagnose( panel, DC, NetItemRef, NULL, -1, WAR ); } Loading @@ -812,6 +827,7 @@ void TestLabel( WinEDA_DrawPanel* panel, wxDC* DC, } if( TestLabel_( NetItemRef, NetItemTst ) ) erc = 0; //same thing, different order. if( TestLabel_( NetItemTst, NetItemRef ) ) erc = 0; Loading
eeschema/program.h +17 −11 Original line number Diff line number Diff line Loading @@ -92,6 +92,12 @@ public: } /** * Function GetBoundingBox * returns the bounding box of this TRACK */ EDA_Rect GetBoundingBox() const; virtual void Draw( WinEDA_DrawPanel* panel, wxDC* DC, const wxPoint& offset, int draw_mode, int Color = -1 ); Loading