Commit 3f8343b3 authored by Carl Poirier's avatar Carl Poirier Committed by Dick Hollenbeck

REMOVE: USE_PCBNEW_NANOMETERS by making it the only way to go in pcbnew,...

REMOVE: USE_PCBNEW_NANOMETERS by making it the only way to go in pcbnew, effectively removing the deci-mils build.
parent 4c6f7bc1
...@@ -14,9 +14,6 @@ set(CMAKE_MODULE_PATH ${PROJECT_SOURCE_DIR}/CMakeModules) ...@@ -14,9 +14,6 @@ set(CMAKE_MODULE_PATH ${PROJECT_SOURCE_DIR}/CMakeModules)
# reports. # reports.
# #
option(USE_PCBNEW_NANOMETRES
"Use nanometers for Pcbnew internal units instead of deci-mils (default ON)." ON)
# Russian GOST patch # Russian GOST patch
option(wxUSE_UNICODE "enable/disable building unicode (default OFF)") option(wxUSE_UNICODE "enable/disable building unicode (default OFF)")
option(KICAD_GOST "enable/disable building using GOST notation for multiple gates per package (default OFF)") option(KICAD_GOST "enable/disable building using GOST notation for multiple gates per package (default OFF)")
......
...@@ -75,15 +75,8 @@ ...@@ -75,15 +75,8 @@
#cmakedefine USE_IMAGES_IN_MENUS 1 #cmakedefine USE_IMAGES_IN_MENUS 1
/// Definitions to enable the s-expression file formats and nanometer units.
#cmakedefine USE_PCBNEW_NANOMETRES
/// The legacy file format revision of the *.brd file created by this build /// The legacy file format revision of the *.brd file created by this build
#if defined(USE_PCBNEW_NANOMETRES)
#define LEGACY_BOARD_FILE_VERSION 2 #define LEGACY_BOARD_FILE_VERSION 2
#else
#define LEGACY_BOARD_FILE_VERSION 1
#endif
/// Definition to compile with Pcbnew footprint library table implementation. /// Definition to compile with Pcbnew footprint library table implementation.
#cmakedefine USE_FP_LIB_TABLE #cmakedefine USE_FP_LIB_TABLE
......
...@@ -111,10 +111,6 @@ This option is used to enable or disable building KiCad with images in menu ...@@ -111,10 +111,6 @@ This option is used to enable or disable building KiCad with images in menu
items. If this is not defined when CMake is used to create the build files, items. If this is not defined when CMake is used to create the build files,
images will be included in menu items on all platforms except OSX. images will be included in menu items on all platforms except OSX.
USE_PCBNEW_NANOMETRES (ON/OFF)
This option is used to enable or disable the nano-meter internal units for
Pcbnew. The default is ON.
KICAD_GOST (ON/OFF) KICAD_GOST (ON/OFF)
------------------- -------------------
This option is used to enable or disable the GOST notation for multiple gates This option is used to enable or disable the GOST notation for multiple gates
......
...@@ -25,10 +25,10 @@ Contribute to KiCad (under Linux) ...@@ -25,10 +25,10 @@ Contribute to KiCad (under Linux)
6) Compile: 6) Compile:
cd kicad_john cd kicad_john
mkdir build; cd build mkdir build; cd build
cmake ../ -DKICAD_TESTING_VERSION=ON -DCMAKE_BUILD_TYPE=Debug cmake ../ -DCMAKE_BUILD_TYPE=Debug
to build a debug version to build a debug version
or or
cmake ../ -DKICAD_TESTING_VERSION=ON -DCMAKE_BUILD_TYPE=Release cmake ../ -DCMAKE_BUILD_TYPE=Release
to build a release version to build a release version
make make
......
...@@ -502,13 +502,6 @@ void EDA_BASE_FRAME::CopyVersionInfoToClipboard( wxCommandEvent& event ) ...@@ -502,13 +502,6 @@ void EDA_BASE_FRAME::CopyVersionInfoToClipboard( wxCommandEvent& event )
tmp << wxT( "Boost version: " ) << ( BOOST_VERSION / 100000 ) << wxT( "." ) tmp << wxT( "Boost version: " ) << ( BOOST_VERSION / 100000 ) << wxT( "." )
<< ( BOOST_VERSION / 100 % 1000 ) << wxT( "." ) << ( BOOST_VERSION % 100 ) << wxT( "\n" ); << ( BOOST_VERSION / 100 % 1000 ) << wxT( "." ) << ( BOOST_VERSION % 100 ) << wxT( "\n" );
tmp << wxT( "Options: USE_PCBNEW_NANOMETRES=" );
#ifdef USE_PCBNEW_NANOMETRES
tmp << wxT( "ON\n" );
#else
tmp << wxT( "OFF\n" );
#endif
tmp << wxT( " USE_WX_GRAPHICS_CONTEXT=" ); tmp << wxT( " USE_WX_GRAPHICS_CONTEXT=" );
#ifdef USE_WX_GRAPHICS_CONTEXT #ifdef USE_WX_GRAPHICS_CONTEXT
tmp << wxT( "ON\n" ); tmp << wxT( "ON\n" );
......
...@@ -755,7 +755,6 @@ void EDA_DRAW_FRAME::AdjustScrollBars( const wxPoint& aCenterPositionIU ) ...@@ -755,7 +755,6 @@ void EDA_DRAW_FRAME::AdjustScrollBars( const wxPoint& aCenterPositionIU )
DBOX clientRectIU( xIU, yIU, clientSizeIU.x, clientSizeIU.y ); DBOX clientRectIU( xIU, yIU, clientSizeIU.x, clientSizeIU.y );
wxPoint centerPositionIU; wxPoint centerPositionIU;
#if 1 || defined( USE_PCBNEW_NANOMETRES )
// put "int" limits on the clientRect // put "int" limits on the clientRect
if( clientRectIU.GetLeft() < VIRT_MIN ) if( clientRectIU.GetLeft() < VIRT_MIN )
clientRectIU.MoveLeftTo( VIRT_MIN ); clientRectIU.MoveLeftTo( VIRT_MIN );
...@@ -765,7 +764,6 @@ void EDA_DRAW_FRAME::AdjustScrollBars( const wxPoint& aCenterPositionIU ) ...@@ -765,7 +764,6 @@ void EDA_DRAW_FRAME::AdjustScrollBars( const wxPoint& aCenterPositionIU )
clientRectIU.MoveRightTo( VIRT_MAX ); clientRectIU.MoveRightTo( VIRT_MAX );
if( clientRectIU.GetBottom() > VIRT_MAX ) if( clientRectIU.GetBottom() > VIRT_MAX )
clientRectIU.MoveBottomTo( VIRT_MAX ); clientRectIU.MoveBottomTo( VIRT_MAX );
#endif
centerPositionIU.x = KiROUND( clientRectIU.x + clientRectIU.width/2 ); centerPositionIU.x = KiROUND( clientRectIU.x + clientRectIU.width/2 );
centerPositionIU.y = KiROUND( clientRectIU.y + clientRectIU.height/2 ); centerPositionIU.y = KiROUND( clientRectIU.y + clientRectIU.height/2 );
...@@ -838,11 +836,9 @@ void EDA_DRAW_FRAME::AdjustScrollBars( const wxPoint& aCenterPositionIU ) ...@@ -838,11 +836,9 @@ void EDA_DRAW_FRAME::AdjustScrollBars( const wxPoint& aCenterPositionIU )
} }
} }
#if 1 || defined( USE_PCBNEW_NANOMETRES )
// put "int" limits on the virtualSizeIU // put "int" limits on the virtualSizeIU
virtualSizeIU.x = std::min( virtualSizeIU.x, MAX_AXIS ); virtualSizeIU.x = std::min( virtualSizeIU.x, MAX_AXIS );
virtualSizeIU.y = std::min( virtualSizeIU.y, MAX_AXIS ); virtualSizeIU.y = std::min( virtualSizeIU.y, MAX_AXIS );
#endif
if( screen->m_Center ) if( screen->m_Center )
{ {
......
...@@ -31,11 +31,10 @@ ...@@ -31,11 +31,10 @@
#ifndef _CONVERT_FROM_IU_ #ifndef _CONVERT_FROM_IU_
#define _CONVERT_FROM_IU_ #define _CONVERT_FROM_IU_
#include <config.h> // USE_PCBNEW_NANOMETRES is defined here #include <config.h>
/// Convert from internal units to user units. /// Convert from internal units to user units.
#if defined(PCBNEW) || defined(CVPCB) || defined(GERBVIEW) #if defined(PCBNEW) || defined(CVPCB) || defined(GERBVIEW)
#if defined( USE_PCBNEW_NANOMETRES )
#if defined(GERBVIEW) #if defined(GERBVIEW)
#define MM_PER_IU 1.0 / 1e5 // Gerbview uses 10 micrometer. #define MM_PER_IU 1.0 / 1e5 // Gerbview uses 10 micrometer.
#else #else
...@@ -43,32 +42,19 @@ ...@@ -43,32 +42,19 @@
#endif #endif
#define MILS_PER_IU ( MM_PER_IU * 0.0254 ) #define MILS_PER_IU ( MM_PER_IU * 0.0254 )
#define DECIMILS_PER_IU (MM_PER_IU * 0.00254 ) #define DECIMILS_PER_IU (MM_PER_IU * 0.00254 )
#else // Pcbnew in deci-mils.
#define DECIMILS_PER_IU 1
#define MILS_PER_IU 0.1
#define MM_PER_IU (25.4 / 1e4)
#endif
/// Convert PCBNEW internal units (iu) to mils. /// Convert PCBNEW internal units (iu) to mils.
inline int Iu2Mils( int iu ) inline int Iu2Mils( int iu )
{ {
#if defined( USE_PCBNEW_NANOMETRES )
double x = iu * MILS_PER_IU; double x = iu * MILS_PER_IU;
return int( x < 0 ? x - 0.5 : x + 0.5 ); return int( x < 0 ? x - 0.5 : x + 0.5 );
#else
return iu * MILS_PER_IU;
#endif
} }
/// Convert PCBNEW internal units (iu) to deci-mils. /// Convert PCBNEW internal units (iu) to deci-mils.
inline int Iu2DMils( int iu ) inline int Iu2DMils( int iu )
{ {
#if defined( USE_PCBNEW_NANOMETRES )
double x = iu * DECIMILS_PER_IU; double x = iu * DECIMILS_PER_IU;
return int( x < 0 ? x - 0.5 : x + 0.5 ); return int( x < 0 ? x - 0.5 : x + 0.5 );
#else
return iu;
#endif
} }
#else // Eeschema and anything else. #else // Eeschema and anything else.
......
#ifndef CONVERT_TO_BIU_H_ #ifndef CONVERT_TO_BIU_H_
#define CONVERT_TO_BIU_H_ #define CONVERT_TO_BIU_H_
#include <config.h> // USE_PCBNEW_NANOMETRES is defined here #include <config.h>
/** /**
* @file convert_to_biu.h * @file convert_to_biu.h
...@@ -18,7 +18,6 @@ ...@@ -18,7 +18,6 @@
/// Scaling factor to convert mils to internal units. /// Scaling factor to convert mils to internal units.
#if defined(PCBNEW) || defined(CVPCB) || defined(GERBVIEW) #if defined(PCBNEW) || defined(CVPCB) || defined(GERBVIEW)
#if defined( USE_PCBNEW_NANOMETRES )
#if defined(GERBVIEW) #if defined(GERBVIEW)
#define IU_PER_MM 1e5 // Gerbview IU is 10 nanometers. #define IU_PER_MM 1e5 // Gerbview IU is 10 nanometers.
#else #else
...@@ -27,32 +26,18 @@ ...@@ -27,32 +26,18 @@
#define IU_PER_MILS (IU_PER_MM * 0.0254) #define IU_PER_MILS (IU_PER_MM * 0.0254)
#define IU_PER_DECIMILS (IU_PER_MM * 0.00254) #define IU_PER_DECIMILS (IU_PER_MM * 0.00254)
#else // Pcbnew compiled for deci-mils.
#define IU_PER_DECIMILS 1
#define IU_PER_MILS 10.0
#define IU_PER_MM (1e4 / 25.4)
#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 )
double x = mils * IU_PER_MILS; double x = mils * IU_PER_MILS;
return int( x < 0 ? x - 0.5 : x + 0.5 ); return int( x < 0 ? x - 0.5 : x + 0.5 );
#else
return mils * IU_PER_MILS;
#endif
} }
/// Convert deci-mils to PCBNEW internal units (iu). /// Convert deci-mils to PCBNEW internal units (iu).
inline int DMils2iu( int dmils ) inline int DMils2iu( int dmils )
{ {
#if defined( USE_PCBNEW_NANOMETRES )
double x = dmils * IU_PER_DECIMILS; double x = dmils * IU_PER_DECIMILS;
return int( x < 0 ? x - 0.5 : x + 0.5 ); return int( x < 0 ? x - 0.5 : x + 0.5 );
#else
return dmils;
#endif
} }
#elif defined (PL_EDITOR) #elif defined (PL_EDITOR)
......
...@@ -270,10 +270,6 @@ if (KICAD_SCRIPTING OR KICAD_SCRIPTING_MODULES) ...@@ -270,10 +270,6 @@ if (KICAD_SCRIPTING OR KICAD_SCRIPTING_MODULES)
set( SWIG_FLAGS ${SWIG_FLAGS} -D${d} ) set( SWIG_FLAGS ${SWIG_FLAGS} -D${d} )
endforeach() endforeach()
if( USE_PCBNEW_NANOMETRES )
set( SWIG_FLAGS ${SWIG_FLAGS} -DUSE_PCBNEW_NANOMETRES )
endif( USE_PCBNEW_NANOMETRES )
endif(KICAD_SCRIPTING OR KICAD_SCRIPTING_MODULES) endif(KICAD_SCRIPTING OR KICAD_SCRIPTING_MODULES)
......
...@@ -618,7 +618,6 @@ void PCB_BASE_FRAME::UpdateStatusBar() ...@@ -618,7 +618,6 @@ void PCB_BASE_FRAME::UpdateStatusBar()
switch( g_UserUnit ) switch( g_UserUnit )
{ {
#if defined( USE_PCBNEW_NANOMETRES )
case INCHES: case INCHES:
absformatter = wxT( "X %.6f Y %.6f" ); absformatter = wxT( "X %.6f Y %.6f" );
locformatter = wxT( "dx %.6f dy %.6f d %.6f" ); locformatter = wxT( "dx %.6f dy %.6f d %.6f" );
...@@ -628,19 +627,6 @@ void PCB_BASE_FRAME::UpdateStatusBar() ...@@ -628,19 +627,6 @@ void PCB_BASE_FRAME::UpdateStatusBar()
absformatter = wxT( "X %.6f Y %.6f" ); absformatter = wxT( "X %.6f Y %.6f" );
locformatter = wxT( "dx %.6f dy %.6f d %.6f" ); locformatter = wxT( "dx %.6f dy %.6f d %.6f" );
break; break;
#else
case INCHES:
absformatter = wxT( "X %.4f Y %.4f" );
locformatter = wxT( "dx %.4f dy %.4f d %.4f" );
break;
case MILLIMETRES:
dXpos = RoundTo0( dXpos, 1000.0 );
dYpos = RoundTo0( dYpos, 1000.0 );
absformatter = wxT( "X %.3f Y %.3f" );
locformatter = wxT( "dx %.3f dy %.3f d %.3f" );
break;
#endif
case UNSCALED_UNITS: case UNSCALED_UNITS:
absformatter = wxT( "X %f Y %f" ); absformatter = wxT( "X %f Y %f" );
...@@ -659,14 +645,6 @@ void PCB_BASE_FRAME::UpdateStatusBar() ...@@ -659,14 +645,6 @@ void PCB_BASE_FRAME::UpdateStatusBar()
dXpos = To_User_Unit( g_UserUnit, dx ); dXpos = To_User_Unit( g_UserUnit, dx );
dYpos = To_User_Unit( g_UserUnit, dy ); dYpos = To_User_Unit( g_UserUnit, dy );
#ifndef USE_PCBNEW_NANOMETRES
if ( g_UserUnit == MILLIMETRES )
{
dXpos = RoundTo0( dXpos, 1000.0 );
dYpos = RoundTo0( dYpos, 1000.0 );
}
#endif
// We already decided the formatter above // We already decided the formatter above
line.Printf( locformatter, dXpos, dYpos, hypot( dXpos, dYpos ) ); line.Printf( locformatter, dXpos, dYpos, hypot( dXpos, dYpos ) );
SetStatusText( line, 3 ); SetStatusText( line, 3 );
......
...@@ -88,7 +88,7 @@ wxString BOARD_ITEM::GetLayerName() const ...@@ -88,7 +88,7 @@ wxString BOARD_ITEM::GetLayerName() const
std::string BOARD_ITEM::FormatInternalUnits( int aValue ) std::string BOARD_ITEM::FormatInternalUnits( int aValue )
{ {
#if 1 // !defined( USE_PCBNEW_NANOMETRES ) #if 1
char buf[50]; char buf[50];
int len; int len;
......
...@@ -64,12 +64,9 @@ ...@@ -64,12 +64,9 @@
*/ */
static const double pcbZoomList[] = static const double pcbZoomList[] =
{ {
#if defined( USE_PCBNEW_NANOMETRES )
ZOOM_FACTOR( 0.1 ), ZOOM_FACTOR( 0.1 ),
ZOOM_FACTOR( 0.2 ), ZOOM_FACTOR( 0.2 ),
ZOOM_FACTOR( 0.3 ), ZOOM_FACTOR( 0.3 ),
#endif
ZOOM_FACTOR( 0.5 ), ZOOM_FACTOR( 0.5 ),
ZOOM_FACTOR( 1.0 ), ZOOM_FACTOR( 1.0 ),
ZOOM_FACTOR( 1.5 ), ZOOM_FACTOR( 1.5 ),
...@@ -129,13 +126,6 @@ static const double pcbZoomList[] = ...@@ -129,13 +126,6 @@ static const double pcbZoomList[] =
The largest ZOOM_FACTOR in above table is ZOOM_FACTOR( 300 ), which computes The largest ZOOM_FACTOR in above table is ZOOM_FACTOR( 300 ), which computes
out to 762000 just below 790885. out to 762000 just below 790885.
*/ */
#if !defined( USE_PCBNEW_NANOMETRES )
ZOOM_FACTOR( 500.0 ),
ZOOM_FACTOR( 1000.0 ),
ZOOM_FACTOR( 2000.0 )
#endif
}; };
......
...@@ -411,11 +411,7 @@ void LEGACY_PLUGIN::loadGENERAL() ...@@ -411,11 +411,7 @@ void LEGACY_PLUGIN::loadGENERAL()
if( !strcmp( data, "mm" ) ) if( !strcmp( data, "mm" ) )
{ {
#if defined( USE_PCBNEW_NANOMETRES )
diskToBiu = IU_PER_MM; diskToBiu = IU_PER_MM;
#else
THROW_IO_ERROR( _( "May not load millimeter *.brd file into 'Pcbnew compiled for deci-mils'" ) );
#endif
} }
} }
...@@ -2822,11 +2818,7 @@ void LEGACY_PLUGIN::init( PROPERTIES* aProperties ) ...@@ -2822,11 +2818,7 @@ void LEGACY_PLUGIN::init( PROPERTIES* aProperties )
m_props = aProperties; m_props = 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 )
biuToDisk = 1.0/IU_PER_MM; // BIUs are nanometers & file is mm biuToDisk = 1.0/IU_PER_MM; // BIUs are nanometers & file is mm
#else
biuToDisk = 1.0; // BIUs are deci-mils
#endif
// Conversion factor for loading KICAD legacy file format into BIUs in RAM // Conversion factor for loading KICAD legacy file format into BIUs in RAM
// Start by assuming the *.brd file is in deci-mils. // Start by assuming the *.brd file is in deci-mils.
...@@ -2835,8 +2827,7 @@ void LEGACY_PLUGIN::init( PROPERTIES* aProperties ) ...@@ -2835,8 +2827,7 @@ void LEGACY_PLUGIN::init( PROPERTIES* aProperties )
// mm to nanometers. The deci-mil legacy files have no such "Units" marker // mm to nanometers. The deci-mil legacy files have no such "Units" marker
// so we must assume the file is in deci-mils until told otherwise. // so we must assume the file is in deci-mils until told otherwise.
diskToBiu = IU_PER_DECIMILS; // BIUs are nanometers if defined(USE_PCBNEW_NANOMETRES) diskToBiu = IU_PER_DECIMILS; // BIUs are nanometers
// else are deci-mils
} }
...@@ -2918,11 +2909,7 @@ void LEGACY_PLUGIN::saveGENERAL( const BOARD* aBoard ) const ...@@ -2918,11 +2909,7 @@ void LEGACY_PLUGIN::saveGENERAL( const BOARD* aBoard ) const
fprintf( m_fp, "encoding utf-8\n" ); fprintf( m_fp, "encoding utf-8\n" );
// tell folks the units used within the file, as early as possible here. // tell folks the units used within the file, as early as possible here.
#if defined( USE_PCBNEW_NANOMETRES )
fprintf( m_fp, "Units mm\n" ); fprintf( m_fp, "Units mm\n" );
#else
fprintf( m_fp, "Units deci-mils\n" );
#endif
// Write copper layer count // Write copper layer count
fprintf( m_fp, "LayerCount %d\n", aBoard->GetCopperLayerCount() ); fprintf( m_fp, "LayerCount %d\n", aBoard->GetCopperLayerCount() );
...@@ -3991,11 +3978,7 @@ void FPL_CACHE::ReadAndVerifyHeader( LINE_READER* aReader ) ...@@ -3991,11 +3978,7 @@ void FPL_CACHE::ReadAndVerifyHeader( LINE_READER* aReader )
if( !strcmp( units, "mm" ) ) if( !strcmp( units, "mm" ) )
{ {
#if defined( USE_PCBNEW_NANOMETRES )
m_owner->diskToBiu = IU_PER_MM; m_owner->diskToBiu = IU_PER_MM;
#else
THROW_IO_ERROR( _( "May not load millimeter legacy library file into 'Pcbnew compiled for deci-mils'" ) );
#endif
} }
} }
...@@ -4191,11 +4174,7 @@ void FPL_CACHE::SaveHeader( FILE* aFile ) ...@@ -4191,11 +4174,7 @@ void FPL_CACHE::SaveHeader( FILE* aFile )
{ {
fprintf( aFile, "%s %s\n", FOOTPRINT_LIBRARY_HEADER, TO_UTF8( DateAndTime() ) ); fprintf( aFile, "%s %s\n", FOOTPRINT_LIBRARY_HEADER, TO_UTF8( DateAndTime() ) );
fprintf( aFile, "# encoding utf-8\n" ); fprintf( aFile, "# encoding utf-8\n" );
#if defined( USE_PCBNEW_NANOMETRES )
fprintf( aFile, "Units mm\n" ); fprintf( aFile, "Units mm\n" );
#else
fprintf( aFile, "Units deci-mils\n" );
#endif
} }
......
...@@ -201,18 +201,12 @@ const KICAD_T SPECCTRA_DB::scanPADs[] = { PCB_PAD_T, EOT }; ...@@ -201,18 +201,12 @@ const KICAD_T SPECCTRA_DB::scanPADs[] = { PCB_PAD_T, EOT };
*/ */
static inline double scale( int kicadDist ) static inline double scale( int kicadDist )
{ {
#if defined(USE_PCBNEW_NANOMETRES)
// nanometers to um // nanometers to um
return kicadDist / ( IU_PER_MM / 1000.0 ); return kicadDist / ( IU_PER_MM / 1000.0 );
// nanometers to mils // nanometers to mils
// return kicadDist/IU_PER_MILS; // return kicadDist/IU_PER_MILS;
#else
// deci-mils to mils.
return kicadDist / 10.0;
#endif
} }
...@@ -1356,7 +1350,7 @@ void SPECCTRA_DB::FromBOARD( BOARD* aBoard ) throw( IO_ERROR ) ...@@ -1356,7 +1350,7 @@ void SPECCTRA_DB::FromBOARD( BOARD* aBoard ) throw( IO_ERROR )
//-----<unit_descriptor> & <resolution_descriptor>-------------------- //-----<unit_descriptor> & <resolution_descriptor>--------------------
{ {
#if defined(USE_PCBNEW_NANOMETRES)
// tell freerouter to use "tenths of micrometers", // tell freerouter to use "tenths of micrometers",
// which is 100 nm resolution. Possibly more resolution is possible // which is 100 nm resolution. Possibly more resolution is possible
// in freerouter, but it would need testing. // in freerouter, but it would need testing.
...@@ -1365,18 +1359,6 @@ void SPECCTRA_DB::FromBOARD( BOARD* aBoard ) throw( IO_ERROR ) ...@@ -1365,18 +1359,6 @@ void SPECCTRA_DB::FromBOARD( BOARD* aBoard ) throw( IO_ERROR )
pcb->resolution->units = T_um; pcb->resolution->units = T_um;
pcb->resolution->value = 10; // tenths of a um pcb->resolution->value = 10; // tenths of a um
// pcb->resolution->value = 1000; // "thousandths of a um" (i.e. "nm") // pcb->resolution->value = 1000; // "thousandths of a um" (i.e. "nm")
#else
pcb->unit->units = T_mil;
pcb->resolution->units = T_mil;
// Kicad only supports 1/10th of mil internal coordinates. So to avoid
// having the router give us back 1/100th of mil coordinates which we
// will have to round and thereby cause error, we declare our maximum
// resolution precisely at 1/10th for now. For more on this, see:
// http://www.freerouting.net/usren/viewtopic.php?f=3&t=354
pcb->resolution->value = 10;
#endif
} }
//-----<boundary_descriptor>------------------------------------------ //-----<boundary_descriptor>------------------------------------------
......
...@@ -147,8 +147,6 @@ static int scale( double distance, UNIT_RES* aResolution ) ...@@ -147,8 +147,6 @@ static int scale( double distance, UNIT_RES* aResolution )
double resValue = aResolution->GetValue(); double resValue = aResolution->GetValue();
double factor; double factor;
#if defined(USE_PCBNEW_NANOMETRES)
switch( aResolution->GetEngUnits() ) switch( aResolution->GetEngUnits() )
{ {
default: default:
...@@ -171,36 +169,6 @@ static int scale( double distance, UNIT_RES* aResolution ) ...@@ -171,36 +169,6 @@ static int scale( double distance, UNIT_RES* aResolution )
int ret = KiROUND( factor * distance / resValue ); int ret = KiROUND( factor * distance / resValue );
#else
switch( aResolution->GetEngUnits() )
{
default:
case T_inch:
factor = 1000.0;
break;
case T_mil:
factor = 1.0;
break;
case T_cm:
factor = 1000.0/2.54;
break;
case T_mm:
factor = 1000.0/25.4;
break;
case T_um:
factor = 1.0/25.4;
break;
}
// the factor of 10.0 is used to convert mils to deci-mils, the units
// used within KiCad.
factor *= 10.0;
int ret = KiROUND( factor * distance / resValue );
#endif
return ret; return ret;
} }
......
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