* Update from TIP

This commit is contained in:
Brian Sidebotham 2014-08-02 22:25:05 +01:00
commit dbd4ba8469
85 changed files with 1481 additions and 824 deletions

View File

@ -1,5 +1,6 @@
boost_root
.downloads-by-cmake
Build
common/netlist_keywords.*
common/netlist_lexer.h
common/pcb_plot_params_lexer.h

View File

@ -84,7 +84,7 @@ public:
GLuint DisplayCubeforTest(); // Just a test function
void SetView3D( int keycode );
void DisplayStatus();
void Redraw( bool finish = false );
void Redraw();
void Render();
/**

View File

@ -52,8 +52,15 @@ void S3D_MATERIAL::SetMaterial()
#if 0
glColorMaterial( GL_FRONT_AND_BACK, GL_SPECULAR );
glColor3f( m_SpecularColor.x, m_SpecularColor.y, m_SpecularColor.z );
#endif
glColorMaterial( GL_FRONT_AND_BACK, GL_AMBIENT_AND_DIFFUSE );
#endif
}
void S3D_MASTER::Insert( S3D_MATERIAL* aMaterial )
{
aMaterial->SetNext( m_Materials );
m_Materials = aMaterial;
}

View File

@ -50,7 +50,6 @@
#include <3d_draw_basic_functions.h>
// Imported function:
extern void Set_Object_Data( std::vector<S3D_VERTEX>& aVertices, double aBiuTo3DUnits );
extern void CheckGLError();
/* returns true if aLayer should be displayed, false otherwise
@ -99,7 +98,7 @@ static void BuildPadShapeThickOutlineAsPolygon( D_PAD* aPad,
}
void EDA_3D_CANVAS::Redraw( bool finish )
void EDA_3D_CANVAS::Redraw()
{
// SwapBuffer requires the window to be shown before calling
if( !IsShown() )
@ -139,11 +138,6 @@ void EDA_3D_CANVAS::Redraw( bool finish )
else
CreateDrawGL_List();
glFlush();
if( finish )
glFinish();
SwapBuffers();
}
@ -593,8 +587,11 @@ void EDA_3D_CANVAS::BuildBoard3DView()
}
// draw modules 3D shapes
for( MODULE* module = pcb->m_Modules; module != NULL; module = module->Next() )
module->ReadAndInsert3DComponentShape( this );
if( g_Parm_3D_Visu.GetFlag( FL_MODULE ) )
{
for( MODULE* module = pcb->m_Modules; module; module = module->Next() )
module->ReadAndInsert3DComponentShape( this );
}
}
@ -831,41 +828,32 @@ void EDA_3D_CANVAS::Draw3DViaHole( SEGVIA* aVia )
void MODULE::ReadAndInsert3DComponentShape( EDA_3D_CANVAS* glcanvas )
{
// Draw module shape: 3D shape if exists (or module outlines if not exists)
S3D_MASTER* struct3D = m_3D_Drawings;
// Read from disk and draws the footprint 3D shapes if exists
S3D_MASTER* shape3D = m_3D_Drawings;
double zpos = g_Parm_3D_Visu.GetModulesZcoord3DIU( IsFlipped() );
if( g_Parm_3D_Visu.GetFlag( FL_MODULE ) )
glPushMatrix();
glTranslatef( m_Pos.x * g_Parm_3D_Visu.m_BiuTo3Dunits,
-m_Pos.y * g_Parm_3D_Visu.m_BiuTo3Dunits,
zpos );
if( m_Orient )
glRotatef( (double) m_Orient / 10, 0.0, 0.0, 1.0 );
if( IsFlipped() )
{
double zpos;
if( IsFlipped() )
zpos = g_Parm_3D_Visu.GetModulesZcoord3DIU( true );
else
zpos = g_Parm_3D_Visu.GetModulesZcoord3DIU( false );
glPushMatrix();
glTranslatef( m_Pos.x * g_Parm_3D_Visu.m_BiuTo3Dunits,
-m_Pos.y * g_Parm_3D_Visu.m_BiuTo3Dunits,
zpos );
if( m_Orient )
glRotatef( (double) m_Orient / 10, 0.0, 0.0, 1.0 );
if( IsFlipped() )
{
glRotatef( 180.0, 0.0, 1.0, 0.0 );
glRotatef( 180.0, 0.0, 0.0, 1.0 );
}
for( ; struct3D != NULL; struct3D = struct3D->Next() )
{
if( struct3D->Is3DType( S3D_MASTER::FILE3D_VRML ) )
struct3D->ReadData();
}
glPopMatrix();
glRotatef( 180.0, 0.0, 1.0, 0.0 );
glRotatef( 180.0, 0.0, 0.0, 1.0 );
}
for( ; shape3D != NULL; shape3D = shape3D->Next() )
{
if( shape3D->Is3DType( S3D_MASTER::FILE3D_VRML ) )
shape3D->ReadData();
}
glPopMatrix();
}

View File

@ -38,9 +38,6 @@
#include "3d_struct.h"
#include "modelparsers.h"
// Imported function:
extern void Set_Object_Data( std::vector< S3D_VERTEX >& aVertices, double aBiuTo3DUnits );
S3D_MODEL_PARSER* S3D_MODEL_PARSER::Create( S3D_MASTER* aMaster,
const wxString aExtension )
@ -96,9 +93,7 @@ const wxString S3D_MASTER::GetShape3DFullFilename()
int S3D_MASTER::ReadData()
{
if( m_Shape3DName.IsEmpty() )
{
return 1;
}
wxString filename = GetShape3DFullFilename();
@ -135,15 +130,3 @@ int S3D_MASTER::ReadData()
return -1;
}
int STRUCT_3D_SHAPE::ReadData( FILE* file, int* LineNum )
{
char line[512];
while( GetLine( file, line, LineNum, 512 ) )
{
}
return -1;
}

View File

@ -117,12 +117,7 @@ public:
S3D_MASTER* Next() const { return (S3D_MASTER*) Pnext; }
S3D_MASTER* Back() const { return (S3D_MASTER*) Pback; }
void Insert( S3D_MATERIAL* aMaterial )
{
aMaterial->SetNext( m_Materials );
m_Materials = aMaterial;
}
void Insert( S3D_MATERIAL* aMaterial );
void Copy( S3D_MASTER* pattern );
int ReadData();
@ -171,8 +166,6 @@ public:
STRUCT_3D_SHAPE* Next() const { return (STRUCT_3D_SHAPE*) Pnext; }
STRUCT_3D_SHAPE* Back() const { return (STRUCT_3D_SHAPE*) Pback; }
int ReadData( FILE* file, int* LineNum );
#if defined(DEBUG)
void Show( int nestLevel, std::ostream& os ) const { ShowDummy( os ); } // override
#endif

View File

@ -88,8 +88,8 @@ void INFO3D_VISU::InitSettings( BOARD* aBoard )
if( bbbox.GetWidth() == 0 && bbbox.GetHeight() == 0 )
{
bbbox.SetWidth( 100 * IU_PER_MM );
bbbox.SetHeight( 100 * IU_PER_MM );
bbbox.SetWidth( Millimeter2iu( 100 ) );
bbbox.SetHeight( Millimeter2iu( 100 ) );
}
m_BoardSettings = &aBoard->GetDesignSettings();
@ -131,6 +131,7 @@ void INFO3D_VISU::InitSettings( BOARD* aBoard )
// Fill remaining unused copper layers and front layer zpos
// with m_EpoxyThickness
// Solder mask and Solder paste have the same Z position
for( ; layer <= LAST_COPPER_LAYER; layer++ )
{
m_LayerZcoord[layer] = m_EpoxyThickness;
@ -144,21 +145,21 @@ void INFO3D_VISU::InitSettings( BOARD* aBoard )
switch( layer_id )
{
case ADHESIVE_N_BACK:
zpos = zpos_copper_back - 4 * zpos_offset;
break;
case ADHESIVE_N_FRONT:
zpos = zpos_copper_front + 4 * zpos_offset;
break;
case SOLDERPASTE_N_BACK:
zpos = zpos_copper_back - 3 * zpos_offset;
break;
case SOLDERPASTE_N_FRONT:
case ADHESIVE_N_FRONT:
zpos = zpos_copper_front + 3 * zpos_offset;
break;
case SOLDERPASTE_N_BACK:
zpos = zpos_copper_back - 1 * zpos_offset;
break;
case SOLDERPASTE_N_FRONT:
zpos = zpos_copper_front + 1 * zpos_offset;
break;
case SOLDERMASK_N_BACK:
zpos = zpos_copper_back - 1 * zpos_offset;
break;
@ -177,7 +178,7 @@ void INFO3D_VISU::InitSettings( BOARD* aBoard )
default:
zpos = zpos_copper_front +
(layer_id - FIRST_NON_COPPER_LAYER + 5) * zpos_offset;
(layer_id - FIRST_NON_COPPER_LAYER + 4) * zpos_offset;
break;
}

View File

@ -148,9 +148,10 @@ public: INFO3D_VISU();
*/
int GetCopperThicknessBIU() const
{
bool use_copper_thickness = GetFlag( FL_USE_COPPER_THICKNESS ) ||
GetFlag( FL_USE_REALISTIC_MODE );
return use_copper_thickness ?
bool use_thickness = GetFlag( FL_USE_COPPER_THICKNESS )
// || GetFlag( FL_USE_REALISTIC_MODE )
;
return use_thickness ?
KiROUND( m_CopperThickness / m_BiuTo3Dunits )
: 0;
}
@ -173,9 +174,10 @@ public: INFO3D_VISU();
*/
int GetNonCopperLayerThicknessBIU() const
{
bool use_copper_thickness = GetFlag( FL_USE_COPPER_THICKNESS ) ||
GetFlag( FL_USE_REALISTIC_MODE );
return use_copper_thickness ?
bool use_thickness = GetFlag( FL_USE_COPPER_THICKNESS )
// || GetFlag( FL_USE_REALISTIC_MODE )
;
return use_thickness ?
KiROUND( m_NonCopperLayerThickness / m_BiuTo3Dunits )
: 0;
}

View File

@ -68,6 +68,8 @@ void VRML_MODEL_PARSER::Load( const wxString aFilename )
while( GetLine( file, line, &LineNum, 512 ) )
{
text = strtok( line, sep_chars );
if ( text == NULL )
continue;
if( stricmp( text, "DEF" ) == 0 || stricmp( text, "Group" ) == 0 )
{
@ -280,8 +282,6 @@ int VRML_MODEL_PARSER::readAppearance( FILE* file, int* LineNum )
}
#define BUFSIZE 2000
void VRML_MODEL_PARSER::readCoordsList( FILE* file, char* text_buffer,
std::vector< double >& aList, int* LineNum )
{
@ -371,6 +371,9 @@ int VRML_MODEL_PARSER::readGeometry( FILE* file, int* LineNum )
strcpy( buffer, line );
text = strtok( buffer, sep_chars );
if( text == NULL )
continue;
if( *text == '}' )
{
err = 0;
@ -381,7 +384,7 @@ int VRML_MODEL_PARSER::readGeometry( FILE* file, int* LineNum )
{
text = strtok( NULL, " ,\t\n\r" );
if( stricmp( text, "true" ) == 0 )
if( text && stricmp( text, "true" ) == 0 )
{
}
else
@ -395,7 +398,7 @@ int VRML_MODEL_PARSER::readGeometry( FILE* file, int* LineNum )
{
text = strtok( NULL, " ,\t\n\r" );
if( stricmp( text, "true" ) == 0 )
if( text && stricmp( text, "true" ) == 0 )
{
}
else

View File

@ -66,8 +66,6 @@ option( KICAD_BUILD_DYNAMIC
)
# WARNING: KiCad developers strongly advise you to build Boost with supplied patches,
# as it is known to work with KiCad. Other versions may contain bugs that may result
# WARNING: KiCad developers strongly advise you to build Boost with supplied patches,
# as it is known to work with KiCad. Other versions may contain bugs that may result
# in KiCad errors.
@ -100,9 +98,9 @@ set( DOWNLOAD_DIR ${PROJECT_SOURCE_DIR}/.downloads-by-cmake
LINK_DIRECTORIES( ${LINK_DIRECTORIES_PATH} )
if( UNIX )
set( KICAD_USER_CONFIG_DIR $ENV{HOME} CACHE PATH "Location of user specifig KiCad config files" )
set( KICAD_USER_CONFIG_DIR $ENV{HOME} CACHE PATH "Location of user specific KiCad config files" )
elseif( MINGW )
set( KICAD_USER_CONFIG_DIR $ENV{%APPDATA%} CACHE PATH "Location of user specifig KiCad config files" )
set( KICAD_USER_CONFIG_DIR $ENV{%APPDATA%} CACHE PATH "Location of user specific KiCad config files" )
endif()
mark_as_advanced( KICAD_USER_CONFIG_DIR )
@ -343,16 +341,17 @@ add_definitions(-DWX_COMPATIBILITY)
find_package( OpenGL QUIET )
check_find_package_result( OPENGL_FOUND "OpenGL" )
# Handle target used to specify if a target needs wx-widgets or other libraries
# Always defined, empty if no libraries are to be build
add_custom_target( lib-dependencies )
if( KICAD_BUILD_STATIC OR KICAD_BUILD_DYNAMIC )
add_custom_target( lib-wxpython )
# This should be build in all cases, if swig exec is not avaiable
# will be impossible also enable SCRIPTING being for PCBNEW required immediatly
include( download_pcre )
include( download_swig )
include( download_wxpython )
add_dependencies( lib-wxpython pcre )
add_dependencies( lib-wxpython swig )
add_dependencies( lib-wxpython libwxpython )
#set(CMAKE_FIND_LIBRARY_SUFFIXES ".a;.so;.dylib;.dll")
@ -372,15 +371,11 @@ add_custom_target( lib-wxpython )
message(STATUS "KICAD_BUILD_DYNAMIC set")
endif()
add_custom_target( lib-dependencies
DEPENDS boost cairo glew libpng pixman pkgconfig
)
include( download_libpng )
if( KICAD_SCRIPTING OR KICAD_SCRIPTING_WXPYTHON OR KICAD_SCRIPTING_MODULES )
message(STATUS "Scripting ENABLED")
include( download_wxpython )
set( SWIG_EXECUTABLE ${SWIG_ROOT}/bin/swig )
set( SWIG_INCLUDE ${SWIG_ROOT}/include )
@ -388,7 +383,7 @@ add_custom_target( lib-wxpython )
if( NOT EXISTS ${SWIG_EXECUTABLE} )
set(KICAD_SCRIPTING CACHE OFF FORCE "Disabling KICAD_SCRIPTING")
message( STATUS "KICAD_SCRIPTING Enabled but SWIG not found, please disable and before reenabling execute: make lib-wxpython")
message( STATUS "KICAD_SCRIPTING Enabled but SWIG not found, please disable and before reenabling execute: make swig")
message( FATAL_ERROR "Missing SWIG!")
endif()
message(STATUS "SWIG_EXECUTABLE: ${SWIG_EXECUTABLE}")
@ -401,11 +396,15 @@ add_custom_target( lib-wxpython )
set(wxWidgets_LIBRARY_DIRS ${LIBWXPYTHON_ROOT}/lib )
add_dependencies( lib-dependencies libwxpython )
add_dependencies( lib-dependencies swig )
else()
include( download_wxwidgets )
add_dependencies( lib-dependencies libwx )
endif()
include( download_libpng )
include( download_pkgconfig )
set( PKG_CONFIG_EXECUTABLE "${PKGCONFIG_ROOT}/bin/pkg-config" )
include( download_glew )
@ -417,6 +416,12 @@ add_custom_target( lib-wxpython )
set( CAIRO_INCLUDE_DIR "${CAIRO_ROOT}/include/cairo" )
set( CAIRO_LIBRARY "${CAIRO_ROOT}/lib/libcairo.a" )
add_dependencies( lib-dependencies boost )
add_dependencies( lib-dependencies cairo )
add_dependencies( lib-dependencies libpng )
add_dependencies( lib-dependencies pixman )
add_dependencies( lib-dependencies pkgconfig )
if( KICAD_BUILD_DYNAMIC AND APPLE )
add_custom_target( osx_fix_bundles ALL DEPENDS cvpcb eeschema gerbview kicad pcbnew bitmap2component pcb_calculator pl_editor)
add_custom_command(TARGET osx_fix_bundles POST_BUILD COMMAND scripts/osx_fixbundle.sh COMMENT "Migrating dylibs to bundles")
@ -623,17 +628,13 @@ if ( KICAD_BUILD_STATIC OR KICAD_BUILD_DYNAMIC )
add_dependencies( pcbnew lib-dependencies )
add_dependencies( eeschema lib-dependencies )
add_dependencies( cvpcb lib-dependencies )
add_dependencies( gal lib-dependencies )
add_dependencies( common lib-dependencies )
add_dependencies( gal lib-dependencies )
add_dependencies( pcbcommon lib-dependencies )
add_dependencies( 3d-viewer lib-dependencies )
add_dependencies( pcad2kicadpcb lib-dependencies )
add_dependencies( polygon lib-dependencies )
add_dependencies( pl_editor lib-dependencies )
add_dependencies( pnsrouter lib-dependencies )
if ( BUILD_GITHUB_PLUGIN )
add_dependencies( github_plugin lib-dependencies )
endif()
endif()
if ( KICAD_BUILD_DYNAMIC )

View File

@ -27,8 +27,6 @@
set( PCRE_RELEASE 8.34 )
set( PCRE_MD5 eb34b2c9c727fd64940d6fd9a00995eb ) # re-calc this on every RELEASE change
# The boost headers [and static libs if built] go here, at the top of KiCad
# source tree in boost_root.
set( PCRE_ROOT "${PROJECT_SOURCE_DIR}/pcre_root" )
#-----</configure>---------------------------------------------------------------
@ -45,10 +43,6 @@ if (APPLE)
endif( CMAKE_OSX_ARCHITECTURES )
endif(APPLE)
# There is a Bazaar 'boost scratch repo' in <SOURCE_DIR>/boost and after committing pristine
# download, the patch is applied. This lets you regenerate a new patch at any time
# easily, simply by editing the working tree in <SOURCE_DIR> and doing "bzr diff" in there.
ExternalProject_Add( pcre
PREFIX "${PREFIX}"
DOWNLOAD_DIR "${DOWNLOAD_DIR}"

View File

@ -11,32 +11,40 @@ Contribute to KiCad (under Linux)
2) initialize Bazaar:
bzr whoami "John Doe <john.doe@gmail.com>"
3) get LATEST KiCad source tree and name it, for instance, "kicad_john":
3) get latest KiCad source tree:
cd ~/
bzr branch lp:kicad kicad_john
bzr branch lp:kicad kicad.bzr
4) Read coding_style_policy.pdf, in <kicad_sources>/Documentation,
and other docs.
this should leave you with the folder kicad.bzr
5) Modify/add source code.
cd kicad_john
4) Read coding_style_policy.pdf, in kicad.bzr/Documentation,
and other docs.
5) create a local (branch) copy of the KiCad project
bzr branch ./kicad.bzr ./kicad.my_contrib
6) Modify/add source code in
cd kicad.my_contrib
gedit .......
if you need to create and add the file foo.cpp do so and:
bzr add foo.cpp
if you need to delete files:
bzr rm foo.cpp
6) Compile:
cd kicad_john
7) Compile:
cd kicad.my_contrib
mkdir build; cd build
cmake ../ -DCMAKE_BUILD_TYPE=Debug
to build a debug version
or
to build a debug version
or
cmake ../ -DCMAKE_BUILD_TYPE=Release
to build a release version
make
to build a release version
make -j8
7) Repeat step 5 and 6 until satisfied.
8) Repeat step 6 and 7 until satisfied.
8) Create a patch:
in kicad_john:
if some files are added: bzr add [FILE...]
9) Create a patch file:
cd kicad.my_contrib
bzr diff > my_changes.patch
9) Send the patch file "my_changes.patch" to the KiCad developers mailing list.

View File

@ -212,4 +212,5 @@ Make the Debug binaries:
make
See ./cmake_config.txt for customizing the KiCad build setting.
See Documentation/compiling/build-config.txt for a list of all CMake options
available when compiling KiCad.

View File

@ -1,5 +1,6 @@
Bazaar
------
======
KiCad uses the Bazaar version control system to track source code changes,
and download the boost libraries needed by Kicad.
The easiest way to get a copy of the KiCad source is to use Bazaar.
@ -11,7 +12,8 @@ Be sure bzrtools is also installed.
boost libraries will be downloaded the first time you build Kicad.
CMake
-----
=====
KiCad uses CMake to generate the build files specific for the target platform
specified by the developer. This document attempts to define some of the more
common CMake and KiCad build configuration settings. You can use CMake either
@ -23,7 +25,8 @@ http://www.cmake.org/cmake/help/documentation.html.
Useful CMake Build Settings.
----------------------------
============================
This section defines some of the more common CMake build configuration setting
used when configuring KiCad. These settings are valid for all projects that
use CMake.
@ -39,14 +42,18 @@ switch on the command line. Please note, only a small subset of these project
generators are supported. If you want to use Eclipse on Linux to build KiCad,
you may be in for a lot of work.
CMAKE_BUILD_TYPE (Release/Debug/RelWithDebInfo/MinSizeRel)
----------------------------------------------------------
Default: Release
When configuring the KiCad build for the command line you must specify build
type. To create a debug build, set CMAKE_BUILD_TYPE to Debug. To create a
release build, set CMAKE_BUILD_TYPE to Release. See the CMake documentation
for other build types. For IDE project files, the build type can be selected
by the IDE configuration manager.
CMAKE_INSTALL_PATH (InstallPath)
--------------------------------
By default CMake will select the correct install path for your platform. If
@ -57,7 +64,8 @@ installed on your system.
wxWidgets Library Configuration.
--------------------------------
================================
KiCad is built using the wxWidgets library. The following options allow you
to specifically tailor the wxWidgets library configuration. For the complete
list of wxWidgets setting see CMakeModules/FindwxWidgets.cmake in the KiCad
@ -69,85 +77,147 @@ CMake looks in the standard platform locations to find the default version of
the wxWidgets library. If you wish to use a custom built wxWidgets library,
set wxWidgets_ROOT_DIR to the correct path.
wxWidgets_USE_DEBUG (ON/OFF)
----------------------------
Default: OFF
When creating a debug build of KiCad, it is often useful to link against the
debug build of the wxWidgets. To use the debug build of wxWidgets, set
wxWidgets_USE_DEBUG to ON.
wxWidgets_USE_UNICODE (ON/OFF)
------------------------------
Default: ON (wxWidgets 2.9 or later), OFF (older versions)
If your platform supports Unicode and you wish to build KiCad with Unicode
support, set wxWidgets_USE_UNICODE to ON. Please note as of the 2.9 branch
this option is not required.
KiCad Specific Options
----------------------
======================
All of the configuration settings below are specific to the KiCad project.
If for any reason you add or remove a build option to the KiCad CMake files,
please update the list below.
KICAD_SKIP_BOOST (ON/OFF)
--------------------------
Skips building the required boost library components.
WARNING: KiCad developers strongly advise you to build the bundled boost library, as it is
known to work with KiCad. Other versions may contain bugs that may result in KiCad errors.
Default: OFF
Use the version of the Boost library installed on the system rather than
building a local copy.
WARNING: The KiCad developers strongly advise you to build the bundled copy of
the Boost library, as it is known to work with KiCad. Other versions may
contain bugs that may result in KiCad errors.
USE_WX_GRAPHICS_CONTEXT (ON/OFF)
--------------------------------
This option is *Experimental* and used the advanced drawing library code
using wxGraphicsContext and should only be used for testing purposes.
Under Windows, a very recent version of mingw is needed. It also requires
wxWidgets to be built with the --enable-graphics_ctx configuration switch.
Default: OFF
This option is *Experimental*. It enables advanced drawing library code using
wxGraphicsContext and should only be used for testing purposes. Under Windows,
a very recent version of mingw is needed. It also requires wxWidgets to be
built with the --enable-graphics_ctx configuration switch.
USE_IMAGES_IN_MENUS (ON/OFF)
----------------------------
Default: OFF for OSX, ON for other platforms.
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,
images will be included in menu items on all platforms except OSX.
DOWNLOAD_DIR (PATH)
-------------------
Default: <source directory>/.downloads-by-cmake
Some external dependencies are automatically download and built when you
compile KiCad. This option specifies which directory they are stored in. If you
are building multiple copies of KiCad (e.g., to test different features or your
own modifications), it is recommended you set this option to a global directory
to avoid download and building the dependencies multiple times.
KICAD_USER_CONFIG_DIR (PATH)
----------------------------
Default: Home directory (Unix-based systems), Application data directory (Windows)
This option specifies where to store user-specific configuration information.
KICAD_KEEPCASE (ON/OFF)
-----------------------
This option enables or disables turning off the automatic component name
conversion to uppercase. The default is OFF which means component names will
be converted to upper case.
Default: ON
If this is OFF, component names are automatically converted to uppercase meaning
they are case insensitive. If it is ON, component names are not changed and
are therefore case sensitive.
USE_WX_OVERLAY (ON/OFF)
-----------------------
This option enables or disables wxOverlay for drawing operation on OSX. It is
OFF by default on all platforms except OSX. Warning, this is experimental!
Default: ON for OSX, OFF for other platforms.
This option enables or disables the use of wxOverlay for drawing operations.
Warning, this is experimental!
KICAD_SCRIPTING (ON/OFF)
------------------------
This option enables or disables building Python scripting support for KiCad.
The default is OFF. Currently only Pcbnew is supported. This option requires
that SWIG and Python are installed on the system.
Default: OFF
This option enables or disables building Python scripting support within KiCad.
Currently only Pcbnew is supported. This option requires SWIG and Python to be
installed on the system.
KICAD_SCRIPTING_MODULES (ON/OFF)
--------------------------------
This option enables or disables building the KiCad modules that can be used
from scripting languages. The default is OFF. Currently only Pcbnew is
supported. This option requires that SWIG and Python are installed on the
system.
Default: OFF
This option enables or disables building KiCad Python modules that can be used
externally by Python. Currently only Pcbnew is supported. This option
requires SWIG and Python to be installed on the system.
KICAD_SCRIPTING_WXPYTHON (ON/OFF)
---------------------------------
This option enables or disables building wxPython support into KiCad for
python and py.shell. The default is OFF. Currently only Pcbnew is
supported. This option requires that SWIG, Python, and wxPython are
installed on the system.
Default: OFF
This option enables or disables building wxPython support into the KiCad
scripting support. Currently only Pcbnew is supported. This option requires
SWIG, Python, and wxPython to be installed on the system.
PYTHON_SITE_PACKAGE_PATH (PATH)
-------------------------------
Default: System site library path
When building KiCad with Python scripting enable, the Python site library path
is used by default. If you want to install the KiCad Python extension in a
different path, set this variable to the desired path.
USE_FP_LIB_TABLE (ON/OFF)
-------------------------
This option enable or disables building KiCad with the new footprint library
table support. The default setting (OFF) builds KiCad with the legacy library
path support. This option is experimental until the library table support is
ready for release.
BUILD_GITHUB_PLUGIN (ON/OFF)
----------------------------
Default: OFF
This option enables or disables building KiCad with a pcbnew plugin for loading
footprints from a GitHub repository.
KICAD_REPO_NAME (STRING)
------------------------
Default: "product"
The name of the repository this copy of KiCad was compiled from. This is
reported in the "About" dialog and is useful for people who are working with
multiple copies of the code from different sources. The default value is
"product", the name of the main development branch on Launchpad.

View File

@ -37,11 +37,11 @@ Building Kicad with support for Scripting
then issue for example
cmake -DKICAD_BUILD_DYNAMIC=ON .
make lib-wxpython
make swig
After successfully building you can set your KICAD_SCRIPTING* options (for example):
cmake -DKICAD_SCRIPTING=ON -DKICAD_SCRIPTING_WXPYTHON=ON .
cmake -DKICAD_SCRIPTING=ON -DKICAD_SCRIPTING_WXPYTHON=ON -DKICAD_SCRIPTING_MODULES=ON .
make
The system will build all accordling your choices and package all in the bundle

View File

@ -170,6 +170,9 @@ build directory.
Important parameters to cmake
-----------------------------
See Documentation/compiling/build-config.txt for a list of all CMake options
available when compiling KiCad.
-DCMAKE_BUILD_TYPE=<buildtype>
<buildtype> may current one of "Debug" and "Release".

View File

@ -57,6 +57,10 @@ set( GAL_SRCS
add_library( gal STATIC ${GAL_SRCS} )
add_dependencies( gal shader_headers )
add_dependencies( gal lib-dependencies )
add_dependencies( shader_headers lib-dependencies )
# Only for win32 cross compilation using MXE
if( WIN32 AND MSYS )
add_definitions( -DGLEW_STATIC )
@ -183,6 +187,7 @@ set( COMMON_SRCS
add_library( common STATIC ${COMMON_SRCS} )
add_dependencies( common lib-dependencies )
set( PCB_COMMON_SRCS
base_screen.cpp
@ -249,6 +254,7 @@ set_source_files_properties( ${PCB_COMMON_SRCS} PROPERTIES
)
add_library( pcbcommon STATIC ${PCB_COMMON_SRCS} )
add_dependencies( pcbcommon lib-dependencies )
# auto-generate specctra_lexer.h and specctra_keywords.cpp
make_lexer(
@ -315,3 +321,6 @@ make_lexer(
# to build it, first enable #define STAND_ALONE at top of dsnlexer.cpp
add_executable( dsntest EXCLUDE_FROM_ALL dsnlexer.cpp )
target_link_libraries( dsntest common ${wxWidgets_LIBRARIES} rt )
add_dependencies( dsntest lib-dependencies )

View File

@ -119,7 +119,7 @@ void DIALOG_PAGES_SETTINGS::initDialog()
// The first shows translated strings, the second contains not translated strings
m_paperSizeComboBox->Clear();
for( unsigned ii = 0; ii<DIM(pageFmts); ii++ )
for( unsigned ii = 0; ii < DIM(pageFmts); ii++ )
{
m_pageFmt.Add( pageFmts[ii] );
m_paperSizeComboBox->Append( wxGetTranslation( pageFmts[ii] ) );

View File

@ -35,7 +35,7 @@ DIALOG_PAGES_SETTINGS_BASE::DIALOG_PAGES_SETTINGS_BASE( wxWindow* parent, wxWind
wxString m_paperSizeComboBoxChoices[] = { _("dummy text") };
int m_paperSizeComboBoxNChoices = sizeof( m_paperSizeComboBoxChoices ) / sizeof( wxString );
m_paperSizeComboBox = new wxChoice( this, ID_CHICE_PAGE_SIZE, wxDefaultPosition, wxDefaultSize, m_paperSizeComboBoxNChoices, m_paperSizeComboBoxChoices, 0 );
m_paperSizeComboBox = new wxChoice( this, wxID_ANY, wxDefaultPosition, wxDefaultSize, m_paperSizeComboBoxNChoices, m_paperSizeComboBoxChoices, 0 );
m_paperSizeComboBox->SetSelection( 0 );
bleftSizer->Add( m_paperSizeComboBox, 0, wxEXPAND|wxBOTTOM|wxRIGHT|wxLEFT, 5 );

View File

@ -390,7 +390,7 @@
<property name="font"></property>
<property name="gripper">0</property>
<property name="hidden">0</property>
<property name="id">ID_CHICE_PAGE_SIZE</property>
<property name="id">wxID_ANY</property>
<property name="max_size"></property>
<property name="maximize_button">0</property>
<property name="maximum_size"></property>

View File

@ -37,27 +37,26 @@ class DIALOG_SHIM;
///////////////////////////////////////////////////////////////////////////
#define ID_CHICE_PAGE_SIZE 1000
#define ID_CHOICE_PAGE_ORIENTATION 1001
#define ID_TEXTCTRL_USER_PAGE_SIZE_Y 1002
#define ID_TEXTCTRL_USER_PAGE_SIZE_X 1003
#define ID_TEXTCTRL_DATE 1004
#define ID_BTN_APPLY_DATE 1005
#define ID_PICKER_DATE 1006
#define ID_CHECKBOX_DATE 1007
#define ID_TEXTCTRL_REVISION 1008
#define ID_CHECKBOX_REVISION 1009
#define ID_TEXTCTRL_TITLE 1010
#define ID_TEXTCTRL_COMPANY 1011
#define ID_CHECKBOX_COMPANY 1012
#define ID_TEXTCTRL_COMMENT1 1013
#define ID_CHECKBOX_COMMENT1 1014
#define ID_TEXTCTRL_COMMENT2 1015
#define ID_CHECKBOX_COMMENT2 1016
#define ID_TEXTCTRL_COMMENT3 1017
#define ID_CHECKBOX_COMMENT3 1018
#define ID_TEXTCTRL_COMMENT4 1019
#define ID_CHECKBOX_COMMENT4 1020
#define ID_CHOICE_PAGE_ORIENTATION 1000
#define ID_TEXTCTRL_USER_PAGE_SIZE_Y 1001
#define ID_TEXTCTRL_USER_PAGE_SIZE_X 1002
#define ID_TEXTCTRL_DATE 1003
#define ID_BTN_APPLY_DATE 1004
#define ID_PICKER_DATE 1005
#define ID_CHECKBOX_DATE 1006
#define ID_TEXTCTRL_REVISION 1007
#define ID_CHECKBOX_REVISION 1008
#define ID_TEXTCTRL_TITLE 1009
#define ID_TEXTCTRL_COMPANY 1010
#define ID_CHECKBOX_COMPANY 1011
#define ID_TEXTCTRL_COMMENT1 1012
#define ID_CHECKBOX_COMMENT1 1013
#define ID_TEXTCTRL_COMMENT2 1014
#define ID_CHECKBOX_COMMENT2 1015
#define ID_TEXTCTRL_COMMENT3 1016
#define ID_CHECKBOX_COMMENT3 1017
#define ID_TEXTCTRL_COMMENT4 1018
#define ID_CHECKBOX_COMMENT4 1019
///////////////////////////////////////////////////////////////////////////////
/// Class DIALOG_PAGES_SETTINGS_BASE

View File

@ -502,8 +502,8 @@ void EDA_APP::SetDefaultSearchPaths()
#ifdef __WXMSW__
tmp.AddEnvList( wxT( "PROGRAMFILES" ) );
#elif __WXMAC__
tmp.Add( wxString( wxGetenv( wxT( "HOME" ) ) ) + wxT( "/Library/Application Support" ) );
tmp.Add( wxT( "/Library/Application Support" ) );
tmp.Add( wxString( wxGetenv( wxT( "HOME" ) ) ) + wxT( "/Library/Application Support/kicad/" ) );
tmp.Add( wxT( "/Library/Application Support/kicad/" ) );
#else
tmp.AddEnvList( wxT( "PATH" ) );
#endif

View File

@ -799,10 +799,13 @@ bool FP_LIB_TABLE::ConvertFromLegacy( NETLIST& aNetList, const wxArrayString& aL
wxString uri = cur->rows[i].GetFullURI( true );
if( wxFileName::GetPathSeparator() == wxChar( '\\' )
&& uri.Find( wxChar( '/' ) ) >= 0 )
&& uri.Find( wxChar( '/' ) ) >= 0 )
uri.Replace( wxT( "/"), wxT( "\\" ) );
#ifdef __WINDOWS__
if( uri.CmpNoCase( libPath ) )
#else
if( uri == libPath )
#endif
{
libNickname = cur->rows[i].GetNickName();
break;
@ -827,7 +830,6 @@ bool FP_LIB_TABLE::ConvertFromLegacy( NETLIST& aNetList, const wxArrayString& aL
else
{
FPID newFPID = lastFPID;
newFPID.SetLibNickname( libNickname );
if( !newFPID.IsValid() )

View File

@ -42,7 +42,7 @@ const wxString ProjectFileExtension( wxT( "pro" ) );
const wxString SchematicFileExtension( wxT( "sch" ) );
const wxString NetlistFileExtension( wxT( "net" ) );
const wxString ComponentFileExtension( wxT( "cmp" ) );
const wxString GerberFileExtension( wxT( "pho" ) );
const wxString GerberFileExtension( wxT( ".((gbr|(gb|gt)[alops])|pho)" ) );
const wxString LegacyPcbFileExtension( wxT( "brd" ) );
const wxString KiCadPcbFileExtension( wxT( "kicad_pcb" ) );

View File

@ -1,8 +1,8 @@
#ifndef HELP_MESSAGE_FILE_H
#define HELP_MESSAGE_FILE_H
#define LOAD_FILE_HELP _( "Open a net list file" )
#define SAVE_HLP_MSG _( "Save the component/footprint link file (.cmp file)" )
#define SAVE_AS_HLP_MSG _( "Save the component/footprint link file (.cmp file) with a new name" )
#define LOAD_FILE_HELP _( "Open netlist file" )
#define SAVE_HLP_MSG _( "Save component/footprint link file (.cmp file)" )
#define SAVE_AS_HLP_MSG _( "Save component/footprint link file (.cmp file) with new name" )
#endif // HELP_MESSAGE_FILE_H

View File

@ -606,6 +606,9 @@ void CVPCB_MAINFRAME::OnSelectComponent( wxListEvent& event )
libraryName = m_LibraryList->GetSelectedLibrary();
m_FootprintList->SetFootprints( m_footprints, libraryName, component, filter );
// Tell AuiMgr that objects are changed !
m_auimgr.Update();
if( component == NULL )
return;

View File

@ -66,7 +66,7 @@ void CVPCB_MAINFRAME::ReCreateMenuBar()
// Open
AddMenuItem( filesMenu,
ID_LOAD_PROJECT,
_( "&Open" ), LOAD_FILE_HELP, KiBitmap( open_document_xpm ) );
_( "&Open Netlist" ), LOAD_FILE_HELP, KiBitmap( open_document_xpm ) );
// Open Recent submenu
static wxMenu* openRecentMenu;
@ -81,7 +81,7 @@ void CVPCB_MAINFRAME::ReCreateMenuBar()
wxGetApp().GetFileHistory().AddFilesToMenu();
AddMenuItem( filesMenu, openRecentMenu, -1,
_( "Open &Recent" ),
_( "Open a recent opened netlist document" ),
_( "Open recent netlist" ),
KiBitmap( open_project_xpm ) );
// Separator
@ -111,7 +111,7 @@ void CVPCB_MAINFRAME::ReCreateMenuBar()
wxMenu* preferencesMenu = new wxMenu;
AddMenuItem( preferencesMenu, ID_CVPCB_LIB_TABLE_EDIT,
_( "Li&brary Tables" ), _( "Setup footprint libraries" ),
_( "Edit Li&brary Table" ), _( "Setup footprint libraries" ),
KiBitmap( library_table_xpm ) );
// Language submenu
@ -134,7 +134,7 @@ void CVPCB_MAINFRAME::ReCreateMenuBar()
AddMenuItem( preferencesMenu, ID_SAVE_PROJECT_AS,
_( "&Save Project File As" ),
_( "Save changes to the project configuration to a new file" ),
_( "Save changes to a new project configuration file" ),
KiBitmap( save_setup_xpm ) );
// Menu Help:
@ -143,12 +143,12 @@ void CVPCB_MAINFRAME::ReCreateMenuBar()
// Version info
AddHelpVersionInfoMenuEntry( helpMenu );
// Contents
AddMenuItem( helpMenu, wxID_HELP, _( "&Contents" ),
_( "Open the CvPcb handbook" ),
// Manual Contents
AddMenuItem( helpMenu, wxID_HELP, _( "&CvPcb Manual" ),
_( "Open CvPcb manual" ),
KiBitmap( online_help_xpm ) );
// About
// About CvPcb
AddMenuItem( helpMenu, wxID_ABOUT,
_( "&About CvPcb" ),
_( "About CvPcb footprint selector" ),

View File

@ -58,7 +58,7 @@ void CVPCB_MAINFRAME::ReCreateHToolbar()
m_mainToolBar->AddSeparator();
m_mainToolBar->AddTool( ID_CVPCB_CREATE_CONFIGWINDOW, wxEmptyString,
KiBitmap( config_xpm ),
_( "Configuration" ) );
_( "Set CvPcb config (paths and equ files)" ) );
m_mainToolBar->AddSeparator();
m_mainToolBar->AddTool( ID_CVPCB_CREATE_SCREENCMP, wxEmptyString,
@ -72,21 +72,21 @@ void CVPCB_MAINFRAME::ReCreateHToolbar()
m_mainToolBar->AddSeparator();
m_mainToolBar->AddTool( ID_CVPCB_GOTO_PREVIOUSNA, wxEmptyString,
KiBitmap( left_xpm ),
_( "Select previous free component" ) );
_( "Select previous unlinked component" ) );
m_mainToolBar->AddTool( ID_CVPCB_GOTO_FIRSTNA, wxEmptyString,
KiBitmap( right_xpm ),
_( "Select next free component" ) );
_( "Select next unlinked component" ) );
m_mainToolBar->AddSeparator();
m_mainToolBar->AddTool( ID_CVPCB_DEL_ASSOCIATIONS, wxEmptyString,
KiBitmap( delete_association_xpm ),
_( "Delete all associations" ) );
_( "Delete all associations (links)" ) );
m_mainToolBar->AddSeparator();
m_mainToolBar->AddTool( ID_PCB_DISPLAY_FOOTPRINT_DOC, wxEmptyString,
KiBitmap( datasheet_xpm ),
_( "Display footprints list documentation" ) );
_( "Display footprint documentation" ) );
m_mainToolBar->AddSeparator();
m_mainToolBar->AddSeparator();
@ -94,20 +94,20 @@ void CVPCB_MAINFRAME::ReCreateHToolbar()
KiBitmap( module_filtered_list_xpm ),
wxNullBitmap,
true, NULL,
_( "Filter the footprint list for the current component key words" ),
_( "Filter footprint list by keywords" ),
wxEmptyString );
m_mainToolBar->AddTool( ID_CVPCB_FOOTPRINT_DISPLAY_PIN_FILTERED_LIST,
KiBitmap( module_pin_filtered_list_xpm ),
wxNullBitmap,
true, NULL,
_( "Filter the footprint list by pin count for the current component" ),
_( "Filter footprint list by pin count" ),
wxEmptyString );
m_mainToolBar->AddTool( ID_CVPCB_FOOTPRINT_DISPLAY_BY_LIBRARY_LIST,
KiBitmap( module_library_list_xpm ),
wxNullBitmap, true, NULL,
_( "Filter the footprint list by the selected library" ),
_( "Filter footprint list by library" ),
wxEmptyString );
if( config )

View File

@ -141,8 +141,6 @@ void COMPONENT_TREE_SEARCH_CONTAINER::AddAliasList( const wxString& aNodeName,
const wxArrayString& aAliasNameList,
CMP_LIBRARY* aOptionalLib )
{
static const wxChar unitLetter[] = wxT( "ABCDEFGHIJKLMNOPQRSTUVWXYZ" );
TREE_NODE* const lib_node = new TREE_NODE( TREE_NODE::TYPE_LIB, NULL, NULL,
aNodeName, wxEmptyString, wxEmptyString );
nodes.push_back( lib_node );
@ -168,9 +166,20 @@ void COMPONENT_TREE_SEARCH_CONTAINER::AddAliasList( const wxString& aNodeName,
if( !a->GetDescription().empty() )
{
// Preformatting. Unfortunately, the tree widget doesn't have columns
display_info.Printf( wxT(" %s[ %s ]"),
( a->GetName().length() <= 8 ) ? wxT("\t\t") : wxT("\t"),
GetChars( a->GetDescription() ) );
// and using tabs does not work very well or does not work at all
// (depending on OS versions). So indent with spaces in fixed-font width.
// The 98%-ile of length of strings found in the standard library is 15
// characters. Use this as a reasonable cut-off point for aligned indentation.
// For the few component names longer than that, the description is indented a
// bit more.
// The max found in the default lib would be 20 characters, but that creates too
// much visible whitespace for the less extreme component names.
const int COLUMN_DESCR_POS = 15;
const int indent_len = COLUMN_DESCR_POS - a->GetName().length();
display_info = wxString::Format( wxT( " %*s [ %s ]" ),
indent_len > 0 ? indent_len : 0, wxT( "" ),
GetChars( a->GetDescription() ) );
}
TREE_NODE* alias_node = new TREE_NODE( TREE_NODE::TYPE_ALIAS, lib_node,
@ -178,21 +187,28 @@ void COMPONENT_TREE_SEARCH_CONTAINER::AddAliasList( const wxString& aNodeName,
nodes.push_back( alias_node );
if( a->GetComponent()->IsMulti() ) // Add all units as sub-nodes.
for ( int u = 0; u < a->GetComponent()->GetPartCount(); ++u )
{
for( int u = 1; u <= a->GetComponent()->GetPartCount(); ++u )
{
const wxString unitName = unitLetter[u];
TREE_NODE* unit_node = new TREE_NODE(TREE_NODE::TYPE_UNIT, alias_node, a,
_("Unit ") + unitName,
wxEmptyString, wxEmptyString );
unit_node->Unit = u + 1;
wxString unitName = _("Unit");
unitName += wxT( " " ) + LIB_COMPONENT::ReturnSubReference( u, false );
TREE_NODE* unit_node = new TREE_NODE( TREE_NODE::TYPE_UNIT,
alias_node, a,
unitName,
wxEmptyString, wxEmptyString );
unit_node->Unit = u;
nodes.push_back( unit_node );
}
}
}
}
LIB_ALIAS* COMPONENT_TREE_SEARCH_CONTAINER::GetSelectedAlias( int* aUnit )
{
if( tree == NULL )
return NULL;
const wxTreeItemId& select_id = tree->GetSelection();
BOOST_FOREACH( TREE_NODE* node, nodes )

View File

@ -97,7 +97,7 @@ public:
/** Function GetSelectedAlias
*
* @param if not-NULL, the selected sub-unit is set here.
* @return the selected alias or NULL if there is none.
* @return the selected alias or NULL if there is none, or there is no tree.
*/
LIB_ALIAS* GetSelectedAlias( int* aUnit );

View File

@ -47,19 +47,29 @@ DIALOG_CHOOSE_COMPONENT::DIALOG_CHOOSE_COMPONENT( wxWindow* aParent, const wxStr
m_search_container->SetTree( m_libraryComponentTree );
m_searchBox->SetFocus();
m_componentDetails->SetEditable( false );
#if wxCHECK_VERSION( 3, 0, 0 )
m_libraryComponentTree->ScrollTo( m_libraryComponentTree->GetFocusedItem() );
#endif
// The tree showing libs and component uses a fixed font,
// because we want controle the position of some info when drawing the
// tree. Using tabs does not work very well (does not work on Windows)
wxFont font = wxSystemSettings::GetFont( wxSYS_DEFAULT_GUI_FONT );
m_libraryComponentTree->SetFont( wxFont( font.GetPointSize(),
wxFONTFAMILY_MODERN, wxFONTSTYLE_NORMAL, wxFONTWEIGHT_NORMAL ) );
}
// After this dialog is done: return the alias that has been selected, or an
// empty string if there is none.
wxString DIALOG_CHOOSE_COMPONENT::GetSelectedAliasName( int* aUnit ) const
DIALOG_CHOOSE_COMPONENT::~DIALOG_CHOOSE_COMPONENT()
{
LIB_ALIAS *alias = m_search_container->GetSelectedAlias( aUnit );
m_search_container->SetTree( NULL );
}
if( alias )
return alias->GetName();
return wxEmptyString;
LIB_ALIAS* DIALOG_CHOOSE_COMPONENT::GetSelectedAlias( int* aUnit ) const
{
return m_search_container->GetSelectedAlias( aUnit );
}
@ -131,7 +141,11 @@ void DIALOG_CHOOSE_COMPONENT::OnTreeSelect( wxTreeEvent& aEvent )
}
void DIALOG_CHOOSE_COMPONENT::OnDoubleClickTreeSelect( wxTreeEvent& aEvent )
// Test strategy for OnDoubleClickTreeActivation()/OnTreeMouseUp() work around wxWidgets bug:
// - search for an item.
// - use the mouse to double-click on an item in the tree.
// -> The dialog should close, and the component should _not_ be immediately placed
void DIALOG_CHOOSE_COMPONENT::OnDoubleClickTreeActivation( wxTreeEvent& aEvent )
{
if( !updateSelection() )
return;
@ -152,6 +166,27 @@ void DIALOG_CHOOSE_COMPONENT::OnTreeMouseUp( wxMouseEvent& aMouseEvent )
aMouseEvent.Skip(); // Let upstream handle it.
}
// Test strategy to see if OnInterceptTreeEnter() works:
// - search for an item.
// - click into the tree once to set focus on tree; navigate. Press 'Enter'
// -> The dialog should close and the component be available to place.
void DIALOG_CHOOSE_COMPONENT::OnInterceptTreeEnter( wxKeyEvent& aEvent )
{
// We have to do some special handling for double-click on a tree-item because
// of some superfluous event delivery bug in wxWidgets (see OnDoubleClickTreeActivation()).
// In tree-activation, we assume we got a double-click and need to take special precaution
// that the mouse-up event is not delivered to the window one level up by going through
// a state-sequence OnDoubleClickTreeActivation() -> OnTreeMouseUp().
// Pressing 'Enter' within a tree will also call OnDoubleClickTreeActivation(),
// but since this is not due to the double-click and we have no way of knowing that it is
// not, we need to intercept the 'Enter' key before that to know that it is time to exit.
if( aEvent.GetKeyCode() == WXK_RETURN )
EndModal( wxID_OK ); // Dialog is done.
else
aEvent.Skip(); // Let tree handle that key for navigation.
}
void DIALOG_CHOOSE_COMPONENT::OnStartComponentBrowser( wxMouseEvent& aEvent )
{

View File

@ -27,27 +27,39 @@
#include <dialog_choose_component_base.h>
class COMPONENT_TREE_SEARCH_CONTAINER;
class LIB_ALIAS;
class LIB_COMPONENT;
class wxTreeItemId;
class DIALOG_CHOOSE_COMPONENT : public DIALOG_CHOOSE_COMPONENT_BASE
{
public:
/**
* Create dialog to choose component.
*
* @param aParent Parent window.
* @param aTitle Dialog title.
* @param aSearchContainer The tree selection search container. Needs to be pre-populated
* This dialog does not take over ownership of this object.
* @param aDeMorganConvert preferred deMorgan conversion (TODO: should happen in dialog)
*/
DIALOG_CHOOSE_COMPONENT( wxWindow* aParent, const wxString& aTitle,
COMPONENT_TREE_SEARCH_CONTAINER* aSearch_container,
COMPONENT_TREE_SEARCH_CONTAINER* aSearchContainer,
int aDeMorganConvert );
virtual ~DIALOG_CHOOSE_COMPONENT();
/** Function GetSelectedAliasName
/** Function GetSelectedAlias
* To be called after this dialog returns from ShowModal().
*
* @param aUnit if not NULL, the selected unit is filled in here.
* @return the alias that has been selected, or an empty string if there is none.
* @return the alias that has been selected, or NULL if there is none.
*/
wxString GetSelectedAliasName( int* aUnit ) const;
LIB_ALIAS* GetSelectedAlias( int* aUnit ) const;
/** Function IsExternalBrowserSelected
*
* @return true, iff the browser pressed the browsing button.
* @return true, iff the user pressed the thumbnail view of the component to
* launch the component browser.
*/
bool IsExternalBrowserSelected() const { return m_external_browser_requested; }
@ -57,7 +69,8 @@ protected:
virtual void OnInterceptSearchBoxKey( wxKeyEvent& aEvent );
virtual void OnTreeSelect( wxTreeEvent& aEvent );
virtual void OnDoubleClickTreeSelect( wxTreeEvent& aEvent );
virtual void OnDoubleClickTreeActivation( wxTreeEvent& aEvent );
virtual void OnInterceptTreeEnter( wxKeyEvent& aEvent );
virtual void OnTreeMouseUp( wxMouseEvent& aMouseEvent );
virtual void OnStartComponentBrowser( wxMouseEvent& aEvent );

View File

@ -1,5 +1,5 @@
///////////////////////////////////////////////////////////////////////////
// C++ code generated with wxFormBuilder (version Feb 8 2014)
// C++ code generated with wxFormBuilder (version Feb 22 2014)
// http://www.wxformbuilder.org/
//
// PLEASE DO "NOT" EDIT THIS FILE!
@ -21,7 +21,7 @@ DIALOG_CHOOSE_COMPONENT_BASE::DIALOG_CHOOSE_COMPONENT_BASE( wxWindow* parent, wx
m_searchLabel = new wxStaticText( this, wxID_ANY, wxT("Search"), wxDefaultPosition, wxDefaultSize, 0 );
m_searchLabel->Wrap( -1 );
bSearchSizer->Add( m_searchLabel, 0, wxALL, 5 );
bSearchSizer->Add( m_searchLabel, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5 );
m_searchBox = new wxTextCtrl( this, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, wxTE_PROCESS_ENTER );
bSearchSizer->Add( m_searchBox, 1, wxALL, 5 );
@ -32,7 +32,7 @@ DIALOG_CHOOSE_COMPONENT_BASE::DIALOG_CHOOSE_COMPONENT_BASE( wxWindow* parent, wx
m_libraryComponentTree = new wxTreeCtrl( this, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxTR_DEFAULT_STYLE|wxTR_HIDE_ROOT );
m_libraryComponentTree->SetMinSize( wxSize( -1,50 ) );
bSizer1->Add( m_libraryComponentTree, 2, wxALL|wxEXPAND, 5 );
bSizer1->Add( m_libraryComponentTree, 1, wxALL|wxEXPAND, 5 );
wxBoxSizer* bSizer3;
bSizer3 = new wxBoxSizer( wxHORIZONTAL );
@ -40,7 +40,7 @@ DIALOG_CHOOSE_COMPONENT_BASE::DIALOG_CHOOSE_COMPONENT_BASE( wxWindow* parent, wx
m_componentView = new wxPanel( this, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxFULL_REPAINT_ON_RESIZE|wxSUNKEN_BORDER );
m_componentView->SetMinSize( wxSize( 150,150 ) );
bSizer3->Add( m_componentView, 2, wxEXPAND | wxALL, 5 );
bSizer3->Add( m_componentView, 4, wxEXPAND | wxALL, 5 );
m_componentDetails = new wxTextCtrl( this, wxID_ANY, wxEmptyString, wxDefaultPosition, wxSize( -1,-1 ), wxTE_MULTILINE );
m_componentDetails->SetMinSize( wxSize( -1,100 ) );
@ -60,7 +60,7 @@ DIALOG_CHOOSE_COMPONENT_BASE::DIALOG_CHOOSE_COMPONENT_BASE( wxWindow* parent, wx
m_button->AddButton( m_buttonCancel );
m_button->Realize();
bSizer5->Add( m_button, 0, wxEXPAND, 5 );
bSizer5->Add( m_button, 0, wxALL|wxEXPAND, 5 );
bSizer1->Add( bSizer5, 0, wxALIGN_RIGHT, 5 );
@ -75,8 +75,9 @@ DIALOG_CHOOSE_COMPONENT_BASE::DIALOG_CHOOSE_COMPONENT_BASE( wxWindow* parent, wx
m_searchBox->Connect( wxEVT_KEY_DOWN, wxKeyEventHandler( DIALOG_CHOOSE_COMPONENT_BASE::OnInterceptSearchBoxKey ), NULL, this );
m_searchBox->Connect( wxEVT_COMMAND_TEXT_UPDATED, wxCommandEventHandler( DIALOG_CHOOSE_COMPONENT_BASE::OnSearchBoxChange ), NULL, this );
m_searchBox->Connect( wxEVT_COMMAND_TEXT_ENTER, wxCommandEventHandler( DIALOG_CHOOSE_COMPONENT_BASE::OnSearchBoxEnter ), NULL, this );
m_libraryComponentTree->Connect( wxEVT_KEY_UP, wxKeyEventHandler( DIALOG_CHOOSE_COMPONENT_BASE::OnInterceptTreeEnter ), NULL, this );
m_libraryComponentTree->Connect( wxEVT_LEFT_UP, wxMouseEventHandler( DIALOG_CHOOSE_COMPONENT_BASE::OnTreeMouseUp ), NULL, this );
m_libraryComponentTree->Connect( wxEVT_COMMAND_TREE_ITEM_ACTIVATED, wxTreeEventHandler( DIALOG_CHOOSE_COMPONENT_BASE::OnDoubleClickTreeSelect ), NULL, this );
m_libraryComponentTree->Connect( wxEVT_COMMAND_TREE_ITEM_ACTIVATED, wxTreeEventHandler( DIALOG_CHOOSE_COMPONENT_BASE::OnDoubleClickTreeActivation ), NULL, this );
m_libraryComponentTree->Connect( wxEVT_COMMAND_TREE_SEL_CHANGED, wxTreeEventHandler( DIALOG_CHOOSE_COMPONENT_BASE::OnTreeSelect ), NULL, this );
m_componentView->Connect( wxEVT_LEFT_UP, wxMouseEventHandler( DIALOG_CHOOSE_COMPONENT_BASE::OnStartComponentBrowser ), NULL, this );
m_componentView->Connect( wxEVT_PAINT, wxPaintEventHandler( DIALOG_CHOOSE_COMPONENT_BASE::OnHandlePreviewRepaint ), NULL, this );
@ -88,8 +89,9 @@ DIALOG_CHOOSE_COMPONENT_BASE::~DIALOG_CHOOSE_COMPONENT_BASE()
m_searchBox->Disconnect( wxEVT_KEY_DOWN, wxKeyEventHandler( DIALOG_CHOOSE_COMPONENT_BASE::OnInterceptSearchBoxKey ), NULL, this );
m_searchBox->Disconnect( wxEVT_COMMAND_TEXT_UPDATED, wxCommandEventHandler( DIALOG_CHOOSE_COMPONENT_BASE::OnSearchBoxChange ), NULL, this );
m_searchBox->Disconnect( wxEVT_COMMAND_TEXT_ENTER, wxCommandEventHandler( DIALOG_CHOOSE_COMPONENT_BASE::OnSearchBoxEnter ), NULL, this );
m_libraryComponentTree->Disconnect( wxEVT_KEY_UP, wxKeyEventHandler( DIALOG_CHOOSE_COMPONENT_BASE::OnInterceptTreeEnter ), NULL, this );
m_libraryComponentTree->Disconnect( wxEVT_LEFT_UP, wxMouseEventHandler( DIALOG_CHOOSE_COMPONENT_BASE::OnTreeMouseUp ), NULL, this );
m_libraryComponentTree->Disconnect( wxEVT_COMMAND_TREE_ITEM_ACTIVATED, wxTreeEventHandler( DIALOG_CHOOSE_COMPONENT_BASE::OnDoubleClickTreeSelect ), NULL, this );
m_libraryComponentTree->Disconnect( wxEVT_COMMAND_TREE_ITEM_ACTIVATED, wxTreeEventHandler( DIALOG_CHOOSE_COMPONENT_BASE::OnDoubleClickTreeActivation ), NULL, this );
m_libraryComponentTree->Disconnect( wxEVT_COMMAND_TREE_SEL_CHANGED, wxTreeEventHandler( DIALOG_CHOOSE_COMPONENT_BASE::OnTreeSelect ), NULL, this );
m_componentView->Disconnect( wxEVT_LEFT_UP, wxMouseEventHandler( DIALOG_CHOOSE_COMPONENT_BASE::OnStartComponentBrowser ), NULL, this );
m_componentView->Disconnect( wxEVT_PAINT, wxPaintEventHandler( DIALOG_CHOOSE_COMPONENT_BASE::OnHandlePreviewRepaint ), NULL, this );

View File

@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<wxFormBuilder_Project>
<FileVersion major="1" minor="12" />
<FileVersion major="1" minor="11" />
<object class="Project" expanded="1">
<property name="class_decoration"></property>
<property name="code_generation">C++</property>
@ -104,7 +104,7 @@
<property name="permission">none</property>
<object class="sizeritem" expanded="0">
<property name="border">5</property>
<property name="flag">wxALL</property>
<property name="flag">wxALIGN_CENTER_VERTICAL|wxALL</property>
<property name="proportion">0</property>
<object class="wxStaticText" expanded="0">
<property name="BottomDockable">1</property>
@ -281,7 +281,7 @@
<object class="sizeritem" expanded="0">
<property name="border">5</property>
<property name="flag">wxALL|wxEXPAND</property>
<property name="proportion">2</property>
<property name="proportion">1</property>
<object class="wxTreeCtrl" expanded="0">
<property name="BottomDockable">1</property>
<property name="LeftDockable">1</property>
@ -338,7 +338,7 @@
<event name="OnEnterWindow"></event>
<event name="OnEraseBackground"></event>
<event name="OnKeyDown"></event>
<event name="OnKeyUp"></event>
<event name="OnKeyUp">OnInterceptTreeEnter</event>
<event name="OnKillFocus"></event>
<event name="OnLeaveWindow"></event>
<event name="OnLeftDClick"></event>
@ -363,7 +363,7 @@
<event name="OnTreeEndDrag"></event>
<event name="OnTreeEndLabelEdit"></event>
<event name="OnTreeGetInfo"></event>
<event name="OnTreeItemActivated">OnDoubleClickTreeSelect</event>
<event name="OnTreeItemActivated">OnDoubleClickTreeActivation</event>
<event name="OnTreeItemCollapsed"></event>
<event name="OnTreeItemCollapsing"></event>
<event name="OnTreeItemExpanded"></event>
@ -392,7 +392,7 @@
<object class="sizeritem" expanded="1">
<property name="border">5</property>
<property name="flag">wxEXPAND | wxALL</property>
<property name="proportion">2</property>
<property name="proportion">4</property>
<object class="wxPanel" expanded="1">
<property name="BottomDockable">1</property>
<property name="LeftDockable">1</property>
@ -573,7 +573,7 @@
<property name="permission">none</property>
<object class="sizeritem" expanded="0">
<property name="border">5</property>
<property name="flag">wxEXPAND</property>
<property name="flag">wxALL|wxEXPAND</property>
<property name="proportion">0</property>
<object class="wxStdDialogButtonSizer" expanded="0">
<property name="Apply">0</property>

View File

@ -1,5 +1,5 @@
///////////////////////////////////////////////////////////////////////////
// C++ code generated with wxFormBuilder (version Feb 8 2014)
// C++ code generated with wxFormBuilder (version Feb 22 2014)
// http://www.wxformbuilder.org/
//
// PLEASE DO "NOT" EDIT THIS FILE!
@ -50,8 +50,9 @@ class DIALOG_CHOOSE_COMPONENT_BASE : public DIALOG_SHIM
virtual void OnInterceptSearchBoxKey( wxKeyEvent& event ) { event.Skip(); }
virtual void OnSearchBoxChange( wxCommandEvent& event ) { event.Skip(); }
virtual void OnSearchBoxEnter( wxCommandEvent& event ) { event.Skip(); }
virtual void OnInterceptTreeEnter( wxKeyEvent& event ) { event.Skip(); }
virtual void OnTreeMouseUp( wxMouseEvent& event ) { event.Skip(); }
virtual void OnDoubleClickTreeSelect( wxTreeEvent& event ) { event.Skip(); }
virtual void OnDoubleClickTreeActivation( wxTreeEvent& event ) { event.Skip(); }
virtual void OnTreeSelect( wxTreeEvent& event ) { event.Skip(); }
virtual void OnStartComponentBrowser( wxMouseEvent& event ) { event.Skip(); }
virtual void OnHandlePreviewRepaint( wxPaintEvent& event ) { event.Skip(); }

View File

@ -52,8 +52,8 @@
#include <boost/foreach.hpp>
// TODO(hzeller): would be good if we could give a pre-selected component.
wxString SCH_BASE_FRAME::SelectComponentFromLibBrowser( void )
wxString SCH_BASE_FRAME::SelectComponentFromLibBrowser( LIB_ALIAS* aPreselectedAlias,
int* aUnit, int* aConvert )
{
wxSemaphore semaphore( 0, 1 );
wxString cmpname;
@ -64,7 +64,21 @@ wxString SCH_BASE_FRAME::SelectComponentFromLibBrowser( void )
viewlibFrame->Destroy();
viewlibFrame = new LIB_VIEW_FRAME( this, NULL, &semaphore,
KICAD_DEFAULT_DRAWFRAME_STYLE | wxFRAME_FLOAT_ON_PARENT );
KICAD_DEFAULT_DRAWFRAME_STYLE | wxFRAME_FLOAT_ON_PARENT );
if ( aPreselectedAlias )
{
viewlibFrame->SetSelectedLibrary( aPreselectedAlias->GetLibraryName() );
viewlibFrame->SetSelectedComponent( aPreselectedAlias->GetName() );
}
if( aUnit && *aUnit > 0 )
viewlibFrame->SetUnit( *aUnit );
if( aConvert && *aConvert > 0 )
viewlibFrame->SetConvert( *aConvert );
viewlibFrame->Refresh();
// Show the library viewer frame until it is closed
// Wait for viewer closing event:
while( semaphore.TryWait() == wxSEMA_BUSY )
@ -74,6 +88,13 @@ wxString SCH_BASE_FRAME::SelectComponentFromLibBrowser( void )
}
cmpname = viewlibFrame->GetSelectedComponent();
if( aUnit )
*aUnit = viewlibFrame->GetUnit();
if( aConvert )
*aConvert = viewlibFrame->GetConvert();
viewlibFrame->Destroy();
return cmpname;
@ -114,7 +135,13 @@ wxString SCH_BASE_FRAME::SelectComponentFromLibrary( const wxString& aLibname,
{
// This is good for a transition for experineced users: giving them a History. Ideally,
// we actually make this part even faster to access with a popup on ALT-a or something.
search_container.AddAliasList( _("-- History --"), aHistoryList, NULL );
// the history is under a node named "-- History --"
// However, because it is translatable, and we need to have a node name starting by "-- "
// because we (later) sort all node names alphabetically and this node should be the first,
// we build it with only with "History" string translatable
wxString nodename;
nodename << wxT("-- ") << _("History") << wxT(" --");
search_container.AddAliasList( nodename, aHistoryList, NULL );
search_container.SetPreselectNode( aHistoryList[0], aHistoryLastUnit );
}
@ -125,18 +152,13 @@ wxString SCH_BASE_FRAME::SelectComponentFromLibrary( const wxString& aLibname,
if( dlg.ShowModal() == wxID_CANCEL )
return wxEmptyString;
wxString cmpName = dlg.GetSelectedAliasName( aUnit );
wxString cmpName;
LIB_ALIAS* const alias = dlg.GetSelectedAlias( aUnit );
if ( alias )
cmpName = alias->GetName();
if( dlg.IsExternalBrowserSelected() )
{
cmpName = SelectComponentFromLibBrowser(); // Would be good if we could pre-select.
if( aUnit )
*aUnit = LIB_VIEW_FRAME::GetUnit();
if( aConvert )
*aConvert = LIB_VIEW_FRAME::GetConvert();
}
if( dlg.IsExternalBrowserSelected() ) // User requested big component browser.
cmpName = SelectComponentFromLibBrowser( alias, aUnit, aConvert);
if ( !cmpName.empty() )
{

View File

@ -13,55 +13,54 @@
*/
// Common to schematic editor and component editor
#define HELP_UNDO _( "Undo last edition" )
#define HELP_REDO _( "Redo the last undo command" )
#define HELP_UNDO _( "Undo last command" )
#define HELP_REDO _( "Redo last command" )
#define HELP_ZOOM_IN _( "Zoom in" )
#define HELP_ZOOM_OUT _( "Zoom out" )
#define HELP_ZOOM_FIT _( "Fit the schematic sheet on the screen" )
#define HELP_ZOOM_REDRAW _( "Redraw the schematic view" )
#define HELP_ZOOM_FIT _( "Fit schematic sheet on screen" )
#define HELP_ZOOM_REDRAW _( "Redraw schematic view" )
#define HELP_DELETE_ITEMS _( "Delete items" )
#define HELP_DELETE_ITEMS _( "Delete item" )
// Schematic editor:
#define HELP_FIND _( "Find components and texts" )
#define HELP_FIND _( "Find components and text" )
#define HELP_REPLACE _( "Find and replace text in schematic items" )
#define HELP_PLACE_COMPONENTS _( "Place a component" )
#define HELP_PLACE_POWERPORT _( "Place a power port" )
#define HELP_PLACE_WIRE _( "Place a wire" )
#define HELP_PLACE_BUS _( "Place a bus" )
#define HELP_PLACE_WIRE2BUS_ENTRY _( "Place a wire to bus entry" )
#define HELP_PLACE_BUS2BUS_ENTRY _( "Place a bus to bus entry" )
#define HELP_PLACE_NC_FLAG _( "Place a no connect flag" )
#define HELP_PLACE_COMPONENTS _( "Place component" )
#define HELP_PLACE_POWERPORT _( "Place power port" )
#define HELP_PLACE_WIRE _( "Place wire" )
#define HELP_PLACE_BUS _( "Place bus" )
#define HELP_PLACE_WIRE2BUS_ENTRY _( "Place wire to bus entry" )
#define HELP_PLACE_BUS2BUS_ENTRY _( "Place bus to bus entry" )
#define HELP_PLACE_NC_FLAG _( "Place not-connected flag" )
#define HELP_PLACE_NETLABEL _( "Place a net name (local label)" )
#define HELP_PLACE_NETLABEL _( "Place net name - local label" )
#define HELP_PLACE_GLOBALLABEL \
_(\
"Place a global label.\nWarning: all global labels with the same name are connected in whole hierarchy" )
"Place global label.\nWarning: inside global hierarchy , all global labels with same name are connected" )
#define HELP_PLACE_HIER_LABEL \
_( "Place a hierarchical label. This label will be seen as a hierarchical pin in the sheet symbol" )
_( "Place a hierarchical label. Label will be seen as a hierarchical pin in the sheet symbol" )
#define HELP_PLACE_JUNCTION _( "Place a junction" )
#define HELP_PLACE_SHEET _( "Create a hierarchical sheet" )
#define HELP_PLACE_JUNCTION _( "Place junction" )
#define HELP_PLACE_SHEET _( "Create hierarchical sheet" )
#define HELP_IMPORT_SHEETPIN _( \
"Place a hierarchical pin imported from the corresponding hierarchical label in sheet" )
#define HELP_PLACE_SHEETPIN _( "Place a hierarchical pin in sheet" )
"Place hierarchical pin imported from the corresponding hierarchical label" )
#define HELP_PLACE_SHEETPIN _( "Place hierarchical pin in sheet" )
#define HELP_PLACE_GRAPHICLINES _( "Place graphic lines or polygons" )
#define HELP_PLACE_GRAPHICTEXTS _( "Place graphic text (comment)" )
#define HELP_PLACE_GRAPHICTEXTS _( "Place text" )
#define HELP_ANNOTATE _( "Annotate the components in the schematic" )
#define HELP_RUN_LIB_EDITOR _( "Library editor - Create and edit components" )
#define HELP_RUN_LIB_VIEWER _( "Library browser - Browse components" )
#define HELP_ANNOTATE _( "Annotate schematic components" )
#define HELP_RUN_LIB_EDITOR _( "Library Editor - Create/edit components" )
#define HELP_RUN_LIB_VIEWER _( "Library Browser - Browse components" )
#define HELP_GENERATE_BOM _( "Generate bill of materials and/or cross references" )
#define HELP_IMPORT_FOOTPRINTS \
_( "Import the footprint selection from CvPcb (the .cmp file)\n\
in component footprint fields" )
_( "Back-import component footprint fields via CvPcb .cmp file" )
// Component editor:
#define HELP_ADD_PIN _( "Add pins to the component" )
#define HELP_ADD_BODYTEXT _( "Add graphic texts to the component body" )
#define HELP_ADD_BODYRECT _( "Add graphic rectangles to the component body" )
#define HELP_ADD_BODYCIRCLE _( "Add circles to the component body" )
#define HELP_ADD_BODYARC _( "Add arcs to the component body" )
#define HELP_ADD_BODYPOLYGON _( "Add lines and polygons to the component body" )
#define HELP_PLACE_GRAPHICIMAGES _("Add a bitmap image")
#define HELP_ADD_PIN _( "Add pins to component" )
#define HELP_ADD_BODYTEXT _( "Add text to component body" )
#define HELP_ADD_BODYRECT _( "Add graphic rectangle to component body" )
#define HELP_ADD_BODYCIRCLE _( "Add circles to component body" )
#define HELP_ADD_BODYARC _( "Add arcs to component body" )
#define HELP_ADD_BODYPOLYGON _( "Add lines and polygons to component body" )
#define HELP_PLACE_GRAPHICIMAGES _("Add bitmap image")

View File

@ -221,6 +221,13 @@ LIB_EDIT_FRAME::LIB_EDIT_FRAME( SCH_EDIT_FRAME* aParent,
LoadSettings();
// Ensure m_LastGridSizeId is an offset inside the allowed schematic range
if( m_LastGridSizeId < ID_POPUP_GRID_LEVEL_50 - ID_POPUP_GRID_LEVEL_1000 )
m_LastGridSizeId = ID_POPUP_GRID_LEVEL_50 - ID_POPUP_GRID_LEVEL_1000;
if( m_LastGridSizeId > ID_POPUP_GRID_LEVEL_1 - ID_POPUP_GRID_LEVEL_1000 )
m_LastGridSizeId = ID_POPUP_GRID_LEVEL_1 - ID_POPUP_GRID_LEVEL_1000;
SetSize( m_FramePos.x, m_FramePos.y, m_FrameSize.x, m_FrameSize.y );
GetScreen()->SetGrid( ID_POPUP_GRID_LEVEL_1000 + m_LastGridSizeId );

View File

@ -1,9 +1,9 @@
/*
* This program source code file is part of KiCad, a free EDA CAD application.
*
* Copyright (C) 2007 Jean-Pierre Charras, jaen-pierre.charras@gipsa-lab.inpg.com
* Copyright (C) 2009-2011 Wayne Stambaugh <stambaughw@verizon.net>
* Copyright (C) 1992-2011 KiCad Developers, see AUTHORS.txt for contributors.
* Copyright (C) 2014 Jean-Pierre Charras, jp.charras at wanadoo.fr
* Copyright (C) 2009-2014 Wayne Stambaugh <stambaughw@verizon.net>
* Copyright (C) 1992-2014 KiCad Developers, see AUTHORS.txt for contributors.
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
@ -66,15 +66,15 @@ void SCH_EDIT_FRAME::ReCreateMenuBar()
// New
AddMenuItem( fileMenu,
ID_NEW_PROJECT,
_( "&New" ),
_( "New schematic project" ),
_( "&New Schematic Project" ),
_( "Clear current schematic hierarchy and start a new schematic root sheet" ),
KiBitmap( new_xpm ) );
// Open
text = AddHotkeyName( _( "&Open" ), s_Schematic_Hokeys_Descr, HK_LOAD_SCH );
text = AddHotkeyName( _( "&Open Schematic Project" ), s_Schematic_Hokeys_Descr, HK_LOAD_SCH );
AddMenuItem( fileMenu,
ID_LOAD_PROJECT, text,
_( "Open an existing schematic project" ),
_( "Open an existing schematic hierarchy" ),
KiBitmap( open_document_xpm ) );
// Open Recent submenu
@ -95,19 +95,19 @@ void SCH_EDIT_FRAME::ReCreateMenuBar()
// Import
AddMenuItem( fileMenu,
ID_APPEND_PROJECT, _( "&Append Schematic" ),
_( "Append another schematic project to the current loaded schematic" ),
ID_APPEND_PROJECT, _( "&Append Schematic Sheet" ),
_( "Append schematic sheet to current project" ),
KiBitmap( open_document_xpm ) );
// Separator
fileMenu->AppendSeparator();
// Save schematic project
text = AddHotkeyName( _( "&Save Whole Schematic Project" ),
text = AddHotkeyName( _( "&Save Schematic Project" ),
s_Schematic_Hokeys_Descr, HK_SAVE_SCH );
AddMenuItem( fileMenu,
ID_SAVE_PROJECT, text,
_( "Save all sheets in the schematic project" ),
_( "Save all sheets in schematic project" ),
KiBitmap( save_project_xpm ) );
// Save current sheet
@ -131,14 +131,14 @@ void SCH_EDIT_FRAME::ReCreateMenuBar()
AddMenuItem( fileMenu,
ID_SHEET_SET,
_( "Pa&ge Settings" ),
_( "Settigns for page size and information" ),
_( "Setting for sheet size and frame references" ),
KiBitmap( sheetset_xpm ) );
// Print
AddMenuItem( fileMenu,
wxID_PRINT,
_( "Pri&nt" ),
_( "Print schematic" ),
_( "Print schematic sheet" ),
KiBitmap( print_button_xpm ) );
#ifdef __WINDOWS__ // __WINDOWS__
@ -259,8 +259,8 @@ void SCH_EDIT_FRAME::ReCreateMenuBar()
// Hierarchy
AddMenuItem( viewMenu,
ID_HIERARCHY,
_( "&Hierarchy" ),
_( "Navigate schematic hierarchy" ),
_( "Show &Hierarchical Navigator" ),
_( "Navigate hierarchical sheets" ),
KiBitmap( hierarchy_nav_xpm ) );
// Redraw
@ -399,15 +399,15 @@ void SCH_EDIT_FRAME::ReCreateMenuBar()
// Library
AddMenuItem( preferencesMenu,
ID_CONFIG_REQ,
_( "&Library" ),
_( "Library preferences" ),
_( "Set Active &Libraries" ),
_( "Set active library list and library paths" ),
KiBitmap( library_xpm ) );
// Colors
AddMenuItem( preferencesMenu,
ID_COLORS_SETUP,
_( "&Colors" ),
_( "Color preferences" ),
_( "Set &Colors Scheme" ),
_( "Set color preferences" ),
KiBitmap( palette_xpm ) );
// Options (Preferences on WXMAC)
@ -417,8 +417,8 @@ void SCH_EDIT_FRAME::ReCreateMenuBar()
#else
AddMenuItem( preferencesMenu,
wxID_PREFERENCES,
_( "&Options" ),
_( "Eeschema preferences" ),
_( "Schematic Editor &Options" ),
_( "Set Eeschema preferences" ),
KiBitmap( preference_xpm ) );
#endif // __WXMAC__
@ -467,21 +467,21 @@ void SCH_EDIT_FRAME::ReCreateMenuBar()
// Annotate
AddMenuItem( toolsMenu,
ID_GET_ANNOTATE,
_( "&Annotate" ), HELP_ANNOTATE,
_( "&Annotate Schematic" ), HELP_ANNOTATE,
KiBitmap( annotate_xpm ) );
// ERC
AddMenuItem( toolsMenu,
ID_GET_ERC,
_( "ER&C" ),
_( "Electric Rules &Checker" ),
_( "Perform electrical rule check" ),
KiBitmap( erc_xpm ) );
// Generate netlist
AddMenuItem( toolsMenu,
ID_GET_NETLIST,
_( "Generate &Netlist" ),
_( "Generate the component netlist" ),
_( "Generate &Netlist File" ),
_( "Generate the component netlist file" ),
KiBitmap( netlist_xpm ) );
// Generate bill of materials
@ -497,7 +497,7 @@ void SCH_EDIT_FRAME::ReCreateMenuBar()
//Run CvPcb
AddMenuItem( toolsMenu,
ID_TO_CVPCB,
_( "A&ssign Component Footprints" ),
_( "A&ssign Component Footprint" ),
_( "Run CvPcb" ),
KiBitmap( cvpcb_xpm ) );
@ -517,14 +517,14 @@ void SCH_EDIT_FRAME::ReCreateMenuBar()
// Contents
AddMenuItem( helpMenu,
wxID_HELP,
_( "&Contents" ),
_( "Open the Eeschema handbook" ),
_( "Eesc&hema Manual" ),
_( "Open Eeschema manual" ),
KiBitmap( online_help_xpm ) );
AddMenuItem( helpMenu,
wxID_INDEX,
_( "&Getting Started in KiCad" ),
_( "Open the \"Getting Started in KiCad\" guide for beginners" ),
_( "Open \"Getting Started in KiCad\" guide for beginners" ),
KiBitmap( help_xpm ) );
// About Eeschema

View File

@ -59,11 +59,6 @@ void RotateListOfItems( PICKED_ITEMS_LIST& aItemsList, wxPoint& rotationPoint )
}
void DeleteItemsInList( EDA_DRAW_PANEL* panel, PICKED_ITEMS_LIST& aItemsList );
void DuplicateItemsInList( SCH_SCREEN* screen, PICKED_ITEMS_LIST& aItemsList,
const wxPoint aMoveVector );
void MirrorY( PICKED_ITEMS_LIST& aItemsList, wxPoint& aMirrorPoint )
{
for( unsigned ii = 0; ii < aItemsList.GetCount(); ii++ )

View File

@ -764,14 +764,14 @@ void SCH_COMPONENT::SetOrientation( int aOrientation )
m_transform.x2 = m_transform.y1 = 0;
break;
case CMP_ROTATE_CLOCKWISE: // Rotate + (incremental rotation)
case CMP_ROTATE_COUNTERCLOCKWISE: // Rotate + (incremental rotation)
temp.x1 = temp.y2 = 0;
temp.y1 = 1;
temp.x2 = -1;
transform = true;
break;
case CMP_ROTATE_COUNTERCLOCKWISE: // Rotate - (incremental rotation)
case CMP_ROTATE_CLOCKWISE: // Rotate - (incremental rotation)
temp.x1 = temp.y2 = 0;
temp.y1 = -1;
temp.x2 = 1;
@ -1534,8 +1534,7 @@ void SCH_COMPONENT::Rotate( wxPoint aPosition )
RotatePoint( &m_Pos, aPosition, 900 );
//SetOrientation( CMP_ROTATE_COUNTERCLOCKWISE );
SetOrientation( CMP_ROTATE_CLOCKWISE );
SetOrientation( CMP_ROTATE_COUNTERCLOCKWISE );
for( int ii = 0; ii < GetFieldCount(); ii++ )
{

View File

@ -701,7 +701,7 @@ static void abortMoveItem( EDA_DRAW_PANEL* aPanel, wxDC* aDC )
// Erase the wire representation before the 'normal' view is drawn.
if ( item->IsWireImage() )
item->Draw( aPanel, aDC, wxPoint( 0, 0 ), g_XorMode );
item->Draw( aPanel, aDC, wxPoint( 0, 0 ), g_XorMode );
item->ClearFlags();
}

View File

@ -173,6 +173,7 @@ END_EVENT_TABLE()
#define SCH_EDIT_FRAME_NAME wxT( "SchematicFrame" )
SCH_EDIT_FRAME::SCH_EDIT_FRAME( wxWindow* aParent, const wxString& aTitle,
const wxPoint& aPosition, const wxSize& aSize,
long aStyle ) :
@ -214,6 +215,13 @@ SCH_EDIT_FRAME::SCH_EDIT_FRAME( wxWindow* aParent, const wxString& aTitle,
/* Get config */
LoadSettings();
// Ensure m_LastGridSizeId is an offset inside the allowed schematic range
if( m_LastGridSizeId < ID_POPUP_GRID_LEVEL_50 - ID_POPUP_GRID_LEVEL_1000 )
m_LastGridSizeId = ID_POPUP_GRID_LEVEL_50 - ID_POPUP_GRID_LEVEL_1000;
if( m_LastGridSizeId > ID_POPUP_GRID_LEVEL_1 - ID_POPUP_GRID_LEVEL_1000 )
m_LastGridSizeId = ID_POPUP_GRID_LEVEL_1 - ID_POPUP_GRID_LEVEL_1000;
SetSize( m_FramePos.x, m_FramePos.y, m_FrameSize.x, m_FrameSize.y );
if( m_canvas )
@ -534,12 +542,6 @@ double SCH_EDIT_FRAME::BestZoom()
}
/* Build a filename that can be used in plot and print functions
* for the current sheet path.
* This filename is unique and must be used instead of the screen filename
* when one must creates file for each sheet in the hierarchy,
* because in complex hierarchies a sheet and a SCH_SCREEN is used more than once
*/
wxString SCH_EDIT_FRAME::GetUniqueFilenameForCurrentSheet()
{
wxFileName fn = GetScreen()->GetFileName();
@ -582,11 +584,6 @@ void SCH_EDIT_FRAME::OnModify()
}
/*****************************************************************************
* Enable or disable menu entry and toolbar buttons according to current
* conditions.
*****************************************************************************/
void SCH_EDIT_FRAME::OnUpdateBlockSelected( wxUpdateUIEvent& event )
{
bool enable = ( GetScreen() && GetScreen()->m_BlockLocate.GetCommand() == BLOCK_MOVE );
@ -782,9 +779,11 @@ void SCH_EDIT_FRAME::OnOpenCvpcb( wxCommandEvent& event )
}
}
void SCH_EDIT_FRAME::OnOpenLibraryEditor( wxCommandEvent& event )
{
SCH_COMPONENT* component = NULL;
if( event.GetId() == ID_POPUP_SCH_CALL_LIBEDIT_AND_LOAD_CMP )
{
SCH_ITEM* item = GetScreen()->GetCurItem();
@ -861,6 +860,7 @@ void SCH_EDIT_FRAME::OnPrint( wxCommandEvent& event )
}
}
void SCH_EDIT_FRAME::PrintPage( wxDC* aDC, LAYER_MSK aPrintMask, bool aPrintMirrorMode,
void* aData )
{
@ -975,7 +975,7 @@ void SCH_EDIT_FRAME::addCurrentItemToList( wxDC* aDC )
// Erase the wire representation before the 'normal' view is drawn.
if ( item->IsWireImage() )
item->Draw( m_canvas, aDC, wxPoint( 0, 0 ), g_XorMode );
item->Draw( m_canvas, aDC, wxPoint( 0, 0 ), g_XorMode );
item->ClearFlags();
screen->SetModify();
@ -993,13 +993,7 @@ void SCH_EDIT_FRAME::addCurrentItemToList( wxDC* aDC )
}
}
/* sets the main window title bar text.
* If file name defined by SCH_SCREEN::m_FileName is not set, the title is set to the
* application name appended with no file.
* Otherwise, the title is set to the hierarchical sheet path and the full file name,
* and read only is appended to the title if the user does not have write
* access to the file.
*/
void SCH_EDIT_FRAME::UpdateTitle()
{
wxString title;

View File

@ -195,7 +195,7 @@ void SCH_EDIT_FRAME::ReCreateVToolbar()
m_drawToolBar->AddTool( ID_HIERARCHY_PUSH_POP_BUTT, wxEmptyString,
KiBitmap( hierarchy_cursor_xpm ),
_( "Ascend or descend hierarchy" ), wxITEM_CHECK );
_( "Ascend/descend hierarchy" ), wxITEM_CHECK );
m_drawToolBar->AddTool( ID_SCH_PLACE_COMPONENT, wxEmptyString, KiBitmap( add_component_xpm ),
HELP_PLACE_COMPONENTS, wxITEM_CHECK );
@ -251,7 +251,7 @@ void SCH_EDIT_FRAME::ReCreateVToolbar()
HELP_PLACE_GRAPHICTEXTS, wxITEM_CHECK );
m_drawToolBar->AddTool( ID_ADD_IMAGE_BUTT, wxEmptyString, KiBitmap( image_xpm ),
_("Add a bitmap image"), wxITEM_CHECK );
_("Add bitmap image"), wxITEM_CHECK );
m_drawToolBar->AddTool( ID_SCHEMATIC_DELETE_ITEM_BUTT, wxEmptyString,
KiBitmap( delete_xpm ),
@ -282,11 +282,11 @@ void SCH_EDIT_FRAME::ReCreateOptToolbar()
m_optionsToolBar->AddTool( ID_TB_OPTIONS_SELECT_UNIT_INCH, wxEmptyString,
KiBitmap( unit_inch_xpm ),
_( "Units in inches" ), wxITEM_CHECK );
_( "Set unit to inch" ), wxITEM_CHECK );
m_optionsToolBar->AddTool( ID_TB_OPTIONS_SELECT_UNIT_MM, wxEmptyString,
KiBitmap( unit_mm_xpm ),
_( "Units in millimeters" ), wxITEM_CHECK );
_( "Set unit to mm" ), wxITEM_CHECK );
m_optionsToolBar->AddTool( ID_TB_OPTIONS_SELECT_CURSOR, wxEmptyString,
KiBitmap( cursor_shape_xpm ),

View File

@ -402,16 +402,24 @@ void LIB_VIEW_FRAME::ClickOnLibList( wxCommandEvent& event )
if( ii < 0 )
return;
wxString name = m_libList->GetString( ii );
SetSelectedLibrary( m_libList->GetString( ii ) );
}
if( m_libraryName == name )
void LIB_VIEW_FRAME::SetSelectedLibrary( const wxString& aLibraryName )
{
if( m_libraryName == aLibraryName )
return;
m_libraryName = name;
m_libraryName = aLibraryName;
ReCreateListCmp();
m_canvas->Refresh();
DisplayLibInfos();
ReCreateHToolbar();
// Ensure the corresponding line in m_libList is selected
// (which is not necessary the case if SetSelectedLibrary is called
// by an other caller than ClickOnLibList.
m_libList->SetStringSelection( m_libraryName, true );
}
@ -422,11 +430,19 @@ void LIB_VIEW_FRAME::ClickOnCmpList( wxCommandEvent& event )
if( ii < 0 )
return;
wxString name = m_cmpList->GetString( ii );
SetSelectedComponent( m_cmpList->GetString( ii ) );
}
if( m_entryName.CmpNoCase( name ) != 0 )
void LIB_VIEW_FRAME::SetSelectedComponent( const wxString& aComponentName )
{
if( m_entryName.CmpNoCase( aComponentName ) != 0 )
{
m_entryName = name;
m_entryName = aComponentName;
// Ensure the corresponding line in m_cmpList is selected
// (which is not necessary the case if SetSelectedComponent is called
// by an other caller than ClickOnCmpList.
m_cmpList->SetStringSelection( aComponentName, true );
DisplayLibInfos();
m_unit = 1;
m_convert = 1;
@ -436,6 +452,7 @@ void LIB_VIEW_FRAME::ClickOnCmpList( wxCommandEvent& event )
}
}
void LIB_VIEW_FRAME::DClickOnCmpList( wxCommandEvent& event )
{
if( m_semaphore )
@ -480,10 +497,10 @@ void LIB_VIEW_FRAME::LoadSettings( )
cfg->Read( CMPLIST_WIDTH_KEY, &m_cmpListWidth, 100 );
// Set parameters to a reasonable value.
if ( m_libListWidth > m_FrameSize.x/2 )
if( m_libListWidth > m_FrameSize.x/2 )
m_libListWidth = m_FrameSize.x/2;
if ( m_cmpListWidth > m_FrameSize.x/2 )
if( m_cmpListWidth > m_FrameSize.x/2 )
m_cmpListWidth = m_FrameSize.x/2;
}

View File

@ -47,29 +47,6 @@ class CMP_LIBRARY;
*/
class LIB_VIEW_FRAME : public SCH_BASE_FRAME
{
private:
wxComboBox* m_selpartBox;
// List of libraries (for selection )
wxListBox* m_libList; // The list of libs
int m_libListWidth; // Last width of the window
// List of components in the selected library
wxListBox* m_cmpList; // The list of components
int m_cmpListWidth; // Last width of the window
// Flags
wxSemaphore* m_semaphore; // != NULL if the frame must emulate a modal dialog
wxString m_configPath; // subpath for configuration
protected:
static wxString m_libraryName;
static wxString m_entryName;
static wxString m_exportToEeschemaCmpName; // When the viewer is used to select a component
// in schematic, the selected component is here
static int m_unit;
static int m_convert;
public:
LIB_VIEW_FRAME( SCH_BASE_FRAME* aParent, CMP_LIBRARY* aLibrary = NULL,
wxSemaphore* aSemaphore = NULL,
@ -134,11 +111,26 @@ public:
*/
void SaveSettings();
wxString& GetEntryName( void ) const { return m_entryName; }
wxString& GetSelectedComponent( void ) const { return m_exportToEeschemaCmpName; }
/**
* Set the selected library in the library window.
*
* @param aLibName name of the library to be selected.
*/
void SetSelectedLibrary( const wxString& aLibName );
static int GetUnit( void ) { return m_unit; }
static int GetConvert( void ) { return m_convert; }
/**
* Set the selected component.
*
* @param the alias name of the component to be selected.
*/
void SetSelectedComponent( const wxString& aComponentName );
const wxString& GetSelectedComponent( void ) const { return m_exportToEeschemaCmpName; }
void SetUnit( int aUnit ) { m_unit = aUnit; }
int GetUnit( void ) { return m_unit; }
void SetConvert( int aConvert ) { m_convert = aConvert; }
int GetConvert( void ) { return m_convert; }
private:
/**
@ -160,6 +152,33 @@ private:
bool OnRightClick( const wxPoint& MousePos, wxMenu* PopMenu );
void DClickOnCmpList( wxCommandEvent& event );
wxComboBox* m_selpartBox;
// List of libraries (for selection )
wxListBox* m_libList; // The list of libs
int m_libListWidth; // Last width of the window
// List of components in the selected library
wxListBox* m_cmpList; // The list of components
int m_cmpListWidth; // Last width of the window
// Flags
wxSemaphore* m_semaphore; // != NULL if the frame must emulate a modal dialog
wxString m_configPath; // subpath for configuration
// TODO(hzeller): looks like these members were chosen to be static to survive different
// instances of this browser and communicate it to the next instance. This looks like an
// ugly hack, and should be solved differently.
static wxString m_libraryName;
// TODO(hzeller): figure out what the difference between these is and the motivation to
// have this distinction. Shouldn't these essentially be the same ?
static wxString m_entryName;
static wxString m_exportToEeschemaCmpName; // When the viewer is used to select a component
// in schematic, the selected component is here
static int m_unit;
static int m_convert;
DECLARE_EVENT_TABLE()
};

View File

@ -31,7 +31,7 @@ class PAGE_INFO;
class TITLE_BLOCK;
class LIB_VIEW_FRAME;
class LIB_EDIT_FRAME;
class LIB_ALIAS;
/**
* Class SCH_BASE_FRAME
@ -80,9 +80,15 @@ protected:
* Calls the library viewer to select component to import into schematic.
* if the library viewer is currently running, it is closed and reopened
* in modal mode.
* @param aPreslectedAlias Preselected component alias. NULL if none.
* @param aUnit Pointer to Unit-number. Input is the pre-selected unit, output
* is the finally selected unit by the user. Can be NULL.
* @param aConvert Pointer to deMorgan conversion. Input is what is pre-selected,
* output is the finally selected deMorgan type by the user.
* @return the component name
*/
wxString SelectComponentFromLibBrowser( void );
wxString SelectComponentFromLibBrowser( LIB_ALIAS* aPreselectedAlias,
int* aUnit, int* aConvert );
/**
* Function SelectComponentFromLib

View File

@ -279,6 +279,7 @@ public:
void OnUpdateSelectAutoTrackWidth( wxUpdateUIEvent& aEvent );
void OnUpdateAutoPlaceModulesMode( wxUpdateUIEvent& aEvent );
void OnUpdateAutoPlaceTracksMode( wxUpdateUIEvent& aEvent );
void OnUpdateMuWaveToolbar( wxUpdateUIEvent& aEvent );
/**
* Function RecordMacros.

View File

@ -64,27 +64,27 @@ void LAUNCHER_PANEL::CreateCommandToolbar( void )
wxBitmapButton* btn;
btn = AddBitmapButton( ID_TO_EESCHEMA, KiBitmap( icon_eeschema_xpm ) );
btn->SetToolTip( _( "Eeschema (Schematic editor)" ) );
btn->SetToolTip( _( "Eeschema - Electronic schematic editor" ) );
btn = AddBitmapButton( ID_TO_CVPCB, KiBitmap( icon_cvpcb_xpm ) );
btn->SetToolTip( _( "CvPcb (Components to modules)" ) );
btn->SetToolTip( _( "CvPcb - Associate footprint to components" ) );
btn = AddBitmapButton( ID_TO_PCB, KiBitmap( icon_pcbnew_xpm ) );
btn->SetToolTip( _( "Pcbnew (PCB editor)" ) );
btn->SetToolTip( _( "Pcbnew - Printed circuit board editor" ) );
btn = AddBitmapButton( ID_TO_GERBVIEW, KiBitmap( icon_gerbview_xpm ) );
btn->SetToolTip( _( "GerbView (Gerber viewer)" ) );
btn->SetToolTip( _( "GerbView - Gerber viewer" ) );
btn = AddBitmapButton( ID_TO_BITMAP_CONVERTER, KiBitmap( icon_bitmap2component_xpm ) );
btn->SetToolTip( _(
"Bitmap2Component (a tool to build a logo from a bitmap)\n\
Creates a component (for Eeschema) or a footprint (for Pcbnew) that shows a B&W picture" ) );
"Bitmap2Component - Convert bitmap images to Eeschema\n"
"or Pcbnew elements" ) );
btn = AddBitmapButton( ID_TO_PCB_CALCULATOR, KiBitmap( icon_pcbcalculator_xpm ) );
btn->SetToolTip( _( "Pcb calculator, the Swiss army knife..." ) );
btn->SetToolTip( _( "Pcb calculator - Calculator for components, track width, etc." ) );
btn = AddBitmapButton( ID_TO_PL_EDITOR, KiBitmap( icon_pagelayout_editor_xpm ) );
btn->SetToolTip( _( "pl_editor, the page layout and title block shape editor" ) );
btn->SetToolTip( _( "Pl editor - Worksheet layout editor" ) );
}

View File

@ -123,8 +123,8 @@ void KICAD_MANAGER_FRAME::ReCreateMenuBar()
// Open
AddMenuItem( fileMenu,
ID_LOAD_PROJECT,
_( "&Open\tCtrl+O" ),
_( "Open an existing project" ),
_( "&Open Project\tCtrl+O" ),
_( "Open existing project" ),
KiBitmap( open_project_xpm ) );
// File history
@ -134,25 +134,25 @@ void KICAD_MANAGER_FRAME::ReCreateMenuBar()
AddMenuItem( fileMenu, openRecentMenu,
wxID_ANY,
_( "Open &Recent" ),
_( "Open a recent opened schematic project" ),
_( "Open recent schematic project" ),
KiBitmap( open_project_xpm ) );
// New
wxMenu* newMenu = new wxMenu();
AddMenuItem( newMenu, ID_NEW_PROJECT,
_( "&Blank\tCtrl+N" ),
_( "Start a blank project" ),
_( "&Blank Project\tCtrl+N" ),
_( "Create blank project" ),
KiBitmap( new_project_xpm ) );
AddMenuItem( newMenu, ID_NEW_PROJECT_FROM_TEMPLATE,
_( "New from &Template\tCtrl+T" ),
_( "Start a new project from a template" ),
_( "Project from &Template\tCtrl+T" ),
_( "Create new project from template" ),
KiBitmap( new_project_with_template_xpm ) );
AddMenuItem( fileMenu, newMenu,
wxID_ANY,
_( "New" ),
_( "Start a new project" ),
_( "Create new project" ),
KiBitmap( new_project_xpm ) );
// Save
@ -193,15 +193,15 @@ void KICAD_MANAGER_FRAME::ReCreateMenuBar()
// Text editor
AddMenuItem( browseMenu,
ID_TO_EDITOR,
_( "Text E&ditor" ),
_( "Open Text E&ditor" ),
_( "Launch preferred text editor" ),
KiBitmap( editor_xpm ) );
// View file
AddMenuItem( browseMenu,
ID_BROWSE_AN_SELECT_FILE,
_( "&View File" ),
_( "View, read or edit file with a text editor" ),
_( "&Open Local File" ),
_( "Edit local file" ),
KiBitmap( browse_files_xpm ) );
// Menu Preferences:
@ -210,8 +210,8 @@ void KICAD_MANAGER_FRAME::ReCreateMenuBar()
// Text editor
AddMenuItem( preferencesMenu,
ID_SELECT_PREFERED_EDITOR,
_( "&Text Editor" ),
_( "Select your preferred text editor" ),
_( "&Set Text Editor" ),
_( "Set your preferred text editor" ),
KiBitmap( editor_xpm ) );
// PDF Viewer submenu:System browser or user defined checkbox
@ -219,8 +219,8 @@ void KICAD_MANAGER_FRAME::ReCreateMenuBar()
// Default
AddMenuItem( SubMenuPdfBrowserChoice, ID_SELECT_DEFAULT_PDF_BROWSER,
_( "&Default" ),
_( "Use system default PDF viewer used to browse datasheets" ),
_( "System &Default PDF Viewer" ),
_( "Use system default PDF viewer" ),
KiBitmap( datasheet_xpm ),
wxITEM_CHECK );
SubMenuPdfBrowserChoice->Check( ID_SELECT_DEFAULT_PDF_BROWSER,
@ -228,8 +228,8 @@ void KICAD_MANAGER_FRAME::ReCreateMenuBar()
// Favourite
AddMenuItem( SubMenuPdfBrowserChoice, ID_SELECT_PREFERED_PDF_BROWSER,
_( "&Favourite" ),
_( "Use your favourite PDF viewer used to browse datasheets" ),
_( "&Favourite PDF Viewer" ),
_( "Use favourite PDF viewer" ),
KiBitmap( datasheet_xpm ),
wxITEM_CHECK );
SubMenuPdfBrowserChoice->Check( ID_SELECT_PREFERED_PDF_BROWSER,
@ -239,8 +239,8 @@ void KICAD_MANAGER_FRAME::ReCreateMenuBar()
// Append PDF Viewer submenu to preferences
AddMenuItem( SubMenuPdfBrowserChoice,
ID_SELECT_PREFERED_PDF_BROWSER_NAME,
_( "Select &PDF Viewer" ),
_( "Select your favourite PDF viewer used to browse datasheets" ),
_( "Set &PDF Viewer" ),
_( "Set favourite PDF viewer" ),
KiBitmap( datasheet_xpm ) );
// PDF viewer submenu
@ -261,13 +261,13 @@ void KICAD_MANAGER_FRAME::ReCreateMenuBar()
// Contents
AddMenuItem( helpMenu, wxID_HELP,
_( "&Contents" ),
_( "Open the KiCad handbook" ),
_( "KiCad Manual" ),
_( "Open KiCad user manual" ),
KiBitmap( online_help_xpm ) );
AddMenuItem( helpMenu, wxID_INDEX,
_( "&Getting Started in KiCad" ),
_( "Open the \"Getting Started in KiCad\" guide for beginners" ),
_( "Open \"Getting Started in KiCad\" guide for beginners" ),
KiBitmap( help_xpm ) );
// Separator
@ -311,16 +311,16 @@ void KICAD_MANAGER_FRAME::RecreateBaseHToolbar()
// New
m_mainToolBar->AddTool( ID_NEW_PROJECT, wxEmptyString,
KiBitmap( new_project_xpm ),
_( "Start a new project" ) );
_( "Create new project" ) );
m_mainToolBar->AddTool( ID_NEW_PROJECT_FROM_TEMPLATE, wxEmptyString,
KiBitmap( new_project_with_template_xpm ),
_( "Start a new project from a template" ) );
_( "Create new project from template" ) );
// Load
m_mainToolBar->AddTool( ID_LOAD_PROJECT, wxEmptyString,
KiBitmap( open_project_xpm ),
_( "Load existing project" ) );
_( "Open existing project" ) );
// Save
m_mainToolBar->AddTool( ID_SAVE_PROJECT, wxEmptyString,

View File

@ -17,27 +17,31 @@
; General Product Description Definitions
!define PRODUCT_NAME "KiCad"
!define PRODUCT_VERSION "2013.03.13"
!define PRODUCT_WEB_SITE "http://iut-tice.ujf-grenoble.fr/kicad/"
!define SOURCEFORGE_WEB_SITE "http://kicad.sourceforge.net/"
!define PRODUCT_VERSION "2014.03.05"
!define ALT_DOWNLOAD_WEB_SITE "http://iut-tice.ujf-grenoble.fr/kicad/"
!define LIBRARIES_WEB_SITE "https://github.com/KiCad/"
!define KICAD_MAIN_SITE "www.kicad-pcb.org/"
!define COMPANY_NAME ""
!define TRADE_MARKS ""
!define COPYRIGHT "Kicad Developers Team"
!define COMMENTS ""
!define HELP_WEB_SITE "http://groups.yahoo.com/group/kicad-users/"
!define DEVEL_WEB_SITE "https://launchpad.net/~kicad-developers/"
!define DEVEL_WEB_SITE "https://launchpad.net/kicad/"
!define WINGS3D_WEB_SITE "http://www.wings3d.com"
!define PRODUCT_UNINST_KEY "Software\Microsoft\Windows\CurrentVersion\Uninstall\${PRODUCT_NAME}"
!define UNINST_ROOT "HKLM"
;Comment out the following SetCompressor command while testing this script
SetCompressor /final /solid lzma
;SetCompressor /final /solid lzma
CRCCheck force
XPStyle on
Name "${PRODUCT_NAME} ${PRODUCT_VERSION}"
OutFile "${PRODUCT_NAME}_stable-${PRODUCT_VERSION}-BZR4000_Win_full_version.exe"
InstallDir "$PROGRAMFILES\KiCad"
OutFile "${PRODUCT_NAME}_stable-${PRODUCT_VERSION}-BZR4xxx_Win_full_version.exe"
;InstallDir "$PROGRAMFILES\KiCad"
InstallDir "C:\KiCad"
ShowInstDetails hide
ShowUnInstDetails hide
@ -72,21 +76,25 @@ ShowUnInstDetails hide
!insertmacro MUI_UNPAGE_INSTFILES
; Language files
; - To add another language; add an insert macro line here and inlcude a language file as below
; - To add another language; add an insert macro line here and include a language file as below
; - This must be after all page macros have been inserted
!insertmacro MUI_LANGUAGE "English" ;first language is the default language
!insertmacro MUI_LANGUAGE "French"
!insertmacro MUI_LANGUAGE "Italian"
!insertmacro MUI_LANGUAGE "Polish"
!insertmacro MUI_LANGUAGE "Portuguese"
!insertmacro MUI_LANGUAGE "Dutch"
!insertmacro MUI_LANGUAGE "Russian"
!insertmacro MUI_LANGUAGE "Japanese"
!include "English.nsh"
!include "French.nsh"
!include "Polish.nsh"
!include "Dutch.nsh"
!include "Russian.nsh"
!include "Italian.nsh"
!include "Japanese.nsh"
!include "Polish.nsh"
!include "Portuguese.nsh"
!include "Russian.nsh"
; MUI end ------
@ -150,20 +158,22 @@ SectionEnd
Section -CreateShortcuts
SetOutPath $INSTDIR
WriteIniStr "$INSTDIR\HomePage.url" "InternetShortcut" "URL" "${PRODUCT_WEB_SITE}"
WriteIniStr "$INSTDIR\SourceForge.url" "InternetShortcut" "URL" "${SOURCEFORGE_WEB_SITE}"
WriteIniStr "$INSTDIR\UserGroup.url" "InternetShortcut" "URL" "${HELP_WEB_SITE}"
WriteIniStr "$INSTDIR\DevelGroup.url" "InternetShortcut" "URL" "${DEVEL_WEB_SITE}"
WriteIniStr "$INSTDIR\Wings3D.url" "InternetShortcut" "URL" "${WINGS3D_WEB_SITE}"
WriteIniStr "$INSTDIR\HomePage.url" "InternetShortcut" "URL" "${KICAD_MAIN_SITE}"
WriteIniStr "$INSTDIR\AltDownloadSite.url" "InternetShortcut" "URL" "${ALT_DOWNLOAD_WEB_SITE}"
WriteIniStr "$INSTDIR\UserGroup.url" "InternetShortcut" "URL" "${HELP_WEB_SITE}"
WriteIniStr "$INSTDIR\DevelGroup.url" "InternetShortcut" "URL" "${DEVEL_WEB_SITE}"
WriteIniStr "$INSTDIR\LibrariesGroup.url" "InternetShortcut" "URL" "${LIBRARIES_WEB_SITE}"
WriteIniStr "$INSTDIR\Wings3D.url" "InternetShortcut" "URL" "${WINGS3D_WEB_SITE}"
SetShellVarContext all
CreateDirectory "$SMPROGRAMS\KiCad"
CreateShortCut "$SMPROGRAMS\KiCad\Home Page.lnk" "$INSTDIR\HomePage.url"
CreateShortCut "$SMPROGRAMS\KiCad\Kicad SourceForge.lnk" "$INSTDIR\SourceForge.url"
CreateShortCut "$SMPROGRAMS\KiCad\Kicad Alternate Download.lnk" "$INSTDIR\AltDownloadSite.url"
CreateShortCut "$SMPROGRAMS\KiCad\Kicad Libraries.lnk" "$INSTDIR\LibrariesGroup.url"
CreateShortCut "$SMPROGRAMS\KiCad\Wings3D.lnk" "$INSTDIR\Wings3D.url"
CreateShortCut "$SMPROGRAMS\KiCad\User Group.lnk" "$INSTDIR\UserGroup.url"
CreateShortCut "$SMPROGRAMS\KiCad\Devel Group.lnk" "$INSTDIR\DevelGroup.url"
CreateShortCut "$SMPROGRAMS\KiCad\Uninstall.lnk" "$INSTDIR\uninstaller.exe"
CreateShortCut "$SMPROGRAMS\KiCad\KiCad.lnk" "$INSTDIR\bin\kicad.exe"
CreateShortCut "$SMPROGRAMS\KiCad\Wings3D.lnk" "$INSTDIR\Wings3D.url"
CreateShortCut "$DESKTOP\KiCad.lnk" "$INSTDIR\bin\kicad.exe"
SectionEnd
@ -172,13 +182,13 @@ Section -CreateAddRemoveEntry
WriteRegStr ${UNINST_ROOT} "${PRODUCT_UNINST_KEY}" "DisplayVersion" "${PRODUCT_VERSION}"
WriteRegStr ${UNINST_ROOT} "${PRODUCT_UNINST_KEY}" "Publisher" "${COMPANY_NAME}"
WriteRegStr ${UNINST_ROOT} "${PRODUCT_UNINST_KEY}" "UninstallString" "$INSTDIR\uninstaller.exe"
WriteRegStr ${UNINST_ROOT} "${PRODUCT_UNINST_KEY}" "URLInfoAbout" "${PRODUCT_WEB_SITE}"
WriteRegStr ${UNINST_ROOT} "${PRODUCT_UNINST_KEY}" "URLInfoAbout" "${KICAD_MAIN_SITE}"
WriteRegStr ${UNINST_ROOT} "${PRODUCT_UNINST_KEY}" "DisplayIcon" "$INSTDIR\bin\kicad.exe"
WriteRegDWORD ${UNINST_ROOT} "${PRODUCT_UNINST_KEY}" "NoModify" "1"
WriteRegDWORD ${UNINST_ROOT} "${PRODUCT_UNINST_KEY}" "NoRepair" "1"
WriteRegStr ${UNINST_ROOT} "${PRODUCT_UNINST_KEY}" "Comments" "${COMMENTS}"
WriteRegStr ${UNINST_ROOT} "${PRODUCT_UNINST_KEY}" "HelpLink" "${HELP_WEB_SITE}"
WriteRegStr ${UNINST_ROOT} "${PRODUCT_UNINST_KEY}" "URLUpdateInfo" "${PRODUCT_WEB_SITE}"
WriteRegStr ${UNINST_ROOT} "${PRODUCT_UNINST_KEY}" "URLUpdateInfo" "${KICAD_MAIN_SITE}"
WriteRegStr ${UNINST_ROOT} "${PRODUCT_UNINST_KEY}" "InstallLocation" "$INSTDIR"
WriteUninstaller "$INSTDIR\uninstaller.exe"
@ -213,6 +223,9 @@ Section Uninstall
;remove start menu shortcuts and web page links
SetShellVarContext all
Delete "$SMPROGRAMS\KiCad\Home Page.lnk"
Delete "$SMPROGRAMS\KiCad\Kicad Libraries.lnk"
Delete "$SMPROGRAMS\KiCad\Kicad Alternate Download.lnk"
Delete "$SMPROGRAMS\KiCad\Devel Group.lnk"
Delete "$SMPROGRAMS\KiCad\User Group.lnk"
Delete "$SMPROGRAMS\KiCad\Uninstall.lnk"
Delete "$SMPROGRAMS\KiCad\KiCad.lnk"
@ -221,6 +234,9 @@ Section Uninstall
Delete "$INSTDIR\Wings3D.url"
Delete "$INSTDIR\HomePage.url"
Delete "$INSTDIR\UserGroup.url"
Delete "$INSTDIR\AltDownloadSite.url"
Delete "$INSTDIR\DevelGroup.url"
Delete "$INSTDIR\LibrariesGroup.url"
RMDir "$SMPROGRAMS\KiCad"
;remove all program files now

View File

@ -4,6 +4,10 @@ set( MAKE_LINK_MAPS false )
add_definitions( -DPCBNEW )
add_subdirectory(router)
# psnrouter depends on make_lexer outputs in common (bug # 1285878 )
add_dependencies( pnsrouter pcbcommon )
if( KICAD_SCRIPTING OR KICAD_SCRIPTING_MODULES )
file( MAKE_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/scripting )
find_package( SWIG REQUIRED )
@ -513,6 +517,7 @@ make_lexer(
add_subdirectory( pcad2kicadpcb_plugin )
if( BUILD_GITHUB_PLUGIN )
add_subdirectory( github )
add_dependencies( github_plugin lib-dependencies )
endif()
@ -526,6 +531,7 @@ add_executable( pcbnew WIN32 MACOSX_BUNDLE
${PCBNEW_RESOURCES}
)
add_dependencies( pcbnew lib-dependencies )
###
# Set properties for APPLE on pcbnew target
###
@ -616,6 +622,13 @@ if( KICAD_SCRIPTING )
# fix bundle after copying wxpython, fixing and copying
add_dependencies( osx_fix_bundles pcbnew_copy_wxpython_scripting )
if ( KICAD_SCRIPTING_MODULES )
#they do more or less the same job, avoid race between them
#Cmake copy goes in error otherwise
add_dependencies( pcbnew_copy_wxpython_scripting pcbnew_copy_wxpython_module )
endif()
endif()
endif()

View File

@ -184,23 +184,23 @@ void PCB_EDIT_FRAME::SpreadFootprints( bool aFootprintsOutsideBoardOnly )
// Build candidate list
// calculate also the area needed by these footprints
MODULE* Module = GetBoard()->m_Modules;
MODULE* module = GetBoard()->m_Modules;
std::vector <MODULE*> moduleList;
for( ; Module != NULL; Module = Module->Next() )
for( ; module != NULL; module = module->Next() )
{
Module->CalculateBoundingBox();
module->CalculateBoundingBox();
if( outsideBrdFilter )
{
if( bbox.Contains( Module->GetPosition() ) )
if( bbox.Contains( module->GetPosition() ) )
continue;
}
if( Module->IsLocked() )
if( module->IsLocked() )
continue;
moduleList.push_back(Module);
moduleList.push_back(module);
}
if( moduleList.size() == 0 ) // Nothing to do
@ -216,18 +216,17 @@ void PCB_EDIT_FRAME::SpreadFootprints( bool aFootprintsOutsideBoardOnly )
for( unsigned ii = 0; ii < moduleList.size(); ii++ )
{
Module = moduleList[ii];
module = moduleList[ii];
// Undo: add copy of module to undo list
picker.SetItem( Module );
picker.SetLink( Module->Clone() );
picker.SetItem( module );
picker.SetLink( module->Clone() );
undoList.PushItem( picker );
}
// Extract and place footprints by sheet
std::vector <MODULE*> moduleListBySheet;
std::vector <EDA_RECT> placementSheetAreas;
wxString curr_sheetPath ;
double subsurface;
double placementsurface = 0.0;
@ -253,22 +252,23 @@ void PCB_EDIT_FRAME::SpreadFootprints( bool aFootprintsOutsideBoardOnly )
for( int pass = 0; pass < 2; pass++ )
{
int subareaIdx = 0;
curr_sheetPath = moduleList[0]->GetPath().BeforeLast( '/' );
moduleListBySheet.clear();
subsurface = 0.0;
for( unsigned ii = 0; ii < moduleList.size(); ii++ )
{
Module = moduleList[ii];
bool iscurrPath = curr_sheetPath == moduleList[ii]->GetPath().BeforeLast( '/' );
module = moduleList[ii];
bool islastItem = false;
if( iscurrPath )
{
moduleListBySheet.push_back( Module );
subsurface += Module->GetArea();
}
if( ii == moduleList.size() - 1 ||
( moduleList[ii]->GetPath().BeforeLast( '/' ) !=
moduleList[ii+1]->GetPath().BeforeLast( '/' ) ) )
islastItem = true;
if( !iscurrPath || (ii == moduleList.size()-1) )
moduleListBySheet.push_back( module );
subsurface += module->GetArea();
if( islastItem )
{
// end of the footprint sublist relative to the same sheet path
// calculate placement of the current sublist
@ -306,14 +306,9 @@ void PCB_EDIT_FRAME::SpreadFootprints( bool aFootprintsOutsideBoardOnly )
sub_area.GetHeight();
}
curr_sheetPath = moduleList[ii]->GetPath().BeforeLast( '/' );
// Prepare buffers for next sheet
subsurface = 0.0;
moduleListBySheet.clear();
// Enter first module of next sheet
moduleListBySheet.push_back( Module );
subsurface += Module->GetArea();
subareaIdx++;
}
}
@ -350,7 +345,14 @@ void PCB_EDIT_FRAME::SpreadFootprints( bool aFootprintsOutsideBoardOnly )
}
// Sort function, used to group footprints by sheet.
// Footprints are sorted by their sheet path.
// (the full sheet path restricted to the time stamp of the sheet itself,
// without the time stamp of the footprint ).
static bool sortModulesbySheetPath( MODULE* ref, MODULE* compare )
{
return compare->GetPath().Cmp( ref->GetPath() ) < 0;
if( ref->GetPath().Length() == compare->GetPath().Length() )
return ref->GetPath().BeforeLast( '/' ).Cmp( compare->GetPath().BeforeLast( '/' ) ) < 0;
return ref->GetPath().Length() < compare->GetPath().Length();
}

View File

@ -23,6 +23,21 @@
#include <class_edge_mod.h>
#include <convert_basic_shapes_to_polygon.h>
// These variables are parameters used in addTextSegmToPoly.
// But addTextSegmToPoly is a call-back function,
// so we cannot send them as arguments.
int s_textWidth;
int s_textCircle2SegmentCount;
CPOLYGONS_LIST* s_cornerBuffer;
// This is a call back function, used by DrawGraphicText to draw the 3D text shape:
static void addTextSegmToPoly( int x0, int y0, int xf, int yf )
{
TransformRoundedEndsSegmentToPolygon( *s_cornerBuffer,
wxPoint( x0, y0), wxPoint( xf, yf ),
s_textCircle2SegmentCount, s_textWidth );
}
/* generate pads shapes on layer aLayer as polygons,
* and adds these polygons to aCornerBuffer
* aCornerBuffer = the buffer to store polygons
@ -91,12 +106,16 @@ void MODULE::TransformGraphicShapesWithClearanceToPolygonSet(
int aCircleToSegmentsCount,
double aCorrectionFactor )
{
std::vector<TEXTE_MODULE *> texts; // List of TEXTE_MODULE to convert
EDGE_MODULE* outline;
for( EDA_ITEM* item = GraphicalItems(); item != NULL; item = item->Next() )
{
switch( item->Type() )
{
case PCB_MODULE_TEXT_T:
if( ((TEXTE_MODULE*)item)->GetLayer() == aLayer )
texts.push_back( (TEXTE_MODULE *) item );
break;
case PCB_MODULE_EDGE_T:
@ -153,6 +172,33 @@ void MODULE::TransformGraphicShapesWithClearanceToPolygonSet(
break;
}
}
// Convert texts sur modules
if( Reference().GetLayer() == aLayer && Reference().IsVisible() )
texts.push_back( &Reference() );
if( Value().GetLayer() == aLayer && Value().IsVisible() )
texts.push_back( &Value() );
s_cornerBuffer = &aCornerBuffer;
s_textCircle2SegmentCount = aCircleToSegmentsCount;
for( unsigned ii = 0; ii < texts.size(); ii++ )
{
TEXTE_MODULE *textmod = texts[ii];
s_textWidth = textmod->GetThickness() + ( 2 * aInflateValue );
wxSize size = textmod->GetSize();
if( textmod->IsMirrored() )
NEGATE( size.x );
DrawGraphicText( NULL, NULL, textmod->GetTextPosition(), BLACK,
textmod->GetText(), textmod->GetDrawRotation(), size,
textmod->GetHorizJustify(), textmod->GetVertJustify(),
textmod->GetThickness(), textmod->IsItalic(),
true, addTextSegmToPoly );
}
}
/* Function TransformSolidAreasShapesToPolygonSet
@ -257,20 +303,6 @@ void TEXTE_PCB::TransformBoundingBoxWithClearanceToPolygon(
* clearance when the circle is approximated by segment bigger or equal
* to the real clearance value (usually near from 1.0)
*/
// These variables are parameters used in addTextSegmToPoly.
// But addTextSegmToPoly is a call-back function,
// so we cannot send them as arguments.
int s_textWidth;
int s_textCircle2SegmentCount;
CPOLYGONS_LIST* s_cornerBuffer;
// This is a call back function, used by DrawGraphicText to draw the 3D text shape:
static void addTextSegmToPoly( int x0, int y0, int xf, int yf )
{
TransformRoundedEndsSegmentToPolygon( *s_cornerBuffer,
wxPoint( x0, y0), wxPoint( xf, yf ),
s_textCircle2SegmentCount, s_textWidth );
}
void TEXTE_PCB::TransformShapeWithClearanceToPolygonSet(
CPOLYGONS_LIST& aCornerBuffer,
@ -309,7 +341,7 @@ void TEXTE_PCB::TransformShapeWithClearanceToPolygonSet(
}
else
{
DrawGraphicText( NULL, NULL, GetTextPosition(), (EDA_COLOR_T) color,
DrawGraphicText( NULL, NULL, GetTextPosition(), color,
GetText(), GetOrientation(), size,
GetHorizJustify(), GetVertJustify(),
GetThickness(), IsItalic(),

View File

@ -47,6 +47,7 @@
#define PrecisionKey wxT( "DrilltPrecisionOpt" )
#define MirrorKey wxT( "DrillMirrorYOpt" )
#define MinimalHeaderKey wxT( "DrillMinHeader" )
#define MergePTHNPTHKey wxT( "DrillMergePTHNPTH" )
#define UnitDrillInchKey wxT( "DrillUnit" )
#define DrillOriginIsAuxAxisKey wxT( "DrillAuxAxis" )
#define DrillMapFileTypeKey wxT( "DrillMapFileType" )
@ -68,7 +69,6 @@ void PCB_EDIT_FRAME::InstallDrillFrame( wxCommandEvent& event )
}
DIALOG_GENDRILL::DIALOG_GENDRILL( PCB_EDIT_FRAME* parent ) :
DIALOG_GENDRILL_BASE( parent )
{
@ -88,6 +88,7 @@ int DIALOG_GENDRILL::m_UnitDrillIsInch = true;
int DIALOG_GENDRILL::m_ZerosFormat = EXCELLON_WRITER::DECIMAL_FORMAT;
bool DIALOG_GENDRILL::m_MinimalHeader = false;
bool DIALOG_GENDRILL::m_Mirror = false;
bool DIALOG_GENDRILL::m_Merge_PTH_NPTH = false;
bool DIALOG_GENDRILL::m_DrillOriginIsAuxAxis = false;
int DIALOG_GENDRILL::m_mapFileType = 1;
@ -102,6 +103,7 @@ void DIALOG_GENDRILL::initDialog()
{
m_config->Read( ZerosFormatKey, &m_ZerosFormat );
m_config->Read( MirrorKey, &m_Mirror );
m_config->Read( MergePTHNPTHKey, &m_Merge_PTH_NPTH );
m_config->Read( MinimalHeaderKey, &m_MinimalHeader );
m_config->Read( UnitDrillInchKey, &m_UnitDrillIsInch );
m_config->Read( DrillOriginIsAuxAxisKey, &m_DrillOriginIsAuxAxis );
@ -124,6 +126,7 @@ void DIALOG_GENDRILL::InitDisplayParams()
m_Choice_Drill_Offset->SetSelection( 1 );
m_Check_Mirror->SetValue( m_Mirror );
m_Check_Merge_PTH_NPTH->SetValue( m_Merge_PTH_NPTH );
m_Choice_Drill_Map->SetSelection( m_mapFileType );
m_ViaDrillValue->SetLabel( _( "Use Netclasses values" ) );
m_MicroViaDrillValue->SetLabel( _( "Use Netclasses values" ) );
@ -213,6 +216,7 @@ void DIALOG_GENDRILL::UpdateConfig()
m_config->Write( ZerosFormatKey, m_ZerosFormat );
m_config->Write( MirrorKey, m_Mirror );
m_config->Write( MinimalHeaderKey, m_MinimalHeader );
m_config->Write( MergePTHNPTHKey, m_Merge_PTH_NPTH );
m_config->Write( UnitDrillInchKey, m_UnitDrillIsInch );
m_config->Write( DrillOriginIsAuxAxisKey, m_DrillOriginIsAuxAxis );
m_config->Write( DrillMapFileTypeKey, m_mapFileType );
@ -229,6 +233,7 @@ void DIALOG_GENDRILL::OnGenMapFile( wxCommandEvent& event )
GenDrillAndMapFiles( false, true);
}
void DIALOG_GENDRILL::OnGenDrillFile( wxCommandEvent& event )
{
GenDrillAndMapFiles(true, false);
@ -264,6 +269,7 @@ void DIALOG_GENDRILL::UpdatePrecisionOptions()
m_staticTextPrecision->Enable( true );
}
void DIALOG_GENDRILL::OnOutputDirectoryBrowseClicked( wxCommandEvent& event )
{
// Build the absolute path of current output plot directory
@ -292,14 +298,14 @@ void DIALOG_GENDRILL::OnOutputDirectoryBrowseClicked( wxCommandEvent& event )
wxString boardFilePath = ( (wxFileName) m_parent->GetBoard()->GetFileName() ).GetPath();
if( !dirName.MakeRelativeTo( boardFilePath ) )
wxMessageBox( _(
"Cannot make path relative (target volume different from board file volume)!" ),
wxMessageBox( _( "Cannot make path relative. The target volume is different from board file volume!" ),
_( "Plot Output Directory" ), wxOK | wxICON_ERROR );
}
m_outputDirectoryName->SetValue( dirName.GetFullPath() );
}
void DIALOG_GENDRILL::SetParams()
{
wxString msg;
@ -315,6 +321,7 @@ void DIALOG_GENDRILL::SetParams()
m_UnitDrillIsInch = (m_Choice_Unit->GetSelection() == 0) ? false : true;
m_MinimalHeader = m_Check_Minimal->IsChecked();
m_Mirror = m_Check_Mirror->IsChecked();
m_Merge_PTH_NPTH = m_Check_Merge_PTH_NPTH->IsChecked();
m_ZerosFormat = m_Choice_Zeros_Format->GetSelection();
m_DrillOriginIsAuxAxis = m_Choice_Drill_Offset->GetSelection();
@ -331,16 +338,7 @@ void DIALOG_GENDRILL::SetParams()
m_board->SetPlotOptions( m_plotOpts );
}
/**
* Function GenDrillAndMapFiles
* Calls the functions to create EXCELLON drill files and/or drill map files
* >When all holes are through holes, only one excellon file is created.
* >When there are some partial holes (some blind or buried vias),
* one excellon file is created, for all plated through holes,
* and one file per layer pair, which have one or more holes, excluding
* through holes, already in the first file.
* one file for all Not Plated through holes
*/
void DIALOG_GENDRILL::GenDrillAndMapFiles(bool aGenDrill, bool aGenMap)
{
wxString layer_extend; /* added to the Board FileName to
@ -369,14 +367,14 @@ void DIALOG_GENDRILL::GenDrillAndMapFiles(bool aGenDrill, bool aGenMap)
excellonWriter.SetFormat( !m_UnitDrillIsInch,
(EXCELLON_WRITER::zeros_fmt) m_ZerosFormat,
m_Precision.m_lhs, m_Precision.m_rhs );
excellonWriter.SetOptions( m_Mirror, m_MinimalHeader, m_FileDrillOffset );
excellonWriter.SetOptions( m_Mirror, m_MinimalHeader, m_FileDrillOffset, m_Merge_PTH_NPTH );
wxFileName fn;
for( ; ; )
{
excellonWriter.BuildHolesList( layer1, layer2,
gen_through_holes ? false : true, gen_NPTH_holes );
excellonWriter.BuildHolesList( layer1, layer2, gen_through_holes ? false : true,
gen_NPTH_holes, m_Merge_PTH_NPTH );
if( excellonWriter.GetHolesCount() > 0 ) // has holes?
{
@ -393,6 +391,7 @@ void DIALOG_GENDRILL::GenDrillAndMapFiles(bool aGenDrill, bool aGenMap)
layer_extend << wxT( "-back" );
else
layer_extend << wxT( "-inner" ) << layer1;
if( layer2 == LAYER_N_FRONT )
layer_extend << wxT( "-front" );
else
@ -401,6 +400,7 @@ void DIALOG_GENDRILL::GenDrillAndMapFiles(bool aGenDrill, bool aGenMap)
fn.SetName( fn.GetName() + layer_extend );
wxString defaultPath = m_plotOpts.GetOutputDirectory();
if( defaultPath.IsEmpty() )
defaultPath = ::wxGetCwd();
@ -466,6 +466,7 @@ void DIALOG_GENDRILL::GenDrillAndMapFiles(bool aGenDrill, bool aGenMap)
gen_NPTH_holes = true;
continue;
}
layer1++;
layer2++; // use next layer pair
@ -482,11 +483,6 @@ void DIALOG_GENDRILL::GenDrillAndMapFiles(bool aGenDrill, bool aGenMap)
}
/*
* Create a plain text report file giving a list of drill values and drill count
* for through holes, oblong holes, and for buried vias,
* drill values and drill count per layer pair
*/
void DIALOG_GENDRILL::OnGenReportFile( wxCommandEvent& event )
{
UpdateConfig(); // set params and Save drill options
@ -497,6 +493,7 @@ void DIALOG_GENDRILL::OnGenReportFile( wxCommandEvent& event )
fn.SetExt( ReportFileExtension );
wxString defaultPath = m_plotOpts.GetOutputDirectory();
if( defaultPath.IsEmpty() )
defaultPath = ::wxGetCwd();
@ -512,7 +509,7 @@ void DIALOG_GENDRILL::OnGenReportFile( wxCommandEvent& event )
excellonWriter.SetFormat( !m_UnitDrillIsInch,
(EXCELLON_WRITER::zeros_fmt) m_ZerosFormat,
m_Precision.m_lhs, m_Precision.m_rhs );
excellonWriter.SetOptions( m_Mirror, m_MinimalHeader, m_FileDrillOffset );
excellonWriter.SetOptions( m_Mirror, m_MinimalHeader, m_FileDrillOffset, m_Merge_PTH_NPTH );
bool success = excellonWriter.GenDrillReportFile( dlg.GetPath() );
@ -572,7 +569,7 @@ void DIALOG_GENDRILL::GenDrillMap( const wxString aFullFileNameWithoutExt,
break;
default:
wxLogMessage( wxT( "DIALOG_GENDRILL::GenDrillMap() error, fmt % unkown" ), format );
wxLogMessage( wxT( "DIALOG_GENDRILL::GenDrillMap() error, fmt % unknown" ), format );
return;
}
@ -581,15 +578,14 @@ void DIALOG_GENDRILL::GenDrillMap( const wxString aFullFileNameWithoutExt,
fullFilename << wxT(".") << ext;
bool success = aExcellonWriter.GenDrillMapFile( fullFilename,
m_parent->GetPageSettings(),
format );
m_parent->GetPageSettings(),
format );
wxString msg;
if( ! success )
{
msg.Printf( _( "** Unable to create %s **\n" ),
GetChars( fullFilename ) );
msg.Printf( _( "** Unable to create %s **\n" ), GetChars( fullFilename ) );
m_messagesBox->AppendText( msg );
return;
}
@ -598,5 +594,4 @@ void DIALOG_GENDRILL::GenDrillMap( const wxString aFullFileNameWithoutExt,
msg.Printf( _( "Plot: %s OK\n" ), GetChars( fullFilename ) );
m_messagesBox->AppendText( msg );
}
}

View File

@ -41,6 +41,7 @@ public:
static int m_ZerosFormat;
static bool m_MinimalHeader;
static bool m_Mirror;
static bool m_Merge_PTH_NPTH;
static bool m_DrillOriginIsAuxAxis; /* Axis selection (main / auxiliary)
* for drill origin coordinates */
DRILL_PRECISION m_Precision; // Selected precision for drill files
@ -69,15 +70,34 @@ private:
// event functions
void OnSelDrillUnitsSelected( wxCommandEvent& event );
void OnSelZerosFmtSelected( wxCommandEvent& event );
void OnGenDrillFile( wxCommandEvent& event );
void OnGenMapFile( wxCommandEvent& event );
void OnGenReportFile( wxCommandEvent& event );
void OnGenDrillFile( wxCommandEvent& event );
void OnGenMapFile( wxCommandEvent& event );
/*
* Create a plain text report file giving a list of drill values and drill count
* for through holes, oblong holes, and for buried vias,
* drill values and drill count per layer pair
*/
void OnGenReportFile( wxCommandEvent& event );
void OnCancelClick( wxCommandEvent& event );
void OnOutputDirectoryBrowseClicked( wxCommandEvent& event );
// Specific functions:
void SetParams( void );
void GenDrillAndMapFiles(bool aGenDrill, bool aGenMap);
/**
* Function GenDrillAndMapFiles
* Calls the functions to create EXCELLON drill files and/or drill map files
* >When all holes are through holes, only one excellon file is created.
* >When there are some partial holes (some blind or buried vias),
* one excellon file is created, for all plated through holes,
* and one file per layer pair, which have one or more holes, excluding
* through holes, already in the first file.
* one file for all Not Plated through holes
*/
void GenDrillAndMapFiles( bool aGenDrill, bool aGenMap );
void GenDrillMap( const wxString aFileName,
EXCELLON_WRITER& aExcellonWriter,
PlotFormat format );

View File

@ -1,5 +1,5 @@
///////////////////////////////////////////////////////////////////////////
// C++ code generated with wxFormBuilder (version Oct 8 2012)
// C++ code generated with wxFormBuilder (version Feb 26 2014)
// http://www.wxformbuilder.org/
//
// PLEASE DO "NOT" EDIT THIS FILE!
@ -88,6 +88,9 @@ DIALOG_GENDRILL_BASE::DIALOG_GENDRILL_BASE( wxWindow* parent, wxWindowID id, con
m_Check_Minimal = new wxCheckBox( this, wxID_ANY, _("Minimal header"), wxDefaultPosition, wxDefaultSize, 0 );
sbOptSizer->Add( m_Check_Minimal, 0, wxTOP|wxRIGHT|wxLEFT, 5 );
m_Check_Merge_PTH_NPTH = new wxCheckBox( this, wxID_ANY, _("Merge PTH and NPTH holes into one file"), wxDefaultPosition, wxDefaultSize, 0 );
sbOptSizer->Add( m_Check_Merge_PTH_NPTH, 0, wxALL, 5 );
bMiddleBoxSizer->Add( sbOptSizer, 0, wxEXPAND|wxRIGHT|wxLEFT, 5 );

View File

@ -20,8 +20,10 @@
<property name="path">.</property>
<property name="precompiled_header"></property>
<property name="relative_path">1</property>
<property name="skip_lua_events">1</property>
<property name="skip_php_events">1</property>
<property name="skip_python_events">1</property>
<property name="ui_table">UI</property>
<property name="use_enum">0</property>
<property name="use_microsoft_bom">0</property>
<object class="Dialog" expanded="1">
@ -879,6 +881,94 @@
<event name="OnUpdateUI"></event>
</object>
</object>
<object class="sizeritem" expanded="1">
<property name="border">5</property>
<property name="flag">wxALL</property>
<property name="proportion">0</property>
<object class="wxCheckBox" expanded="1">
<property name="BottomDockable">1</property>
<property name="LeftDockable">1</property>
<property name="RightDockable">1</property>
<property name="TopDockable">1</property>
<property name="aui_layer"></property>
<property name="aui_name"></property>
<property name="aui_position"></property>
<property name="aui_row"></property>
<property name="best_size"></property>
<property name="bg"></property>
<property name="caption"></property>
<property name="caption_visible">1</property>
<property name="center_pane">0</property>
<property name="checked">0</property>
<property name="close_button">1</property>
<property name="context_help"></property>
<property name="context_menu">1</property>
<property name="default_pane">0</property>
<property name="dock">Dock</property>
<property name="dock_fixed">0</property>
<property name="docking">Left</property>
<property name="enabled">1</property>
<property name="fg"></property>
<property name="floatable">1</property>
<property name="font"></property>
<property name="gripper">0</property>
<property name="hidden">0</property>
<property name="id">wxID_ANY</property>
<property name="label">Merge PTH and NPTH holes into one file</property>
<property name="max_size"></property>
<property name="maximize_button">0</property>
<property name="maximum_size"></property>
<property name="min_size"></property>
<property name="minimize_button">0</property>
<property name="minimum_size"></property>
<property name="moveable">1</property>
<property name="name">m_Check_Merge_PTH_NPTH</property>
<property name="pane_border">1</property>
<property name="pane_position"></property>
<property name="pane_size"></property>
<property name="permission">protected</property>
<property name="pin_button">1</property>
<property name="pos"></property>
<property name="resize">Resizable</property>
<property name="show">1</property>
<property name="size"></property>
<property name="style"></property>
<property name="subclass"></property>
<property name="toolbar_pane">0</property>
<property name="tooltip"></property>
<property name="validator_data_type"></property>
<property name="validator_style">wxFILTER_NONE</property>
<property name="validator_type">wxDefaultValidator</property>
<property name="validator_variable"></property>
<property name="window_extra_style"></property>
<property name="window_name"></property>
<property name="window_style"></property>
<event name="OnChar"></event>
<event name="OnCheckBox"></event>
<event name="OnEnterWindow"></event>
<event name="OnEraseBackground"></event>
<event name="OnKeyDown"></event>
<event name="OnKeyUp"></event>
<event name="OnKillFocus"></event>
<event name="OnLeaveWindow"></event>
<event name="OnLeftDClick"></event>
<event name="OnLeftDown"></event>
<event name="OnLeftUp"></event>
<event name="OnMiddleDClick"></event>
<event name="OnMiddleDown"></event>
<event name="OnMiddleUp"></event>
<event name="OnMotion"></event>
<event name="OnMouseEvents"></event>
<event name="OnMouseWheel"></event>
<event name="OnPaint"></event>
<event name="OnRightDClick"></event>
<event name="OnRightDown"></event>
<event name="OnRightUp"></event>
<event name="OnSetFocus"></event>
<event name="OnSize"></event>
<event name="OnUpdateUI"></event>
</object>
</object>
</object>
</object>
<object class="sizeritem" expanded="1">

View File

@ -1,5 +1,5 @@
///////////////////////////////////////////////////////////////////////////
// C++ code generated with wxFormBuilder (version Oct 8 2012)
// C++ code generated with wxFormBuilder (version Feb 26 2014)
// http://www.wxformbuilder.org/
//
// PLEASE DO "NOT" EDIT THIS FILE!
@ -48,6 +48,7 @@ class DIALOG_GENDRILL_BASE : public DIALOG_SHIM
wxRadioBox* m_Choice_Drill_Map;
wxCheckBox* m_Check_Mirror;
wxCheckBox* m_Check_Minimal;
wxCheckBox* m_Check_Merge_PTH_NPTH;
wxRadioBox* m_Choice_Drill_Offset;
wxStaticBoxSizer* m_DefaultViasDrillSizer;
wxStaticText* m_ViaDrillValue;

View File

@ -237,6 +237,10 @@ void PCB_EDIT_FRAME::OnSelectOptionToolbar( wxCommandEvent& event )
m_show_microwave_tools = state;
m_auimgr.GetPane( wxT( "m_microWaveToolBar" ) ).Show( m_show_microwave_tools );
m_auimgr.Update();
GetMenuBar()->SetLabel( ID_MENU_PCB_SHOW_HIDE_MUWAVE_TOOLBAR,
m_show_microwave_tools ?
_( "Hide Microwave Toolbar" ): _( "Show Microwave Toolbar" ));
break;
case ID_TB_OPTIONS_SHOW_MANAGE_LAYERS_VERTICAL_TOOLBAR:

View File

@ -27,9 +27,11 @@ DIALOG_GLOBAL_DELETION::DIALOG_GLOBAL_DELETION( PCB_EDIT_FRAME* parent )
m_TrackFilterLocked->Enable( m_DelTracks->GetValue() );
m_TrackFilterNormal->Enable( m_DelTracks->GetValue() );
m_TrackFilterVias->Enable( m_DelTracks->GetValue() );
m_ModuleFilterLocked->Enable( m_DelModules->GetValue() );
m_ModuleFilterNormal->Enable( m_DelModules->GetValue() );
SetFocus();
GetSizer()->SetSizeHints(this);
GetSizer()->SetSizeHints( this );
Centre();
}
@ -42,12 +44,14 @@ void PCB_EDIT_FRAME::InstallPcbGlobalDeleteFrame( const wxPoint& pos )
dlg.ShowModal();
}
void DIALOG_GLOBAL_DELETION::SetCurrentLayer( LAYER_NUM aLayer )
{
m_currentLayer = aLayer;
m_textCtrlCurrLayer->SetValue( m_Parent->GetBoard()->GetLayerName( aLayer ) );
}
void DIALOG_GLOBAL_DELETION::OnCheckDeleteTracks( wxCommandEvent& event )
{
m_TrackFilterAR->Enable( m_DelTracks->GetValue() );
@ -56,6 +60,14 @@ void DIALOG_GLOBAL_DELETION::OnCheckDeleteTracks( wxCommandEvent& event )
m_TrackFilterVias->Enable( m_DelTracks->GetValue() );
}
void DIALOG_GLOBAL_DELETION::OnCheckDeleteModules( wxCommandEvent& event )
{
m_ModuleFilterLocked->Enable( m_DelModules->GetValue() );
m_ModuleFilterNormal->Enable( m_DelModules->GetValue() );
}
void DIALOG_GLOBAL_DELETION::AcceptPcbDelete( )
{
bool gen_rastnest = false;
@ -68,72 +80,102 @@ void DIALOG_GLOBAL_DELETION::AcceptPcbDelete( )
}
else
{
if( !IsOK( this, _( "OK to delete selected items ?" ) ) )
if( !IsOK( this, _( "Are you sure you want to delete the selected items?" ) ) )
return;
BOARD * pcb = m_Parent->GetBoard();
BOARD* pcb = m_Parent->GetBoard();
PICKED_ITEMS_LIST pickersList;
ITEM_PICKER itemPicker( NULL, UR_DELETED );
BOARD_ITEM* item, * nextitem;
if( m_DelZones->GetValue() )
{
gen_rastnest = true;
/* SEG_ZONE items used in Zone filling selection are now deprecated :
* and are deleted but not put in undo buffer if exist
*/
pcb->m_Zone.DeleteAll();
while( pcb->GetAreaCount() )
{
item = pcb->GetArea( 0 );
itemPicker.SetItem( item );
pickersList.PushItem( itemPicker );
pcb->Remove( item );
}
}
LAYER_MSK masque_layer = NO_LAYERS;
LAYER_MSK layers_filter = ALL_LAYERS;
if( m_rbLayersOption->GetSelection() != 0 ) // Use current layer only
layers_filter = GetLayerMask( m_currentLayer );
if( m_DelDrawings->GetValue() )
masque_layer = (~EDGE_LAYER) & ALL_NO_CU_LAYERS;
if( m_DelBoardEdges->GetValue() )
masque_layer |= EDGE_LAYER;
layers_filter &= layers_filter;
for( item = pcb->m_Drawings; item != NULL; item = nextitem )
if( m_DelZones->GetValue() )
{
nextitem = item->Next();
bool removeme = GetLayerMask( item->GetLayer() ) & masque_layer;
int area_index = 0;
item = pcb->GetArea( area_index );
if( ( item->Type() == PCB_TEXT_T ) && m_DelTexts->GetValue() )
removeme = true;
if( removeme )
while( item != NULL )
{
itemPicker.SetItem( item );
pickersList.PushItem( itemPicker );
item->UnLink();
if( GetLayerMask( item->GetLayer() ) & layers_filter )
{
itemPicker.SetItem( item );
pickersList.PushItem( itemPicker );
pcb->Remove( item );
gen_rastnest = true;
}
else
{
area_index++;
}
item = pcb->GetArea( area_index );
}
}
if( m_DelDrawings->GetValue() || m_DelBoardEdges->GetValue() )
{
LAYER_MSK masque_layer = NO_LAYERS;
if( m_DelDrawings->GetValue() )
masque_layer = (~EDGE_LAYER) & ALL_NO_CU_LAYERS;
if( m_DelBoardEdges->GetValue() )
masque_layer |= EDGE_LAYER;
masque_layer &= layers_filter;
for( item = pcb->m_Drawings; item != NULL; item = nextitem )
{
nextitem = item->Next();
if( ( item->Type() == PCB_LINE_T ) && ( GetLayerMask( item->GetLayer() ) & masque_layer) )
{
itemPicker.SetItem( item );
pickersList.PushItem( itemPicker );
item->UnLink();
}
}
}
if( m_DelTexts->GetValue() )
{
LAYER_MSK del_text_layers = ALL_LAYERS & layers_filter;
for( item = pcb->m_Drawings; item != NULL; item = nextitem )
{
nextitem = item->Next();
if( ( item->Type() == PCB_TEXT_T ) && ( GetLayerMask( item->GetLayer() ) & del_text_layers ) )
{
itemPicker.SetItem( item );
pickersList.PushItem( itemPicker );
item->UnLink();
}
}
}
if( m_DelModules->GetValue() )
{
gen_rastnest = true;
for( item = pcb->m_Modules; item; item = nextitem )
{
nextitem = item->Next();
itemPicker.SetItem( item );
pickersList.PushItem( itemPicker );
item->UnLink();
if( ( GetLayerMask( item->GetLayer() ) & layers_filter ) &&
( ( m_ModuleFilterNormal->GetValue() && !item->IsLocked() ) ||
( m_ModuleFilterLocked->GetValue() && item->IsLocked() ) ) )
{
itemPicker.SetItem( item );
pickersList.PushItem( itemPicker );
item->UnLink();
gen_rastnest = true;
}
}
}
@ -148,6 +190,7 @@ void DIALOG_GLOBAL_DELETION::AcceptPcbDelete( )
track_mask_filter |= TRACK_AR;
TRACK * nexttrack;
for( TRACK *track = pcb->m_Track; track != NULL; track = nexttrack )
{
nexttrack = track->Next();
@ -180,6 +223,7 @@ void DIALOG_GLOBAL_DELETION::AcceptPcbDelete( )
if( gen_rastnest )
m_Parent->Compile_Ratsnest( NULL, true );
}
m_Parent->GetCanvas()->Refresh();
@ -187,4 +231,3 @@ void DIALOG_GLOBAL_DELETION::AcceptPcbDelete( )
EndModal( 1 );
}

View File

@ -30,6 +30,7 @@ private:
void AcceptPcbDelete();
void OnCheckDeleteTracks( wxCommandEvent& event );
void OnCheckDeleteModules( wxCommandEvent& event );
};
#endif // _DIALOG_GLOBAL_DELETION_H_

View File

@ -1,5 +1,5 @@
///////////////////////////////////////////////////////////////////////////
// C++ code generated with wxFormBuilder (version Oct 8 2012)
// C++ code generated with wxFormBuilder (version Feb 26 2014)
// http://www.wxformbuilder.org/
//
// PLEASE DO "NOT" EDIT THIS FILE!
@ -52,25 +52,32 @@ DIALOG_GLOBAL_DELETION_BASE::DIALOG_GLOBAL_DELETION_BASE( wxWindow* parent, wxWi
wxBoxSizer* bSizerRight;
bSizerRight = new wxBoxSizer( wxVERTICAL );
sbTrackFilter = new wxStaticBoxSizer( new wxStaticBox( this, wxID_ANY, _("Track Filter") ), wxVERTICAL );
sbFilter = new wxStaticBoxSizer( new wxStaticBox( this, wxID_ANY, _("Filter Settings") ), wxVERTICAL );
m_TrackFilterAR = new wxCheckBox( this, wxID_ANY, _("Automatically routed tracks"), wxDefaultPosition, wxDefaultSize, 0 );
m_TrackFilterAR->SetValue(true);
sbTrackFilter->Add( m_TrackFilterAR, 0, wxTOP|wxRIGHT|wxLEFT, 5 );
sbFilter->Add( m_TrackFilterAR, 0, wxTOP|wxRIGHT|wxLEFT, 5 );
m_TrackFilterLocked = new wxCheckBox( this, wxID_ANY, _("Locked tracks"), wxDefaultPosition, wxDefaultSize, 0 );
sbTrackFilter->Add( m_TrackFilterLocked, 0, wxTOP|wxRIGHT|wxLEFT, 5 );
sbFilter->Add( m_TrackFilterLocked, 0, wxTOP|wxRIGHT|wxLEFT, 5 );
m_TrackFilterNormal = new wxCheckBox( this, wxID_ANY, _("Normal tracks"), wxDefaultPosition, wxDefaultSize, 0 );
m_TrackFilterNormal = new wxCheckBox( this, wxID_ANY, _("Unlocked tracks"), wxDefaultPosition, wxDefaultSize, 0 );
m_TrackFilterNormal->SetValue(true);
sbTrackFilter->Add( m_TrackFilterNormal, 0, wxTOP|wxRIGHT|wxLEFT, 5 );
sbFilter->Add( m_TrackFilterNormal, 0, wxTOP|wxRIGHT|wxLEFT, 5 );
m_TrackFilterVias = new wxCheckBox( this, wxID_ANY, _("Vias"), wxDefaultPosition, wxDefaultSize, 0 );
m_TrackFilterVias->SetValue(true);
sbTrackFilter->Add( m_TrackFilterVias, 0, wxALL, 5 );
sbFilter->Add( m_TrackFilterVias, 0, wxALL, 5 );
m_ModuleFilterLocked = new wxCheckBox( this, wxID_ANY, _("Locked footprints"), wxDefaultPosition, wxDefaultSize, 0 );
sbFilter->Add( m_ModuleFilterLocked, 0, wxALL, 5 );
m_ModuleFilterNormal = new wxCheckBox( this, wxID_ANY, _("Unlocked footprints"), wxDefaultPosition, wxDefaultSize, 0 );
m_ModuleFilterNormal->SetValue(true);
sbFilter->Add( m_ModuleFilterNormal, 0, wxALL, 5 );
bSizerRight->Add( sbTrackFilter, 0, wxALL|wxEXPAND, 5 );
bSizerRight->Add( sbFilter, 0, wxALL|wxEXPAND, 5 );
wxString m_rbLayersOptionChoices[] = { _("All layers"), _("Current layer only") };
int m_rbLayersOptionNChoices = sizeof( m_rbLayersOptionChoices ) / sizeof( wxString );
@ -112,6 +119,7 @@ DIALOG_GLOBAL_DELETION_BASE::DIALOG_GLOBAL_DELETION_BASE( wxWindow* parent, wxWi
this->Centre( wxBOTH );
// Connect Events
m_DelModules->Connect( wxEVT_COMMAND_CHECKBOX_CLICKED, wxCommandEventHandler( DIALOG_GLOBAL_DELETION_BASE::OnCheckDeleteModules ), NULL, this );
m_DelTracks->Connect( wxEVT_COMMAND_CHECKBOX_CLICKED, wxCommandEventHandler( DIALOG_GLOBAL_DELETION_BASE::OnCheckDeleteTracks ), NULL, this );
m_sdbSizer1Cancel->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_GLOBAL_DELETION_BASE::OnCancelClick ), NULL, this );
m_sdbSizer1OK->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_GLOBAL_DELETION_BASE::OnOkClick ), NULL, this );
@ -120,6 +128,7 @@ DIALOG_GLOBAL_DELETION_BASE::DIALOG_GLOBAL_DELETION_BASE( wxWindow* parent, wxWi
DIALOG_GLOBAL_DELETION_BASE::~DIALOG_GLOBAL_DELETION_BASE()
{
// Disconnect Events
m_DelModules->Disconnect( wxEVT_COMMAND_CHECKBOX_CLICKED, wxCommandEventHandler( DIALOG_GLOBAL_DELETION_BASE::OnCheckDeleteModules ), NULL, this );
m_DelTracks->Disconnect( wxEVT_COMMAND_CHECKBOX_CLICKED, wxCommandEventHandler( DIALOG_GLOBAL_DELETION_BASE::OnCheckDeleteTracks ), NULL, this );
m_sdbSizer1Cancel->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_GLOBAL_DELETION_BASE::OnCancelClick ), NULL, this );
m_sdbSizer1OK->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_GLOBAL_DELETION_BASE::OnOkClick ), NULL, this );

View File

@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<wxFormBuilder_Project>
<FileVersion major="1" minor="11" />
<FileVersion major="1" minor="12" />
<object class="Project" expanded="1">
<property name="class_decoration"></property>
<property name="code_generation">C++</property>
@ -20,8 +20,10 @@
<property name="path">.</property>
<property name="precompiled_header"></property>
<property name="relative_path">1</property>
<property name="skip_lua_events">1</property>
<property name="skip_php_events">1</property>
<property name="skip_python_events">1</property>
<property name="ui_table">UI</property>
<property name="use_enum">0</property>
<property name="use_microsoft_bom">0</property>
<object class="Dialog" expanded="1">
@ -527,7 +529,7 @@
<property name="window_name"></property>
<property name="window_style"></property>
<event name="OnChar"></event>
<event name="OnCheckBox"></event>
<event name="OnCheckBox">OnCheckDeleteModules</event>
<event name="OnEnterWindow"></event>
<event name="OnEraseBackground"></event>
<event name="OnKeyDown"></event>
@ -833,9 +835,9 @@
<property name="proportion">0</property>
<object class="wxStaticBoxSizer" expanded="1">
<property name="id">wxID_ANY</property>
<property name="label">Track Filter</property>
<property name="label">Filter Settings</property>
<property name="minimum_size"></property>
<property name="name">sbTrackFilter</property>
<property name="name">sbFilter</property>
<property name="orient">wxVERTICAL</property>
<property name="permission">protected</property>
<event name="OnUpdateUI"></event>
@ -1048,7 +1050,7 @@
<property name="gripper">0</property>
<property name="hidden">0</property>
<property name="id">wxID_ANY</property>
<property name="label">Normal tracks</property>
<property name="label">Unlocked tracks</property>
<property name="max_size"></property>
<property name="maximize_button">0</property>
<property name="maximum_size"></property>
@ -1191,6 +1193,182 @@
<event name="OnUpdateUI"></event>
</object>
</object>
<object class="sizeritem" expanded="1">
<property name="border">5</property>
<property name="flag">wxALL</property>
<property name="proportion">0</property>
<object class="wxCheckBox" expanded="1">
<property name="BottomDockable">1</property>
<property name="LeftDockable">1</property>
<property name="RightDockable">1</property>
<property name="TopDockable">1</property>
<property name="aui_layer"></property>
<property name="aui_name"></property>
<property name="aui_position"></property>
<property name="aui_row"></property>
<property name="best_size"></property>
<property name="bg"></property>
<property name="caption"></property>
<property name="caption_visible">1</property>
<property name="center_pane">0</property>
<property name="checked">0</property>
<property name="close_button">1</property>
<property name="context_help"></property>
<property name="context_menu">1</property>
<property name="default_pane">0</property>
<property name="dock">Dock</property>
<property name="dock_fixed">0</property>
<property name="docking">Left</property>
<property name="enabled">1</property>
<property name="fg"></property>
<property name="floatable">1</property>
<property name="font"></property>
<property name="gripper">0</property>
<property name="hidden">0</property>
<property name="id">wxID_ANY</property>
<property name="label">Locked footprints</property>
<property name="max_size"></property>
<property name="maximize_button">0</property>
<property name="maximum_size"></property>
<property name="min_size"></property>
<property name="minimize_button">0</property>
<property name="minimum_size"></property>
<property name="moveable">1</property>
<property name="name">m_ModuleFilterLocked</property>
<property name="pane_border">1</property>
<property name="pane_position"></property>
<property name="pane_size"></property>
<property name="permission">protected</property>
<property name="pin_button">1</property>
<property name="pos"></property>
<property name="resize">Resizable</property>
<property name="show">1</property>
<property name="size"></property>
<property name="style"></property>
<property name="subclass"></property>
<property name="toolbar_pane">0</property>
<property name="tooltip"></property>
<property name="validator_data_type"></property>
<property name="validator_style">wxFILTER_NONE</property>
<property name="validator_type">wxDefaultValidator</property>
<property name="validator_variable"></property>
<property name="window_extra_style"></property>
<property name="window_name"></property>
<property name="window_style"></property>
<event name="OnChar"></event>
<event name="OnCheckBox"></event>
<event name="OnEnterWindow"></event>
<event name="OnEraseBackground"></event>
<event name="OnKeyDown"></event>
<event name="OnKeyUp"></event>
<event name="OnKillFocus"></event>
<event name="OnLeaveWindow"></event>
<event name="OnLeftDClick"></event>
<event name="OnLeftDown"></event>
<event name="OnLeftUp"></event>
<event name="OnMiddleDClick"></event>
<event name="OnMiddleDown"></event>
<event name="OnMiddleUp"></event>
<event name="OnMotion"></event>
<event name="OnMouseEvents"></event>
<event name="OnMouseWheel"></event>
<event name="OnPaint"></event>
<event name="OnRightDClick"></event>
<event name="OnRightDown"></event>
<event name="OnRightUp"></event>
<event name="OnSetFocus"></event>
<event name="OnSize"></event>
<event name="OnUpdateUI"></event>
</object>
</object>
<object class="sizeritem" expanded="1">
<property name="border">5</property>
<property name="flag">wxALL</property>
<property name="proportion">0</property>
<object class="wxCheckBox" expanded="1">
<property name="BottomDockable">1</property>
<property name="LeftDockable">1</property>
<property name="RightDockable">1</property>
<property name="TopDockable">1</property>
<property name="aui_layer"></property>
<property name="aui_name"></property>
<property name="aui_position"></property>
<property name="aui_row"></property>
<property name="best_size"></property>
<property name="bg"></property>
<property name="caption"></property>
<property name="caption_visible">1</property>
<property name="center_pane">0</property>
<property name="checked">1</property>
<property name="close_button">1</property>
<property name="context_help"></property>
<property name="context_menu">1</property>
<property name="default_pane">0</property>
<property name="dock">Dock</property>
<property name="dock_fixed">0</property>
<property name="docking">Left</property>
<property name="enabled">1</property>
<property name="fg"></property>
<property name="floatable">1</property>
<property name="font"></property>
<property name="gripper">0</property>
<property name="hidden">0</property>
<property name="id">wxID_ANY</property>
<property name="label">Unlocked footprints</property>
<property name="max_size"></property>
<property name="maximize_button">0</property>
<property name="maximum_size"></property>
<property name="min_size"></property>
<property name="minimize_button">0</property>
<property name="minimum_size"></property>
<property name="moveable">1</property>
<property name="name">m_ModuleFilterNormal</property>
<property name="pane_border">1</property>
<property name="pane_position"></property>
<property name="pane_size"></property>
<property name="permission">protected</property>
<property name="pin_button">1</property>
<property name="pos"></property>
<property name="resize">Resizable</property>
<property name="show">1</property>
<property name="size"></property>
<property name="style"></property>
<property name="subclass"></property>
<property name="toolbar_pane">0</property>
<property name="tooltip"></property>
<property name="validator_data_type"></property>
<property name="validator_style">wxFILTER_NONE</property>
<property name="validator_type">wxDefaultValidator</property>
<property name="validator_variable"></property>
<property name="window_extra_style"></property>
<property name="window_name"></property>
<property name="window_style"></property>
<event name="OnChar"></event>
<event name="OnCheckBox"></event>
<event name="OnEnterWindow"></event>
<event name="OnEraseBackground"></event>
<event name="OnKeyDown"></event>
<event name="OnKeyUp"></event>
<event name="OnKillFocus"></event>
<event name="OnLeaveWindow"></event>
<event name="OnLeftDClick"></event>
<event name="OnLeftDown"></event>
<event name="OnLeftUp"></event>
<event name="OnMiddleDClick"></event>
<event name="OnMiddleDown"></event>
<event name="OnMiddleUp"></event>
<event name="OnMotion"></event>
<event name="OnMouseEvents"></event>
<event name="OnMouseWheel"></event>
<event name="OnPaint"></event>
<event name="OnRightDClick"></event>
<event name="OnRightDown"></event>
<event name="OnRightUp"></event>
<event name="OnSetFocus"></event>
<event name="OnSize"></event>
<event name="OnUpdateUI"></event>
</object>
</object>
</object>
</object>
<object class="sizeritem" expanded="1">

View File

@ -1,5 +1,5 @@
///////////////////////////////////////////////////////////////////////////
// C++ code generated with wxFormBuilder (version Oct 8 2012)
// C++ code generated with wxFormBuilder (version Feb 26 2014)
// http://www.wxformbuilder.org/
//
// PLEASE DO "NOT" EDIT THIS FILE!
@ -48,11 +48,13 @@ class DIALOG_GLOBAL_DELETION_BASE : public DIALOG_SHIM
wxCheckBox* m_DelTracks;
wxCheckBox* m_DelMarkers;
wxCheckBox* m_DelAlls;
wxStaticBoxSizer* sbTrackFilter;
wxStaticBoxSizer* sbFilter;
wxCheckBox* m_TrackFilterAR;
wxCheckBox* m_TrackFilterLocked;
wxCheckBox* m_TrackFilterNormal;
wxCheckBox* m_TrackFilterVias;
wxCheckBox* m_ModuleFilterLocked;
wxCheckBox* m_ModuleFilterNormal;
wxRadioBox* m_rbLayersOption;
wxStaticText* m_staticText1;
wxTextCtrl* m_textCtrlCurrLayer;
@ -62,6 +64,7 @@ class DIALOG_GLOBAL_DELETION_BASE : public DIALOG_SHIM
wxButton* m_sdbSizer1Cancel;
// Virtual event handlers, overide them in your derived class
virtual void OnCheckDeleteModules( wxCommandEvent& event ) { event.Skip(); }
virtual void OnCheckDeleteTracks( wxCommandEvent& event ) { event.Skip(); }
virtual void OnCancelClick( wxCommandEvent& event ) { event.Skip(); }
virtual void OnOkClick( wxCommandEvent& event ) { event.Skip(); }

View File

@ -294,6 +294,7 @@ DIALOG_LAYERS_SETUP::DIALOG_LAYERS_SETUP( PCB_EDIT_FRAME* parent ) :
m_TitlePanel->SetMinSize( wxSize( -1, m_AdhesFrontName->GetSize().y+10 ) );
Layout();
Fit();
Center();

View File

@ -680,13 +680,14 @@ bool DIALOG_PAD_PROPERTIES::padValuesOK()
{
if( m_dummyPad->GetDrillSize().x || m_dummyPad->GetDrillSize().y )
{
msg = _( "Error: pad is not on a copper layer and has a hole" );
// Note: he message is shown in an HTML window
msg = _( "Error: the pad is not on a copper layer and has a hole" );
if( m_dummyPad->GetAttribute() == PAD_HOLE_NOT_PLATED )
{
msg += wxT("\n");
msg += _( "For NPTH pad, set pad drill value to pad size value,\n"
"if you do not want this pad plotted in gerber files"
msg += wxT("<br><br><i>");
msg += _( "For NPTH pad, set pad size value to pad drill value,"
" if you do not want this pad plotted in gerber files"
);
}

View File

@ -1077,7 +1077,7 @@ void PCB_EDIT_FRAME::Process_Special_Functions( wxCommandEvent& event )
#ifndef USE_WX_OVERLAY
InstallGraphicItemPropertiesDialog( (DRAWSEGMENT*) GetCurItem(), &dc );
#else
// #1267772 - Draw into dialog converted in refresh request
// #1277772 - Draw into dialog converted in refresh request
InstallGraphicItemPropertiesDialog( (DRAWSEGMENT*) GetCurItem(), NULL );
m_canvas->Refresh();
#endif

View File

@ -55,12 +55,6 @@ inline double diameter_in_mm( double ius )
}
/* Creates a hole map of the board in HPGL, POSTSCRIPT or other supported formats
* Each hole size has a the drill mark symbol (circle, cross X, cross + ...) up to
* PLOTTER::MARKER_COUNT different values.
* If more than PLOTTER::MARKER_COUNT different values,
* these other vaules share the same mark
*/
bool EXCELLON_WRITER::GenDrillMapFile( const wxString& aFullFileName,
const PAGE_INFO& aSheet,
PlotFormat aFormat )
@ -87,15 +81,15 @@ bool EXCELLON_WRITER::GenDrillMapFile( const wxString& aFullFileName,
break;
case PLOT_FORMAT_HPGL: // Scale for HPGL format.
{
HPGL_PLOTTER* hpgl_plotter = new HPGL_PLOTTER;
plotter = hpgl_plotter;
hpgl_plotter->SetPenNumber( plot_opts.GetHPGLPenNum() );
hpgl_plotter->SetPenSpeed( plot_opts.GetHPGLPenSpeed() );
hpgl_plotter->SetPenOverlap( 0 );
plotter->SetPageSettings( aSheet );
plotter->SetViewport( offset, IU_PER_DECIMILS, scale, false );
}
{
HPGL_PLOTTER* hpgl_plotter = new HPGL_PLOTTER;
plotter = hpgl_plotter;
hpgl_plotter->SetPenNumber( plot_opts.GetHPGLPenNum() );
hpgl_plotter->SetPenSpeed( plot_opts.GetHPGLPenSpeed() );
hpgl_plotter->SetPenOverlap( 0 );
plotter->SetPageSettings( aSheet );
plotter->SetViewport( offset, IU_PER_DECIMILS, scale, false );
}
break;
@ -104,59 +98,59 @@ bool EXCELLON_WRITER::GenDrillMapFile( const wxString& aFullFileName,
// fall through
case PLOT_FORMAT_PDF:
case PLOT_FORMAT_POST:
{
PAGE_INFO pageA4( wxT( "A4" ) );
wxSize pageSizeIU = pageA4.GetSizeIU();
{
PAGE_INFO pageA4( wxT( "A4" ) );
wxSize pageSizeIU = pageA4.GetSizeIU();
// Reserve a margin around the page.
int margin = KiROUND( 20 * IU_PER_MM );
// Reserve a margin around the page.
int margin = KiROUND( 20 * IU_PER_MM );
// Calculate a scaling factor to print the board on the sheet
double Xscale = double( pageSizeIU.x - ( 2 * margin ) ) / bbbox.GetWidth();
// Calculate a scaling factor to print the board on the sheet
double Xscale = double( pageSizeIU.x - ( 2 * margin ) ) / bbbox.GetWidth();
// We should print the list of drill sizes, so reserve room for it
// 60% height for board 40% height for list
int ypagesize_for_board = KiROUND( pageSizeIU.y * 0.6 );
double Yscale = double( ypagesize_for_board - margin ) / bbbox.GetHeight();
// We should print the list of drill sizes, so reserve room for it
// 60% height for board 40% height for list
int ypagesize_for_board = KiROUND( pageSizeIU.y * 0.6 );
double Yscale = double( ypagesize_for_board - margin ) / bbbox.GetHeight();
scale = std::min( Xscale, Yscale );
scale = std::min( Xscale, Yscale );
// Experience shows the scale should not to large, because texts
// create problem (can be to big or too small).
// So the scale is clipped at 3.0;
scale = std::min( scale, 3.0 );
// Experience shows the scale should not to large, because texts
// create problem (can be to big or too small).
// So the scale is clipped at 3.0;
scale = std::min( scale, 3.0 );
offset.x = KiROUND( double( bbbox.Centre().x ) -
( pageSizeIU.x / 2.0 ) / scale );
offset.y = KiROUND( double( bbbox.Centre().y ) -
( ypagesize_for_board / 2.0 ) / scale );
offset.x = KiROUND( double( bbbox.Centre().x ) -
( pageSizeIU.x / 2.0 ) / scale );
offset.y = KiROUND( double( bbbox.Centre().y ) -
( ypagesize_for_board / 2.0 ) / scale );
if( aFormat == PLOT_FORMAT_PDF )
plotter = new PDF_PLOTTER;
else
plotter = new PS_PLOTTER;
if( aFormat == PLOT_FORMAT_PDF )
plotter = new PDF_PLOTTER;
else
plotter = new PS_PLOTTER;
plotter->SetPageSettings( pageA4 );
plotter->SetViewport( offset, IU_PER_DECIMILS, scale, false );
}
plotter->SetPageSettings( pageA4 );
plotter->SetViewport( offset, IU_PER_DECIMILS, scale, false );
}
break;
case PLOT_FORMAT_DXF:
{
DXF_PLOTTER* dxf_plotter = new DXF_PLOTTER;
plotter = dxf_plotter;
plotter->SetPageSettings( aSheet );
plotter->SetViewport( offset, IU_PER_DECIMILS, scale, false );
}
{
DXF_PLOTTER* dxf_plotter = new DXF_PLOTTER;
plotter = dxf_plotter;
plotter->SetPageSettings( aSheet );
plotter->SetViewport( offset, IU_PER_DECIMILS, scale, false );
}
break;
case PLOT_FORMAT_SVG:
{
SVG_PLOTTER* svg_plotter = new SVG_PLOTTER;
plotter = svg_plotter;
plotter->SetPageSettings( aSheet );
plotter->SetViewport( offset, IU_PER_DECIMILS, scale, false );
}
{
SVG_PLOTTER* svg_plotter = new SVG_PLOTTER;
plotter = svg_plotter;
plotter->SetPageSettings( aSheet );
plotter->SetViewport( offset, IU_PER_DECIMILS, scale, false );
}
break;
}
@ -239,8 +233,7 @@ bool EXCELLON_WRITER::GenDrillMapFile( const wxString& aFullFileName,
plotY += intervalle;
plot_diam = KiROUND( m_toolListBuffer[ii].m_Diameter );
x = KiROUND( plotX - textmarginaftersymbol * charScale
- plot_diam / 2.0 );
x = KiROUND( plotX - textmarginaftersymbol * charScale - plot_diam / 2.0 );
y = KiROUND( plotY + charSize * charScale );
plotter->Marker( wxPoint( x, y ), plot_diam, ii );
@ -267,10 +260,9 @@ bool EXCELLON_WRITER::GenDrillMapFile( const wxString& aFullFileName,
m_toolListBuffer[ii].m_OvalCount );
msg += FROM_UTF8( line );
plotter->Text( wxPoint( plotX, y ), UNSPECIFIED_COLOR,
msg,
0, wxSize( KiROUND( charSize * charScale ),
KiROUND( charSize * charScale ) ),
plotter->Text( wxPoint( plotX, y ), UNSPECIFIED_COLOR, msg, 0,
wxSize( KiROUND( charSize * charScale ),
KiROUND( charSize * charScale ) ),
GR_TEXT_HJUSTIFY_LEFT, GR_TEXT_VJUSTIFY_CENTER,
TextWidth, false, false );
@ -287,52 +279,6 @@ bool EXCELLON_WRITER::GenDrillMapFile( const wxString& aFullFileName,
}
/*
* Create a plain text report file giving a list of drill values and drill count
* for through holes, oblong holes, and for buried vias,
* drill values and drill count per layer pair
*/
/* Here is a sample created by this function:
* Drill report for F:/tmp/interf_u/interf_u.brd
* Created on 04/10/2012 20:48:38
* Selected Drill Unit: Imperial (inches)
*
* Drill report for plated through holes :
* T1 0,025" 0,64mm (88 holes)
* T2 0,031" 0,79mm (120 holes)
* T3 0,032" 0,81mm (151 holes) (with 1 slot)
* T4 0,040" 1,02mm (43 holes)
* T5 0,079" 2,00mm (1 hole) (with 1 slot)
* T6 0,120" 3,05mm (1 hole) (with 1 slot)
*
* Total plated holes count 404
*
*
* Drill report for buried and blind vias :
*
* Drill report for holes from layer Soudure to layer Interne1 :
*
* Total plated holes count 0
*
*
* Drill report for holes from layer Interne1 to layer Interne2 :
* T1 0,025" 0,64mm (3 holes)
*
* Total plated holes count 3
*
*
* Drill report for holes from layer Interne2 to layer Composant :
* T1 0,025" 0,64mm (1 hole)
*
* Total plated holes count 1
*
*
* Drill report for unplated through holes :
* T1 0,120" 3,05mm (1 hole) (with 1 slot)
*
* Total unplated holes count 1
*
*/
bool EXCELLON_WRITER::GenDrillReportFile( const wxString& aFullFileName )
{
unsigned totalHoleCount;
@ -360,7 +306,7 @@ bool EXCELLON_WRITER::GenDrillReportFile( const wxString& aFullFileName )
for( ; ; )
{
BuildHolesList( layer1, layer2,
gen_through_holes ? false : true, gen_NPTH_holes );
gen_through_holes ? false : true, gen_NPTH_holes, false);
totalHoleCount = 0;
@ -461,17 +407,17 @@ bool EXCELLON_WRITER::GenDrillReportFile( const wxString& aFullFileName )
return true;
}
// Helper function to plot drill marks:
bool EXCELLON_WRITER::PlotDrillMarks( PLOTTER* aPlotter )
{
// Plot the drill map:
wxPoint pos;
for( unsigned ii = 0; ii < m_holeListBuffer.size(); ii++ )
{
pos = m_holeListBuffer[ii].m_Hole_Pos;
/* Always plot the drill symbol (for slots identifies the needed
* cutter!) */
// Always plot the drill symbol (for slots identifies the needed cutter!
aPlotter->Marker( pos, m_holeListBuffer[ii].m_Hole_Diameter,
m_holeListBuffer[ii].m_Tool_Reference - 1 );

View File

@ -69,11 +69,7 @@
*/
/*
* Create the drill file in EXCELLON format
* return hole count
*/
int EXCELLON_WRITER::CreateDrillFile( FILE * aFile )
int EXCELLON_WRITER::CreateDrillFile( FILE* aFile )
{
m_file = aFile;
@ -100,7 +96,8 @@ int EXCELLON_WRITER::CreateDrillFile( FILE * aFile )
fputs( "G90\n", m_file ); // Absolute mode
fputs( "G05\n", m_file ); // Drill mode
/* Units : */
// Units :
if( !m_minimalHeader )
{
if( m_unitsDecimal )
@ -112,12 +109,14 @@ int EXCELLON_WRITER::CreateDrillFile( FILE * aFile )
/* Read the hole file and generate lines for normal holes (oblong
* holes will be created later) */
int tool_reference = -2;
for( unsigned ii = 0; ii < m_holeListBuffer.size(); ii++ )
{
HOLE_INFO& hole_descr = m_holeListBuffer[ii];
if( hole_descr.m_Hole_Shape )
continue; // oblong holes will be created later
if( tool_reference != hole_descr.m_Tool_Reference )
{
tool_reference = hole_descr.m_Tool_Reference;
@ -145,16 +144,18 @@ int EXCELLON_WRITER::CreateDrillFile( FILE * aFile )
for( unsigned ii = 0; ii < m_holeListBuffer.size(); ii++ )
{
HOLE_INFO& hole_descr = m_holeListBuffer[ii];
if( hole_descr.m_Hole_Shape == 0 )
continue; // wait for oblong holes
if( tool_reference != hole_descr.m_Tool_Reference )
{
tool_reference = hole_descr.m_Tool_Reference;
fprintf( m_file, "T%d\n", tool_reference );
}
diam = std::min( hole_descr.m_Hole_Size.x,
hole_descr.m_Hole_Size.y );
diam = std::min( hole_descr.m_Hole_Size.x, hole_descr.m_Hole_Size.y );
if( diam == 0 )
continue;
@ -166,20 +167,23 @@ int EXCELLON_WRITER::CreateDrillFile( FILE * aFile )
if( hole_descr.m_Hole_Size.x < hole_descr.m_Hole_Size.y )
{
int delta = ( hole_descr.m_Hole_Size.y - hole_descr.m_Hole_Size.x ) / 2;
y0 -= delta; yf += delta;
y0 -= delta;
yf += delta;
}
else
{
int delta = ( hole_descr.m_Hole_Size.x - hole_descr.m_Hole_Size.y ) / 2;
x0 -= delta; xf += delta;
x0 -= delta;
xf += delta;
}
RotatePoint( &x0, &y0, xc, yc, hole_descr.m_Hole_Orient );
RotatePoint( &xf, &yf, xc, yc, hole_descr.m_Hole_Orient );
if( !m_mirror )
{
y0 *= -1; yf *= -1;
y0 *= -1;
yf *= -1;
}
xt = x0 * m_conversionUnits;
@ -189,11 +193,12 @@ int EXCELLON_WRITER::CreateDrillFile( FILE * aFile )
/* remove the '\n' from end of line, because we must add the "G85"
* command to the line: */
for( int kk = 0; line[kk] != 0; kk++ )
{
if( line[kk] == '\n' || line[kk] =='\r' )
line[kk] = 0;
}
fputs( line, m_file );
fputs( "G85", m_file ); // add the "G85" command
xt = xf * m_conversionUnits;
@ -213,14 +218,6 @@ int EXCELLON_WRITER::CreateDrillFile( FILE * aFile )
}
/**
* SetFormat
* Initialize internal parameters to match the given format
* @param aMetric = true for metric coordinates, false for imperial units
* @param aZerosFmt = DECIMAL_FORMAT, SUPPRESS_LEADING, SUPPRESS_TRAILING, KEEP_ZEROS
* @param aLeftDigits = number of digits for integer part of coordinates
* @param aRightDigits = number of digits for mantissa part of coordinates
*/
void EXCELLON_WRITER::SetFormat( bool aMetric,
zeros_fmt aZerosFmt,
int aLeftDigits,
@ -240,10 +237,6 @@ void EXCELLON_WRITER::SetFormat( bool aMetric,
}
/* Created a line like:
* X48000Y19500
* According to the selected format
*/
void EXCELLON_WRITER::WriteCoordinates( char* aLine, double aCoordX, double aCoordY )
{
wxString xs, ys;
@ -277,8 +270,10 @@ void EXCELLON_WRITER::WriteCoordinates( char* aLine, double aCoordX, double aCoo
//Remove useless trailing 0
while( xs.Last() == '0' )
xs.RemoveLast();
while( ys.Last() == '0' )
ys.RemoveLast();
sprintf( aLine, "X%sY%s\n", TO_UTF8( xs ), TO_UTF8( ys ) );
break;
@ -301,6 +296,7 @@ void EXCELLON_WRITER::WriteCoordinates( char* aLine, double aCoordX, double aCoo
if( aCoordX < 0 )
xpad++;
if( aCoordY < 0 )
ypad++;
@ -308,10 +304,12 @@ void EXCELLON_WRITER::WriteCoordinates( char* aLine, double aCoordX, double aCoo
ys.Printf( wxT( "%0*d" ), ypad, KiROUND( aCoordY ) );
size_t j = xs.Len() - 1;
while( xs[j] == '0' && j )
xs.Truncate( j-- );
j = ys.Len() - 1;
while( ys[j] == '0' && j )
ys.Truncate( j-- );
@ -327,8 +325,10 @@ void EXCELLON_WRITER::WriteCoordinates( char* aLine, double aCoordX, double aCoo
if( aCoordX < 0 )
xpad++;
if( aCoordY < 0 )
ypad++;
xs.Printf( wxT( "%0*d" ), xpad, KiROUND( aCoordX ) );
ys.Printf( wxT( "%0*d" ), ypad, KiROUND( aCoordY ) );
sprintf( aLine, "X%sY%s\n", TO_UTF8( xs ), TO_UTF8( ys ) );
@ -337,13 +337,6 @@ void EXCELLON_WRITER::WriteCoordinates( char* aLine, double aCoordX, double aCoo
}
/* Print the DRILL file header. The full header is:
* M48
* ;DRILL file {PCBNEW (2007-11-29-b)} date 17/1/2008-21:02:35
* ;FORMAT={ <precision> / absolute / <units> / <numbers format>}
* FMAT,2
* INCH,TZ
*/
void EXCELLON_WRITER::WriteEXCELLONHeader()
{
fputs( "M48\n", m_file ); // The beginning of a header
@ -361,13 +354,14 @@ void EXCELLON_WRITER::WriteEXCELLONHeader()
msg << m_precision.GetPrecisionString();
else
msg << wxT( "-:-" ); // in decimal format the precision is irrelevant
msg << wxT( "/ absolute / " );
msg << ( m_unitsDecimal ? wxT( "metric" ) : wxT( "inch" ) );
/* Adding numbers notation format.
* this is same as m_Choice_Zeros_Format strings, but NOT translated
* because some EXCELLON parsers do not like non ascii values
* so we use ONLY english (ascii) strings.
* because some EXCELLON parsers do not like non ASCII values
* so we use ONLY English (ASCII) strings.
* if new options are added in m_Choice_Zeros_Format, they must also
* be added here
*/
@ -432,21 +426,11 @@ static bool CmpHoleDiameterValue( const HOLE_INFO& a, const HOLE_INFO& b )
}
/*
* Create the list of holes and tools for a given board
* The list is sorted by increasing drill values
* Only holes from aFirstLayer to aLastLayer copper layers are listed (for vias, because pad holes are always through holes)
* param aFirstLayer = first layer to consider. if < 0 aFirstLayer is ignored (used to creates report file)
* param aLastLayer = last layer to consider. if < 0 aLastLayer is ignored
* param aExcludeThroughHoles : if true, exclude through holes ( pads and vias through )
* param aGenerateNPTH_list :
* true to create NPTH only list (with no plated holes)
* false to created plated holes list (with no NPTH )
*/
void EXCELLON_WRITER::BuildHolesList( int aFirstLayer,
int aLastLayer,
bool aExcludeThroughHoles,
bool aGenerateNPTH_list )
bool aGenerateNPTH_list,
bool aMergePTHNPTH )
{
HOLE_INFO new_hole;
int hole_value;
@ -460,8 +444,12 @@ void EXCELLON_WRITER::BuildHolesList( int aFirstLayer,
EXCHG( aFirstLayer, aLastLayer );
}
/* build hole list for vias
*/
if ( aGenerateNPTH_list && aMergePTHNPTH )
{
return;
}
// build hole list for vias
if( ! aGenerateNPTH_list ) // vias are always plated !
{
for( TRACK* track = m_pcb->m_Track; track; track = track->Next() )
@ -507,7 +495,7 @@ void EXCELLON_WRITER::BuildHolesList( int aFirstLayer,
// Read and analyse pads
for( D_PAD* pad = module->Pads(); pad; pad = pad->Next() )
{
if( ! aGenerateNPTH_list && pad->GetAttribute() == PAD_HOLE_NOT_PLATED )
if( ! aGenerateNPTH_list && pad->GetAttribute() == PAD_HOLE_NOT_PLATED && ! aMergePTHNPTH )
continue;
if( aGenerateNPTH_list && pad->GetAttribute() != PAD_HOLE_NOT_PLATED )
@ -519,15 +507,15 @@ void EXCELLON_WRITER::BuildHolesList( int aFirstLayer,
new_hole.m_Hole_NotPlated = (pad->GetAttribute() == PAD_HOLE_NOT_PLATED);
new_hole.m_Tool_Reference = -1; // Flag is: Not initialized
new_hole.m_Hole_Orient = pad->GetOrientation();
new_hole.m_Hole_Shape = 0; // hole shape: round
new_hole.m_Hole_Diameter = std::min( pad->GetDrillSize().x, pad->GetDrillSize().y );
new_hole.m_Hole_Shape = 0; // hole shape: round
new_hole.m_Hole_Diameter = std::min( pad->GetDrillSize().x, pad->GetDrillSize().y );
new_hole.m_Hole_Size.x = new_hole.m_Hole_Size.y = new_hole.m_Hole_Diameter;
if( pad->GetDrillShape() != PAD_DRILL_CIRCLE )
new_hole.m_Hole_Shape = 1; // oval flag set
new_hole.m_Hole_Size = pad->GetDrillSize();
new_hole.m_Hole_Pos = pad->GetPosition(); // hole position
new_hole.m_Hole_Size = pad->GetDrillSize();
new_hole.m_Hole_Pos = pad->GetPosition(); // hole position
new_hole.m_Hole_Bottom_Layer = LAYER_N_BACK;
new_hole.m_Hole_Top_Layer = LAYER_N_FRONT;// pad holes are through holes
m_holeListBuffer.push_back( new_hole );
@ -539,7 +527,7 @@ void EXCELLON_WRITER::BuildHolesList( int aFirstLayer,
sort( m_holeListBuffer.begin(), m_holeListBuffer.end(), CmpHoleDiameterValue );
// build the tool list
int LastHole = -1; /* Set to not initialised (this is a value not used
int LastHole = -1; /* Set to not initialized (this is a value not used
* for m_holeListBuffer[ii].m_Hole_Diameter) */
DRILL_TOOL new_tool( 0 );
unsigned jj;
@ -556,7 +544,7 @@ void EXCELLON_WRITER::BuildHolesList( int aFirstLayer,
jj = m_toolListBuffer.size();
if( jj == 0 )
continue; // Should not occurs
continue; // Should not occurs
m_holeListBuffer[ii].m_Tool_Reference = jj; // Tool value Initialized (value >= 1)

View File

@ -60,7 +60,7 @@ public:
* So we must generate a drill file for each layer pair (adjacent layers)
* Not plated holes are always through holes, and must be output on a specific drill file
* because they are drilled after the Pcb process is finished.
*/
*/
class HOLE_INFO
{
public:
@ -74,6 +74,7 @@ public:
LAYER_NUM m_Hole_Top_Layer; // hole ending layer (usually front layer):
// m_Hole_First_Layer < m_Hole_Last_Layer
bool m_Hole_NotPlated; // hole not plated. Must be in a specific drill file
public:
HOLE_INFO()
{
@ -88,7 +89,7 @@ class DRILL_PRECISION
{
public:
int m_lhs; // Left digit number (integer value of coordinates)
int m_rhs; // Right digit number (deciam value of coordinates)
int m_rhs; // Right digit number (decimal value of coordinates)
public: DRILL_PRECISION( int l = 2, int r = 4 )
{
@ -120,25 +121,28 @@ public:
SUPPRESS_TRAILING,
KEEP_ZEROS
};
wxPoint m_Offset; // offset coordinates
bool m_ShortHeader; // true to generate the smallest header (strip comments)
wxPoint m_Offset; // offset coordinates
bool m_ShortHeader; // true to generate the smallest header (strip comments)
private:
FILE* m_file; // The output file
BOARD* m_pcb;
bool m_minimalHeader; // True to use minimal haeder
bool m_minimalHeader; // True to use minimal header
// in excellon file (strip comments)
bool m_unitsDecimal; // true = decimal, false = inches
zeros_fmt m_zeroFormat; // the zero format option for output file
DRILL_PRECISION m_precision; // The current coordinate precision (not used in decimat format)
DRILL_PRECISION m_precision; // The current coordinate precision (not used in decimal format)
double m_conversionUnits; // scaling factor to convert the board unites to Excellon units
// (i.e inches or mm)
bool m_mirror;
wxPoint m_offset; // Drill offset ooordinates
wxPoint m_offset; // Drill offset coordinates
bool m_mergePTHNPTH;
std::vector<HOLE_INFO> m_holeListBuffer; // Buffer containing holes
std::vector<DRILL_TOOL> m_toolListBuffer; // Buffer containing tools
public: EXCELLON_WRITER( BOARD* aPcb, wxPoint aOffset )
public:
EXCELLON_WRITER( BOARD* aPcb, wxPoint aOffset )
{
m_file = NULL;
m_pcb = aPcb;
@ -146,6 +150,7 @@ public: EXCELLON_WRITER( BOARD* aPcb, wxPoint aOffset )
m_conversionUnits = 0.0001;
m_unitsDecimal = false;
m_mirror = false;
m_mergePTHNPTH = false;
m_minimalHeader = false;
}
@ -156,7 +161,7 @@ public: EXCELLON_WRITER( BOARD* aPcb, wxPoint aOffset )
/**
* Return the plot offset (usually the position
* of the auxiliaty axis
* of the auxiliary axis
*/
const wxPoint GetOffset() { return m_offset; }
@ -177,11 +182,12 @@ public: EXCELLON_WRITER( BOARD* aPcb, wxPoint aOffset )
* @param aMinimalHeader = true to use a minimal header (no comments, no info)
* @param aOffset = drill coordinates offset
*/
void SetOptions( bool aMirror, bool aMinimalHeader, wxPoint aOffset )
void SetOptions( bool aMirror, bool aMinimalHeader, wxPoint aOffset, bool aMergePTHNPTH )
{
m_mirror = aMirror;
m_offset = aOffset;
m_minimalHeader = aMinimalHeader;
m_mergePTHNPTH = aMergePTHNPTH;
}
/**
@ -198,16 +204,16 @@ public: EXCELLON_WRITER( BOARD* aPcb, wxPoint aOffset )
* false to created plated holes list (with no NPTH )
*/
void BuildHolesList( int aFirstLayer, int aLastLayer,
bool aExcludeThroughHoles,
bool aGenerateNPTH_list );
bool aExcludeThroughHoles,
bool aGenerateNPTH_list,
bool aMergePTHNPTH );
int GetHolesCount() const { return m_holeListBuffer.size(); }
/**
* Function CreateDrillFile
* Creates an Excellon drill file
* @param aFile = an opened file to write to
* will be closed by CreateDrillFile
* @param aFile = an opened file to write to will be closed by CreateDrillFile
* @return hole count
*/
int CreateDrillFile( FILE * aFile );
@ -218,6 +224,47 @@ public: EXCELLON_WRITER( BOARD* aPcb, wxPoint aOffset )
* for through holes, oblong holes, and for buried vias,
* drill values and drill count per layer pair
* there is only one report for all drill files even when buried or blinds vias exist
*
* Here is a sample created by this function:
* Drill report for F:/tmp/interf_u/interf_u.brd
* Created on 04/10/2012 20:48:38
* Selected Drill Unit: Imperial (inches)
*
* Drill report for plated through holes :
* T1 0,025" 0,64mm (88 holes)
* T2 0,031" 0,79mm (120 holes)
* T3 0,032" 0,81mm (151 holes) (with 1 slot)
* T4 0,040" 1,02mm (43 holes)
* T5 0,079" 2,00mm (1 hole) (with 1 slot)
* T6 0,120" 3,05mm (1 hole) (with 1 slot)
*
* Total plated holes count 404
*
*
* Drill report for buried and blind vias :
*
* Drill report for holes from layer Soudure to layer Interne1 :
*
* Total plated holes count 0
*
*
* Drill report for holes from layer Interne1 to layer Interne2 :
* T1 0,025" 0,64mm (3 holes)
*
* Total plated holes count 3
*
*
* Drill report for holes from layer Interne2 to layer Composant :
* T1 0,025" 0,64mm (1 hole)
*
* Total plated holes count 1
*
*
* Drill report for unplated through holes :
* T1 0,120" 3,05mm (1 hole) (with 1 slot)
*
* Total unplated holes count 1
*
* @param aFullFileName : the name of the file to create
* m_unitsDecimal = false tu use inches, true to use mm in report file
*
@ -229,16 +276,29 @@ public: EXCELLON_WRITER( BOARD* aPcb, wxPoint aOffset )
* Function GenDrillMapFile
* Plot a map of drill marks for holes.
* @param aFullFileNameWithoutExt : the full filename of the file to create,
* without extension (will be added accordint ti the format)
* @param aSheet : the paper sheet touse for plot
* without extension (will be added according to the format)
* @param aSheet : the paper sheet to use for plot
* @param aFormat : one of the supported plot formats (see enum PlotFormat )
*/
bool GenDrillMapFile( const wxString& aFullFileNameWithoutExt,
const PAGE_INFO& aSheet,
PlotFormat aFormat );
private:
/* Print the DRILL file header. The full header is:
* M48
* ;DRILL file {PCBNEW (2007-11-29-b)} date 17/1/2008-21:02:35
* ;FORMAT={ <precision> / absolute / <units> / <numbers format>}
* FMAT,2
* INCH,TZ
*/
void WriteEXCELLONHeader();
void WriteEXCELLONEndOfFile();
/* Created a line like:
* X48000Y19500
* According to the selected format
*/
void WriteCoordinates( char* aLine, double aCoordX, double aCoordY );
/** Helper function.
@ -253,6 +313,4 @@ private:
};
#endif // #ifndef _GENDRILL_EXCELLON_WRITER_

View File

@ -22,3 +22,5 @@
#define HELP_ZOOM_REDRAW _( "Redraw the screen of the board" )
#define HELP_SHOW_HIDE_LAYERMANAGER _( "Show/hide the layers manager toolbar" )
#define HELP_SHOW_HIDE_MICROWAVE_TOOLS _( "Show/hide the toolbar for microwave tools\nThis is a experimental feature (under development)" )

View File

@ -62,7 +62,7 @@ void FOOTPRINT_EDIT_FRAME::ReCreateMenuBar()
wxMenu* fileMenu = new wxMenu;
// Active library selection
AddMenuItem( fileMenu, ID_MODEDIT_SELECT_CURRENT_LIB, _("Current Library"),
AddMenuItem( fileMenu, ID_MODEDIT_SELECT_CURRENT_LIB, _("Set Active Library"),
_( "Select active library" ),
KiBitmap( open_library_xpm ) );
fileMenu->AppendSeparator();
@ -77,32 +77,32 @@ void FOOTPRINT_EDIT_FRAME::ReCreateMenuBar()
// from File
AddMenuItem( openSubmenu, ID_MODEDIT_IMPORT_PART,
_( "&Import Module from File" ),
_( "Import a footprint from an existing file" ),
_( "&Import Module From File" ),
_( "Import footprint from an existing file" ),
KiBitmap( import_module_xpm ) );
// from Library
AddMenuItem( openSubmenu, ID_MODEDIT_LOAD_MODULE,
_( "Load Module from Current Li&brary" ),
_( "Open a footprint module from a Library" ),
_( "Load Module From Current Li&brary" ),
_( "Open a footprint module from library" ),
KiBitmap( module_xpm ) );
// from current Board
AddMenuItem( openSubmenu, ID_MODEDIT_LOAD_MODULE_FROM_BOARD,
_( "Load Module from &Current Board" ),
_( "Load a footprint module from the current loaded board" ),
_( "Load Module From &Current Board" ),
_( "Load a footprint module from the current board" ),
KiBitmap( load_module_board_xpm ) );
/* Append openSubmenu to fileMenu */
AddMenuItem( fileMenu, openSubmenu, -1,
_( "&Load Module" ),
_( "Load a footprint module" ),
_( "Load footprint module" ),
KiBitmap( open_document_xpm ) );
fileMenu->AppendSeparator();
// Save the currently loaded legacy library as an s-expression library.
AddMenuItem( fileMenu, ID_MODEDIT_SAVE_LIBRARY_AS,
_( "Save Current Library as ..." ),
_( "Save Current Library As..." ),
_( "Save entire current library under a new name." ),
wxNullBitmap );
@ -116,21 +116,21 @@ void FOOTPRINT_EDIT_FRAME::ReCreateMenuBar()
// Save module in new lib
AddMenuItem( fileMenu, ID_MODEDIT_CREATE_NEW_LIB_AND_SAVE_CURRENT_PART,
_( "S&ave Module into a New Library" ),
_( "S&ave Module in New Library" ),
_( "Create a new library and save current module into it" ),
KiBitmap( new_library_xpm ) );
// Export module
AddMenuItem( fileMenu, ID_MODEDIT_EXPORT_PART,
_( "&Export Module" ),
_( "Save the current loaded module to a file" ),
_( "Save current loaded module into file" ),
KiBitmap( export_module_xpm ) );
fileMenu->AppendSeparator();
// Print
AddMenuItem( fileMenu, wxID_PRINT,
_( "&Print" ),
_( "Print the current module" ),
_( "Print current module" ),
KiBitmap( plot_xpm ) );
// Separator
@ -139,7 +139,7 @@ void FOOTPRINT_EDIT_FRAME::ReCreateMenuBar()
// Close editor
AddMenuItem( fileMenu, wxID_EXIT,
_( "Cl&ose" ),
_( "Close the footprint editor" ),
_( "Close footprint editor" ),
KiBitmap( exit_xpm ) );
// Menu Edit:
@ -148,18 +148,18 @@ void FOOTPRINT_EDIT_FRAME::ReCreateMenuBar()
// Undo
text = AddHotkeyName( _( "&Undo" ), g_Module_Editor_Hokeys_Descr, HK_UNDO );
AddMenuItem( editMenu, wxID_UNDO,
text, _( "Undo last edit" ),
text, _( "Undo last action" ),
KiBitmap( undo_xpm ) );
// Redo
text = AddHotkeyName( _( "&Redo" ), g_Module_Editor_Hokeys_Descr, HK_REDO );
AddMenuItem( editMenu, wxID_REDO,
text, _( "Redo the last undo action" ),
text, _( "Redo last action" ),
KiBitmap( redo_xpm ) );
// Delete items
AddMenuItem( editMenu, ID_MODEDIT_DELETE_TOOL,
_( "&Delete" ), _( "Delete objects with the eraser" ),
_( "&Delete" ), _( "Delete objects with eraser" ),
KiBitmap( delete_xpm ) );
// Separator
@ -167,7 +167,7 @@ void FOOTPRINT_EDIT_FRAME::ReCreateMenuBar()
// Properties
AddMenuItem( editMenu, ID_MODEDIT_EDIT_MODULE_PROPERTIES,
_( "&Properties" ),
_( "Edit &Properties" ),
_( "Edit module properties" ),
KiBitmap( module_options_xpm ) );
@ -176,13 +176,13 @@ void FOOTPRINT_EDIT_FRAME::ReCreateMenuBar()
// Sizes and Widths
AddMenuItem( dimensions_Submenu, ID_PCB_DRAWINGS_WIDTHS_SETUP,
_( "&Sizes and Widths" ),
_( "&Size and Width" ),
_( "Adjust width for texts and drawings" ),
KiBitmap( options_text_xpm ) );
// Pad settings
AddMenuItem( dimensions_Submenu, ID_MODEDIT_PAD_SETTINGS,
_( "&Pad Settings" ), _( "Edit the settings for new pads" ),
_( "&Pad Setting" ), _( "Edit settings for new pads" ),
KiBitmap( pad_dimensions_xpm ) );
// User grid size
@ -195,25 +195,25 @@ void FOOTPRINT_EDIT_FRAME::ReCreateMenuBar()
// Zoom In
AddMenuItem( viewMenu, ID_ZOOM_IN,
_( "Zoom &In" ), _( "Zoom in on the module" ),
_( "Zoom &In" ), _( "Zoom in" ),
KiBitmap( zoom_in_xpm ) );
// Zoom Out
AddMenuItem( viewMenu, ID_ZOOM_OUT,
_( "Zoom &Out" ), _( "Zoom out on the module" ),
_( "Zoom &Out" ), _( "Zoom out" ),
KiBitmap( zoom_out_xpm ) );
// Fit on Screen
AddMenuItem( viewMenu, ID_ZOOM_PAGE,
_( "&Fit on Screen" ),
_( "Zoom and fit the module in the window" ),
_( "Zoom to fit the module in the window" ),
KiBitmap( zoom_fit_in_page_xpm ) );
viewMenu->AppendSeparator();
// Redraw
AddMenuItem( viewMenu, ID_ZOOM_REDRAW,
_( "&Redraw" ), _( "Redraw the window's viewport" ),
_( "&Redraw" ), _( "Redraw window's viewport" ),
KiBitmap( zoom_redraw_xpm ) );
// 3D view
@ -258,7 +258,7 @@ void FOOTPRINT_EDIT_FRAME::ReCreateMenuBar()
// Anchor
AddMenuItem( placeMenu, ID_MODEDIT_ANCHOR_TOOL,
_( "A&nchor" ),
_( "Place the footprint module reference anchor" ),
_( "Place footprint module reference anchor" ),
KiBitmap( anchor_xpm ) );
// Menu Help:
@ -269,8 +269,8 @@ void FOOTPRINT_EDIT_FRAME::ReCreateMenuBar()
// Contents
AddMenuItem( helpMenu, wxID_HELP,
_( "&Contents" ),
_( "Open the Pcbnew handbook" ),
_( "P&cbnew Manual" ),
_( "Open the Pcbnew manual" ),
KiBitmap( online_help_xpm ) );
AddMenuItem( helpMenu, wxID_INDEX,

View File

@ -482,6 +482,13 @@ void PCB_EDIT_FRAME::ReCreateMenuBar()
HELP_SHOW_HIDE_LAYERMANAGER,
KiBitmap( layers_manager_xpm ) );
AddMenuItem( configmenu, ID_MENU_PCB_SHOW_HIDE_MUWAVE_TOOLBAR,
m_show_microwave_tools ?
_( "Hide Microwave Toolbar" ): _( "Show Microwave Toolbar" ),
HELP_SHOW_HIDE_MICROWAVE_TOOLS,
KiBitmap( mw_toolbar_xpm ) );
// General
#ifdef __WXMAC__
configmenu->Append(wxID_PREFERENCES);

View File

@ -121,6 +121,8 @@ void PCB_BASE_FRAME::Import_Pad_Settings( D_PAD* aPad, bool aDraw )
m_canvas->RefreshDrawingRect( aPad->GetBoundingBox() );
aPad->GetParent()->SetLastEditTime();
OnModify();
}
/** Compute the 'next' pad number for autoincrement
@ -132,8 +134,8 @@ static wxString GetNextPadName( wxString aPadName )
int ponder = 1;
// Trim and extract the trailing numeric part
while( aPadName.Len()
&& aPadName.Last() >= '0'
while( aPadName.Len()
&& aPadName.Last() >= '0'
&& aPadName.Last() <= '9' )
{
num += ( aPadName.Last() - '0' ) * ponder;

View File

@ -29,3 +29,5 @@ set( PCAD2PCBNEW_SRCS
)
add_library( pcad2kicadpcb STATIC ${PCAD2PCBNEW_SRCS} )
add_dependencies( pcad2kicadpcb lib-dependencies )

View File

@ -141,6 +141,7 @@ BEGIN_EVENT_TABLE( PCB_EDIT_FRAME, PCB_BASE_FRAME )
EVT_MENU_RANGE( ID_PREFERENCES_HOTKEY_START, ID_PREFERENCES_HOTKEY_END,
PCB_EDIT_FRAME::Process_Config )
EVT_MENU( ID_MENU_PCB_SHOW_HIDE_LAYERS_MANAGER_DIALOG, PCB_EDIT_FRAME::Process_Config )
EVT_MENU( ID_MENU_PCB_SHOW_HIDE_MUWAVE_TOOLBAR, PCB_EDIT_FRAME::Process_Config )
EVT_MENU( wxID_PREFERENCES, PCB_EDIT_FRAME::Process_Config )
EVT_MENU( ID_PCB_LAYERS_SETUP, PCB_EDIT_FRAME::Process_Config )
EVT_MENU( ID_PCB_MASK_CLEARANCE, PCB_EDIT_FRAME::Process_Config )
@ -292,6 +293,8 @@ BEGIN_EVENT_TABLE( PCB_EDIT_FRAME, PCB_BASE_FRAME )
PCB_EDIT_FRAME::OnUpdateVerticalToolbar )
EVT_UPDATE_UI_RANGE( ID_TB_OPTIONS_SHOW_ZONES, ID_TB_OPTIONS_SHOW_ZONES_OUTLINES_ONLY,
PCB_EDIT_FRAME::OnUpdateZoneDisplayStyle )
EVT_UPDATE_UI_RANGE( ID_PCB_MUWAVE_START_CMD, ID_PCB_MUWAVE_END_CMD,
PCB_EDIT_FRAME::OnUpdateMuWaveToolbar )
END_EVENT_TABLE()

View File

@ -77,6 +77,17 @@ void PCB_EDIT_FRAME::Process_Config( wxCommandEvent& event )
_("Hide &Layers Manager" ) : _("Show &Layers Manager" ));
break;
case ID_MENU_PCB_SHOW_HIDE_MUWAVE_TOOLBAR:
m_show_microwave_tools = ! m_show_microwave_tools;
m_auimgr.GetPane( wxT( "m_microWaveToolBar" ) ).Show( m_show_microwave_tools );
m_auimgr.Update();
GetMenuBar()->SetLabel( ID_MENU_PCB_SHOW_HIDE_MUWAVE_TOOLBAR,
m_show_microwave_tools ?
_( "Hide Microwave Toolbar" ): _( "Show Microwave Toolbar" ));
break;
case ID_PCB_LAYERS_SETUP:
InstallDialogLayerSetup();
break;

View File

@ -280,6 +280,7 @@ enum pcbnew_ids
ID_PCB_LIB_TABLE_EDIT,
ID_MENU_PCB_SHOW_DESIGN_RULES_DIALOG,
ID_MENU_PCB_SHOW_HIDE_LAYERS_MANAGER_DIALOG,
ID_MENU_PCB_SHOW_HIDE_MUWAVE_TOOLBAR,
ID_TB_OPTIONS_SHOW_MANAGE_LAYERS_VERTICAL_TOOLBAR,
ID_TB_OPTIONS_SHOW_ZONES,

View File

@ -801,26 +801,40 @@ void RN_DATA::ProcessBoard()
{
m_nets.clear();
m_nets.resize( m_board->GetNetCount() );
int netCode;
// Iterate over all items that may need to be connected
for( MODULE* module = m_board->m_Modules; module; module = module->Next() )
{
for( D_PAD* pad = module->Pads().GetFirst(); pad; pad = pad->Next() )
m_nets[pad->GetNet()].AddItem( pad );
{
netCode = pad->GetNet();
if( netCode > 0 )
m_nets[netCode].AddItem( pad );
}
}
for( TRACK* track = m_board->m_Track; track; track = track->Next() )
{
if( track->Type() == PCB_VIA_T )
m_nets[track->GetNet()].AddItem( static_cast<SEGVIA*>( track ) );
else if( track->Type() == PCB_TRACE_T )
m_nets[track->GetNet()].AddItem( track );
netCode = track->GetNet();
if( netCode > 0 )
{
if( track->Type() == PCB_VIA_T )
m_nets[netCode].AddItem( static_cast<SEGVIA*>( track ) );
else if( track->Type() == PCB_TRACE_T )
m_nets[netCode].AddItem( track );
}
}
for( int i = 0; i < m_board->GetAreaCount(); ++i )
{
ZONE_CONTAINER* zone = m_board->GetArea( i );
m_nets[zone->GetNet()].AddItem( zone );
netCode = zone->GetNet();
if( netCode > 0 )
m_nets[netCode].AddItem( zone );
}
}

View File

@ -48,4 +48,3 @@ set( PCBNEW_PNS_SRCS
)
add_library( pnsrouter STATIC ${PCBNEW_PNS_SRCS} )

View File

@ -398,7 +398,7 @@ void PCB_EDIT_FRAME::ReCreateOptToolbar()
m_optionsToolBar->AddTool( ID_TB_OPTIONS_SHOW_EXTRA_VERTICAL_TOOLBAR_MICROWAVE,
wxEmptyString,
KiBitmap( mw_toolbar_xpm ),
_( "Show/hide the toolbar for microwaves tools\n This is a experimental feature (under development)" ),
HELP_SHOW_HIDE_MICROWAVE_TOOLS,
wxITEM_CHECK );
@ -500,25 +500,30 @@ void PCB_EDIT_FRAME::ReCreateMicrowaveVToolbar()
// Set up toolbar
m_microWaveToolBar->AddTool( ID_PCB_MUWAVE_TOOL_SELF_CMD, wxEmptyString,
KiBitmap( mw_add_line_xpm ),
_( "Create line of specified length for microwave applications" ) );
_( "Create line of specified length for microwave applications" ),
wxITEM_CHECK );
m_microWaveToolBar->AddTool( ID_PCB_MUWAVE_TOOL_GAP_CMD, wxEmptyString,
KiBitmap( mw_add_gap_xpm ),
_( "Create gap of specified length for microwave applications" ) );
_( "Create gap of specified length for microwave applications" ),
wxITEM_CHECK );
m_microWaveToolBar->AddSeparator();
m_microWaveToolBar->AddTool( ID_PCB_MUWAVE_TOOL_STUB_CMD, wxEmptyString,
KiBitmap( mw_add_stub_xpm ),
_( "Create stub of specified length for microwave applications" ) );
_( "Create stub of specified length for microwave applications" ),
wxITEM_CHECK );
m_microWaveToolBar->AddTool( ID_PCB_MUWAVE_TOOL_STUB_ARC_CMD, wxEmptyString,
KiBitmap( mw_add_stub_arc_xpm ),
_( "Create stub (arc) of specified length for microwave applications" ) );
_( "Create stub (arc) of specified length for microwave applications" ),
wxITEM_CHECK );
m_microWaveToolBar->AddTool( ID_PCB_MUWAVE_TOOL_FUNCTION_SHAPE_CMD, wxEmptyString,
KiBitmap( mw_add_shape_xpm ),
_( "Create a polynomial shape for microwave applications" ) );
_( "Create a polynomial shape for microwave applications" ),
wxITEM_CHECK );
m_microWaveToolBar->Realize();
}

View File

@ -204,6 +204,12 @@ void PCB_EDIT_FRAME::OnUpdateVerticalToolbar( wxUpdateUIEvent& aEvent )
aEvent.Check( GetToolId() == aEvent.GetId() );
}
void PCB_EDIT_FRAME::OnUpdateMuWaveToolbar( wxUpdateUIEvent& aEvent )
{
if( aEvent.GetEventObject() == m_microWaveToolBar )
aEvent.Check( GetToolId() == aEvent.GetId() );
}
void PCB_EDIT_FRAME::OnUpdateAutoPlaceTracksMode( wxUpdateUIEvent& aEvent )
{

View File

@ -18,3 +18,6 @@ set(POLYGON_SRCS
)
add_library(polygon STATIC ${POLYGON_SRCS})
add_dependencies( polygon lib-dependencies )

View File

@ -18,6 +18,10 @@ add_executable( dxf2idf dxf2idfmain.cpp dxf2idf.cpp
"${CMAKE_SOURCE_DIR}/common/richio.cpp"
)
add_dependencies( idfcyl lib-dependencies )
add_dependencies( idfrect lib-dependencies )
add_dependencies( dxf2idf lib-dependencies )
target_link_libraries( dxf2idf lib_dxf ${wxWidgets_LIBRARIES} )
install( TARGETS idfcyl idfrect dxf2idf