All: change MILS_TO_IU_SCALING_FACTOR constant to MILS_PER_IU ( and MM_TO_IU_SCALING_FACTOR to MM_PER_IU)
Also fix bug 985654.
This commit is contained in:
parent
a00df5b330
commit
3b671e09d1
|
@ -41,10 +41,10 @@
|
||||||
|
|
||||||
|
|
||||||
#if defined( PCBNEW ) || defined( CVPCB ) || defined( EESCHEMA )
|
#if defined( PCBNEW ) || defined( CVPCB ) || defined( EESCHEMA )
|
||||||
#define IU_TO_MM( x ) ( x / MM_TO_IU_SCALING_FACTOR )
|
#define IU_TO_MM( x ) ( x / MM_PER_IU )
|
||||||
#define IU_TO_IN( x ) ( x / MILS_TO_IU_SCALING_FACTOR / 1000 )
|
#define IU_TO_IN( x ) ( x / MILS_PER_IU / 1000 )
|
||||||
#define MM_TO_IU( x ) ( x * MM_TO_IU_SCALING_FACTOR )
|
#define MM_TO_IU( x ) ( x * MM_PER_IU )
|
||||||
#define IN_TO_IU( x ) ( x * MILS_TO_IU_SCALING_FACTOR * 1000 )
|
#define IN_TO_IU( x ) ( x * MILS_PER_IU * 1000 )
|
||||||
#else
|
#else
|
||||||
#error "Cannot resolve internal units due to no definition of EESCHEMA, CVPCB or PCBNEW."
|
#error "Cannot resolve internal units due to no definition of EESCHEMA, CVPCB or PCBNEW."
|
||||||
#endif
|
#endif
|
||||||
|
|
|
@ -37,7 +37,7 @@
|
||||||
// Conversion to application internal units defined at build time.
|
// Conversion to application internal units defined at build time.
|
||||||
#if defined( PCBNEW )
|
#if defined( PCBNEW )
|
||||||
#include <class_board_item.h>
|
#include <class_board_item.h>
|
||||||
#define MILS_TO_IU( x ) ( x * MILS_TO_IU_SCALING_FACTOR );
|
#define MILS_TO_IU( x ) ( x * MILS_PER_IU );
|
||||||
#elif defined( EESCHEMA )
|
#elif defined( EESCHEMA )
|
||||||
#include <sch_item_struct.h>
|
#include <sch_item_struct.h>
|
||||||
#define MILS_TO_IU( x ) ( x )
|
#define MILS_TO_IU( x ) ( x )
|
||||||
|
|
|
@ -1,289 +1,289 @@
|
||||||
/*
|
/*
|
||||||
* This program source code file is part of KiCad, a free EDA CAD application.
|
* This program source code file is part of KiCad, a free EDA CAD application.
|
||||||
*
|
*
|
||||||
* Copyright (C) 2009 Jean-Pierre Charras, jaen-pierre.charras@gipsa-lab.inpg.com
|
* Copyright (C) 2009 Jean-Pierre Charras, jaen-pierre.charras@gipsa-lab.inpg.com
|
||||||
* Copyright (C) 2011 Wayne Stambaugh <stambaughw@verizon.net>
|
* Copyright (C) 2011 Wayne Stambaugh <stambaughw@verizon.net>
|
||||||
* Copyright (C) 1992-2011 KiCad Developers, see AUTHORS.txt for contributors.
|
* Copyright (C) 1992-2011 KiCad Developers, see AUTHORS.txt for contributors.
|
||||||
*
|
*
|
||||||
* This program is free software; you can redistribute it and/or
|
* This program is free software; you can redistribute it and/or
|
||||||
* modify it under the terms of the GNU General Public License
|
* modify it under the terms of the GNU General Public License
|
||||||
* as published by the Free Software Foundation; either version 2
|
* as published by the Free Software Foundation; either version 2
|
||||||
* of the License, or (at your option) any later version.
|
* of the License, or (at your option) any later version.
|
||||||
*
|
*
|
||||||
* This program is distributed in the hope that it will be useful,
|
* This program is distributed in the hope that it will be useful,
|
||||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
* GNU General Public License for more details.
|
* GNU General Public License for more details.
|
||||||
*
|
*
|
||||||
* You should have received a copy of the GNU General Public License
|
* You should have received a copy of the GNU General Public License
|
||||||
* along with this program; if not, you may find one here:
|
* along with this program; if not, you may find one here:
|
||||||
* http://www.gnu.org/licenses/old-licenses/gpl-2.0.html
|
* http://www.gnu.org/licenses/old-licenses/gpl-2.0.html
|
||||||
* or you may search the http://www.gnu.org website for the version 2 license,
|
* or you may search the http://www.gnu.org website for the version 2 license,
|
||||||
* or you may write to the Free Software Foundation, Inc.,
|
* or you may write to the Free Software Foundation, Inc.,
|
||||||
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
|
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @file eeschema/dialogs/dialog_SVG_print.cpp
|
* @file eeschema/dialogs/dialog_SVG_print.cpp
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include <fctsys.h>
|
#include <fctsys.h>
|
||||||
#include <appl_wxstruct.h>
|
#include <appl_wxstruct.h>
|
||||||
#include <gr_basic.h>
|
#include <gr_basic.h>
|
||||||
#include <class_drawpanel.h>
|
#include <class_drawpanel.h>
|
||||||
#include <confirm.h>
|
#include <confirm.h>
|
||||||
#include <gestfich.h>
|
#include <gestfich.h>
|
||||||
#include <class_sch_screen.h>
|
#include <class_sch_screen.h>
|
||||||
#include <wxEeschemaStruct.h>
|
#include <wxEeschemaStruct.h>
|
||||||
#include <dcsvg.h>
|
#include <dcsvg.h>
|
||||||
#include <base_units.h>
|
#include <base_units.h>
|
||||||
|
|
||||||
#include <general.h>
|
#include <general.h>
|
||||||
#include <libeditframe.h>
|
#include <libeditframe.h>
|
||||||
#include <sch_sheet_path.h>
|
#include <sch_sheet_path.h>
|
||||||
|
|
||||||
#include <dialog_SVG_print.h>
|
#include <dialog_SVG_print.h>
|
||||||
|
|
||||||
|
|
||||||
// Keys for configuration
|
// Keys for configuration
|
||||||
#define PLOTSVGMODECOLOR_KEY wxT( "PlotSVGModeColor" )
|
#define PLOTSVGMODECOLOR_KEY wxT( "PlotSVGModeColor" )
|
||||||
|
|
||||||
#define WIDTH_MAX_VALUE 100
|
#define WIDTH_MAX_VALUE 100
|
||||||
#define WIDTH_MIN_VALUE 1
|
#define WIDTH_MIN_VALUE 1
|
||||||
|
|
||||||
// Variables locales
|
// Variables locales
|
||||||
static bool s_Print_Frame_Ref = true;
|
static bool s_Print_Frame_Ref = true;
|
||||||
static int s_PlotBlackAndWhite = 0;
|
static int s_PlotBlackAndWhite = 0;
|
||||||
|
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
* DIALOG_SVG_PRINT functions
|
* DIALOG_SVG_PRINT functions
|
||||||
*/
|
*/
|
||||||
DIALOG_SVG_PRINT::DIALOG_SVG_PRINT( EDA_DRAW_FRAME* parent ) :
|
DIALOG_SVG_PRINT::DIALOG_SVG_PRINT( EDA_DRAW_FRAME* parent ) :
|
||||||
DIALOG_SVG_PRINT_base( parent )
|
DIALOG_SVG_PRINT_base( parent )
|
||||||
{
|
{
|
||||||
m_Parent = parent;
|
m_Parent = parent;
|
||||||
m_Config = wxGetApp().GetSettings();
|
m_Config = wxGetApp().GetSettings();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void DIALOG_SVG_PRINT::OnInitDialog( wxInitDialogEvent& event )
|
void DIALOG_SVG_PRINT::OnInitDialog( wxInitDialogEvent& event )
|
||||||
{
|
{
|
||||||
SetFocus(); // Make ESC key working
|
SetFocus(); // Make ESC key working
|
||||||
|
|
||||||
if( m_Config )
|
if( m_Config )
|
||||||
{
|
{
|
||||||
m_Config->Read( PLOTSVGMODECOLOR_KEY, &s_PlotBlackAndWhite );
|
m_Config->Read( PLOTSVGMODECOLOR_KEY, &s_PlotBlackAndWhite );
|
||||||
}
|
}
|
||||||
|
|
||||||
m_ModeColorOption->SetSelection( s_PlotBlackAndWhite );
|
m_ModeColorOption->SetSelection( s_PlotBlackAndWhite );
|
||||||
|
|
||||||
AddUnitSymbol( *m_TextPenWidth, g_UserUnit );
|
AddUnitSymbol( *m_TextPenWidth, g_UserUnit );
|
||||||
m_DialogPenWidth->SetValue(
|
m_DialogPenWidth->SetValue(
|
||||||
ReturnStringFromValue( g_UserUnit, g_DrawDefaultLineThickness ) );
|
ReturnStringFromValue( g_UserUnit, g_DrawDefaultLineThickness ) );
|
||||||
m_Print_Sheet_Ref->SetValue( s_Print_Frame_Ref );
|
m_Print_Sheet_Ref->SetValue( s_Print_Frame_Ref );
|
||||||
|
|
||||||
if( GetSizer() )
|
if( GetSizer() )
|
||||||
{
|
{
|
||||||
GetSizer()->SetSizeHints( this );
|
GetSizer()->SetSizeHints( this );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void DIALOG_SVG_PRINT::SetPenWidth()
|
void DIALOG_SVG_PRINT::SetPenWidth()
|
||||||
{
|
{
|
||||||
g_DrawDefaultLineThickness = ReturnValueFromTextCtrl( *m_DialogPenWidth );
|
g_DrawDefaultLineThickness = ReturnValueFromTextCtrl( *m_DialogPenWidth );
|
||||||
|
|
||||||
if( g_DrawDefaultLineThickness > WIDTH_MAX_VALUE )
|
if( g_DrawDefaultLineThickness > WIDTH_MAX_VALUE )
|
||||||
{
|
{
|
||||||
g_DrawDefaultLineThickness = WIDTH_MAX_VALUE;
|
g_DrawDefaultLineThickness = WIDTH_MAX_VALUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
if( g_DrawDefaultLineThickness < WIDTH_MIN_VALUE )
|
if( g_DrawDefaultLineThickness < WIDTH_MIN_VALUE )
|
||||||
{
|
{
|
||||||
g_DrawDefaultLineThickness = WIDTH_MIN_VALUE;
|
g_DrawDefaultLineThickness = WIDTH_MIN_VALUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
m_DialogPenWidth->SetValue(
|
m_DialogPenWidth->SetValue(
|
||||||
ReturnStringFromValue( g_UserUnit, g_DrawDefaultLineThickness ) );
|
ReturnStringFromValue( g_UserUnit, g_DrawDefaultLineThickness ) );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void DIALOG_SVG_PRINT::PrintSVGDoc( bool aPrintAll, bool aPrint_Sheet_Ref )
|
void DIALOG_SVG_PRINT::PrintSVGDoc( bool aPrintAll, bool aPrint_Sheet_Ref )
|
||||||
{
|
{
|
||||||
wxString msg;
|
wxString msg;
|
||||||
wxFileName fn;
|
wxFileName fn;
|
||||||
|
|
||||||
SetPenWidth();
|
SetPenWidth();
|
||||||
|
|
||||||
g_DrawDefaultLineThickness =
|
g_DrawDefaultLineThickness =
|
||||||
ReturnValueFromTextCtrl( *m_DialogPenWidth );
|
ReturnValueFromTextCtrl( *m_DialogPenWidth );
|
||||||
|
|
||||||
SCH_SCREEN* screen = (SCH_SCREEN*) m_Parent->GetScreen();
|
SCH_SCREEN* screen = (SCH_SCREEN*) m_Parent->GetScreen();
|
||||||
|
|
||||||
if( aPrintAll && m_Parent->IsType( SCHEMATIC_FRAME ) )
|
if( aPrintAll && m_Parent->IsType( SCHEMATIC_FRAME ) )
|
||||||
{
|
{
|
||||||
SCH_EDIT_FRAME* schframe = (SCH_EDIT_FRAME*) m_Parent;
|
SCH_EDIT_FRAME* schframe = (SCH_EDIT_FRAME*) m_Parent;
|
||||||
SCH_SHEET_PATH* sheetpath;
|
SCH_SHEET_PATH* sheetpath;
|
||||||
SCH_SHEET_PATH oldsheetpath = schframe->GetCurrentSheet();
|
SCH_SHEET_PATH oldsheetpath = schframe->GetCurrentSheet();
|
||||||
SCH_SCREEN* schscreen = schframe->GetScreen();
|
SCH_SCREEN* schscreen = schframe->GetScreen();
|
||||||
SCH_SHEET_LIST SheetList( NULL );
|
SCH_SHEET_LIST SheetList( NULL );
|
||||||
sheetpath = SheetList.GetFirst();
|
sheetpath = SheetList.GetFirst();
|
||||||
SCH_SHEET_PATH list;
|
SCH_SHEET_PATH list;
|
||||||
|
|
||||||
for( ; ; )
|
for( ; ; )
|
||||||
{
|
{
|
||||||
if( sheetpath == NULL )
|
if( sheetpath == NULL )
|
||||||
break;
|
break;
|
||||||
|
|
||||||
list.Clear();
|
list.Clear();
|
||||||
|
|
||||||
if( list.BuildSheetPathInfoFromSheetPathValue( sheetpath->Path() ) )
|
if( list.BuildSheetPathInfoFromSheetPathValue( sheetpath->Path() ) )
|
||||||
{
|
{
|
||||||
schframe->SetCurrentSheet( list );
|
schframe->SetCurrentSheet( list );
|
||||||
schframe->GetCurrentSheet().UpdateAllScreenReferences();
|
schframe->GetCurrentSheet().UpdateAllScreenReferences();
|
||||||
schframe->SetSheetNumberAndCount();
|
schframe->SetSheetNumberAndCount();
|
||||||
schscreen = schframe->GetCurrentSheet().LastScreen();
|
schscreen = schframe->GetCurrentSheet().LastScreen();
|
||||||
}
|
}
|
||||||
else // Should not happen
|
else // Should not happen
|
||||||
return;
|
return;
|
||||||
|
|
||||||
sheetpath = SheetList.GetNext();
|
sheetpath = SheetList.GetNext();
|
||||||
|
|
||||||
fn = schframe->GetUniqueFilenameForCurrentSheet() + wxT( ".svg" );
|
fn = schframe->GetUniqueFilenameForCurrentSheet() + wxT( ".svg" );
|
||||||
|
|
||||||
bool success = DrawSVGPage( m_Parent, fn.GetFullPath(), ( SCH_SCREEN* ) schscreen,
|
bool success = DrawSVGPage( m_Parent, fn.GetFullPath(), ( SCH_SCREEN* ) schscreen,
|
||||||
m_ModeColorOption->GetSelection() == 0 ? false : true,
|
m_ModeColorOption->GetSelection() == 0 ? false : true,
|
||||||
aPrint_Sheet_Ref );
|
aPrint_Sheet_Ref );
|
||||||
msg = _( "Create file " ) + fn.GetFullPath();
|
msg = _( "Create file " ) + fn.GetFullPath();
|
||||||
if( !success )
|
if( !success )
|
||||||
msg += _( " error" );
|
msg += _( " error" );
|
||||||
msg += wxT( "\n" );
|
msg += wxT( "\n" );
|
||||||
m_MessagesBox->AppendText( msg );
|
m_MessagesBox->AppendText( msg );
|
||||||
}
|
}
|
||||||
|
|
||||||
schframe->SetCurrentSheet( oldsheetpath );
|
schframe->SetCurrentSheet( oldsheetpath );
|
||||||
schframe->GetCurrentSheet().UpdateAllScreenReferences();
|
schframe->GetCurrentSheet().UpdateAllScreenReferences();
|
||||||
schframe->SetSheetNumberAndCount();
|
schframe->SetSheetNumberAndCount();
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
fn = m_FileNameCtrl->GetValue();
|
fn = m_FileNameCtrl->GetValue();
|
||||||
|
|
||||||
if( !fn.IsOk() )
|
if( !fn.IsOk() )
|
||||||
fn = screen->GetFileName();
|
fn = screen->GetFileName();
|
||||||
|
|
||||||
fn.SetExt( wxT( "svg" ) );
|
fn.SetExt( wxT( "svg" ) );
|
||||||
fn.MakeAbsolute();
|
fn.MakeAbsolute();
|
||||||
|
|
||||||
bool success = DrawSVGPage( m_Parent, fn.GetFullPath(), ( SCH_SCREEN* ) screen,
|
bool success = DrawSVGPage( m_Parent, fn.GetFullPath(), ( SCH_SCREEN* ) screen,
|
||||||
m_ModeColorOption->GetSelection() == 0 ? false : true,
|
m_ModeColorOption->GetSelection() == 0 ? false : true,
|
||||||
aPrint_Sheet_Ref );
|
aPrint_Sheet_Ref );
|
||||||
msg = _( "Create file " ) + fn.GetFullPath();
|
msg = _( "Create file " ) + fn.GetFullPath();
|
||||||
|
|
||||||
if( !success )
|
if( !success )
|
||||||
msg += _( " error" );
|
msg += _( " error" );
|
||||||
|
|
||||||
msg += wxT( "\n" );
|
msg += wxT( "\n" );
|
||||||
m_MessagesBox->AppendText( msg );
|
m_MessagesBox->AppendText( msg );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
bool DIALOG_SVG_PRINT::DrawSVGPage( EDA_DRAW_FRAME* frame,
|
bool DIALOG_SVG_PRINT::DrawSVGPage( EDA_DRAW_FRAME* frame,
|
||||||
const wxString& FullFileName,
|
const wxString& FullFileName,
|
||||||
SCH_SCREEN* screen,
|
SCH_SCREEN* screen,
|
||||||
bool aPrintBlackAndWhite,
|
bool aPrintBlackAndWhite,
|
||||||
bool aPrint_Sheet_Ref )
|
bool aPrint_Sheet_Ref )
|
||||||
{
|
{
|
||||||
int tmpzoom;
|
int tmpzoom;
|
||||||
wxPoint tmp_startvisu;
|
wxPoint tmp_startvisu;
|
||||||
wxSize sheetSize; // Sheet size in internal units
|
wxSize sheetSize; // Sheet size in internal units
|
||||||
wxPoint old_org;
|
wxPoint old_org;
|
||||||
bool success = true;
|
bool success = true;
|
||||||
|
|
||||||
tmp_startvisu = screen->m_StartVisu;
|
tmp_startvisu = screen->m_StartVisu;
|
||||||
tmpzoom = screen->GetZoom();
|
tmpzoom = screen->GetZoom();
|
||||||
old_org = screen->m_DrawOrg;
|
old_org = screen->m_DrawOrg;
|
||||||
screen->m_DrawOrg.x = screen->m_DrawOrg.y = 0;
|
screen->m_DrawOrg.x = screen->m_DrawOrg.y = 0;
|
||||||
screen->m_StartVisu.x = screen->m_StartVisu.y = 0;
|
screen->m_StartVisu.x = screen->m_StartVisu.y = 0;
|
||||||
|
|
||||||
sheetSize = screen->GetPageSettings().GetSizeIU(); // page size in 1/1000 inch, ie in internal units
|
sheetSize = screen->GetPageSettings().GetSizeIU(); // page size in 1/1000 inch, ie in internal units
|
||||||
|
|
||||||
screen->SetScalingFactor( 1.0 );
|
screen->SetScalingFactor( 1.0 );
|
||||||
EDA_DRAW_PANEL* panel = frame->GetCanvas();
|
EDA_DRAW_PANEL* panel = frame->GetCanvas();
|
||||||
|
|
||||||
LOCALE_IO toggle;
|
LOCALE_IO toggle;
|
||||||
|
|
||||||
float dpi = 1000.0;
|
float dpi = 1000.0;
|
||||||
KicadSVGFileDC dc( FullFileName, sheetSize.x, sheetSize.y, dpi );
|
KicadSVGFileDC dc( FullFileName, sheetSize.x, sheetSize.y, dpi );
|
||||||
|
|
||||||
EDA_RECT tmp = *panel->GetClipBox();
|
EDA_RECT tmp = *panel->GetClipBox();
|
||||||
GRResetPenAndBrush( &dc );
|
GRResetPenAndBrush( &dc );
|
||||||
GRForceBlackPen( aPrintBlackAndWhite );
|
GRForceBlackPen( aPrintBlackAndWhite );
|
||||||
|
|
||||||
|
|
||||||
panel->SetClipBox( EDA_RECT( wxPoint( -0x3FFFFF0, -0x3FFFFF0 ),
|
panel->SetClipBox( EDA_RECT( wxPoint( -0x3FFFFF0, -0x3FFFFF0 ),
|
||||||
wxSize( 0x7FFFFF0, 0x7FFFFF0 ) ) );
|
wxSize( 0x7FFFFF0, 0x7FFFFF0 ) ) );
|
||||||
|
|
||||||
screen->m_IsPrinting = true;
|
screen->m_IsPrinting = true;
|
||||||
|
|
||||||
if( frame->IsType( SCHEMATIC_FRAME ) )
|
if( frame->IsType( SCHEMATIC_FRAME ) )
|
||||||
screen->Draw( panel, &dc, GR_COPY );
|
screen->Draw( panel, &dc, GR_COPY );
|
||||||
|
|
||||||
if( frame->IsType( LIBEDITOR_FRAME ) )
|
if( frame->IsType( LIBEDITOR_FRAME ) )
|
||||||
((LIB_EDIT_FRAME*)frame)->RedrawComponent( &dc,
|
((LIB_EDIT_FRAME*)frame)->RedrawComponent( &dc,
|
||||||
wxPoint(sheetSize.x/2,
|
wxPoint(sheetSize.x/2,
|
||||||
sheetSize.y/2) );
|
sheetSize.y/2) );
|
||||||
|
|
||||||
if( aPrint_Sheet_Ref )
|
if( aPrint_Sheet_Ref )
|
||||||
frame->TraceWorkSheet( &dc, screen, g_DrawDefaultLineThickness, MILS_TO_IU_SCALING_FACTOR );
|
frame->TraceWorkSheet( &dc, screen, g_DrawDefaultLineThickness, MILS_PER_IU );
|
||||||
|
|
||||||
screen->m_IsPrinting = false;
|
screen->m_IsPrinting = false;
|
||||||
panel->SetClipBox( tmp );
|
panel->SetClipBox( tmp );
|
||||||
|
|
||||||
GRForceBlackPen( false );
|
GRForceBlackPen( false );
|
||||||
|
|
||||||
screen->m_StartVisu = tmp_startvisu;
|
screen->m_StartVisu = tmp_startvisu;
|
||||||
screen->m_DrawOrg = old_org;
|
screen->m_DrawOrg = old_org;
|
||||||
screen->SetZoom( tmpzoom );
|
screen->SetZoom( tmpzoom );
|
||||||
|
|
||||||
return success;
|
return success;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void DIALOG_SVG_PRINT::OnButtonPlotAllClick( wxCommandEvent& event )
|
void DIALOG_SVG_PRINT::OnButtonPlotAllClick( wxCommandEvent& event )
|
||||||
{
|
{
|
||||||
PrintSVGDoc( true, m_Print_Sheet_Ref->GetValue() );
|
PrintSVGDoc( true, m_Print_Sheet_Ref->GetValue() );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void DIALOG_SVG_PRINT::OnButtonPlotCurrentClick( wxCommandEvent& event )
|
void DIALOG_SVG_PRINT::OnButtonPlotCurrentClick( wxCommandEvent& event )
|
||||||
{
|
{
|
||||||
PrintSVGDoc( false, m_Print_Sheet_Ref->GetValue() );
|
PrintSVGDoc( false, m_Print_Sheet_Ref->GetValue() );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void DIALOG_SVG_PRINT::OnButtonCancelClick( wxCommandEvent& event )
|
void DIALOG_SVG_PRINT::OnButtonCancelClick( wxCommandEvent& event )
|
||||||
{
|
{
|
||||||
Close();
|
Close();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void DIALOG_SVG_PRINT::OnCloseWindow( wxCloseEvent& event )
|
void DIALOG_SVG_PRINT::OnCloseWindow( wxCloseEvent& event )
|
||||||
{
|
{
|
||||||
if( m_Config )
|
if( m_Config )
|
||||||
{
|
{
|
||||||
s_PlotBlackAndWhite = m_ModeColorOption->GetSelection();
|
s_PlotBlackAndWhite = m_ModeColorOption->GetSelection();
|
||||||
m_Config->Write( PLOTSVGMODECOLOR_KEY, s_PlotBlackAndWhite );
|
m_Config->Write( PLOTSVGMODECOLOR_KEY, s_PlotBlackAndWhite );
|
||||||
}
|
}
|
||||||
EndModal( 0 );
|
EndModal( 0 );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/* called on radiobox color/black and white selection
|
/* called on radiobox color/black and white selection
|
||||||
*/
|
*/
|
||||||
void DIALOG_SVG_PRINT::OnSetColorModeSelected( wxCommandEvent& event )
|
void DIALOG_SVG_PRINT::OnSetColorModeSelected( wxCommandEvent& event )
|
||||||
{
|
{
|
||||||
s_PlotBlackAndWhite = m_ModeColorOption->GetSelection();
|
s_PlotBlackAndWhite = m_ModeColorOption->GetSelection();
|
||||||
}
|
}
|
||||||
|
|
|
@ -378,7 +378,7 @@ void SCH_PRINTOUT::DrawPage( SCH_SCREEN* aScreen )
|
||||||
aScreen->Draw( panel, dc, GR_DEFAULT_DRAWMODE );
|
aScreen->Draw( panel, dc, GR_DEFAULT_DRAWMODE );
|
||||||
|
|
||||||
if( printReference )
|
if( printReference )
|
||||||
parent->TraceWorkSheet( dc, aScreen, g_DrawDefaultLineThickness, MILS_TO_IU_SCALING_FACTOR );
|
parent->TraceWorkSheet( dc, aScreen, g_DrawDefaultLineThickness, MILS_PER_IU );
|
||||||
|
|
||||||
g_DrawBgColor = bg_color;
|
g_DrawBgColor = bg_color;
|
||||||
aScreen->m_IsPrinting = false;
|
aScreen->m_IsPrinting = false;
|
||||||
|
|
|
@ -71,7 +71,7 @@ void SCH_EDIT_FRAME::RedrawActiveWindow( wxDC* DC, bool EraseBg )
|
||||||
|
|
||||||
GetScreen()->Draw( m_canvas, DC, GR_DEFAULT_DRAWMODE );
|
GetScreen()->Draw( m_canvas, DC, GR_DEFAULT_DRAWMODE );
|
||||||
|
|
||||||
TraceWorkSheet( DC, GetScreen(), g_DrawDefaultLineThickness, MILS_TO_IU_SCALING_FACTOR );
|
TraceWorkSheet( DC, GetScreen(), g_DrawDefaultLineThickness, MILS_PER_IU );
|
||||||
|
|
||||||
#ifdef USE_WX_OVERLAY
|
#ifdef USE_WX_OVERLAY
|
||||||
if( IsShown() )
|
if( IsShown() )
|
||||||
|
|
|
@ -863,7 +863,7 @@ void SCH_EDIT_FRAME::SVG_Print( wxCommandEvent& event )
|
||||||
void SCH_EDIT_FRAME::PrintPage( wxDC* aDC, int aPrintMask, bool aPrintMirrorMode, void* aData )
|
void SCH_EDIT_FRAME::PrintPage( wxDC* aDC, int aPrintMask, bool aPrintMirrorMode, void* aData )
|
||||||
{
|
{
|
||||||
GetScreen()->Draw( m_canvas, aDC, GR_DEFAULT_DRAWMODE );
|
GetScreen()->Draw( m_canvas, aDC, GR_DEFAULT_DRAWMODE );
|
||||||
TraceWorkSheet( aDC, GetScreen(), g_DrawDefaultLineThickness, MILS_TO_IU_SCALING_FACTOR );
|
TraceWorkSheet( aDC, GetScreen(), g_DrawDefaultLineThickness, MILS_PER_IU );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -17,10 +17,10 @@
|
||||||
#include <pcbnew_id.h>
|
#include <pcbnew_id.h>
|
||||||
|
|
||||||
|
|
||||||
#define DMIL_GRID( x ) wxRealPoint( x * DECIMILS_TO_IU_SCALING_FACTOR,\
|
#define DMIL_GRID( x ) wxRealPoint( x * DECIMILS_PER_IU,\
|
||||||
x * DECIMILS_TO_IU_SCALING_FACTOR )
|
x * DECIMILS_PER_IU )
|
||||||
#define MM_GRID( x ) wxRealPoint( x * MM_TO_IU_SCALING_FACTOR,\
|
#define MM_GRID( x ) wxRealPoint( x * MM_PER_IU,\
|
||||||
x * MM_TO_IU_SCALING_FACTOR )
|
x * MM_PER_IU )
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -118,5 +118,5 @@ GBR_SCREEN::~GBR_SCREEN()
|
||||||
// virtual function
|
// virtual function
|
||||||
int GBR_SCREEN::MilsToIuScalar()
|
int GBR_SCREEN::MilsToIuScalar()
|
||||||
{
|
{
|
||||||
return (int)MILS_TO_IU_SCALING_FACTOR;
|
return (int)MILS_PER_IU;
|
||||||
}
|
}
|
||||||
|
|
|
@ -9,7 +9,7 @@
|
||||||
#include <base_units.h>
|
#include <base_units.h>
|
||||||
#include <class_pcb_screen.h>
|
#include <class_pcb_screen.h>
|
||||||
|
|
||||||
#define ZOOM_FACTOR( x ) ( x * DECIMILS_TO_IU_SCALING_FACTOR )
|
#define ZOOM_FACTOR( x ) ( x * DECIMILS_PER_IU )
|
||||||
|
|
||||||
|
|
||||||
/* Handle info to display a board */
|
/* Handle info to display a board */
|
||||||
|
|
|
@ -175,8 +175,8 @@ int GERBVIEW_FRAME::ReadDCodeDefinitionFile( const wxString& D_Code_FullFileName
|
||||||
|
|
||||||
|
|
||||||
/* Updating gerber scale: */
|
/* Updating gerber scale: */
|
||||||
double dcode_scale = MILS_TO_IU_SCALING_FACTOR; // By uniting dCode = mil,
|
double dcode_scale = MILS_PER_IU; // By uniting dCode = mil,
|
||||||
// internal unit = MILS_TO_IU_SCALING_FACTOR
|
// internal unit = MILS_PER_IU
|
||||||
current_Dcode = 0;
|
current_Dcode = 0;
|
||||||
|
|
||||||
if( D_Code_FullFileName.IsEmpty() )
|
if( D_Code_FullFileName.IsEmpty() )
|
||||||
|
|
|
@ -107,7 +107,7 @@ void GERBVIEW_FRAME::RedrawActiveWindow( wxDC* DC, bool EraseBg )
|
||||||
if( IsElementVisible( DCODES_VISIBLE ) )
|
if( IsElementVisible( DCODES_VISIBLE ) )
|
||||||
DrawItemsDCodeID( DC, GR_COPY );
|
DrawItemsDCodeID( DC, GR_COPY );
|
||||||
|
|
||||||
TraceWorkSheet( DC, screen, 0, MILS_TO_IU_SCALING_FACTOR );
|
TraceWorkSheet( DC, screen, 0, MILS_PER_IU );
|
||||||
|
|
||||||
if( m_canvas->IsMouseCaptured() )
|
if( m_canvas->IsMouseCaptured() )
|
||||||
m_canvas->CallMouseCapture( DC, wxDefaultPosition, false );
|
m_canvas->CallMouseCapture( DC, wxDefaultPosition, false );
|
||||||
|
|
|
@ -432,7 +432,7 @@ bool EXCELLON_IMAGE::Execute_HEADER_Command( char*& text )
|
||||||
if( dcode == NULL )
|
if( dcode == NULL )
|
||||||
break;
|
break;
|
||||||
// conv_scale = scaling factor from inch to Internal Unit
|
// conv_scale = scaling factor from inch to Internal Unit
|
||||||
double conv_scale = MILS_TO_IU_SCALING_FACTOR * 1000;
|
double conv_scale = MILS_PER_IU * 1000;
|
||||||
if( m_GerbMetric )
|
if( m_GerbMetric )
|
||||||
conv_scale /= 25.4;
|
conv_scale /= 25.4;
|
||||||
|
|
||||||
|
|
|
@ -411,7 +411,7 @@ void GERBVIEW_FRAME::Liste_D_Codes()
|
||||||
D_CODE* pt_D_code;
|
D_CODE* pt_D_code;
|
||||||
wxString Line;
|
wxString Line;
|
||||||
wxArrayString list;
|
wxArrayString list;
|
||||||
double scale = MILS_TO_IU_SCALING_FACTOR * 1000;
|
double scale = MILS_PER_IU * 1000;
|
||||||
int curr_layer = getActiveLayer();
|
int curr_layer = getActiveLayer();
|
||||||
|
|
||||||
for( int layer = 0; layer < 32; layer++ )
|
for( int layer = 0; layer < 32; layer++ )
|
||||||
|
|
|
@ -21,16 +21,16 @@
|
||||||
// for metric gerber units, the imperial to metric conversion is made in read functions
|
// for metric gerber units, the imperial to metric conversion is made in read functions
|
||||||
static double scale_list[10] =
|
static double scale_list[10] =
|
||||||
{
|
{
|
||||||
1000.0 * MILS_TO_IU_SCALING_FACTOR,
|
1000.0 * MILS_PER_IU,
|
||||||
100.0 * MILS_TO_IU_SCALING_FACTOR,
|
100.0 * MILS_PER_IU,
|
||||||
10.0 * MILS_TO_IU_SCALING_FACTOR,
|
10.0 * MILS_PER_IU,
|
||||||
1.0 * MILS_TO_IU_SCALING_FACTOR,
|
1.0 * MILS_PER_IU,
|
||||||
0.1 * MILS_TO_IU_SCALING_FACTOR,
|
0.1 * MILS_PER_IU,
|
||||||
0.01 * MILS_TO_IU_SCALING_FACTOR,
|
0.01 * MILS_PER_IU,
|
||||||
0.001 * MILS_TO_IU_SCALING_FACTOR,
|
0.001 * MILS_PER_IU,
|
||||||
0.0001 * MILS_TO_IU_SCALING_FACTOR,
|
0.0001 * MILS_PER_IU,
|
||||||
0.00001 * MILS_TO_IU_SCALING_FACTOR,
|
0.00001 * MILS_PER_IU,
|
||||||
0.000001 * MILS_TO_IU_SCALING_FACTOR
|
0.000001 * MILS_PER_IU
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
@ -44,9 +44,9 @@ int scaletoIU( double aCoord, bool isMetric )
|
||||||
int ret;
|
int ret;
|
||||||
|
|
||||||
if( isMetric )
|
if( isMetric )
|
||||||
ret = KiROUND( aCoord * MILS_TO_IU_SCALING_FACTOR / 0.00254 );
|
ret = KiROUND( aCoord * MILS_PER_IU / 0.00254 );
|
||||||
else
|
else
|
||||||
ret = KiROUND( aCoord * MILS_TO_IU_SCALING_FACTOR );
|
ret = KiROUND( aCoord * MILS_PER_IU );
|
||||||
|
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
@ -94,9 +94,9 @@ wxPoint GERBER_IMAGE::ReadXYCoord( char*& Text )
|
||||||
{
|
{
|
||||||
// When X or Y values are float numbers, they are given in mm or inches
|
// When X or Y values are float numbers, they are given in mm or inches
|
||||||
if( m_GerbMetric ) // units are mm
|
if( m_GerbMetric ) // units are mm
|
||||||
current_coord = KiROUND( atof( line ) * MILS_TO_IU_SCALING_FACTOR / 0.0254 );
|
current_coord = KiROUND( atof( line ) * MILS_PER_IU / 0.0254 );
|
||||||
else // units are inches
|
else // units are inches
|
||||||
current_coord = KiROUND( atof( line ) * MILS_TO_IU_SCALING_FACTOR * 1000 );
|
current_coord = KiROUND( atof( line ) * MILS_PER_IU * 1000 );
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
@ -185,9 +185,9 @@ wxPoint GERBER_IMAGE::ReadIJCoord( char*& Text )
|
||||||
{
|
{
|
||||||
// When X or Y values are float numbers, they are given in mm or inches
|
// When X or Y values are float numbers, they are given in mm or inches
|
||||||
if( m_GerbMetric ) // units are mm
|
if( m_GerbMetric ) // units are mm
|
||||||
current_coord = KiROUND( atof( line ) * MILS_TO_IU_SCALING_FACTOR / 0.0254 );
|
current_coord = KiROUND( atof( line ) * MILS_PER_IU / 0.0254 );
|
||||||
else // units are inches
|
else // units are inches
|
||||||
current_coord = KiROUND( atof( line ) * MILS_TO_IU_SCALING_FACTOR * 1000 );
|
current_coord = KiROUND( atof( line ) * MILS_PER_IU * 1000 );
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
|
|
@ -160,7 +160,7 @@ bool GERBER_IMAGE::ExecuteRS274XCommand( int command,
|
||||||
double fcoord;
|
double fcoord;
|
||||||
|
|
||||||
// conv_scale = scaling factor from inch to Internal Unit
|
// conv_scale = scaling factor from inch to Internal Unit
|
||||||
double conv_scale = MILS_TO_IU_SCALING_FACTOR * 1000;
|
double conv_scale = MILS_PER_IU * 1000;
|
||||||
if( m_GerbMetric )
|
if( m_GerbMetric )
|
||||||
conv_scale /= 25.4;
|
conv_scale /= 25.4;
|
||||||
|
|
||||||
|
@ -294,7 +294,7 @@ bool GERBER_IMAGE::ExecuteRS274XCommand( int command,
|
||||||
m_GerbMetric = false;
|
m_GerbMetric = false;
|
||||||
else if( code == MILLIMETER )
|
else if( code == MILLIMETER )
|
||||||
m_GerbMetric = true;
|
m_GerbMetric = true;
|
||||||
conv_scale = m_GerbMetric ? MILS_TO_IU_SCALING_FACTOR / 25.4 : MILS_TO_IU_SCALING_FACTOR;
|
conv_scale = m_GerbMetric ? MILS_PER_IU / 25.4 : MILS_PER_IU;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case OFFSET: // command: OFAnnBnn (nn = float number) = layer Offset
|
case OFFSET: // command: OFAnnBnn (nn = float number) = layer Offset
|
||||||
|
|
|
@ -298,8 +298,8 @@ public:
|
||||||
// Accessors returning "Internal Units (IU)". IUs are mils in EESCHEMA,
|
// Accessors returning "Internal Units (IU)". IUs are mils in EESCHEMA,
|
||||||
// and either deci-mils or nanometers in PCBNew.
|
// and either deci-mils or nanometers in PCBNew.
|
||||||
#if defined(PCBNEW) || defined(EESCHEMA) || defined(GERBVIEW)
|
#if defined(PCBNEW) || defined(EESCHEMA) || defined(GERBVIEW)
|
||||||
int GetWidthIU() const { return MILS_TO_IU_SCALING_FACTOR * GetWidthMils(); }
|
int GetWidthIU() const { return MILS_PER_IU * GetWidthMils(); }
|
||||||
int GetHeightIU() const { return MILS_TO_IU_SCALING_FACTOR * GetHeightMils(); }
|
int GetHeightIU() const { return MILS_PER_IU * GetHeightMils(); }
|
||||||
const wxSize GetSizeIU() const { return wxSize( GetWidthIU(), GetHeightIU() ); }
|
const wxSize GetSizeIU() const { return wxSize( GetWidthIU(), GetHeightIU() ); }
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
|
@ -20,26 +20,26 @@
|
||||||
#if defined(PCBNEW) || defined(CVPCB) || defined(GERBVIEW)
|
#if defined(PCBNEW) || defined(CVPCB) || defined(GERBVIEW)
|
||||||
#if defined( USE_PCBNEW_NANOMETRES )
|
#if defined( USE_PCBNEW_NANOMETRES )
|
||||||
#if defined(GERBVIEW)
|
#if defined(GERBVIEW)
|
||||||
#define MM_TO_IU_SCALING_FACTOR 1e5 // Gerbview uses 10 micrometer.
|
#define MM_PER_IU 1e5 // Gerbview uses 10 micrometer.
|
||||||
#else
|
#else
|
||||||
#define MM_TO_IU_SCALING_FACTOR 1e6 // Pcbnew uses nanometers.
|
#define MM_PER_IU 1e6 // Pcbnew uses nanometers.
|
||||||
#endif
|
#endif
|
||||||
#define MILS_TO_IU_SCALING_FACTOR ( MM_TO_IU_SCALING_FACTOR * 0.0254 )
|
#define MILS_PER_IU ( MM_PER_IU * 0.0254 )
|
||||||
#define DECIMILS_TO_IU_SCALING_FACTOR (MM_TO_IU_SCALING_FACTOR * 0.00254 )
|
#define DECIMILS_PER_IU (MM_PER_IU * 0.00254 )
|
||||||
#else // Pcbnew in deci-mils.
|
#else // Pcbnew in deci-mils.
|
||||||
#define DECIMILS_TO_IU_SCALING_FACTOR 1
|
#define DECIMILS_PER_IU 1
|
||||||
#define MILS_TO_IU_SCALING_FACTOR 10.0
|
#define MILS_PER_IU 10.0
|
||||||
#define MM_TO_IU_SCALING_FACTOR (1e4 / 25.4)
|
#define MM_PER_IU (1e4 / 25.4)
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/// Convert mils to PCBNEW internal units (iu).
|
/// Convert mils to PCBNEW internal units (iu).
|
||||||
inline int Mils2iu( int mils )
|
inline int Mils2iu( int mils )
|
||||||
{
|
{
|
||||||
#if defined( USE_PCBNEW_NANOMETRES )
|
#if defined( USE_PCBNEW_NANOMETRES )
|
||||||
double x = mils * MILS_TO_IU_SCALING_FACTOR;
|
double x = mils * MILS_PER_IU;
|
||||||
return int( x < 0 ? x - 0.5 : x + 0.5 );
|
return int( x < 0 ? x - 0.5 : x + 0.5 );
|
||||||
#else
|
#else
|
||||||
return mils * MILS_TO_IU_SCALING_FACTOR;
|
return mils * MILS_PER_IU;
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -47,7 +47,7 @@ inline int Mils2iu( int mils )
|
||||||
inline int DMils2iu( int dmils )
|
inline int DMils2iu( int dmils )
|
||||||
{
|
{
|
||||||
#if defined( USE_PCBNEW_NANOMETRES )
|
#if defined( USE_PCBNEW_NANOMETRES )
|
||||||
double x = dmils * DECIMILS_TO_IU_SCALING_FACTOR;
|
double x = dmils * DECIMILS_PER_IU;
|
||||||
return int( x < 0 ? x - 0.5 : x + 0.5 );
|
return int( x < 0 ? x - 0.5 : x + 0.5 );
|
||||||
#else
|
#else
|
||||||
return dmils;
|
return dmils;
|
||||||
|
@ -55,8 +55,8 @@ inline int DMils2iu( int dmils )
|
||||||
}
|
}
|
||||||
|
|
||||||
#else // Eeschema and anything else.
|
#else // Eeschema and anything else.
|
||||||
#define MILS_TO_IU_SCALING_FACTOR 1.0
|
#define MILS_PER_IU 1.0
|
||||||
#define MM_TO_IU_SCALING_FACTOR (MILS_TO_IU_SCALING_FACTOR / 0.0254)
|
#define MM_PER_IU (MILS_PER_IU / 0.0254)
|
||||||
|
|
||||||
inline int Mils2iu( int mils )
|
inline int Mils2iu( int mils )
|
||||||
{
|
{
|
||||||
|
|
|
@ -19,11 +19,11 @@
|
||||||
#include <pcbnew_id.h>
|
#include <pcbnew_id.h>
|
||||||
|
|
||||||
|
|
||||||
#define ZOOM_FACTOR( x ) ( x * DECIMILS_TO_IU_SCALING_FACTOR )
|
#define ZOOM_FACTOR( x ) ( x * DECIMILS_PER_IU )
|
||||||
#define DMIL_GRID( x ) wxRealPoint( x * DECIMILS_TO_IU_SCALING_FACTOR,\
|
#define DMIL_GRID( x ) wxRealPoint( x * DECIMILS_PER_IU,\
|
||||||
x * DECIMILS_TO_IU_SCALING_FACTOR )
|
x * DECIMILS_PER_IU )
|
||||||
#define MM_GRID( x ) wxRealPoint( x * MM_TO_IU_SCALING_FACTOR,\
|
#define MM_GRID( x ) wxRealPoint( x * MM_PER_IU,\
|
||||||
x * MM_TO_IU_SCALING_FACTOR )
|
x * MM_PER_IU )
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -133,7 +133,7 @@ PCB_SCREEN::~PCB_SCREEN()
|
||||||
|
|
||||||
int PCB_SCREEN::MilsToIuScalar()
|
int PCB_SCREEN::MilsToIuScalar()
|
||||||
{
|
{
|
||||||
return (int)MILS_TO_IU_SCALING_FACTOR;
|
return (int)MILS_PER_IU;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -271,7 +271,7 @@ bool DIALOG_SVG_PRINT::DrawPage( const wxString& FullFileName,
|
||||||
g_DrawBgColor = WHITE;
|
g_DrawBgColor = WHITE;
|
||||||
|
|
||||||
if( aPrint_Frame_Ref )
|
if( aPrint_Frame_Ref )
|
||||||
m_Parent->TraceWorkSheet( &dc, screen, s_Parameters.m_PenDefaultSize, MILS_TO_IU_SCALING_FACTOR );
|
m_Parent->TraceWorkSheet( &dc, screen, s_Parameters.m_PenDefaultSize, MILS_PER_IU );
|
||||||
|
|
||||||
m_Parent->PrintPage( &dc, m_PrintMaskLayer, false, &s_Parameters);
|
m_Parent->PrintPage( &dc, m_PrintMaskLayer, false, &s_Parameters);
|
||||||
g_DrawBgColor = bg_color;
|
g_DrawBgColor = bg_color;
|
||||||
|
|
|
@ -2682,7 +2682,7 @@ void LEGACY_PLUGIN::init( PROPERTIES* aProperties )
|
||||||
|
|
||||||
// conversion factor for saving RAM BIUs to KICAD legacy file format.
|
// conversion factor for saving RAM BIUs to KICAD legacy file format.
|
||||||
#if defined( USE_PCBNEW_NANOMETRES )
|
#if defined( USE_PCBNEW_NANOMETRES )
|
||||||
biuToDisk = 1/MM_TO_IU_SCALING_FACTOR; // BIUs are nanometers & file is mm
|
biuToDisk = 1/MM_PER_IU; // BIUs are nanometers & file is mm
|
||||||
#else
|
#else
|
||||||
biuToDisk = 1.0; // BIUs are deci-mils
|
biuToDisk = 1.0; // BIUs are deci-mils
|
||||||
#endif
|
#endif
|
||||||
|
@ -2694,7 +2694,7 @@ void LEGACY_PLUGIN::init( PROPERTIES* aProperties )
|
||||||
// then, during the file loading process, to start a conversion from
|
// then, during the file loading process, to start a conversion from
|
||||||
// mm to nanometers.
|
// mm to nanometers.
|
||||||
|
|
||||||
diskToBiu = DECIMILS_TO_IU_SCALING_FACTOR; // BIUs are nanometers if USE_PCBNEW_NANOMETRES
|
diskToBiu = DECIMILS_PER_IU; // BIUs are nanometers if USE_PCBNEW_NANOMETRES
|
||||||
// or BIUs are deci-mils
|
// or BIUs are deci-mils
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
/*
|
/*
|
||||||
* This program source code file is part of KiCad, a free EDA CAD application.
|
* This program source code file is part of KiCad, a free EDA CAD application.
|
||||||
*
|
*
|
||||||
* Copyright (C) 2009 Jean-Pierre Charras, jaen-pierre.charras@gipsa-lab.inpg.com
|
* Copyright (C) 2009 Jean-Pierre Charras, jean-pierre.charras@ujf-grenoble.fr
|
||||||
* Copyright (C) 1992-2011 KiCad Developers, see AUTHORS.txt for contributors.
|
* Copyright (C) 1992-2011 KiCad Developers, see AUTHORS.txt for contributors.
|
||||||
*
|
*
|
||||||
* This program is free software; you can redistribute it and/or
|
* This program is free software; you can redistribute it and/or
|
||||||
|
@ -181,7 +181,7 @@ void BOARD_PRINTOUT_CONTROLER::DrawPage()
|
||||||
if( userscale == 0 ) // fit in page
|
if( userscale == 0 ) // fit in page
|
||||||
{
|
{
|
||||||
// Margin = 10mm
|
// Margin = 10mm
|
||||||
int extra_margin = int( 10 * MM_TO_IU_SCALING_FACTOR ); // deci-mils
|
int extra_margin = int( 10 * MM_PER_IU ); // deci-mils
|
||||||
|
|
||||||
pageSizeIU.x = bbbox.GetWidth() + extra_margin * 2;
|
pageSizeIU.x = bbbox.GetWidth() + extra_margin * 2;
|
||||||
pageSizeIU.y = bbbox.GetHeight() + extra_margin * 2;
|
pageSizeIU.y = bbbox.GetHeight() + extra_margin * 2;
|
||||||
|
@ -275,7 +275,7 @@ void BOARD_PRINTOUT_CONTROLER::DrawPage()
|
||||||
|
|
||||||
if( m_PrintParams.m_Print_Sheet_Ref )
|
if( m_PrintParams.m_Print_Sheet_Ref )
|
||||||
m_Parent->TraceWorkSheet( dc, screen, m_PrintParams.m_PenDefaultSize,
|
m_Parent->TraceWorkSheet( dc, screen, m_PrintParams.m_PenDefaultSize,
|
||||||
MILS_TO_IU_SCALING_FACTOR );
|
MILS_PER_IU );
|
||||||
|
|
||||||
if( printMirror )
|
if( printMirror )
|
||||||
{
|
{
|
||||||
|
|
|
@ -99,7 +99,7 @@ void PCB_EDIT_FRAME::ExportToSpecctra( wxCommandEvent& event )
|
||||||
wxString errorText;
|
wxString errorText;
|
||||||
|
|
||||||
BASE_SCREEN* screen = GetScreen();
|
BASE_SCREEN* screen = GetScreen();
|
||||||
bool wasModified = screen->IsModify() && !screen->IsSave();
|
bool wasModified = screen->IsModify();
|
||||||
|
|
||||||
db.SetPCB( SPECCTRA_DB::MakePCB() );
|
db.SetPCB( SPECCTRA_DB::MakePCB() );
|
||||||
|
|
||||||
|
@ -171,10 +171,10 @@ static inline double scale( int kicadDist )
|
||||||
#if defined(USE_PCBNEW_NANOMETRES)
|
#if defined(USE_PCBNEW_NANOMETRES)
|
||||||
|
|
||||||
// nanometers to um
|
// nanometers to um
|
||||||
return kicadDist / ( MM_TO_IU_SCALING_FACTOR / 1000.0 );
|
return kicadDist / ( MM_PER_IU / 1000.0 );
|
||||||
|
|
||||||
// nanometers to mils
|
// nanometers to mils
|
||||||
// return kicadDist/MILS_TO_IU_SCALING_FACTOR;
|
// return kicadDist/MILS_PER_IU;
|
||||||
|
|
||||||
#else
|
#else
|
||||||
// deci-mils to mils.
|
// deci-mils to mils.
|
||||||
|
@ -185,7 +185,7 @@ static inline double scale( int kicadDist )
|
||||||
/// Convert integer internal units to float um
|
/// Convert integer internal units to float um
|
||||||
static inline double IU2um( int kicadDist )
|
static inline double IU2um( int kicadDist )
|
||||||
{
|
{
|
||||||
return kicadDist * (1000.0 / MM_TO_IU_SCALING_FACTOR);
|
return kicadDist * (1000.0 / MM_PER_IU);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -67,7 +67,7 @@ void FOOTPRINT_EDIT_FRAME::RedrawActiveWindow( wxDC* DC, bool EraseBg )
|
||||||
GRSetDrawMode( DC, GR_COPY );
|
GRSetDrawMode( DC, GR_COPY );
|
||||||
|
|
||||||
m_canvas->DrawBackGround( DC );
|
m_canvas->DrawBackGround( DC );
|
||||||
TraceWorkSheet( DC, screen, 0, MILS_TO_IU_SCALING_FACTOR );
|
TraceWorkSheet( DC, screen, 0, MILS_PER_IU );
|
||||||
|
|
||||||
// Redraw the footprints
|
// Redraw the footprints
|
||||||
for( MODULE* module = GetBoard()->m_Modules; module; module = module->Next() )
|
for( MODULE* module = GetBoard()->m_Modules; module; module = module->Next() )
|
||||||
|
@ -105,7 +105,7 @@ void PCB_EDIT_FRAME::RedrawActiveWindow( wxDC* DC, bool EraseBg )
|
||||||
|
|
||||||
m_canvas->DrawBackGround( DC );
|
m_canvas->DrawBackGround( DC );
|
||||||
|
|
||||||
TraceWorkSheet( DC, GetScreen(), g_DrawDefaultLineThickness, MILS_TO_IU_SCALING_FACTOR );
|
TraceWorkSheet( DC, GetScreen(), g_DrawDefaultLineThickness, MILS_PER_IU );
|
||||||
|
|
||||||
GetBoard()->Draw( m_canvas, DC, GR_OR | GR_ALLOW_HIGHCONTRAST);
|
GetBoard()->Draw( m_canvas, DC, GR_OR | GR_ALLOW_HIGHCONTRAST);
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue