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