Loading change_log.txt +10 −0 Original line number Diff line number Diff line Loading @@ -5,6 +5,16 @@ Started 2007-June-11 Please add newer entries at the top, list the date and your name with email address. 2008-Apr-21 UPDATE Jean-Pierre Charras <jean-pierre.charras@inpg.fr> ================================================================================ +eeschema * Added WinEDA_LibeditFrame::GeneralControle( wxDC* DC, wxPoint Mouse ); * Added WinEDA_ViewlibFrame::GeneralControle( wxDC* DC, wxPoint Mouse ); Needed: Move redundant code to WinEDA_DrawFrame::GeneralControle ** Current sheet only Annotation and clear annotation now works for complex hierarchies 2008-Apr-17 UPDATE Dick Hollenbeck <dick@softplc.com> ================================================================================ +all Loading eeschema/annotate.cpp +71 −47 Original line number Diff line number Diff line Loading @@ -119,13 +119,9 @@ void ReAnnotatePowerSymbolsOnly( void ) CmpListStruct* AllocateCmpListStrct( int numcomponents ) { int ii = numcomponents * sizeof(CmpListStruct); CmpListStruct* list = (CmpListStruct*) MyZMalloc( ii ); //fill this memory with zeros. char* cptr = (char*) list; for( int i = 0; i<ii; i++ ) *cptr++ = 0; //allocate memory and fill this memory with zeros. CmpListStruct* list = (CmpListStruct*) MyZMalloc( ii ); return list; } Loading Loading @@ -192,24 +188,53 @@ int AnnotateByValue( const void* o1, const void* o2 ) } /***************************************************************************** * DeleteAnnotation: * * Clear the current annotation. ****************************************************************************/ void DeleteAnnotation( WinEDA_SchematicFrame* parent, bool annotateSchematic ) /**************************************************************************************/ void WinEDA_SchematicFrame::DeleteAnnotation( bool aCurrentSheetOnly, bool aRedraw ) /**************************************************************************************/ /** Function DeleteAnnotation * Remove current component annotations * @param aCurrentSheetOnly : if false: remove all annotations, else remove annotation relative to the current sheet only * @param aRedraw : true to refresh display */ { DrawSheetStruct* sheet; EDA_BaseStruct* strct; SCH_SCREEN* screen; EDA_ScreenList ScreenList; if( annotateSchematic ) sheet = g_RootSheet; screen = ScreenList.GetFirst(); if( aCurrentSheetOnly ) screen = GetScreen(); if( screen == NULL ) return; while( screen ) { strct = screen->EEDrawList; for( ; strct; strct = strct->Pnext ) { if( strct->Type() == TYPE_SCH_COMPONENT ) { if( aCurrentSheetOnly ) ( (SCH_COMPONENT*) strct )->ClearAnnotation( m_CurrentSheet ); else sheet = parent->GetSheet()->Last(); ( (SCH_COMPONENT*) strct )->ClearAnnotation( NULL ); } } screen->SetModify(); if( aCurrentSheetOnly ) break; screen = ScreenList.GetNext(); } sheet->DeleteAnnotation( annotateSchematic ); g_RootSheet->m_AssociatedScreen->SetModify(); parent->DrawPanel->Refresh( true ); //update the References m_CurrentSheet->UpdateAllScreenReferences(); if( aRedraw ) DrawPanel->Refresh( true ); } Loading Loading @@ -238,7 +263,7 @@ void AnnotateComponents( WinEDA_SchematicFrame* parent, /* If it is an annotation for all the components, reset previous * annotation: */ if( resetAnnotation ) DeleteAnnotation( parent, annotateSchematic ); parent->DeleteAnnotation( !annotateSchematic, false ); /* Build the sheet list */ EDA_SheetList SheetList( g_RootSheet ); Loading Loading @@ -439,7 +464,6 @@ void BreakReference( CmpListStruct* BaseListeCmp, int NbOfCmp ) break; } } } } Loading eeschema/annotate_dialog.cpp +1 −3 Original line number Diff line number Diff line Loading @@ -34,8 +34,6 @@ #include "program.h" #include "annotate_dialog.h" extern void DeleteAnnotation( WinEDA_SchematicFrame* parent, bool annotateSchematic ); extern void AnnotateComponents( WinEDA_SchematicFrame* parent, bool annotateSchematic, bool sortByPosition, Loading Loading @@ -262,7 +260,7 @@ void WinEDA_AnnotateFrame::OnClearAnnotationCmpClick( wxCommandEvent& event ) wxICON_EXCLAMATION | wxOK | wxCANCEL ); if (response == wxCANCEL) return; DeleteAnnotation( m_Parent, GetLevel() ); m_Parent->DeleteAnnotation( GetLevel() ? false : true, true ); m_btnClear->Enable(false); } Loading eeschema/block.cpp +4 −4 Original line number Diff line number Diff line Loading @@ -828,7 +828,7 @@ static SCH_ITEM * CopyStruct( WinEDA_DrawPanel* panel, wxDC* DC, BASE_SCREEN* sc case TYPE_SCH_COMPONENT: { ( (SCH_COMPONENT*) Struct )->m_TimeStamp = GetTimeStamp(); ( (SCH_COMPONENT*) Struct )->ClearAnnotation(); ( (SCH_COMPONENT*) Struct )->ClearAnnotation(NULL); } break; Loading Loading @@ -893,7 +893,7 @@ static SCH_ITEM * CopyStruct( WinEDA_DrawPanel* panel, wxDC* DC, BASE_SCREEN* sc case TYPE_SCH_COMPONENT: ( (SCH_COMPONENT*) NewDrawStruct )->m_TimeStamp = GetTimeStamp(); ( (SCH_COMPONENT*) NewDrawStruct )->ClearAnnotation(); ( (SCH_COMPONENT*) NewDrawStruct )->ClearAnnotation(NULL); break; } Loading Loading @@ -1051,7 +1051,7 @@ void WinEDA_SchematicFrame::PasteStruct( wxDC* DC ) if( Struct->Type() == TYPE_SCH_COMPONENT ) { ( (SCH_COMPONENT*) Struct )->m_TimeStamp = GetTimeStamp(); ( (SCH_COMPONENT*) Struct )->ClearAnnotation(); ( (SCH_COMPONENT*) Struct )->ClearAnnotation(NULL); SetStructFather( Struct, GetScreen() ); } PickedList = (DrawPickedStruct*) PickedList->Pnext; Loading @@ -1075,7 +1075,7 @@ void WinEDA_SchematicFrame::PasteStruct( wxDC* DC ) if( DrawStruct->Type() == TYPE_SCH_COMPONENT ) { ( (SCH_COMPONENT*) DrawStruct )->m_TimeStamp = GetTimeStamp(); ( (SCH_COMPONENT*) DrawStruct )->ClearAnnotation(); ( (SCH_COMPONENT*) DrawStruct )->ClearAnnotation(NULL); } SetStructFather( DrawStruct, GetScreen() ); RedrawOneStruct( DrawPanel, DC, DrawStruct, GR_DEFAULT_DRAWMODE ); Loading eeschema/class_drawsheet.cpp +0 −26 Original line number Diff line number Diff line Loading @@ -359,32 +359,6 @@ EDA_Rect DrawSheetStruct::GetBoundingBox() } /**************************************************************************************/ void DrawSheetStruct::DeleteAnnotation( bool recurse ) /**************************************************************************************/ { if( recurse && m_AssociatedScreen ) { EDA_BaseStruct* strct = m_AssociatedScreen->EEDrawList; for( ; strct; strct = strct->Pnext ) { if( strct->Type() == DRAW_SHEET_STRUCT_TYPE ) { DrawSheetStruct* sheet = (DrawSheetStruct*) strct; sheet->DeleteAnnotation( recurse ); } } } EDA_BaseStruct* comp = m_AssociatedScreen->EEDrawList; for( ; comp; comp = comp->Pnext ) { if( comp->Type() == TYPE_SCH_COMPONENT ) { ( (SCH_COMPONENT*) comp )->ClearAnnotation(); } } } /*******************************************************************/ int DrawSheetStruct::ComponentCount() Loading Loading
change_log.txt +10 −0 Original line number Diff line number Diff line Loading @@ -5,6 +5,16 @@ Started 2007-June-11 Please add newer entries at the top, list the date and your name with email address. 2008-Apr-21 UPDATE Jean-Pierre Charras <jean-pierre.charras@inpg.fr> ================================================================================ +eeschema * Added WinEDA_LibeditFrame::GeneralControle( wxDC* DC, wxPoint Mouse ); * Added WinEDA_ViewlibFrame::GeneralControle( wxDC* DC, wxPoint Mouse ); Needed: Move redundant code to WinEDA_DrawFrame::GeneralControle ** Current sheet only Annotation and clear annotation now works for complex hierarchies 2008-Apr-17 UPDATE Dick Hollenbeck <dick@softplc.com> ================================================================================ +all Loading
eeschema/annotate.cpp +71 −47 Original line number Diff line number Diff line Loading @@ -119,13 +119,9 @@ void ReAnnotatePowerSymbolsOnly( void ) CmpListStruct* AllocateCmpListStrct( int numcomponents ) { int ii = numcomponents * sizeof(CmpListStruct); CmpListStruct* list = (CmpListStruct*) MyZMalloc( ii ); //fill this memory with zeros. char* cptr = (char*) list; for( int i = 0; i<ii; i++ ) *cptr++ = 0; //allocate memory and fill this memory with zeros. CmpListStruct* list = (CmpListStruct*) MyZMalloc( ii ); return list; } Loading Loading @@ -192,24 +188,53 @@ int AnnotateByValue( const void* o1, const void* o2 ) } /***************************************************************************** * DeleteAnnotation: * * Clear the current annotation. ****************************************************************************/ void DeleteAnnotation( WinEDA_SchematicFrame* parent, bool annotateSchematic ) /**************************************************************************************/ void WinEDA_SchematicFrame::DeleteAnnotation( bool aCurrentSheetOnly, bool aRedraw ) /**************************************************************************************/ /** Function DeleteAnnotation * Remove current component annotations * @param aCurrentSheetOnly : if false: remove all annotations, else remove annotation relative to the current sheet only * @param aRedraw : true to refresh display */ { DrawSheetStruct* sheet; EDA_BaseStruct* strct; SCH_SCREEN* screen; EDA_ScreenList ScreenList; if( annotateSchematic ) sheet = g_RootSheet; screen = ScreenList.GetFirst(); if( aCurrentSheetOnly ) screen = GetScreen(); if( screen == NULL ) return; while( screen ) { strct = screen->EEDrawList; for( ; strct; strct = strct->Pnext ) { if( strct->Type() == TYPE_SCH_COMPONENT ) { if( aCurrentSheetOnly ) ( (SCH_COMPONENT*) strct )->ClearAnnotation( m_CurrentSheet ); else sheet = parent->GetSheet()->Last(); ( (SCH_COMPONENT*) strct )->ClearAnnotation( NULL ); } } screen->SetModify(); if( aCurrentSheetOnly ) break; screen = ScreenList.GetNext(); } sheet->DeleteAnnotation( annotateSchematic ); g_RootSheet->m_AssociatedScreen->SetModify(); parent->DrawPanel->Refresh( true ); //update the References m_CurrentSheet->UpdateAllScreenReferences(); if( aRedraw ) DrawPanel->Refresh( true ); } Loading Loading @@ -238,7 +263,7 @@ void AnnotateComponents( WinEDA_SchematicFrame* parent, /* If it is an annotation for all the components, reset previous * annotation: */ if( resetAnnotation ) DeleteAnnotation( parent, annotateSchematic ); parent->DeleteAnnotation( !annotateSchematic, false ); /* Build the sheet list */ EDA_SheetList SheetList( g_RootSheet ); Loading Loading @@ -439,7 +464,6 @@ void BreakReference( CmpListStruct* BaseListeCmp, int NbOfCmp ) break; } } } } Loading
eeschema/annotate_dialog.cpp +1 −3 Original line number Diff line number Diff line Loading @@ -34,8 +34,6 @@ #include "program.h" #include "annotate_dialog.h" extern void DeleteAnnotation( WinEDA_SchematicFrame* parent, bool annotateSchematic ); extern void AnnotateComponents( WinEDA_SchematicFrame* parent, bool annotateSchematic, bool sortByPosition, Loading Loading @@ -262,7 +260,7 @@ void WinEDA_AnnotateFrame::OnClearAnnotationCmpClick( wxCommandEvent& event ) wxICON_EXCLAMATION | wxOK | wxCANCEL ); if (response == wxCANCEL) return; DeleteAnnotation( m_Parent, GetLevel() ); m_Parent->DeleteAnnotation( GetLevel() ? false : true, true ); m_btnClear->Enable(false); } Loading
eeschema/block.cpp +4 −4 Original line number Diff line number Diff line Loading @@ -828,7 +828,7 @@ static SCH_ITEM * CopyStruct( WinEDA_DrawPanel* panel, wxDC* DC, BASE_SCREEN* sc case TYPE_SCH_COMPONENT: { ( (SCH_COMPONENT*) Struct )->m_TimeStamp = GetTimeStamp(); ( (SCH_COMPONENT*) Struct )->ClearAnnotation(); ( (SCH_COMPONENT*) Struct )->ClearAnnotation(NULL); } break; Loading Loading @@ -893,7 +893,7 @@ static SCH_ITEM * CopyStruct( WinEDA_DrawPanel* panel, wxDC* DC, BASE_SCREEN* sc case TYPE_SCH_COMPONENT: ( (SCH_COMPONENT*) NewDrawStruct )->m_TimeStamp = GetTimeStamp(); ( (SCH_COMPONENT*) NewDrawStruct )->ClearAnnotation(); ( (SCH_COMPONENT*) NewDrawStruct )->ClearAnnotation(NULL); break; } Loading Loading @@ -1051,7 +1051,7 @@ void WinEDA_SchematicFrame::PasteStruct( wxDC* DC ) if( Struct->Type() == TYPE_SCH_COMPONENT ) { ( (SCH_COMPONENT*) Struct )->m_TimeStamp = GetTimeStamp(); ( (SCH_COMPONENT*) Struct )->ClearAnnotation(); ( (SCH_COMPONENT*) Struct )->ClearAnnotation(NULL); SetStructFather( Struct, GetScreen() ); } PickedList = (DrawPickedStruct*) PickedList->Pnext; Loading @@ -1075,7 +1075,7 @@ void WinEDA_SchematicFrame::PasteStruct( wxDC* DC ) if( DrawStruct->Type() == TYPE_SCH_COMPONENT ) { ( (SCH_COMPONENT*) DrawStruct )->m_TimeStamp = GetTimeStamp(); ( (SCH_COMPONENT*) DrawStruct )->ClearAnnotation(); ( (SCH_COMPONENT*) DrawStruct )->ClearAnnotation(NULL); } SetStructFather( DrawStruct, GetScreen() ); RedrawOneStruct( DrawPanel, DC, DrawStruct, GR_DEFAULT_DRAWMODE ); Loading
eeschema/class_drawsheet.cpp +0 −26 Original line number Diff line number Diff line Loading @@ -359,32 +359,6 @@ EDA_Rect DrawSheetStruct::GetBoundingBox() } /**************************************************************************************/ void DrawSheetStruct::DeleteAnnotation( bool recurse ) /**************************************************************************************/ { if( recurse && m_AssociatedScreen ) { EDA_BaseStruct* strct = m_AssociatedScreen->EEDrawList; for( ; strct; strct = strct->Pnext ) { if( strct->Type() == DRAW_SHEET_STRUCT_TYPE ) { DrawSheetStruct* sheet = (DrawSheetStruct*) strct; sheet->DeleteAnnotation( recurse ); } } } EDA_BaseStruct* comp = m_AssociatedScreen->EEDrawList; for( ; comp; comp = comp->Pnext ) { if( comp->Type() == TYPE_SCH_COMPONENT ) { ( (SCH_COMPONENT*) comp )->ClearAnnotation(); } } } /*******************************************************************/ int DrawSheetStruct::ComponentCount() Loading