Commit 7080828f authored by jean-pierre charras's avatar jean-pierre charras

More about worksheet code.

parent 26f2c04f
...@@ -26,6 +26,12 @@ set(COMMON_ABOUT_DLG_SRCS ...@@ -26,6 +26,12 @@ set(COMMON_ABOUT_DLG_SRCS
dialogs/dialog_page_settings_base.cpp dialogs/dialog_page_settings_base.cpp
) )
if(KICAD_GOST)
set( TITLE_BLOCK_SHAPES title_block_shapes_gost )
else()
set( TITLE_BLOCK_SHAPES title_block_shapes )
endif()
set(COMMON_SRCS set(COMMON_SRCS
${COMMON_ABOUT_DLG_SRCS} ${COMMON_ABOUT_DLG_SRCS}
base_struct.cpp base_struct.cpp
...@@ -76,6 +82,7 @@ set(COMMON_SRCS ...@@ -76,6 +82,7 @@ set(COMMON_SRCS
richio.cpp richio.cpp
selcolor.cpp selcolor.cpp
string.cpp string.cpp
${TITLE_BLOCK_SHAPES}.cpp
trigo.cpp trigo.cpp
wildcards_and_files_ext.cpp wildcards_and_files_ext.cpp
worksheet.cpp worksheet.cpp
......
...@@ -90,17 +90,16 @@ void PlotWorkSheet( PLOTTER* plotter, const TITLE_BLOCK& aTitleBlock, ...@@ -90,17 +90,16 @@ void PlotWorkSheet( PLOTTER* plotter, const TITLE_BLOCK& aTitleBlock,
plotter->SetCurrentLineWidth( PLOTTER::DEFAULT_LINE_WIDTH ); plotter->SetCurrentLineWidth( PLOTTER::DEFAULT_LINE_WIDTH );
WS_DRAW_ITEM_LIST drawList; WS_DRAW_ITEM_LIST drawList;
// Initialize plot parameters // Prepare plot parameters
drawList.SetMargins( LTmargin, RBmargin); drawList.SetMargins( LTmargin, RBmargin);
drawList.SetPenSize(PLOTTER::DEFAULT_LINE_WIDTH ); drawList.SetPenSize(PLOTTER::DEFAULT_LINE_WIDTH );
drawList.SetMilsToIUfactor( iusPerMil ); drawList.SetMilsToIUfactor( iusPerMil );
drawList.SetPageSize( pageSize ); drawList.SetPageSize( pageSize );
drawList.SetSheetNumber( aSheetNumber );
drawList.SetSheetCount( aNumberOfSheets );
drawList.BuildWorkSheetGraphicList( drawList.BuildWorkSheetGraphicList( aPageInfo.GetType(), aFilename,
aPageInfo.GetType(), aFilename, aSheetDesc, aTitleBlock, plotColor, plotColor );
aSheetDesc,
aTitleBlock, aNumberOfSheets, aSheetNumber,
plotColor, plotColor );
// Draw item list // Draw item list
for( WS_DRAW_ITEM_BASE* item = drawList.GetFirst(); item; for( WS_DRAW_ITEM_BASE* item = drawList.GetFirst(); item;
......
...@@ -33,28 +33,15 @@ ...@@ -33,28 +33,15 @@
#include <fctsys.h> #include <fctsys.h>
#include <gr_basic.h> #include <gr_basic.h>
#include <common.h> #include <common.h>
#include <macros.h>
#include <class_drawpanel.h> #include <class_drawpanel.h>
#include <class_base_screen.h> #include <class_base_screen.h>
#include <drawtxt.h> #include <drawtxt.h>
#include <confirm.h>
#include <wxstruct.h> #include <wxstruct.h>
#include <appl_wxstruct.h>
#include <kicad_string.h>
#include <worksheet.h> #include <worksheet.h>
#include <class_title_block.h> #include <class_title_block.h>
#include <build_version.h>
// include data which defines the shape of a title block
// and frame references
#include <worksheet_shape_builder.h> #include <worksheet_shape_builder.h>
#if defined(KICAD_GOST)
#include "title_block_shapes_gost.h"
#else
#include "title_block_shapes.h"
#endif
void DrawPageLayout( wxDC* aDC, EDA_DRAW_PANEL * aCanvas, void DrawPageLayout( wxDC* aDC, EDA_DRAW_PANEL * aCanvas,
const PAGE_INFO& aPageInfo, const PAGE_INFO& aPageInfo,
const wxString& aPaperFormat, const wxString& aPaperFormat,
...@@ -76,11 +63,12 @@ void DrawPageLayout( wxDC* aDC, EDA_DRAW_PANEL * aCanvas, ...@@ -76,11 +63,12 @@ void DrawPageLayout( wxDC* aDC, EDA_DRAW_PANEL * aCanvas,
drawList.SetPenSize( aPenWidth ); drawList.SetPenSize( aPenWidth );
drawList.SetMilsToIUfactor( aScalar ); drawList.SetMilsToIUfactor( aScalar );
drawList.SetPageSize( pagesize ); drawList.SetPageSize( pagesize );
drawList.SetSheetNumber( aSheetNumber );
drawList.SetSheetCount( aSheetCount );
drawList.BuildWorkSheetGraphicList( drawList.BuildWorkSheetGraphicList(
aPaperFormat, aFullSheetName, aFileName, aPaperFormat, aFullSheetName, aFileName,
aTitleBlock, aSheetCount, aSheetNumber, aTitleBlock, aLineColor, aTextColor );
aLineColor, aTextColor );
// Draw item list // Draw item list
for( WS_DRAW_ITEM_BASE* item = drawList.GetFirst(); item; for( WS_DRAW_ITEM_BASE* item = drawList.GetFirst(); item;
......
...@@ -38,7 +38,7 @@ ...@@ -38,7 +38,7 @@
#include <sch_junction.h> #include <sch_junction.h>
int SCH_JUNCTION::m_symbolSize = 50; // Default diameter of the junction symbol int SCH_JUNCTION::m_symbolSize = 40; // Default diameter of the junction symbol
SCH_JUNCTION::SCH_JUNCTION( const wxPoint& pos ) : SCH_JUNCTION::SCH_JUNCTION( const wxPoint& pos ) :
SCH_ITEM( NULL, SCH_JUNCTION_T ) SCH_ITEM( NULL, SCH_JUNCTION_T )
......
...@@ -21,8 +21,8 @@ public: ...@@ -21,8 +21,8 @@ public:
Ki_WorkSheetData* Pnext; Ki_WorkSheetData* Pnext;
int m_Posx, m_Posy; int m_Posx, m_Posy;
int m_Endx, m_Endy; int m_Endx, m_Endy;
const wxChar* m_Legende; const wxChar* m_TextBase;
const wxChar* m_Text; int m_Flags;
}; };
/** /**
......
...@@ -46,6 +46,7 @@ class WS_DRAW_ITEM_LINE : public WS_DRAW_ITEM_BASE ...@@ -46,6 +46,7 @@ class WS_DRAW_ITEM_LINE : public WS_DRAW_ITEM_BASE
wxPoint m_start; // start point of line/rect wxPoint m_start; // start point of line/rect
wxPoint m_end; // end point wxPoint m_end; // end point
int m_penWidth; int m_penWidth;
public: public:
WS_DRAW_ITEM_LINE( wxPoint aStart, wxPoint aEnd, WS_DRAW_ITEM_LINE( wxPoint aStart, wxPoint aEnd,
int aPenWidth, EDA_COLOR_T aColor ) : int aPenWidth, EDA_COLOR_T aColor ) :
...@@ -118,8 +119,10 @@ public: ...@@ -118,8 +119,10 @@ public:
}; };
/* /*
* this class stores the list of graphic items to draw/plot * this class stores the list of graphic items:
* the title block and frame references * rect, lines, polygons and texts to draw/plot
* the title block and frame references, and parameters to
* draw/plot them
*/ */
class WS_DRAW_ITEM_LIST class WS_DRAW_ITEM_LIST
{ {
...@@ -131,6 +134,9 @@ class WS_DRAW_ITEM_LIST ...@@ -131,6 +134,9 @@ class WS_DRAW_ITEM_LIST
double m_milsToIu; // the scalar to convert pages units ( mils) double m_milsToIu; // the scalar to convert pages units ( mils)
// to draw/plot units. // to draw/plot units.
int m_penSize; // The line width for drawings. int m_penSize; // The line width for drawings.
int m_sheetNumber; // the value of the sheet number, for basic inscriptions
int m_sheetCount; // the value of the number of sheets, in schematic
// for basic inscriptions, in schematic
public: public:
WS_DRAW_ITEM_LIST() WS_DRAW_ITEM_LIST()
...@@ -138,6 +144,8 @@ public: ...@@ -138,6 +144,8 @@ public:
m_idx = 0; m_idx = 0;
m_milsToIu = 1.0; m_milsToIu = 1.0;
m_penSize = 1; m_penSize = 1;
m_sheetNumber = 1;
m_sheetCount = 1;
} }
~WS_DRAW_ITEM_LIST() ~WS_DRAW_ITEM_LIST()
...@@ -173,6 +181,26 @@ public: ...@@ -173,6 +181,26 @@ public:
m_pageSize = aPageSize; m_pageSize = aPageSize;
} }
/**
* Function SetSheetNumber
* Set the value of the sheet number, for basic inscriptions
* @param aSheetNumber the number to display.
*/
void SetSheetNumber( int aSheetNumber )
{
m_sheetNumber = aSheetNumber;
}
/**
* Function SetSheetCount
* Set the value of the count of sheets, for basic inscriptions
* @param aSheetCount the number of esheets to display.
*/
void SetSheetCount( int aSheetCount )
{
m_sheetCount = aSheetCount;
}
/* Function SetMargins /* Function SetMargins
* Set the left top margin and the right bottom margin * Set the left top margin and the right bottom margin
* of the page layout * of the page layout
...@@ -220,8 +248,6 @@ public: ...@@ -220,8 +248,6 @@ public:
* @param aPaperFormat The paper size type, for basic inscriptions. * @param aPaperFormat The paper size type, for basic inscriptions.
* @param aFileName The file name, for basic inscriptions. * @param aFileName The file name, for basic inscriptions.
* @param aTitleBlock The sheet title block, for basic inscriptions. * @param aTitleBlock The sheet title block, for basic inscriptions.
* @param aSheetCount The number of sheets (for basic inscriptions).
* @param aSheetNumber The sheet number (for basic inscriptions).
* @param aLineColor The color for drawing and fixed text. * @param aLineColor The color for drawing and fixed text.
* @param aTextColor The color for user inscriptions. * @param aTextColor The color for user inscriptions.
*/ */
...@@ -229,7 +255,6 @@ public: ...@@ -229,7 +255,6 @@ public:
const wxString& aFileName, const wxString& aFileName,
const wxString& aSheetPathHumanReadable, const wxString& aSheetPathHumanReadable,
const TITLE_BLOCK& aTitleBlock, const TITLE_BLOCK& aTitleBlock,
int aSheetCount, int aSheetNumber,
EDA_COLOR_T aLineColor, EDA_COLOR_T aTextColor ); EDA_COLOR_T aLineColor, EDA_COLOR_T aTextColor );
}; };
......
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