Commit 0ac832f0 authored by charras's avatar charras

screen number and screen count now are set

parent 39125547
...@@ -10,6 +10,7 @@ email address. ...@@ -10,6 +10,7 @@ email address.
================================================================================ ================================================================================
+eeschema: +eeschema:
made in some dialogs the ESC key working (linux version, already working under windows) made in some dialogs the ESC key working (linux version, already working under windows)
screen number and screen count now are set
2008-Apr-29 UPDATE Dick Hollenbeck <dick@softplc.com> 2008-Apr-29 UPDATE Dick Hollenbeck <dick@softplc.com>
......
...@@ -22,45 +22,23 @@ static int ExistUnit( CmpListStruct* Objet, int Unit, ...@@ -22,45 +22,23 @@ static int ExistUnit( CmpListStruct* Objet, int Unit,
CmpListStruct* BaseListeCmp, int NbOfCmp ); CmpListStruct* BaseListeCmp, int NbOfCmp );
/************************************************/ /******************************************************/
void WinEDA_SchematicFrame::UpdateSheetNumberAndDate() void WinEDA_SchematicFrame::UpdateSheetNumberAndDate()
/************************************************/ /******************************************************/
/* Set a sheet number, the sheet count for sheets in the whole schematic /* Set a sheet number, the sheet count for sheets in the whole schematic
* and update the date in all screens * and update the date in all screens
*/ */
{ {
wxString date = GenDate(); wxString date = GenDate();
int sheet_number = 1; // sheet 1 is the root sheet EDA_ScreenList s_list;
DrawSheetPath* sheetpath;
/* Build the sheet list */ // Set the date
EDA_SheetList SheetList( g_RootSheet ); for ( SCH_SCREEN * screen = s_list.GetFirst(); screen != NULL; screen = s_list.GetNext() )
int sheet_count = SheetList.GetCount(); screen->m_Date = date;
for( sheetpath = SheetList.GetFirst();
sheetpath != NULL;
sheetpath = SheetList.GetNext() )
{
// Read all sheets in path, but not the root sheet (jj = 1)
for( int jj = 1; jj < sheetpath->m_numSheets; jj++ )
{
DrawSheetStruct* sheet = sheetpath->m_sheets[jj];
sheet->m_SheetNumber = sheet_number++;
sheet->m_NumberOfSheets = sheet_count;
SCH_SCREEN* screen = sheet->m_AssociatedScreen;
if( screen != NULL )
{
screen->m_NumberOfScreen = sheet_count;
screen->m_Date = date;
}
}
}
g_RootSheet->m_AssociatedScreen->m_Date = date; // Set sheet counts
g_RootSheet->m_AssociatedScreen->m_NumberOfScreen = sheet_count; SetSheetNumberAndCount();
g_RootSheet->m_SheetNumber = 1;
g_RootSheet->m_NumberOfSheets = sheet_count;
} }
......
...@@ -47,8 +47,6 @@ DrawSheetStruct::DrawSheetStruct( const wxPoint& pos ) : ...@@ -47,8 +47,6 @@ DrawSheetStruct::DrawSheetStruct( const wxPoint& pos ) :
m_AssociatedScreen = NULL; m_AssociatedScreen = NULL;
m_SheetName.Printf( wxT( "Sheet%8.8lX" ), m_TimeStamp ); m_SheetName.Printf( wxT( "Sheet%8.8lX" ), m_TimeStamp );
m_FileName.Printf( wxT( "file%8.8lX.sch" ), m_TimeStamp ); m_FileName.Printf( wxT( "file%8.8lX.sch" ), m_TimeStamp );
m_SheetNumber = 1;
m_NumberOfSheets = 1;
} }
...@@ -277,7 +275,7 @@ void DrawSheetStruct::CleanupSheet( WinEDA_SchematicFrame* aFrame, bool aRedraw ...@@ -277,7 +275,7 @@ void DrawSheetStruct::CleanupSheet( WinEDA_SchematicFrame* aFrame, bool aRedraw
} }
Pinsheet = NextPinsheet; Pinsheet = NextPinsheet;
} }
if( aRedraw ) if( aRedraw )
aFrame->DrawPanel->PostDirtyRect( GetBoundingBox() ); aFrame->DrawPanel->PostDirtyRect( GetBoundingBox() );
...@@ -499,9 +497,9 @@ bool DrawSheetStruct::Load( WinEDA_SchematicFrame* frame ) ...@@ -499,9 +497,9 @@ bool DrawSheetStruct::Load( WinEDA_SchematicFrame* frame )
} }
/*******************************************************************************/ /**********************************/
int DrawSheetStruct::CountSheets() int DrawSheetStruct::CountSheets()
/*******************************************************************************/ /**********************************/
{ {
int count = 1; //1 = this!! int count = 1; //1 = this!!
......
...@@ -26,7 +26,7 @@ public: ...@@ -26,7 +26,7 @@ public:
public: public:
Hierarchical_PIN_Sheet_Struct( DrawSheetStruct* parent, Hierarchical_PIN_Sheet_Struct( DrawSheetStruct* parent,
const wxPoint& pos = wxPoint( 0, 0 ), const wxPoint& pos = wxPoint( 0, 0 ),
const wxString& text = wxEmptyString ); const wxString& text = wxEmptyString );
~Hierarchical_PIN_Sheet_Struct() { } ~Hierarchical_PIN_Sheet_Struct() { }
...@@ -36,13 +36,13 @@ public: ...@@ -36,13 +36,13 @@ public:
} }
Hierarchical_PIN_Sheet_Struct* GenCopy(); Hierarchical_PIN_Sheet_Struct* GenCopy();
Hierarchical_PIN_Sheet_Struct* Next() { return (Hierarchical_PIN_Sheet_Struct*) Pnext; } Hierarchical_PIN_Sheet_Struct* Next() { return (Hierarchical_PIN_Sheet_Struct*) Pnext; }
void Place( WinEDA_SchematicFrame* frame, wxDC* DC ); void Place( WinEDA_SchematicFrame* frame, wxDC* DC );
void Draw( WinEDA_DrawPanel* panel, wxDC* DC, const wxPoint& offset, void Draw( WinEDA_DrawPanel* panel, wxDC* DC, const wxPoint& offset,
int draw_mode, int Color = -1 ); int draw_mode, int Color = -1 );
/** /**
* Function Save * Function Save
...@@ -50,11 +50,13 @@ public: ...@@ -50,11 +50,13 @@ public:
* @param aFile The FILE to write to. * @param aFile The FILE to write to.
* @return bool - true if success writing else false. * @return bool - true if success writing else false.
*/ */
bool Save( FILE* aFile ) const; bool Save( FILE* aFile ) const;
#if defined (DEBUG)
#if defined(DEBUG)
// comment inherited by Doxygen from Base_Struct // comment inherited by Doxygen from Base_Struct
void Show( int nestLevel, std::ostream& os ); void Show( int nestLevel, std::ostream& os );
#endif #endif
}; };
...@@ -64,7 +66,7 @@ public: ...@@ -64,7 +66,7 @@ public:
*/ */
WX_DEFINE_ARRAY( DrawSheetStruct *, SheetGrowArray ); WX_DEFINE_ARRAY( DrawSheetStruct *, SheetGrowArray );
class DrawSheetStruct : public SCH_ITEM /*public SCH_SCREEN*/ /* Gestion de la hierarchie */ class DrawSheetStruct : public SCH_ITEM /* Gestion de la hierarchie */
{ {
public: public:
wxString m_SheetName; /*this is equivalent to C101 for components: wxString m_SheetName; /*this is equivalent to C101 for components:
...@@ -75,7 +77,6 @@ private: ...@@ -75,7 +77,6 @@ private:
* reading the sheet description from file. */ * reading the sheet description from file. */
public: public:
int m_SheetNameSize; /* Size (height) of the text, used to draw the name */ int m_SheetNameSize; /* Size (height) of the text, used to draw the name */
int m_FileNameSize; /* Size (height) of the text, used to draw the name */ int m_FileNameSize; /* Size (height) of the text, used to draw the name */
wxPoint m_Pos; wxPoint m_Pos;
wxSize m_Size; /* Position and Size of sheet symbol */ wxSize m_Size; /* Position and Size of sheet symbol */
...@@ -85,8 +86,6 @@ public: ...@@ -85,8 +86,6 @@ public:
SCH_SCREEN* m_AssociatedScreen; /* Associated Screen which handle the physical data SCH_SCREEN* m_AssociatedScreen; /* Associated Screen which handle the physical data
* In complex hierarchies we can have many DrawSheetStruct using the same data * In complex hierarchies we can have many DrawSheetStruct using the same data
*/ */
int m_SheetNumber; // sheet number (used for info)
int m_NumberOfSheets; // Sheets count in the whole schematic (used for info)
public: public:
DrawSheetStruct( const wxPoint& pos = wxPoint( 0, 0 ) ); DrawSheetStruct( const wxPoint& pos = wxPoint( 0, 0 ) );
...@@ -103,32 +102,34 @@ public: ...@@ -103,32 +102,34 @@ public:
* @param aFile The FILE to write to. * @param aFile The FILE to write to.
* @return bool - true if success writing else false. * @return bool - true if success writing else false.
*/ */
bool Save( FILE* aFile ) const; bool Save( FILE* aFile ) const;
void Place( WinEDA_SchematicFrame* frame, wxDC* DC ); void Place( WinEDA_SchematicFrame* frame, wxDC* DC );
DrawSheetStruct* GenCopy(); DrawSheetStruct* GenCopy();
void Display_Infos( WinEDA_DrawFrame* frame ); void Display_Infos( WinEDA_DrawFrame* frame );
void CleanupSheet( WinEDA_SchematicFrame* frame, bool aRedraw ); void CleanupSheet( WinEDA_SchematicFrame* frame, bool aRedraw );
virtual void Draw( WinEDA_DrawPanel* panel, wxDC* DC, const wxPoint& offset, virtual void Draw( WinEDA_DrawPanel* panel, wxDC* DC, const wxPoint& offset,
int draw_mode, int Color = -1 ); int draw_mode, int Color = -1 );
EDA_Rect GetBoundingBox(); EDA_Rect GetBoundingBox();
void SwapData( DrawSheetStruct* copyitem ); void SwapData( DrawSheetStruct* copyitem );
int ComponentCount(); int ComponentCount();
bool Load( WinEDA_SchematicFrame* frame ); bool Load( WinEDA_SchematicFrame* frame );
bool SearchHierarchy( wxString filename, SCH_SCREEN** screen ); //search the existing hierarchy for an instance of screen "FileName". bool SearchHierarchy( wxString filename, SCH_SCREEN** screen ); //search the existing hierarchy for an instance of screen "FileName".
bool LocatePathOfScreen( SCH_SCREEN* screen, DrawSheetPath* list ); bool LocatePathOfScreen( SCH_SCREEN* screen, DrawSheetPath* list );
int CountSheets(); int CountSheets();
wxString GetFileName( void ); wxString GetFileName( void );
void SetFileName( const wxString& aFilename ); // Set a new filename without changing anything else void SetFileName( const wxString& aFilename ); // Set a new filename without changing anything else
bool ChangeFileName( WinEDA_SchematicFrame* aFrame, const wxString& aFileName ); // Set a new filename and manage data and associated screen bool ChangeFileName( WinEDA_SchematicFrame* aFrame, const wxString& aFileName ); // Set a new filename and manage data and associated screen
//void RemoveSheet(DrawSheetStruct* sheet); //void RemoveSheet(DrawSheetStruct* sheet);
//to remove a sheet, just delete it //to remove a sheet, just delete it
//-- the destructor should take care of everything else. //-- the destructor should take care of everything else.
#if defined(DEBUG) #if defined (DEBUG)
// comment inherited by Doxygen from Base_Struct // comment inherited by Doxygen from Base_Struct
void Show( int nestLevel, std::ostream& os ); void Show( int nestLevel, std::ostream& os );
#endif #endif
}; };
...@@ -147,25 +148,25 @@ public: ...@@ -147,25 +148,25 @@ public:
DrawSheetPath(); DrawSheetPath();
~DrawSheetPath() { }; ~DrawSheetPath() { };
void Clear() { m_numSheets = 0; } void Clear() { m_numSheets = 0; }
int Cmp( DrawSheetPath& d ); int Cmp( DrawSheetPath& d );
DrawSheetStruct* Last(); DrawSheetStruct* Last();
SCH_SCREEN* LastScreen(); SCH_SCREEN* LastScreen();
EDA_BaseStruct* LastDrawList(); EDA_BaseStruct* LastDrawList();
void Push( DrawSheetStruct* sheet ); void Push( DrawSheetStruct* sheet );
DrawSheetStruct* Pop(); DrawSheetStruct* Pop();
/** Function Path /** Function Path
* the path uses the time stamps which do not changes even when editing sheet parameters * 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 * a path is something like / (root) or /34005677 or /34005677/00AE4523
*/ */
wxString Path(); wxString Path();
/** Function PathHumanReadable /** Function PathHumanReadable
* Return the sheet path in a readable form, i.e. * Return the sheet path in a readable form, i.e.
* as a path made from sheet names. * as a path made from sheet names.
* (the "normal" path uses the time stamps which do not changes even when editing sheet parameters) * (the "normal" path uses the time stamps which do not changes even when editing sheet parameters)
*/ */
wxString PathHumanReadable(); wxString PathHumanReadable();
/** Function UpdateAllScreenReferences /** Function UpdateAllScreenReferences
* Update the reference and the m_Multi parameter (part selection) for all components on a screen * Update the reference and the m_Multi parameter (part selection) for all components on a screen
...@@ -173,13 +174,13 @@ public: ...@@ -173,13 +174,13 @@ public:
* Mandatory in complex hierarchies because sheets use the same screen (basic schematic) * Mandatory in complex hierarchies because sheets use the same screen (basic schematic)
* but with different references and part selection according to the displayed sheet * but with different references and part selection according to the displayed sheet
*/ */
void UpdateAllScreenReferences(); void UpdateAllScreenReferences();
bool operator =( const DrawSheetPath& d1 ); bool operator =( const DrawSheetPath& d1 );
bool operator ==( const DrawSheetPath& d1 ); bool operator ==( const DrawSheetPath& d1 );
bool operator !=( const DrawSheetPath& d1 ); bool operator !=( const DrawSheetPath& d1 );
}; };
...@@ -222,12 +223,12 @@ public: ...@@ -222,12 +223,12 @@ public:
int GetCount() { return m_count; } int GetCount() { return m_count; }
DrawSheetPath* GetFirst(); DrawSheetPath* GetFirst();
DrawSheetPath* GetNext(); DrawSheetPath* GetNext();
DrawSheetPath* GetSheet( int index ); DrawSheetPath* GetSheet( int index );
private: private:
void BuildSheetList( DrawSheetStruct* sheet ); void BuildSheetList( DrawSheetStruct* sheet );
}; };
#endif /* CLASS_DRAWSHEET_H */ #endif /* CLASS_DRAWSHEET_H */
...@@ -91,8 +91,6 @@ SCH_SCREEN::SCH_SCREEN( int screentype, KICAD_T aType ) : ...@@ -91,8 +91,6 @@ SCH_SCREEN::SCH_SCREEN( int screentype, KICAD_T aType ) :
SetGridList( g_GridList ); SetGridList( g_GridList );
m_UndoRedoCountMax = 10; m_UndoRedoCountMax = 10;
m_RefCount = 0; m_RefCount = 0;
m_ScreenNumber = 1;
m_NumberOfScreen = 1;
} }
......
...@@ -152,7 +152,6 @@ int WinEDA_SchematicFrame::LoadOneEEProject( const wxString& FileName, bool IsNe ...@@ -152,7 +152,6 @@ int WinEDA_SchematicFrame::LoadOneEEProject( const wxString& FileName, bool IsNe
{ {
screen->m_CurrentSheetDesc = &g_Sheet_A4; screen->m_CurrentSheetDesc = &g_Sheet_A4;
screen->SetZoom( 32 ); screen->SetZoom( 32 );
screen->m_ScreenNumber = screen->m_NumberOfScreen = 1;
screen->m_Title = wxT( "noname.sch" ); screen->m_Title = wxT( "noname.sch" );
GetScreen()->m_FileName = screen->m_Title; GetScreen()->m_FileName = screen->m_Title;
screen->m_Company.Empty(); screen->m_Company.Empty();
...@@ -162,6 +161,7 @@ int WinEDA_SchematicFrame::LoadOneEEProject( const wxString& FileName, bool IsNe ...@@ -162,6 +161,7 @@ int WinEDA_SchematicFrame::LoadOneEEProject( const wxString& FileName, bool IsNe
screen->m_Commentaire4.Empty(); screen->m_Commentaire4.Empty();
Read_Config( wxEmptyString, TRUE ); Read_Config( wxEmptyString, TRUE );
Zoom_Automatique( TRUE ); Zoom_Automatique( TRUE );
SetSheetNumberAndCount();
ReDrawPanel(); ReDrawPanel();
return 1; return 1;
} }
...@@ -226,6 +226,7 @@ int WinEDA_SchematicFrame::LoadOneEEProject( const wxString& FileName, bool IsNe ...@@ -226,6 +226,7 @@ int WinEDA_SchematicFrame::LoadOneEEProject( const wxString& FileName, bool IsNe
/* Reaffichage ecran de base (ROOT) si necessaire */ /* Reaffichage ecran de base (ROOT) si necessaire */
ActiveScreen = GetScreen(); ActiveScreen = GetScreen();
Zoom_Automatique( FALSE ); Zoom_Automatique( FALSE );
SetSheetNumberAndCount();
DrawPanel->Refresh( TRUE ); DrawPanel->Refresh( TRUE );
return diag; return diag;
} }
......
...@@ -316,6 +316,7 @@ static bool UpdateScreenFromSheet(WinEDA_SchematicFrame * frame) ...@@ -316,6 +316,7 @@ static bool UpdateScreenFromSheet(WinEDA_SchematicFrame * frame)
//update the References //update the References
frame->m_CurrentSheet->UpdateAllScreenReferences(); frame->m_CurrentSheet->UpdateAllScreenReferences();
frame->SetSheetNumberAndCount();
frame->DrawPanel->m_CanStartBlock = -1; frame->DrawPanel->m_CanStartBlock = -1;
ActiveScreen = frame->m_CurrentSheet->LastScreen(); ActiveScreen = frame->m_CurrentSheet->LastScreen();
if ( NewScreen->m_FirstRedraw ){ if ( NewScreen->m_FirstRedraw ){
......
...@@ -66,7 +66,7 @@ bool WinEDA_SchematicFrame::SaveEEFile( SCH_SCREEN* screen, int FileSave ) ...@@ -66,7 +66,7 @@ bool WinEDA_SchematicFrame::SaveEEFile( SCH_SCREEN* screen, int FileSave )
this, this,
wxFD_SAVE, wxFD_SAVE,
FALSE FALSE
); );
if( Name.IsEmpty() ) if( Name.IsEmpty() )
return FALSE; return FALSE;
...@@ -115,9 +115,9 @@ bool SCH_SCREEN::Save( FILE* aFile ) const ...@@ -115,9 +115,9 @@ bool SCH_SCREEN::Save( FILE* aFile ) const
* @return bool - true if success writing else false. * @return bool - true if success writing else false.
*/ */
{ {
const wxChar** LibNames; const wxChar** LibNames;
wxString Name, msg; wxString Name, msg;
Ki_PageDescr* PlotSheet; Ki_PageDescr* PlotSheet;
LibNames = GetLibNames(); LibNames = GetLibNames();
for( int ii = 0; LibNames[ii] != NULL; ii++ ) for( int ii = 0; LibNames[ii] != NULL; ii++ )
...@@ -145,7 +145,12 @@ bool SCH_SCREEN::Save( FILE* aFile ) const ...@@ -145,7 +145,12 @@ bool SCH_SCREEN::Save( FILE* aFile ) const
fprintf( aFile, "$Descr %s %d %d\n", CONV_TO_UTF8( PlotSheet->m_Name ), fprintf( aFile, "$Descr %s %d %d\n", CONV_TO_UTF8( PlotSheet->m_Name ),
PlotSheet->m_Size.x, PlotSheet->m_Size.y ); PlotSheet->m_Size.x, PlotSheet->m_Size.y );
/* Write ScreenNumber and NumberOfScreen; not very meaningfull for SheetNumber and Sheet Count
* in a complex hierarchy, but usefull in simple hierarchy and flat hierarchy
* Used also to serach the root sheet ( ScreenNumber = 1 ) withing the files
*/
fprintf( aFile, "Sheet %d %d\n", m_ScreenNumber, m_NumberOfScreen ); fprintf( aFile, "Sheet %d %d\n", m_ScreenNumber, m_NumberOfScreen );
fprintf( aFile, "Title \"%s\"\n", CONV_TO_UTF8( m_Title ) ); fprintf( aFile, "Title \"%s\"\n", CONV_TO_UTF8( m_Title ) );
fprintf( aFile, "Date \"%s\"\n", CONV_TO_UTF8( m_Date ) ); fprintf( aFile, "Date \"%s\"\n", CONV_TO_UTF8( m_Date ) );
fprintf( aFile, "Rev \"%s\"\n", CONV_TO_UTF8( m_Revision ) ); fprintf( aFile, "Rev \"%s\"\n", CONV_TO_UTF8( m_Revision ) );
...@@ -159,7 +164,7 @@ bool SCH_SCREEN::Save( FILE* aFile ) const ...@@ -159,7 +164,7 @@ bool SCH_SCREEN::Save( FILE* aFile ) const
/* Saving schematic items */ /* Saving schematic items */
bool failed = FALSE; bool failed = FALSE;
for( SCH_ITEM* item = EEDrawList; item; item=item->Next() ) for( SCH_ITEM* item = EEDrawList; item; item = item->Next() )
{ {
switch( item->Type() ) switch( item->Type() )
{ {
...@@ -179,11 +184,11 @@ bool SCH_SCREEN::Save( FILE* aFile ) const ...@@ -179,11 +184,11 @@ bool SCH_SCREEN::Save( FILE* aFile ) const
failed = TRUE; failed = TRUE;
break; break;
/* /*
case DRAW_HIERARCHICAL_PIN_SHEET_STRUCT_TYPE: * case DRAW_HIERARCHICAL_PIN_SHEET_STRUCT_TYPE:
case DRAW_PICK_ITEM_STRUCT_TYPE: * case DRAW_PICK_ITEM_STRUCT_TYPE:
break; * break;
*/ */
default: default:
break; break;
......
...@@ -201,6 +201,32 @@ DrawSheetPath* WinEDA_SchematicFrame::GetSheet() ...@@ -201,6 +201,32 @@ DrawSheetPath* WinEDA_SchematicFrame::GetSheet()
} }
/****************************************************/
void WinEDA_SchematicFrame::SetSheetNumberAndCount()
/****************************************************/
/** Function SetSheetNumberAndCount
* Set the m_ScreenNumber and m_NumberOfScreen members for screens
* must be called after a delete or add sheet command, ans when entering a sheet
*/
{
SCH_SCREEN* screen = GetScreen();
EDA_ScreenList s_list;
/* Set the screen count, and the screen number (1 for root sheet)
*/
int screen_num = 2;
for ( screen = s_list.GetFirst(); screen != NULL; screen = s_list.GetNext() )
{
if ( screen == g_RootSheet->m_AssociatedScreen )
screen->m_ScreenNumber = 1;
else
screen->m_ScreenNumber = screen_num++;
screen->m_NumberOfScreen = s_list.GetCount();
}
}
SCH_SCREEN* WinEDA_SchematicFrame::GetScreen() const SCH_SCREEN* WinEDA_SchematicFrame::GetScreen() const
{ {
return m_CurrentSheet->LastScreen(); return m_CurrentSheet->LastScreen();
......
...@@ -19,10 +19,8 @@ ...@@ -19,10 +19,8 @@
class SCH_SCREEN : public BASE_SCREEN class SCH_SCREEN : public BASE_SCREEN
{ {
public: public:
int m_RefCount; //how many sheets reference this screen? int m_RefCount; /*how many sheets reference this screen?
//delete when it goes to zero. * delete when it goes to zero. */
int m_ScreenNumber;
int m_NumberOfScreen;
SCH_SCREEN( int idtype, KICAD_T aType = SCREEN_STRUCT_TYPE ); SCH_SCREEN( int idtype, KICAD_T aType = SCREEN_STRUCT_TYPE );
~SCH_SCREEN(); ~SCH_SCREEN();
...@@ -47,29 +45,30 @@ public: ...@@ -47,29 +45,30 @@ public:
} }
void FreeDrawList(); // Free EESchema drawing list (does not delete the sub hierarchies) void FreeDrawList(); // Free EESchema drawing list (does not delete the sub hierarchies)
void Place( WinEDA_SchematicFrame* frame, wxDC* DC ) { }; void Place( WinEDA_SchematicFrame* frame, wxDC* DC ) { };
void RemoveFromDrawList( SCH_ITEM* DrawStruct ); /* remove DrawStruct from EEDrawList. */ void RemoveFromDrawList( SCH_ITEM* DrawStruct ); /* remove DrawStruct from EEDrawList. */
bool CheckIfOnDrawList( SCH_ITEM* st ); bool CheckIfOnDrawList( SCH_ITEM* st );
void AddToDrawList( SCH_ITEM* DrawStruct ); void AddToDrawList( SCH_ITEM* DrawStruct );
void ClearUndoORRedoList( EDA_BaseStruct* List ); void ClearUndoORRedoList( EDA_BaseStruct* List );
bool SchematicCleanUp( wxDC* DC = NULL ); bool SchematicCleanUp( wxDC* DC = NULL );
SCH_ITEM* ExtractWires( bool CreateCopy ); SCH_ITEM* ExtractWires( bool CreateCopy );
/* full undo redo management : */ /* full undo redo management : */
virtual void ClearUndoRedoList(); virtual void ClearUndoRedoList();
virtual void AddItemToUndoList( EDA_BaseStruct* item ); virtual void AddItemToUndoList( EDA_BaseStruct* item );
virtual void AddItemToRedoList( EDA_BaseStruct* item ); virtual void AddItemToRedoList( EDA_BaseStruct* item );
/** /**
* Function Save * Function Save
* writes the data structures for this object out to a FILE in "*.brd" format. * writes the data structures for this object out to a FILE in "*.brd" format.
* @param aFile The FILE to write to. * @param aFile The FILE to write to.
* @return bool - true if success writing else false. * @return bool - true if success writing else false.
*/ */
bool Save( FILE* aFile ) const; bool Save( FILE* aFile ) const;
}; };
...@@ -94,8 +93,8 @@ public: ...@@ -94,8 +93,8 @@ public:
SCH_SCREEN* GetScreen( unsigned int index ); SCH_SCREEN* GetScreen( unsigned int index );
private: private:
void AddScreenToList( SCH_SCREEN* testscreen ); void AddScreenToList( SCH_SCREEN* testscreen );
void BuildScreenList( EDA_BaseStruct* sheet ); void BuildScreenList( EDA_BaseStruct* sheet );
}; };
#endif /* CLASS_SCREEN_H */ #endif /* CLASS_SCREEN_H */
...@@ -112,10 +112,18 @@ public: ...@@ -112,10 +112,18 @@ public:
void InstallPreviousSheet(); void InstallPreviousSheet();
void InstallNextScreen( DrawSheetStruct* Sheet ); void InstallNextScreen( DrawSheetStruct* Sheet );
/** Function SetSheetNumberAndCount
* Set the m_ScreenNumber and m_NumberOfScreen members for screens
* must be called after a delete or add sheet command, and when entering a sheet
*/
void SetSheetNumberAndCount();
// Plot functions:
void ToPlot_PS( wxCommandEvent& event ); void ToPlot_PS( wxCommandEvent& event );
void ToPlot_HPGL( wxCommandEvent& event ); void ToPlot_HPGL( wxCommandEvent& event );
void ToPostProcess( wxCommandEvent& event ); void ToPostProcess( wxCommandEvent& event );
// read and save files
void Save_File( wxCommandEvent& event ); void Save_File( wxCommandEvent& event );
void SaveProject(); void SaveProject();
int LoadOneEEProject( const wxString& FileName, bool IsNew ); int LoadOneEEProject( const wxString& FileName, bool IsNew );
......
...@@ -85,15 +85,4 @@ asked by: Dick Hollenbeck ...@@ -85,15 +85,4 @@ asked by: Dick Hollenbeck
loaded board. I think the number of layers should be reduced to the loaded board. I think the number of layers should be reduced to the
default and the default layer names should be used. default and the default layer names should be used.
2008-Apr-30 Assigned To:
asked by: Dick Hollenbeck
================================================================================
+eeschema
This line in eeschema/save_schemas.cpp is using m_ScreenNumber == 1
regardless.
fprintf( aFile, "Sheet %d %d\n", m_ScreenNumber, m_NumberOfScreen );
The field m_ScreenNumber needs to be updated based on where
the sheet is in the hierarchy. Until this is fixed, the code which checks
for "Sheet 1 " in kicad/treeprj_frame.cpp is broken and the project manager
is showing all *.sch files, not just the top most *.sch files.
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