Added comments about complex hierarchy handling. some code cleaning.
This commit is contained in:
parent
b603580355
commit
2be24e1f58
|
@ -55,8 +55,8 @@ void WinEDA_SchematicFrame::UpdateSheetNumberAndDate()
|
|||
****************************************************************************/
|
||||
void ReAnnotatePowerSymbolsOnly( void )
|
||||
{
|
||||
/* Build the sheet list (sheet, not screen) */
|
||||
EDA_SheetList SheetList( NULL );
|
||||
/* Build the whole sheet list in hierarchy (sheet, not screen) */
|
||||
EDA_SheetList SheetList;
|
||||
|
||||
DrawSheetPath* sheet;
|
||||
int CmpNumber = 1;
|
||||
|
@ -250,7 +250,7 @@ void AnnotateComponents( WinEDA_SchematicFrame* parent,
|
|||
parent->DeleteAnnotation( !annotateSchematic, false );
|
||||
|
||||
/* Build the sheet list */
|
||||
EDA_SheetList SheetList( g_RootSheet );
|
||||
EDA_SheetList SheetList;
|
||||
|
||||
/* Update the sheet number, sheet count and date */
|
||||
parent->UpdateSheetNumberAndDate();
|
||||
|
@ -615,7 +615,7 @@ int CheckAnnotate( WinEDA_SchematicFrame* frame, bool oneSheetOnly )
|
|||
wxString msg, cmpref;
|
||||
|
||||
/* build the screen list */
|
||||
EDA_SheetList SheetList( NULL );
|
||||
EDA_SheetList SheetList;
|
||||
|
||||
std::vector <OBJ_CMP_TO_LIST> ComponentsList;
|
||||
|
||||
|
|
|
@ -34,7 +34,7 @@ bool WinEDA_SchematicFrame::FillFootprintFieldForAllInstancesofComponent(
|
|||
{
|
||||
DrawSheetPath* sheet;
|
||||
SCH_ITEM* DrawList = NULL;
|
||||
EDA_SheetList SheetList( NULL );
|
||||
EDA_SheetList SheetList;
|
||||
SCH_COMPONENT* Cmp;
|
||||
bool found = false;
|
||||
|
||||
|
|
|
@ -264,7 +264,7 @@ void BuildComponentsListFromSchematic( std::vector <OBJ_CMP_TO_LIST>& aList )
|
|||
DrawSheetPath* sheet;
|
||||
|
||||
/* Build the sheet (not screen) list */
|
||||
EDA_SheetList SheetList( NULL );
|
||||
EDA_SheetList SheetList;
|
||||
|
||||
for( sheet = SheetList.GetFirst(); sheet != NULL; sheet = SheetList.GetNext() )
|
||||
{
|
||||
|
@ -303,8 +303,8 @@ static void GenListeGLabels( std::vector <LABEL_OBJECT>& aList )
|
|||
Hierarchical_PIN_Sheet_Struct* PinLabel;
|
||||
DrawSheetPath* sheet;
|
||||
|
||||
/* Build the screen list */
|
||||
EDA_SheetList SheetList( NULL );
|
||||
/* Build the sheet list */
|
||||
EDA_SheetList SheetList;
|
||||
|
||||
LABEL_OBJECT labet_object;
|
||||
|
||||
|
|
|
@ -218,12 +218,13 @@ void DrawSheetStruct::SwapData( DrawSheetStruct* copyitem )
|
|||
}
|
||||
|
||||
|
||||
/****************************************************************/
|
||||
/********************************************************************/
|
||||
void DrawSheetStruct::Place( WinEDA_SchematicFrame* frame, wxDC* DC )
|
||||
/****************************************************************/
|
||||
/********************************************************************/
|
||||
{
|
||||
/* Placement en liste des structures si nouveau composant:*/
|
||||
if( m_Flags & IS_NEW )
|
||||
bool isnew = (m_Flags & IS_NEW) ? true : false;
|
||||
if( isnew )
|
||||
{
|
||||
if( !frame->EditSheet( this, DC ) )
|
||||
{
|
||||
|
@ -237,6 +238,10 @@ void DrawSheetStruct::Place( WinEDA_SchematicFrame* frame, wxDC* DC )
|
|||
}
|
||||
|
||||
SCH_ITEM::Place( frame, DC ); //puts it on the EEDrawList.
|
||||
if ( isnew )
|
||||
{
|
||||
frame->SetSheetNumberAndCount();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
@ -540,6 +545,11 @@ bool DrawSheetStruct::Load( WinEDA_SchematicFrame* aFrame )
|
|||
/**********************************/
|
||||
int DrawSheetStruct::CountSheets()
|
||||
/**********************************/
|
||||
/** Function CountSheets
|
||||
* calculates the number of sheets found in "this"
|
||||
* this number includes the full subsheets count
|
||||
* @return the full count of sheets+subsheets contained by "this"
|
||||
*/
|
||||
{
|
||||
int count = 1; //1 = this!!
|
||||
|
||||
|
@ -550,8 +560,8 @@ int DrawSheetStruct::CountSheets()
|
|||
{
|
||||
if( strct->Type() == DRAW_SHEET_STRUCT_TYPE )
|
||||
{
|
||||
DrawSheetStruct* ss = (DrawSheetStruct*) strct;
|
||||
count += ss->CountSheets();
|
||||
DrawSheetStruct* subsheet = (DrawSheetStruct*) strct;
|
||||
count += subsheet->CountSheets();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -137,7 +137,7 @@ public:
|
|||
|
||||
/** Function ComponentCount
|
||||
* count our own components, without the power components.
|
||||
* @return the copponent count.
|
||||
* @return the component count.
|
||||
*/
|
||||
int ComponentCount();
|
||||
|
||||
|
@ -169,7 +169,18 @@ public:
|
|||
* @return true if found
|
||||
*/
|
||||
bool LocatePathOfScreen( SCH_SCREEN* aScreen, DrawSheetPath* aList );
|
||||
|
||||
/** Function CountSheets
|
||||
* calculates the number of sheets found in "this"
|
||||
* this number includes the full subsheets count
|
||||
* @return the full count of sheets+subsheets contained by "this"
|
||||
*/
|
||||
int CountSheets();
|
||||
|
||||
/** Function GetFileName
|
||||
* return the filename corresponding to this sheet
|
||||
* @return a wxString containing the filename
|
||||
*/
|
||||
wxString GetFileName( void );
|
||||
|
||||
// Set a new filename without changing anything else
|
||||
|
|
|
@ -43,19 +43,27 @@ DrawSheetPath::DrawSheetPath()
|
|||
}
|
||||
|
||||
|
||||
int DrawSheetPath::Cmp( const DrawSheetPath& d ) const
|
||||
/*******************************************************************/
|
||||
int DrawSheetPath::Cmp( const DrawSheetPath& aSheetPathToTest ) const
|
||||
/********************************************************************/
|
||||
|
||||
/** Function Cmp
|
||||
* Compare if this is the same sheet path as aSheetPathToTest
|
||||
* @param aSheetPathToTest = sheet path to compare
|
||||
* @return -1 if differents, 0 if same
|
||||
*/
|
||||
{
|
||||
if( m_numSheets > d.m_numSheets )
|
||||
if( m_numSheets > aSheetPathToTest.m_numSheets )
|
||||
return 1;
|
||||
if( m_numSheets < d.m_numSheets )
|
||||
if( m_numSheets < aSheetPathToTest.m_numSheets )
|
||||
return -1;
|
||||
|
||||
//otherwise, same number of sheets.
|
||||
for( int i = 0; i<m_numSheets; i++ )
|
||||
{
|
||||
if( m_sheets[i]->m_TimeStamp > d.m_sheets[i]->m_TimeStamp )
|
||||
if( m_sheets[i]->m_TimeStamp > aSheetPathToTest.m_sheets[i]->m_TimeStamp )
|
||||
return 1;
|
||||
if( m_sheets[i]->m_TimeStamp < d.m_sheets[i]->m_TimeStamp )
|
||||
if( m_sheets[i]->m_TimeStamp < aSheetPathToTest.m_sheets[i]->m_TimeStamp )
|
||||
return -1;
|
||||
}
|
||||
|
||||
|
@ -87,18 +95,31 @@ EDA_BaseStruct* DrawSheetPath::LastDrawList()
|
|||
}
|
||||
|
||||
|
||||
void DrawSheetPath::Push( DrawSheetStruct* sheet )
|
||||
/**************************************************/
|
||||
void DrawSheetPath::Push( DrawSheetStruct* aSheet )
|
||||
/**************************************************/
|
||||
|
||||
/** Function Push
|
||||
* store (push) aSheet in list
|
||||
* @param aSheet = pointer to the DrawSheetStruct to store in list
|
||||
*/
|
||||
{
|
||||
wxASSERT( m_numSheets <= DSLSZ );
|
||||
if( m_numSheets > DSLSZ )
|
||||
wxMessageBox( wxT( "DrawSheetPath::Push() error: no room in buffer to store sheet" ) );
|
||||
if( m_numSheets < DSLSZ )
|
||||
{
|
||||
m_sheets[m_numSheets] = sheet;
|
||||
m_sheets[m_numSheets] = aSheet;
|
||||
m_numSheets++;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
DrawSheetStruct* DrawSheetPath::Pop()
|
||||
|
||||
/** Function Pop
|
||||
* retrieves (pop) the last entered sheet and remove it from list
|
||||
* @return a DrawSheetStruct* pointer to the removed sheet in list
|
||||
*/
|
||||
{
|
||||
if( m_numSheets > 0 )
|
||||
{
|
||||
|
@ -110,10 +131,15 @@ DrawSheetStruct* DrawSheetPath::Pop()
|
|||
|
||||
|
||||
wxString DrawSheetPath::Path()
|
||||
|
||||
/** Function Path
|
||||
* the path uses the time stamps which do not changes even when editing sheet parameters
|
||||
* a path is something like / (root) or /34005677 or /34005677/00AE4523
|
||||
*/
|
||||
{
|
||||
wxString s, t;
|
||||
|
||||
s = wxT( "/" );
|
||||
s = wxT( "/" ); // This is the root path
|
||||
|
||||
//start at 1 to avoid the root sheet,
|
||||
//which does not need to be added to the path
|
||||
|
@ -128,7 +154,15 @@ wxString DrawSheetPath::Path()
|
|||
}
|
||||
|
||||
|
||||
/******************************************/
|
||||
wxString DrawSheetPath::PathHumanReadable()
|
||||
/******************************************/
|
||||
|
||||
/** Function PathHumanReadable
|
||||
* Return the sheet path in a readable form, i.e.
|
||||
* as a path made from sheet names.
|
||||
* (the "normal" path uses the time stamps which do not changes even when editing sheet parameters)
|
||||
*/
|
||||
{
|
||||
wxString s, t;
|
||||
|
||||
|
@ -155,7 +189,7 @@ void DrawSheetPath::UpdateAllScreenReferences()
|
|||
if( t->Type() == TYPE_SCH_COMPONENT )
|
||||
{
|
||||
SCH_COMPONENT* component = (SCH_COMPONENT*) t;
|
||||
component->GetField(REFERENCE)->m_Text = component->GetRef( this );
|
||||
component->GetField( REFERENCE )->m_Text = component->GetRef( this );
|
||||
component->m_Multi = component->GetUnitSelection( this );
|
||||
}
|
||||
t = t->Next();
|
||||
|
@ -209,17 +243,39 @@ bool DrawSheetPath::operator!=( const DrawSheetPath& d1 )
|
|||
}
|
||||
|
||||
|
||||
|
||||
/*********************************************************************/
|
||||
/* Class EDA_SheetList to handle the list of Sheets in a hierarchy */
|
||||
/*********************************************************************/
|
||||
|
||||
|
||||
/*******************************************************/
|
||||
EDA_SheetList::EDA_SheetList( DrawSheetStruct* aSheet )
|
||||
/*******************************************************/
|
||||
|
||||
/* The constructor: build the list of sheets from aSheet.
|
||||
* If aSheet == NULL (default) build the whole list of sheets in hierarchy
|
||||
* So usually call it with no param.
|
||||
*/
|
||||
{
|
||||
m_index = 0;
|
||||
m_count = 0;
|
||||
m_List = NULL;
|
||||
if( aSheet == NULL )
|
||||
aSheet = g_RootSheet;
|
||||
BuildSheetList( aSheet );
|
||||
}
|
||||
|
||||
|
||||
/*****************************************/
|
||||
DrawSheetPath* EDA_SheetList::GetFirst()
|
||||
/*****************************************/
|
||||
|
||||
/** Function GetFirst
|
||||
* @return the first item (sheet) in m_List and prepare calls to GetNext()
|
||||
*/
|
||||
{
|
||||
m_index = 0;
|
||||
if( m_count > 0 )
|
||||
if( GetCount() > 0 )
|
||||
return &( m_List[0] );
|
||||
return NULL;
|
||||
}
|
||||
|
@ -228,51 +284,63 @@ DrawSheetPath* EDA_SheetList::GetFirst()
|
|||
/*****************************************/
|
||||
DrawSheetPath* EDA_SheetList::GetNext()
|
||||
/*****************************************/
|
||||
|
||||
/** Function GetNext
|
||||
* @return the next item (sheet) in m_List or NULL if no more item in sheet list
|
||||
*/
|
||||
{
|
||||
if( m_index < m_count )
|
||||
if( m_index < GetCount() )
|
||||
m_index++;
|
||||
return GetSheet( m_index );
|
||||
}
|
||||
|
||||
|
||||
/************************************************/
|
||||
DrawSheetPath* EDA_SheetList::GetSheet( int index )
|
||||
DrawSheetPath* EDA_SheetList::GetSheet( int aIndex )
|
||||
/************************************************/
|
||||
|
||||
/* return the m_List[index] item
|
||||
/** Function GetSheet
|
||||
* @return the item (sheet) in aIndex position in m_List or NULL if less than index items
|
||||
* @param aIndex = index in sheet list to get the sheet
|
||||
*/
|
||||
{
|
||||
if( index < m_count )
|
||||
return &(m_List[index]);
|
||||
if( aIndex < GetCount() )
|
||||
return &(m_List[aIndex]);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
|
||||
/************************************************************************/
|
||||
void EDA_SheetList::BuildSheetList( DrawSheetStruct* sheet )
|
||||
void EDA_SheetList::BuildSheetList( DrawSheetStruct* aSheet )
|
||||
/************************************************************************/
|
||||
|
||||
/** Function BuildSheetList
|
||||
* Build the list of sheets and their sheet path from the aSheet sheet
|
||||
* if aSheet = g_RootSheet, the full sheet path list (and full sheet list) is built
|
||||
* @param aSheet = the starting sheet to build list
|
||||
*/
|
||||
{
|
||||
if( m_List == NULL )
|
||||
{
|
||||
int count = sheet->CountSheets();
|
||||
int count = aSheet->CountSheets();
|
||||
m_count = count;
|
||||
m_index = 0;
|
||||
count *= sizeof(DrawSheetPath);
|
||||
m_List = (DrawSheetPath*) MyZMalloc( count );
|
||||
count *= sizeof(DrawSheetPath);
|
||||
m_List = (DrawSheetPath*) MyZMalloc( count );
|
||||
m_currList.Clear();
|
||||
}
|
||||
m_currList.Push( sheet );
|
||||
m_currList.Push( aSheet );
|
||||
m_List[m_index] = m_currList;
|
||||
m_index++;
|
||||
if( sheet->m_AssociatedScreen != NULL )
|
||||
if( aSheet->m_AssociatedScreen != NULL )
|
||||
{
|
||||
EDA_BaseStruct* strct = m_currList.LastDrawList();
|
||||
while( strct )
|
||||
{
|
||||
if( strct->Type() == DRAW_SHEET_STRUCT_TYPE )
|
||||
{
|
||||
DrawSheetStruct* sht = (DrawSheetStruct*) strct;
|
||||
BuildSheetList( sht );
|
||||
DrawSheetStruct* sheet = (DrawSheetStruct*) strct;
|
||||
BuildSheetList( sheet );
|
||||
}
|
||||
strct = strct->Next();
|
||||
}
|
||||
|
|
|
@ -11,11 +11,46 @@
|
|||
|
||||
#include "base_struct.h"
|
||||
|
||||
/** Info about complex hierarchies handling:
|
||||
* A hierarchical schematic uses sheets (hierachical sheets) included in a given sheet.
|
||||
* each sheet corresponds to a schematic drawing handled by a SCH_SCREEN structure
|
||||
* a SCH_SCREEN structure contains drawings, and have a filename to write to its data.
|
||||
* Also a SCH_SCREEN display a sheet number and the name of the sheet
|
||||
* In simple (and flat) hierarchies a sheet is linked to a SCH_SCREEN,
|
||||
* and a SCH_SCREEN is used by only one hierarchical sheet.
|
||||
*
|
||||
* In complex hierachies the same SCH_SCREEN (and its data) is shared between more than one sheet.
|
||||
* Therefore subsheets (like subsheets in a SCH_SCREEN shared by many sheets) can be also shared
|
||||
* So the same SCH_SCREEN must handle differents components references and parts selection
|
||||
* depending on which sheet is currently selected, and how a given subsheet is selected.
|
||||
* 2 sheets share the same SCH_SCREEN (the same drawings) if they have the same filename.
|
||||
*
|
||||
* In kicad each component and sheet receives (when created) an unique identification called Time Stamp.
|
||||
* So each sheet have 2 id : its time stamp (that cannot change) and its name
|
||||
* ( that can be edited and therefore is not reliable for strong identification)
|
||||
* Kicad uses therefore Time Stamp ( an unique 32 bit id), to identify sheets in hierarchies.
|
||||
* A given sheet in a hierarchy is fully labelled by its path (or sheet path)
|
||||
* that is the list of timestamp found to access it through the hierarchy
|
||||
* the root sheet is /
|
||||
* others have a path like /1234ABCD ou /4567FEDC/AA2233DD/
|
||||
* of course this path can be displayed as human readable sheet name like :
|
||||
* / or /sheet1/include_sheet/ or /sheet2/include_sheet/
|
||||
*
|
||||
* So to know for a given SCH_SCREEN (a given schematic drawings) we must:
|
||||
* Handle all references possibilities.
|
||||
* When acceded by a given selected sheet, display (update) the corresponding references and sheet path
|
||||
*
|
||||
* the class DrawSheetPath handles paths used to access a sheet
|
||||
* the class EDA_SheetList allows to handle the full (or partial) list of sheets and their paths in a complex hierarchy.
|
||||
* the class EDA_ScreenList allow to handle the list of SCH_SCREEN. It is useful to clear or save data,
|
||||
* but is not suitable to handle the full complex hierarchy possibilities (useable in flat and simple hierarchies).
|
||||
*/
|
||||
|
||||
/**********************************************/
|
||||
/* class to handle a series of sheets *********/
|
||||
/* a 'path' so to speak.. *********************/
|
||||
/**********************************************/
|
||||
|
||||
/***************************************************/
|
||||
/* class to handle a and acces to series of sheets */
|
||||
/* a 'path' so to speak.. **************************/
|
||||
/***************************************************/
|
||||
class DrawSheetPath
|
||||
{
|
||||
public:
|
||||
|
@ -27,11 +62,27 @@ public:
|
|||
DrawSheetPath();
|
||||
~DrawSheetPath() { };
|
||||
void Clear() { m_numSheets = 0; }
|
||||
int Cmp( const DrawSheetPath& d ) const;
|
||||
|
||||
/** Function Cmp
|
||||
* Compare if this is the same sheet path as aSheetPathToTest
|
||||
* @param aSheetPathToTest = sheet path to compare
|
||||
* @return -1 if differents, 0 if same
|
||||
*/
|
||||
int Cmp( const DrawSheetPath& aSheetPathToTest ) const;
|
||||
DrawSheetStruct* Last();
|
||||
SCH_SCREEN* LastScreen();
|
||||
EDA_BaseStruct* LastDrawList();
|
||||
void Push( DrawSheetStruct* sheet );
|
||||
|
||||
/** Function Push
|
||||
* store (push) aSheet in list
|
||||
* @param aSheet = pointer to the DrawSheetStruct to store in list
|
||||
*/
|
||||
void Push( DrawSheetStruct* aSheet );
|
||||
|
||||
/** Function Pop
|
||||
* retrieves (pop) the last entered sheet and remove it from list
|
||||
* @return a DrawSheetStruct* pointer to the removed sheet in list
|
||||
*/
|
||||
DrawSheetStruct* Pop();
|
||||
|
||||
/** Function Path
|
||||
|
@ -69,11 +120,11 @@ public:
|
|||
/*******************************************************/
|
||||
|
||||
/* sheets are not unique - can have many sheets with the same
|
||||
* filename and the same SCH_SCREEN reference.
|
||||
* the schematic (SCH_SCREEN) is shared between these sheets,
|
||||
* and component references are specific to a sheet path.
|
||||
* When a sheet is entered, component references and sheet number are updated
|
||||
*/
|
||||
* filename and the same SCH_SCREEN reference.
|
||||
* the schematic (SCH_SCREEN) is shared between these sheets,
|
||||
* and component references are specific to a sheet path.
|
||||
* When a sheet is entered, component references and sheet number are updated
|
||||
*/
|
||||
class EDA_SheetList
|
||||
{
|
||||
private:
|
||||
|
@ -81,37 +132,56 @@ private:
|
|||
int m_count; /* Number of sheets included in hierarchy,
|
||||
* starting at the given sheet in constructor . the given sheet is counted
|
||||
*/
|
||||
int m_index;
|
||||
int m_index; /* internal variable to handle GetNext(): cleared by GetFirst()
|
||||
* and incremented by GetNext() after returning the next item in m_List
|
||||
* Also used for internal calculations in BuildSheetList()
|
||||
*/
|
||||
DrawSheetPath m_currList;
|
||||
|
||||
public:
|
||||
EDA_SheetList( DrawSheetStruct* sheet )
|
||||
{
|
||||
m_index = 0;
|
||||
m_count = 0;
|
||||
m_List = NULL;
|
||||
if( sheet == NULL )
|
||||
sheet = g_RootSheet;
|
||||
BuildSheetList( sheet );
|
||||
}
|
||||
|
||||
/* The constructor: build the list of sheets from aSheet.
|
||||
* If aSheet == NULL (default) build the whole list of sheets in hierarchy
|
||||
* So usually call it with no param.
|
||||
*/
|
||||
EDA_SheetList( DrawSheetStruct* aSheet = NULL );
|
||||
|
||||
~EDA_SheetList()
|
||||
{
|
||||
if( m_List )
|
||||
{
|
||||
free( m_List );
|
||||
}
|
||||
m_List = NULL;
|
||||
}
|
||||
|
||||
|
||||
/** Function GetCount()
|
||||
* @return the number of sheets in list:
|
||||
* usually the number of sheets found in the whole hierarchy
|
||||
*/
|
||||
int GetCount() { return m_count; }
|
||||
|
||||
/** Function GetFirst
|
||||
* @return the first item (sheet) in m_List and prepare calls to GetNext()
|
||||
*/
|
||||
DrawSheetPath* GetFirst();
|
||||
|
||||
/** Function GetNext
|
||||
* @return the next item (sheet) in m_List or NULL if no more item in sheet list
|
||||
*/
|
||||
DrawSheetPath* GetNext();
|
||||
DrawSheetPath* GetSheet( int index );
|
||||
|
||||
/** Function GetSheet
|
||||
* @return the item (sheet) in aIndex position in m_List or NULL if less than index items
|
||||
* @param aIndex = index in sheet list to get the sheet
|
||||
*/
|
||||
DrawSheetPath* GetSheet( int aIndex );
|
||||
|
||||
private:
|
||||
|
||||
/** Function BuildSheetList
|
||||
* Build the list of sheets and their sheet path from the aSheet sheet
|
||||
* if aSheet = g_RootSheet, the full sheet path and sheet list is built
|
||||
* @param aSheet = the starting sheet from the built is made
|
||||
*/
|
||||
void BuildSheetList( DrawSheetStruct* sheet );
|
||||
};
|
||||
|
||||
|
|
|
@ -71,32 +71,6 @@ void DeleteSubHierarchy( DrawSheetStruct* FirstSheet, bool confirm_deletion )
|
|||
}
|
||||
|
||||
|
||||
/*********************************************************************/
|
||||
|
||||
//void ClearDrawList(EDA_BaseStruct *DrawList, bool confirm_deletion)
|
||||
/********************************************************************/
|
||||
/* free the draw list DrawList and the subhierarchies */
|
||||
|
||||
//this is redundant -- use FreeDrawList, a member of SCH_SCREEN
|
||||
|
||||
/*
|
||||
* {
|
||||
* EDA_BaseStruct *DrawStruct;
|
||||
*
|
||||
* while (DrawList != NULL)
|
||||
* {
|
||||
* DrawStruct = DrawList;
|
||||
* DrawList = DrawList->Pnext;
|
||||
*
|
||||
* if( DrawStruct->Type() == DRAW_SHEET_STRUCT_TYPE)
|
||||
* {
|
||||
* DeleteSubHierarchy((DrawSheetStruct*) DrawStruct, confirm_deletion);
|
||||
* }
|
||||
*
|
||||
* delete DrawStruct;
|
||||
* }
|
||||
* }
|
||||
*/
|
||||
/********************************************************************/
|
||||
bool ClearProjectDrawList( SCH_SCREEN* screen, bool confirm_deletion )
|
||||
/********************************************************************/
|
||||
|
|
|
@ -724,7 +724,7 @@ static bool WriteDiagnosticERC( const wxString& FullFileName )
|
|||
|
||||
fprintf( OutErc, "%s (%s)\n", CONV_TO_UTF8( msg ), Line );
|
||||
|
||||
EDA_SheetList SheetList( NULL );
|
||||
EDA_SheetList SheetList;
|
||||
|
||||
for( Sheet = SheetList.GetFirst(); Sheet != NULL; Sheet = SheetList.GetNext() )
|
||||
{
|
||||
|
|
|
@ -78,7 +78,7 @@ SCH_ITEM * WinEDA_SchematicFrame::FindComponentAndItem(
|
|||
wxString msg;
|
||||
LibDrawPin* pin;
|
||||
|
||||
EDA_SheetList SheetList( NULL );
|
||||
EDA_SheetList SheetList;
|
||||
|
||||
sheet = SheetList.GetFirst();
|
||||
if( !Find_in_hierarchy )
|
||||
|
@ -276,7 +276,7 @@ SCH_ITEM * WinEDA_SchematicFrame::FindMarker( int SearchType )
|
|||
if( SearchType == 0 )
|
||||
s_MarkerCount = 0;
|
||||
|
||||
EDA_SheetList SheetList( NULL );
|
||||
EDA_SheetList SheetList;
|
||||
|
||||
NotFound = TRUE; StartCount = 0;
|
||||
/* Search for s_MarkerCount markers */
|
||||
|
@ -446,7 +446,7 @@ SCH_ITEM* WinEDA_SchematicFrame::FindSchematicItem(
|
|||
NotFound = TRUE;
|
||||
StartCount = 0;
|
||||
|
||||
EDA_SheetList SheetList( NULL );
|
||||
EDA_SheetList SheetList;
|
||||
|
||||
Sheet = SheetList.GetFirst();
|
||||
if( !Find_in_hierarchy )
|
||||
|
|
|
@ -251,7 +251,7 @@ void WinEDA_HierFrame::OnSelect( wxTreeEvent& event )
|
|||
wxTreeItemId ItemSel = m_Tree->GetSelection();
|
||||
|
||||
*(m_Parent->m_CurrentSheet) =
|
||||
( (TreeItemData*) ( m_Tree->GetItemData( ItemSel ) ) )->m_SheetList;
|
||||
( (TreeItemData*) m_Tree->GetItemData( ItemSel ) )->m_SheetList;
|
||||
UpdateScreenFromSheet( m_Parent );
|
||||
Close( TRUE );
|
||||
}
|
||||
|
|
|
@ -285,7 +285,7 @@ void Write_GENERIC_NetList( WinEDA_SchematicFrame* frame,
|
|||
|
||||
/* Create netlist module section */
|
||||
fprintf( tmpfile, "$BeginComponentList\n" );
|
||||
EDA_SheetList SheetList( NULL );
|
||||
EDA_SheetList SheetList;
|
||||
|
||||
for( sheet = SheetList.GetFirst(); sheet != NULL; sheet = SheetList.GetNext() )
|
||||
{
|
||||
|
@ -409,7 +409,7 @@ static void WriteNetListPspice( WinEDA_SchematicFrame* frame, FILE* f,
|
|||
/* Create text list starting by [.-]pspice , or [.-]gnucap (simulator commands) */
|
||||
/* and create text list starting by [+]pspice , or [+]gnucap (simulator commands) */
|
||||
bufnum[BUFYPOS_LEN] = 0;
|
||||
EDA_SheetList SheetList( NULL );
|
||||
EDA_SheetList SheetList;
|
||||
|
||||
for( sheet = SheetList.GetFirst(); sheet != NULL; sheet = SheetList.GetNext() )
|
||||
{
|
||||
|
@ -552,7 +552,7 @@ static void WriteNetListPCBNEW( WinEDA_SchematicFrame* frame, FILE* f, bool with
|
|||
/* Create netlist module section */
|
||||
ClearUsedFlags( ); /* Reset the flags FlagControlMulti in all schematic files*/
|
||||
|
||||
EDA_SheetList SheetList( NULL );
|
||||
EDA_SheetList SheetList;
|
||||
|
||||
for( sheet = SheetList.GetFirst(); sheet != NULL; sheet = SheetList.GetNext() )
|
||||
{
|
||||
|
@ -767,7 +767,7 @@ static void FindAllsInstancesOfComponent( SCH_COMPONENT* Component_in,
|
|||
DrawSheetPath* sheet;
|
||||
wxString str, Reference = Component_in->GetRef( Sheet_in );
|
||||
|
||||
EDA_SheetList SheetList( NULL );
|
||||
EDA_SheetList SheetList;
|
||||
|
||||
for( sheet = SheetList.GetFirst(); sheet != NULL; sheet = SheetList.GetNext() )
|
||||
{
|
||||
|
@ -956,7 +956,7 @@ static void WriteNetListCADSTAR( WinEDA_SchematicFrame* frame, FILE* f )
|
|||
|
||||
/* Create netlist module section */
|
||||
ClearUsedFlags( ); /* Reset the flags FlagControlMulti in all schematic files*/
|
||||
EDA_SheetList SheetList( NULL );
|
||||
EDA_SheetList SheetList;
|
||||
|
||||
for( sheet = SheetList.GetFirst(); sheet != NULL; sheet = SheetList.GetNext() )
|
||||
{
|
||||
|
|
|
@ -198,7 +198,7 @@ void* WinEDA_SchematicFrame::BuildNetListBase()
|
|||
SetStatusText( activity );
|
||||
|
||||
/* Build the sheet (not screen) list (flattened)*/
|
||||
EDA_SheetList SheetListList( NULL );
|
||||
EDA_SheetList SheetListList;
|
||||
i = 0;
|
||||
/* first pass : count objects used in connectivty calculation */
|
||||
g_NbrObjNet = 0;
|
||||
|
|
|
@ -171,6 +171,7 @@ void WinEDA_SchematicFrame::Process_Special_Functions( wxCommandEvent& event )
|
|||
break;
|
||||
HandleBlockEndByPopUp( BLOCK_DELETE, &dc );
|
||||
g_ItemToRepeat = NULL;
|
||||
SetSheetNumberAndCount();
|
||||
break;
|
||||
|
||||
case wxID_PASTE:
|
||||
|
@ -358,6 +359,7 @@ void WinEDA_SchematicFrame::Process_Special_Functions( wxCommandEvent& event )
|
|||
screen->SetCurItem( NULL );
|
||||
g_ItemToRepeat = NULL;
|
||||
TestDanglingEnds( screen->EEDrawList, &dc );
|
||||
SetSheetNumberAndCount();
|
||||
screen->SetModify();
|
||||
}
|
||||
break;
|
||||
|
@ -655,6 +657,7 @@ void WinEDA_SchematicFrame::Process_Special_Functions( wxCommandEvent& event )
|
|||
case ID_POPUP_DELETE_BLOCK:
|
||||
DrawPanel->MouseToCursorSchema();
|
||||
HandleBlockEndByPopUp( BLOCK_DELETE, &dc );
|
||||
SetSheetNumberAndCount();
|
||||
break;
|
||||
|
||||
case ID_POPUP_ROTATE_BLOCK:
|
||||
|
|
|
@ -300,7 +300,7 @@ bool WinEDA_SchematicFrame::GetSchematicFromRedoList()
|
|||
/* Redo the last edition:
|
||||
* - Save the current schematic in undo list
|
||||
* - Get the old version
|
||||
* @return FALSE if nothing done, else TRUE
|
||||
* @return FALSE if nothing done, else true
|
||||
*/
|
||||
{
|
||||
if( GetScreen()->m_RedoList == NULL )
|
||||
|
@ -314,10 +314,11 @@ bool WinEDA_SchematicFrame::GetSchematicFromRedoList()
|
|||
|
||||
CurrentDrawItem = NULL;
|
||||
GetScreen()->SetModify();
|
||||
SetSheetNumberAndCount();
|
||||
ReCreateHToolbar();
|
||||
SetToolbars();
|
||||
|
||||
return TRUE;
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
|
@ -408,7 +409,7 @@ void WinEDA_SchematicFrame::PutDataInPreviousState( DrawPickedStruct* List )
|
|||
break;
|
||||
|
||||
case IS_WIRE_IMAGE:
|
||||
/* Exchange the current wires and the oild wires */
|
||||
/* Exchange the current wires and the old wires */
|
||||
List->SetSon( ( (SCH_SCREEN*) GetScreen() )->ExtractWires( FALSE ) );
|
||||
while( FirstItem )
|
||||
{
|
||||
|
@ -472,10 +473,11 @@ void WinEDA_SchematicFrame::PutDataInPreviousState( DrawPickedStruct* List )
|
|||
bool WinEDA_SchematicFrame::GetSchematicFromUndoList()
|
||||
/**********************************************************/
|
||||
|
||||
/* Undo the last edition:
|
||||
/** Function GetSchematicFromUndoList
|
||||
* Undo the last edition:
|
||||
* - Save the current schematic in Redo list
|
||||
* - Get an old version of the schematic
|
||||
* @return FALSE if nothing done, else TRUE
|
||||
* @return FALSE if nothing done, else true
|
||||
*/
|
||||
{
|
||||
if( GetScreen()->m_UndoList == NULL )
|
||||
|
@ -489,10 +491,11 @@ bool WinEDA_SchematicFrame::GetSchematicFromUndoList()
|
|||
|
||||
CurrentDrawItem = NULL;
|
||||
GetScreen()->SetModify();
|
||||
SetSheetNumberAndCount();
|
||||
ReCreateHToolbar();
|
||||
SetToolbars();
|
||||
|
||||
return TRUE;
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -227,7 +227,7 @@ void WinEDA_SchematicFrame::SetSheetNumberAndCount()
|
|||
int sheet_count = g_RootSheet->CountSheets();
|
||||
int SheetNumber = 1;
|
||||
wxString current_sheetpath = m_CurrentSheet->Path();
|
||||
EDA_SheetList SheetList( NULL );
|
||||
EDA_SheetList SheetList;
|
||||
|
||||
// Examine all sheets path to find the current sheets path,
|
||||
// and count them from root to the current scheet path:
|
||||
|
@ -317,9 +317,9 @@ void WinEDA_SchematicFrame::OnCloseWindow( wxCloseEvent& Event )
|
|||
return;
|
||||
}
|
||||
|
||||
EDA_SheetList sheets( g_RootSheet );
|
||||
EDA_SheetList SheetList;
|
||||
|
||||
for( sheet = sheets.GetFirst(); sheet != NULL; sheet = sheets.GetNext() )
|
||||
for( sheet = SheetList.GetFirst(); sheet != NULL; sheet = SheetList.GetNext() )
|
||||
{
|
||||
if( sheet->LastScreen() && sheet->LastScreen()->IsModify() )
|
||||
break;
|
||||
|
@ -350,7 +350,7 @@ void WinEDA_SchematicFrame::OnCloseWindow( wxCloseEvent& Event )
|
|||
}
|
||||
}
|
||||
|
||||
for( sheet = sheets.GetFirst(); sheet != NULL; sheet = sheets.GetNext() )
|
||||
for( sheet = SheetList.GetFirst(); sheet != NULL; sheet = SheetList.GetNext() )
|
||||
{
|
||||
if( sheet->LastScreen() )
|
||||
{
|
||||
|
|
Loading…
Reference in New Issue