Browse Source
Code cleanup: Remove outdated decimils to/from iu defines and conversion functions (decimils are no more in use since a long time).
Code cleanup: Remove outdated decimils to/from iu defines and conversion functions (decimils are no more in use since a long time).
Remove convert_from_iu.h file, only used for one define, and containing brokenand duplicate defines. Only convert_to_biu.h is now used.pull/3/merge
33 changed files with 133 additions and 247 deletions
-
53common/wxunittext.cpp
-
4eeschema/libedit_plot_component.cpp
-
3eeschema/plot_schematic_DXF.cpp
-
3eeschema/plot_schematic_HPGL.cpp
-
3eeschema/plot_schematic_PDF.cpp
-
3eeschema/plot_schematic_PS.cpp
-
3eeschema/plot_schematic_SVG.cpp
-
66gerbview/class_gbr_screen.cpp
-
2gerbview/class_gbr_screen.h
-
69include/convert_from_iu.h
-
43include/convert_to_biu.h
-
2pcbnew/basepcbframe.cpp
-
2pcbnew/class_board_design_settings.cpp
-
2pcbnew/class_dimension.cpp
-
2pcbnew/class_marker_pcb.cpp
-
8pcbnew/class_pad.cpp
-
6pcbnew/classpcb.cpp
-
2pcbnew/dialogs/dialog_SVG_print.cpp
-
2pcbnew/dialogs/dialog_export_idf.cpp
-
2pcbnew/exporters/export_d356.cpp
-
13pcbnew/exporters/export_gencad.cpp
-
1pcbnew/exporters/export_idf.cpp
-
2pcbnew/exporters/export_vrml.cpp
-
10pcbnew/exporters/gen_drill_report_files.cpp
-
2pcbnew/import_dxf/dialog_dxf_import.cpp
-
1pcbnew/import_dxf/dxf2brd_items.cpp
-
2pcbnew/kicad_plugin.cpp
-
24pcbnew/legacy_plugin.cpp
-
31pcbnew/pcb_parser.cpp
-
2pcbnew/pcbframe.cpp
-
8pcbnew/pcbnew.h
-
2pcbnew/plot_board_layers.cpp
-
2scripting/kicad.i
@ -1,69 +0,0 @@ |
|||
/* |
|||
* This program source code file is part of KiCad, a free EDA CAD application. |
|||
* |
|||
* Copyright (C) 2012 CERN |
|||
* |
|||
* This program is free software; you can redistribute it and/or |
|||
* modify it under the terms of the GNU General Public License |
|||
* as published by the Free Software Foundation; either version 2 |
|||
* of the License, or (at your option) any later version. |
|||
* |
|||
* This program is distributed in the hope that it will be useful, |
|||
* but WITHOUT ANY WARRANTY; without even the implied warranty of |
|||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|||
* GNU General Public License for more details. |
|||
* |
|||
* You should have received a copy of the GNU General Public License |
|||
* along with this program; if not, you may find one here: |
|||
* 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 write to the Free Software Foundation, Inc., |
|||
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA |
|||
*/ |
|||
|
|||
/** |
|||
* @file convert_from_iu.h |
|||
* @brief Definitions and functions to convert from internal units to user units |
|||
* depending upon the application and/or build options. |
|||
*/ |
|||
|
|||
|
|||
#ifndef _CONVERT_FROM_IU_ |
|||
#define _CONVERT_FROM_IU_ |
|||
|
|||
|
|||
/// Convert from internal units to user units. |
|||
#if defined(PCBNEW) || defined(CVPCB) || defined(GERBVIEW) |
|||
#if defined(GERBVIEW) |
|||
#define MM_PER_IU 1.0 / 1e5 // Gerbview uses 10 micrometer. |
|||
#else |
|||
#define MM_PER_IU 1.0 / 1e6 // Pcbnew in nanometers. |
|||
#endif |
|||
#define MILS_PER_IU ( MM_PER_IU * 0.0254 ) |
|||
#define DECIMILS_PER_IU (MM_PER_IU * 0.00254 ) |
|||
|
|||
/// Convert PCBNEW internal units (iu) to mils. |
|||
inline int Iu2Mils( int iu ) |
|||
{ |
|||
double x = iu * MILS_PER_IU; |
|||
return int( x < 0 ? x - 0.5 : x + 0.5 ); |
|||
} |
|||
|
|||
/// Convert PCBNEW internal units (iu) to deci-mils. |
|||
inline int Iu2DMils( int iu ) |
|||
{ |
|||
double x = iu * DECIMILS_PER_IU; |
|||
return int( x < 0 ? x - 0.5 : x + 0.5 ); |
|||
} |
|||
|
|||
#else // Eeschema and anything else. |
|||
#define MILS_PER_IU 1.0 |
|||
#define MM_PER_IU (MILS_PER_IU / 0.0254) |
|||
|
|||
inline int Iu2Mils( int iu ) |
|||
{ |
|||
return iu; |
|||
} |
|||
#endif |
|||
|
|||
#endif // #define _CONVERT_FROM_IU_ |
|||
Write
Preview
Loading…
Cancel
Save
Reference in new issue