Commit 2a1b776b authored by CHARRAS's avatar CHARRAS

see changelog

parent df7e6f37
......@@ -5,6 +5,23 @@ Started 2007-June-11
Please add newer entries at the top, list the date and your name with
email address.
2008-Feb-26 UPDATE Jean-Pierre Charras <jean-pierre.charras@inpg.fr>
================================================================================
+eeschema
changed in class DrawSheetStruct m_s member name to m_AssociatedScreen
some others minor problems solved.
some files "uncrustified"
Major problem in undo/redo when a sheet is deleted not yet solved
Only for a complex hierarchy, could lost data.
When a sheet is deleted by block delete. it is put in undo list.
It is really deleted after 10 changes (when the undo list is full).
At this time, the associated data is also deleted.
If an other (not deleted) sheet shares the same data, this data is lost.
Need work to solve this problem and keep the undo/redo feature.
2008-Feb-25 UPDATE Wayne Stambaugh <stambaughw{at}verizon{dot}net>
================================================================================
+eeschema
......
......@@ -34,9 +34,6 @@ void ReAnnotatePowerSymbolsOnly( void )
/* Build the screen list (screen, not sheet) */
EDA_SheetList SheetList( NULL );
/* Update the screen number, sheet count and date */
//ScreenList.UpdateScreenNumberAndDate();
DrawSheetList* sheet;
int CmpNumber = 1;
......@@ -161,7 +158,7 @@ void DeleteAnnotation( WinEDA_SchematicFrame* parent, bool annotateSchematic )
sheet->DeleteAnnotation( annotateSchematic );
g_RootSheet->m_s->SetModify();
g_RootSheet->m_AssociatedScreen->SetModify();
parent->DrawPanel->Refresh( true );
}
......@@ -192,10 +189,11 @@ void AnnotateComponents( WinEDA_SchematicFrame* parent,
/* Build the sheet list */
EDA_SheetList SheetList( g_RootSheet );
/* Update the sheet number */
ii = 0;
/* Update the screen number, sheet count and date */
SheetList.UpdateSheetNumberAndDate();
/* First pass: Component counting */
ii = 0;
sheet = parent->GetSheet();
if( annotateSchematic )
{
......@@ -595,7 +593,7 @@ int CheckAnnotate( WinEDA_SchematicFrame* frame, bool oneSheetOnly )
/* build the screen list */
EDA_SheetList SheetList( NULL );
g_RootSheet->m_s->SetModify();
g_RootSheet->m_AssociatedScreen->SetModify();
ii = 0;
/* first pass : count composents */
......
......@@ -258,7 +258,7 @@ void WinEDA_AnnotateFrame::OnClear( wxCommandEvent& event )
message += _( "\n\nThis operation will clear the existing annotation " \
"and cannot be undone." );
response = wxMessageBox( message, _( "" ),
response = wxMessageBox( message, wxT( "" ),
wxICON_EXCLAMATION | wxOK | wxCANCEL );
if (response == wxCANCEL)
return;
......@@ -283,7 +283,7 @@ void WinEDA_AnnotateFrame::OnApply( wxCommandEvent& event )
message += _( "\n\nThis operation will change the current annotation and " \
"cannot be undone." );
response = wxMessageBox( message, _( "" ),
response = wxMessageBox( message, wxT( "" ),
wxICON_EXCLAMATION | wxOK | wxCANCEL );
if (response == wxCANCEL)
return;
......
......@@ -832,12 +832,12 @@ static EDA_BaseStruct* CopyStruct( WinEDA_DrawPanel* panel, wxDC* DC, BASE_SCREE
case DRAW_SHEET_STRUCT_TYPE:
{
//DuplicateStruct calls GenCopy, which should handle
//m_s and m_sRefCount properly.
//m_AssociatedScreen and m_sRefCount properly.
DrawSheetStruct* sheet = (DrawSheetStruct*) Struct;
sheet->m_TimeStamp = GetTimeStamp();
//sheet->m_s->m_UndoList = NULL;
//sheet->m_s->m_RedoList = NULL;
//keep m_s pointer & associated.
//sheet->m_AssociatedScreen->m_UndoList = NULL;
//sheet->m_AssociatedScreen->m_RedoList = NULL;
//keep m_AssociatedScreen pointer & associated.
//sheet->m_Son = NULL; m_son is involved in undo and redo.
break;
}
......
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
......@@ -140,9 +140,7 @@ void EDA_SchComponentStruct::SetRef( DrawSheetList* sheet, wxString ref )
//check to see if it is already there before inserting it
wxString path = GetPath( sheet );
printf( "SetRef path: %s ref: %s\n",
CONV_TO_UTF8( path ),
CONV_TO_UTF8( ref ) );
// printf( "SetRef path: %s ref: %s\n", CONV_TO_UTF8( path ), CONV_TO_UTF8( ref ) ); // Debug
unsigned int i;
bool notInArray = true;
for( i = 0; i<m_Paths.GetCount(); i++ )
......
......@@ -28,8 +28,8 @@ enum NumFieldType {
FIELD5,
FIELD6,
FIELD7,
FIELD8,
NUMBER_OF_FIELDS /* Nombre de champs de texte affectes au composant */
FIELD8,
NUMBER_OF_FIELDS /* Nombre de champs de texte affectes au composant */
};
......@@ -37,7 +37,8 @@ enum NumFieldType {
* component fields are texts attached to the component (not the graphic texts)
* There are 2 major fields : Reference and Value
*/
class PartTextStruct : public EDA_BaseStruct, public EDA_TextStruct
class PartTextStruct : public EDA_BaseStruct
, public EDA_TextStruct
{
public:
int m_Layer;
......@@ -48,7 +49,7 @@ public:
public:
PartTextStruct( const wxPoint& pos = wxPoint( 0, 0 ), const wxString& text = wxEmptyString );
~PartTextStruct();
virtual wxString GetClass() const
{
return wxT( "PartText" );
......@@ -78,37 +79,38 @@ public:
wxPoint m_Pos; /* Exact position of part. */
public:
DrawPartStruct( KICAD_T struct_type, const wxPoint &pos );
DrawPartStruct( KICAD_T struct_type, const wxPoint& pos );
~DrawPartStruct();
virtual wxString GetClass() const
{
return wxT( "DrawPart" );
}
};
WX_DECLARE_OBJARRAY(DrawSheetList, ArrayOfSheetLists);
WX_DECLARE_OBJARRAY( DrawSheetList, ArrayOfSheetLists );
/* the class EDA_SchComponentStruct describes a real component */
class EDA_SchComponentStruct : public DrawPartStruct
{
public:
int m_Multi; /* In multi unit chip - which unit to draw. */
int m_Multi; /* In multi unit chip - which unit to draw. */
//int m_FlagControlMulti;
ArrayOfSheetLists m_UsedOnSheets;
int m_Convert; /* Gestion (management) des mutiples representations (ex: conversion De Morgan) */
int m_Transform[2][2]; /* The rotation/mirror transformation matrix. */
bool* m_PinIsDangling; // liste des indicateurs de pin non connectee
ArrayOfSheetLists m_UsedOnSheets;
int m_Convert; /* Gestion (management) des mutiples representations (ex: conversion De Morgan) */
int m_Transform[2][2]; /* The rotation/mirror transformation matrix. */
bool* m_PinIsDangling; // liste des indicateurs de pin non connectee
wxArrayString m_Paths; // /sheet1/C102, /sh2/sh1/U32 etc.
wxArrayString m_References; // C102, U32 etc.
wxString m_PrefixString; //C, R, U, Q etc - the first character which typically indicates what the component is.
//determined, upon placement, from the library component.
//determined, upon file load, by the first non-digits in the reference fields.
wxArrayString m_Paths; // /sheet1/C102, /sh2/sh1/U32 etc.
wxArrayString m_References; // C102, U32 etc.
wxString m_PrefixString; /*C, R, U, Q etc - the first character which typically indicates what the component is.
* determined, upon placement, from the library component.
* 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 ) { }
virtual wxString GetClass() const
{
return wxT( "EDA_SchComponent" );
......@@ -124,7 +126,7 @@ public:
EDA_Rect GetBoundaryBox();
const wxString& ReturnFieldName( int aFieldNdx ) const;
/**
* Function GetFieldValue
......@@ -134,32 +136,35 @@ public:
*/
const wxString& GetFieldValue( int aFieldNdx ) const;
virtual void Draw( WinEDA_DrawPanel* panel,
wxDC* DC,
const wxPoint& offset,
int draw_mode,
int Color = -1 );
wxDC* DC,
const wxPoint& offset,
int draw_mode,
int Color = -1 );
void SwapData( EDA_SchComponentStruct* copyitem );
virtual void Place( WinEDA_DrawFrame* frame, wxDC* DC );
//returns a unique ID, in the form of a path.
wxString GetPath( DrawSheetList* sheet);
const wxString GetRef( DrawSheetList* sheet );
void SetRef( DrawSheetList* sheet, wxString ref );
void ClearRefs();
#if defined(DEBUG)
//returns a unique ID, in the form of a path.
wxString GetPath( DrawSheetList* sheet );
const wxString GetRef( DrawSheetList* sheet );
void SetRef( DrawSheetList* sheet, wxString ref );
void ClearRefs();
#if defined (DEBUG)
/**
* Function Show
* is used to output the object tree, currently for debugging only.
* @param nestLevel An aid to prettier tree indenting, and is the level
* @param nestLevel An aid to prettier tree indenting, and is the level
* of nesting of this object within the overall tree.
* @param os The ostream& to output to.
*/
void Show( int nestLevel, std::ostream& os );
#endif
void Show( int nestLevel, std::ostream& os );
#endif
};
......
......@@ -37,20 +37,20 @@ wxString msg;
}
/* effacement du sous schema correspondant */
if( FirstSheet->m_s->IsModify() && confirm_deletion )
if( FirstSheet->m_AssociatedScreen->IsModify() && confirm_deletion )
{
msg.Printf( _("Sheet %s (file %s) modified. Save it?"),
FirstSheet->m_SheetName.GetData(),
FirstSheet->m_FileName.GetData());
if( IsOK(NULL, msg) )
{
frame->SaveEEFile(FirstSheet->m_s, FILE_SAVE_AS);
frame->SaveEEFile(FirstSheet->m_AssociatedScreen, FILE_SAVE_AS);
}
}
/* free the sub hierarchy */
if(FirstSheet->m_s){
EEDrawList = FirstSheet->m_s->EEDrawList;
if(FirstSheet->m_AssociatedScreen){
EEDrawList = FirstSheet->m_AssociatedScreen->EEDrawList;
while (EEDrawList != NULL)
{
DrawStruct = EEDrawList;
......@@ -61,7 +61,7 @@ wxString msg;
}
}
/* Effacement des elements de la feuille courante */
FirstSheet->m_s->FreeDrawList();
FirstSheet->m_AssociatedScreen->FreeDrawList();
}
}
......
......@@ -544,7 +544,7 @@ wxString mask, filename;
else
s_ExportSeparatorSymbol = s_ExportSeparator[0];
m_ListFileName = g_RootSheet->m_s->m_FileName;
m_ListFileName = g_RootSheet->m_AssociatedScreen->m_FileName;
ChangeFileNameExt(m_ListFileName, EXT_LIST);
//need to get rid of the path.
m_ListFileName = m_ListFileName.AfterLast('/');
......
This diff is collapsed.
......@@ -129,7 +129,7 @@ wxString title;
void WinEDA_DrawPanel::PrintPage(wxDC * DC, bool Print_Sheet_Ref, int PrintMask)
/*******************************************************************************/
{
BASE_SCREEN * screen; // * oldscreen = m_Parent->GetScreen();
BASE_SCREEN * screen;
wxBeginBusyCursor();
......@@ -140,7 +140,6 @@ BASE_SCREEN * screen; // * oldscreen = m_Parent->GetScreen();
if ( Print_Sheet_Ref )
m_Parent->TraceWorkSheet(DC, screen, g_DrawMinimunLineWidth );
//m_Parent->m_CurrentSheet->m_s = oldscreen;
wxEndBusyCursor();
}
......
......@@ -400,7 +400,7 @@ void WinEDA_ErcFrame::TestErc( wxCommandEvent& event )
if( WriteFichierERC == TRUE )
{
wxString ErcFullFileName;
ErcFullFileName = g_RootSheet->m_s->m_FileName;
ErcFullFileName = g_RootSheet->m_AssociatedScreen->m_FileName;
ChangeFileNameExt( ErcFullFileName, wxT( ".erc" ) );
ErcFullFileName = EDA_FileSelector( _( "ERC file:" ),
wxEmptyString, /* Chemin par defaut */
......
......@@ -63,7 +63,7 @@ void WinEDA_SchematicFrame::Save_File( wxCommandEvent& event )
mask = wxT( "*" ) + g_SchExtBuffer;
FullFileName = EDA_FileSelector( _( "Schematic files:" ),
wxEmptyString, //default path
sheet->m_s->m_FileName,// default filename
sheet->m_AssociatedScreen->m_FileName,// default filename
g_SchExtBuffer, // extension par defaut
mask, // Masque d'affichage
this,
......@@ -111,8 +111,8 @@ int WinEDA_SchematicFrame::LoadOneEEProject( const wxString& FileName, bool IsNe
{
if( !IsOK( this, _( "Clear Schematic Hierarchy (modified!)?" ) ) )
return FALSE;
if( g_RootSheet->m_s->m_FileName != g_DefaultSchematicFileName )
SetLastProject( g_RootSheet->m_s->m_FileName );
if( g_RootSheet->m_AssociatedScreen->m_FileName != g_DefaultSchematicFileName )
SetLastProject( g_RootSheet->m_AssociatedScreen->m_FileName );
}
FullFileName = FileName;
......@@ -146,7 +146,7 @@ int WinEDA_SchematicFrame::LoadOneEEProject( const wxString& FileName, bool IsNe
memset( &g_EESchemaVar, 0, sizeof(g_EESchemaVar) );
GetScreen()->ClrModify();
//m_CurrentSheet->m_s->Pnext = NULL; should be by default
//m_CurrentSheet->m_AssociatedScreen->Pnext = NULL; should be by default
if( IsNew )
{
......@@ -190,7 +190,7 @@ int WinEDA_SchematicFrame::LoadOneEEProject( const wxString& FileName, bool IsNe
// Loading the project library cache
wxString FullLibName;
wxString shortfilename;
wxSplitPath( g_RootSheet->m_s->m_FileName, NULL, &shortfilename, NULL );
wxSplitPath( g_RootSheet->m_AssociatedScreen->m_FileName, NULL, &shortfilename, NULL );
FullLibName << wxT( "." ) << STRING_DIR_SEP << shortfilename << wxT( ".cache" ) <<
g_LibExtBuffer;
if( wxFileExists( FullLibName ) )
......@@ -211,16 +211,16 @@ int WinEDA_SchematicFrame::LoadOneEEProject( const wxString& FileName, bool IsNe
LibCacheExist = TRUE;
}
if( !wxFileExists( g_RootSheet->m_s->m_FileName ) && !LibCacheExist ) // Nouveau projet prpbablement
if( !wxFileExists( g_RootSheet->m_AssociatedScreen->m_FileName ) && !LibCacheExist ) // Nouveau projet prpbablement
{
msg.Printf( _( "File %s not found (new project ?)" ),
g_RootSheet->m_s->m_FileName.GetData() );
g_RootSheet->m_AssociatedScreen->m_FileName.GetData() );
DisplayInfo( this, msg, 20 );
return -1;
}
//load the project.
SAFE_DELETE(g_RootSheet->m_s);
SAFE_DELETE(g_RootSheet->m_AssociatedScreen);
if(!g_RootSheet->Load(this))
return 0;
......
......@@ -273,7 +273,7 @@ void WinEDA_SchematicFrame::InstallNextScreen(DrawSheetStruct * Sheet)
/* Routine d'installation de l'ecran correspondant au symbole Sheet pointe
par la souris
have to be careful here because the DrawSheetStructs within the EEDrawList
don't actually have a valid m_s (on purpose -- you need the m_SubSheet hierarchy
don't actually have a valid m_AssociatedScreen (on purpose -- you need the m_SubSheet hierarchy
to maintain path info (well, this is but one way to maintain path info..)
*/
{
......@@ -297,11 +297,10 @@ static void UpdateScreenFromSheet(WinEDA_SchematicFrame * frame)
{
SCH_SCREEN * NewScreen;
//SCH_SCREEN * oldscreen = frame->GetScreen(); what is oldscreen used for?
NewScreen = frame->m_CurrentSheet->LastScreen();
if(!NewScreen)
NewScreen = g_RootSheet->m_s;
NewScreen = g_RootSheet->m_AssociatedScreen;
// Reinit des parametres d'affichage du nouvel ecran
// assumes m_CurrentSheet has already been updated.
......
......@@ -656,6 +656,7 @@ void WinEDA_LibeditFrame::Process_Special_Functions( wxCommandEvent& event )
{
EditField( &dc, (LibDrawField*) CurrentDrawItem );
}
DrawPanel->MouseToCursorSchema();
DrawPanel->CursorOn( &dc );
break;
......@@ -725,7 +726,6 @@ void WinEDA_LibeditFrame::Process_Special_Functions( wxCommandEvent& event )
break;
}
DrawPanel->MouseToCursorSchema();
DrawPanel->m_IgnoreMouseEvents = FALSE;
if( m_ID_current_state == 0 )
......
......@@ -65,7 +65,9 @@ OBJECTS = eeschema.o\
savelib.o symbtext.o \
symbdraw.o \
hierarch.o files-io.o \
annotate.o plothpgl.o \
annotate.o\
annotate_dialog.o\
plothpgl.o \
plot.o libalias.o \
plotps.o netform.o \
delsheet.o \
......@@ -110,7 +112,9 @@ find.o:find.cpp dialog_find.cpp dialog_find.h $(DEPEND)
eeconfig.o: eeconfig.cpp eeconfig.h $(DEPEND)
annotate.o: annotate.cpp annotate_dialog.cpp annotate_dialog.h $(DEPEND) netlist.h
annotate.o: annotate.cpp annotate_dialog.h $(DEPEND) netlist.h
annotate_dialog.o: annotate_dialog.cpp annotate_dialog.h $(DEPEND) netlist.h
netlist.o: netlist.cpp $(DEPEND) netlist.h
......
......@@ -170,7 +170,7 @@ void* WinEDA_SchematicFrame::BuildNetListBase()
g_TabObjNet = NULL; /* Init pour le 1er passage dans ListeObjetConnection */
/* count nelist items */
g_RootSheet->m_s->SetModify();
g_RootSheet->m_AssociatedScreen->SetModify();
for( sheet = SheetListList.GetFirst(); sheet != NULL; sheet = SheetListList.GetNext() )
{
......
......@@ -539,7 +539,7 @@ void WinEDA_NetlistFrame::GenNetlist( wxCommandEvent& event )
g_NetFormat = CurrPage->m_IdNetType;
/* Calculate the netlist filename */
FullFileName = g_RootSheet->m_s->m_FileName;
FullFileName = g_RootSheet->m_AssociatedScreen->m_FileName;
switch( g_NetFormat )
{
......@@ -649,7 +649,7 @@ void WinEDA_NetlistFrame::RunSimulator( wxCommandEvent& event )
CommandLine = g_SimulatorCommandLine.AfterFirst( ' ' );
/* Calculate the netlist filename */
NetlistFullFileName = g_RootSheet->m_s->m_FileName;
NetlistFullFileName = g_RootSheet->m_AssociatedScreen->m_FileName;
ChangeFileNameExt( NetlistFullFileName, wxT( ".cir" ) );
AddDelimiterString( NetlistFullFileName );
CommandLine += wxT( " " ) + NetlistFullFileName;
......
......@@ -209,7 +209,7 @@ void WinEDA_SchematicFrame::Process_Special_Functions( wxCommandEvent& event )
case ID_TO_PCB:
{
wxString Line;
if( g_RootSheet->m_s->m_FileName != wxEmptyString )
if( g_RootSheet->m_AssociatedScreen->m_FileName != wxEmptyString )
{
Line = GetScreen()->m_FileName;
AddDelimiterString( Line );
......@@ -224,9 +224,9 @@ void WinEDA_SchematicFrame::Process_Special_Functions( wxCommandEvent& event )
case ID_TO_CVPCB:
{
wxString Line;
if( g_RootSheet->m_s->m_FileName != wxEmptyString )
if( g_RootSheet->m_AssociatedScreen->m_FileName != wxEmptyString )
{
Line = g_RootSheet->m_s->m_FileName;
Line = g_RootSheet->m_AssociatedScreen->m_FileName;
AddDelimiterString( Line );
ChangeFileNameExt( Line, wxEmptyString );
ExecuteFile( this, CVPCB_EXE, Line );
......
......@@ -16,40 +16,40 @@
/* Functions to undo and redo edit commands.
* commmands to undo are in CurrentScreen->m_UndoList
* commmands to redo are in CurrentScreen->m_RedoList
*
*
* m_UndoList and m_RedoList are a linked list of DrawPickedStruct.
* each DrawPickedStruct has its .m_Son member pointing to an item to undo or redo,
* or to a list of DrawPickedStruct which points (.m_PickedStruct membre)
* the items to undo or redo
*
*
* there are 3 cases:
* - delete item(s) command
* - change item(s) command
* - add item(s) command
*
*
* Undo command
* - delete item(s) command:
* deleted items are moved in undo list
*
*
* - change item(s) command
* A copy of item(s) is made (a DrawPickedStruct list of wrappers)
* the .m_Image member of each wrapper points the modified item.
*
*
* - add item(s) command
* A list of item(s) is made
* the .m_Image member of each wrapper points the new item.
*
*
* Redo command
* - delete item(s) old command:
* deleted items are moved in EEDrawList list
*
*
* - change item(s) command
* the copy of item(s) is moved in Undo list
*
*
* - add item(s) command
* The list of item(s) is used to create a deleted list in undo list
* (same as a delete command)
*
*
* A problem is the hierarchical sheet handling.
* the data associated (subhierarchy, uno/redo list) is deleted only
* when the sheet is really deleted (i.e. when deleted from undo or redo list)
......@@ -90,7 +90,7 @@ void SwapData( EDA_BaseStruct* Item )
case DRAW_LABEL_STRUCT_TYPE:
case DRAW_GLOBAL_LABEL_STRUCT_TYPE:
case DRAW_HIER_LABEL_STRUCT_TYPE:
case DRAW_HIER_LABEL_STRUCT_TYPE:
case DRAW_TEXT_STRUCT_TYPE:
#undef SOURCE
#undef DEST
......@@ -181,20 +181,20 @@ void WinEDA_SchematicFrame::SaveCopyInUndoList( EDA_BaseStruct* ItemToCopy,
/* Create a copy of the current schematic draw list, and put it in the undo list.
* A DrawPickedStruct wrapper is created to handle the draw list.
* the .m_Son of this wrapper points the list of items
*
*
* flag_type_command =
* 0 (unspecified)
* IS_CHANGED
* IS_NEW
* IS_DELETED
* IS_WIRE_IMAGE
*
*
* for 0: only a wrapper is created. The used must init the .Flags member of the
* wrapper, and add the item list to the wrapper
* If it is a delete command, items are put on list with the .Flags member set to IS_DELETED.
* When it will be really deleted, the EEDrawList and the subhierarchy will be deleted.
* If it is only a copy, the EEDrawList and the subhierarchy must NOT be deleted.
*
*
* Note:
* Edit wires and busses is a bit complex.
* because when a new wire is added, modifications in wire list
......@@ -286,13 +286,13 @@ void WinEDA_SchematicFrame::SaveCopyInUndoList( EDA_BaseStruct* ItemToCopy,
GetScreen()->AddItemToUndoList( NewList );
/* Clear redo list, because after new save there is no redo to do */
((SCH_SCREEN*)GetScreen())->ClearUndoORRedoList( GetScreen()->m_RedoList );
( (SCH_SCREEN*) GetScreen() )->ClearUndoORRedoList( GetScreen()->m_RedoList );
GetScreen()->m_RedoList = NULL;
}
/**********************************************************/
bool WinEDA_SchematicFrame::GetSchematicFromRedoList()
bool WinEDA_SchematicFrame::GetSchematicFromRedoList()
/**********************************************************/
/* Redo the last edition:
......@@ -314,8 +314,8 @@ bool WinEDA_SchematicFrame::GetSchematicFromRedoList()
GetScreen()->SetModify();
ReCreateHToolbar();
SetToolbars();
return TRUE;
return TRUE;
}
......@@ -362,7 +362,7 @@ void WinEDA_SchematicFrame::PutDataInPreviousState( DrawPickedStruct* List )
while( PickedList )
{
item = PickedList->m_Image;
((SCH_SCREEN*)GetScreen())->RemoveFromDrawList( item );
( (SCH_SCREEN*) GetScreen() )->RemoveFromDrawList( item );
item->m_Flags = IS_DELETED;
PickedList->m_PickedStruct = item;
PickedList->m_Flags = IS_DELETED;
......@@ -372,7 +372,7 @@ void WinEDA_SchematicFrame::PutDataInPreviousState( DrawPickedStruct* List )
else
{
FirstItem = List->m_Image;
((SCH_SCREEN*)GetScreen())->RemoveFromDrawList( FirstItem );
( (SCH_SCREEN*) GetScreen() )->RemoveFromDrawList( FirstItem );
FirstItem->m_Flags = IS_DELETED;
List->m_Son = FirstItem;
}
......@@ -407,7 +407,7 @@ void WinEDA_SchematicFrame::PutDataInPreviousState( DrawPickedStruct* List )
case IS_WIRE_IMAGE:
/* Exchange the current wires and the oild wires */
List->m_Son = ((SCH_SCREEN*)GetScreen())->ExtractWires( FALSE );
List->m_Son = ( (SCH_SCREEN*) GetScreen() )->ExtractWires( FALSE );
while( FirstItem )
{
EDA_BaseStruct* nextitem = FirstItem->Pnext;
......@@ -437,7 +437,7 @@ void WinEDA_SchematicFrame::PutDataInPreviousState( DrawPickedStruct* List )
case IS_NEW:
item = PickedList->m_Image;
((SCH_SCREEN*)GetScreen())->RemoveFromDrawList( item );
( (SCH_SCREEN*) GetScreen() )->RemoveFromDrawList( item );
item->m_Flags = IS_DELETED;
PickedList->m_PickedStruct = item;
PickedList->m_Flags = IS_DELETED;
......@@ -489,8 +489,8 @@ bool WinEDA_SchematicFrame::GetSchematicFromUndoList()
GetScreen()->SetModify();
ReCreateHToolbar();
SetToolbars();
return TRUE;
return TRUE;
}
......@@ -517,7 +517,7 @@ void SCH_SCREEN::ClearUndoORRedoList( EDA_BaseStruct* List )
FirstItem = List->m_Son;
CmdType = List->m_Flags;
SAFE_DELETE( List );
SAFE_DELETE( List );
if( FirstItem == NULL )
continue;
......@@ -542,22 +542,25 @@ void SCH_SCREEN::ClearUndoORRedoList( EDA_BaseStruct* List )
{
if( (item->m_Flags & IS_NEW) == 0 )
{
printf("schematic undo_redo.cpp: undo_redo with a DRAW_SHEET_STRUCT_TYPE, checkme!!\n");
/*
sheet->EEDrawList = NULL;
sheet->m_UndoList = NULL;
sheet->m_RedoList = NULL;
*/
printf(
"schematic undo_redo.cpp: undo_redo with a DRAW_SHEET_STRUCT_TYPE, checkme!!\n" );
/*
* sheet->EEDrawList = NULL;
* sheet->m_UndoList = NULL;
* sheet->m_RedoList = NULL;
*/
}
}
}
if( (item->m_Flags & IS_NEW) == 0 ){
SAFE_DELETE( item );
}
if( (item->m_Flags & IS_NEW) == 0 )
{
SAFE_DELETE( item );
}
}
DrawPickedStruct* wrapper = PickedList;
PickedList = PickedList->Next();
SAFE_DELETE( wrapper );
SAFE_DELETE( wrapper );
}
}
else // This is a single item: deleted copy
......@@ -583,18 +586,21 @@ void SCH_SCREEN::ClearUndoORRedoList( EDA_BaseStruct* List )
{
if( (FirstItem->m_Flags & IS_NEW) == 0 )
{
printf("schematic undo_redo.cpp undo_redo with a DRAW_SHEET_STRUCT_TYPE, checkme!!\n");
/*
sheet->EEDrawList = NULL;
sheet->m_UndoList = NULL;
sheet->m_RedoList = NULL;
*/
printf(
"schematic undo_redo.cpp undo_redo with a DRAW_SHEET_STRUCT_TYPE, checkme!!\n" );
/*
* sheet->EEDrawList = NULL;
* sheet->m_UndoList = NULL;
* sheet->m_RedoList = NULL;
*/
}
}
}
if( (FirstItem->m_Flags & IS_NEW) == 0 ){
SAFE_DELETE( FirstItem );
}
if( (FirstItem->m_Flags & IS_NEW) == 0 )
{
SAFE_DELETE( FirstItem );
}
}
}
}
......
......@@ -215,22 +215,22 @@ wxString WinEDA_SchematicFrame::GetScreenDesc()
}
/******************************/
/*******************************************/
void WinEDA_SchematicFrame::CreateScreens()
/******************************/
/*******************************************/
{
/* creation des ecrans Sch , Lib */
if( g_RootSheet == NULL )
{
g_RootSheet = new DrawSheetStruct();
}
if( g_RootSheet->m_s == NULL )
if( g_RootSheet->m_AssociatedScreen == NULL )
{
g_RootSheet->m_s = new SCH_SCREEN( SCHEMATIC_FRAME );
g_RootSheet->m_s->m_RefCount++;
g_RootSheet->m_AssociatedScreen = new SCH_SCREEN( SCHEMATIC_FRAME );
g_RootSheet->m_AssociatedScreen->m_RefCount++;
}
g_RootSheet->m_s->m_FileName = g_DefaultSchematicFileName;
g_RootSheet->m_s->m_Date = GenDate();
g_RootSheet->m_AssociatedScreen->m_FileName = g_DefaultSchematicFileName;
g_RootSheet->m_AssociatedScreen->m_Date = GenDate();
m_CurrentSheet->Clear();
m_CurrentSheet->Push( g_RootSheet );
......@@ -294,10 +294,11 @@ void WinEDA_SchematicFrame::OnCloseWindow( wxCloseEvent& Event )
}
}
if( !GetScreen()->m_FileName.IsEmpty() && (GetScreen()->EEDrawList != NULL) )
SetLastProject( GetScreen()->m_FileName );
if( !g_RootSheet->m_AssociatedScreen->m_FileName.IsEmpty() &&
(g_RootSheet->m_AssociatedScreen->EEDrawList != NULL) )
SetLastProject( g_RootSheet->m_AssociatedScreen->m_FileName );
ClearProjectDrawList( g_RootSheet->m_s, TRUE );
ClearProjectDrawList( g_RootSheet->m_AssociatedScreen, TRUE );
/* allof sub sheets are deleted, only the main sheet is useable */
m_CurrentSheet->Clear();
......
This diff is collapsed.
......@@ -358,8 +358,8 @@ DrawSheetLabelStruct* WinEDA_SchematicFrame::Import_PinSheet( DrawSheetStruct* S
DrawSheetLabelStruct* NewSheetLabel, * SheetLabel = NULL;
DrawHierLabelStruct* HLabel = NULL;
if(!Sheet->m_s) return NULL;
DrawStruct = Sheet->m_s->EEDrawList;
if(!Sheet->m_AssociatedScreen) return NULL;
DrawStruct = Sheet->m_AssociatedScreen->EEDrawList;
HLabel = NULL;
for( ; DrawStruct != NULL; DrawStruct = DrawStruct->Pnext )
{
......
No preview for this file type
This diff is collapsed.
This diff is collapsed.
......@@ -63,9 +63,9 @@ static std::vector<HOLE_INFO> s_HoleListBuffer;
#include "dialog_gendrill.cpp" // Dialog box for drill file generation
/**********************************************/
/************************************************/
void WinEDA_DrillFrame::InitDisplayParams( void )
/**********************************************/
/************************************************/
/* some param values initialisation before display dialog window
*/
......@@ -121,8 +121,6 @@ void WinEDA_DrillFrame::InitDisplayParams( void )
m_MicroViasDrillSizer->Enable( m_MicroViasCount );
m_MicroViaDrillValue->Enable( m_MicroViasCount );
/* Display statistics */
// Pads holes cound:
m_PadsHoleCount = 0;
for( MODULE* module = m_Parent->m_Pcb->m_Modules; module != NULL; module = module->Next() )
......@@ -133,10 +131,10 @@ void WinEDA_DrillFrame::InitDisplayParams( void )
{
if( pad->m_Drill.x != 0 )
m_PadsHoleCount++;
else
}
else
if( MIN( pad->m_Drill.x, pad->m_Drill.y ) != 0 )
m_PadsHoleCount++;
}
}
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment