Commit d7f569ae authored by jean-pierre charras's avatar jean-pierre charras
Browse files

Fix GOST compatibility.

parent c328d6b1
Loading
Loading
Loading
Loading
+1 −7
Original line number Original line Diff line number Diff line
@@ -26,14 +26,8 @@ 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_PAGE_LAYOUT_SRCS
set(COMMON_PAGE_LAYOUT_SRCS
    page_layout/${TITLE_BLOCK_SHAPES}.cpp
    page_layout/title_block_shapes.cpp
    page_layout/class_worksheet_dataitem.cpp
    page_layout/class_worksheet_dataitem.cpp
    page_layout/class_worksheet_layout.cpp
    page_layout/class_worksheet_layout.cpp
    page_layout/page_layout_default_description.cpp
    page_layout/page_layout_default_description.cpp
+2 −0
Original line number Original line Diff line number Diff line
@@ -630,6 +630,7 @@ void WORKSHEET_LAYOUT::SetDefaultLayout()
    try
    try
    {
    {
        lp_parser.Parse( this );
        lp_parser.Parse( this );
        SetDefaultDescrFlag( true );
    }
    }
    catch( IO_ERROR ioe )
    catch( IO_ERROR ioe )
    {
    {
@@ -693,6 +694,7 @@ void WORKSHEET_LAYOUT::SetPageLayout( const wxString& aFullFileName, bool Append
        try
        try
        {
        {
            lp_parser.Parse( this );
            lp_parser.Parse( this );
            SetDefaultDescrFlag( false );
        }
        }
        catch( IO_ERROR ioe )
        catch( IO_ERROR ioe )
        {
        {
+18 −2
Original line number Original line Diff line number Diff line
@@ -61,19 +61,35 @@
#include <worksheet_shape_builder.h>
#include <worksheet_shape_builder.h>
#include <class_worksheet_dataitem.h>
#include <class_worksheet_dataitem.h>



// Temporary include. Will be removed when a GOST page layout descr file is available
#ifdef KICAD_GOST
#include "title_block_shapes_gost.cpp"
#endif

void WS_DRAW_ITEM_LIST::BuildWorkSheetGraphicList(
void WS_DRAW_ITEM_LIST::BuildWorkSheetGraphicList(
                       const PAGE_INFO& aPageInfo,
                       const PAGE_INFO& aPageInfo,
                       const TITLE_BLOCK& aTitleBlock,
                       const TITLE_BLOCK& aTitleBlock,
                       EDA_COLOR_T aColor, EDA_COLOR_T aAltColor )
                       EDA_COLOR_T aColor, EDA_COLOR_T aAltColor )
{
{
    WORKSHEET_LAYOUT& pglayout = WORKSHEET_LAYOUT::GetTheInstance();

// Ugly hack: will be removed when a GOST page layout descr file is available
#ifdef KICAD_GOST
    if( pglayout.IsDefaultDescr() )
    {
        ((WS_DRAW_ITEM_LIST_GOST*)this)->BuildWorkSheetGraphicListGOST( aPageInfo,
                aTitleBlock, aColor, aAltColor );
        return;
    }
#endif

    #define milsTomm (25.4/1000)
    #define milsTomm (25.4/1000)
    #define mmTomils (1000/25.4)
    #define mmTomils (1000/25.4)


    m_titleBlock = &aTitleBlock;
    m_titleBlock = &aTitleBlock;
    m_paperFormat = &aPageInfo.GetType();
    m_paperFormat = &aPageInfo.GetType();


    WORKSHEET_LAYOUT& pglayout = WORKSHEET_LAYOUT::GetTheInstance();

    wxPoint LTmargin( Mm2mils( pglayout.GetLeftMargin() ),
    wxPoint LTmargin( Mm2mils( pglayout.GetLeftMargin() ),
                      Mm2mils( pglayout.GetTopMargin() ) );
                      Mm2mils( pglayout.GetTopMargin() ) );
    wxPoint RBmargin( Mm2mils( pglayout.GetRightMargin() ),
    wxPoint RBmargin( Mm2mils( pglayout.GetRightMargin() ),
+10 −1
Original line number Original line Diff line number Diff line
@@ -977,7 +977,16 @@ Ki_WorkSheetData WS_DopTop_Line6 =


#include <worksheet_shape_builder.h>
#include <worksheet_shape_builder.h>


void WS_DRAW_ITEM_LIST::BuildWorkSheetGraphicList(
class WS_DRAW_ITEM_LIST_GOST : public WS_DRAW_ITEM_LIST
{
public:
    void BuildWorkSheetGraphicListGOST(
                           const PAGE_INFO& aPageInfo,
                           const TITLE_BLOCK& aTitleBlock,
                           EDA_COLOR_T aLineColor, EDA_COLOR_T aTextColor );
};

void WS_DRAW_ITEM_LIST_GOST::BuildWorkSheetGraphicListGOST(
                           const PAGE_INFO& aPageInfo,
                           const PAGE_INFO& aPageInfo,
                           const TITLE_BLOCK& aTitleBlock,
                           const TITLE_BLOCK& aTitleBlock,
                           EDA_COLOR_T aLineColor, EDA_COLOR_T aTextColor )
                           EDA_COLOR_T aLineColor, EDA_COLOR_T aTextColor )
+1 −1
Original line number Original line Diff line number Diff line
@@ -143,7 +143,7 @@ DIALOG_EESCHEMA_OPTIONS_BASE::DIALOG_EESCHEMA_OPTIONS_BASE( wxWindow* parent, wx
	m_staticText23->Wrap( -1 );
	m_staticText23->Wrap( -1 );
	fgSizer1->Add( m_staticText23, 0, wxALIGN_CENTER_VERTICAL|wxRIGHT|wxLEFT, 3 );
	fgSizer1->Add( m_staticText23, 0, wxALIGN_CENTER_VERTICAL|wxRIGHT|wxLEFT, 3 );
	
	
	m_staticText26 = new wxStaticText( m_panel1, wxID_ANY, _("part id notation:"), wxDefaultPosition, wxDefaultSize, 0 );
	m_staticText26 = new wxStaticText( m_panel1, wxID_ANY, _("Part id notation:"), wxDefaultPosition, wxDefaultSize, 0 );
	m_staticText26->Wrap( -1 );
	m_staticText26->Wrap( -1 );
	fgSizer1->Add( m_staticText26, 0, wxRIGHT|wxLEFT|wxALIGN_CENTER_VERTICAL, 5 );
	fgSizer1->Add( m_staticText26, 0, wxRIGHT|wxLEFT|wxALIGN_CENTER_VERTICAL, 5 );
	
	
Loading