diff --git a/3d-viewer/3d_aux.cpp b/3d-viewer/3d_aux.cpp index e78229a296..aee7d99922 100644 --- a/3d-viewer/3d_aux.cpp +++ b/3d-viewer/3d_aux.cpp @@ -84,7 +84,6 @@ void S3D_MASTER::ObjectCoordsTo3DUnits( std::vector< S3D_VERTEX >& aVertices ) } /* adjust offset position (offset is given in UNIT 3D (0.1 inch) */ -#define SCALE_3D_CONV ((IU_PER_MILS * 1000) / UNITS3D_TO_UNITSPCB) aVertices[ii].x += m_MatPosition.x * SCALE_3D_CONV; aVertices[ii].y += m_MatPosition.y * SCALE_3D_CONV; aVertices[ii].z += m_MatPosition.z * SCALE_3D_CONV; diff --git a/3d-viewer/3d_class.cpp b/3d-viewer/3d_class.cpp index 8a1d5f4c62..5c9e9deeae 100644 --- a/3d-viewer/3d_class.cpp +++ b/3d-viewer/3d_class.cpp @@ -5,7 +5,7 @@ /* * This program source code file is part of KiCad, a free EDA CAD application. * - * Copyright (C) 1992-2012 KiCad Developers, see AUTHORS.txt for contributors. + * Copyright (C) 1992-2015 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 @@ -83,6 +83,8 @@ S3D_MASTER::S3D_MASTER( EDA_ITEM* aParent ) : m_use_modelfile_ambientIntensity = true; m_use_modelfile_transparency = true; m_use_modelfile_shininess = true; + m_loadTransparentObjects = true; + m_loadNonTransparentObjects = true; } diff --git a/3d-viewer/3d_draw_helper_functions.cpp b/3d-viewer/3d_draw_helper_functions.cpp index b3c08aa86f..f74e700996 100644 --- a/3d-viewer/3d_draw_helper_functions.cpp +++ b/3d-viewer/3d_draw_helper_functions.cpp @@ -304,7 +304,7 @@ void EDA_3D_CANVAS::Draw3DGrid( double aGriSizeMM ) glEnd(); } - if( delta > xsize / 2 ) + if( delta > xsize / 2.0f ) break; } diff --git a/3d-viewer/3d_struct.h b/3d-viewer/3d_struct.h index 22b12ce56e..c64d3d8655 100644 --- a/3d-viewer/3d_struct.h +++ b/3d-viewer/3d_struct.h @@ -42,6 +42,14 @@ */ #define UNITS3D_TO_UNITSPCB (IU_PER_MILS * 100) +/** + * scaling factor for 3D shape offset ( S3D_MASTER::m_MatPosition member ) + * Was in inches in legacy version, and, due to a mistake, still in inches + * in .kicad_pcb files (which are using mm) + * so this scaling convert file units (inch) to 3D units (0.1 inch), only + * for S3D_MASTER::m_MatPosition parameter + */ +#define SCALE_3D_CONV 10 class S3D_MASTER; class STRUCT_3D_SHAPE; diff --git a/3d-viewer/vrml_aux.cpp b/3d-viewer/vrml_aux.cpp index 8422efa7e8..7611c4d580 100644 --- a/3d-viewer/vrml_aux.cpp +++ b/3d-viewer/vrml_aux.cpp @@ -94,13 +94,13 @@ static int SkipGetChar( FILE* File ) } -char* GetNextTag( FILE* File, char* tag ) +bool GetNextTag( FILE* File, char* tag, size_t len ) { int c = SkipGetChar( File ); if( c == EOF ) { - return NULL; + return false; } tag[0] = c; @@ -109,9 +109,10 @@ char* GetNextTag( FILE* File, char* tag ) // DBG( printf( "tag[0] %c\n", tag[0] ) ); if( (c != '}') && (c != ']') ) { + len--; char* dst = &tag[1]; - while( fscanf( File, "%c", dst ) ) + while( fscanf( File, "%c", dst ) && len > 0 ) { if( (*dst == ' ') || (*dst == '[') || (*dst == '{') || (*dst == '\t') || (*dst == '\n')|| (*dst == '\r') ) @@ -121,6 +122,7 @@ char* GetNextTag( FILE* File, char* tag ) } dst++; + len--; } @@ -134,7 +136,7 @@ char* GetNextTag( FILE* File, char* tag ) } } - return tag; + return true; } diff --git a/3d-viewer/vrml_aux.h b/3d-viewer/vrml_aux.h index f245ce7dfc..718ad72cc0 100644 --- a/3d-viewer/vrml_aux.h +++ b/3d-viewer/vrml_aux.h @@ -52,6 +52,6 @@ int read_NotImplemented( FILE* File, char closeChar); int parseVertexList( FILE* File, std::vector< glm::vec3 > &dst_vector); int parseVertex( FILE* File, glm::vec3 &dst_vertex ); int parseFloat( FILE* File, float *dst_float ); -char* GetNextTag( FILE* File, char* tag ); +bool GetNextTag( FILE* File, char* tag, size_t len ); #endif diff --git a/3d-viewer/vrml_v1_modelparser.cpp b/3d-viewer/vrml_v1_modelparser.cpp index 814daf3e46..97cc69bfdb 100644 --- a/3d-viewer/vrml_v1_modelparser.cpp +++ b/3d-viewer/vrml_v1_modelparser.cpp @@ -75,9 +75,6 @@ void VRML1_MODEL_PARSER::Load( const wxString& aFilename, double aVrmlunits_to_3 glm::vec3 matPos( GetMaster()->m_MatPosition.x, GetMaster()->m_MatPosition.y, GetMaster()->m_MatPosition.z ); - -#define SCALE_3D_CONV ( (IU_PER_MILS * 1000.0f) / UNITS3D_TO_UNITSPCB ) - // glPushMatrix(); glTranslatef( matPos.x * SCALE_3D_CONV, matPos.y * SCALE_3D_CONV, matPos.z * SCALE_3D_CONV ); @@ -91,7 +88,7 @@ void VRML1_MODEL_PARSER::Load( const wxString& aFilename, double aVrmlunits_to_3 childs.clear(); - while( GetNextTag( m_file, text ) ) + while( GetNextTag( m_file, text, sizeof(text) ) ) { if( ( *text == '}' ) || ( *text == ']' ) ) { @@ -126,7 +123,7 @@ int VRML1_MODEL_PARSER::read_separator() // DBG( printf( "Separator\n" ) ); - while( GetNextTag( m_file, text ) ) + while( GetNextTag( m_file, text, sizeof(text) ) ) { if( strcmp( text, "Material" ) == 0 ) { @@ -185,7 +182,7 @@ int VRML1_MODEL_PARSER::readMaterial() m_model->m_Materials = material; - while( GetNextTag( m_file, text ) ) + while( GetNextTag( m_file, text, sizeof(text) ) ) { if( *text == ']' ) { @@ -233,7 +230,7 @@ int VRML1_MODEL_PARSER::readCoordinate3() // DBG( printf( " readCoordinate3\n" ) ); - while( GetNextTag( m_file, text ) ) + while( GetNextTag( m_file, text, sizeof(text) ) ) { if( *text == ']' ) { @@ -261,7 +258,7 @@ int VRML1_MODEL_PARSER::readIndexedFaceSet() // DBG( printf( " readIndexedFaceSet\n" ) ); - while( GetNextTag( m_file, text ) ) + while( GetNextTag( m_file, text, sizeof(text) ) ) { if( *text == ']' ) { diff --git a/3d-viewer/vrml_v2_modelparser.cpp b/3d-viewer/vrml_v2_modelparser.cpp index 92da608393..f648f08605 100644 --- a/3d-viewer/vrml_v2_modelparser.cpp +++ b/3d-viewer/vrml_v2_modelparser.cpp @@ -53,6 +53,10 @@ VRML2_MODEL_PARSER::VRML2_MODEL_PARSER( S3D_MASTER* aMaster ) : S3D_MODEL_PARSER( aMaster ) { m_model = NULL; + m_file = NULL; + m_Materials = NULL; + m_normalPerVertex = true; + colorPerVertex = true; } @@ -87,9 +91,6 @@ void VRML2_MODEL_PARSER::Load( const wxString& aFilename, double aVrmlunits_to_3 glm::vec3 matPos( GetMaster()->m_MatPosition.x, GetMaster()->m_MatPosition.y, GetMaster()->m_MatPosition.z ); - -#define SCALE_3D_CONV ( (IU_PER_MILS * 1000.0f) / UNITS3D_TO_UNITSPCB ) - glTranslatef( matPos.x * SCALE_3D_CONV, matPos.y * SCALE_3D_CONV, matPos.z * SCALE_3D_CONV ); glRotatef( -matRot.z, 0.0f, 0.0f, 1.0f ); @@ -102,7 +103,7 @@ void VRML2_MODEL_PARSER::Load( const wxString& aFilename, double aVrmlunits_to_3 childs.clear(); - while( GetNextTag( m_file, text ) ) + while( GetNextTag( m_file, text, sizeof(text) ) ) { if( ( *text == '}' ) || ( *text == ']' ) ) { @@ -141,7 +142,7 @@ int VRML2_MODEL_PARSER::read_Transform() { char text[128]; - while( GetNextTag( m_file, text ) ) + while( GetNextTag( m_file, text, sizeof(text) ) ) { if( *text == ']' ) { @@ -260,15 +261,15 @@ int VRML2_MODEL_PARSER::read_DEF_Coordinate() char text[128]; // Get the name of the definition. - GetNextTag( m_file, text ); + GetNextTag( m_file, text, sizeof(text) ); std::string coordinateName = text; - while( GetNextTag( m_file, text ) ) + while( GetNextTag( m_file, text, sizeof(text) ) ) { - if( ( text == NULL ) || ( *text == ']' ) ) + if( *text == ']' ) continue; - if( ( *text == '}' ) ) + if( *text == '}' ) return 0; if( strcmp( text, "Coordinate" ) == 0 ) @@ -290,9 +291,9 @@ int VRML2_MODEL_PARSER::read_DEF() { char text[128]; - GetNextTag( m_file, text ); + GetNextTag( m_file, text, sizeof(text) ); - while( GetNextTag( m_file, text ) ) + while( GetNextTag( m_file, text, sizeof(text) ) ) { if( *text == ']' ) { @@ -347,7 +348,7 @@ int VRML2_MODEL_PARSER::read_USE() char text[128]; // Get the name of the definition. - GetNextTag( m_file, text ); + GetNextTag( m_file, text, sizeof(text) ); std::string coordinateName = text; // Look for it in our coordinate map. @@ -371,7 +372,7 @@ int VRML2_MODEL_PARSER::read_Shape() { char text[128]; - while( GetNextTag( m_file, text ) ) + while( GetNextTag( m_file, text, sizeof(text) ) ) { if( *text == ']' ) { @@ -421,7 +422,7 @@ int VRML2_MODEL_PARSER::read_Appearance() { char text[128]; - while( GetNextTag( m_file, text ) ) + while( GetNextTag( m_file, text, sizeof(text) ) ) { if( *text == ']' ) { @@ -449,7 +450,7 @@ int VRML2_MODEL_PARSER::read_material() S3D_MATERIAL* material = NULL; char text[128]; - if( GetNextTag( m_file, text ) ) + if( GetNextTag( m_file, text, sizeof(text) ) ) { if( strcmp( text, "Material" ) == 0 ) { @@ -465,7 +466,7 @@ int VRML2_MODEL_PARSER::read_material() } else if( strcmp( text, "DEF" ) == 0 ) { - if( GetNextTag( m_file, text ) ) + if( GetNextTag( m_file, text, sizeof(text) ) ) { wxString mat_name; mat_name = FROM_UTF8( text ); @@ -474,7 +475,7 @@ int VRML2_MODEL_PARSER::read_material() GetMaster()->Insert( material ); m_model->m_Materials = material; - if( GetNextTag( m_file, text ) ) + if( GetNextTag( m_file, text, sizeof(text) ) ) { if( strcmp( text, "Material" ) == 0 ) { @@ -485,7 +486,7 @@ int VRML2_MODEL_PARSER::read_material() } else if( strcmp( text, "USE" ) == 0 ) { - if( GetNextTag( m_file, text ) ) + if( GetNextTag( m_file, text, sizeof(text) ) ) { wxString mat_name; mat_name = FROM_UTF8( text ); @@ -514,7 +515,7 @@ int VRML2_MODEL_PARSER::read_Material() char text[128]; glm::vec3 vertex; - while( GetNextTag( m_file, text ) ) + while( GetNextTag( m_file, text, sizeof(text) ) ) { if( *text == ']' ) { @@ -596,7 +597,7 @@ int VRML2_MODEL_PARSER::read_IndexedFaceSet() m_normalPerVertex = false; colorPerVertex = false; - while( GetNextTag( m_file, text ) ) + while( GetNextTag( m_file, text, sizeof(text) ) ) { if( *text == ']' ) { @@ -610,7 +611,7 @@ int VRML2_MODEL_PARSER::read_IndexedFaceSet() if( strcmp( text, "normalPerVertex" ) == 0 ) { - if( GetNextTag( m_file, text ) ) + if( GetNextTag( m_file, text, sizeof(text) ) ) { if( strcmp( text, "TRUE" ) == 0 ) { @@ -620,7 +621,7 @@ int VRML2_MODEL_PARSER::read_IndexedFaceSet() } else if( strcmp( text, "colorPerVertex" ) == 0 ) { - GetNextTag( m_file, text ); + GetNextTag( m_file, text, sizeof(text) ); if( strcmp( text, "TRUE" ) ) { @@ -670,12 +671,12 @@ int VRML2_MODEL_PARSER::read_IndexedLineSet() { char text[128]; - while( GetNextTag( m_file, text ) ) + while( GetNextTag( m_file, text, sizeof(text) ) ) { - if( ( text == NULL ) || ( *text == ']' ) ) + if( *text == ']' ) continue; - if( ( *text == '}' ) ) + if( *text == '}' ) return 0; if( strcmp( text, "Coordinate" ) == 0 ) @@ -786,7 +787,7 @@ int VRML2_MODEL_PARSER::read_Color() { char text[128]; - while( GetNextTag( m_file, text ) ) + while( GetNextTag( m_file, text, sizeof(text) ) ) { if( *text == ']' ) { @@ -813,7 +814,7 @@ int VRML2_MODEL_PARSER::read_Normal() { char text[128]; - while( GetNextTag( m_file, text ) ) + while( GetNextTag( m_file, text, sizeof(text) ) ) { if( *text == ']' ) { @@ -846,7 +847,7 @@ int VRML2_MODEL_PARSER::read_Coordinate() { char text[128]; - while( GetNextTag( m_file, text ) ) + while( GetNextTag( m_file, text, sizeof(text) ) ) { if( *text == ']' ) { @@ -875,12 +876,12 @@ int VRML2_MODEL_PARSER::read_CoordinateDef() { char text[128]; - while( GetNextTag( m_file, text ) ) + while( GetNextTag( m_file, text, sizeof(text) ) ) { - if( ( text == NULL ) || ( *text == ']' ) ) + if( *text == ']' ) continue; - if( ( *text == '}' ) ) + if( *text == '}' ) return 0; if( strcmp( text, "point" ) == 0 ) diff --git a/3d-viewer/x3dmodelparser.cpp b/3d-viewer/x3dmodelparser.cpp index d6a1d106f7..8a71777fae 100644 --- a/3d-viewer/x3dmodelparser.cpp +++ b/3d-viewer/x3dmodelparser.cpp @@ -79,10 +79,6 @@ void X3D_MODEL_PARSER::Load( const wxString& aFilename, double aVrmlunits_to_3Du glm::vec3 matPos( GetMaster()->m_MatPosition.x, GetMaster()->m_MatPosition.y, GetMaster()->m_MatPosition.z ); - -#define SCALE_3D_CONV ( (IU_PER_MILS * 1000.0f) / UNITS3D_TO_UNITSPCB ) - - glTranslatef( matPos.x * SCALE_3D_CONV, matPos.y * SCALE_3D_CONV, matPos.z * SCALE_3D_CONV ); glRotatef( -matRot.z, 0.0f, 0.0f, 1.0f ); diff --git a/CMakeLists.txt b/CMakeLists.txt index 4029146eca..130bccbb63 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -670,6 +670,13 @@ if( KICAD_SCRIPTING OR KICAD_SCRIPTING_MODULES ) # wxWidgets found. At least the major an minor version should match. set( _wxpy_version "${wxWidgets_VERSION_MAJOR}.${wxWidgets_VERSION_MINOR}" ) set( _py_cmd "import wxversion;print wxversion.checkInstalled('${_wxpy_version}')" ) + + # Add user specified Python site package path. + if( PYTHON_SITE_PACKAGE_PATH ) + set( _py_cmd + "import sys;sys.path.insert(0, \"${PYTHON_SITE_PACKAGE_PATH}\");${_py_cmd}" ) + endif() + execute_process( COMMAND ${PYTHON_EXECUTABLE} -c "${_py_cmd}" RESULT_VARIABLE WXPYTHON_VERSION_RESULT OUTPUT_VARIABLE WXPYTHON_VERSION_FOUND @@ -685,11 +692,12 @@ if( KICAD_SCRIPTING OR KICAD_SCRIPTING_MODULES ) endif() if( NOT WXPYTHON_VERSION_FOUND STREQUAL "True" ) - message( FATAL_ERROR "wxPython version ${_wxpy_version} does not appear to be installed on the system." ) - else() - set( WXPYTHON_VERSION_FOUND "${_wxpy_version}" - CACHE STRING "wxPython version found." ) + message( FATAL_ERROR + "wxPython version ${_wxpy_version} does not appear to be installed on the system." ) endif() + + set( WXPYTHON_VERSION ${_wxpy_version} CACHE STRING "wxPython version found." ) + message( STATUS "wxPython version ${_wxpy_version} found." ) endif() #message( STATUS "PYTHON_INCLUDE_DIRS:${PYTHON_INCLUDE_DIRS}" ) @@ -829,6 +837,9 @@ else() message( STATUS "WARNING: Doxygen not found - doxygen-docs (Source Docs) target not created" ) endif() +# Generate config.h. +configure_file( ${PROJECT_SOURCE_DIR}/CMakeModules/config.h.cmake + ${CMAKE_BINARY_DIR}/config.h ) #================================================ # "make uninstall" rules diff --git a/CMakeModules/PerformFeatureChecks.cmake b/CMakeModules/PerformFeatureChecks.cmake index 5c9d092957..b48cb0af60 100644 --- a/CMakeModules/PerformFeatureChecks.cmake +++ b/CMakeModules/PerformFeatureChecks.cmake @@ -109,9 +109,4 @@ macro( perform_feature_checks ) # getc() on platforms where getc_unlocked() doesn't exist. check_symbol_exists( getc_unlocked "stdio.h" HAVE_FGETC_NOLOCK ) - # Generate config.h. - configure_file( ${PROJECT_SOURCE_DIR}/CMakeModules/config.h.cmake - ${CMAKE_BINARY_DIR}/config.h - ) - endmacro( perform_feature_checks ) diff --git a/CMakeModules/config.h.cmake b/CMakeModules/config.h.cmake index 46272e82c0..a71d1661d3 100644 --- a/CMakeModules/config.h.cmake +++ b/CMakeModules/config.h.cmake @@ -72,7 +72,7 @@ /// The wxPython version found during configuration. #if defined( KICAD_SCRIPTING_WXPYTHON ) -#define WXPYTHON_VERSION "@WXPYTHON_VERSION_FOUND@" +#define WXPYTHON_VERSION "@WXPYTHON_VERSION@" #endif /// When defined, build the GITHUB_PLUGIN for pcbnew. diff --git a/bitmaps_png/CMakeLists.txt b/bitmaps_png/CMakeLists.txt index 322836ed2f..cbef91207f 100644 --- a/bitmaps_png/CMakeLists.txt +++ b/bitmaps_png/CMakeLists.txt @@ -151,6 +151,12 @@ set( BMAPS_MID annotate_down_right annotate_right_down annotate + array_line + array_module + array_pad + array_text + array_target + array_zone auto_associe auto_delete_track auto_track_width @@ -217,6 +223,12 @@ set( BMAPS_MID drag_track_segment drc_off drc + duplicate_line + duplicate_module + duplicate_pad + duplicate_target + duplicate_text + duplicate_zone edges_sketch edit_comp_footprint edit_component @@ -363,9 +375,11 @@ set( BMAPS_MID move_polygon move_rectangle move_sheet + move_target move_text move_track_segment move_track + move_zone move mw_add_gap mw_add_line diff --git a/bitmaps_png/cpp_26/array_footprint.cpp b/bitmaps_png/cpp_26/array_footprint.cpp new file mode 100644 index 0000000000..c7b32372e6 --- /dev/null +++ b/bitmaps_png/cpp_26/array_footprint.cpp @@ -0,0 +1,25 @@ + +/* Do not modify this file, it was automatically generated by the + * PNG2cpp CMake script, using a *.png file as input. + */ + +#include + +static const unsigned char png[] = { + 0x89, 0x50, 0x4e, 0x47, 0x0d, 0x0a, 0x1a, 0x0a, 0x00, 0x00, 0x00, 0x0d, 0x49, 0x48, 0x44, 0x52, + 0x00, 0x00, 0x00, 0x1a, 0x00, 0x00, 0x00, 0x1a, 0x08, 0x06, 0x00, 0x00, 0x00, 0xa9, 0x4a, 0x4c, + 0xce, 0x00, 0x00, 0x00, 0x79, 0x49, 0x44, 0x41, 0x54, 0x48, 0xc7, 0xdd, 0x94, 0x41, 0x0a, 0x00, + 0x31, 0x08, 0x03, 0xfd, 0x4a, 0xff, 0x94, 0xff, 0xf6, 0xdc, 0xfd, 0x94, 0x7b, 0xda, 0x43, 0x65, + 0x41, 0xad, 0x90, 0x82, 0x07, 0xc1, 0x8b, 0x0e, 0xc4, 0x18, 0x51, 0x55, 0x61, 0x94, 0xd0, 0x41, + 0x00, 0xd4, 0x2b, 0x3b, 0x0c, 0x60, 0x7a, 0xb5, 0x81, 0xbe, 0x45, 0xb2, 0x86, 0x7a, 0xbd, 0x85, + 0xc8, 0x33, 0xa6, 0xd7, 0xdf, 0x03, 0x65, 0xe4, 0x8b, 0xc8, 0xf6, 0x0b, 0x8a, 0x1c, 0xd4, 0x82, + 0x82, 0x33, 0x97, 0x40, 0x34, 0xe9, 0x7a, 0xb9, 0x8e, 0xf6, 0xb0, 0x6d, 0xb3, 0x2e, 0x2c, 0x43, + 0x25, 0xeb, 0x52, 0x87, 0xad, 0xb8, 0x8e, 0x0b, 0xca, 0x48, 0x71, 0xfa, 0xb0, 0xa9, 0x38, 0xa9, + 0x44, 0x10, 0x0f, 0x44, 0x93, 0xae, 0x97, 0xeb, 0x68, 0x0f, 0xdb, 0x2a, 0xeb, 0x5e, 0x8c, 0x95, + 0x3c, 0x73, 0x5c, 0xe2, 0x55, 0x2a, 0x00, 0x00, 0x00, 0x00, 0x49, 0x45, 0x4e, 0x44, 0xae, 0x42, + 0x60, 0x82, +}; + +const BITMAP_OPAQUE array_footprint_xpm[1] = {{ png, sizeof( png ), "array_footprint_xpm" }}; + +//EOF diff --git a/bitmaps_png/cpp_26/array_line.cpp b/bitmaps_png/cpp_26/array_line.cpp new file mode 100644 index 0000000000..0b0911eba6 --- /dev/null +++ b/bitmaps_png/cpp_26/array_line.cpp @@ -0,0 +1,54 @@ + +/* Do not modify this file, it was automatically generated by the + * PNG2cpp CMake script, using a *.png file as input. + */ + +#include + +static const unsigned char png[] = { + 0x89, 0x50, 0x4e, 0x47, 0x0d, 0x0a, 0x1a, 0x0a, 0x00, 0x00, 0x00, 0x0d, 0x49, 0x48, 0x44, 0x52, + 0x00, 0x00, 0x00, 0x1a, 0x00, 0x00, 0x00, 0x1a, 0x08, 0x06, 0x00, 0x00, 0x00, 0xa9, 0x4a, 0x4c, + 0xce, 0x00, 0x00, 0x02, 0x51, 0x49, 0x44, 0x41, 0x54, 0x48, 0xc7, 0xa5, 0x96, 0x4f, 0x6c, 0x4c, + 0x51, 0x14, 0xc6, 0x7f, 0xa3, 0xff, 0xa4, 0xd5, 0x4a, 0x34, 0xb5, 0x20, 0x4d, 0xc5, 0x42, 0x5a, + 0x74, 0xa9, 0x34, 0x44, 0x42, 0x10, 0x82, 0x48, 0x2c, 0x84, 0x88, 0x58, 0x58, 0xd0, 0x8d, 0xda, + 0x48, 0x49, 0xa4, 0xe9, 0x06, 0x8b, 0x62, 0x31, 0xb4, 0xe3, 0xdd, 0x73, 0xdf, 0x8c, 0x69, 0xaa, + 0x99, 0x94, 0x11, 0xed, 0x58, 0xb1, 0x60, 0x67, 0x6d, 0x65, 0x6b, 0x63, 0x67, 0x61, 0x23, 0xb1, + 0x20, 0xd7, 0xe6, 0x78, 0xf3, 0x5a, 0x33, 0xef, 0xde, 0xc6, 0xe2, 0x25, 0x2f, 0x99, 0xef, 0xe4, + 0x77, 0xee, 0x79, 0xe7, 0xfb, 0xee, 0xe0, 0x9c, 0x23, 0xf4, 0x61, 0x8a, 0x75, 0x6b, 0xd2, 0x43, + 0x2e, 0x79, 0x0f, 0x2e, 0x12, 0xc6, 0x10, 0xde, 0x11, 0xd3, 0x1d, 0xa4, 0x37, 0x5c, 0xc4, 0x30, + 0xc1, 0x7b, 0x5a, 0x83, 0x41, 0x08, 0x67, 0x11, 0x7e, 0x23, 0x38, 0x84, 0x9b, 0x01, 0x90, 0x13, + 0x08, 0x35, 0x84, 0x1a, 0x31, 0x87, 0x82, 0x40, 0x58, 0x0e, 0x22, 0xfc, 0x54, 0xc8, 0x0b, 0xdf, + 0xf8, 0x88, 0x19, 0x45, 0x58, 0x56, 0xd0, 0x58, 0xd0, 0xe8, 0x88, 0x18, 0x46, 0xf8, 0xae, 0x90, + 0x0f, 0xe4, 0xe9, 0xf0, 0x9c, 0x64, 0x17, 0x42, 0x15, 0xa1, 0x86, 0xe5, 0x36, 0x2e, 0xe0, 0x1b, + 0x61, 0x19, 0x40, 0xf8, 0xaa, 0x90, 0x4f, 0x44, 0x6c, 0xf4, 0x9c, 0x7c, 0x00, 0xa1, 0xa2, 0x27, + 0xb9, 0x4f, 0x44, 0xdb, 0x8a, 0xdf, 0x1b, 0x16, 0x95, 0xe9, 0x45, 0xf8, 0xac, 0x90, 0x2f, 0xc4, + 0x6c, 0xc9, 0x84, 0x14, 0xe9, 0x43, 0x78, 0xa6, 0x90, 0x27, 0xcc, 0xd1, 0xf5, 0x8f, 0xa6, 0xc1, + 0xb8, 0x3a, 0x11, 0x3e, 0x2a, 0xe4, 0x1b, 0x11, 0x83, 0x9e, 0x6f, 0xd2, 0x8d, 0x50, 0x50, 0x48, + 0x91, 0x32, 0xbd, 0x0d, 0x75, 0xab, 0x7c, 0xd2, 0x8a, 0xe1, 0x8d, 0x42, 0x7e, 0x10, 0x33, 0x9a, + 0x09, 0xc9, 0xd3, 0x81, 0x61, 0x5a, 0x21, 0x0b, 0xcc, 0xd0, 0xdf, 0x54, 0xbb, 0x6a, 0xce, 0x25, + 0x85, 0xfc, 0xc2, 0x70, 0x2a, 0x13, 0xb2, 0x48, 0x0b, 0x86, 0x49, 0x85, 0x54, 0x11, 0x86, 0x32, + 0xf5, 0xa9, 0x8d, 0xb9, 0xa7, 0x10, 0x87, 0x70, 0x25, 0xc0, 0x5b, 0xd7, 0x75, 0xbb, 0x96, 0x88, + 0xd8, 0xeb, 0xd5, 0x6b, 0xd1, 0x85, 0x04, 0x62, 0xb8, 0x13, 0x00, 0x39, 0x93, 0x32, 0xe4, 0xb1, + 0x20, 0xd3, 0x3b, 0xe7, 0x60, 0x86, 0x0d, 0x08, 0x6f, 0x11, 0x66, 0x9b, 0x0a, 0x0b, 0x6c, 0x45, + 0x38, 0xec, 0x9c, 0x83, 0x79, 0x7a, 0x30, 0x3c, 0xc2, 0x72, 0x3e, 0xc3, 0x53, 0x3b, 0xd2, 0x27, + 0x4d, 0xcf, 0xbc, 0xbd, 0x99, 0xeb, 0xb1, 0x6c, 0xc2, 0x10, 0xeb, 0xa8, 0x8e, 0xeb, 0xe2, 0xb4, + 0x7b, 0x9a, 0x7a, 0x8e, 0x65, 0x09, 0x61, 0x5f, 0x58, 0x04, 0x4d, 0xd3, 0x85, 0xe1, 0xb1, 0x8e, + 0xaa, 0x4c, 0x91, 0x3e, 0x8f, 0x71, 0xeb, 0x4d, 0x19, 0x9e, 0xfe, 0x0d, 0x61, 0x5f, 0x04, 0xb5, + 0xe9, 0x92, 0xd4, 0x10, 0x2a, 0x14, 0xd8, 0xe6, 0xd1, 0x77, 0x22, 0xe4, 0x93, 0xa6, 0x0a, 0x6c, + 0xf6, 0x47, 0x90, 0x23, 0x87, 0x70, 0x4b, 0x8b, 0x5e, 0x61, 0xd9, 0xed, 0x6d, 0x4a, 0xb8, 0x9b, + 0x34, 0x55, 0x5a, 0xd9, 0x54, 0x56, 0x40, 0x5e, 0xd3, 0xa2, 0x65, 0x2c, 0xfb, 0xb3, 0x37, 0x8a, + 0x1c, 0x96, 0x89, 0xa4, 0xa9, 0x88, 0x61, 0x6f, 0x04, 0x29, 0xe4, 0x5c, 0xb2, 0xbe, 0x96, 0x93, + 0x01, 0x57, 0xc9, 0xd5, 0xa4, 0xa9, 0x88, 0x03, 0xde, 0x64, 0x50, 0x8f, 0x1c, 0x4d, 0x41, 0x2e, + 0x05, 0x5c, 0x72, 0xe9, 0xa6, 0x4e, 0x87, 0x46, 0xd0, 0x88, 0xae, 0x64, 0x0d, 0xc3, 0x78, 0x00, + 0xe4, 0x48, 0x0a, 0x72, 0x39, 0x2c, 0x82, 0x22, 0x06, 0x53, 0x97, 0xd6, 0x24, 0x8b, 0xb4, 0x78, + 0x20, 0x7b, 0x10, 0x5e, 0x2b, 0xe8, 0x46, 0x68, 0x32, 0xf4, 0x23, 0x2c, 0x68, 0xd1, 0x03, 0xef, + 0x4d, 0x1a, 0x31, 0x88, 0xe5, 0xa5, 0xea, 0xa7, 0x7c, 0x4d, 0xd5, 0x41, 0x45, 0x76, 0x22, 0x54, + 0xd2, 0x06, 0xf3, 0x7c, 0xfc, 0x11, 0x84, 0x2a, 0x96, 0x87, 0x94, 0x58, 0x1f, 0x9c, 0x75, 0xce, + 0x39, 0x98, 0x65, 0x3b, 0x73, 0x75, 0x83, 0x05, 0x04, 0xeb, 0x10, 0xf3, 0xf4, 0x04, 0xeb, 0xd7, + 0xf2, 0x87, 0xf0, 0x7f, 0x9e, 0x3f, 0x6d, 0x57, 0x45, 0xa7, 0xea, 0xac, 0xbd, 0xc8, 0x00, 0x00, + 0x00, 0x00, 0x49, 0x45, 0x4e, 0x44, 0xae, 0x42, 0x60, 0x82, +}; + +const BITMAP_OPAQUE array_line_xpm[1] = {{ png, sizeof( png ), "array_line_xpm" }}; + +//EOF diff --git a/bitmaps_png/cpp_26/array_module.cpp b/bitmaps_png/cpp_26/array_module.cpp new file mode 100644 index 0000000000..deb7ef121f --- /dev/null +++ b/bitmaps_png/cpp_26/array_module.cpp @@ -0,0 +1,25 @@ + +/* Do not modify this file, it was automatically generated by the + * PNG2cpp CMake script, using a *.png file as input. + */ + +#include + +static const unsigned char png[] = { + 0x89, 0x50, 0x4e, 0x47, 0x0d, 0x0a, 0x1a, 0x0a, 0x00, 0x00, 0x00, 0x0d, 0x49, 0x48, 0x44, 0x52, + 0x00, 0x00, 0x00, 0x1a, 0x00, 0x00, 0x00, 0x1a, 0x08, 0x06, 0x00, 0x00, 0x00, 0xa9, 0x4a, 0x4c, + 0xce, 0x00, 0x00, 0x00, 0x79, 0x49, 0x44, 0x41, 0x54, 0x48, 0xc7, 0xdd, 0x94, 0x41, 0x0a, 0x00, + 0x31, 0x08, 0x03, 0xfd, 0x4a, 0xff, 0x94, 0xff, 0xf6, 0xdc, 0xfd, 0x94, 0x7b, 0xda, 0x43, 0x65, + 0x41, 0xad, 0x90, 0x82, 0x07, 0xc1, 0x8b, 0x0e, 0xc4, 0x18, 0x51, 0x55, 0x61, 0x94, 0xd0, 0x41, + 0x00, 0xd4, 0x2b, 0x3b, 0x0c, 0x60, 0x7a, 0xb5, 0x81, 0xbe, 0x45, 0xb2, 0x86, 0x7a, 0xbd, 0x85, + 0xc8, 0x33, 0xa6, 0xd7, 0xdf, 0x03, 0x65, 0xe4, 0x8b, 0xc8, 0xf6, 0x0b, 0x8a, 0x1c, 0xd4, 0x82, + 0x82, 0x33, 0x97, 0x40, 0x34, 0xe9, 0x7a, 0xb9, 0x8e, 0xf6, 0xb0, 0x6d, 0xb3, 0x2e, 0x2c, 0x43, + 0x25, 0xeb, 0x52, 0x87, 0xad, 0xb8, 0x8e, 0x0b, 0xca, 0x48, 0x71, 0xfa, 0xb0, 0xa9, 0x38, 0xa9, + 0x44, 0x10, 0x0f, 0x44, 0x93, 0xae, 0x97, 0xeb, 0x68, 0x0f, 0xdb, 0x2a, 0xeb, 0x5e, 0x8c, 0x95, + 0x3c, 0x73, 0x5c, 0xe2, 0x55, 0x2a, 0x00, 0x00, 0x00, 0x00, 0x49, 0x45, 0x4e, 0x44, 0xae, 0x42, + 0x60, 0x82, +}; + +const BITMAP_OPAQUE array_module_xpm[1] = {{ png, sizeof( png ), "array_module_xpm" }}; + +//EOF diff --git a/bitmaps_png/cpp_26/array_pad.cpp b/bitmaps_png/cpp_26/array_pad.cpp new file mode 100644 index 0000000000..9afe012a82 --- /dev/null +++ b/bitmaps_png/cpp_26/array_pad.cpp @@ -0,0 +1,77 @@ + +/* Do not modify this file, it was automatically generated by the + * PNG2cpp CMake script, using a *.png file as input. + */ + +#include + +static const unsigned char png[] = { + 0x89, 0x50, 0x4e, 0x47, 0x0d, 0x0a, 0x1a, 0x0a, 0x00, 0x00, 0x00, 0x0d, 0x49, 0x48, 0x44, 0x52, + 0x00, 0x00, 0x00, 0x1a, 0x00, 0x00, 0x00, 0x1a, 0x08, 0x06, 0x00, 0x00, 0x00, 0xa9, 0x4a, 0x4c, + 0xce, 0x00, 0x00, 0x03, 0xbd, 0x49, 0x44, 0x41, 0x54, 0x48, 0xc7, 0xbd, 0x96, 0xdd, 0x4b, 0x54, + 0x41, 0x18, 0xc6, 0x67, 0x3f, 0xdc, 0x2b, 0x53, 0x28, 0x93, 0xa0, 0x08, 0xef, 0x14, 0x8a, 0x4c, + 0x44, 0x2c, 0x8c, 0x2d, 0xcb, 0x4a, 0xc1, 0x7f, 0xa0, 0x8b, 0xfe, 0x82, 0xa0, 0x8b, 0x8c, 0x22, + 0xf2, 0x63, 0x3d, 0x47, 0x57, 0x4b, 0xca, 0x42, 0xd4, 0xf5, 0xb3, 0x14, 0xf3, 0x83, 0x5c, 0x95, + 0x45, 0x02, 0x15, 0x0c, 0xfb, 0x07, 0x8a, 0x84, 0x10, 0x25, 0x23, 0x24, 0x24, 0xa2, 0x8b, 0x6e, + 0x82, 0xbc, 0xc8, 0xde, 0xdf, 0x38, 0x47, 0x8f, 0xeb, 0x6e, 0x7a, 0x61, 0x5d, 0x3c, 0x9c, 0x61, + 0xce, 0xcc, 0x3c, 0xf3, 0x3e, 0xef, 0x33, 0xef, 0x8c, 0x5a, 0x5f, 0x5f, 0x57, 0xff, 0x03, 0x89, + 0x3b, 0x43, 0xea, 0xa0, 0xa0, 0x54, 0x50, 0xae, 0xc2, 0xea, 0xf0, 0xae, 0x8b, 0x34, 0xaa, 0x74, + 0x65, 0xa9, 0x02, 0x55, 0xa5, 0xf2, 0xd5, 0x1d, 0x75, 0x60, 0x57, 0x22, 0x59, 0x38, 0x43, 0x30, + 0xa1, 0x6a, 0xd5, 0x6f, 0xf9, 0x7e, 0xd7, 0xd8, 0x68, 0xcf, 0xaa, 0x3a, 0x75, 0x74, 0xc7, 0xe4, + 0xb0, 0x3a, 0x14, 0xa8, 0x0b, 0xd4, 0xcb, 0x98, 0x58, 0xea, 0x83, 0xd4, 0xc1, 0xd4, 0x86, 0xd4, + 0x41, 0xda, 0x7e, 0xcb, 0x5f, 0x29, 0x73, 0xd2, 0x12, 0x12, 0x19, 0x92, 0xaf, 0x82, 0xcf, 0x82, + 0x69, 0x41, 0x4c, 0xa3, 0x46, 0x4d, 0xc9, 0xf7, 0x93, 0xe0, 0x87, 0x20, 0xcb, 0x35, 0x3e, 0xd3, + 0x67, 0xfb, 0x86, 0x73, 0x9f, 0x9d, 0xea, 0x6e, 0x5d, 0x7e, 0x64, 0x8d, 0x7c, 0xeb, 0xab, 0x02, + 0x4f, 0x16, 0x1f, 0xda, 0x39, 0x1d, 0xd9, 0xbd, 0xf2, 0x6f, 0xc0, 0x4d, 0xe6, 0x26, 0x9a, 0x30, + 0x24, 0x31, 0x43, 0xf4, 0x41, 0xb0, 0x20, 0x98, 0x31, 0x7d, 0x1f, 0x65, 0xb7, 0x6f, 0x9c, 0xf1, + 0x01, 0x3b, 0xd0, 0x58, 0x34, 0x50, 0x18, 0x61, 0xf1, 0xc7, 0x8b, 0x61, 0xfb, 0xd2, 0xc8, 0x85, + 0x48, 0x59, 0xf4, 0x4a, 0x5b, 0xcb, 0x72, 0x93, 0x26, 0x85, 0x8c, 0xc8, 0xb6, 0x11, 0xe9, 0x9c, + 0x6c, 0x48, 0x34, 0x6d, 0xf0, 0xcb, 0x7c, 0xa3, 0x82, 0x35, 0xc1, 0x6b, 0xc1, 0x2b, 0xdd, 0xb6, + 0x55, 0x36, 0x32, 0xfa, 0x2c, 0xdf, 0x78, 0xdf, 0x97, 0x8e, 0x1a, 0x7b, 0xbe, 0x3a, 0x4c, 0xdb, + 0x6f, 0xfb, 0xab, 0x64, 0xe1, 0x7a, 0xc1, 0x18, 0x64, 0x44, 0x86, 0x8c, 0x4e, 0xce, 0x1c, 0xa2, + 0x52, 0x93, 0x93, 0x98, 0x89, 0x64, 0xca, 0x15, 0x29, 0x12, 0x2c, 0x99, 0x7f, 0xab, 0x32, 0xf9, + 0x9a, 0x10, 0x05, 0x33, 0x9b, 0x33, 0xfa, 0xd9, 0xf9, 0x99, 0xfe, 0x82, 0x4e, 0xaf, 0xe5, 0xbd, + 0xe5, 0x8c, 0x87, 0x8c, 0xc8, 0xf8, 0xa7, 0x73, 0x26, 0x06, 0x71, 0x13, 0x95, 0xbb, 0x88, 0x90, + 0x2b, 0xea, 0x22, 0x8a, 0x68, 0xd9, 0xb6, 0x88, 0xae, 0x0b, 0x8a, 0x8f, 0x34, 0x67, 0x6a, 0xa2, + 0xfc, 0xe7, 0xa7, 0xbb, 0xbc, 0xb6, 0xf7, 0xc6, 0x26, 0x91, 0x44, 0x86, 0x8c, 0x9a, 0x48, 0x0c, + 0x82, 0x1b, 0xb7, 0x88, 0xc4, 0xc2, 0x5a, 0xba, 0x8d, 0xc4, 0xcf, 0x18, 0xb9, 0x06, 0x0c, 0x09, + 0x32, 0xce, 0x09, 0x26, 0x75, 0xbf, 0xa5, 0x4e, 0xc8, 0xf7, 0xb8, 0xcf, 0xf2, 0x8c, 0x0f, 0xac, + 0x76, 0x57, 0x57, 0xbd, 0xbb, 0xdb, 0x40, 0x1b, 0x32, 0x41, 0x05, 0x32, 0x92, 0x33, 0x0c, 0xa2, + 0xa5, 0x13, 0xeb, 0xc7, 0x9b, 0x61, 0xd6, 0xb8, 0x2b, 0x66, 0x72, 0xb2, 0x64, 0x22, 0x99, 0xd3, + 0x7d, 0xb5, 0x6a, 0x51, 0xbe, 0x6f, 0xd5, 0xba, 0xf2, 0x80, 0x94, 0xba, 0x94, 0xa7, 0xc5, 0xc3, + 0x41, 0xbd, 0x73, 0xc8, 0x88, 0x0c, 0x19, 0xc9, 0x19, 0x7d, 0xb8, 0x11, 0xeb, 0xef, 0x74, 0x9d, + 0x24, 0xd8, 0x58, 0xf8, 0xa3, 0x49, 0x7c, 0xcc, 0x60, 0x52, 0x93, 0xd4, 0xaa, 0x9f, 0xd2, 0xce, + 0x71, 0x6d, 0xec, 0x98, 0xa7, 0xd6, 0x33, 0x0a, 0x19, 0x91, 0x39, 0xf6, 0xc6, 0x20, 0xb8, 0x11, + 0xeb, 0x73, 0xce, 0x92, 0x1d, 0xd8, 0x2c, 0x2c, 0x6c, 0xa4, 0x5b, 0x35, 0x58, 0xd3, 0x91, 0xb8, + 0x48, 0xdc, 0x64, 0x44, 0x86, 0x74, 0xe4, 0x0c, 0x83, 0x20, 0x1d, 0xd6, 0xe7, 0x9c, 0xed, 0x5e, + 0x82, 0xb0, 0x30, 0xee, 0x22, 0xf1, 0xe4, 0x44, 0xa4, 0x4a, 0x5e, 0xc3, 0x44, 0x4a, 0xc9, 0x19, + 0x06, 0xc1, 0x8d, 0x89, 0x2a, 0x48, 0x72, 0x22, 0x64, 0x64, 0x12, 0x93, 0x59, 0x64, 0xbf, 0x89, + 0x08, 0x97, 0xb0, 0x3d, 0x22, 0x05, 0x32, 0x20, 0x07, 0xb2, 0x20, 0x0f, 0x32, 0xed, 0x45, 0x3a, + 0xe6, 0xfe, 0x55, 0x3a, 0x12, 0x27, 0xfa, 0x8e, 0x14, 0xf4, 0xe5, 0x75, 0xf5, 0xac, 0xb4, 0x86, + 0x9c, 0xe4, 0xf6, 0xaf, 0x76, 0x56, 0x07, 0x87, 0xce, 0x76, 0xc8, 0x02, 0x51, 0x37, 0x99, 0x36, + 0x83, 0xe5, 0x19, 0x0d, 0x0e, 0x17, 0x45, 0x18, 0xe3, 0x8c, 0x67, 0x2e, 0x6b, 0xb0, 0x56, 0x42, + 0x33, 0x60, 0xc5, 0xdc, 0xde, 0x93, 0x3d, 0x0c, 0xb6, 0xe7, 0x2b, 0xc3, 0x85, 0x62, 0x55, 0x2c, + 0x8b, 0x75, 0xe9, 0x83, 0x4c, 0x47, 0xe6, 0xb2, 0xf7, 0xc5, 0x91, 0x60, 0x7b, 0x52, 0x7b, 0xcb, + 0x5a, 0x3b, 0xec, 0xad, 0xef, 0x13, 0x39, 0x5c, 0x1c, 0x32, 0x0e, 0x9b, 0x39, 0x80, 0x15, 0x1c, + 0x42, 0xda, 0x2c, 0xc4, 0xae, 0x69, 0xeb, 0x7c, 0xc4, 0x1d, 0x58, 0x8f, 0x73, 0x60, 0x2d, 0xef, + 0x6d, 0xda, 0x49, 0x0f, 0x2c, 0x65, 0x82, 0x72, 0xc1, 0x4e, 0x28, 0x1f, 0x52, 0x46, 0xee, 0x39, + 0x3b, 0x61, 0x01, 0x76, 0xcb, 0x3f, 0xf2, 0xa0, 0x93, 0x1e, 0x5f, 0x82, 0x2c, 0xef, 0x4d, 0x57, + 0x09, 0x0a, 0x25, 0x2f, 0x41, 0x52, 0xf8, 0x28, 0x80, 0xfc, 0x2c, 0x8b, 0x96, 0xb4, 0x49, 0x32, + 0x2d, 0x17, 0x51, 0x05, 0x32, 0xf2, 0x8f, 0x64, 0x1b, 0x67, 0x6d, 0x16, 0xd5, 0xc2, 0xfe, 0xfc, + 0xf8, 0xa2, 0x6a, 0x5f, 0x1d, 0x2d, 0x69, 0x4f, 0x5c, 0x54, 0xa5, 0x94, 0x13, 0x26, 0xa5, 0x1d, + 0xe8, 0x43, 0x67, 0x05, 0x6c, 0x22, 0x43, 0x22, 0x72, 0x46, 0x92, 0x91, 0xc5, 0x58, 0x7f, 0xf3, + 0x9a, 0x08, 0xbd, 0xbf, 0xaf, 0x6b, 0x1d, 0x63, 0xd9, 0xa0, 0xdf, 0xf2, 0x8d, 0x39, 0xeb, 0xec, + 0xb8, 0x26, 0xcc, 0x4e, 0x2a, 0xb9, 0xac, 0x9c, 0x5b, 0x92, 0xc8, 0x90, 0x00, 0xbd, 0xe9, 0xc3, + 0x49, 0xd8, 0x36, 0xd1, 0xc5, 0xd7, 0xb4, 0x50, 0x5f, 0x77, 0x7e, 0xe8, 0x5c, 0xc7, 0xe5, 0x97, + 0xc5, 0x11, 0xe6, 0x26, 0xbd, 0xf8, 0x8c, 0x5d, 0xd3, 0xb8, 0x7e, 0x19, 0xe0, 0x0c, 0x06, 0x24, + 0x15, 0x07, 0x69, 0xbb, 0xba, 0xce, 0x86, 0x73, 0x95, 0xe7, 0x49, 0x8e, 0xba, 0x56, 0x5a, 0x42, + 0x7b, 0xbe, 0xca, 0x1d, 0x32, 0xfd, 0xb0, 0xe0, 0xb1, 0x21, 0xfa, 0xea, 0x64, 0x4a, 0x5b, 0x3f, + 0x40, 0x5c, 0x67, 0x22, 0xfe, 0x71, 0x22, 0xc5, 0x35, 0x96, 0xde, 0x98, 0xf6, 0x62, 0x4f, 0x8f, + 0x93, 0x6d, 0x9d, 0xe4, 0x8c, 0xa7, 0x13, 0x4f, 0x28, 0x63, 0xcf, 0x7d, 0x7d, 0x6e, 0xfd, 0x4b, + 0xfc, 0x01, 0x33, 0x8a, 0x28, 0x8c, 0xb5, 0xeb, 0xec, 0xf9, 0x00, 0x00, 0x00, 0x00, 0x49, 0x45, + 0x4e, 0x44, 0xae, 0x42, 0x60, 0x82, +}; + +const BITMAP_OPAQUE array_pad_xpm[1] = {{ png, sizeof( png ), "array_pad_xpm" }}; + +//EOF diff --git a/bitmaps_png/cpp_26/array_target.cpp b/bitmaps_png/cpp_26/array_target.cpp new file mode 100644 index 0000000000..e5b52092cb --- /dev/null +++ b/bitmaps_png/cpp_26/array_target.cpp @@ -0,0 +1,51 @@ + +/* Do not modify this file, it was automatically generated by the + * PNG2cpp CMake script, using a *.png file as input. + */ + +#include + +static const unsigned char png[] = { + 0x89, 0x50, 0x4e, 0x47, 0x0d, 0x0a, 0x1a, 0x0a, 0x00, 0x00, 0x00, 0x0d, 0x49, 0x48, 0x44, 0x52, + 0x00, 0x00, 0x00, 0x1a, 0x00, 0x00, 0x00, 0x1a, 0x08, 0x06, 0x00, 0x00, 0x00, 0xa9, 0x4a, 0x4c, + 0xce, 0x00, 0x00, 0x02, 0x22, 0x49, 0x44, 0x41, 0x54, 0x48, 0xc7, 0xbd, 0x94, 0x4f, 0x4b, 0x1b, + 0x41, 0x18, 0x87, 0x67, 0xc1, 0x59, 0xdd, 0x4d, 0xb6, 0x69, 0x24, 0xb6, 0xb6, 0x62, 0xbd, 0x0a, + 0x31, 0x15, 0x94, 0x5d, 0x12, 0x6a, 0xbd, 0xd9, 0xcf, 0xe1, 0xb9, 0x58, 0xe8, 0x27, 0x29, 0x3d, + 0xf5, 0xd8, 0x4b, 0xa1, 0xe0, 0x45, 0xb1, 0xc1, 0x4b, 0xa1, 0x9d, 0x0f, 0xe0, 0xd5, 0x8b, 0x8a, + 0x87, 0xf6, 0xa4, 0xa0, 0x87, 0xf6, 0x94, 0x16, 0xe9, 0x74, 0x9e, 0x25, 0x23, 0x13, 0x49, 0xc2, + 0xfe, 0x09, 0x2e, 0xbc, 0x2c, 0x3b, 0xb3, 0xef, 0x3e, 0xf3, 0xbe, 0xbf, 0x77, 0x7f, 0x42, 0x6b, + 0x2d, 0x86, 0x85, 0xb9, 0xf4, 0xa8, 0xbd, 0x31, 0x39, 0x6a, 0xe4, 0xde, 0x9d, 0x17, 0xa3, 0xa8, + 0x22, 0xde, 0x35, 0x1e, 0xca, 0x73, 0x40, 0x73, 0xb3, 0xf2, 0x84, 0x67, 0xd6, 0xc7, 0x7c, 0x3c, + 0xac, 0x86, 0xe2, 0x75, 0xa3, 0x26, 0x3f, 0x03, 0x6a, 0xd4, 0xe5, 0x27, 0x9e, 0x59, 0x1f, 0x0a, + 0x32, 0x57, 0x1c, 0xcc, 0x78, 0x57, 0xeb, 0xab, 0xf3, 0x37, 0x9d, 0x76, 0xc2, 0x82, 0x3e, 0xea, + 0x6e, 0xea, 0x37, 0xdb, 0x8b, 0xbd, 0x30, 0xf0, 0x2e, 0xd9, 0x1f, 0x02, 0x59, 0x0e, 0xa6, 0xbd, + 0x83, 0xb5, 0xe7, 0xf3, 0xdf, 0x3a, 0xed, 0x58, 0x01, 0x3a, 0xea, 0xbe, 0x54, 0x3b, 0xdb, 0x8b, + 0x5f, 0x4d, 0xce, 0x3e, 0xfb, 0x03, 0x20, 0x4e, 0x3c, 0xe3, 0x7b, 0xd7, 0xed, 0x64, 0x45, 0xb7, + 0x5a, 0x2d, 0xbd, 0xb1, 0xf1, 0x22, 0x05, 0xf5, 0xce, 0x5e, 0xe9, 0x3f, 0x27, 0x1d, 0xdd, 0xfd, + 0xb8, 0xae, 0xfb, 0xb0, 0xc8, 0xad, 0x64, 0xda, 0xf7, 0xbe, 0xb4, 0xe3, 0x15, 0x65, 0x72, 0x94, + 0xc9, 0x49, 0x41, 0xbd, 0xb3, 0x2d, 0xf5, 0xf7, 0xb4, 0xa3, 0x4c, 0x8e, 0xea, 0xc3, 0xc2, 0x5b, + 0x10, 0xed, 0x59, 0x7a, 0xf6, 0xf8, 0x1f, 0x10, 0x00, 0x2e, 0xe8, 0xe6, 0xb8, 0x96, 0xc2, 0xa8, + 0x8c, 0xf7, 0x2c, 0x88, 0xf6, 0x98, 0x9c, 0xef, 0x40, 0x00, 0xb8, 0x20, 0x93, 0x93, 0xc2, 0xa8, + 0x8c, 0xf7, 0x6e, 0x41, 0xf5, 0x9a, 0xfc, 0x91, 0x24, 0x49, 0x0a, 0xb0, 0x61, 0x41, 0x36, 0x68, + 0x23, 0x9a, 0x59, 0x90, 0xc9, 0xd9, 0x8d, 0xe3, 0x38, 0x05, 0xd8, 0xb0, 0x20, 0x1b, 0xb4, 0x11, + 0xcd, 0xfa, 0x1d, 0x10, 0xba, 0x40, 0xa8, 0xdc, 0x01, 0x8d, 0x93, 0x72, 0x62, 0xb7, 0x02, 0xdb, + 0x42, 0x1b, 0x54, 0x1c, 0x55, 0xa6, 0x2e, 0x6c, 0x45, 0x9c, 0x94, 0x13, 0xbb, 0x15, 0xd8, 0x16, + 0xda, 0xa0, 0xe2, 0x28, 0x9c, 0xda, 0x1b, 0xd0, 0x08, 0x0d, 0xd0, 0x02, 0x4d, 0x5c, 0x10, 0x77, + 0xb4, 0x5b, 0x78, 0xfa, 0x48, 0x87, 0xa1, 0xf8, 0xe0, 0x6a, 0x84, 0x06, 0x68, 0x81, 0x26, 0x2e, + 0x88, 0x3b, 0xda, 0x2d, 0x3c, 0x99, 0x53, 0x41, 0x20, 0xde, 0x0e, 0x4c, 0x1d, 0x53, 0xc5, 0x74, + 0x01, 0x73, 0x41, 0x40, 0x9a, 0xcd, 0xa6, 0x96, 0xd2, 0xfb, 0x7d, 0x77, 0xea, 0x98, 0x2a, 0xa6, + 0x0b, 0x98, 0x0b, 0x02, 0x62, 0x72, 0x94, 0xef, 0x7b, 0x87, 0x03, 0x53, 0x67, 0xff, 0x23, 0x60, + 0x54, 0x46, 0x1b, 0x01, 0xd1, 0x2e, 0x2a, 0xf1, 0xa5, 0xf7, 0x6b, 0xd4, 0x7f, 0x04, 0x8c, 0xca, + 0x68, 0x23, 0x20, 0xda, 0x45, 0x25, 0x7d, 0xc8, 0xf2, 0x58, 0x67, 0x40, 0x33, 0x40, 0xf5, 0x07, + 0xf2, 0x67, 0xb5, 0x22, 0xde, 0x67, 0x72, 0x06, 0xa3, 0x19, 0x20, 0x93, 0xb3, 0x5b, 0x0d, 0xc4, + 0xce, 0x48, 0x67, 0xb8, 0x57, 0xaf, 0xcb, 0x9a, 0x34, 0x09, 0x53, 0xcd, 0x64, 0x90, 0x65, 0x4d, + 0x35, 0xb3, 0x41, 0x96, 0x31, 0xd5, 0x5c, 0x06, 0x59, 0xd8, 0x54, 0xf3, 0x1a, 0x64, 0x19, 0x53, + 0xcd, 0x65, 0x90, 0x45, 0x4d, 0x55, 0xdd, 0x4b, 0x14, 0x31, 0xc8, 0xc2, 0xa6, 0x9a, 0xd7, 0x20, + 0xcb, 0x98, 0x6a, 0x2e, 0x83, 0x2c, 0x6b, 0xaa, 0x99, 0x0d, 0x72, 0x12, 0xa6, 0x9a, 0xc9, 0x20, + 0x27, 0x6d, 0xaa, 0x13, 0xf5, 0xba, 0xff, 0x0c, 0x96, 0xd3, 0x5f, 0x78, 0x1d, 0xd5, 0x5b, 0x00, + 0x00, 0x00, 0x00, 0x49, 0x45, 0x4e, 0x44, 0xae, 0x42, 0x60, 0x82, +}; + +const BITMAP_OPAQUE array_target_xpm[1] = {{ png, sizeof( png ), "array_target_xpm" }}; + +//EOF diff --git a/bitmaps_png/cpp_26/array_text.cpp b/bitmaps_png/cpp_26/array_text.cpp new file mode 100644 index 0000000000..37aa012460 --- /dev/null +++ b/bitmaps_png/cpp_26/array_text.cpp @@ -0,0 +1,39 @@ + +/* Do not modify this file, it was automatically generated by the + * PNG2cpp CMake script, using a *.png file as input. + */ + +#include + +static const unsigned char png[] = { + 0x89, 0x50, 0x4e, 0x47, 0x0d, 0x0a, 0x1a, 0x0a, 0x00, 0x00, 0x00, 0x0d, 0x49, 0x48, 0x44, 0x52, + 0x00, 0x00, 0x00, 0x1a, 0x00, 0x00, 0x00, 0x1a, 0x08, 0x06, 0x00, 0x00, 0x00, 0xa9, 0x4a, 0x4c, + 0xce, 0x00, 0x00, 0x01, 0x59, 0x49, 0x44, 0x41, 0x54, 0x48, 0xc7, 0xed, 0x96, 0xb1, 0x6a, 0x02, + 0x41, 0x10, 0x86, 0x07, 0x7c, 0x06, 0xad, 0x0c, 0xd8, 0x48, 0xb0, 0x31, 0x36, 0xd6, 0x22, 0x58, + 0x5a, 0xa4, 0xb8, 0x4a, 0xc8, 0x1b, 0x58, 0xa5, 0xca, 0x95, 0xa9, 0x7c, 0x82, 0x20, 0xec, 0xed, + 0xa9, 0x98, 0xce, 0xca, 0x60, 0x93, 0xd6, 0x77, 0xb1, 0xf0, 0x1d, 0x0c, 0x5c, 0x66, 0x6f, 0xe6, + 0xbc, 0xec, 0xe6, 0x76, 0xdd, 0x1c, 0x41, 0x10, 0xee, 0xe0, 0x67, 0x6f, 0x66, 0xff, 0xe1, 0x63, + 0xef, 0x98, 0x61, 0x21, 0x49, 0x12, 0xb8, 0x86, 0xf0, 0x91, 0x53, 0x80, 0xe8, 0xe8, 0x2f, 0xe5, + 0x17, 0x63, 0x7c, 0x7f, 0xf7, 0x97, 0xf2, 0x43, 0xf4, 0x82, 0x42, 0x64, 0x74, 0x40, 0x7d, 0xa2, + 0xf6, 0x1c, 0x67, 0xda, 0x73, 0xfe, 0xc0, 0xb1, 0xf2, 0x07, 0xa8, 0x1d, 0x6a, 0x85, 0xe0, 0x57, + 0x5c, 0x67, 0x1c, 0x67, 0x9a, 0x71, 0x7e, 0xc5, 0x71, 0x90, 0x81, 0xbe, 0x90, 0xda, 0xa7, 0x23, + 0xce, 0x5b, 0x3a, 0x68, 0xde, 0xa2, 0xbc, 0xe8, 0x93, 0x2f, 0x03, 0xc9, 0x0f, 0x80, 0x65, 0x9b, + 0xf6, 0xd6, 0x0d, 0x1d, 0xb4, 0x6e, 0x50, 0x7e, 0xd9, 0x26, 0x1f, 0x81, 0x3a, 0x00, 0xf1, 0x30, + 0xff, 0x96, 0xc5, 0x20, 0xda, 0x8b, 0x87, 0xe4, 0x7f, 0xbb, 0xc3, 0xb5, 0x9b, 0xe7, 0x8b, 0x41, + 0xb4, 0x17, 0x75, 0x53, 0xff, 0xef, 0x9f, 0x66, 0x07, 0xd9, 0x7f, 0xb4, 0x1d, 0x74, 0xf6, 0x54, + 0xa0, 0x5b, 0x04, 0x89, 0x91, 0x0e, 0x12, 0xa3, 0xcb, 0x20, 0xd1, 0xd3, 0x41, 0xa2, 0xe7, 0x04, + 0xa1, 0xe1, 0x19, 0x8d, 0x27, 0xa3, 0x61, 0x4f, 0x2a, 0x6f, 0x87, 0xc8, 0x47, 0xf4, 0x6c, 0x8d, + 0x86, 0xdd, 0xaa, 0xbc, 0x03, 0x24, 0x27, 0xdc, 0x90, 0x86, 0xe4, 0xc4, 0x71, 0x9a, 0x01, 0x4f, + 0x0a, 0x43, 0x62, 0x60, 0xcc, 0xba, 0xf8, 0xbe, 0xd8, 0x68, 0x93, 0xf2, 0x97, 0xa9, 0xc9, 0xe7, + 0x96, 0xaf, 0x82, 0x72, 0x35, 0xe7, 0x22, 0xf9, 0x84, 0x6b, 0x13, 0xe9, 0x0f, 0xba, 0x29, 0x8d, + 0x9b, 0xbc, 0x6f, 0x80, 0xfe, 0x52, 0x93, 0xce, 0x2f, 0x19, 0x02, 0x6c, 0x6a, 0xee, 0x01, 0xb9, + 0xa9, 0x91, 0x4f, 0xf9, 0x4b, 0xd4, 0x94, 0xe9, 0x89, 0x7f, 0xea, 0xa3, 0x0a, 0x54, 0x81, 0xd2, + 0x82, 0x45, 0x9d, 0x2f, 0x15, 0x3f, 0x8a, 0x54, 0xbc, 0xa8, 0xdb, 0x21, 0x7e, 0x35, 0xe6, 0xdc, + 0x0a, 0x2d, 0xd7, 0xa5, 0xd0, 0x31, 0xeb, 0xbc, 0x6a, 0xe0, 0x5a, 0x17, 0xc8, 0x6f, 0x28, 0x7d, + 0x35, 0x0d, 0xec, 0xf1, 0xfb, 0x82, 0x00, 0x00, 0x00, 0x00, 0x49, 0x45, 0x4e, 0x44, 0xae, 0x42, + 0x60, 0x82, +}; + +const BITMAP_OPAQUE array_text_xpm[1] = {{ png, sizeof( png ), "array_text_xpm" }}; + +//EOF diff --git a/bitmaps_png/cpp_26/array_zone.cpp b/bitmaps_png/cpp_26/array_zone.cpp new file mode 100644 index 0000000000..211aed3385 --- /dev/null +++ b/bitmaps_png/cpp_26/array_zone.cpp @@ -0,0 +1,51 @@ + +/* Do not modify this file, it was automatically generated by the + * PNG2cpp CMake script, using a *.png file as input. + */ + +#include + +static const unsigned char png[] = { + 0x89, 0x50, 0x4e, 0x47, 0x0d, 0x0a, 0x1a, 0x0a, 0x00, 0x00, 0x00, 0x0d, 0x49, 0x48, 0x44, 0x52, + 0x00, 0x00, 0x00, 0x1a, 0x00, 0x00, 0x00, 0x1a, 0x08, 0x06, 0x00, 0x00, 0x00, 0xa9, 0x4a, 0x4c, + 0xce, 0x00, 0x00, 0x02, 0x1a, 0x49, 0x44, 0x41, 0x54, 0x48, 0xc7, 0xcd, 0x94, 0x3d, 0x88, 0x13, + 0x41, 0x18, 0x86, 0xe7, 0x40, 0xbb, 0x20, 0xe1, 0x1a, 0x13, 0x3b, 0xb1, 0xb3, 0xb0, 0xbf, 0x43, + 0x0e, 0xe5, 0x38, 0xbd, 0xd2, 0x46, 0x10, 0x04, 0x0b, 0x0b, 0x4b, 0xb9, 0xce, 0x9f, 0xc2, 0xcc, + 0x9a, 0x9d, 0x9d, 0x9f, 0x6c, 0x22, 0xc1, 0x22, 0x6a, 0x27, 0x07, 0x5a, 0x18, 0xb2, 0xe4, 0xe4, + 0x20, 0x46, 0x4c, 0x8a, 0x6b, 0x6c, 0xc5, 0xeb, 0x4e, 0x2c, 0x6c, 0x44, 0x39, 0x72, 0x57, 0xa8, + 0xa0, 0x98, 0x1b, 0xdf, 0xec, 0xae, 0x49, 0x30, 0xeb, 0xdd, 0x8e, 0x03, 0xc1, 0xe2, 0xdd, 0x6f, + 0x77, 0x66, 0xbe, 0x79, 0xe7, 0xe7, 0xdb, 0x87, 0x68, 0xad, 0xc9, 0x34, 0x14, 0x3d, 0x1c, 0xf2, + 0x93, 0x50, 0xa2, 0x0f, 0x14, 0xc6, 0x0d, 0x13, 0x29, 0xa9, 0x43, 0xdd, 0x14, 0xaa, 0x8f, 0x8c, + 0xa2, 0x89, 0xde, 0x61, 0xa2, 0xf7, 0x88, 0x3b, 0xd0, 0xd7, 0x38, 0x7e, 0x08, 0xdb, 0x47, 0xd2, + 0x63, 0x46, 0x83, 0x49, 0x6e, 0x42, 0xb7, 0xa1, 0x0a, 0x29, 0x90, 0x87, 0x61, 0xa4, 0xe4, 0x4e, + 0xdc, 0xfe, 0x5b, 0xdd, 0x3f, 0x8d, 0x3e, 0x42, 0x7d, 0x98, 0xed, 0x22, 0x6e, 0x86, 0xd1, 0x21, + 0x7b, 0x78, 0xff, 0x1c, 0x2f, 0x60, 0xd2, 0xa8, 0x40, 0x18, 0x62, 0x00, 0x55, 0xa1, 0x95, 0x38, + 0xae, 0x43, 0x22, 0x5c, 0x80, 0x43, 0x6e, 0x25, 0x19, 0xf5, 0xa1, 0xfb, 0x9e, 0xef, 0x5d, 0x10, + 0x92, 0xb5, 0xa5, 0x64, 0x67, 0xf1, 0xcd, 0x63, 0xb3, 0x41, 0xff, 0x5e, 0xc2, 0x8e, 0x02, 0xf4, + 0x2f, 0x16, 0x4b, 0xc5, 0xe3, 0x52, 0xf2, 0xcb, 0x52, 0xd2, 0x63, 0x68, 0x3b, 0x1d, 0x9b, 0xbd, + 0x84, 0xd6, 0x26, 0x8d, 0xb0, 0x03, 0xae, 0xf8, 0xc5, 0x52, 0x59, 0xe8, 0x46, 0xf0, 0x4c, 0x2b, + 0x9f, 0x6b, 0xe1, 0xbb, 0x0b, 0x63, 0x13, 0xef, 0x26, 0x18, 0x55, 0x95, 0x52, 0x27, 0x54, 0x59, + 0xb4, 0x91, 0xf3, 0x42, 0xfa, 0x5e, 0x9b, 0x31, 0x96, 0x1f, 0x1b, 0x53, 0x4d, 0xda, 0xd1, 0x5b, + 0xe9, 0xf3, 0x8d, 0xe6, 0x5a, 0xa0, 0x7b, 0xbd, 0x6d, 0xfd, 0xe4, 0xe9, 0xaa, 0x16, 0x8a, 0x0d, + 0x95, 0xbf, 0x7b, 0xf4, 0x5e, 0x82, 0xd1, 0x8a, 0x2a, 0xf3, 0xab, 0xcd, 0xe7, 0x8d, 0x0e, 0x72, + 0xba, 0xc8, 0xe9, 0x0a, 0xe5, 0x45, 0x2a, 0xb1, 0x56, 0xae, 0x98, 0x3b, 0x93, 0x7a, 0x47, 0xe8, + 0x3b, 0x82, 0xa3, 0xdc, 0x12, 0xca, 0x7d, 0x85, 0xf7, 0x53, 0x69, 0x76, 0x84, 0xb2, 0x38, 0x8c, + 0xa3, 0xbf, 0x81, 0x05, 0x5e, 0xc1, 0x98, 0xd9, 0x34, 0x77, 0x34, 0x38, 0x6b, 0x7d, 0xde, 0x5b, + 0x72, 0x90, 0xd4, 0xa7, 0x94, 0x66, 0x52, 0xdc, 0xd1, 0x25, 0xa8, 0xb3, 0xec, 0x2d, 0xcf, 0x21, + 0xa7, 0x8e, 0x9c, 0x43, 0xc9, 0x55, 0x17, 0xdd, 0xc5, 0x1b, 0xe8, 0x7b, 0x5c, 0x85, 0x3f, 0x10, + 0x5f, 0x23, 0xa9, 0x87, 0x23, 0x79, 0xb0, 0x4f, 0xd5, 0x5d, 0x87, 0x1e, 0xc7, 0xdf, 0xab, 0xd0, + 0x35, 0x21, 0x58, 0x85, 0x73, 0x7e, 0x6e, 0xbf, 0xff, 0xe8, 0x0b, 0xf4, 0x29, 0x6c, 0x2b, 0x44, + 0x0b, 0x28, 0x96, 0x1c, 0x17, 0x66, 0xdf, 0xfe, 0xfa, 0x1f, 0x51, 0x52, 0x0b, 0xcb, 0x3a, 0x2a, + 0x69, 0x77, 0x60, 0x28, 0x84, 0x3b, 0x2f, 0xa4, 0xfb, 0xc8, 0x88, 0x0c, 0x19, 0x9a, 0x39, 0xc9, + 0x15, 0xab, 0x0d, 0x8f, 0xe2, 0x20, 0x32, 0x38, 0xa4, 0x95, 0xa5, 0xd9, 0x2c, 0xae, 0x60, 0x09, + 0xe3, 0x67, 0xc8, 0x54, 0x59, 0x37, 0x3d, 0xa8, 0x1a, 0x02, 0xd2, 0x06, 0xaa, 0x46, 0x80, 0xb4, + 0x81, 0xaa, 0x11, 0x20, 0x6d, 0xa0, 0x6a, 0x04, 0x48, 0x1b, 0xa8, 0x1a, 0x01, 0xd2, 0x06, 0xaa, + 0x46, 0x80, 0xb4, 0x81, 0xaa, 0x11, 0x20, 0x6d, 0xa0, 0x6a, 0x04, 0x48, 0x1b, 0xa8, 0x1a, 0x01, + 0xd2, 0x06, 0xaa, 0x46, 0x80, 0xfc, 0x77, 0xa8, 0x1a, 0x02, 0xf2, 0xbf, 0x86, 0xea, 0x2f, 0x73, + 0x29, 0x07, 0xb2, 0xe7, 0xc3, 0x61, 0x3a, 0x00, 0x00, 0x00, 0x00, 0x49, 0x45, 0x4e, 0x44, 0xae, + 0x42, 0x60, 0x82, +}; + +const BITMAP_OPAQUE array_zone_xpm[1] = {{ png, sizeof( png ), "array_zone_xpm" }}; + +//EOF diff --git a/bitmaps_png/cpp_26/duplicate_footprint.cpp b/bitmaps_png/cpp_26/duplicate_footprint.cpp new file mode 100644 index 0000000000..e811930db6 --- /dev/null +++ b/bitmaps_png/cpp_26/duplicate_footprint.cpp @@ -0,0 +1,43 @@ + +/* Do not modify this file, it was automatically generated by the + * PNG2cpp CMake script, using a *.png file as input. + */ + +#include + +static const unsigned char png[] = { + 0x89, 0x50, 0x4e, 0x47, 0x0d, 0x0a, 0x1a, 0x0a, 0x00, 0x00, 0x00, 0x0d, 0x49, 0x48, 0x44, 0x52, + 0x00, 0x00, 0x00, 0x1a, 0x00, 0x00, 0x00, 0x1a, 0x08, 0x06, 0x00, 0x00, 0x00, 0xa9, 0x4a, 0x4c, + 0xce, 0x00, 0x00, 0x01, 0xa4, 0x49, 0x44, 0x41, 0x54, 0x48, 0xc7, 0x63, 0xf8, 0xff, 0xff, 0x3f, + 0x03, 0x3d, 0x30, 0x0a, 0x27, 0x24, 0x24, 0xe4, 0x3f, 0x0c, 0x13, 0xc3, 0xa7, 0xc8, 0x22, 0x86, + 0x93, 0x8a, 0x28, 0x06, 0xe3, 0xe2, 0x2f, 0x61, 0x60, 0xe0, 0x03, 0x62, 0x4f, 0x20, 0xae, 0x58, + 0xcc, 0xc0, 0x10, 0xbc, 0x9c, 0x81, 0x41, 0x96, 0xa0, 0x45, 0xc8, 0x2e, 0x85, 0x19, 0x84, 0x8f, + 0x9f, 0x65, 0x67, 0xf7, 0x7f, 0x31, 0x23, 0x23, 0xc8, 0x32, 0x30, 0x5e, 0xc3, 0xc2, 0xf2, 0x73, + 0x19, 0x23, 0xe3, 0xb7, 0xa5, 0x0c, 0x0c, 0x76, 0x04, 0x2d, 0x22, 0x25, 0xe8, 0xc2, 0x03, 0x03, + 0xff, 0x2f, 0x62, 0x60, 0xd0, 0xc9, 0xb0, 0xb7, 0xff, 0xbf, 0x8c, 0x89, 0xa9, 0x72, 0x39, 0x23, + 0xe3, 0xe7, 0x63, 0x42, 0x42, 0x20, 0xf6, 0x27, 0xa0, 0xcf, 0x14, 0x08, 0xf9, 0x28, 0x28, 0x3a, + 0x3a, 0x9a, 0x8f, 0x94, 0x70, 0x87, 0x39, 0x00, 0xe8, 0xab, 0xc0, 0x4d, 0xec, 0xec, 0x9f, 0x80, + 0x96, 0xfd, 0x02, 0x5a, 0xd6, 0x45, 0xc8, 0xa2, 0x43, 0x40, 0xbc, 0x81, 0x1c, 0x8b, 0x80, 0xc6, + 0x30, 0x02, 0x83, 0xee, 0xfb, 0x1d, 0x79, 0xf9, 0xff, 0x2b, 0x99, 0x98, 0x9e, 0xe1, 0xb5, 0xc8, + 0xd7, 0xd7, 0x97, 0x0b, 0x48, 0xff, 0x26, 0xc5, 0x57, 0x20, 0x7d, 0xf3, 0x19, 0x18, 0x38, 0x40, + 0xc1, 0xb8, 0x9c, 0x89, 0xe9, 0xe9, 0x5d, 0xa0, 0x45, 0xc0, 0xf8, 0xfa, 0xb2, 0x8a, 0x89, 0xe9, + 0x0a, 0x30, 0xbe, 0x6e, 0xac, 0x62, 0x60, 0x10, 0xc2, 0xe6, 0xa3, 0xc3, 0x40, 0x7c, 0x80, 0x54, + 0x1f, 0x01, 0x53, 0x5c, 0x0a, 0x30, 0xe8, 0xfe, 0xad, 0x63, 0x63, 0xfb, 0x71, 0x4f, 0x41, 0xe1, + 0x3f, 0x08, 0xaf, 0x66, 0x61, 0xf9, 0x05, 0x14, 0xcb, 0xc6, 0x15, 0x74, 0x89, 0x0e, 0x0e, 0x0e, + 0x2c, 0x64, 0xc6, 0x51, 0xf8, 0x0a, 0x26, 0xa6, 0x6f, 0x20, 0x4b, 0xae, 0x4a, 0x4b, 0xff, 0x07, + 0xb2, 0x6f, 0x03, 0x7d, 0xc3, 0x4c, 0x71, 0xaa, 0x43, 0xe6, 0xc3, 0x0c, 0x02, 0x06, 0x95, 0x3b, + 0x30, 0xf8, 0xbe, 0xac, 0x60, 0x66, 0xfe, 0x0e, 0xf4, 0xa5, 0x2d, 0x55, 0xf2, 0x11, 0xae, 0x12, + 0x02, 0x68, 0x81, 0xd5, 0x32, 0x06, 0x86, 0x59, 0x54, 0x2d, 0x19, 0x80, 0x78, 0x3f, 0x54, 0x6c, + 0x3f, 0x0c, 0x63, 0xe3, 0x53, 0x5c, 0xd6, 0x21, 0x1b, 0xcc, 0x70, 0x4a, 0x71, 0x3f, 0x2e, 0x3e, + 0x56, 0x8b, 0x08, 0x44, 0x3c, 0xdc, 0xa5, 0x30, 0x83, 0x88, 0xe5, 0x93, 0x6c, 0x11, 0x31, 0x41, + 0x85, 0x8d, 0x4f, 0x8e, 0x8f, 0x6c, 0xd3, 0xd2, 0xd2, 0xb8, 0x48, 0xcc, 0x02, 0x64, 0x59, 0x34, + 0x31, 0x38, 0x38, 0xb8, 0x85, 0xe6, 0x16, 0x79, 0x7a, 0x7a, 0xb2, 0x03, 0xe9, 0x3d, 0xa4, 0xf8, + 0x8a, 0x5c, 0x1f, 0x4d, 0x02, 0xfa, 0x68, 0x02, 0x3d, 0x82, 0xce, 0x33, 0x34, 0x34, 0x94, 0x99, + 0xe6, 0x16, 0xd1, 0x33, 0xd5, 0xd1, 0x3e, 0x1f, 0x21, 0x5b, 0x88, 0xaf, 0x24, 0xa0, 0xb8, 0x64, + 0xc0, 0xe6, 0x33, 0xb2, 0xcb, 0x3a, 0x5a, 0x62, 0x00, 0x66, 0x05, 0x94, 0x24, 0x1f, 0x97, 0xfe, + 0x47, 0x00, 0x00, 0x00, 0x00, 0x49, 0x45, 0x4e, 0x44, 0xae, 0x42, 0x60, 0x82, +}; + +const BITMAP_OPAQUE duplicate_footprint_xpm[1] = {{ png, sizeof( png ), "duplicate_footprint_xpm" }}; + +//EOF diff --git a/bitmaps_png/cpp_26/duplicate_line.cpp b/bitmaps_png/cpp_26/duplicate_line.cpp new file mode 100644 index 0000000000..097a1826b7 --- /dev/null +++ b/bitmaps_png/cpp_26/duplicate_line.cpp @@ -0,0 +1,37 @@ + +/* Do not modify this file, it was automatically generated by the + * PNG2cpp CMake script, using a *.png file as input. + */ + +#include + +static const unsigned char png[] = { + 0x89, 0x50, 0x4e, 0x47, 0x0d, 0x0a, 0x1a, 0x0a, 0x00, 0x00, 0x00, 0x0d, 0x49, 0x48, 0x44, 0x52, + 0x00, 0x00, 0x00, 0x1a, 0x00, 0x00, 0x00, 0x1a, 0x08, 0x06, 0x00, 0x00, 0x00, 0xa9, 0x4a, 0x4c, + 0xce, 0x00, 0x00, 0x01, 0x41, 0x49, 0x44, 0x41, 0x54, 0x48, 0xc7, 0xed, 0x96, 0xb1, 0x4a, 0x03, + 0x41, 0x14, 0x45, 0xcf, 0xbc, 0x59, 0x0d, 0xc4, 0x08, 0xb1, 0x90, 0x4d, 0x0c, 0x6c, 0x61, 0xb0, + 0x88, 0xda, 0xa7, 0x16, 0x0b, 0xc1, 0xc2, 0x0f, 0xf0, 0x23, 0xfc, 0x06, 0xbb, 0x94, 0xd6, 0x62, + 0x21, 0x6c, 0x76, 0x9d, 0xd5, 0x14, 0x42, 0x2c, 0x2c, 0x44, 0x44, 0xd2, 0x07, 0x2b, 0x2d, 0x52, + 0x08, 0x62, 0x61, 0x11, 0x14, 0x4c, 0xc2, 0x82, 0x1a, 0xc7, 0x4f, 0x50, 0x21, 0x93, 0xc2, 0x58, + 0x9c, 0xfa, 0xf0, 0x86, 0xfb, 0xde, 0x1d, 0xac, 0xb5, 0x8c, 0x03, 0xc6, 0x2e, 0xe2, 0x00, 0xeb, + 0x82, 0x09, 0x10, 0x7d, 0xc7, 0x15, 0x78, 0x11, 0x6c, 0x1b, 0x58, 0x70, 0x1a, 0x86, 0x18, 0x96, + 0x62, 0xa5, 0xd2, 0x08, 0x6c, 0x22, 0x72, 0x1f, 0xc3, 0x86, 0xb3, 0xd4, 0x85, 0x50, 0x35, 0x4a, + 0xf5, 0xae, 0xf3, 0xf9, 0xcf, 0x86, 0xe7, 0xf5, 0x13, 0xad, 0xc3, 0x10, 0x66, 0x9c, 0xc4, 0x3b, + 0x84, 0x55, 0x23, 0xf2, 0xdc, 0xf6, 0xfd, 0xe1, 0x45, 0x2e, 0x97, 0x26, 0x4a, 0x35, 0x9d, 0xed, + 0x51, 0x02, 0x65, 0x23, 0xf2, 0xd4, 0xf6, 0xfd, 0x8f, 0xd3, 0xe9, 0xe9, 0xbe, 0x11, 0xd9, 0x71, + 0xb6, 0xb0, 0x47, 0xb0, 0x72, 0x2c, 0x32, 0x78, 0x58, 0x5c, 0xb4, 0x46, 0xa9, 0xc1, 0x09, 0xcc, + 0x3b, 0xbb, 0x0c, 0x89, 0xd6, 0x57, 0x37, 0x85, 0xc2, 0x67, 0x6b, 0x6e, 0x2e, 0x4d, 0x44, 0x6a, + 0xce, 0x44, 0x31, 0xac, 0x35, 0x3c, 0xaf, 0xff, 0x58, 0x2e, 0x5b, 0x23, 0xd2, 0x8b, 0x61, 0x33, + 0x82, 0xbd, 0x43, 0xc8, 0x8f, 0x54, 0x54, 0x87, 0x62, 0xac, 0x54, 0xf7, 0xb6, 0x54, 0xb2, 0x97, + 0xb3, 0xb3, 0x69, 0x22, 0xf2, 0x76, 0xac, 0x75, 0x6b, 0xa4, 0x13, 0x45, 0xb0, 0x1e, 0x43, 0xda, + 0xd0, 0xfa, 0xbd, 0x13, 0x04, 0xf6, 0xa5, 0x52, 0xb1, 0xcd, 0x4c, 0xe6, 0xb5, 0x0e, 0x5b, 0x23, + 0x7f, 0xba, 0x08, 0x96, 0x8d, 0xc8, 0xdd, 0x79, 0x36, 0xdb, 0xef, 0x04, 0x81, 0x35, 0x22, 0xdd, + 0x13, 0xd0, 0x4e, 0x6a, 0x62, 0x1f, 0xa6, 0x8e, 0x44, 0x6a, 0x11, 0x0c, 0x63, 0x91, 0x5d, 0xe7, + 0x7d, 0x14, 0x42, 0xb5, 0x0e, 0xc5, 0x9f, 0xf4, 0xd1, 0x99, 0x0b, 0x26, 0x40, 0xf4, 0xf7, 0x3e, + 0x27, 0xff, 0xa2, 0xdf, 0xf2, 0x05, 0x63, 0x00, 0xb0, 0xc1, 0xf1, 0xcc, 0x65, 0x5d, 0x00, 0x00, + 0x00, 0x00, 0x49, 0x45, 0x4e, 0x44, 0xae, 0x42, 0x60, 0x82, +}; + +const BITMAP_OPAQUE duplicate_line_xpm[1] = {{ png, sizeof( png ), "duplicate_line_xpm" }}; + +//EOF diff --git a/bitmaps_png/cpp_26/duplicate_module.cpp b/bitmaps_png/cpp_26/duplicate_module.cpp new file mode 100644 index 0000000000..ecf5bcde44 --- /dev/null +++ b/bitmaps_png/cpp_26/duplicate_module.cpp @@ -0,0 +1,43 @@ + +/* Do not modify this file, it was automatically generated by the + * PNG2cpp CMake script, using a *.png file as input. + */ + +#include + +static const unsigned char png[] = { + 0x89, 0x50, 0x4e, 0x47, 0x0d, 0x0a, 0x1a, 0x0a, 0x00, 0x00, 0x00, 0x0d, 0x49, 0x48, 0x44, 0x52, + 0x00, 0x00, 0x00, 0x1a, 0x00, 0x00, 0x00, 0x1a, 0x08, 0x06, 0x00, 0x00, 0x00, 0xa9, 0x4a, 0x4c, + 0xce, 0x00, 0x00, 0x01, 0xa4, 0x49, 0x44, 0x41, 0x54, 0x48, 0xc7, 0x63, 0xf8, 0xff, 0xff, 0x3f, + 0x03, 0x3d, 0x30, 0x0a, 0x27, 0x24, 0x24, 0xe4, 0x3f, 0x0c, 0x13, 0xc3, 0xa7, 0xc8, 0x22, 0x86, + 0x93, 0x8a, 0x28, 0x06, 0xe3, 0xe2, 0x2f, 0x61, 0x60, 0xe0, 0x03, 0x62, 0x4f, 0x20, 0xae, 0x58, + 0xcc, 0xc0, 0x10, 0xbc, 0x9c, 0x81, 0x41, 0x96, 0xa0, 0x45, 0xc8, 0x2e, 0x85, 0x19, 0x84, 0x8f, + 0x9f, 0x65, 0x67, 0xf7, 0x7f, 0x31, 0x23, 0x23, 0xc8, 0x32, 0x30, 0x5e, 0xc3, 0xc2, 0xf2, 0x73, + 0x19, 0x23, 0xe3, 0xb7, 0xa5, 0x0c, 0x0c, 0x76, 0x04, 0x2d, 0x22, 0x25, 0xe8, 0xc2, 0x03, 0x03, + 0xff, 0x2f, 0x62, 0x60, 0xd0, 0xc9, 0xb0, 0xb7, 0xff, 0xbf, 0x8c, 0x89, 0xa9, 0x72, 0x39, 0x23, + 0xe3, 0xe7, 0x63, 0x42, 0x42, 0x20, 0xf6, 0x27, 0xa0, 0xcf, 0x14, 0x08, 0xf9, 0x28, 0x28, 0x3a, + 0x3a, 0x9a, 0x8f, 0x94, 0x70, 0x87, 0x39, 0x00, 0xe8, 0xab, 0xc0, 0x4d, 0xec, 0xec, 0x9f, 0x80, + 0x96, 0xfd, 0x02, 0x5a, 0xd6, 0x45, 0xc8, 0xa2, 0x43, 0x40, 0xbc, 0x81, 0x1c, 0x8b, 0x80, 0xc6, + 0x30, 0x02, 0x83, 0xee, 0xfb, 0x1d, 0x79, 0xf9, 0xff, 0x2b, 0x99, 0x98, 0x9e, 0xe1, 0xb5, 0xc8, + 0xd7, 0xd7, 0x97, 0x0b, 0x48, 0xff, 0x26, 0xc5, 0x57, 0x20, 0x7d, 0xf3, 0x19, 0x18, 0x38, 0x40, + 0xc1, 0xb8, 0x9c, 0x89, 0xe9, 0xe9, 0x5d, 0xa0, 0x45, 0xc0, 0xf8, 0xfa, 0xb2, 0x8a, 0x89, 0xe9, + 0x0a, 0x30, 0xbe, 0x6e, 0xac, 0x62, 0x60, 0x10, 0xc2, 0xe6, 0xa3, 0xc3, 0x40, 0x7c, 0x80, 0x54, + 0x1f, 0x01, 0x53, 0x5c, 0x0a, 0x30, 0xe8, 0xfe, 0xad, 0x63, 0x63, 0xfb, 0x71, 0x4f, 0x41, 0xe1, + 0x3f, 0x08, 0xaf, 0x66, 0x61, 0xf9, 0x05, 0x14, 0xcb, 0xc6, 0x15, 0x74, 0x89, 0x0e, 0x0e, 0x0e, + 0x2c, 0x64, 0xc6, 0x51, 0xf8, 0x0a, 0x26, 0xa6, 0x6f, 0x20, 0x4b, 0xae, 0x4a, 0x4b, 0xff, 0x07, + 0xb2, 0x6f, 0x03, 0x7d, 0xc3, 0x4c, 0x71, 0xaa, 0x43, 0xe6, 0xc3, 0x0c, 0x02, 0x06, 0x95, 0x3b, + 0x30, 0xf8, 0xbe, 0xac, 0x60, 0x66, 0xfe, 0x0e, 0xf4, 0xa5, 0x2d, 0x55, 0xf2, 0x11, 0xae, 0x12, + 0x02, 0x68, 0x81, 0xd5, 0x32, 0x06, 0x86, 0x59, 0x54, 0x2d, 0x19, 0x80, 0x78, 0x3f, 0x54, 0x6c, + 0x3f, 0x0c, 0x63, 0xe3, 0x53, 0x5c, 0xd6, 0x21, 0x1b, 0xcc, 0x70, 0x4a, 0x71, 0x3f, 0x2e, 0x3e, + 0x56, 0x8b, 0x08, 0x44, 0x3c, 0xdc, 0xa5, 0x30, 0x83, 0x88, 0xe5, 0x93, 0x6c, 0x11, 0x31, 0x41, + 0x85, 0x8d, 0x4f, 0x8e, 0x8f, 0x6c, 0xd3, 0xd2, 0xd2, 0xb8, 0x48, 0xcc, 0x02, 0x64, 0x59, 0x34, + 0x31, 0x38, 0x38, 0xb8, 0x85, 0xe6, 0x16, 0x79, 0x7a, 0x7a, 0xb2, 0x03, 0xe9, 0x3d, 0xa4, 0xf8, + 0x8a, 0x5c, 0x1f, 0x4d, 0x02, 0xfa, 0x68, 0x02, 0x3d, 0x82, 0xce, 0x33, 0x34, 0x34, 0x94, 0x99, + 0xe6, 0x16, 0xd1, 0x33, 0xd5, 0xd1, 0x3e, 0x1f, 0x21, 0x5b, 0x88, 0xaf, 0x24, 0xa0, 0xb8, 0x64, + 0xc0, 0xe6, 0x33, 0xb2, 0xcb, 0x3a, 0x5a, 0x62, 0x00, 0x66, 0x05, 0x94, 0x24, 0x1f, 0x97, 0xfe, + 0x47, 0x00, 0x00, 0x00, 0x00, 0x49, 0x45, 0x4e, 0x44, 0xae, 0x42, 0x60, 0x82, +}; + +const BITMAP_OPAQUE duplicate_module_xpm[1] = {{ png, sizeof( png ), "duplicate_module_xpm" }}; + +//EOF diff --git a/bitmaps_png/cpp_26/duplicate_pad.cpp b/bitmaps_png/cpp_26/duplicate_pad.cpp new file mode 100644 index 0000000000..7a60b513d4 --- /dev/null +++ b/bitmaps_png/cpp_26/duplicate_pad.cpp @@ -0,0 +1,50 @@ + +/* Do not modify this file, it was automatically generated by the + * PNG2cpp CMake script, using a *.png file as input. + */ + +#include + +static const unsigned char png[] = { + 0x89, 0x50, 0x4e, 0x47, 0x0d, 0x0a, 0x1a, 0x0a, 0x00, 0x00, 0x00, 0x0d, 0x49, 0x48, 0x44, 0x52, + 0x00, 0x00, 0x00, 0x1a, 0x00, 0x00, 0x00, 0x1a, 0x08, 0x06, 0x00, 0x00, 0x00, 0xa9, 0x4a, 0x4c, + 0xce, 0x00, 0x00, 0x02, 0x12, 0x49, 0x44, 0x41, 0x54, 0x48, 0xc7, 0xd5, 0x54, 0x4d, 0x48, 0x54, + 0x51, 0x18, 0x3d, 0xef, 0x4e, 0xf8, 0x83, 0x0c, 0x31, 0x9a, 0x1b, 0x45, 0x66, 0xd1, 0x6a, 0x60, + 0xda, 0xb6, 0x69, 0xe1, 0xaa, 0x89, 0x36, 0x41, 0x20, 0x41, 0xab, 0x20, 0xc6, 0xa5, 0xd0, 0xc2, + 0xad, 0x36, 0x69, 0x30, 0xd0, 0x66, 0x08, 0x5d, 0xd8, 0x22, 0x06, 0x52, 0xf3, 0xe9, 0x4a, 0x26, + 0xa9, 0x45, 0x42, 0x09, 0xea, 0xea, 0x6d, 0x24, 0x10, 0x8d, 0x76, 0x12, 0x21, 0x44, 0x8c, 0xe2, + 0x28, 0xa2, 0xf5, 0x3a, 0xdf, 0x7d, 0xdf, 0x44, 0x0c, 0x09, 0xce, 0xcc, 0xf3, 0x41, 0x8b, 0xc3, + 0x7d, 0xef, 0xfb, 0xee, 0x3d, 0xe7, 0x9e, 0xef, 0xbb, 0xf7, 0xc2, 0xf7, 0x7d, 0x44, 0x81, 0x9a, + 0x1f, 0x38, 0xc8, 0x21, 0x8b, 0x27, 0xf8, 0xc8, 0xb1, 0x6c, 0x11, 0x7c, 0x67, 0x25, 0x17, 0x8a, + 0x10, 0xc9, 0x7a, 0x88, 0x35, 0x62, 0x87, 0xf0, 0x88, 0x65, 0x85, 0xa7, 0x31, 0xc9, 0xf5, 0x34, + 0x25, 0xa4, 0x4e, 0x84, 0x68, 0x8b, 0x28, 0x9d, 0x81, 0x2d, 0x3b, 0xa7, 0x41, 0x67, 0x55, 0x37, + 0x59, 0xdd, 0x75, 0x09, 0x8f, 0xf1, 0x86, 0xe3, 0x06, 0xb1, 0xab, 0xd8, 0xd0, 0x98, 0x88, 0xed, + 0xc4, 0x46, 0x31, 0xf8, 0x0a, 0x48, 0xb9, 0xc0, 0xd5, 0x05, 0xe0, 0x72, 0x7d, 0x42, 0x41, 0x1f, + 0x3c, 0x25, 0x13, 0x91, 0x4f, 0x18, 0x43, 0xbf, 0x85, 0x7c, 0x33, 0x96, 0x18, 0xc6, 0xbb, 0xfb, + 0x37, 0x9c, 0xaf, 0x2f, 0x3b, 0xcc, 0xf1, 0x0c, 0x97, 0xb9, 0xc6, 0x1c, 0xbd, 0x76, 0x9c, 0xc3, + 0x69, 0xe0, 0x4e, 0x3d, 0x8e, 0xca, 0xda, 0x8f, 0x92, 0x75, 0x41, 0x81, 0x3f, 0x13, 0x02, 0xb1, + 0xdd, 0xf4, 0x03, 0xac, 0x3c, 0xef, 0x32, 0x07, 0xe3, 0x49, 0x73, 0xb2, 0x10, 0x8b, 0xad, 0xce, + 0x39, 0xce, 0xd1, 0x6a, 0x22, 0xf1, 0x6b, 0xde, 0x98, 0x43, 0x0a, 0x0f, 0x84, 0x26, 0xa4, 0x39, + 0x99, 0x53, 0x96, 0x38, 0xc9, 0xaf, 0xd1, 0x55, 0x65, 0xb3, 0xb7, 0x57, 0xdc, 0x7d, 0xfb, 0x00, + 0x5c, 0x0a, 0xa5, 0x74, 0x9a, 0xf3, 0x64, 0x6e, 0x75, 0x31, 0x05, 0x8a, 0x5e, 0x77, 0xf7, 0xcf, + 0xa5, 0xf6, 0xf6, 0x03, 0x0a, 0x0f, 0xb1, 0x8c, 0xf7, 0x38, 0xde, 0x0d, 0xe5, 0x30, 0xc8, 0xdc, + 0xea, 0x62, 0x92, 0x3e, 0x5c, 0x6c, 0x69, 0xd9, 0xfb, 0x92, 0x4c, 0xfa, 0xec, 0xd7, 0xa9, 0xf4, + 0x6e, 0x16, 0xb8, 0x1e, 0xda, 0xf1, 0x7e, 0x0b, 0xb4, 0x92, 0x74, 0x49, 0x88, 0x97, 0xe3, 0xf1, + 0xe3, 0x1f, 0xa9, 0x94, 0xbf, 0xdd, 0xd7, 0x27, 0x25, 0xfc, 0x1c, 0xfa, 0x85, 0x2d, 0x02, 0x6d, + 0x24, 0x7e, 0xc1, 0x83, 0x51, 0x11, 0x47, 0xef, 0xe3, 0xf1, 0x7d, 0x0a, 0x0f, 0x5e, 0xd8, 0x13, + 0xc4, 0xbe, 0xdc, 0x9c, 0x33, 0xe6, 0xfb, 0xac, 0xe3, 0x54, 0x78, 0xbf, 0x3a, 0xce, 0x25, 0x54, + 0xff, 0x6d, 0xb7, 0x1b, 0xcb, 0x5c, 0x79, 0x84, 0xc2, 0xed, 0x5b, 0x58, 0xe7, 0xb7, 0x4b, 0xe4, + 0x25, 0x56, 0xbb, 0xb1, 0xc6, 0x45, 0x72, 0xe8, 0x24, 0x9e, 0x11, 0x45, 0xa2, 0x40, 0x3c, 0x55, + 0x14, 0x34, 0x26, 0xb9, 0xce, 0xa6, 0x84, 0xd4, 0x89, 0x10, 0x4d, 0x61, 0x14, 0x23, 0xff, 0x84, + 0xe4, 0x64, 0x8e, 0x3a, 0x6b, 0xd4, 0x4d, 0xc6, 0xee, 0x5a, 0x08, 0x85, 0x36, 0x87, 0x09, 0x62, + 0x46, 0x31, 0x61, 0x63, 0x81, 0x98, 0x38, 0xcb, 0x34, 0x23, 0x94, 0xb7, 0x25, 0x0a, 0xc8, 0x44, + 0x64, 0x92, 0x48, 0x2b, 0x26, 0x6d, 0x2c, 0xc8, 0x49, 0x19, 0xf3, 0xcd, 0x08, 0xb9, 0xb6, 0x1f, + 0x01, 0x99, 0xb8, 0x48, 0xff, 0x95, 0x4b, 0xdb, 0x58, 0x90, 0x93, 0x9e, 0xb9, 0xff, 0x85, 0x50, + 0x64, 0xa5, 0x8b, 0xe8, 0x30, 0x44, 0x75, 0xbc, 0x23, 0xbb, 0xb0, 0xb5, 0x4f, 0x90, 0xf6, 0xcc, + 0xbd, 0x90, 0x27, 0xa8, 0x5e, 0xfc, 0x06, 0x78, 0x64, 0xb7, 0x0e, 0x00, 0x4c, 0xaa, 0xda, 0x00, + 0x00, 0x00, 0x00, 0x49, 0x45, 0x4e, 0x44, 0xae, 0x42, 0x60, 0x82, +}; + +const BITMAP_OPAQUE duplicate_pad_xpm[1] = {{ png, sizeof( png ), "duplicate_pad_xpm" }}; + +//EOF diff --git a/bitmaps_png/cpp_26/duplicate_target.cpp b/bitmaps_png/cpp_26/duplicate_target.cpp new file mode 100644 index 0000000000..bf4b78ea42 --- /dev/null +++ b/bitmaps_png/cpp_26/duplicate_target.cpp @@ -0,0 +1,63 @@ + +/* Do not modify this file, it was automatically generated by the + * PNG2cpp CMake script, using a *.png file as input. + */ + +#include + +static const unsigned char png[] = { + 0x89, 0x50, 0x4e, 0x47, 0x0d, 0x0a, 0x1a, 0x0a, 0x00, 0x00, 0x00, 0x0d, 0x49, 0x48, 0x44, 0x52, + 0x00, 0x00, 0x00, 0x1a, 0x00, 0x00, 0x00, 0x1a, 0x08, 0x06, 0x00, 0x00, 0x00, 0xa9, 0x4a, 0x4c, + 0xce, 0x00, 0x00, 0x02, 0xda, 0x49, 0x44, 0x41, 0x54, 0x48, 0xc7, 0xcd, 0x96, 0xcf, 0x6b, 0x13, + 0x41, 0x14, 0xc7, 0x67, 0x7f, 0x25, 0xdd, 0x4d, 0xb6, 0x69, 0x24, 0xd5, 0x26, 0xa5, 0x49, 0x0f, + 0x1e, 0x5a, 0xd3, 0x58, 0xb0, 0x6c, 0x4c, 0xb0, 0xea, 0x41, 0xf4, 0xe0, 0xc1, 0xbf, 0xa1, 0x67, + 0xa9, 0xe0, 0xdd, 0x8b, 0xb7, 0xde, 0xd4, 0x53, 0xd1, 0x83, 0x0a, 0xd6, 0xa6, 0x4d, 0x0a, 0x8a, + 0x8d, 0x22, 0x28, 0xed, 0x1e, 0x7a, 0xb3, 0x37, 0x29, 0x6a, 0x8d, 0x0a, 0x7a, 0xb2, 0x50, 0x91, + 0x16, 0x63, 0x62, 0x5b, 0x3b, 0xbe, 0xef, 0x92, 0x85, 0x6d, 0xd8, 0xfc, 0x16, 0x71, 0xe0, 0xb1, + 0xd9, 0x99, 0x65, 0x3e, 0xf3, 0xfd, 0xbe, 0xf7, 0x86, 0x30, 0xce, 0x39, 0xfb, 0x17, 0x51, 0x7f, + 0xd1, 0x5a, 0x76, 0x5f, 0x9b, 0x61, 0xec, 0x68, 0x86, 0xb1, 0xb3, 0xf4, 0x1c, 0xcd, 0x31, 0xa6, + 0xfe, 0x75, 0xd0, 0x2c, 0x63, 0x17, 0xb3, 0x92, 0xf4, 0xea, 0x21, 0xad, 0xd1, 0xef, 0xfd, 0x05, + 0x59, 0x2e, 0xce, 0x8b, 0xe2, 0x3b, 0x02, 0x86, 0x5b, 0x02, 0xd1, 0xd0, 0x75, 0x1f, 0xbb, 0x11, + 0xea, 0x51, 0x3e, 0x02, 0xd4, 0x7b, 0x48, 0x59, 0xc7, 0x3b, 0xe6, 0xb1, 0x3e, 0x2f, 0xcb, 0x53, + 0x39, 0x49, 0x7a, 0x4a, 0x9b, 0xdf, 0xce, 0x8a, 0xe2, 0xeb, 0x9c, 0x2c, 0x97, 0x56, 0x82, 0xc1, + 0xdd, 0x8c, 0x20, 0x6c, 0xdc, 0xad, 0x7c, 0xd3, 0x10, 0x44, 0xc3, 0x50, 0xbb, 0x84, 0xcd, 0xb1, + 0xd1, 0xbe, 0xbd, 0x74, 0x2a, 0x89, 0x09, 0xbe, 0x9a, 0x3f, 0xc3, 0xaf, 0x4c, 0x0c, 0x94, 0x35, + 0x55, 0xd8, 0xc0, 0x7a, 0xf5, 0x06, 0x04, 0x9c, 0x5e, 0x0e, 0x04, 0x8a, 0x2f, 0xfd, 0xfe, 0x62, + 0x46, 0x14, 0xaf, 0x35, 0x04, 0xe1, 0xc4, 0x5d, 0x1e, 0xe1, 0x5b, 0x2a, 0x39, 0xc2, 0x13, 0x89, + 0x04, 0x1f, 0x1f, 0x3f, 0x65, 0x81, 0xca, 0x85, 0x0b, 0xfc, 0xd7, 0x7a, 0x9a, 0xe7, 0xef, 0x8d, + 0xf1, 0x0a, 0xec, 0xc0, 0xa9, 0xc9, 0xc2, 0x6e, 0x52, 0x53, 0xfa, 0x34, 0x38, 0xc8, 0xe7, 0x44, + 0x71, 0x0b, 0xd6, 0xd2, 0xdc, 0xcd, 0xfb, 0x8c, 0xf5, 0xb8, 0x82, 0x60, 0x4f, 0x2c, 0x7a, 0x64, + 0x1f, 0x10, 0x00, 0x9c, 0xa0, 0xbd, 0xb5, 0x80, 0x05, 0x83, 0x32, 0x7c, 0x57, 0x55, 0x14, 0xe1, + 0x39, 0x41, 0x78, 0xb3, 0x16, 0x89, 0xf0, 0x25, 0x5d, 0xff, 0x49, 0x0a, 0x77, 0x28, 0x87, 0x2b, + 0x35, 0x15, 0x05, 0x03, 0xca, 0xe7, 0x64, 0x32, 0x69, 0x01, 0xec, 0xb0, 0x41, 0x76, 0xc0, 0x46, + 0xe4, 0xcc, 0xa1, 0xe6, 0x1c, 0x29, 0x28, 0x2d, 0x48, 0xd2, 0xee, 0x87, 0x58, 0x8c, 0x7f, 0x1f, + 0x1e, 0xe6, 0x8b, 0x5e, 0xef, 0x36, 0xc1, 0x2f, 0xb9, 0xe4, 0x9e, 0xf1, 0x76, 0xa3, 0x02, 0x3b, + 0x46, 0x96, 0xbd, 0x7d, 0xae, 0x69, 0x3f, 0x0a, 0xd1, 0x28, 0xec, 0xdb, 0xa4, 0x72, 0x97, 0x6a, + 0x2a, 0xc2, 0x49, 0x71, 0x62, 0xa7, 0x02, 0xdb, 0x42, 0x3b, 0xa0, 0x58, 0xf7, 0xc9, 0x5f, 0xab, + 0x37, 0xb9, 0xc3, 0x98, 0x42, 0x85, 0x30, 0x45, 0xd0, 0xdf, 0xb3, 0xa2, 0x78, 0xbd, 0x6e, 0x31, + 0xc0, 0x7b, 0xe4, 0x00, 0xb9, 0x40, 0x4e, 0x9c, 0x20, 0x3c, 0x91, 0xbb, 0xfe, 0xc8, 0x61, 0xae, + 0x69, 0x6c, 0xda, 0xc5, 0x16, 0x13, 0xcf, 0x07, 0x8c, 0x9d, 0xac, 0xd5, 0x4f, 0x07, 0xaa, 0x0e, + 0x55, 0x85, 0xea, 0x02, 0xcc, 0x09, 0x02, 0x24, 0x1e, 0x8f, 0x73, 0x45, 0x11, 0xb6, 0x99, 0x4b, + 0xaf, 0xd8, 0xa0, 0xa6, 0x1b, 0x16, 0x7d, 0x02, 0x18, 0x94, 0xc1, 0x46, 0x80, 0x60, 0x17, 0x94, + 0x78, 0x14, 0x61, 0xcb, 0xd9, 0x47, 0x34, 0x34, 0xbf, 0xc6, 0x2e, 0x87, 0x02, 0x4a, 0x06, 0xa0, + 0x50, 0x50, 0x99, 0xc1, 0x3b, 0xe6, 0x5b, 0xba, 0x19, 0x90, 0x33, 0x80, 0x82, 0xdd, 0xca, 0x17, + 0xbf, 0x8f, 0xdd, 0x72, 0x2a, 0xa1, 0x31, 0xa4, 0x7a, 0x85, 0x27, 0x27, 0x8e, 0xf7, 0x2d, 0xa5, + 0x53, 0x86, 0x09, 0xd0, 0x6a, 0xfe, 0xb4, 0x39, 0x39, 0x31, 0xf0, 0x82, 0x0e, 0xfa, 0x18, 0xeb, + 0x1d, 0xdf, 0x75, 0x38, 0xb1, 0xd7, 0x23, 0x2c, 0xa6, 0x8c, 0x11, 0x93, 0x2c, 0x35, 0xc9, 0x5a, + 0x0b, 0x54, 0x2e, 0x9c, 0x37, 0x77, 0xde, 0xa7, 0x4d, 0xb2, 0xde, 0xac, 0xc0, 0xb4, 0x8e, 0x40, + 0xb0, 0x87, 0x1a, 0x7b, 0x19, 0x10, 0x00, 0x9c, 0x20, 0x2a, 0x22, 0x0b, 0x06, 0x65, 0xf8, 0xae, + 0x69, 0x90, 0x5b, 0x50, 0x63, 0x67, 0x0d, 0xc3, 0xb0, 0x00, 0x76, 0xd8, 0x20, 0x3b, 0x60, 0x23, + 0x72, 0xd6, 0x16, 0x08, 0x9b, 0xb5, 0x1b, 0x6d, 0x29, 0xc2, 0x49, 0x71, 0x62, 0xa7, 0x02, 0xdb, + 0x42, 0x3b, 0xa0, 0x58, 0xd7, 0xe4, 0x47, 0x1d, 0x59, 0x07, 0xef, 0x91, 0x03, 0xe4, 0x02, 0x39, + 0x71, 0x82, 0xf0, 0x44, 0xee, 0xfa, 0xc3, 0xbd, 0xa6, 0xaa, 0xb2, 0xab, 0x1d, 0x81, 0x50, 0x4d, + 0xa8, 0x2a, 0x54, 0x17, 0x60, 0x4e, 0x10, 0x20, 0xd4, 0xd8, 0xa6, 0xc7, 0x23, 0x3c, 0x6b, 0xa9, + 0xea, 0xea, 0xc0, 0x86, 0x00, 0x83, 0x32, 0xd8, 0x08, 0x10, 0xec, 0x82, 0x92, 0x0a, 0xa4, 0xb5, + 0x3e, 0x6a, 0xa4, 0xcc, 0xba, 0x19, 0x28, 0x67, 0x00, 0x51, 0x63, 0x67, 0xfd, 0x2a, 0x9b, 0x6c, + 0xfa, 0x66, 0x68, 0x13, 0x6a, 0x76, 0xf4, 0x2f, 0xe8, 0xbf, 0x03, 0x35, 0x13, 0x7f, 0x00, 0x00, + 0x4f, 0xfc, 0x7e, 0x5d, 0x89, 0x9f, 0xa7, 0x00, 0x00, 0x00, 0x00, 0x49, 0x45, 0x4e, 0x44, 0xae, + 0x42, 0x60, 0x82, +}; + +const BITMAP_OPAQUE duplicate_target_xpm[1] = {{ png, sizeof( png ), "duplicate_target_xpm" }}; + +//EOF diff --git a/bitmaps_png/cpp_26/duplicate_text.cpp b/bitmaps_png/cpp_26/duplicate_text.cpp new file mode 100644 index 0000000000..a231825612 --- /dev/null +++ b/bitmaps_png/cpp_26/duplicate_text.cpp @@ -0,0 +1,40 @@ + +/* Do not modify this file, it was automatically generated by the + * PNG2cpp CMake script, using a *.png file as input. + */ + +#include + +static const unsigned char png[] = { + 0x89, 0x50, 0x4e, 0x47, 0x0d, 0x0a, 0x1a, 0x0a, 0x00, 0x00, 0x00, 0x0d, 0x49, 0x48, 0x44, 0x52, + 0x00, 0x00, 0x00, 0x1a, 0x00, 0x00, 0x00, 0x1a, 0x08, 0x06, 0x00, 0x00, 0x00, 0xa9, 0x4a, 0x4c, + 0xce, 0x00, 0x00, 0x01, 0x6e, 0x49, 0x44, 0x41, 0x54, 0x48, 0xc7, 0x63, 0xf8, 0xff, 0xff, 0x3f, + 0x03, 0x3d, 0x30, 0x84, 0x60, 0x98, 0xfd, 0x9f, 0x54, 0xbc, 0x98, 0x81, 0x41, 0x65, 0x19, 0x03, + 0x83, 0x3d, 0x90, 0xd6, 0x5f, 0xc5, 0xc0, 0xc0, 0x49, 0x75, 0x8b, 0x0c, 0x18, 0xf2, 0xfe, 0xb7, + 0x31, 0x29, 0xfd, 0x5f, 0x02, 0xd4, 0xba, 0x94, 0x81, 0xe1, 0xdf, 0x6a, 0x16, 0x96, 0xaf, 0x2b, + 0x98, 0x98, 0x6e, 0x00, 0x2d, 0x94, 0x24, 0xc5, 0xa2, 0x06, 0xb8, 0x04, 0x92, 0xe1, 0x48, 0x62, + 0x0d, 0x91, 0x4c, 0x5e, 0xff, 0x2b, 0x98, 0x0c, 0xfe, 0x03, 0x0d, 0x9f, 0xb1, 0x92, 0x89, 0xe9, + 0xd2, 0x2a, 0x16, 0x96, 0xef, 0x87, 0x05, 0x05, 0x7f, 0x2f, 0x63, 0x64, 0x7c, 0x39, 0x97, 0x81, + 0x81, 0x97, 0x18, 0x8b, 0x1a, 0x50, 0x24, 0xb0, 0x58, 0x04, 0xb3, 0x0c, 0x59, 0x0c, 0x68, 0xe1, + 0xb4, 0x7d, 0xfc, 0xfc, 0x5f, 0x77, 0xf3, 0xf0, 0x7c, 0x5d, 0xc6, 0xc4, 0x54, 0x8d, 0xd7, 0x22, + 0xac, 0x12, 0x38, 0x2c, 0x42, 0xc7, 0xc0, 0x20, 0xe4, 0x03, 0xfa, 0xe6, 0xfb, 0x3d, 0x05, 0x85, + 0xff, 0xcb, 0x99, 0x98, 0x3e, 0x02, 0x83, 0xd3, 0x0b, 0x28, 0xd6, 0x3f, 0x9f, 0x81, 0x41, 0x80, + 0xaa, 0x16, 0x81, 0xe2, 0x66, 0x39, 0x23, 0xe3, 0xb5, 0x2b, 0x52, 0x52, 0xff, 0xf7, 0xf2, 0xf2, + 0x7e, 0x03, 0xfa, 0xf0, 0xd7, 0x4a, 0x66, 0xe6, 0xc3, 0x54, 0xf5, 0x11, 0xd0, 0xe5, 0xce, 0x40, + 0x1f, 0x7c, 0x5f, 0xcd, 0xcc, 0xfc, 0xfb, 0x8e, 0xbc, 0xfc, 0xff, 0xf7, 0x9a, 0x9a, 0xff, 0x37, + 0xb1, 0xb3, 0x7f, 0x02, 0x5a, 0xee, 0x47, 0x8b, 0xa0, 0xd3, 0x02, 0x06, 0xd9, 0xf5, 0xed, 0x5c, + 0x5c, 0x5f, 0x6e, 0xcb, 0xc9, 0x81, 0x82, 0xef, 0x0d, 0x30, 0xb9, 0x33, 0x53, 0xdd, 0x22, 0x10, + 0x9e, 0xc9, 0xc0, 0xc0, 0x0a, 0x4c, 0x08, 0xed, 0x40, 0x4b, 0xff, 0x2e, 0x65, 0x62, 0x6a, 0xa0, + 0x49, 0x62, 0x40, 0xc6, 0x8b, 0x18, 0x18, 0xcc, 0x71, 0xe5, 0x27, 0x92, 0x2d, 0x02, 0xf2, 0x37, + 0x93, 0x8a, 0x07, 0xd6, 0x22, 0xa0, 0x84, 0x03, 0x10, 0x1f, 0x40, 0x2b, 0x7a, 0x40, 0x7c, 0x07, + 0x54, 0x8b, 0xe6, 0x44, 0x61, 0xb3, 0x1c, 0x21, 0x36, 0x27, 0x8a, 0x90, 0x45, 0x38, 0xcb, 0x39, + 0x84, 0xa1, 0x08, 0x4b, 0x70, 0x59, 0x84, 0x6c, 0x19, 0xde, 0xa0, 0x23, 0xa9, 0x0a, 0xc0, 0x61, + 0x11, 0x51, 0x89, 0x61, 0xd4, 0xa2, 0x51, 0x8b, 0x46, 0xb8, 0x45, 0x0c, 0x0c, 0x33, 0x75, 0x81, + 0x86, 0xb7, 0xa3, 0x15, 0x39, 0xed, 0x20, 0x71, 0x2a, 0x5b, 0x84, 0xbf, 0x7c, 0xa3, 0x7a, 0xd0, + 0x11, 0x83, 0x01, 0xfa, 0xc4, 0x94, 0x7d, 0x09, 0xb7, 0x71, 0x10, 0x00, 0x00, 0x00, 0x00, 0x49, + 0x45, 0x4e, 0x44, 0xae, 0x42, 0x60, 0x82, +}; + +const BITMAP_OPAQUE duplicate_text_xpm[1] = {{ png, sizeof( png ), "duplicate_text_xpm" }}; + +//EOF diff --git a/bitmaps_png/cpp_26/duplicate_zone.cpp b/bitmaps_png/cpp_26/duplicate_zone.cpp new file mode 100644 index 0000000000..a49ffcd039 --- /dev/null +++ b/bitmaps_png/cpp_26/duplicate_zone.cpp @@ -0,0 +1,63 @@ + +/* Do not modify this file, it was automatically generated by the + * PNG2cpp CMake script, using a *.png file as input. + */ + +#include + +static const unsigned char png[] = { + 0x89, 0x50, 0x4e, 0x47, 0x0d, 0x0a, 0x1a, 0x0a, 0x00, 0x00, 0x00, 0x0d, 0x49, 0x48, 0x44, 0x52, + 0x00, 0x00, 0x00, 0x1a, 0x00, 0x00, 0x00, 0x1a, 0x08, 0x06, 0x00, 0x00, 0x00, 0xa9, 0x4a, 0x4c, + 0xce, 0x00, 0x00, 0x02, 0xde, 0x49, 0x44, 0x41, 0x54, 0x48, 0xc7, 0xbd, 0x94, 0x5d, 0x48, 0x14, + 0x51, 0x14, 0xc7, 0xcf, 0xce, 0x8c, 0x48, 0xe2, 0x47, 0x42, 0x09, 0xfa, 0xa0, 0x46, 0xbd, 0xd8, + 0x4b, 0xbd, 0x05, 0x51, 0x46, 0x4a, 0x06, 0x3e, 0x54, 0x2f, 0x41, 0x21, 0x14, 0xf4, 0x18, 0x61, + 0x3e, 0x04, 0x69, 0x5f, 0xde, 0xd5, 0x9d, 0x9d, 0x3b, 0xe3, 0x6a, 0x48, 0x91, 0x59, 0x44, 0xe5, + 0xc7, 0x6e, 0x7e, 0xa4, 0x68, 0x45, 0xa5, 0xe8, 0x3e, 0xf8, 0x16, 0xf4, 0x60, 0x49, 0x09, 0x9a, + 0x0f, 0x11, 0x84, 0x21, 0x6a, 0xe2, 0x2a, 0x69, 0xeb, 0xed, 0x3f, 0xeb, 0x20, 0xeb, 0x92, 0xb9, + 0xee, 0x68, 0x0f, 0xff, 0x39, 0x73, 0xef, 0x3d, 0x73, 0x7f, 0x73, 0xce, 0x3d, 0xf7, 0x90, 0x10, + 0x82, 0xfe, 0x87, 0x96, 0x1f, 0x4e, 0xfa, 0x4d, 0x8c, 0x44, 0x54, 0x82, 0x6f, 0xec, 0xa0, 0xe5, + 0x4d, 0x46, 0xb1, 0xc9, 0x18, 0xec, 0x14, 0x14, 0xb0, 0xec, 0xd7, 0xd0, 0xfc, 0x6a, 0x09, 0xbb, + 0xa0, 0xef, 0x50, 0x10, 0xb0, 0x69, 0xd8, 0xa1, 0x90, 0x75, 0xd2, 0x12, 0xde, 0x7f, 0x58, 0x3f, + 0xb0, 0x0a, 0xd4, 0x48, 0xb4, 0xc7, 0x4b, 0x74, 0x04, 0x76, 0x5f, 0x2b, 0xd1, 0xb6, 0x8d, 0x80, + 0x82, 0xd0, 0x1d, 0xb7, 0xc7, 0x7d, 0x8a, 0xeb, 0x6a, 0x8f, 0xae, 0xab, 0x47, 0x31, 0xd6, 0x2c, + 0x98, 0xb9, 0xbe, 0x44, 0xe5, 0xf4, 0x65, 0x7f, 0x11, 0x89, 0x16, 0x59, 0x7e, 0xd7, 0x84, 0x4f, + 0x9b, 0x89, 0x96, 0xda, 0x14, 0x25, 0xf0, 0x4c, 0x92, 0x86, 0x01, 0x4c, 0x8f, 0x0e, 0x84, 0x08, + 0x34, 0x43, 0x3b, 0x5d, 0x55, 0xcd, 0x45, 0x47, 0x67, 0x9b, 0x30, 0x3c, 0x9a, 0xe0, 0x1e, 0x57, + 0xee, 0x8a, 0x23, 0xa3, 0x19, 0x68, 0xfa, 0x6c, 0xae, 0x24, 0x5a, 0x65, 0xf9, 0x25, 0x36, 0xbf, + 0xdf, 0x22, 0x49, 0x1f, 0x5a, 0x15, 0x65, 0x7e, 0x20, 0x35, 0x75, 0xd1, 0xeb, 0x70, 0x8c, 0x3f, + 0x22, 0x4a, 0x8a, 0x26, 0xa2, 0x8f, 0xba, 0x47, 0x1b, 0xe8, 0xea, 0xee, 0x14, 0x93, 0x93, 0x13, + 0xc2, 0xeb, 0x6b, 0x14, 0xdc, 0x50, 0x57, 0xb4, 0x93, 0xed, 0x78, 0x08, 0x9f, 0xc5, 0xc8, 0x33, + 0x02, 0xf0, 0x5e, 0x7f, 0x4a, 0x4a, 0xa0, 0x37, 0x31, 0x31, 0xe0, 0x95, 0xa4, 0xeb, 0x31, 0x47, + 0x84, 0xb5, 0x64, 0xa4, 0x72, 0xc4, 0x65, 0x54, 0xf8, 0xad, 0xf4, 0xae, 0x02, 0x21, 0x85, 0xc9, + 0x88, 0x66, 0x7e, 0x2c, 0x3b, 0x5b, 0xf8, 0x24, 0xe9, 0x27, 0xd2, 0x59, 0x88, 0xb9, 0xdb, 0x8f, + 0x89, 0xb6, 0x6f, 0xe4, 0x8c, 0x5e, 0x99, 0x6b, 0x05, 0x6a, 0x9e, 0x0b, 0x51, 0x05, 0x15, 0xa6, + 0xf4, 0x45, 0x82, 0xcc, 0xb3, 0xf1, 0x39, 0x1c, 0x9f, 0x86, 0x32, 0x32, 0x44, 0x5f, 0x52, 0xd2, + 0x1c, 0x22, 0x5c, 0xc0, 0x19, 0x0e, 0xac, 0x5f, 0x75, 0x2c, 0x54, 0x75, 0x83, 0xd0, 0x2f, 0x6b, + 0x6c, 0xda, 0x41, 0x80, 0x26, 0x2f, 0xf3, 0x4b, 0x3e, 0x44, 0x3e, 0x1c, 0x16, 0x4d, 0x3e, 0x22, + 0x98, 0x6f, 0x93, 0xe5, 0xc5, 0xd1, 0xac, 0x2c, 0x31, 0x95, 0x93, 0x23, 0xba, 0xe3, 0xe3, 0x67, + 0x00, 0x3f, 0x11, 0xed, 0x3d, 0x9a, 0x85, 0xc6, 0xad, 0x72, 0xfe, 0x66, 0x56, 0xde, 0x0d, 0xbd, + 0xd4, 0x00, 0x6c, 0x2e, 0x72, 0x03, 0xc0, 0xf6, 0x22, 0x65, 0x9f, 0x5f, 0x27, 0x24, 0xcc, 0x8e, + 0x64, 0x66, 0x9a, 0xe9, 0x9b, 0x40, 0xb9, 0xcb, 0xff, 0x06, 0xad, 0xad, 0x05, 0x89, 0x49, 0x4f, + 0x34, 0x43, 0xad, 0x63, 0x8c, 0x29, 0x91, 0x9b, 0xd4, 0x13, 0xc5, 0xa1, 0x10, 0x34, 0x40, 0x83, + 0xcd, 0x92, 0xc4, 0xec, 0xb6, 0xa0, 0xf7, 0xeb, 0x5d, 0xca, 0x06, 0xa2, 0x03, 0x6b, 0xdd, 0xa7, + 0xd8, 0x1a, 0x24, 0xa3, 0x76, 0xc8, 0x1f, 0xa5, 0xda, 0xed, 0x80, 0xcc, 0x0d, 0x4a, 0xa1, 0x6b, + 0x50, 0x0d, 0x3a, 0x46, 0x7d, 0xc8, 0x32, 0xba, 0x65, 0xcd, 0x87, 0xcb, 0x6f, 0x0f, 0x54, 0x4e, + 0x2a, 0x6c, 0x27, 0x54, 0x0b, 0x95, 0x58, 0xd6, 0xbc, 0x0e, 0x3c, 0xf4, 0x03, 0x4e, 0x2a, 0xdb, + 0x1c, 0x90, 0x09, 0x71, 0x52, 0x7e, 0x65, 0x55, 0xe5, 0x2e, 0x5d, 0xd7, 0x8a, 0x74, 0x9d, 0x65, + 0x60, 0xee, 0x90, 0x05, 0xeb, 0x85, 0xba, 0x2d, 0x98, 0x6d, 0x50, 0xad, 0x61, 0x18, 0xbb, 0x8d, + 0x6a, 0xde, 0x83, 0x4e, 0xf2, 0x56, 0xf7, 0xb8, 0x7b, 0x54, 0x55, 0x4d, 0x0f, 0xf3, 0xb9, 0x6b, + 0x45, 0x69, 0x1b, 0x54, 0x62, 0x54, 0x6b, 0x17, 0xba, 0x5e, 0x74, 0xf4, 0xa3, 0x37, 0xfa, 0xd1, + 0x1b, 0xfd, 0xdc, 0x70, 0x2f, 0xab, 0x4a, 0x7d, 0x93, 0xe6, 0x4c, 0x3b, 0x0e, 0x9f, 0x96, 0x2d, + 0x8b, 0x08, 0x65, 0x11, 0x87, 0xf6, 0x75, 0xd5, 0xe5, 0x71, 0x9e, 0x87, 0xcf, 0xf3, 0xad, 0x3a, + 0xa3, 0x33, 0x50, 0x7f, 0x01, 0xcf, 0x3b, 0x88, 0x2e, 0xd2, 0x2e, 0x33, 0xf9, 0xdc, 0x66, 0x57, + 0x5d, 0x31, 0xf4, 0xd4, 0x82, 0x37, 0x98, 0x63, 0xce, 0xd5, 0x9a, 0x62, 0x5e, 0x7c, 0x12, 0xef, + 0x57, 0x36, 0xef, 0x1e, 0x31, 0xaa, 0x0b, 0x95, 0xb5, 0x59, 0x65, 0xe5, 0x78, 0xa2, 0xf2, 0x6e, + 0x1a, 0x65, 0x87, 0xb9, 0xee, 0x7a, 0x60, 0xb7, 0x33, 0xf8, 0xff, 0x72, 0x31, 0xc3, 0xd5, 0x84, + 0xb4, 0x15, 0xe2, 0xac, 0x8e, 0xc1, 0xdf, 0xb1, 0xb5, 0x2d, 0xa8, 0x82, 0x2e, 0xda, 0xee, 0x75, + 0xb1, 0xe8, 0x0f, 0xc0, 0x74, 0xed, 0xb7, 0x43, 0x22, 0xa0, 0x6f, 0x00, 0x00, 0x00, 0x00, 0x49, + 0x45, 0x4e, 0x44, 0xae, 0x42, 0x60, 0x82, +}; + +const BITMAP_OPAQUE duplicate_zone_xpm[1] = {{ png, sizeof( png ), "duplicate_zone_xpm" }}; + +//EOF diff --git a/bitmaps_png/cpp_26/move_target.cpp b/bitmaps_png/cpp_26/move_target.cpp new file mode 100644 index 0000000000..7ba8a6e138 --- /dev/null +++ b/bitmaps_png/cpp_26/move_target.cpp @@ -0,0 +1,67 @@ + +/* Do not modify this file, it was automatically generated by the + * PNG2cpp CMake script, using a *.png file as input. + */ + +#include + +static const unsigned char png[] = { + 0x89, 0x50, 0x4e, 0x47, 0x0d, 0x0a, 0x1a, 0x0a, 0x00, 0x00, 0x00, 0x0d, 0x49, 0x48, 0x44, 0x52, + 0x00, 0x00, 0x00, 0x1a, 0x00, 0x00, 0x00, 0x1a, 0x08, 0x06, 0x00, 0x00, 0x00, 0xa9, 0x4a, 0x4c, + 0xce, 0x00, 0x00, 0x03, 0x21, 0x49, 0x44, 0x41, 0x54, 0x48, 0xc7, 0xbd, 0x94, 0x4b, 0x4c, 0x13, + 0x51, 0x14, 0x86, 0x6f, 0xdb, 0x81, 0x96, 0xb6, 0xd8, 0x97, 0x7d, 0x4c, 0xa7, 0x9d, 0x3e, 0x10, + 0x6c, 0x30, 0x02, 0x0b, 0x7c, 0xe0, 0x13, 0xad, 0xb4, 0x18, 0x4c, 0x04, 0x12, 0xa5, 0xc4, 0x85, + 0x21, 0xb8, 0x75, 0x67, 0x5c, 0xb0, 0x76, 0x6f, 0x5c, 0xf9, 0x88, 0x89, 0xc1, 0x40, 0x81, 0xc6, + 0x40, 0x14, 0x62, 0x5c, 0x01, 0x01, 0x0c, 0x0b, 0x13, 0x62, 0x10, 0x0d, 0x89, 0xdd, 0xb8, 0x37, + 0x90, 0xa0, 0x96, 0x87, 0x8d, 0xc7, 0xfb, 0x8f, 0x14, 0x8b, 0xb1, 0xb1, 0xa5, 0xc8, 0x24, 0x7f, + 0x32, 0x3d, 0x9d, 0x3b, 0xdf, 0x3d, 0xe7, 0xff, 0xef, 0x30, 0x22, 0x62, 0x7b, 0xa1, 0x7f, 0x3f, + 0xc0, 0xd8, 0x65, 0xae, 0xe1, 0xbd, 0x00, 0xc5, 0xb8, 0x26, 0xff, 0x1b, 0x88, 0x5f, 0x36, 0xae, + 0xae, 0x12, 0x81, 0x4d, 0x6b, 0xd4, 0x6c, 0x99, 0xdf, 0xf7, 0x70, 0xd5, 0xef, 0x2a, 0x88, 0x5f, + 0x4d, 0xda, 0x12, 0xb6, 0xec, 0xf7, 0x6a, 0x37, 0x24, 0xc9, 0x41, 0x55, 0x41, 0x03, 0xdd, 0x88, + 0xb9, 0xd6, 0xcb, 0x74, 0xaa, 0x35, 0x5e, 0xbf, 0xc7, 0xff, 0xd7, 0x16, 0x0d, 0x02, 0x44, 0xa7, + 0x55, 0xaf, 0x57, 0x04, 0x25, 0xf2, 0xf9, 0x7c, 0x14, 0x0c, 0x06, 0xe8, 0x5c, 0x83, 0x95, 0x36, + 0x16, 0x6b, 0xe8, 0xd3, 0x4c, 0x2d, 0x9d, 0x39, 0x66, 0x4a, 0xe9, 0x75, 0xec, 0x55, 0x51, 0x20, + 0x8c, 0xab, 0x54, 0x60, 0x2b, 0x07, 0x2a, 0x7c, 0x64, 0x30, 0xe8, 0x51, 0x20, 0xbf, 0xdf, 0x4f, + 0xe1, 0x13, 0x56, 0xfa, 0xfe, 0xc1, 0x47, 0xe9, 0x05, 0x33, 0x2d, 0xcd, 0xd5, 0x92, 0x68, 0x17, + 0x56, 0x35, 0x1a, 0xd6, 0x5d, 0x0c, 0xa8, 0xcb, 0x69, 0xd7, 0xa5, 0x65, 0xd9, 0xab, 0x40, 0xb6, + 0x40, 0x27, 0x33, 0x20, 0x13, 0xa5, 0xdf, 0x3b, 0x69, 0xe4, 0x41, 0x25, 0xed, 0x33, 0xaa, 0x92, + 0x05, 0x83, 0x36, 0x23, 0x1c, 0xe3, 0xc6, 0xbf, 0x76, 0xb9, 0xec, 0x14, 0x08, 0x04, 0x14, 0x00, + 0x24, 0x8a, 0x22, 0x1d, 0x0e, 0x19, 0x69, 0xe4, 0x61, 0x35, 0x07, 0x84, 0x14, 0xf5, 0xdd, 0xad, + 0x26, 0xb5, 0x5a, 0xf5, 0x83, 0xaf, 0xb9, 0xbe, 0x99, 0x4a, 0x39, 0x5f, 0xd0, 0x30, 0x22, 0x8c, + 0x74, 0x55, 0x72, 0xe3, 0xcf, 0x1e, 0xb5, 0x6e, 0x29, 0x54, 0x61, 0x24, 0x6d, 0xa9, 0x40, 0xa2, + 0xcb, 0xfc, 0x5b, 0x4e, 0x33, 0xa9, 0x54, 0x2a, 0x2c, 0x9c, 0xc5, 0x3a, 0xae, 0xf3, 0x85, 0x8e, + 0xae, 0xa7, 0xbb, 0xc3, 0xb9, 0xbe, 0xb1, 0x58, 0xa7, 0x8c, 0x0a, 0x7a, 0x76, 0xbf, 0x9a, 0x4c, + 0x26, 0x13, 0x79, 0xbd, 0x5e, 0xb2, 0x58, 0x2c, 0x64, 0xb3, 0x71, 0x78, 0x28, 0x44, 0x82, 0xc0, + 0x56, 0x8b, 0xf1, 0xa8, 0x1e, 0x11, 0x46, 0xba, 0xd2, 0x0b, 0x16, 0xc5, 0x13, 0x8c, 0xca, 0x6c, + 0x36, 0x29, 0x10, 0x78, 0x26, 0x49, 0x12, 0x19, 0x8d, 0x7a, 0xd2, 0x6b, 0xd9, 0x48, 0x66, 0x5d, + 0x34, 0x2e, 0x1f, 0xba, 0x38, 0xe8, 0xbe, 0x59, 0x50, 0xbc, 0x71, 0x4e, 0x4e, 0x1f, 0x31, 0xa4, + 0x96, 0xe6, 0xea, 0xb8, 0xf1, 0x0e, 0x05, 0xb4, 0xdf, 0x66, 0x22, 0xab, 0xd5, 0x4a, 0x2e, 0x97, + 0x93, 0x3c, 0x1e, 0x89, 0x04, 0x0d, 0x4b, 0x21, 0xa1, 0x78, 0xbe, 0x39, 0xee, 0xa9, 0x69, 0x19, + 0x95, 0x92, 0xad, 0xe3, 0xde, 0xcf, 0x91, 0x21, 0xf7, 0xad, 0x42, 0xce, 0x91, 0x16, 0xe7, 0x04, + 0x11, 0x46, 0xba, 0x60, 0xbc, 0xc3, 0x6e, 0xe2, 0xe3, 0x3a, 0x48, 0xe5, 0xe5, 0x06, 0x8c, 0xec, + 0x2b, 0x7f, 0xe6, 0x14, 0x9e, 0x6d, 0xea, 0x97, 0xea, 0x5a, 0x46, 0x3d, 0xc9, 0xce, 0x77, 0x01, + 0xea, 0x5c, 0x08, 0x50, 0xeb, 0x44, 0x6e, 0x58, 0xce, 0x56, 0x71, 0x4e, 0x10, 0x61, 0xa4, 0x0b, + 0xc6, 0x97, 0x96, 0xb0, 0x2f, 0xc6, 0x32, 0x36, 0x94, 0xe9, 0xa4, 0x31, 0x61, 0x37, 0x46, 0xe2, + 0xe2, 0xa3, 0xe6, 0x84, 0x38, 0xd9, 0x3e, 0xe3, 0x5b, 0x8b, 0x71, 0x58, 0x74, 0xc8, 0xfd, 0x31, + 0x3a, 0xe0, 0x7e, 0x1e, 0xee, 0x95, 0xaa, 0x76, 0xf2, 0x51, 0x45, 0x84, 0x67, 0xb3, 0x6b, 0xe8, + 0x04, 0x10, 0xdc, 0x5f, 0x78, 0xe2, 0x3c, 0xde, 0x36, 0x2d, 0x7f, 0x8b, 0xcd, 0x07, 0xa8, 0x39, + 0xe1, 0x7e, 0x8c, 0x5a, 0xa4, 0x5f, 0xbc, 0xc6, 0xa1, 0xb7, 0x8b, 0xfa, 0x7a, 0xff, 0xf2, 0xc4, + 0x93, 0x44, 0x27, 0x80, 0x84, 0x9f, 0x3a, 0xbb, 0x33, 0xa0, 0xc8, 0xa0, 0xeb, 0x05, 0x6a, 0x91, + 0x3e, 0xf1, 0xce, 0xa5, 0x31, 0x69, 0x25, 0x7b, 0x8c, 0xf9, 0x80, 0xe4, 0xcc, 0x39, 0x41, 0xba, + 0x60, 0x3c, 0x3c, 0xc1, 0xb8, 0x00, 0x80, 0x3a, 0xe6, 0xfc, 0x8a, 0x47, 0xed, 0x53, 0xf2, 0xaa, + 0x52, 0x9b, 0x92, 0x53, 0x1d, 0x6f, 0xfd, 0xdb, 0x3c, 0x2b, 0xe8, 0xc3, 0x88, 0x08, 0x23, 0x5d, + 0x78, 0x29, 0x3c, 0x41, 0x17, 0x10, 0x7e, 0x2b, 0xb5, 0xf9, 0xed, 0xb5, 0xab, 0x6f, 0x7c, 0xe9, + 0x68, 0x42, 0x7c, 0x59, 0x30, 0x48, 0x99, 0x3f, 0xdf, 0x21, 0x76, 0x0a, 0xe3, 0xe1, 0x09, 0xc6, + 0x85, 0x4e, 0xf0, 0xf2, 0x68, 0x5c, 0x5c, 0x44, 0x2d, 0x3a, 0x20, 0x4e, 0xb5, 0x4d, 0x7a, 0xd3, + 0xfc, 0x7e, 0xac, 0x71, 0x82, 0x09, 0x3b, 0x02, 0x65, 0x60, 0x48, 0x57, 0xae, 0x30, 0x44, 0xe3, + 0xee, 0x2e, 0xbe, 0x91, 0xf1, 0x2b, 0x09, 0xa6, 0xc9, 0xdb, 0xa3, 0x5c, 0x42, 0x84, 0x91, 0x2e, + 0x18, 0x0f, 0x4f, 0x94, 0x8e, 0x78, 0x27, 0x80, 0x84, 0x7b, 0x1d, 0x0d, 0xd9, 0x90, 0xa2, 0x40, + 0xca, 0xce, 0x79, 0x84, 0x91, 0x2e, 0x18, 0x0f, 0x4f, 0x30, 0xae, 0x3f, 0x3b, 0xd9, 0x15, 0x50, + 0xb6, 0x67, 0x30, 0x1e, 0x9e, 0xfc, 0x0d, 0xb2, 0x2b, 0xa0, 0x2d, 0xcf, 0x78, 0xba, 0x32, 0xc6, + 0xff, 0x37, 0x50, 0x3e, 0xfa, 0x09, 0x65, 0x16, 0x60, 0xbf, 0x0d, 0xb1, 0xac, 0x3b, 0x00, 0x00, + 0x00, 0x00, 0x49, 0x45, 0x4e, 0x44, 0xae, 0x42, 0x60, 0x82, +}; + +const BITMAP_OPAQUE move_target_xpm[1] = {{ png, sizeof( png ), "move_target_xpm" }}; + +//EOF diff --git a/bitmaps_png/cpp_26/move_zone.cpp b/bitmaps_png/cpp_26/move_zone.cpp new file mode 100644 index 0000000000..dd00c175f2 --- /dev/null +++ b/bitmaps_png/cpp_26/move_zone.cpp @@ -0,0 +1,62 @@ + +/* Do not modify this file, it was automatically generated by the + * PNG2cpp CMake script, using a *.png file as input. + */ + +#include + +static const unsigned char png[] = { + 0x89, 0x50, 0x4e, 0x47, 0x0d, 0x0a, 0x1a, 0x0a, 0x00, 0x00, 0x00, 0x0d, 0x49, 0x48, 0x44, 0x52, + 0x00, 0x00, 0x00, 0x1a, 0x00, 0x00, 0x00, 0x1a, 0x08, 0x06, 0x00, 0x00, 0x00, 0xa9, 0x4a, 0x4c, + 0xce, 0x00, 0x00, 0x02, 0xcf, 0x49, 0x44, 0x41, 0x54, 0x48, 0xc7, 0xbd, 0x95, 0xcb, 0x4f, 0x13, + 0x51, 0x14, 0xc6, 0x6f, 0xa2, 0x74, 0xd1, 0x44, 0x8c, 0x1b, 0x71, 0xa6, 0x50, 0x68, 0x54, 0x8c, + 0xb2, 0x70, 0xa1, 0x46, 0xdc, 0x35, 0xa9, 0x76, 0x30, 0x43, 0x42, 0x21, 0xe1, 0x15, 0x56, 0x4d, + 0x17, 0xd6, 0x08, 0xb2, 0x31, 0x04, 0x31, 0xd8, 0x19, 0xe2, 0x3f, 0x60, 0x7c, 0x2c, 0x94, 0x68, + 0x6b, 0xa0, 0x85, 0x06, 0x5f, 0x05, 0x4d, 0x11, 0xd3, 0xd6, 0xc2, 0x46, 0x4c, 0x8c, 0x01, 0x8d, + 0x24, 0xa2, 0xae, 0x74, 0x85, 0x1b, 0x12, 0x10, 0x23, 0xc9, 0xf8, 0x9d, 0xe1, 0x42, 0x0a, 0x42, + 0xd2, 0x99, 0x41, 0x17, 0xbf, 0xde, 0x3b, 0xa7, 0x33, 0xe7, 0xbb, 0xe7, 0x7c, 0x67, 0x5a, 0xa6, + 0x69, 0x1a, 0xfb, 0x1f, 0xac, 0x7c, 0x28, 0x4c, 0x64, 0x2a, 0x3b, 0x6f, 0x18, 0x85, 0x05, 0x41, + 0x61, 0xfe, 0x42, 0x2b, 0x0f, 0x8d, 0x81, 0xc7, 0x06, 0x19, 0x07, 0x6e, 0xa3, 0x42, 0xf4, 0x60, + 0x78, 0x8d, 0x10, 0x7b, 0x88, 0xb5, 0x6f, 0x5d, 0xec, 0x6f, 0x92, 0x56, 0x84, 0x5e, 0x82, 0x41, + 0x70, 0x11, 0xdc, 0xe4, 0x95, 0xc6, 0xb7, 0x5b, 0x68, 0xcc, 0xae, 0xda, 0x6b, 0x54, 0x55, 0xf5, + 0x2b, 0x8a, 0x32, 0x09, 0xee, 0xb6, 0x2a, 0xad, 0xc7, 0x11, 0x1f, 0xe6, 0x07, 0x20, 0xd1, 0x51, + 0xab, 0x42, 0x94, 0x2c, 0x8c, 0xe4, 0x41, 0xa0, 0x81, 0x79, 0xbe, 0xfe, 0x90, 0x3b, 0xe5, 0x3d, + 0xac, 0x87, 0x9d, 0xc4, 0xf7, 0x95, 0xb8, 0xb7, 0x1d, 0xeb, 0x33, 0x2b, 0x42, 0xe3, 0x58, 0xeb, + 0x91, 0x78, 0x06, 0x7c, 0x03, 0xf6, 0x1c, 0xd1, 0xdf, 0x60, 0x09, 0x2c, 0x80, 0x03, 0x5c, 0xc0, + 0xa4, 0x50, 0x88, 0xa5, 0xb1, 0x9e, 0x43, 0xa2, 0x31, 0xb0, 0x88, 0xf6, 0x9d, 0xc1, 0x7a, 0x8f, + 0x0b, 0x65, 0xc0, 0x23, 0xbe, 0xbf, 0x85, 0xfb, 0xfc, 0xbc, 0x03, 0xa6, 0x2a, 0x7a, 0x02, 0x12, + 0x10, 0xf0, 0x20, 0xd9, 0x2f, 0x9e, 0x94, 0x98, 0xb4, 0x75, 0xd8, 0x0e, 0xb3, 0xcb, 0xac, 0x1c, + 0xfb, 0x09, 0x3a, 0x44, 0x57, 0x57, 0x57, 0x11, 0x9e, 0x49, 0x5a, 0x19, 0x86, 0x04, 0xb8, 0xde, + 0xae, 0xb4, 0x3b, 0x91, 0xf0, 0x2a, 0xf0, 0x15, 0x74, 0x17, 0x1c, 0x45, 0xec, 0x15, 0x18, 0xc2, + 0x21, 0x6a, 0xb8, 0xb8, 0x8a, 0xeb, 0x56, 0xf0, 0xda, 0xfc, 0x78, 0xab, 0x6c, 0x08, 0xeb, 0x0b, + 0x30, 0xc0, 0xdb, 0x43, 0x93, 0x16, 0x01, 0x29, 0x9b, 0x62, 0x3b, 0x02, 0x91, 0x8f, 0x60, 0xae, + 0x45, 0x69, 0x29, 0x44, 0xec, 0x0b, 0x09, 0x49, 0x51, 0x67, 0xc5, 0xd9, 0x01, 0xb1, 0xcd, 0xdc, + 0x0b, 0xbb, 0x91, 0x10, 0xeb, 0xc7, 0x7d, 0x51, 0x54, 0x15, 0xa0, 0xaa, 0xb0, 0xb6, 0xe1, 0xfa, + 0xc2, 0xa1, 0xdb, 0xbb, 0xeb, 0xe5, 0x61, 0xc7, 0xac, 0x2f, 0x55, 0x32, 0xe7, 0x1d, 0x14, 0x2f, + 0x59, 0x17, 0x5a, 0x21, 0xed, 0x50, 0x1c, 0xe4, 0xd5, 0x77, 0xf0, 0x55, 0xee, 0xdf, 0x7f, 0x4c, + 0x1e, 0x2e, 0x9e, 0x6d, 0x9e, 0x76, 0x69, 0xcd, 0xef, 0x5d, 0x9a, 0x2f, 0xbd, 0xb5, 0x98, 0x31, + 0xa1, 0x10, 0x8b, 0xf1, 0x77, 0xad, 0xb3, 0xbb, 0xe7, 0x8a, 0xe6, 0x0b, 0x57, 0x8c, 0x56, 0xc5, + 0x85, 0x4c, 0xdd, 0x44, 0xe9, 0x52, 0x13, 0xc4, 0xa4, 0x41, 0xf1, 0x93, 0x14, 0x13, 0x9f, 0x7a, + 0x22, 0x8e, 0xf2, 0xad, 0x7e, 0xbd, 0x83, 0xfc, 0x07, 0x32, 0x99, 0x07, 0x1f, 0xdc, 0x77, 0x0e, + 0x56, 0x37, 0xf4, 0x9e, 0x98, 0xa6, 0x77, 0xea, 0xf4, 0xfd, 0xa2, 0xca, 0xda, 0x71, 0xe7, 0x42, + 0xd3, 0x94, 0x4b, 0xab, 0x8a, 0x8b, 0xbd, 0x94, 0xcf, 0xdb, 0x2f, 0xb4, 0x40, 0xb4, 0x63, 0x33, + 0x21, 0x32, 0xd6, 0x9d, 0x0f, 0xae, 0x1b, 0xbb, 0x02, 0x72, 0xa2, 0xf8, 0x33, 0x55, 0x42, 0x22, + 0x9e, 0x07, 0x45, 0x81, 0x55, 0x21, 0xef, 0xc0, 0xbe, 0x04, 0xc5, 0xbc, 0x7d, 0xc2, 0xb5, 0xea, + 0x11, 0xc7, 0x7c, 0x6e, 0x1b, 0x0d, 0xfd, 0x79, 0xd1, 0x74, 0x91, 0xf1, 0xe4, 0x09, 0xb5, 0x8b, + 0x04, 0x88, 0xc6, 0xb7, 0x65, 0xba, 0x47, 0x75, 0x59, 0xe7, 0x4f, 0x3d, 0x96, 0x75, 0x2e, 0x36, + 0xbe, 0x2b, 0x5b, 0xe7, 0x99, 0x21, 0x21, 0x1a, 0x61, 0x9a, 0x2e, 0x4a, 0x4a, 0x9e, 0x50, 0x15, + 0x04, 0x5d, 0xeb, 0xb1, 0xa9, 0xf5, 0xb1, 0x86, 0x37, 0xa5, 0xcb, 0x52, 0x5c, 0x78, 0x6e, 0x58, + 0x48, 0xef, 0x3f, 0x4e, 0x48, 0x27, 0x25, 0xe3, 0xc9, 0x13, 0x6a, 0x17, 0x55, 0x42, 0xc9, 0xa5, + 0xa8, 0x30, 0x43, 0x31, 0x29, 0x26, 0x64, 0x6b, 0x33, 0x25, 0xcb, 0xd8, 0x8f, 0xb8, 0xd3, 0x6c, + 0xa7, 0x29, 0xa1, 0x55, 0x31, 0x9a, 0x2e, 0xda, 0x6f, 0x36, 0x0c, 0x52, 0x54, 0xf4, 0xe3, 0x20, + 0xa9, 0xfa, 0x38, 0xdb, 0x61, 0xca, 0xa3, 0x5c, 0x68, 0x84, 0x69, 0xba, 0xc8, 0x78, 0xf2, 0x44, + 0xaf, 0x08, 0x95, 0x90, 0x88, 0x27, 0xb2, 0xf7, 0x54, 0xae, 0x88, 0x25, 0x21, 0xfd, 0xe4, 0x18, + 0x61, 0x9a, 0x2e, 0x32, 0x9e, 0x3c, 0xa1, 0x76, 0x6d, 0xac, 0x64, 0x5b, 0x84, 0x72, 0x3d, 0x23, + 0xe3, 0xc9, 0x93, 0xcd, 0x44, 0xb6, 0x45, 0x68, 0xcd, 0x33, 0x4c, 0xd7, 0xaa, 0xf1, 0xff, 0x4c, + 0x28, 0x1f, 0xfe, 0x00, 0x7b, 0xdc, 0xc2, 0x19, 0xcd, 0xc3, 0x9e, 0x72, 0x00, 0x00, 0x00, 0x00, + 0x49, 0x45, 0x4e, 0x44, 0xae, 0x42, 0x60, 0x82, +}; + +const BITMAP_OPAQUE move_zone_xpm[1] = {{ png, sizeof( png ), "move_zone_xpm" }}; + +//EOF diff --git a/bitmaps_png/sources/array_line.svg b/bitmaps_png/sources/array_line.svg new file mode 100644 index 0000000000..ba726bf427 --- /dev/null +++ b/bitmaps_png/sources/array_line.svg @@ -0,0 +1,44 @@ + + + + + + + + image/svg+xml + + + + + + + + + + + diff --git a/bitmaps_png/sources/array_module.svg b/bitmaps_png/sources/array_module.svg new file mode 100644 index 0000000000..deea56d3c3 --- /dev/null +++ b/bitmaps_png/sources/array_module.svg @@ -0,0 +1,141 @@ + + + + + + image/svg+xml + + + + + + + + + + + + + + + + + + + + + + diff --git a/bitmaps_png/sources/array_pad.svg b/bitmaps_png/sources/array_pad.svg new file mode 100644 index 0000000000..8d275518ad --- /dev/null +++ b/bitmaps_png/sources/array_pad.svg @@ -0,0 +1,44 @@ + + + + + + + + image/svg+xml + + + + + + + + + + + diff --git a/bitmaps_png/sources/array_target.svg b/bitmaps_png/sources/array_target.svg new file mode 100644 index 0000000000..6ea4156a65 --- /dev/null +++ b/bitmaps_png/sources/array_target.svg @@ -0,0 +1,174 @@ + + + + + + + + image/svg+xml + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/bitmaps_png/sources/array_text.svg b/bitmaps_png/sources/array_text.svg new file mode 100644 index 0000000000..1ef82e6056 --- /dev/null +++ b/bitmaps_png/sources/array_text.svg @@ -0,0 +1,44 @@ + + + + + + + + image/svg+xml + + + + + + + + + + + diff --git a/bitmaps_png/sources/array_zone.svg b/bitmaps_png/sources/array_zone.svg new file mode 100644 index 0000000000..2c11152927 --- /dev/null +++ b/bitmaps_png/sources/array_zone.svg @@ -0,0 +1,161 @@ + + + + + + + + image/svg+xml + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/bitmaps_png/sources/duplicate_line.svg b/bitmaps_png/sources/duplicate_line.svg new file mode 100644 index 0000000000..3f19b6fd2f --- /dev/null +++ b/bitmaps_png/sources/duplicate_line.svg @@ -0,0 +1,95 @@ + + + + + + image/svg+xml + + + + + + + + + + + + + + + + + + + diff --git a/bitmaps_png/sources/duplicate_module.svg b/bitmaps_png/sources/duplicate_module.svg new file mode 100644 index 0000000000..965b12e464 --- /dev/null +++ b/bitmaps_png/sources/duplicate_module.svg @@ -0,0 +1,145 @@ + + + + + + image/svg+xml + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/bitmaps_png/sources/duplicate_pad.svg b/bitmaps_png/sources/duplicate_pad.svg new file mode 100644 index 0000000000..6841fbd5e5 --- /dev/null +++ b/bitmaps_png/sources/duplicate_pad.svg @@ -0,0 +1,70 @@ + + + + + + + + + image/svg+xml + + + + + + + + + + diff --git a/bitmaps_png/sources/duplicate_target.svg b/bitmaps_png/sources/duplicate_target.svg new file mode 100644 index 0000000000..9676b99b16 --- /dev/null +++ b/bitmaps_png/sources/duplicate_target.svg @@ -0,0 +1,164 @@ + + + + + + + + image/svg+xml + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/bitmaps_png/sources/duplicate_text.svg b/bitmaps_png/sources/duplicate_text.svg new file mode 100644 index 0000000000..419b9452f5 --- /dev/null +++ b/bitmaps_png/sources/duplicate_text.svg @@ -0,0 +1,90 @@ + + + + + + image/svg+xml + + + + + + + + + + + + + + + + + diff --git a/bitmaps_png/sources/duplicate_zone.svg b/bitmaps_png/sources/duplicate_zone.svg new file mode 100644 index 0000000000..00417405e1 --- /dev/null +++ b/bitmaps_png/sources/duplicate_zone.svg @@ -0,0 +1,161 @@ + + + + + + + + image/svg+xml + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/bitmaps_png/sources/move_target.svg b/bitmaps_png/sources/move_target.svg new file mode 100644 index 0000000000..71c5b168bb --- /dev/null +++ b/bitmaps_png/sources/move_target.svg @@ -0,0 +1,227 @@ + + + + + + image/svg+xml + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/bitmaps_png/sources/move_zone.svg b/bitmaps_png/sources/move_zone.svg new file mode 100644 index 0000000000..c9adba4dcc --- /dev/null +++ b/bitmaps_png/sources/move_zone.svg @@ -0,0 +1,169 @@ + + + + + + + + image/svg+xml + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/common/base_units.cpp b/common/base_units.cpp index 846c8b0eb3..7cf035c470 100644 --- a/common/base_units.cpp +++ b/common/base_units.cpp @@ -97,6 +97,9 @@ double To_User_Unit( EDA_UNITS_T aUnit, double aValue ) case INCHES: return IU_TO_IN( aValue ); + case DEGREES: + return aValue / 10.0f; + default: return aValue; } @@ -246,6 +249,10 @@ wxString StringFromValue( EDA_UNITS_T aUnit, int aValue, bool aAddUnitSymbol ) stringValue += _( " mm" ); break; + case DEGREES: + stringValue += _( " deg" ); + break; + case UNSCALED_UNITS: break; } @@ -277,6 +284,11 @@ double From_User_Unit( EDA_UNITS_T aUnit, double aValue ) value = IN_TO_IU( aValue ); break; + case DEGREES: + // Convert to "decidegrees" + value = aValue * 10; + break; + default: case UNSCALED_UNITS: value = aValue; @@ -286,7 +298,7 @@ double From_User_Unit( EDA_UNITS_T aUnit, double aValue ) } -int ValueFromString( EDA_UNITS_T aUnits, const wxString& aTextValue ) +double DoubleValueFromString( EDA_UNITS_T aUnits, const wxString& aTextValue ) { double value; double dtmp = 0; @@ -328,22 +340,39 @@ int ValueFromString( EDA_UNITS_T aUnits, const wxString& aTextValue ) // Check the optional unit designator (2 ch significant) wxString unit( buf.Mid( brk_point ).Strip( wxString::leading ).Left( 2 ).Lower() ); - if( unit == wxT( "in" ) || unit == wxT( "\"" ) ) + if( aUnits == INCHES || aUnits == MILLIMETRES ) { - aUnits = INCHES; + if( unit == wxT( "in" ) || unit == wxT( "\"" ) ) + { + aUnits = INCHES; + } + else if( unit == wxT( "mm" ) ) + { + aUnits = MILLIMETRES; + } + else if( unit == wxT( "mi" ) || unit == wxT( "th" ) ) // Mils or thous + { + aUnits = INCHES; + dtmp /= 1000; + } } - else if( unit == wxT( "mm" ) ) + else if( aUnits == DEGREES ) { - aUnits = MILLIMETRES; - } - else if( unit == wxT( "mi" ) || unit == wxT( "th" ) ) // Mils or thous - { - aUnits = INCHES; - dtmp /= 1000; + if( unit == wxT( "ra" ) ) // Radians + { + dtmp *= 180.0f / M_PI; + } } value = From_User_Unit( aUnits, dtmp ); + return value; +} + + +int ValueFromString( EDA_UNITS_T aUnits, const wxString& aTextValue ) +{ + double value = DoubleValueFromString( aUnits, aTextValue ); return KiROUND( value ); } diff --git a/common/block_commande.cpp b/common/block_commande.cpp index 990fa6cee0..73e5223d6c 100644 --- a/common/block_commande.cpp +++ b/common/block_commande.cpp @@ -64,6 +64,7 @@ void BLOCK_SELECTOR::SetMessageBlock( EDA_DRAW_FRAME* frame ) case BLOCK_MOVE: // Move case BLOCK_PRESELECT_MOVE: // Move with preselection list + case BLOCK_MOVE_EXACT: msg = _( "Block Move" ); break; diff --git a/common/class_layer_box_selector.cpp b/common/class_layer_box_selector.cpp index 48e7fe05fb..885479a631 100644 --- a/common/class_layer_box_selector.cpp +++ b/common/class_layer_box_selector.cpp @@ -81,6 +81,8 @@ LAYER_BOX_SELECTOR::LAYER_BOX_SELECTOR( wxWindow* parent, wxWindowID id, { if( choices != NULL ) ResyncBitmapOnly(); + + m_hotkeys = NULL; } diff --git a/common/common.cpp b/common/common.cpp index 51d7b96e25..10fa7f0d00 100644 --- a/common/common.cpp +++ b/common/common.cpp @@ -146,6 +146,10 @@ wxString ReturnUnitSymbol( EDA_UNITS_T aUnit, const wxString& formatString ) case UNSCALED_UNITS: break; + + case DEGREES: + wxASSERT( false ); + break; } if( formatString.IsEmpty() ) @@ -174,6 +178,10 @@ wxString GetUnitsLabel( EDA_UNITS_T aUnit ) case UNSCALED_UNITS: label = _( "units" ); break; + + case DEGREES: + wxASSERT( false ); + break; } return label; @@ -196,6 +204,10 @@ wxString GetAbbreviatedUnitsLabel( EDA_UNITS_T aUnit ) case UNSCALED_UNITS: break; + + case DEGREES: + wxASSERT( false ); + break; } return label; diff --git a/common/common_plotHPGL_functions.cpp b/common/common_plotHPGL_functions.cpp index 553b45dd67..1d7fd54783 100644 --- a/common/common_plotHPGL_functions.cpp +++ b/common/common_plotHPGL_functions.cpp @@ -489,9 +489,7 @@ void HPGL_PLOTTER::FlashPadCircle( const wxPoint& pos, int diametre, DPOINT pos_dev = userToDeviceCoordinates( pos ); int delta = KiROUND( penDiameter - penOverlap ); - int radius = diametre / 2; - - radius = ( diametre - KiROUND( penDiameter ) ) / 2; + int radius = ( diametre - KiROUND( penDiameter ) ) / 2; if( radius < 0 ) radius = 0; diff --git a/common/fp_lib_table.cpp b/common/fp_lib_table.cpp index fb7a8f6d67..9c91e3844e 100644 --- a/common/fp_lib_table.cpp +++ b/common/fp_lib_table.cpp @@ -379,7 +379,7 @@ void FP_LIB_TABLE::Parse( FP_LIB_TABLE_LEXER* in ) throw( IO_ERROR, PARSE_ERROR void FP_LIB_TABLE::Format( OUTPUTFORMATTER* out, int nestLevel ) const - throw( IO_ERROR ) + throw( IO_ERROR, boost::interprocess::lock_exception ) { out->Print( nestLevel, "(fp_lib_table\n" ); @@ -391,7 +391,7 @@ void FP_LIB_TABLE::Format( OUTPUTFORMATTER* out, int nestLevel ) const void FP_LIB_TABLE::ROW::Format( OUTPUTFORMATTER* out, int nestLevel ) const - throw( IO_ERROR ) + throw( IO_ERROR, boost::interprocess::lock_exception ) { out->Print( nestLevel, "(lib (name %s)(type %s)(uri %s)(options %s)(descr %s))\n", out->Quotew( GetNickName() ).c_str(), @@ -665,7 +665,7 @@ bool FP_LIB_TABLE::IsEmpty( bool aIncludeFallback ) MODULE* FP_LIB_TABLE::FootprintLoadWithOptionalNickname( const FPID& aFootprintId ) - throw( IO_ERROR, PARSE_ERROR ) + throw( IO_ERROR, PARSE_ERROR, boost::interprocess::lock_exception ) { wxString nickname = aFootprintId.GetLibNickname(); wxString fpname = aFootprintId.GetFootprintName(); diff --git a/common/gal/cairo/cairo_gal.cpp b/common/gal/cairo/cairo_gal.cpp index cd329344bc..07714ec775 100644 --- a/common/gal/cairo/cairo_gal.cpp +++ b/common/gal/cairo/cairo_gal.cpp @@ -956,7 +956,7 @@ void CAIRO_GAL::blitCursor( wxBufferedDC& clientDC ) } // Store pixels that are going to be overpainted - VECTOR2D cursorScreen = ToScreen( cursorPosition ) - cursorSize / 2; + VECTOR2D cursorScreen = ToScreen( cursorPosition ) - cursorSize / 2.0f; cursorSave.Blit( 0, 0, cursorSize, cursorSize, &clientDC, cursorScreen.x, cursorScreen.y ); // Draw the cursor diff --git a/common/gal/opengl/opengl_gal.cpp b/common/gal/opengl/opengl_gal.cpp index 9a50adf73f..71917b1896 100644 --- a/common/gal/opengl/opengl_gal.cpp +++ b/common/gal/opengl/opengl_gal.cpp @@ -492,7 +492,7 @@ void OPENGL_GAL::DrawPolygon( const std::deque& aPointList ) boost::shared_array points( new GLdouble[3 * aPointList.size()] ); int v = 0; - for( std::deque::const_iterator it = aPointList.begin(); it != aPointList.end(); it++ ) + for( std::deque::const_iterator it = aPointList.begin(); it != aPointList.end(); ++it ) { points[v] = it->x; points[v + 1] = it->y; diff --git a/common/gal/opengl/shader.cpp b/common/gal/opengl/shader.cpp index 8edb1c350b..04157ae0c4 100644 --- a/common/gal/opengl/shader.cpp +++ b/common/gal/opengl/shader.cpp @@ -55,7 +55,7 @@ SHADER::~SHADER() { // Delete the shaders and the program for( std::deque::iterator it = shaderNumbers.begin(); it != shaderNumbers.end(); - it++ ) + ++it ) { glDeleteShader( *it ); } diff --git a/common/geometry/shape_line_chain.cpp b/common/geometry/shape_line_chain.cpp index 70a7939330..94ffccc316 100644 --- a/common/geometry/shape_line_chain.cpp +++ b/common/geometry/shape_line_chain.cpp @@ -428,7 +428,7 @@ SHAPE_LINE_CHAIN& SHAPE_LINE_CHAIN::Simplify() else if( PointCount() == 2 ) { if( m_points[0] == m_points[1] ) - m_points.erase( m_points.end() ); + m_points.pop_back(); return *this; } diff --git a/common/kiway.cpp b/common/kiway.cpp index 2e3de4ffb2..03b515336b 100644 --- a/common/kiway.cpp +++ b/common/kiway.cpp @@ -67,7 +67,7 @@ void KIWAY::player_destroy_handler( wxWindowDestroyEvent& event ) // if destroying one of our flock, then mark it as deceased. if( (wxWindow*) m_player[i] == w ) { - DBG(printf( "%s: m_player[%d] destroyed: %s\n", + DBG(printf( "%s: m_player[%u] destroyed: %s\n", __func__, i, TO_UTF8( m_player[i]->GetName() ) );) m_player[i] = 0; diff --git a/common/search_stack.cpp b/common/search_stack.cpp index e497b89099..cbbdc9f3c0 100644 --- a/common/search_stack.cpp +++ b/common/search_stack.cpp @@ -203,7 +203,7 @@ void SEARCH_STACK::Show( const char* aPrefix ) const printf( "%s SEARCH_STACK:\n", aPrefix ); for( unsigned i=0; iIsDirty() ) { - PCB_EDIT_FRAME* f = static_cast( GetEditFrame() ); + EDA_DRAW_FRAME* f = static_cast( GetEditFrame() ); f->GetGalCanvas()->Refresh(); // fixme: ugly hack, provide a method in TOOL_DISPATCHER. } diff --git a/cvpcb/cvstruct.h b/cvpcb/cvstruct.h index 7623658ac8..d262d0ba19 100644 --- a/cvpcb/cvstruct.h +++ b/cvpcb/cvstruct.h @@ -179,7 +179,6 @@ class COMPONENTS_LISTBOX : public ITEMS_LISTBOX_BASE { public: wxArrayString m_ComponentList; - CVPCB_MAINFRAME* m_Parent; public: diff --git a/eeschema/CMakeLists.txt b/eeschema/CMakeLists.txt index adbf37c83f..8ed081294e 100644 --- a/eeschema/CMakeLists.txt +++ b/eeschema/CMakeLists.txt @@ -84,12 +84,10 @@ set( EESCHEMA_SRCS component_references_lister.cpp controle.cpp cross-probing.cpp - database.cpp ${EESCHEMA_DLGS} edit_component_in_schematic.cpp edit_bitmap.cpp edit_label.cpp - eelibs_read_libraryfiles.cpp eeredraw.cpp eeschema.cpp eeschema_config.cpp @@ -140,6 +138,7 @@ set( EESCHEMA_SRCS sch_collectors.cpp sch_component.cpp sch_field.cpp + sch_item_struct.cpp sch_junction.cpp sch_line.cpp sch_marker.cpp @@ -165,10 +164,6 @@ set( EESCHEMA_SRCS transform.cpp viewlib_frame.cpp viewlibs.cpp - - # This file does not look common. - # Keep it after template_fieldnames_keywords.cpp - ../common/sch_item_struct.cpp ) diff --git a/eeschema/annotate.cpp b/eeschema/annotate.cpp index f15e49ab5b..3fccb8e1f9 100644 --- a/eeschema/annotate.cpp +++ b/eeschema/annotate.cpp @@ -31,9 +31,9 @@ #include #include #include -#include +#include -#include +#include #include #include #include diff --git a/eeschema/backanno.cpp b/eeschema/backanno.cpp index 3d0601fd6b..2d4b81edcd 100644 --- a/eeschema/backanno.cpp +++ b/eeschema/backanno.cpp @@ -33,14 +33,14 @@ #include #include #include -#include +#include #include #include #include #include #include -#include +#include #include #include diff --git a/eeschema/block.cpp b/eeschema/block.cpp index 01c7c3fb04..a1706ecb5e 100644 --- a/eeschema/block.cpp +++ b/eeschema/block.cpp @@ -32,7 +32,7 @@ #include #include #include -#include +#include #include #include diff --git a/eeschema/block_libedit.cpp b/eeschema/block_libedit.cpp index 794ce6a52e..cf0430110f 100644 --- a/eeschema/block_libedit.cpp +++ b/eeschema/block_libedit.cpp @@ -197,6 +197,9 @@ bool LIB_EDIT_FRAME::HandleBlockEnd( wxDC* DC ) case BLOCK_SELECT_ITEMS_ONLY: break; + + case BLOCK_MOVE_EXACT: + break; } if( !nextCmd ) diff --git a/eeschema/bus-wire-junction.cpp b/eeschema/bus-wire-junction.cpp index 95d9bc4348..ed78442e34 100644 --- a/eeschema/bus-wire-junction.cpp +++ b/eeschema/bus-wire-junction.cpp @@ -31,7 +31,7 @@ #include #include #include -#include +#include #include #include diff --git a/eeschema/busentry.cpp b/eeschema/busentry.cpp index 742c5dcb4d..b7baf06892 100644 --- a/eeschema/busentry.cpp +++ b/eeschema/busentry.cpp @@ -33,7 +33,7 @@ #include #include #include -#include +#include #include #include diff --git a/eeschema/class_library.cpp b/eeschema/class_library.cpp index 93f9a91ce0..578f7f904f 100644 --- a/eeschema/class_library.cpp +++ b/eeschema/class_library.cpp @@ -756,7 +756,7 @@ bool PART_LIB::SaveHeader( OUTPUTFORMATTER& aFormatter ) } -PART_LIB* PART_LIB::LoadLibrary( const wxString& aFileName ) throw( IO_ERROR ) +PART_LIB* PART_LIB::LoadLibrary( const wxString& aFileName ) throw( IO_ERROR, boost::bad_pointer ) { std::auto_ptr lib( new PART_LIB( LIBRARY_TYPE_EESCHEMA, aFileName ) ); @@ -784,7 +784,7 @@ PART_LIB* PART_LIB::LoadLibrary( const wxString& aFileName ) throw( IO_ERROR ) } -PART_LIB* PART_LIBS::AddLibrary( const wxString& aFileName ) throw( IO_ERROR ) +PART_LIB* PART_LIBS::AddLibrary( const wxString& aFileName ) throw( IO_ERROR, boost::bad_pointer ) { PART_LIB* lib; @@ -979,7 +979,8 @@ void PART_LIBS::RemoveCacheLibrary() void PART_LIBS::LibNamesAndPaths( PROJECT* aProject, bool doSave, - wxString* aPaths, wxArrayString* aNames ) throw( IO_ERROR ) + wxString* aPaths, wxArrayString* aNames ) + throw( IO_ERROR, boost::bad_pointer ) { wxString pro = aProject->GetProjectFullName(); @@ -1049,7 +1050,7 @@ const wxString PART_LIBS::CacheName( const wxString& aFullProjectFilename ) } -void PART_LIBS::LoadAllLibraries( PROJECT* aProject ) throw( IO_ERROR ) +void PART_LIBS::LoadAllLibraries( PROJECT* aProject ) throw( IO_ERROR, boost::bad_pointer ) { wxFileName fn; wxString filename; diff --git a/eeschema/class_library.h b/eeschema/class_library.h index 136e3670b7..3819c1de05 100644 --- a/eeschema/class_library.h +++ b/eeschema/class_library.h @@ -123,7 +123,7 @@ public: * @param aFileName - File name object of part library. * @throw IO_ERROR if there's any problem loading. */ - PART_LIB* AddLibrary( const wxString& aFileName ) throw( IO_ERROR ); + PART_LIB* AddLibrary( const wxString& aFileName ) throw( IO_ERROR, boost::bad_pointer ); /** * Function AddLibrary @@ -152,7 +152,7 @@ public: * loads all of the project's libraries into this container, which should * be cleared before calling it. */ - void LoadAllLibraries( PROJECT* aProject ) throw( IO_ERROR ); + void LoadAllLibraries( PROJECT* aProject ) throw( IO_ERROR, boost::bad_pointer ); /** * Function LibNamesAndPaths @@ -160,7 +160,8 @@ public: * (without paths). */ static void LibNamesAndPaths( PROJECT* aProject, bool doSave, - wxString* aPaths, wxArrayString* aNames=NULL ) throw( IO_ERROR ); + wxString* aPaths, wxArrayString* aNames=NULL ) + throw( IO_ERROR, boost::bad_pointer ); /** * Function cacheName @@ -545,7 +546,7 @@ public: * the caller. * @throw IO_ERROR if there's any problem loading the library. */ - static PART_LIB* LoadLibrary( const wxString& aFileName ) throw( IO_ERROR ); + static PART_LIB* LoadLibrary( const wxString& aFileName ) throw( IO_ERROR, boost::bad_pointer ); }; diff --git a/eeschema/class_netlist_object.cpp b/eeschema/class_netlist_object.cpp index 34c7333a47..3a99199165 100644 --- a/eeschema/class_netlist_object.cpp +++ b/eeschema/class_netlist_object.cpp @@ -30,7 +30,7 @@ #include #include -#include +#include #include #include diff --git a/eeschema/component_references_lister.cpp b/eeschema/component_references_lister.cpp index f83b45c40d..15eb9e6dca 100644 --- a/eeschema/component_references_lister.cpp +++ b/eeschema/component_references_lister.cpp @@ -1,4 +1,4 @@ -/* +/** * @file component_references_lister.cpp * @brief Code for creating a flat list of components needed for annotation and BOM. */ @@ -35,8 +35,8 @@ #include #include -#include -#include +#include +#include #include diff --git a/eeschema/controle.cpp b/eeschema/controle.cpp index 981ad38e83..7e42bee023 100644 --- a/eeschema/controle.cpp +++ b/eeschema/controle.cpp @@ -31,7 +31,7 @@ #include #include #include -#include +#include #include #include diff --git a/eeschema/cross-probing.cpp b/eeschema/cross-probing.cpp index 570226661c..d5f229b4cc 100644 --- a/eeschema/cross-probing.cpp +++ b/eeschema/cross-probing.cpp @@ -33,7 +33,7 @@ #include #include #include -#include +#include #include #include diff --git a/eeschema/database.cpp b/eeschema/database.cpp deleted file mode 100644 index 00cb8443b6..0000000000 --- a/eeschema/database.cpp +++ /dev/null @@ -1,132 +0,0 @@ -/* - * 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) 1992-2013 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 - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, you may find one here: - * http://www.gnu.org/licenses/old-licenses/gpl-2.0.html - * or you may search the http://www.gnu.org website for the version 2 license, - * or you may write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA - */ - -/** - * @file database.cpp - */ - -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#include - - -// Used in DataBaseGetName: this is a callback function for EDA_LIST_DIALOG -// to display keywords and description of a component -void DisplayCmpDocAndKeywords( wxString& aName, void* aData ) -{ - PART_LIBS* libs = (PART_LIBS*) aData; - - wxASSERT( libs ); - - LIB_ALIAS* part = libs->FindLibraryEntry( aName ); - - if( !part ) - return; - - aName = wxT( "Description: " ) + part->GetDescription(); - aName += wxT( "\nKey Words: " ) + part->GetKeyWords(); -} - - -#if 0 // not used, should be wxFrame member for KIWAY and PROJECT access. - -/* - * Displays a list of filtered components found in libraries for selection, - * Keys is a list of keywords to filter components which do not match these keywords - * If Keys is empty, list components that match BufName mask (with * and?) - * - * Returns the name of the selected component, or an empty string - */ -wxString DataBaseGetName( EDA_DRAW_FRAME* frame, wxString& Keys, wxString& BufName ) -{ - std::vector nameList; - wxString msg; - -// BufName.MakeUpper(); - Keys.MakeUpper(); - - /* Review the list of libraries for counting. */ - BOOST_FOREACH( PART_LIB& lib, PART_LIB::GetLibraryList() ) - { - lib.SearchEntryNames( nameList, BufName, Keys ); - } - - if( nameList.empty() ) - { - if( !BufName.IsEmpty() ) - { - if( !Keys.IsEmpty() ) - { - msg.Printf( _( "No components found matching name search criteria '%s' and key search criteria '%s'" ), - GetChars( BufName ), GetChars( Keys ) ); - } - else - { - msg.Printf( _( "No components found matching name search criteria '%s'" ), - GetChars( BufName ) ); - } - } - else - { - if( !Keys.IsEmpty() ) - { - msg.Printf( _( "No components found matching key search criteria '%s'" ), - GetChars( Keys ) ); - } - else - { - msg = _( "No components found matching" ); - } - } - - DisplayInfoMessage( frame, msg ); - - return wxEmptyString; - } - - wxArrayString headers; - headers.Add( _( "Component" ) ); - headers.Add( _( "Library" ) ); - - // Show candidate list: - wxString cmpname; - - EDA_LIST_DIALOG dlg( frame, _( "Select Component" ), headers, nameList, cmpname, - DisplayCmpDocAndKeywords, true ); - - if( dlg.ShowModal() != wxID_OK ) - return wxEmptyString; - - cmpname = dlg.GetTextSelection(); - return cmpname; -} -#endif diff --git a/eeschema/dialogs/dialog_annotate.cpp b/eeschema/dialogs/dialog_annotate.cpp index 8a3c0b6a22..8cf2c1dac5 100644 --- a/eeschema/dialogs/dialog_annotate.cpp +++ b/eeschema/dialogs/dialog_annotate.cpp @@ -29,7 +29,7 @@ #include -#include +#include #include #include diff --git a/eeschema/dialogs/dialog_bom.cpp b/eeschema/dialogs/dialog_bom.cpp index 6f71d20960..2de179f9a5 100644 --- a/eeschema/dialogs/dialog_bom.cpp +++ b/eeschema/dialogs/dialog_bom.cpp @@ -33,7 +33,7 @@ #include #include #include -#include +#include #include #include diff --git a/eeschema/dialogs/dialog_edit_component_in_schematic.cpp b/eeschema/dialogs/dialog_edit_component_in_schematic.cpp index a17e711edf..9647edda26 100644 --- a/eeschema/dialogs/dialog_edit_component_in_schematic.cpp +++ b/eeschema/dialogs/dialog_edit_component_in_schematic.cpp @@ -35,7 +35,7 @@ #include #include #include -#include +#include #include #include @@ -70,7 +70,7 @@ private: friend class SCH_EDIT_FRAME; SCH_EDIT_FRAME* m_Parent; - SCH_COMPONENT* m_Cmp; + SCH_COMPONENT* m_cmp; LIB_PART* m_part; bool m_skipCopyFromPanel; @@ -141,7 +141,7 @@ int DIALOG_EDIT_COMPONENT_IN_SCHEMATIC::s_SelectedRow; void SCH_EDIT_FRAME::EditComponent( SCH_COMPONENT* aComponent ) { wxCHECK_RET( aComponent != NULL && aComponent->Type() == SCH_COMPONENT_T, - wxT( "Invalid component object pointer. Bad Programmer!" ) ); + wxT( "Invalid component object pointer. Bad Programmer!" ) ); m_canvas->SetIgnoreMouseEvents( true ); @@ -169,6 +169,7 @@ DIALOG_EDIT_COMPONENT_IN_SCHEMATIC::DIALOG_EDIT_COMPONENT_IN_SCHEMATIC( wxWindow { m_Parent = (SCH_EDIT_FRAME*) parent; + m_cmp = NULL; m_part = NULL; m_skipCopyFromPanel = false; @@ -301,7 +302,7 @@ void DIALOG_EDIT_COMPONENT_IN_SCHEMATIC::copyPanelToOptions() wxString newname = chipnameTextCtrl->GetValue(); // Save current flags which could be modified by next change settings - STATUS_FLAGS flags = m_Cmp->GetFlags(); + STATUS_FLAGS flags = m_cmp->GetFlags(); newname.Replace( wxT( " " ), wxT( "_" ) ); @@ -309,7 +310,7 @@ void DIALOG_EDIT_COMPONENT_IN_SCHEMATIC::copyPanelToOptions() { DisplayError( NULL, _( "No Component Name!" ) ); } - else if( Cmp_KEEPCASE( newname, m_Cmp->m_part_name ) ) + else if( Cmp_KEEPCASE( newname, m_cmp->m_part_name ) ) { PART_LIBS* libs = Prj().SchLibs(); @@ -321,41 +322,41 @@ void DIALOG_EDIT_COMPONENT_IN_SCHEMATIC::copyPanelToOptions() } else // Change component from lib! { - m_Cmp->SetPartName( newname, libs ); + m_cmp->SetPartName( newname, libs ); } } // For components with multiple shapes (De Morgan representation) Set the selected shape: if( convertCheckBox->IsEnabled() ) { - m_Cmp->SetConvert( convertCheckBox->GetValue() ? 2 : 1 ); + m_cmp->SetConvert( convertCheckBox->GetValue() ? 2 : 1 ); } //Set the part selection in multiple part per package - if( m_Cmp->GetUnit() ) + if( m_cmp->GetUnit() ) { int unit_selection = unitChoice->GetCurrentSelection() + 1; - m_Cmp->SetUnitSelection( &m_Parent->GetCurrentSheet(), unit_selection ); - m_Cmp->SetUnit( unit_selection ); + m_cmp->SetUnitSelection( &m_Parent->GetCurrentSheet(), unit_selection ); + m_cmp->SetUnit( unit_selection ); } switch( orientationRadioBox->GetSelection() ) { case 0: - m_Cmp->SetOrientation( CMP_ORIENT_0 ); + m_cmp->SetOrientation( CMP_ORIENT_0 ); break; case 1: - m_Cmp->SetOrientation( CMP_ORIENT_90 ); + m_cmp->SetOrientation( CMP_ORIENT_90 ); break; case 2: - m_Cmp->SetOrientation( CMP_ORIENT_180 ); + m_cmp->SetOrientation( CMP_ORIENT_180 ); break; case 3: - m_Cmp->SetOrientation( CMP_ORIENT_270 ); + m_cmp->SetOrientation( CMP_ORIENT_270 ); break; } @@ -367,17 +368,17 @@ void DIALOG_EDIT_COMPONENT_IN_SCHEMATIC::copyPanelToOptions() break; case 1: - m_Cmp->SetOrientation( CMP_MIRROR_X ); + m_cmp->SetOrientation( CMP_MIRROR_X ); break; case 2: - m_Cmp->SetOrientation( CMP_MIRROR_Y ); + m_cmp->SetOrientation( CMP_MIRROR_Y ); break; } // Restore m_Flag modified by SetUnit() and other change settings - m_Cmp->ClearFlags(); - m_Cmp->SetFlags( flags ); + m_cmp->ClearFlags(); + m_cmp->SetFlags( flags ); } @@ -396,9 +397,9 @@ void DIALOG_EDIT_COMPONENT_IN_SCHEMATIC::OnOKButtonClick( wxCommandEvent& event // save old cmp in undo list if not already in edit, or moving ... // or the component to be edited is part of a block - if( m_Cmp->m_Flags == 0 || - m_Parent->GetScreen()->m_BlockLocate.GetState() != STATE_NO_BLOCK ) - m_Parent->SaveCopyInUndoList( m_Cmp, UR_CHANGED ); + if( m_cmp->m_Flags == 0 + || m_Parent->GetScreen()->m_BlockLocate.GetState() != STATE_NO_BLOCK ) + m_Parent->SaveCopyInUndoList( m_cmp, UR_CHANGED ); copyPanelToOptions(); @@ -441,21 +442,21 @@ void DIALOG_EDIT_COMPONENT_IN_SCHEMATIC::OnOKButtonClick( wxCommandEvent& event // change all field positions from relative to absolute for( unsigned i = 0; im_Pos ); + m_FieldsBuf[i].SetTextPosition( m_FieldsBuf[i].GetTextPosition() + m_cmp->m_Pos ); } - LIB_PART* entry = Prj().SchLibs()->FindLibPart( m_Cmp->m_part_name ); + LIB_PART* entry = Prj().SchLibs()->FindLibPart( m_cmp->m_part_name ); if( entry && entry->IsPower() ) - m_FieldsBuf[VALUE].SetText( m_Cmp->m_part_name ); + m_FieldsBuf[VALUE].SetText( m_cmp->m_part_name ); // copy all the fields back, and change the length of m_Fields. - m_Cmp->SetFields( m_FieldsBuf ); + m_cmp->SetFields( m_FieldsBuf ); // Reference has a specific initialization, depending on the current active sheet // because for a given component, in a complex hierarchy, there are more than one // reference. - m_Cmp->SetRef( &m_Parent->GetCurrentSheet(), m_FieldsBuf[REFERENCE].GetText() ); + m_cmp->SetRef( &m_Parent->GetCurrentSheet(), m_FieldsBuf[REFERENCE].GetText() ); m_Parent->OnModify(); m_Parent->GetScreen()->TestDanglingEnds(); @@ -474,7 +475,7 @@ void DIALOG_EDIT_COMPONENT_IN_SCHEMATIC::addFieldButtonHandler( wxCommandEvent& unsigned fieldNdx = m_FieldsBuf.size(); - SCH_FIELD blank( wxPoint(), fieldNdx, m_Cmp ); + SCH_FIELD blank( wxPoint(), fieldNdx, m_cmp ); blank.SetOrientation( m_FieldsBuf[REFERENCE].GetOrientation() ); @@ -564,7 +565,7 @@ void DIALOG_EDIT_COMPONENT_IN_SCHEMATIC::moveUpButtonHandler( wxCommandEvent& ev SCH_FIELD tmp = m_FieldsBuf[fieldNdx - 1]; DBG( printf( "tmp.m_Text=\"%s\" tmp.m_Name=\"%s\"\n", - TO_UTF8( tmp.GetText() ), TO_UTF8( tmp.GetName( false ) ) ); ) + TO_UTF8( tmp.GetText() ), TO_UTF8( tmp.GetName( false ) ) ); ) m_FieldsBuf[fieldNdx - 1] = m_FieldsBuf[fieldNdx]; setRowItem( fieldNdx - 1, m_FieldsBuf[fieldNdx] ); @@ -621,7 +622,7 @@ SCH_FIELD* DIALOG_EDIT_COMPONENT_IN_SCHEMATIC::findField( const wxString& aField void DIALOG_EDIT_COMPONENT_IN_SCHEMATIC::InitBuffers( SCH_COMPONENT* aComponent ) { - m_Cmp = aComponent; + m_cmp = aComponent; /* We have 3 component related field lists to be aware of: 1) UI presentation, 2) fields in component ram copy, and 3) fields recorded @@ -635,7 +636,7 @@ void DIALOG_EDIT_COMPONENT_IN_SCHEMATIC::InitBuffers( SCH_COMPONENT* aComponent which came from the component. */ - m_part = Prj().SchLibs()->FindLibPart( m_Cmp->m_part_name ); + m_part = Prj().SchLibs()->FindLibPart( m_cmp->m_part_name ); #if 0 && defined(DEBUG) for( int i = 0; iGetFieldCount(); ++i ) @@ -658,7 +659,7 @@ void DIALOG_EDIT_COMPONENT_IN_SCHEMATIC::InitBuffers( SCH_COMPONENT* aComponent m_FieldsBuf.push_back( aComponent->m_Fields[i] ); // make the editable field position relative to the component - m_FieldsBuf[i].SetTextPosition( m_FieldsBuf[i].GetTextPosition() - m_Cmp->m_Pos ); + m_FieldsBuf[i].SetTextPosition( m_FieldsBuf[i].GetTextPosition() - m_cmp->m_Pos ); } // Add template fieldnames: @@ -669,7 +670,7 @@ void DIALOG_EDIT_COMPONENT_IN_SCHEMATIC::InitBuffers( SCH_COMPONENT* aComponent for( TEMPLATE_FIELDNAMES::const_iterator it = tfnames.begin(); it!=tfnames.end(); ++it ) { // add a new field unconditionally to the UI only - SCH_FIELD fld( wxPoint(0,0), -1 /* id is a relic */, m_Cmp, it->m_Name ); + SCH_FIELD fld( wxPoint(0,0), -1 /* id is a relic */, m_cmp, it->m_Name ); // See if field by same name already exists in component. SCH_FIELD* schField = aComponent->FindField( it->m_Name ); @@ -691,7 +692,7 @@ void DIALOG_EDIT_COMPONENT_IN_SCHEMATIC::InitBuffers( SCH_COMPONENT* aComponent fld = *schField; // make the editable field position relative to the component - fld.SetTextPosition( fld.GetTextPosition() - m_Cmp->m_Pos ); + fld.SetTextPosition( fld.GetTextPosition() - m_cmp->m_Pos ); } m_FieldsBuf.push_back( fld ); @@ -711,7 +712,7 @@ void DIALOG_EDIT_COMPONENT_IN_SCHEMATIC::InitBuffers( SCH_COMPONENT* aComponent // make the editable field position relative to the component m_FieldsBuf[newNdx].SetTextPosition( m_FieldsBuf[newNdx].GetTextPosition() - - m_Cmp->m_Pos ); + m_cmp->m_Pos ); } } @@ -724,7 +725,7 @@ void DIALOG_EDIT_COMPONENT_IN_SCHEMATIC::InitBuffers( SCH_COMPONENT* aComponent } #endif - m_FieldsBuf[REFERENCE].SetText( m_Cmp->GetRef( &m_Parent->GetCurrentSheet() ) ); + m_FieldsBuf[REFERENCE].SetText( m_cmp->GetRef( &m_Parent->GetCurrentSheet() ) ); for( unsigned i = 0; iIsDragging() ) + if( m_cmp->IsDragging() ) { orientationRadioBox->Disable(); mirrorRadioBox->Disable(); @@ -784,6 +785,8 @@ void DIALOG_EDIT_COMPONENT_IN_SCHEMATIC::setRowItem( int aFieldNdx, const SCH_FI void DIALOG_EDIT_COMPONENT_IN_SCHEMATIC::copySelectedFieldToPanel() { + wxCHECK_RET( m_cmp != NULL, wxT( "Component pointer not initialized." ) ); + unsigned fieldNdx = getSelectedFieldNdx(); if( fieldNdx >= m_FieldsBuf.size() ) // traps the -1 case too @@ -855,7 +858,7 @@ void DIALOG_EDIT_COMPONENT_IN_SCHEMATIC::copySelectedFieldToPanel() textSizeTextCtrl->SetValue( EDA_GRAPHIC_TEXT_CTRL::FormatSize( g_UserUnit, field.GetSize().x ) ); wxPoint coord = field.GetTextPosition(); - wxPoint zero = -m_Cmp->m_Pos; // relative zero + wxPoint zero = -m_cmp->m_Pos; // relative zero // If the field value is empty and the position is at relative zero, we // set the initial position as a small offset from the ref field, and @@ -965,11 +968,11 @@ void DIALOG_EDIT_COMPONENT_IN_SCHEMATIC::copyOptionsToPanel() } // For components with multiple parts per package, set the unit selection - if( m_Cmp->GetUnit() <= (int)unitChoice->GetCount() ) - unitChoice->SetSelection( m_Cmp->GetUnit() - 1 ); + if( m_cmp->GetUnit() <= (int)unitChoice->GetCount() ) + unitChoice->SetSelection( m_cmp->GetUnit() - 1 ); // Disable unit selection if only one unit exists: - if( m_Cmp->GetUnit() <= 1 ) + if( m_cmp->GetUnit() <= 1 ) { unitChoice->Enable( false ); unitsInterchageableLabel->Show( false ); @@ -984,7 +987,7 @@ void DIALOG_EDIT_COMPONENT_IN_SCHEMATIC::copyOptionsToPanel() unitsInterchageableLabel->SetLabel( _( "No" ) ); } - int orientation = m_Cmp->GetOrientation() & ~( CMP_MIRROR_X | CMP_MIRROR_Y ); + int orientation = m_cmp->GetOrientation() & ~( CMP_MIRROR_X | CMP_MIRROR_Y ); if( orientation == CMP_ORIENT_90 ) orientationRadioBox->SetSelection( 1 ); @@ -995,7 +998,7 @@ void DIALOG_EDIT_COMPONENT_IN_SCHEMATIC::copyOptionsToPanel() else orientationRadioBox->SetSelection( 0 ); - int mirror = m_Cmp->GetOrientation() & ( CMP_MIRROR_X | CMP_MIRROR_Y ); + int mirror = m_cmp->GetOrientation() & ( CMP_MIRROR_X | CMP_MIRROR_Y ); if( mirror == CMP_MIRROR_X ) { @@ -1012,38 +1015,37 @@ void DIALOG_EDIT_COMPONENT_IN_SCHEMATIC::copyOptionsToPanel() // Activate/Desactivate the normal/convert option ? (activated only if // the component has more than one shape) - if( m_Cmp->GetConvert() > 1 ) + if( m_cmp->GetConvert() > 1 ) convertCheckBox->SetValue( true ); if( m_part == NULL || !m_part->HasConversion() ) convertCheckBox->Enable( false ); // Set the component's library name. - chipnameTextCtrl->SetValue( m_Cmp->m_part_name ); + chipnameTextCtrl->SetValue( m_cmp->m_part_name ); // Set the component's unique ID time stamp. m_textCtrlTimeStamp->SetValue( wxString::Format( wxT( "%8.8lX" ), - (unsigned long) m_Cmp->GetTimeStamp() ) ); + (unsigned long) m_cmp->GetTimeStamp() ) ); } #include -/* reinitialize components parameters to default values found in lib - */ + void DIALOG_EDIT_COMPONENT_IN_SCHEMATIC::SetInitCmp( wxCommandEvent& event ) { - if( !m_Cmp ) + if( !m_cmp ) return; - if( LIB_PART* part = Prj().SchLibs()->FindLibPart( m_Cmp->m_part_name ) ) + if( LIB_PART* part = Prj().SchLibs()->FindLibPart( m_cmp->m_part_name ) ) { // save old cmp in undo list if not already in edit, or moving ... - if( m_Cmp->m_Flags == 0 ) - m_Parent->SaveCopyInUndoList( m_Cmp, UR_CHANGED ); + if( m_cmp->m_Flags == 0 ) + m_Parent->SaveCopyInUndoList( m_cmp, UR_CHANGED ); INSTALL_UNBUFFERED_DC( dc, m_Parent->GetCanvas() ); - m_Cmp->Draw( m_Parent->GetCanvas(), &dc, wxPoint( 0, 0 ), g_XorMode ); + m_cmp->Draw( m_Parent->GetCanvas(), &dc, wxPoint( 0, 0 ), g_XorMode ); // Initialize fixed field values to default values found in library // Note: the field texts are not modified because they are set in schematic, @@ -1051,35 +1053,35 @@ void DIALOG_EDIT_COMPONENT_IN_SCHEMATIC::SetInitCmp( wxCommandEvent& event ) // Only VALUE, REFERENCE , FOOTPRINT and DATASHEET are re-initialized LIB_FIELD& refField = part->GetReferenceField(); - m_Cmp->GetField( REFERENCE )->SetTextPosition( refField.GetTextPosition() + m_Cmp->m_Pos ); - m_Cmp->GetField( REFERENCE )->ImportValues( refField ); + m_cmp->GetField( REFERENCE )->SetTextPosition( refField.GetTextPosition() + m_cmp->m_Pos ); + m_cmp->GetField( REFERENCE )->ImportValues( refField ); LIB_FIELD& valField = part->GetValueField(); - m_Cmp->GetField( VALUE )->SetTextPosition( valField.GetTextPosition() + m_Cmp->m_Pos ); - m_Cmp->GetField( VALUE )->ImportValues( valField ); + m_cmp->GetField( VALUE )->SetTextPosition( valField.GetTextPosition() + m_cmp->m_Pos ); + m_cmp->GetField( VALUE )->ImportValues( valField ); LIB_FIELD* field = part->GetField(FOOTPRINT); - if( field && m_Cmp->GetField( FOOTPRINT ) ) + if( field && m_cmp->GetField( FOOTPRINT ) ) { - m_Cmp->GetField( FOOTPRINT )->SetTextPosition( field->GetTextPosition() + m_Cmp->m_Pos ); - m_Cmp->GetField( FOOTPRINT )->ImportValues( *field ); + m_cmp->GetField( FOOTPRINT )->SetTextPosition( field->GetTextPosition() + m_cmp->m_Pos ); + m_cmp->GetField( FOOTPRINT )->ImportValues( *field ); } field = part->GetField(DATASHEET); - if( field && m_Cmp->GetField( DATASHEET ) ) + if( field && m_cmp->GetField( DATASHEET ) ) { - m_Cmp->GetField( DATASHEET )->SetTextPosition( field->GetTextPosition() + m_Cmp->m_Pos ); - m_Cmp->GetField( DATASHEET )->ImportValues( *field ); + m_cmp->GetField( DATASHEET )->SetTextPosition( field->GetTextPosition() + m_cmp->m_Pos ); + m_cmp->GetField( DATASHEET )->ImportValues( *field ); } - m_Cmp->SetOrientation( CMP_NORMAL ); + m_cmp->SetOrientation( CMP_NORMAL ); m_Parent->OnModify(); - m_Cmp->Draw( m_Parent->GetCanvas(), &dc, wxPoint( 0, 0 ), GR_DEFAULT_DRAWMODE ); + m_cmp->Draw( m_Parent->GetCanvas(), &dc, wxPoint( 0, 0 ), GR_DEFAULT_DRAWMODE ); EndQuasiModal( wxID_OK ); } diff --git a/eeschema/dialogs/dialog_edit_label.cpp b/eeschema/dialogs/dialog_edit_label.cpp index bc8c279021..7d12c683c2 100644 --- a/eeschema/dialogs/dialog_edit_label.cpp +++ b/eeschema/dialogs/dialog_edit_label.cpp @@ -30,7 +30,7 @@ #include #include -#include +#include #include #include diff --git a/eeschema/dialogs/dialog_edit_libentry_fields_in_lib.cpp b/eeschema/dialogs/dialog_edit_libentry_fields_in_lib.cpp index 75fdff829f..b2f3e08bfb 100644 --- a/eeschema/dialogs/dialog_edit_libentry_fields_in_lib.cpp +++ b/eeschema/dialogs/dialog_edit_libentry_fields_in_lib.cpp @@ -31,7 +31,7 @@ #include #include #include -#include +#include #include #include @@ -54,7 +54,7 @@ static int s_SelectedRow; class DIALOG_EDIT_LIBENTRY_FIELDS_IN_LIB : public DIALOG_EDIT_LIBENTRY_FIELDS_IN_LIB_BASE { public: - DIALOG_EDIT_LIBENTRY_FIELDS_IN_LIB( LIB_EDIT_FRAME* aParent, LIB_PART* aLibEntry ); + DIALOG_EDIT_LIBENTRY_FIELDS_IN_LIB( LIB_EDIT_FRAME* aParent, LIB_PART* aLibEntry ); //~DIALOG_EDIT_LIBENTRY_FIELDS_IN_LIB() {} private: @@ -282,9 +282,9 @@ void DIALOG_EDIT_LIBENTRY_FIELDS_IN_LIB::OnOKButtonClick( wxCommandEvent& event } #if defined(DEBUG) - for( unsigned i=0; i #include #include -#include +#include #include #include diff --git a/eeschema/dialogs/dialog_erc.cpp b/eeschema/dialogs/dialog_erc.cpp index 4c41ee57ab..754fa185e3 100644 --- a/eeschema/dialogs/dialog_erc.cpp +++ b/eeschema/dialogs/dialog_erc.cpp @@ -34,7 +34,7 @@ #include #include #include -#include +#include #include #include diff --git a/eeschema/dialogs/dialog_libedit_dimensions.cpp b/eeschema/dialogs/dialog_libedit_dimensions.cpp index c409ebeba0..2de5135171 100644 --- a/eeschema/dialogs/dialog_libedit_dimensions.cpp +++ b/eeschema/dialogs/dialog_libedit_dimensions.cpp @@ -27,7 +27,6 @@ * Handles the dialog so set current texts and pins sizes in LibEdit */ #include -#include #include #include diff --git a/eeschema/dialogs/dialog_netlist.cpp b/eeschema/dialogs/dialog_netlist.cpp index a47f7f0df9..7fc937f53e 100644 --- a/eeschema/dialogs/dialog_netlist.cpp +++ b/eeschema/dialogs/dialog_netlist.cpp @@ -42,7 +42,7 @@ #include #include #include -#include +#include #include #include diff --git a/eeschema/dialogs/dialog_plot_schematic.cpp b/eeschema/dialogs/dialog_plot_schematic.cpp index f2bc4fb524..9f7b6ee6ef 100644 --- a/eeschema/dialogs/dialog_plot_schematic.cpp +++ b/eeschema/dialogs/dialog_plot_schematic.cpp @@ -34,7 +34,7 @@ #include #include #include -#include +#include #include #include #include diff --git a/eeschema/dialogs/dialog_plot_schematic.h b/eeschema/dialogs/dialog_plot_schematic.h index c2aca65cd4..8f29677232 100644 --- a/eeschema/dialogs/dialog_plot_schematic.h +++ b/eeschema/dialogs/dialog_plot_schematic.h @@ -31,7 +31,7 @@ #include #include #include -#include +#include #include #include diff --git a/eeschema/dialogs/dialog_print_using_printer.cpp b/eeschema/dialogs/dialog_print_using_printer.cpp index 390b875103..e7c03b58d5 100644 --- a/eeschema/dialogs/dialog_print_using_printer.cpp +++ b/eeschema/dialogs/dialog_print_using_printer.cpp @@ -28,7 +28,7 @@ #include #include #include -#include +#include #include #include diff --git a/eeschema/edit_bitmap.cpp b/eeschema/edit_bitmap.cpp index 2a83d10a11..2cdc892075 100644 --- a/eeschema/edit_bitmap.cpp +++ b/eeschema/edit_bitmap.cpp @@ -29,7 +29,7 @@ #include #include -#include +#include #include #include diff --git a/eeschema/edit_component_in_schematic.cpp b/eeschema/edit_component_in_schematic.cpp index 3a143d0118..67c374f26e 100644 --- a/eeschema/edit_component_in_schematic.cpp +++ b/eeschema/edit_component_in_schematic.cpp @@ -32,7 +32,7 @@ #include #include #include -#include +#include #include #include @@ -77,7 +77,6 @@ void SCH_EDIT_FRAME::EditComponentFieldText( SCH_FIELD* aField ) // Don't use GetText() here. If the field is the reference designator and it's parent // component has multiple parts, we don't want the part suffix added to the field. - wxString newtext = aField->GetText(); m_canvas->SetIgnoreMouseEvents( true ); wxString title; @@ -91,7 +90,7 @@ void SCH_EDIT_FRAME::EditComponentFieldText( SCH_FIELD* aField ) m_canvas->MoveCursorToCrossHair(); m_canvas->SetIgnoreMouseEvents( false ); - newtext = dlg.GetTextField( ); + wxString newtext = dlg.GetTextField( ); if ( response != wxID_OK ) return; // canceled by user diff --git a/eeschema/edit_label.cpp b/eeschema/edit_label.cpp index e81bea06e5..d73c3b23d1 100644 --- a/eeschema/edit_label.cpp +++ b/eeschema/edit_label.cpp @@ -33,7 +33,7 @@ #include #include #include -#include +#include #include #include diff --git a/eeschema/eelibs_read_libraryfiles.cpp b/eeschema/eelibs_read_libraryfiles.cpp deleted file mode 100644 index 896bca08c6..0000000000 --- a/eeschema/eelibs_read_libraryfiles.cpp +++ /dev/null @@ -1,42 +0,0 @@ -/* - * This program source code file is part of KiCad, a free EDA CAD application. - * - * Copyright (C) 2007 SoftPLC Corporation, Dick Hollenbeck - * Copyright (C) 2014 KiCad Developers, see CHANGELOG.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 - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, you may find one here: - * http://www.gnu.org/licenses/old-licenses/gpl-2.0.html - * or you may search the http://www.gnu.org website for the version 2 license, - * or you may write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA - */ - -/** - * @file eelibs_read_libraryfiles.cpp - * @brief Functions to handle reading component library files. - */ - -#include -#include -#include -#include -#include -#include - -#include -#include -#include - -#include - diff --git a/eeschema/eeredraw.cpp b/eeschema/eeredraw.cpp index 88c6329a23..7f0899d364 100644 --- a/eeschema/eeredraw.cpp +++ b/eeschema/eeredraw.cpp @@ -30,7 +30,7 @@ #include #include #include -#include +#include #include diff --git a/eeschema/eeschema.cpp b/eeschema/eeschema.cpp index b3d25190e9..922247ad20 100644 --- a/eeschema/eeschema.cpp +++ b/eeschema/eeschema.cpp @@ -34,7 +34,7 @@ #include #include #include -#include +#include #include #include #include diff --git a/eeschema/eeschema_config.cpp b/eeschema/eeschema_config.cpp index 63b1e78759..d0bbd72728 100644 --- a/eeschema/eeschema_config.cpp +++ b/eeschema/eeschema_config.cpp @@ -31,7 +31,7 @@ #include #include #include -#include +#include #include #include diff --git a/eeschema/erc.cpp b/eeschema/erc.cpp index 379b48f620..8084f35fec 100644 --- a/eeschema/erc.cpp +++ b/eeschema/erc.cpp @@ -31,7 +31,7 @@ #include #include #include -#include +#include #include #include diff --git a/eeschema/events_called_functions_for_edit.cpp b/eeschema/events_called_functions_for_edit.cpp index 4ab2366698..44d2c3adca 100644 --- a/eeschema/events_called_functions_for_edit.cpp +++ b/eeschema/events_called_functions_for_edit.cpp @@ -31,7 +31,7 @@ #include #include #include -#include +#include #include #include diff --git a/eeschema/files-io.cpp b/eeschema/files-io.cpp index 4a32ef030f..64772d0211 100644 --- a/eeschema/files-io.cpp +++ b/eeschema/files-io.cpp @@ -32,7 +32,7 @@ #include #include #include -#include +#include #include #include diff --git a/eeschema/find.cpp b/eeschema/find.cpp index 2436096344..f207a1e853 100644 --- a/eeschema/find.cpp +++ b/eeschema/find.cpp @@ -39,11 +39,10 @@ #include #include #include -#include +#include #include #include -#include #include #include #include diff --git a/eeschema/getpart.cpp b/eeschema/getpart.cpp index 7beaf1baef..6fdb327b9b 100644 --- a/eeschema/getpart.cpp +++ b/eeschema/getpart.cpp @@ -34,7 +34,7 @@ #include #include #include -#include +#include #include #include diff --git a/eeschema/hierarch.cpp b/eeschema/hierarch.cpp index 26bb344671..18553aa986 100644 --- a/eeschema/hierarch.cpp +++ b/eeschema/hierarch.cpp @@ -1,7 +1,7 @@ /* * This program source code file is part of KiCad, a free EDA CAD application. * - * Copyright (C) 2004 Jean-Pierre Charras, jaen-pierre.charras@gipsa-lab.inpg.com + * Copyright (C) 2004 Jean-Pierre Charras, jp.charras at wanadoo.fr * Copyright (C) 2008-2011 Wayne Stambaugh * Copyright (C) 2004-2011 KiCad Developers, see change_log.txt for contributors. * @@ -24,14 +24,14 @@ */ /** - * @file hierarch.cpp + * @file hierarch.schframe */ #include #include #include #include -#include +#include #include #include diff --git a/eeschema/hotkeys.cpp b/eeschema/hotkeys.cpp index 809a34ab82..6fefdadfde 100644 --- a/eeschema/hotkeys.cpp +++ b/eeschema/hotkeys.cpp @@ -30,7 +30,7 @@ #include #include #include -#include +#include #include #include diff --git a/eeschema/lib_pin.cpp b/eeschema/lib_pin.cpp index 409492d663..24a9218cbd 100644 --- a/eeschema/lib_pin.cpp +++ b/eeschema/lib_pin.cpp @@ -34,7 +34,7 @@ #include #include #include -#include +#include #include #include #include diff --git a/eeschema/libarch.cpp b/eeschema/libarch.cpp index 03ffd09e52..100b6aa7a3 100644 --- a/eeschema/libarch.cpp +++ b/eeschema/libarch.cpp @@ -32,7 +32,7 @@ #include #include #include -#include +#include #include #include diff --git a/eeschema/libedit.cpp b/eeschema/libedit.cpp index f474736d52..4ad4f0729b 100644 --- a/eeschema/libedit.cpp +++ b/eeschema/libedit.cpp @@ -40,7 +40,6 @@ #include #include -#include #include #include #include @@ -73,7 +72,7 @@ void LIB_EDIT_FRAME::DisplayLibInfos() void LIB_EDIT_FRAME::SelectActiveLibrary( PART_LIB* aLibrary ) { if( !aLibrary ) - aLibrary = SelectLibraryFromList( this ); + aLibrary = SelectLibraryFromList(); if( aLibrary ) { diff --git a/eeschema/libeditframe.cpp b/eeschema/libeditframe.cpp index eee31eaa86..7e5c073d4a 100644 --- a/eeschema/libeditframe.cpp +++ b/eeschema/libeditframe.cpp @@ -35,11 +35,10 @@ #include #include #include -#include +#include #include #include -#include #include #include #include diff --git a/eeschema/load_one_schematic_file.cpp b/eeschema/load_one_schematic_file.cpp index 47a2a7df06..e63667c752 100644 --- a/eeschema/load_one_schematic_file.cpp +++ b/eeschema/load_one_schematic_file.cpp @@ -31,7 +31,7 @@ #include #include #include -#include +#include #include #include diff --git a/eeschema/menubar.cpp b/eeschema/menubar.cpp index d3b6b22ed0..e9a22fb818 100644 --- a/eeschema/menubar.cpp +++ b/eeschema/menubar.cpp @@ -31,7 +31,7 @@ #include #include #include -#include +#include #include #include diff --git a/eeschema/netform.cpp b/eeschema/netform.cpp index a87dec87f3..3a1ab09c74 100644 --- a/eeschema/netform.cpp +++ b/eeschema/netform.cpp @@ -3,7 +3,7 @@ * * Copyright (C) 1992-2013 jp.charras at wanadoo.fr * Copyright (C) 2013 SoftPLC Corporation, Dick Hollenbeck - * Copyright (C) 1992-2013 KiCad Developers, see change_log.txt for contributors. + * Copyright (C) 1992-2015 KiCad Developers, see change_log.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 @@ -33,9 +33,10 @@ #include #include #include -#include +#include #include +#include #include #include #include @@ -48,7 +49,7 @@ #include #include -#define INTERMEDIATE_NETLIST_EXT wxT("xml") +#define INTERMEDIATE_NETLIST_EXT wxT( "xml" ) /** * Class UNIQUE_STRINGS @@ -87,7 +88,7 @@ bool UNIQUE_STRINGS::Lookup( const wxString& aString ) /** * Class NETLIST_EXPORT_TOOL * is a private implementation class used in this source file to keep track - * of and recycle datastructures used in the generation of various exported netlist + * of and recycle data structures used in the generation of various exported netlist * files. Since it is private it is not in a header file. */ class NETLIST_EXPORT_TOOL @@ -305,8 +306,8 @@ public: * .-PSpice or .-gnucap put at beginning of the netlist * .+PSpice or .-genucap are put at end of the netList * @param f = the file to write to - * @param aUsePrefix = true, adds an 'X' prefix to any reference designator starting with "U" or "IC", - * false to leave reference designator unchanged. + * @param aUsePrefix = true, adds an 'X' prefix to any reference designator starting + * with "U" or "IC", false to leave reference designator unchanged. * @param aUseNetcodeAsNetName = true to use numbers (net codes) as net names. * false to use net names from schematic. */ @@ -353,25 +354,14 @@ wxString NETLIST_EXPORT_TOOL::MakeCommandLine( const wxString& aFormatString, wxFileName in = aTempfile; wxFileName out = aFinalFile; - ret.Replace( wxT("%B"), out.GetName().GetData(), true ); - ret.Replace( wxT("%I"), in.GetFullPath().GetData(), true ); - ret.Replace( wxT("%O"), out.GetFullPath().GetData(), true ); + ret.Replace( wxT( "%B" ), out.GetName().GetData(), true ); + ret.Replace( wxT( "%I" ), in.GetFullPath().GetData(), true ); + ret.Replace( wxT( "%O" ), out.GetFullPath().GetData(), true ); return ret; } -/* Function WriteNetListFile - * creates the netlist file. Netlist info must be existing - * (call BuildNetListBase() to create this info ) - * param aConnectedItemsList = the initialized list of connected items - * param aFormat = netlist format (NET_TYPE_PCBNEW ...) - * param aFullFileName = full netlist file name - * param aNetlistOptions = netlist options using OR'ed bits. - * For SPICE netlist only: - * if NET_USE_X_PREFIX is set : change "U" and "IC" refernce prefix to "X" - * return true if success. - */ bool SCH_EDIT_FRAME::WriteNetListFile( NETLIST_OBJECT_LIST * aConnectedItemsList, int aFormat, const wxString& aFullFileName, unsigned aNetlistOptions ) @@ -382,6 +372,7 @@ bool SCH_EDIT_FRAME::WriteNetListFile( NETLIST_OBJECT_LIST * aConnectedItemsList NETLIST_EXPORT_TOOL helper( aConnectedItemsList, Prj().SchLibs() ); bool open_file = (aFormat < NET_TYPE_CUSTOM1) && (aFormat >= 0); + if( (aFormat == NET_TYPE_PCBNEW) && (aNetlistOptions & NET_PCBNEW_USE_NEW_FORMAT ) ) open_file = false; @@ -405,57 +396,51 @@ bool SCH_EDIT_FRAME::WriteNetListFile( NETLIST_OBJECT_LIST * aConnectedItemsList if( (aNetlistOptions & NET_PCBNEW_USE_NEW_FORMAT ) ) ret = helper.WriteKiCadNetList( aFullFileName ); else - { ret = helper.WriteNetListPCBNEW( f, true ); - fclose( f ); - } break; case NET_TYPE_ORCADPCB2: ret = helper.WriteNetListPCBNEW( f, false ); - fclose( f ); break; case NET_TYPE_CADSTAR: ret = helper.WriteNetListCADSTAR( f ); - fclose( f ); break; case NET_TYPE_SPICE: ret = helper.WriteNetListPspice( f, aNetlistOptions & NET_USE_X_PREFIX, aNetlistOptions & NET_USE_NETCODES_AS_NETNAMES ); - fclose( f ); break; default: - { - wxFileName tmpFile = aFullFileName; - tmpFile.SetExt( INTERMEDIATE_NETLIST_EXT ); + { + wxFileName tmpFile = aFullFileName; + tmpFile.SetExt( INTERMEDIATE_NETLIST_EXT ); - DBG(printf("tmpFile:'%s'\n", TO_UTF8( tmpFile.GetFullPath() ) );) + ret = helper.WriteGENERICNetList( tmpFile.GetFullPath() ); - ret = helper.WriteGENERICNetList( tmpFile.GetFullPath() ); - if( !ret ) - break; + if( !ret ) + break; - // If user provided no plugin command line, return now. - if( m_netListerCommand.IsEmpty() ) - break; + // If user provided no plugin command line, return now. + if( m_netListerCommand.IsEmpty() ) + break; - // build full command line from user's format string, e.g.: - // "xsltproc -o %O /usr/local/lib/kicad/plugins/netlist_form_pads-pcb.xsl %I" - // becomes, after the user selects /tmp/s1.net as the output file from the file dialog: - // "xsltproc -o /tmp/s1.net /usr/local/lib/kicad/plugins/netlist_form_pads-pcb.xsl /tmp/s1.xml" - wxString commandLine = NETLIST_EXPORT_TOOL::MakeCommandLine( m_netListerCommand, - tmpFile.GetFullPath(), - aFullFileName ); + // build full command line from user's format string, e.g.: + // "xsltproc -o %O /usr/local/lib/kicad/plugins/netlist_form_pads-pcb.xsl %I" + // becomes, after the user selects /tmp/s1.net as the output file from the file dialog: + // "xsltproc -o /tmp/s1.net /usr/local/lib/kicad/plugins/netlist_form_pads-pcb.xsl /tmp/s1.xml" + wxString commandLine = NETLIST_EXPORT_TOOL::MakeCommandLine( m_netListerCommand, + tmpFile.GetFullPath(), + aFullFileName ); - DBG(printf("commandLine:'%s'\n", TO_UTF8( commandLine ) );) - - ProcessExecute( commandLine, wxEXEC_SYNC ); - } + ProcessExecute( commandLine, wxEXEC_SYNC ); break; } + } + + if( f != NULL ) + fclose( f ); return ret; } @@ -1276,19 +1261,22 @@ bool NETLIST_EXPORT_TOOL::WriteNetListPspice( FILE* f, bool aUsePrefix, bool aUs for( unsigned ii = 0; ii < m_SortedComponentPinList.size(); ii++ ) { // Case of Alt Sequence definition with Unused/Invalid Node index: - // Valid used Node Indexes are in the set {0,1,2,...m_SortedComponentPinList.size()-1} + // Valid used Node Indexes are in the set + // {0,1,2,...m_SortedComponentPinList.size()-1} if( pinSequence.size() ) { // All Vector values must be less <= max package size // And Total Vector size should be <= package size - if( ( (unsigned) pinSequence[ii] < m_SortedComponentPinList.size() ) && ( ii < pinSequence.size() ) ) + if( ( (unsigned) pinSequence[ii] < m_SortedComponentPinList.size() ) + && ( ii < pinSequence.size() ) ) { // Case of Alt Pin Sequence in control good Index: activePinIndex = pinSequence[ii]; } else { - // Case of Alt Pin Sequence in control Bad Index or not using all pins for simulation: + // Case of Alt Pin Sequence in control Bad Index or not using all + // pins for simulation: continue; } } @@ -1358,6 +1346,7 @@ bool NETLIST_EXPORT_TOOL::WriteNetListPspice( FILE* f, bool aUsePrefix, bool aUs // Print texts starting with [+]pspice or [+]gnucap nbitems = spiceCommandAtEndFile.GetCount(); + if( nbitems ) { ret |= fprintf( f, "\n" ); @@ -1452,16 +1441,19 @@ bool NETLIST_EXPORT_TOOL::WriteNetListPCBNEW( FILE* f, bool with_pcbnew ) field.Replace( wxT( " " ), wxT( "_" ) ); ret |= fprintf( f, " {Lib=%s}", TO_UTF8( field ) ); } + ret |= fprintf( f, "\n" ); // Write pin list: for( unsigned ii = 0; ii < m_SortedComponentPinList.size(); ii++ ) { NETLIST_OBJECT* pin = m_SortedComponentPinList[ii]; + if( !pin ) continue; sprintPinNetName( netName, wxT( "N-%.6d" ), pin ); + if( netName.IsEmpty() ) netName = wxT( "?" ); @@ -1524,7 +1516,7 @@ bool NETLIST_EXPORT_TOOL::WriteNetListPCBNEW( FILE* f, bool with_pcbnew ) bool NETLIST_EXPORT_TOOL::addPinToComponentPinList( SCH_COMPONENT* aComponent, - SCH_SHEET_PATH* aSheetPath, LIB_PIN* aPin ) + SCH_SHEET_PATH* aSheetPath, LIB_PIN* aPin ) { // Search the PIN description for Pin in g_NetObjectslist for( unsigned ii = 0; ii < m_masterList->size(); ii++ ) @@ -1558,14 +1550,7 @@ bool NETLIST_EXPORT_TOOL::addPinToComponentPinList( SCH_COMPONENT* aComponent, return false; } -/* - * remove duplicate pins from aPinList (list of pins relative to a given component) - * (i.e. set pointer to duplicate pins to NULL in this list). - * also set .m_Flag member of "removed" NETLIST_OBJECT pins to 1 - * When pins are duplicated, not connected duplicate is removed - * (for instance when a multiple part per package component has its power pins connected - * only on a part). - */ + void NETLIST_EXPORT_TOOL::eraseDuplicatePins( ) { for( unsigned ii = 0; ii < m_SortedComponentPinList.size(); ii++ ) @@ -1582,6 +1567,7 @@ void NETLIST_EXPORT_TOOL::eraseDuplicatePins( ) * are necessary successive in list */ int idxref = ii; + for( unsigned jj = ii + 1; jj < m_SortedComponentPinList.size(); jj++ ) { if( m_SortedComponentPinList[jj] == NULL ) // Already removed @@ -1618,8 +1604,8 @@ void NETLIST_EXPORT_TOOL::eraseDuplicatePins( ) void NETLIST_EXPORT_TOOL::findAllInstancesOfComponent( SCH_COMPONENT* aComponent, - LIB_PART* aEntry, - SCH_SHEET_PATH* aSheetPath ) + LIB_PART* aEntry, + SCH_SHEET_PATH* aSheetPath ) { wxString ref = aComponent->GetRef( aSheetPath ); wxString ref2; @@ -1847,6 +1833,7 @@ bool NETLIST_EXPORT_TOOL::writeListOfNetsCADSTAR( FILE* f ) Cmp = nitem->GetComponentParent(); wxString refstr = Cmp->GetRef( &nitem->m_SheetPath ); + if( refstr[0] == '#' ) continue; // Power supply symbols. @@ -1860,10 +1847,10 @@ bool NETLIST_EXPORT_TOOL::writeListOfNetsCADSTAR( FILE* f ) buf[4] = 0; str_pinnum = FROM_UTF8( buf ); InitNetDescLine.Printf( wxT( "\n%s %s %.4s %s" ), - GetChars( InitNetDesc ), - GetChars( refstr ), - GetChars( str_pinnum ), - GetChars( netcodeName ) ); + GetChars( InitNetDesc ), + GetChars( refstr ), + GetChars( str_pinnum ), + GetChars( netcodeName ) ); } print_ter++; break; diff --git a/eeschema/netlist.cpp b/eeschema/netlist.cpp index d78848c779..4b7413da3a 100644 --- a/eeschema/netlist.cpp +++ b/eeschema/netlist.cpp @@ -28,7 +28,7 @@ */ #include -#include +#include #include #include diff --git a/eeschema/netlist.h b/eeschema/netlist.h index 2f3d59bbcd..b8d36086b8 100644 --- a/eeschema/netlist.h +++ b/eeschema/netlist.h @@ -3,7 +3,7 @@ * * Copyright (C) 1992-2011 jean-pierre Charras * Copyright (C) 1992-2011 Wayne Stambaugh - * Copyright (C) 1992-2011 KiCad Developers, see change_log.txt for contributors. + * Copyright (C) 1992-2015 KiCad Developers, see changelog.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 @@ -31,15 +31,6 @@ #ifndef _NETLIST_H_ #define _NETLIST_H_ - -#include - -#include -#include -#include -#include - - /// netlist types enum NETLIST_TYPE_ID { NET_TYPE_UNINIT = 0, @@ -64,422 +55,9 @@ enum netlistOptions { }; -class SCH_COMPONENT; - - #define NETLIST_HEAD_STRING "EESchema Netlist Version 1.1" // Max pin number per component and footprint #define MAXPIN 5000 - -/** - * Class SCH_REFERENCE - * is used as a helper to define a component's reference designator in a schematic. This - * helper is required in a complex hierarchy because a component can be used more than - * once and its reference depends on the sheet path. This class is used to flatten the - * schematic hierarchy for annotation, net list generation, and bill of material - * generation. - */ -class SCH_REFERENCE -{ - /// Component reference prefix, without number (for IC1, this is IC) ) - UTF8 m_Ref; // it's private, use the accessors please - SCH_COMPONENT* m_RootCmp; ///< The component associated the reference object. - LIB_PART* m_Entry; ///< The source component from a library. - wxPoint m_CmpPos; ///< The physical position of the component in schematic - ///< used to annotate by X or Y position - int m_Unit; ///< The unit number for components with multiple parts - ///< per package. - SCH_SHEET_PATH m_SheetPath; ///< The sheet path for this reference. - bool m_IsNew; ///< True if not yet annotated. - int m_SheetNum; ///< The sheet number for the reference. - time_t m_TimeStamp; ///< The time stamp for the reference. - EDA_TEXT* m_Value; ///< The component value of the refernce. It is the - ///< same for all instances. - int m_NumRef; ///< The numeric part of the reference designator. - int m_Flag; - - friend class SCH_REFERENCE_LIST; - - -public: - - SCH_REFERENCE() : - m_SheetPath() - { - m_RootCmp = NULL; - m_Entry = NULL; - m_Unit = 0; - m_TimeStamp = 0; - m_IsNew = false; - m_Value = NULL; - m_NumRef = 0; - m_Flag = 0; - m_SheetNum = 0; - } - - SCH_REFERENCE( SCH_COMPONENT* aComponent, LIB_PART* aLibComponent, - SCH_SHEET_PATH& aSheetPath ); - - SCH_COMPONENT* GetComp() const { return m_RootCmp; } - - LIB_PART* GetLibComponent() const { return m_Entry; } - - SCH_SHEET_PATH GetSheetPath() const { return m_SheetPath; } - - int GetUnit() const { return m_Unit; } - - void SetSheetNumber( int aSheetNumber ) { m_SheetNum = aSheetNumber; } - - /** - * Function Annotate - * updates the annotation of the component according the the current object state. - */ - void Annotate(); - - /** - * Function Split - * attempts to split the reference designator into a name (U) and number (1). If the - * last character is '?' or not a digit, the reference is tagged as not annotated. - * For components with multiple parts per package that are not already annotated, set - * m_Unit to a max value (0x7FFFFFFF). - */ - void Split(); - - /* Some accessors which hide the strategy of how the reference is stored, - thereby making it easy to change that strategy. - */ - - void SetRef( const wxString& aReference ) - { - m_Ref = aReference; - } - - wxString GetRef() const - { - return m_Ref; - } - void SetRefStr( const std::string& aReference ) - { - m_Ref = aReference; - } - const char* GetRefStr() const - { - return m_Ref.c_str(); - } - - int CompareValue( const SCH_REFERENCE& item ) const - { - return Cmp_KEEPCASE( m_Value->GetText(), item.m_Value->GetText() ); - } - - int CompareRef( const SCH_REFERENCE& item ) const - { - return m_Ref.compare( item.m_Ref ); - } - - int CompareLibName( const SCH_REFERENCE& item ) const - { - return Cmp_KEEPCASE( m_RootCmp->GetPartName(), item.m_RootCmp->GetPartName() ); - } - - bool IsUnitsLocked() - { - return m_Entry->UnitsLocked(); - } -}; - - -/** - * Class SCH_REFERENCE_LIST - * is used to create a flattened list of components because in a complex hierarchy, a component - * can be used more than once and its reference designator is dependent on the sheet path for - * the same component. This flattened list is used for netlist generation, BOM generation, - * and schematic annotation. - */ -class SCH_REFERENCE_LIST -{ -private: - std::vector componentFlatList; - -public: - /** Constructor - */ - SCH_REFERENCE_LIST() - { - } - - SCH_REFERENCE& operator[]( int aIndex ) - { - return componentFlatList[ aIndex ]; - } - - /** - * Function GetCount - * @return the number of items in the list - */ - unsigned GetCount() - { - return componentFlatList.size(); - } - - /** - * Function GetItem - * @return the aIdx item - */ - SCH_REFERENCE& GetItem( int aIdx ) - { - return componentFlatList[aIdx]; - } - - /** - * Function AddItem - * adds a SCH_REFERENCE object to the list of references. - * @param aItem - a SCH_REFERENCE item to add - */ - void AddItem( SCH_REFERENCE& aItem ) - { - componentFlatList.push_back( aItem ); - } - - /** - * Function RemoveItem - * removes an item from the list of references. - * - * @param aIndex is the index of the item to be removed. - */ - void RemoveItem( unsigned int aIndex ); - - /** - * Function RemoveSubComponentsFromList - * Remove sub components from the list, when multiples parts per package are - * found in this list. - * Useful to create BOM, when a component must appear only once - */ - void RemoveSubComponentsFromList(); - - /* Sort functions: - * Sort functions are used to sort components for annotation or BOM generation. - * Because sorting depend on we want to do, there are many sort functions. - * Note: - * When creating BOM, components are fully annotated. - * references are something like U3, U5 or R4, R8 - * When annotating, some or all components are not annotated, - * i.e. ref is only U or R, with no number. - */ - - /** - * Function SplitReferences - * attempts to split all reference designators into a name (U) and number (1). If the - * last character is '?' or not a digit, the reference is tagged as not annotated. - * For components with multiple parts per package that are not already annotated, set - * m_Unit to a max value (0x7FFFFFFF). - * @see SCH_REFERENCE::Split() - */ - void SplitReferences() - { - for( unsigned ii = 0; ii < GetCount(); ii++ ) - componentFlatList[ii].Split(); - } - - /** - * function UpdateAnnotation - * Updates the reference components for the schematic project (or the current sheet) - * Note: this function does not calculate the reference numbers stored in m_NumRef - * So, it must be called after calculation of new reference numbers - * @see SCH_REFERENCE::Annotate() - */ - void UpdateAnnotation() - { - /* update the reference numbers */ - for( unsigned ii = 0; ii < GetCount(); ii++ ) - { - componentFlatList[ii].Annotate(); - } - } - - /** - * Function Annotate - * set the reference designators in the list that have not been annotated. - * @param aUseSheetNum Set to true to start annotation for each sheet at the sheet number - * times \a aSheetIntervalId. Otherwise annotate incrementally. - * @param aSheetIntervalId The per sheet reference designator multiplier. - *

- * If a the sheet number is 2 and \a aSheetIntervalId is 100, then the first reference - * designator would be 201 and the last reference designator would be 299 when no overlap - * occurs with sheet number 3. If there are 150 items in sheet number 2, then items are - * referenced U201 to U351, and items in sheet 3 start from U352 - *

- */ - void Annotate( bool aUseSheetNum, int aSheetIntervalId ); - - /** - * Function CheckAnnotation - * check for annotations errors. - *

- * The following annotation error conditions are tested: - *

    - *
  • Components not annotated.
  • - *
  • Components having the same reference designator (duplicates).
  • - *
  • Components with multiple parts per package having different reference designators.
  • - *
  • Components with multiple parts per package with invalid part count.
  • - *
- *

- * @param aMessageList A wxArrayString to store error messages. - * @return The number of errors found. - */ - int CheckAnnotation( wxArrayString* aMessageList ); - - /** - * Function sortByXCoordinate - * sorts the list of references by X position. - *

- * Components are sorted as follows: - *

    - *
  • Numeric value of reference designator.
  • - *
  • Sheet number.
  • - *
  • X coordinate position.
  • - *
  • Y coordinate position.
  • - *
  • Time stamp.
  • - *
- *

- */ - void SortByXCoordinate() - { - sort( componentFlatList.begin(), componentFlatList.end(), sortByXPosition ); - } - - /** - * Function sortByYCoordinate - * sorts the list of references by Y position. - *

- * Components are sorted as follows: - *

    - *
  • Numeric value of reference designator.
  • - *
  • Sheet number.
  • - *
  • Y coordinate position.
  • - *
  • X coordinate position.
  • - *
  • Time stamp.
  • - *
- *

- */ - void SortByYCoordinate() - { - sort( componentFlatList.begin(), componentFlatList.end(), sortByYPosition ); - } - - /** - * Function SortComponentsByTimeStamp - * sort the flat list by Time Stamp. - * Useful to detect duplicate Time Stamps - */ - void SortByTimeStamp() - { - sort( componentFlatList.begin(), componentFlatList.end(), sortByTimeStamp ); - } - - /** - * Function SortByRefAndValue - * sorts the list of references by value. - *

- * Components are sorted in the following order: - *

    - *
  • Numeric value of reference designator.
  • - *
  • Value of component.
  • - *
  • Unit number when component has multiple parts.
  • - *
  • Sheet number.
  • - *
  • X coordinate position.
  • - *
  • Y coordinate position.
  • - *
- *

- */ - void SortByRefAndValue() - { - sort( componentFlatList.begin(), componentFlatList.end(), sortByRefAndValue ); - } - - /** - * Function SortByReferenceOnly - * sorts the list of references by reference. - *

- * Components are sorted in the following order: - *

    - *
  • Numeric value of reference designator.
  • - *
  • Unit number when component has multiple parts.
  • - *
- *

- */ - void SortByReferenceOnly() - { - sort( componentFlatList.begin(), componentFlatList.end(), sortByReferenceOnly ); - } - - /** - * Function GetUnit - * searches the sorted list of components for a another component with the same - * reference and a given part unit. Use this method to manage components with - * multiple parts per package. - * @param aIndex = index in aComponentsList for of given SCH_REFERENCE item to test. - * @param aUnit = the given unit number to search - * @return index in aComponentsList if found or -1 if not found - */ - int FindUnit( size_t aIndex, int aUnit ); - - /** - * Function ResetHiddenReferences - * clears the annotation for all references that have an invisible reference designator. - * Invisible reference designators always have # as the first letter. - */ - void ResetHiddenReferences(); - - /** - * Function GetRefsInUse - * adds all the reference designator numbers greater than \a aMinRefId to \a aIdList - * skipping the reference at \a aIndex. - * @param aIndex = the current component index to use for reference prefix filtering. - * @param aIdList = the buffer to fill - * @param aMinRefId = the min id value to store. all values < aMinRefId are ignored - */ - void GetRefsInUse( int aIndex, std::vector< int >& aIdList, int aMinRefId ); - - /** - * Function GetLastReference - * returns the last used (greatest) reference number in the reference list - * for the prefix reference given by \a aIndex. The component list must be - * sorted. - * - * @param aIndex The index of the reference item used for the search pattern. - * @param aMinValue The minimum value for the current search. - */ - int GetLastReference( int aIndex, int aMinValue ); - -private: - /* sort functions used to sort componentFlatList - */ - - static bool sortByRefAndValue( const SCH_REFERENCE& item1, const SCH_REFERENCE& item2 ); - - static bool sortByXPosition( const SCH_REFERENCE& item1, const SCH_REFERENCE& item2 ); - - static bool sortByYPosition( const SCH_REFERENCE& item1, const SCH_REFERENCE& item2 ); - - static bool sortByTimeStamp( const SCH_REFERENCE& item1, const SCH_REFERENCE& item2 ); - - static bool sortByReferenceOnly( const SCH_REFERENCE& item1, const SCH_REFERENCE& item2 ); - - /** - * Function CreateFirstFreeRefId - * searches for the first free reference number in \a aListId of reference numbers in use. - * This function just searches for a hole in a list of incremented numbers, this list must - * be sorted by increasing values and each value can be stored only once. The new value - * is added to the list. - * @see BuildRefIdInUseList to prepare this list - * @param aIdList The buffer that contains the reference numbers in use. - * @param aFirstValue The first expected free value - * @return The first free (not yet used) value. - */ - int CreateFirstFreeRefId( std::vector& aIdList, int aFirstValue ); -}; - -#endif // _NETLIST_H_ +#endif diff --git a/eeschema/onleftclick.cpp b/eeschema/onleftclick.cpp index 8a5a6adcaa..668fdb3471 100644 --- a/eeschema/onleftclick.cpp +++ b/eeschema/onleftclick.cpp @@ -31,7 +31,7 @@ #include #include #include -#include +#include #include #include diff --git a/eeschema/onrightclick.cpp b/eeschema/onrightclick.cpp index c5906fff9f..7c08eff063 100644 --- a/eeschema/onrightclick.cpp +++ b/eeschema/onrightclick.cpp @@ -31,7 +31,7 @@ #include #include #include -#include +#include #include #include diff --git a/eeschema/operations_on_items_lists.cpp b/eeschema/operations_on_items_lists.cpp index ef4daebd87..ed280717cc 100644 --- a/eeschema/operations_on_items_lists.cpp +++ b/eeschema/operations_on_items_lists.cpp @@ -31,7 +31,7 @@ #include #include #include -#include +#include #include #include diff --git a/eeschema/pinedit.cpp b/eeschema/pinedit.cpp index 0977a59dd2..7fbd00d22a 100644 --- a/eeschema/pinedit.cpp +++ b/eeschema/pinedit.cpp @@ -41,7 +41,6 @@ #include #include #include -#include #include <../common/dialogs/dialog_display_info_HTML_base.h> #include diff --git a/eeschema/plot_schematic_DXF.cpp b/eeschema/plot_schematic_DXF.cpp index 3786ee82de..523e224a84 100644 --- a/eeschema/plot_schematic_DXF.cpp +++ b/eeschema/plot_schematic_DXF.cpp @@ -28,7 +28,7 @@ #include #include #include -#include +#include #include #include #include diff --git a/eeschema/plot_schematic_HPGL.cpp b/eeschema/plot_schematic_HPGL.cpp index 979e24f40f..f700a3dfac 100644 --- a/eeschema/plot_schematic_HPGL.cpp +++ b/eeschema/plot_schematic_HPGL.cpp @@ -28,7 +28,7 @@ #include #include #include -#include +#include #include #include #include diff --git a/eeschema/plot_schematic_PDF.cpp b/eeschema/plot_schematic_PDF.cpp index 0d59493fc4..06d0d58293 100644 --- a/eeschema/plot_schematic_PDF.cpp +++ b/eeschema/plot_schematic_PDF.cpp @@ -28,7 +28,7 @@ #include #include #include -#include +#include #include #include #include diff --git a/eeschema/plot_schematic_PS.cpp b/eeschema/plot_schematic_PS.cpp index ce221d6795..257c3b5c72 100644 --- a/eeschema/plot_schematic_PS.cpp +++ b/eeschema/plot_schematic_PS.cpp @@ -27,7 +27,7 @@ #include #include #include -#include +#include #include #include #include diff --git a/eeschema/plot_schematic_SVG.cpp b/eeschema/plot_schematic_SVG.cpp index 2f8a869678..fe22466daf 100644 --- a/eeschema/plot_schematic_SVG.cpp +++ b/eeschema/plot_schematic_SVG.cpp @@ -31,7 +31,7 @@ #include #include #include -#include +#include #include #include #include diff --git a/eeschema/protos.h b/eeschema/protos.h index ae95bbb980..ae3cf1d00d 100644 --- a/eeschema/protos.h +++ b/eeschema/protos.h @@ -29,13 +29,9 @@ #include class EDA_DRAW_PANEL; -class EDA_DRAW_FRAME; class PICKED_ITEMS_LIST; -class PART_LIB; class SCH_ITEM; -//void DisplayCmpDoc( wxString& Name ); -wxString DataBaseGetName( EDA_DRAW_FRAME* frame, wxString& Keys, wxString& BufName ); // operations_on_item_lists.cpp void DeleteItemsInList( EDA_DRAW_PANEL* panel, PICKED_ITEMS_LIST& aItemsList ); @@ -59,43 +55,4 @@ void DrawDanglingSymbol( EDA_DRAW_PANEL* panel, wxDC* DC, const wxPoint& pos, EDA_COLOR_T Color ); -/***************/ -/* SELPART.CPP */ -/***************/ - -/** - * Function DisplayComponentsNamesInLib - * Select component from list of components in this library - * - * If == NULL Library, selection of library REQUESTED - * If only in research library - * - * Returns - * 1 if selected component - * 0 if canceled order - */ -int DisplayComponentsNamesInLib( EDA_DRAW_FRAME* frame, - PART_LIB* Library, - wxString& Buffer, - wxString& OldName ); - -/** - * Function SelectLibraryFromList - * displays a list of current loaded libraries, and allows the user to select - * a library - * This list is sorted, with the library cache always at end of the list - */ -PART_LIB* SelectLibraryFromList( EDA_DRAW_FRAME* frame ); - -/** - * Get the name component from a library to load. - * - * If no library specified, there will be demand for selection of a library. - * Returns - * 1 if selected component - * 0 if canceled order - * Place the name of the selected component list in BufName - */ -int GetNameOfPartToLoad( EDA_DRAW_FRAME* frame, PART_LIB* Lib, wxString& BufName ); - #endif /* __PROTOS_H__ */ diff --git a/eeschema/sch_base_frame.cpp b/eeschema/sch_base_frame.cpp index e32d89dd8a..b2a0696d6c 100644 --- a/eeschema/sch_base_frame.cpp +++ b/eeschema/sch_base_frame.cpp @@ -160,6 +160,10 @@ void SCH_BASE_FRAME::UpdateStatusBar() absformatter = wxT( "X %f Y %f" ); locformatter = wxT( "dx %f dy %f d %f" ); break; + + case DEGREES: + wxASSERT( false ); + break; } line.Printf( absformatter, dXpos, dYpos ); diff --git a/include/sch_base_frame.h b/eeschema/sch_base_frame.h similarity index 79% rename from include/sch_base_frame.h rename to eeschema/sch_base_frame.h index 255e675d72..fed27d7dd8 100644 --- a/include/sch_base_frame.h +++ b/eeschema/sch_base_frame.h @@ -3,8 +3,8 @@ /* * This program source code file is part of KiCad, a free EDA CAD application. * - * Copyright (C) 2012 SoftPLC Corporation, Dick Hollenbeck - * Copyright (C) 2012 KiCad Developers, see change_log.txt for contributors. + * Copyright (C) 2015 SoftPLC Corporation, Dick Hollenbeck + * Copyright (C) 2015 KiCad Developers, see change_log.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 @@ -32,6 +32,7 @@ class TITLE_BLOCK; class LIB_VIEW_FRAME; class LIB_EDIT_FRAME; class LIB_ALIAS; +class PART_LIB; /** * Class SCH_BASE_FRAME @@ -132,6 +133,42 @@ protected: * If the viewed is already opened from an other window, close it and reopen */ void OnOpenLibraryViewer( wxCommandEvent& event ); + + /** + * Function DisplayComponentsNamesInLib + * Select a component from the list of components in a library + * + * @param aLibrary = a reference to the library to explore + * If NULL the user will be prompted tp chose a library + * @param aBuffer = a wxString to put the selected component name + * + * @return true if a component is selected + * false on cancel + */ + bool DisplayListComponentsInLib( PART_LIB* aLibrary, wxString& aBuffer, + wxString& aPreviousChoice ); + + /** + * Function SelectLibraryFromList + * displays a list of current loaded libraries, and allows the user to select + * a library + * This list is sorted, with the library cache always at end of the list + * @return a reference to the selected library, or NULL + */ + PART_LIB* SelectLibraryFromList(); + + /** + * Function SelectPartNameToLoad + * Select a part name from the list of components (parts) found in a library. + * + * @param aLibrary = a reference to the library to explore + * If NULL the user will be prompted tp chose a library + * @param aBufName = a wxString to put the selected component name + * + * @return true if a component is selected + * false on cancel + */ + bool SelectPartNameToLoad( PART_LIB* aLibrary, wxString& aBufName ); }; #endif // SCH_BASE_FRAME_H_ diff --git a/eeschema/sch_bitmap.cpp b/eeschema/sch_bitmap.cpp index fb93c40c37..43b344ea65 100644 --- a/eeschema/sch_bitmap.cpp +++ b/eeschema/sch_bitmap.cpp @@ -29,7 +29,7 @@ #include #include #include -#include +#include #include #include diff --git a/eeschema/sch_bus_entry.cpp b/eeschema/sch_bus_entry.cpp index 6f14824083..227f88a6c1 100644 --- a/eeschema/sch_bus_entry.cpp +++ b/eeschema/sch_bus_entry.cpp @@ -38,7 +38,6 @@ #include #include -#include #include diff --git a/eeschema/sch_component.cpp b/eeschema/sch_component.cpp index 85ca4564b6..bf9dc92808 100644 --- a/eeschema/sch_component.cpp +++ b/eeschema/sch_component.cpp @@ -31,10 +31,9 @@ #include #include #include -#include #include #include -#include +#include #include #include diff --git a/eeschema/sch_field.cpp b/eeschema/sch_field.cpp index a48b1fb478..a1fdc2d7ab 100644 --- a/eeschema/sch_field.cpp +++ b/eeschema/sch_field.cpp @@ -41,12 +41,10 @@ #include #include #include -#include -#include +#include #include #include -#include #include #include #include diff --git a/common/sch_item_struct.cpp b/eeschema/sch_item_struct.cpp similarity index 99% rename from common/sch_item_struct.cpp rename to eeschema/sch_item_struct.cpp index a5a8937409..9a2cda7810 100644 --- a/common/sch_item_struct.cpp +++ b/eeschema/sch_item_struct.cpp @@ -33,7 +33,7 @@ #include #include #include -#include +#include #include diff --git a/include/sch_item_struct.h b/eeschema/sch_item_struct.h similarity index 100% rename from include/sch_item_struct.h rename to eeschema/sch_item_struct.h diff --git a/eeschema/sch_line.cpp b/eeschema/sch_line.cpp index 58dd1d8c3b..60f57ad95a 100644 --- a/eeschema/sch_line.cpp +++ b/eeschema/sch_line.cpp @@ -1,8 +1,8 @@ /* * This program source code file is part of KiCad, a free EDA CAD application. * - * Copyright (C) 2009 Jean-Pierre Charras, jaen-pierre.charras@gipsa-lab.inpg.com - * Copyright (C) 1992-2011 KiCad Developers, see AUTHORS.txt for contributors. + * Copyright (C) 2015 Jean-Pierre Charras, jaen-pierre.charras@gipsa-lab.inpg.com + * Copyright (C) 1992-2015 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 @@ -31,8 +31,6 @@ #include #include #include -#include -#include #include #include #include diff --git a/eeschema/sch_no_connect.cpp b/eeschema/sch_no_connect.cpp index b92ebe5003..f33f3e9ddd 100644 --- a/eeschema/sch_no_connect.cpp +++ b/eeschema/sch_no_connect.cpp @@ -1,8 +1,8 @@ /* * This program source code file is part of KiCad, a free EDA CAD application. * - * Copyright (C) 2009 Jean-Pierre Charras, jaen-pierre.charras@gipsa-lab.inpg.com - * Copyright (C) 1992-2011 KiCad Developers, see AUTHORS.txt for contributors. + * Copyright (C) 2015 Jean-Pierre Charras, jaen-pierre.charras@gipsa-lab.inpg.com + * Copyright (C) 1992-2015 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 @@ -32,12 +32,9 @@ #include #include #include -#include -#include #include #include -#include #include #include diff --git a/eeschema/sch_reference_list.h b/eeschema/sch_reference_list.h new file mode 100644 index 0000000000..7133d4bc47 --- /dev/null +++ b/eeschema/sch_reference_list.h @@ -0,0 +1,453 @@ +/* + * This program source code file is part of KiCad, a free EDA CAD application. + * + * Copyright (C) 1992-2011 jean-pierre Charras + * Copyright (C) 1992-2011 Wayne Stambaugh + * Copyright (C) 1992-2015 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 + * as published by the Free Software Foundation; either version 2 + * of the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, you may find one here: + * http://www.gnu.org/licenses/old-licenses/gpl-2.0.html + * or you may search the http://www.gnu.org website for the version 2 license, + * or you may write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA + */ + + +/** + * @file eeschema/sch_reference_list.h + */ + +#ifndef _SCH_REFERENCE_LIST_H_ +#define _SCH_REFERENCE_LIST_H_ + + +#include + +#include +#include +#include +#include + + +/** + * Class SCH_REFERENCE + * is used as a helper to define a component's reference designator in a schematic. This + * helper is required in a complex hierarchy because a component can be used more than + * once and its reference depends on the sheet path. This class is used to flatten the + * schematic hierarchy for annotation, net list generation, and bill of material + * generation. + */ +class SCH_REFERENCE +{ + /// Component reference prefix, without number (for IC1, this is IC) ) + UTF8 m_Ref; // it's private, use the accessors please + SCH_COMPONENT* m_RootCmp; ///< The component associated the reference object. + LIB_PART* m_Entry; ///< The source component from a library. + wxPoint m_CmpPos; ///< The physical position of the component in schematic + ///< used to annotate by X or Y position + int m_Unit; ///< The unit number for components with multiple parts + ///< per package. + SCH_SHEET_PATH m_SheetPath; ///< The sheet path for this reference. + bool m_IsNew; ///< True if not yet annotated. + int m_SheetNum; ///< The sheet number for the reference. + time_t m_TimeStamp; ///< The time stamp for the reference. + EDA_TEXT* m_Value; ///< The component value of the refernce. It is the + ///< same for all instances. + int m_NumRef; ///< The numeric part of the reference designator. + int m_Flag; + + friend class SCH_REFERENCE_LIST; + + +public: + + SCH_REFERENCE() : + m_SheetPath() + { + m_RootCmp = NULL; + m_Entry = NULL; + m_Unit = 0; + m_TimeStamp = 0; + m_IsNew = false; + m_Value = NULL; + m_NumRef = 0; + m_Flag = 0; + m_SheetNum = 0; + } + + SCH_REFERENCE( SCH_COMPONENT* aComponent, LIB_PART* aLibComponent, + SCH_SHEET_PATH& aSheetPath ); + + SCH_COMPONENT* GetComp() const { return m_RootCmp; } + + LIB_PART* GetLibComponent() const { return m_Entry; } + + SCH_SHEET_PATH GetSheetPath() const { return m_SheetPath; } + + int GetUnit() const { return m_Unit; } + + void SetSheetNumber( int aSheetNumber ) { m_SheetNum = aSheetNumber; } + + /** + * Function Annotate + * updates the annotation of the component according the the current object state. + */ + void Annotate(); + + /** + * Function Split + * attempts to split the reference designator into a name (U) and number (1). If the + * last character is '?' or not a digit, the reference is tagged as not annotated. + * For components with multiple parts per package that are not already annotated, set + * m_Unit to a max value (0x7FFFFFFF). + */ + void Split(); + + /* Some accessors which hide the strategy of how the reference is stored, + thereby making it easy to change that strategy. + */ + + void SetRef( const wxString& aReference ) + { + m_Ref = aReference; + } + + wxString GetRef() const + { + return m_Ref; + } + void SetRefStr( const std::string& aReference ) + { + m_Ref = aReference; + } + const char* GetRefStr() const + { + return m_Ref.c_str(); + } + + int CompareValue( const SCH_REFERENCE& item ) const + { + return Cmp_KEEPCASE( m_Value->GetText(), item.m_Value->GetText() ); + } + + int CompareRef( const SCH_REFERENCE& item ) const + { + return m_Ref.compare( item.m_Ref ); + } + + int CompareLibName( const SCH_REFERENCE& item ) const + { + return Cmp_KEEPCASE( m_RootCmp->GetPartName(), item.m_RootCmp->GetPartName() ); + } + + bool IsUnitsLocked() + { + return m_Entry->UnitsLocked(); + } +}; + + +/** + * Class SCH_REFERENCE_LIST + * is used to create a flattened list of components because in a complex hierarchy, a component + * can be used more than once and its reference designator is dependent on the sheet path for + * the same component. This flattened list is used for netlist generation, BOM generation, + * and schematic annotation. + */ +class SCH_REFERENCE_LIST +{ +private: + std::vector componentFlatList; + +public: + /** Constructor + */ + SCH_REFERENCE_LIST() + { + } + + SCH_REFERENCE& operator[]( int aIndex ) + { + return componentFlatList[ aIndex ]; + } + + /** + * Function GetCount + * @return the number of items in the list + */ + unsigned GetCount() + { + return componentFlatList.size(); + } + + /** + * Function GetItem + * @return the aIdx item + */ + SCH_REFERENCE& GetItem( int aIdx ) + { + return componentFlatList[aIdx]; + } + + /** + * Function AddItem + * adds a SCH_REFERENCE object to the list of references. + * @param aItem - a SCH_REFERENCE item to add + */ + void AddItem( SCH_REFERENCE& aItem ) + { + componentFlatList.push_back( aItem ); + } + + /** + * Function RemoveItem + * removes an item from the list of references. + * + * @param aIndex is the index of the item to be removed. + */ + void RemoveItem( unsigned int aIndex ); + + /** + * Function RemoveSubComponentsFromList + * Remove sub components from the list, when multiples parts per package are + * found in this list. + * Useful to create BOM, when a component must appear only once + */ + void RemoveSubComponentsFromList(); + + /* Sort functions: + * Sort functions are used to sort components for annotation or BOM generation. + * Because sorting depend on we want to do, there are many sort functions. + * Note: + * When creating BOM, components are fully annotated. + * references are something like U3, U5 or R4, R8 + * When annotating, some or all components are not annotated, + * i.e. ref is only U or R, with no number. + */ + + /** + * Function SplitReferences + * attempts to split all reference designators into a name (U) and number (1). If the + * last character is '?' or not a digit, the reference is tagged as not annotated. + * For components with multiple parts per package that are not already annotated, set + * m_Unit to a max value (0x7FFFFFFF). + * @see SCH_REFERENCE::Split() + */ + void SplitReferences() + { + for( unsigned ii = 0; ii < GetCount(); ii++ ) + componentFlatList[ii].Split(); + } + + /** + * function UpdateAnnotation + * Updates the reference components for the schematic project (or the current sheet) + * Note: this function does not calculate the reference numbers stored in m_NumRef + * So, it must be called after calculation of new reference numbers + * @see SCH_REFERENCE::Annotate() + */ + void UpdateAnnotation() + { + /* update the reference numbers */ + for( unsigned ii = 0; ii < GetCount(); ii++ ) + { + componentFlatList[ii].Annotate(); + } + } + + /** + * Function Annotate + * set the reference designators in the list that have not been annotated. + * @param aUseSheetNum Set to true to start annotation for each sheet at the sheet number + * times \a aSheetIntervalId. Otherwise annotate incrementally. + * @param aSheetIntervalId The per sheet reference designator multiplier. + *

+ * If a the sheet number is 2 and \a aSheetIntervalId is 100, then the first reference + * designator would be 201 and the last reference designator would be 299 when no overlap + * occurs with sheet number 3. If there are 150 items in sheet number 2, then items are + * referenced U201 to U351, and items in sheet 3 start from U352 + *

+ */ + void Annotate( bool aUseSheetNum, int aSheetIntervalId ); + + /** + * Function CheckAnnotation + * check for annotations errors. + *

+ * The following annotation error conditions are tested: + *

    + *
  • Components not annotated.
  • + *
  • Components having the same reference designator (duplicates).
  • + *
  • Components with multiple parts per package having different reference designators.
  • + *
  • Components with multiple parts per package with invalid part count.
  • + *
+ *

+ * @param aMessageList A wxArrayString to store error messages. + * @return The number of errors found. + */ + int CheckAnnotation( wxArrayString* aMessageList ); + + /** + * Function sortByXCoordinate + * sorts the list of references by X position. + *

+ * Components are sorted as follows: + *

    + *
  • Numeric value of reference designator.
  • + *
  • Sheet number.
  • + *
  • X coordinate position.
  • + *
  • Y coordinate position.
  • + *
  • Time stamp.
  • + *
+ *

+ */ + void SortByXCoordinate() + { + sort( componentFlatList.begin(), componentFlatList.end(), sortByXPosition ); + } + + /** + * Function sortByYCoordinate + * sorts the list of references by Y position. + *

+ * Components are sorted as follows: + *

    + *
  • Numeric value of reference designator.
  • + *
  • Sheet number.
  • + *
  • Y coordinate position.
  • + *
  • X coordinate position.
  • + *
  • Time stamp.
  • + *
+ *

+ */ + void SortByYCoordinate() + { + sort( componentFlatList.begin(), componentFlatList.end(), sortByYPosition ); + } + + /** + * Function SortComponentsByTimeStamp + * sort the flat list by Time Stamp. + * Useful to detect duplicate Time Stamps + */ + void SortByTimeStamp() + { + sort( componentFlatList.begin(), componentFlatList.end(), sortByTimeStamp ); + } + + /** + * Function SortByRefAndValue + * sorts the list of references by value. + *

+ * Components are sorted in the following order: + *

    + *
  • Numeric value of reference designator.
  • + *
  • Value of component.
  • + *
  • Unit number when component has multiple parts.
  • + *
  • Sheet number.
  • + *
  • X coordinate position.
  • + *
  • Y coordinate position.
  • + *
+ *

+ */ + void SortByRefAndValue() + { + sort( componentFlatList.begin(), componentFlatList.end(), sortByRefAndValue ); + } + + /** + * Function SortByReferenceOnly + * sorts the list of references by reference. + *

+ * Components are sorted in the following order: + *

    + *
  • Numeric value of reference designator.
  • + *
  • Unit number when component has multiple parts.
  • + *
+ *

+ */ + void SortByReferenceOnly() + { + sort( componentFlatList.begin(), componentFlatList.end(), sortByReferenceOnly ); + } + + /** + * Function GetUnit + * searches the sorted list of components for a another component with the same + * reference and a given part unit. Use this method to manage components with + * multiple parts per package. + * @param aIndex = index in aComponentsList for of given SCH_REFERENCE item to test. + * @param aUnit = the given unit number to search + * @return index in aComponentsList if found or -1 if not found + */ + int FindUnit( size_t aIndex, int aUnit ); + + /** + * Function ResetHiddenReferences + * clears the annotation for all references that have an invisible reference designator. + * Invisible reference designators always have # as the first letter. + */ + void ResetHiddenReferences(); + + /** + * Function GetRefsInUse + * adds all the reference designator numbers greater than \a aMinRefId to \a aIdList + * skipping the reference at \a aIndex. + * @param aIndex = the current component index to use for reference prefix filtering. + * @param aIdList = the buffer to fill + * @param aMinRefId = the min id value to store. all values < aMinRefId are ignored + */ + void GetRefsInUse( int aIndex, std::vector< int >& aIdList, int aMinRefId ); + + /** + * Function GetLastReference + * returns the last used (greatest) reference number in the reference list + * for the prefix reference given by \a aIndex. The component list must be + * sorted. + * + * @param aIndex The index of the reference item used for the search pattern. + * @param aMinValue The minimum value for the current search. + */ + int GetLastReference( int aIndex, int aMinValue ); + +private: + /* sort functions used to sort componentFlatList + */ + + static bool sortByRefAndValue( const SCH_REFERENCE& item1, const SCH_REFERENCE& item2 ); + + static bool sortByXPosition( const SCH_REFERENCE& item1, const SCH_REFERENCE& item2 ); + + static bool sortByYPosition( const SCH_REFERENCE& item1, const SCH_REFERENCE& item2 ); + + static bool sortByTimeStamp( const SCH_REFERENCE& item1, const SCH_REFERENCE& item2 ); + + static bool sortByReferenceOnly( const SCH_REFERENCE& item1, const SCH_REFERENCE& item2 ); + + /** + * Function CreateFirstFreeRefId + * searches for the first free reference number in \a aListId of reference numbers in use. + * This function just searches for a hole in a list of incremented numbers, this list must + * be sorted by increasing values and each value can be stored only once. The new value + * is added to the list. + * @see BuildRefIdInUseList to prepare this list + * @param aIdList The buffer that contains the reference numbers in use. + * @param aFirstValue The first expected free value + * @return The first free (not yet used) value. + */ + int CreateFirstFreeRefId( std::vector& aIdList, int aFirstValue ); +}; + + +#endif // _SCH_REFERENCE_LIST_H_ diff --git a/eeschema/sch_screen.cpp b/eeschema/sch_screen.cpp index 9965fb4c83..6d0d24d66c 100644 --- a/eeschema/sch_screen.cpp +++ b/eeschema/sch_screen.cpp @@ -37,7 +37,7 @@ #include #include #include -#include +#include #include #include diff --git a/eeschema/sch_sheet.cpp b/eeschema/sch_sheet.cpp index 6a732eb1e6..57b9e86a13 100644 --- a/eeschema/sch_sheet.cpp +++ b/eeschema/sch_sheet.cpp @@ -32,7 +32,7 @@ #include #include #include -#include +#include #include #include #include diff --git a/eeschema/sch_sheet_path.cpp b/eeschema/sch_sheet_path.cpp index 4db1666c0d..28900e4b30 100644 --- a/eeschema/sch_sheet_path.cpp +++ b/eeschema/sch_sheet_path.cpp @@ -35,7 +35,7 @@ #include #include -#include +#include #include #include #include diff --git a/eeschema/sch_sheet_pin.cpp b/eeschema/sch_sheet_pin.cpp index f679a89a59..045b25728a 100644 --- a/eeschema/sch_sheet_pin.cpp +++ b/eeschema/sch_sheet_pin.cpp @@ -34,10 +34,9 @@ #include #include #include -#include +#include #include -#include #include #include diff --git a/eeschema/sch_text.cpp b/eeschema/sch_text.cpp index 3b1921dfb1..3dc9929687 100644 --- a/eeschema/sch_text.cpp +++ b/eeschema/sch_text.cpp @@ -1,8 +1,9 @@ /* * This program source code file is part of KiCad, a free EDA CAD application. * - * Copyright (C) 2009 Jean-Pierre Charras, jp.charras at wanadoo.fr - * Copyright (C) 1992-2011 KiCad Developers, see AUTHORS.txt for contributors. + * Copyright (C) 2015 Jean-Pierre Charras, jp.charras at wanadoo.fr + * Copyright (C) 2015 Wayne Stambaugh + * Copyright (C) 1992-2015 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 @@ -34,7 +35,7 @@ #include #include #include -#include +#include #include #include #include @@ -558,7 +559,7 @@ bool SCH_TEXT::IsSelectStateChanged( const wxRect& aRect ) if( aRect.Contains( m_Pos ) ) SetFlags( SELECTED ); else - SetFlags( SELECTED ); + ClearFlags( SELECTED ); return previousState != IsSelected(); } diff --git a/eeschema/schedit.cpp b/eeschema/schedit.cpp index b48ea7e87a..dcad6648cf 100644 --- a/eeschema/schedit.cpp +++ b/eeschema/schedit.cpp @@ -34,7 +34,7 @@ #include #include #include -#include +#include #include #include diff --git a/eeschema/schematic_undo_redo.cpp b/eeschema/schematic_undo_redo.cpp index caa2b4671b..4dcbbe1be5 100644 --- a/eeschema/schematic_undo_redo.cpp +++ b/eeschema/schematic_undo_redo.cpp @@ -29,7 +29,7 @@ #include #include -#include +#include #include #include diff --git a/eeschema/schframe.cpp b/eeschema/schframe.cpp index 65c9e4928e..4549da4ebf 100644 --- a/eeschema/schframe.cpp +++ b/eeschema/schframe.cpp @@ -43,7 +43,7 @@ #include #include #include -#include +#include #include #include @@ -52,6 +52,7 @@ #include #include #include +#include #include #include diff --git a/include/wxEeschemaStruct.h b/eeschema/schframe.h similarity index 99% rename from include/wxEeschemaStruct.h rename to eeschema/schframe.h index 860d6e25bb..245132da56 100644 --- a/include/wxEeschemaStruct.h +++ b/eeschema/schframe.h @@ -1,9 +1,9 @@ /* * This program source code file is part of KiCad, a free EDA CAD application. * - * Copyright (C) 2004 Jean-Pierre Charras, jaen-pierre.charras@gipsa-lab.inpg.com - * Copyright (C) 2008-2011 Wayne Stambaugh - * Copyright (C) 2004-2011 KiCad Developers, see change_log.txt for contributors. + * Copyright (C) 2015 Jean-Pierre Charras, jp.charras wanadoo.fr + * Copyright (C) 2008-2015 Wayne Stambaugh + * Copyright (C) 2004-2015 KiCad Developers, see change_log.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 @@ -44,9 +44,6 @@ class LIB_VIEW_FRAME; class DRAWSEGMENT; class SCH_ITEM; class SCH_NO_CONNECT; -class CMP_LIBRARY; -class LIB_COMPONENT; -class LIB_DRAW_ITEM; class EDA_ITEM; class SCH_BUS_ENTRY_BASE; class SCH_BUS_WIRE_ENTRY; diff --git a/eeschema/selpart.cpp b/eeschema/selpart.cpp index 26239d1d7d..b0b36297b6 100644 --- a/eeschema/selpart.cpp +++ b/eeschema/selpart.cpp @@ -1,8 +1,8 @@ /* * This program source code file is part of KiCad, a free EDA CAD application. * - * Copyright (C) 2007 Jean-Pierre Charras, jp.charras at wanadoo.fr - * Copyright (C) 2014 KiCad Developers, see CHANGELOG.TXT for contributors. + * Copyright (C) 2015 Jean-Pierre Charras, jp.charras at wanadoo.fr + * Copyright (C) 2015 KiCad Developers, see CHANGELOG.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 @@ -29,23 +29,40 @@ #include #include #include -#include +#include +#include #include -#include #include #include - -PART_LIB* SelectLibraryFromList( EDA_DRAW_FRAME* aFrame ) +// Used in DisplayListComponentsInLib: this is a callback function for EDA_LIST_DIALOG +// to display keywords and description of a component +static void DisplayCmpDocAndKeywords( wxString& aName, void* aData ) { - PROJECT& prj = aFrame->Prj(); + PART_LIBS* libs = (PART_LIBS*) aData; + + wxASSERT( libs ); + + LIB_ALIAS* part = libs->FindLibraryEntry( aName ); + + if( !part ) + return; + + aName = wxT( "Description: " ) + part->GetDescription(); + aName += wxT( "\nKey Words: " ) + part->GetKeyWords(); +} + + +PART_LIB* SCH_BASE_FRAME::SelectLibraryFromList() +{ + PROJECT& prj = Prj(); if( PART_LIBS* libs = prj.SchLibs() ) { if( !libs->GetLibraryCount() ) { - DisplayError( aFrame, _( "No component libraries are loaded." ) ); + DisplayError( this, _( "No component libraries are loaded." ) ); return NULL; } @@ -69,7 +86,7 @@ PART_LIB* SelectLibraryFromList( EDA_DRAW_FRAME* aFrame ) wxString old_lib_name = prj.GetRString( PROJECT::SCH_LIB_SELECT ); - EDA_LIST_DIALOG dlg( aFrame, _( "Select Library" ), headers, itemsToDisplay, old_lib_name ); + EDA_LIST_DIALOG dlg( this, _( "Select Library" ), headers, itemsToDisplay, old_lib_name ); if( dlg.ShowModal() != wxID_OK ) return NULL; @@ -91,22 +108,19 @@ PART_LIB* SelectLibraryFromList( EDA_DRAW_FRAME* aFrame ) } -void DisplayCmpDocAndKeywords( wxString& aName, void* aData ); - -int DisplayComponentsNamesInLib( EDA_DRAW_FRAME* frame, - PART_LIB* Library, - wxString& Buffer, wxString& OldName ) +bool SCH_BASE_FRAME::DisplayListComponentsInLib( PART_LIB* aLibrary, + wxString& aBuffer, wxString& aPreviousChoice ) { wxArrayString nameList; - if( Library == NULL ) - Library = SelectLibraryFromList( frame ); + if( aLibrary == NULL ) + aLibrary = SelectLibraryFromList(); - if( Library == NULL ) - return 0; + if( aLibrary == NULL ) + return false; - Library->GetEntryNames( nameList ); + aLibrary->GetEntryNames( nameList ); wxArrayString headers; headers.Add( wxT("Component") ); @@ -118,32 +132,32 @@ int DisplayComponentsNamesInLib( EDA_DRAW_FRAME* frame, { wxArrayString item; item.Add( nameList[i] ); - item.Add( Library->GetLogicalName() ); + item.Add( aLibrary->GetLogicalName() ); itemsToDisplay.push_back( item ); } - EDA_LIST_DIALOG dlg( frame, _( "Select Component" ), headers, itemsToDisplay, - OldName, DisplayCmpDocAndKeywords, frame->Prj().SchLibs() ); + EDA_LIST_DIALOG dlg( this, _( "Select Component" ), headers, itemsToDisplay, + aPreviousChoice, DisplayCmpDocAndKeywords, Prj().SchLibs() ); if( dlg.ShowModal() != wxID_OK ) - return 0; + return false; - Buffer = dlg.GetTextSelection(); + aBuffer = dlg.GetTextSelection(); - return 1; + return true; } -int GetNameOfPartToLoad( EDA_DRAW_FRAME* frame, PART_LIB* Library, wxString& BufName ) +bool SCH_BASE_FRAME::SelectPartNameToLoad( PART_LIB* aLibrary, wxString& aBufName ) { int ii; - static wxString OldCmpName; + static wxString previousCmpName; - ii = DisplayComponentsNamesInLib( frame, Library, BufName, OldCmpName ); + ii = DisplayListComponentsInLib( aLibrary, aBufName, previousCmpName ); - if( ii <= 0 || BufName.IsEmpty() ) - return 0; + if( ii <= 0 || aBufName.IsEmpty() ) + return false; - OldCmpName = BufName; - return 1; + previousCmpName = aBufName; + return true; } diff --git a/eeschema/sheet.cpp b/eeschema/sheet.cpp index d0e143d2b1..59b4b44d30 100644 --- a/eeschema/sheet.cpp +++ b/eeschema/sheet.cpp @@ -29,7 +29,7 @@ #include #include #include -#include +#include #include #include diff --git a/eeschema/sheetlab.cpp b/eeschema/sheetlab.cpp index 9069c1fed9..c853b72950 100644 --- a/eeschema/sheetlab.cpp +++ b/eeschema/sheetlab.cpp @@ -33,7 +33,7 @@ #include #include #include -#include +#include #include #include diff --git a/eeschema/tool_sch.cpp b/eeschema/tool_sch.cpp index 726dd6ebe4..92287aff93 100644 --- a/eeschema/tool_sch.cpp +++ b/eeschema/tool_sch.cpp @@ -29,7 +29,7 @@ #include #include -#include +#include #include #include diff --git a/eeschema/viewlib_frame.cpp b/eeschema/viewlib_frame.cpp index 330777e374..33c2d69cc8 100644 --- a/eeschema/viewlib_frame.cpp +++ b/eeschema/viewlib_frame.cpp @@ -32,7 +32,7 @@ #include #include #include -#include +#include #include #include @@ -42,9 +42,7 @@ #include -/** - * Save previous component library viewer state. - */ +// Save previous component library viewer state. wxString LIB_VIEW_FRAME::m_libraryName; wxString LIB_VIEW_FRAME::m_entryName; diff --git a/eeschema/viewlibs.cpp b/eeschema/viewlibs.cpp index 4f1c104efc..823d506e75 100644 --- a/eeschema/viewlibs.cpp +++ b/eeschema/viewlibs.cpp @@ -1,8 +1,8 @@ /* * This program source code file is part of KiCad, a free EDA CAD application. * - * Copyright (C) 2007 Jean-Pierre Charras, jp.charras at wanadoo.fr - * Copyright (C) 2014 KiCad Developers, see CHANGELOG.TXT for contributors. + * Copyright (C) 2015 Jean-Pierre Charras, jp.charras at wanadoo.fr + * Copyright (C) 2015 KiCad Developers, see CHANGELOG.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 @@ -36,7 +36,6 @@ #include #include -#include #include #include #include @@ -152,7 +151,7 @@ void LIB_VIEW_FRAME::SelectCurrentLibrary() { PART_LIB* Lib; - Lib = SelectLibraryFromList( this ); + Lib = SelectLibraryFromList(); if( Lib ) { @@ -179,6 +178,7 @@ void LIB_VIEW_FRAME::SelectAndViewLibraryPart( int option ) { if( m_libraryName.IsEmpty() ) SelectCurrentLibrary(); + if( m_libraryName.IsEmpty() ) return; @@ -224,9 +224,7 @@ void LIB_VIEW_FRAME::ViewOneLibraryContent( PART_LIB* Lib, int Flag ) return; if( Flag == NEW_PART ) - { - DisplayComponentsNamesInLib( this, Lib, CmpName, m_entryName ); - } + DisplayListComponentsInLib( Lib, CmpName, m_entryName ); if( Flag == NEXT_PART ) { @@ -259,59 +257,56 @@ void LIB_VIEW_FRAME::ViewOneLibraryContent( PART_LIB* Lib, int Flag ) if( id >= 0 ) m_cmpList->SetSelection( id ); } + ReCreateHToolbar(); } void LIB_VIEW_FRAME::RedrawActiveWindow( wxDC* DC, bool EraseBg ) { - if( PART_LIBS* libs = Prj().SchLibs() ) + LIB_ALIAS* entry = Prj().SchLibs()->FindLibraryEntry( m_entryName, m_libraryName ); + + if( !entry ) + return; + + LIB_PART* part = entry->GetPart(); + + if( !part ) + return; + + wxString msg; + wxString tmp; + + m_canvas->DrawBackGround( DC ); + + if( !entry->IsRoot() ) { - if( PART_LIB* lib = libs->FindLibrary( m_libraryName ) ) - { - if( LIB_ALIAS* entry = lib->FindEntry( m_entryName ) ) - { - if( LIB_PART* part = entry->GetPart() ) - { - wxString msg; - wxString tmp; + // Temporarily change the name field text to reflect the alias name. + msg = entry->GetName(); + tmp = part->GetName(); - m_canvas->DrawBackGround( DC ); + part->SetName( msg ); - if( !entry->IsRoot() ) - { - // Temporarily change the name field text to reflect the alias name. - msg = entry->GetName(); - tmp = part->GetName(); + if( m_unit < 1 ) + m_unit = 1; - part->SetName( msg ); - - if( m_unit < 1 ) - m_unit = 1; - - if( m_convert < 1 ) - m_convert = 1; - } - else - { - msg = _( "None" ); - } - - part->Draw( m_canvas, DC, wxPoint( 0, 0 ), m_unit, m_convert, GR_DEFAULT_DRAWMODE ); - - // Redraw the cursor - m_canvas->DrawCrossHair( DC ); - - if( !tmp.IsEmpty() ) - part->SetName( tmp ); - - ClearMsgPanel(); - AppendMsgPanel( _( "Part" ), part->GetName(), BLUE, 6 ); - AppendMsgPanel( _( "Alias" ), msg, RED, 6 ); - AppendMsgPanel( _( "Description" ), entry->GetDescription(), CYAN, 6 ); - AppendMsgPanel( _( "Key words" ), entry->GetKeyWords(), DARKDARKGRAY ); - } - } - } + if( m_convert < 1 ) + m_convert = 1; } + else + msg = _( "None" ); + + part->Draw( m_canvas, DC, wxPoint( 0, 0 ), m_unit, m_convert, GR_DEFAULT_DRAWMODE ); + + // Redraw the cursor + m_canvas->DrawCrossHair( DC ); + + if( !tmp.IsEmpty() ) + part->SetName( tmp ); + + ClearMsgPanel(); + AppendMsgPanel( _( "Part" ), part->GetName(), BLUE, 6 ); + AppendMsgPanel( _( "Alias" ), msg, RED, 6 ); + AppendMsgPanel( _( "Description" ), entry->GetDescription(), CYAN, 6 ); + AppendMsgPanel( _( "Key words" ), entry->GetKeyWords(), DARKDARKGRAY ); } diff --git a/gerbview/export_to_pcbnew.cpp b/gerbview/export_to_pcbnew.cpp index 51c1cfc292..fc81b547e4 100644 --- a/gerbview/export_to_pcbnew.cpp +++ b/gerbview/export_to_pcbnew.cpp @@ -142,6 +142,8 @@ GBR_TO_PCB_EXPORTER::GBR_TO_PCB_EXPORTER( GERBVIEW_FRAME* aFrame, const wxString { m_gerbview_frame = aFrame; m_pcb_file_name = aFileName; + m_fp = NULL; + m_pcbCopperLayersCount = 2; } diff --git a/gerbview/gerbview_frame.cpp b/gerbview/gerbview_frame.cpp index 29b61c6ca8..13063dbe1f 100644 --- a/gerbview/gerbview_frame.cpp +++ b/gerbview/gerbview_frame.cpp @@ -846,6 +846,10 @@ void GERBVIEW_FRAME::UpdateStatusBar() case UNSCALED_UNITS: formatter = wxT( "Ro %f Th %f" ); break; + + case DEGREES: + wxASSERT( false ); + break; } line.Printf( formatter, To_User_Unit( g_UserUnit, ro ), theta ); @@ -875,6 +879,10 @@ void GERBVIEW_FRAME::UpdateStatusBar() absformatter = wxT( "X %f Y %f" ); locformatter = wxT( "dx %f dy %f d %f" ); break; + + case DEGREES: + wxASSERT( false ); + break; } line.Printf( absformatter, dXpos, dYpos ); diff --git a/include/base_units.h b/include/base_units.h index 2858cc7388..c4092b1dd9 100644 --- a/include/base_units.h +++ b/include/base_units.h @@ -148,10 +148,21 @@ wxString& operator <<( wxString& aString, const wxPoint& aPoint ); void PutValueInLocalUnits( wxTextCtrl& aTextCtr, int aValue ); /** - * Return in internal units the value "val" given in inch or mm + * Return in internal units the value "val" given in a real unit + * such as "in", "mm" or "deg" */ double From_User_Unit( EDA_UNITS_T aUnit, double aValue ); + +/** + * Function DoubleValueFromString + * converts \a aTextValue to a double + * @param aUnits The units of \a aTextValue. + * @param aTextValue A reference to a wxString object containing the string to convert. + * @return A double representing that value in internal units + */ +double DoubleValueFromString( EDA_UNITS_T aUnits, const wxString& aTextValue ); + /** * Function ValueFromString * converts \a aTextValue in \a aUnits to internal units used by the application. diff --git a/include/bitmaps.h b/include/bitmaps.h index 3f8482951a..bb77f1cf27 100644 --- a/include/bitmaps.h +++ b/include/bitmaps.h @@ -102,6 +102,12 @@ EXTERN_BITMAP( anchor_xpm ) EXTERN_BITMAP( annotate_down_right_xpm ) EXTERN_BITMAP( annotate_right_down_xpm ) EXTERN_BITMAP( annotate_xpm ) +EXTERN_BITMAP( array_line_xpm ) +EXTERN_BITMAP( array_module_xpm ) +EXTERN_BITMAP( array_pad_xpm ) +EXTERN_BITMAP( array_target_xpm ) +EXTERN_BITMAP( array_text_xpm ) +EXTERN_BITMAP( array_zone_xpm ) EXTERN_BITMAP( auto_associe_xpm ) EXTERN_BITMAP( auto_delete_track_xpm ) EXTERN_BITMAP( auto_track_width_xpm ) @@ -174,6 +180,12 @@ EXTERN_BITMAP( drag_segment_withslope_xpm ) EXTERN_BITMAP( drag_track_segment_xpm ) EXTERN_BITMAP( drc_off_xpm ) EXTERN_BITMAP( drc_xpm ) +EXTERN_BITMAP( duplicate_line_xpm ) +EXTERN_BITMAP( duplicate_module_xpm ) +EXTERN_BITMAP( duplicate_pad_xpm ) +EXTERN_BITMAP( duplicate_target_xpm ) +EXTERN_BITMAP( duplicate_text_xpm ) +EXTERN_BITMAP( duplicate_zone_xpm ) EXTERN_BITMAP( edges_sketch_xpm ) EXTERN_BITMAP( edit_comp_footprint_xpm ) EXTERN_BITMAP( edit_component_xpm ) @@ -332,8 +344,10 @@ EXTERN_BITMAP( move_polygon_xpm ) EXTERN_BITMAP( move_rectangle_xpm ) EXTERN_BITMAP( move_sheet_xpm ) EXTERN_BITMAP( move_text_xpm ) +EXTERN_BITMAP( move_target_xpm ) EXTERN_BITMAP( move_track_segment_xpm ) EXTERN_BITMAP( move_track_xpm ) +EXTERN_BITMAP( move_zone_xpm ) EXTERN_BITMAP( move_xpm ) EXTERN_BITMAP( mw_add_gap_xpm ) EXTERN_BITMAP( mw_add_line_xpm ) diff --git a/include/block_commande.h b/include/block_commande.h index cf2c140237..8d2b94fa0e 100644 --- a/include/block_commande.h +++ b/include/block_commande.h @@ -62,6 +62,7 @@ typedef enum { BLOCK_ZOOM, BLOCK_ABORT, BLOCK_PRESELECT_MOVE, + BLOCK_MOVE_EXACT, BLOCK_SELECT_ITEMS_ONLY, BLOCK_MIRROR_X, BLOCK_MIRROR_Y diff --git a/include/class_board_item.h b/include/class_board_item.h index 19e3f9ab6e..953759fa6d 100644 --- a/include/class_board_item.h +++ b/include/class_board_item.h @@ -78,6 +78,9 @@ class BOARD_ITEM : public EDA_ITEM protected: LAYER_ID m_Layer; + static int getTrailingInt( wxString aStr ); + static int getNextNumberInSequence( std::set aSeq, bool aFillSequenceGaps ); + public: BOARD_ITEM( BOARD_ITEM* aParent, KICAD_T idtype ) : @@ -89,6 +92,16 @@ public: virtual const wxPoint& GetPosition() const = 0; + /** + * Function GetCenter() + * + * This defaults to the same point as returned by GetPosition(), unless + * overridden + * + * @return centre point of the item + */ + virtual const wxPoint GetCenter() const { return GetPosition(); } + virtual void SetPosition( const wxPoint& aPos ) = 0; /** diff --git a/include/common.h b/include/common.h index ed663942e9..337196ad60 100644 --- a/include/common.h +++ b/include/common.h @@ -166,7 +166,8 @@ inline int Mils2mm( double x ) { return KiROUND( x * 25.4 / 1000. ); } enum EDA_UNITS_T { INCHES = 0, MILLIMETRES = 1, - UNSCALED_UNITS = 2 + UNSCALED_UNITS = 2, + DEGREES = 3, }; diff --git a/include/fp_lib_table.h b/include/fp_lib_table.h index 90ff3a9106..d38ced57ec 100644 --- a/include/fp_lib_table.h +++ b/include/fp_lib_table.h @@ -31,6 +31,7 @@ #include #include #include +#include #define FP_LATE_ENVVAR 1 ///< late=1/early=0 environment variable expansion @@ -221,7 +222,7 @@ public: * Actual indentation will be 2 spaces for each nestLevel. */ void Format( OUTPUTFORMATTER* out, int nestLevel ) const - throw( IO_ERROR ); + throw( IO_ERROR, boost::interprocess::lock_exception ); private: @@ -355,7 +356,8 @@ public: * @param nestLevel is the indentation level to base all lines of the output. * Actual indentation will be 2 spaces for each nestLevel. */ - void Format( OUTPUTFORMATTER* out, int nestLevel ) const throw( IO_ERROR ); + void Format( OUTPUTFORMATTER* out, int nestLevel ) const + throw( IO_ERROR, boost::interprocess::lock_exception ); /** * Function GetLogicalLibs @@ -468,7 +470,7 @@ public: * @throw PARSE_ERROR if @a aFootprintId is not parsed OK. */ MODULE* FootprintLoadWithOptionalNickname( const FPID& aFootprintId ) - throw( IO_ERROR, PARSE_ERROR ); + throw( IO_ERROR, PARSE_ERROR, boost::interprocess::lock_exception ); /** * Function GetDescription diff --git a/include/id.h b/include/id.h index d37c8149b0..32ea99c4ea 100644 --- a/include/id.h +++ b/include/id.h @@ -158,6 +158,7 @@ enum main_id ID_POPUP_CANCEL_CURRENT_COMMAND, ID_POPUP_CLOSE_CURRENT_TOOL, ID_POPUP_MOVE_BLOCK, + ID_POPUP_MOVE_BLOCK_EXACT, ID_POPUP_DRAG_BLOCK, ID_POPUP_COPY_BLOCK, ID_POPUP_ROTATE_BLOCK, diff --git a/include/tool/tool_manager.h b/include/tool/tool_manager.h index c2011deb2c..6f32ce6b9b 100644 --- a/include/tool/tool_manager.h +++ b/include/tool/tool_manager.h @@ -30,8 +30,6 @@ #include #include -#include - #include class TOOL_BASE; diff --git a/include/wxBasePcbFrame.h b/include/wxBasePcbFrame.h index 5f0bf6e7a0..0c54a0b02e 100644 --- a/include/wxBasePcbFrame.h +++ b/include/wxBasePcbFrame.h @@ -33,6 +33,7 @@ #include +#include #include #include @@ -103,7 +104,7 @@ protected: * occurs while reading footprint library files. */ MODULE* loadFootprint( const FPID& aFootprintId ) - throw( IO_ERROR, PARSE_ERROR ); + throw( IO_ERROR, PARSE_ERROR, boost::interprocess::lock_exception ); public: PCB_BASE_FRAME( KIWAY* aKiway, wxWindow* aParent, FRAME_T aFrameType, diff --git a/include/wxPcbStruct.h b/include/wxPcbStruct.h index 5b999e5d6f..eb4df9c8e0 100644 --- a/include/wxPcbStruct.h +++ b/include/wxPcbStruct.h @@ -193,6 +193,19 @@ protected: */ void duplicateZone( wxDC* aDC, ZONE_CONTAINER* aZone ); + /** + * Function moveExact + * Move the selected item exactly + */ + void moveExact(); + + /** + * Function duplicateItems + * Duplicate selected item if possible and start a move + * @param aIncrement increment the item number if appropriate + */ + void duplicateItem( bool aIncrement ); + // protected so that PCB::IFACE::CreateWindow() is the only factory. PCB_EDIT_FRAME( KIWAY* aKiway, wxWindow* aParent ); @@ -459,6 +472,15 @@ public: */ int OnHotkeyCopyItem(); + /** + * Function OnHotkeyDuplicateOrArrayItem + * Duplicate an item (optionally incrementing if necessary and possible) + * or invoke array dialog and create an array + * @param aIdCommand = the hotkey command id + * @return true if item duplicated or arrayed + */ + bool OnHotkeyDuplicateOrArrayItem( int aIdCommand ); + /** * Function OnHotkeyMoveItem * Moves or drag the item (footprint, track, text .. ) found under the mouse cursor diff --git a/pagelayout_editor/events_functions.cpp b/pagelayout_editor/events_functions.cpp index 0bec641c0e..598a141df2 100644 --- a/pagelayout_editor/events_functions.cpp +++ b/pagelayout_editor/events_functions.cpp @@ -170,6 +170,7 @@ void PL_EDITOR_FRAME::Process_Special_Functions( wxCommandEvent& event ) SaveCopyInUndoList(); idx = m_treePagelayout->GetSelectedItemIndex(); item = AddPageLayoutItem( WORKSHEET_DATAITEM::WS_SEGMENT, idx ); + if( InvokeDialogNewItem( this, item ) == wxID_CANCEL ) { RemoveLastCommandInUndoList(); @@ -199,6 +200,7 @@ void PL_EDITOR_FRAME::Process_Special_Functions( wxCommandEvent& event ) SaveCopyInUndoList(); idx = m_treePagelayout->GetSelectedItemIndex(); item = AddPageLayoutItem( WORKSHEET_DATAITEM::WS_RECT, idx ); + if( InvokeDialogNewItem( this, item ) == wxID_CANCEL ) { RemoveLastCommandInUndoList(); @@ -353,10 +355,11 @@ static void moveItem( EDA_DRAW_PANEL* aPanel, wxDC* aDC, const wxPoint& aPositio // (does not happen each time the mouse is moved, because the // item is placed on grid) // to avoid useless computation time. - if( aPanel && ( previous_position != position ) ) + if( previous_position != position ) aPanel->Refresh(); } + /* * Function abortMoveItem: called when an item is currently moving, * and when the user aborts the move command. @@ -367,7 +370,7 @@ static void abortMoveItem( EDA_DRAW_PANEL* aPanel, wxDC* aDC ) PL_EDITOR_SCREEN* screen = (PL_EDITOR_SCREEN*) aPanel->GetScreen(); WORKSHEET_DATAITEM *item = screen->GetCurItem(); - if( (item->GetFlags() & NEW_ITEM ) ) + if( item->GetFlags() & NEW_ITEM ) { PL_EDITOR_FRAME* plframe = (PL_EDITOR_FRAME*) aPanel->GetParent(); plframe->RemoveLastCommandInUndoList(); @@ -394,6 +397,7 @@ static void abortMoveItem( EDA_DRAW_PANEL* aPanel, wxDC* aDC ) aPanel->Refresh(); } + void PL_EDITOR_FRAME::MoveItem( WORKSHEET_DATAITEM* aItem ) { wxCHECK_RET( aItem != NULL, wxT( "Cannot move NULL item" ) ); @@ -411,6 +415,7 @@ void PL_EDITOR_FRAME::MoveItem( WORKSHEET_DATAITEM* aItem ) { SetCrossHairPosition( initialPositionUi, false ); initialCursorPosition = GetCrossHairPosition(); + if( m_canvas->IsPointOnDisplay( initialCursorPosition ) ) { m_canvas->MoveCursorToCrossHair(); @@ -443,7 +448,7 @@ void PL_EDITOR_FRAME::PlaceItem( WORKSHEET_DATAITEM* aItem ) { aItem->MoveStartPointTo( initialPosition ); } - else if( (aItem->GetFlags() & LOCATE_ENDPOINT) ) + else if( aItem->GetFlags() & LOCATE_ENDPOINT ) { aItem->MoveEndPointTo( initialPosition ); } @@ -471,12 +476,14 @@ void PL_EDITOR_FRAME::OnSelectCoordOriginCorner( wxCommandEvent& event ) m_canvas->Refresh(); } + void PL_EDITOR_FRAME::OnSelectTitleBlockDisplayMode( wxCommandEvent& event ) { WORKSHEET_DATAITEM::m_SpecialMode = (event.GetId() == ID_SHOW_PL_EDITOR_MODE); m_canvas->Refresh(); } + void PL_EDITOR_FRAME::OnQuit( wxCommandEvent& event ) { Close( true ); @@ -485,7 +492,7 @@ void PL_EDITOR_FRAME::OnQuit( wxCommandEvent& event ) void PL_EDITOR_FRAME::ToPlotter(wxCommandEvent& event) { - wxMessageBox( wxT("Not yet available")); + wxMessageBox( wxT( "Not yet available" ) ); } @@ -533,6 +540,7 @@ void PL_EDITOR_FRAME::ToPrinter(wxCommandEvent& event) InvokeDialogPrint( this, s_PrintData, s_pageSetupData ); } + void PL_EDITOR_FRAME::OnTreeSelection( wxTreeEvent& event ) { WORKSHEET_DATAITEM* item = GetSelectedItem(); @@ -543,11 +551,15 @@ void PL_EDITOR_FRAME::OnTreeSelection( wxTreeEvent& event ) m_canvas->Refresh(); } + void PL_EDITOR_FRAME::OnTreeMiddleClick( wxTreeEvent& event ) { } + extern void AddNewItemsCommand( wxMenu* aMainMenu ); + + void PL_EDITOR_FRAME::OnTreeRightClick( wxTreeEvent& event ) { m_treePagelayout->SelectCell( event.GetItem() ); @@ -568,6 +580,7 @@ void PL_EDITOR_FRAME::OnUpdateTitleBlockDisplayNormalMode( wxUpdateUIEvent& even event.Check( WORKSHEET_DATAITEM::m_SpecialMode == false ); } + void PL_EDITOR_FRAME::OnUpdateTitleBlockDisplaySpecialMode( wxUpdateUIEvent& event ) { event.Check( WORKSHEET_DATAITEM::m_SpecialMode == true ); diff --git a/pagelayout_editor/pl_editor_frame.cpp b/pagelayout_editor/pl_editor_frame.cpp index 699c02be2c..7ccde4e785 100644 --- a/pagelayout_editor/pl_editor_frame.cpp +++ b/pagelayout_editor/pl_editor_frame.cpp @@ -474,6 +474,10 @@ void PL_EDITOR_FRAME::UpdateStatusBar() case UNSCALED_UNITS: SetStatusText( wxEmptyString, 5 ); break; + + case DEGREES: + wxASSERT( false ); + break; } wxString line; diff --git a/pcb_calculator/transline/rectwaveguide.cpp b/pcb_calculator/transline/rectwaveguide.cpp index fb14959367..d325331fba 100644 --- a/pcb_calculator/transline/rectwaveguide.cpp +++ b/pcb_calculator/transline/rectwaveguide.cpp @@ -358,7 +358,7 @@ void RECTWAVEGUIDE::show_results() continue; if( f >= ( fc( m, n ) ) ) { - sprintf( txt, "H(%u,%u) ", m, n ); + sprintf( txt, "H(%d,%d) ", m, n ); if( (strlen( text ) + strlen( txt ) + 5) < MAXSTRLEN ) strcat( text, txt ); else @@ -384,7 +384,7 @@ void RECTWAVEGUIDE::show_results() { if( f >= fc( m, n ) ) { - sprintf( txt, "E(%u,%u) ", m, n ); + sprintf( txt, "E(%d,%d) ", m, n ); if( (strlen( text ) + strlen( txt ) + 5) < MAXSTRLEN ) strcat( text, txt ); else diff --git a/pcbnew/CMakeLists.txt b/pcbnew/CMakeLists.txt index 0e916943cf..8c021667cc 100644 --- a/pcbnew/CMakeLists.txt +++ b/pcbnew/CMakeLists.txt @@ -46,6 +46,8 @@ set( PCBNEW_DIALOGS dialogs/dialog_cleaning_options.cpp dialogs/dialog_copper_zones.cpp dialogs/dialog_copper_zones_base.cpp + dialogs/dialog_create_array.cpp + dialogs/dialog_create_array_base.cpp dialogs/dialog_design_rules.cpp dialogs/dialog_design_rules_base.cpp dialogs/dialog_dimension_editor_base.cpp @@ -104,6 +106,8 @@ set( PCBNEW_DIALOGS dialogs/dialog_pcb_text_properties_base.cpp dialogs/dialog_pns_settings.cpp dialogs/dialog_pns_settings_base.cpp + dialogs/dialog_move_exact.cpp + dialogs/dialog_move_exact_base.cpp dialogs/dialog_non_copper_zones_properties.cpp dialogs/dialog_non_copper_zones_properties_base.cpp dialogs/dialog_pad_properties.cpp diff --git a/pcbnew/basepcbframe.cpp b/pcbnew/basepcbframe.cpp index 6f076ae8a9..d97a46719d 100644 --- a/pcbnew/basepcbframe.cpp +++ b/pcbnew/basepcbframe.cpp @@ -677,6 +677,10 @@ void PCB_BASE_FRAME::UpdateStatusBar() case UNSCALED_UNITS: formatter = wxT( "Ro %f Th %f" ); break; + + case DEGREES: + wxASSERT( false ); + break; } line.Printf( formatter, To_User_Unit( g_UserUnit, ro ), theta ); @@ -707,6 +711,10 @@ void PCB_BASE_FRAME::UpdateStatusBar() absformatter = wxT( "X %f Y %f" ); locformatter = wxT( "dx %f dy %f dist %f" ); break; + + case DEGREES: + wxASSERT( false ); + break; } line.Printf( absformatter, dXpos, dYpos ); diff --git a/pcbnew/block_module_editor.cpp b/pcbnew/block_module_editor.cpp index 2898af9260..4a9f1ea0ec 100644 --- a/pcbnew/block_module_editor.cpp +++ b/pcbnew/block_module_editor.cpp @@ -53,14 +53,19 @@ #include #include +#include + #define BLOCK_COLOR BROWN // Functions defined here, but used also in other files -// These 2 functions are used in modedit to rotate or mirror the whole footprint -// so they are called with force_all = true +// These 3 functions are used in modedit to rotate, mirror or move the +// whole footprint so they are called with force_all = true void MirrorMarkedItems( MODULE* module, wxPoint offset, bool force_all = false ); void RotateMarkedItems( MODULE* module, wxPoint offset, bool force_all = false ); +void MoveMarkedItemsExactly( MODULE* module, const wxPoint& centre, + const wxPoint& translation, double rotation, + bool force_all = false ); // Local functions: static void DrawMovingBlockOutlines( EDA_DRAW_PANEL* aPanel, wxDC* aDC, const wxPoint& aPosition, @@ -166,6 +171,26 @@ bool FOOTPRINT_EDIT_FRAME::HandleBlockEnd( wxDC* DC ) break; + case BLOCK_MOVE_EXACT: + itemsCount = MarkItemsInBloc( currentModule, GetScreen()->m_BlockLocate ); + + if( itemsCount ) + { + wxPoint translation; + double rotation = 0; + + DIALOG_MOVE_EXACT dialog( this, translation, rotation ); + int ret = dialog.ShowModal(); + + if( ret == DIALOG_MOVE_EXACT::MOVE_OK ) + { + SaveCopyInUndoList( currentModule, UR_MODEDIT ); + const wxPoint blockCentre = GetScreen()->m_BlockLocate.Centre(); + MoveMarkedItemsExactly( currentModule, blockCentre, translation, rotation ); + } + } + break; + case BLOCK_PRESELECT_MOVE: // Move with preselection list nextcmd = true; m_canvas->SetMouseCaptureCallback( DrawMovingBlockOutlines ); @@ -194,7 +219,6 @@ bool FOOTPRINT_EDIT_FRAME::HandleBlockEnd( wxDC* DC ) RotateMarkedItems( currentModule, GetScreen()->m_BlockLocate.Centre() ); break; - case BLOCK_MIRROR_X: case BLOCK_MIRROR_Y: case BLOCK_FLIP: // mirror @@ -706,6 +730,78 @@ void ClearMarkItems( MODULE* module ) } +void MoveMarkedItemsExactly( MODULE* module, const wxPoint& centre, + const wxPoint& translation, + double rotation, bool force_all ) +{ + if( module == NULL ) + return; + + if( module->Reference().IsSelected() || force_all ) + { + module->Reference().RotateTransformWithModule( centre, rotation ); + module->Reference().MoveTransformWithModule( translation ); + } + + if( module->Value().IsSelected() || force_all ) + { + module->Value().RotateTransformWithModule( centre, rotation ); + module->Value().MoveTransformWithModule( translation ); + } + + D_PAD* pad = module->Pads(); + + for( ; pad != NULL; pad = pad->Next() ) + { + if( !pad->IsSelected() && !force_all ) + continue; + + // rotate about centre point, + wxPoint newPos = pad->GetPosition(); + RotatePoint( &newPos, centre, rotation ); + + // shift and update + newPos += translation; + pad->SetPosition( newPos ); + pad->SetPos0( newPos ); + + // finally apply rotation to the pad itself + pad->Rotate( newPos, rotation ); + } + + EDA_ITEM* item = module->GraphicalItems(); + + for( ; item != NULL; item = item->Next() ) + { + if( !item->IsSelected() && !force_all ) + continue; + + switch( item->Type() ) + { + case PCB_MODULE_TEXT_T: + { + TEXTE_MODULE* text = static_cast( item ); + + text->RotateTransformWithModule( centre, rotation ); + text->MoveTransformWithModule( translation ); + break; + } + case PCB_MODULE_EDGE_T: + { + EDGE_MODULE* em = static_cast( item ); + em->Rotate( centre, rotation ); + em->Move( translation ); + break; + } + default: + ; + } + } + + ClearMarkItems( module ); +} + + /* Mark items inside rect. * Items are inside rect when an end point is inside rect */ diff --git a/pcbnew/class_board.cpp b/pcbnew/class_board.cpp index 4f0320abb3..c943a087a6 100644 --- a/pcbnew/class_board.cpp +++ b/pcbnew/class_board.cpp @@ -54,6 +54,10 @@ #include #include #include +#include +#include +#include +#include /* This is an odd place for this, but CvPcb won't link if it is @@ -2204,7 +2208,6 @@ void BOARD::ReplaceNetlist( NETLIST& aNetlist, bool aDeleteSinglePadNets, wxString msg; D_PAD* pad; MODULE* footprint; - COMPONENT_NET net; if( !IsEmpty() ) { @@ -2400,24 +2403,21 @@ void BOARD::ReplaceNetlist( NETLIST& aNetlist, bool aDeleteSinglePadNets, // At this point, the component footprint is updated. Now update the nets. for( pad = footprint->Pads(); pad; pad = pad->Next() ) { - net = component->GetNet( pad->GetPadName() ); + COMPONENT_NET net = component->GetNet( pad->GetPadName() ); if( !net.IsValid() ) // Footprint pad had no net. { - if( !pad->GetNetname().IsEmpty() ) + if( aReporter && aReporter->ReportAll() && !pad->GetNetname().IsEmpty() ) { - if( aReporter && aReporter->ReportAll() ) - { - msg.Printf( _( "Clearing component \"%s:%s\" pin \"%s\" net name.\n" ), - GetChars( footprint->GetReference() ), - GetChars( footprint->GetPath() ), - GetChars( pad->GetPadName() ) ); - aReporter->Report( msg ); - } - - if( !aNetlist.IsDryRun() ) - pad->SetNetCode( NETINFO_LIST::UNCONNECTED ); + msg.Printf( _( "Clearing component \"%s:%s\" pin \"%s\" net name.\n" ), + GetChars( footprint->GetReference() ), + GetChars( footprint->GetPath() ), + GetChars( pad->GetPadName() ) ); + aReporter->Report( msg ); } + + if( !aNetlist.IsDryRun() ) + pad->SetNetCode( NETINFO_LIST::UNCONNECTED ); } else // Footprint pad has a net. { @@ -2584,7 +2584,7 @@ void BOARD::ReplaceNetlist( NETLIST& aNetlist, bool aDeleteSinglePadNets, // Explore all pins/pads in component for( unsigned jj = 0; jj < component->GetNetCount(); jj++ ) { - net = component->GetNet( jj ); + COMPONENT_NET net = component->GetNet( jj ); padname = net.GetPinName(); if( footprint->FindPadByName( padname ) ) @@ -2618,6 +2618,87 @@ void BOARD::ReplaceNetlist( NETLIST& aNetlist, bool aDeleteSinglePadNets, } +BOARD_ITEM* BOARD::DuplicateAndAddItem( const BOARD_ITEM* aItem, + bool aIncrementReferences ) +{ + BOARD_ITEM* new_item = NULL; + + switch( aItem->Type() ) + { + case PCB_MODULE_T: + { + MODULE* new_module = new MODULE( *static_cast( aItem ) ); + + if( aIncrementReferences ) + { + // Take the next available module number + new_module->IncrementReference( true ); + } + + new_item = new_module; + break; + } + case PCB_TEXT_T: + case PCB_LINE_T: + case PCB_TRACE_T: + case PCB_VIA_T: + case PCB_ZONE_AREA_T: + case PCB_TARGET_T: + case PCB_DIMENSION_T: + new_item = static_cast( aItem->Clone() ); + break; + + default: + // Un-handled item for duplication + wxASSERT_MSG( false, "Duplication not supported for items of class " + + aItem->GetClass() ); + break; + } + + if( new_item ) + Add( new_item ); + + return new_item; +} + + +wxString BOARD::GetNextModuleReferenceWithPrefix( const wxString& aPrefix, + bool aFillSequenceGaps ) +{ + wxString nextRef; + + std::set usedNumbers; + + for( MODULE* module = m_Modules; module; module = module->Next() ) + { + const wxString ref = module->GetReference(); + wxString remainder; + + // ONly interested in modules with the right prefix + if( !ref.StartsWith( aPrefix, &remainder ) ) + continue; + + // the suffix must be a number + if( !remainder.IsNumber() ) + continue; + + long number; + if( remainder.ToCLong( &number ) ) + usedNumbers.insert( number ); + } + + int nextNum = 1; + + if( usedNumbers.size() ) + { + nextNum = getNextNumberInSequence( usedNumbers, aFillSequenceGaps ); + nextRef = wxString::Format( wxT( "%s%i" ), aPrefix, nextNum ); + } + + return nextRef; +} + + /* Extracts the board outlines and build a closed polygon * from lines, arcs and circle items on edge cut layer * Any closed outline inside the main outline is a hole diff --git a/pcbnew/class_board.h b/pcbnew/class_board.h index b2bdfb3b28..1f7fab1647 100644 --- a/pcbnew/class_board.h +++ b/pcbnew/class_board.h @@ -301,6 +301,16 @@ public: */ BOARD_ITEM* Remove( BOARD_ITEM* aBoardItem ); + BOARD_ITEM* DuplicateAndAddItem( const BOARD_ITEM* aItem, + bool aIncrementReferences ); + + /** + * Function GetNextModuleReferenceWithPrefix + * Get the next available module reference with this prefix + */ + wxString GetNextModuleReferenceWithPrefix( const wxString& aPrefix, + bool aFillSequenceGaps ); + /** * Function GetRatsnest() * returns list of missing connections between components/tracks. diff --git a/pcbnew/class_board_connected_item.cpp b/pcbnew/class_board_connected_item.cpp index dfe4e96f3e..797e2ee158 100644 --- a/pcbnew/class_board_connected_item.cpp +++ b/pcbnew/class_board_connected_item.cpp @@ -50,7 +50,10 @@ BOARD_CONNECTED_ITEM::BOARD_CONNECTED_ITEM( const BOARD_CONNECTED_ITEM& aItem ) void BOARD_CONNECTED_ITEM::SetNetCode( int aNetCode ) { -// assert( aNetCode >= 0 ); + // if aNetCode < 0 ( typically NETINFO_LIST::FORCE_ORPHANED ) + // or no parent board, + // set the m_netinfo to the dummy NETINFO_LIST::ORPHANED + BOARD* board = GetBoard(); if( ( aNetCode >= 0 ) && board ) diff --git a/pcbnew/class_board_item.cpp b/pcbnew/class_board_item.cpp index 0ab41d1058..1ae6f8a856 100644 --- a/pcbnew/class_board_item.cpp +++ b/pcbnew/class_board_item.cpp @@ -195,3 +195,51 @@ void BOARD_ITEM::ViewGetLayers( int aLayers[], int& aCount ) const aCount = 1; aLayers[0] = m_Layer; } + + +int BOARD_ITEM::getTrailingInt( wxString aStr ) +{ + int number = 0; + int base = 1; + + // Trim and extract the trailing numeric part + int index = aStr.Len() - 1; + while( index >= 0 ) + { + const char chr = aStr.GetChar( index ); + + if( chr < '0' || chr > '9' ) + break; + + number += ( chr - '0' ) * base; + base *= 10; + index--; + } + + return number; +} + +int BOARD_ITEM::getNextNumberInSequence( std::set aSeq, bool aFillSequenceGaps) +{ + // By default go to the end of the sequence + int candidate = *aSeq.rbegin(); + + // Filling in gaps in pad numbering + if( aFillSequenceGaps ) + { + // start at the beginning + candidate = *aSeq.begin(); + + for( std::set::iterator it = aSeq.begin(), + itEnd = aSeq.end(); it != itEnd; ++it ) + { + if( *it - candidate > 1 ) + break; + + candidate = *it; + } + } + + candidate++; + return candidate; +} diff --git a/pcbnew/class_drawsegment.cpp b/pcbnew/class_drawsegment.cpp index 2ff4342e29..53c2f4b7cc 100644 --- a/pcbnew/class_drawsegment.cpp +++ b/pcbnew/class_drawsegment.cpp @@ -94,10 +94,41 @@ void DRAWSEGMENT::Copy( DRAWSEGMENT* source ) void DRAWSEGMENT::Rotate( const wxPoint& aRotCentre, double aAngle ) { - RotatePoint( &m_Start, aRotCentre, aAngle ); - RotatePoint( &m_End, aRotCentre, aAngle ); -} + switch( m_Shape ) + { + case S_ARC: + case S_SEGMENT: + case S_CIRCLE: + // these can all be done by just rotating the start and end points + RotatePoint( &m_Start, aRotCentre, aAngle); + RotatePoint( &m_End, aRotCentre, aAngle); + break; + case S_POLYGON: + for( unsigned ii = 0; ii < m_PolyPoints.size(); ii++ ) + { + RotatePoint( &m_PolyPoints[ii], aRotCentre, aAngle); + } + break; + + case S_CURVE: + RotatePoint( &m_Start, aRotCentre, aAngle); + RotatePoint( &m_End, aRotCentre, aAngle); + + for( unsigned int ii = 0; ii < m_BezierPoints.size(); ii++ ) + { + RotatePoint( &m_BezierPoints[ii], aRotCentre, aAngle); + } + break; + + case S_RECT: + default: + // un-handled edge transform + wxASSERT_MSG( false, wxT( "DRAWSEGMENT::Rotate not implemented for " + + ShowShape( m_Shape ) ) ); + break; + } +}; void DRAWSEGMENT::Flip( const wxPoint& aCentre ) { @@ -112,6 +143,37 @@ void DRAWSEGMENT::Flip( const wxPoint& aCentre ) SetLayer( FlipLayer( GetLayer() ) ); } +const wxPoint DRAWSEGMENT::GetCenter() const +{ + wxPoint c; + + switch( m_Shape ) + { + case S_ARC: + case S_CIRCLE: + c = m_Start; + break; + + case S_SEGMENT: + // Midpoint of the line + c = ( GetStart() + GetEnd() ) / 2; + break; + + case S_POLYGON: + case S_RECT: + case S_CURVE: + c = GetBoundingBox().Centre(); + break; + + default: + wxASSERT_MSG( false, "DRAWSEGMENT::GetCentre not implemented for shape" + + ShowShape( GetShape() ) ); + break; + } + + return c; +} + const wxPoint DRAWSEGMENT::GetArcEnd() const { wxPoint endPoint; // start of arc @@ -529,8 +591,11 @@ bool DRAWSEGMENT::HitTest( const wxPoint& aPosition ) const return true; break; + case S_POLYGON: // not yet handled + break; + default: - wxASSERT( 0 ); + wxASSERT_MSG( 0, wxString::Format( "unknown DRAWSEGMENT shape: %d", m_Shape ) ); break; } @@ -582,9 +647,15 @@ bool DRAWSEGMENT::HitTest( const EDA_RECT& aRect, bool aContained, int aAccuracy break; + case S_CURVE: + case S_POLYGON: // not yet handled + break; + default: - ; + wxASSERT_MSG( 0, wxString::Format( "unknown DRAWSEGMENT shape: %d", m_Shape ) ); + break; } + return false; } diff --git a/pcbnew/class_drawsegment.h b/pcbnew/class_drawsegment.h index 7316b4e554..10920dd1a6 100644 --- a/pcbnew/class_drawsegment.h +++ b/pcbnew/class_drawsegment.h @@ -117,7 +117,7 @@ public: // m_Start, m_End, and m_Angle. // No Set...() function for these attributes. - const wxPoint& GetCenter() const { return m_Start; } + const wxPoint GetCenter() const; //override const wxPoint& GetArcStart() const { return m_End; } const wxPoint GetArcEnd() const; diff --git a/pcbnew/class_module.cpp b/pcbnew/class_module.cpp index 4248cc52db..0dea8191f0 100644 --- a/pcbnew/class_module.cpp +++ b/pcbnew/class_module.cpp @@ -1,10 +1,10 @@ /* * This program source code file is part of KiCad, a free EDA CAD application. * - * Copyright (C) 2012 Jean-Pierre Charras, jean-pierre.charras@ujf-grenoble.fr - * Copyright (C) 2012 SoftPLC Corporation, Dick Hollenbeck - * Copyright (C) 2012 Wayne Stambaugh - * Copyright (C) 1992-2012 KiCad Developers, see AUTHORS.txt for contributors. + * Copyright (C) 2015 Jean-Pierre Charras, jean-pierre.charras@ujf-grenoble.fr + * Copyright (C) 2015 SoftPLC Corporation, Dick Hollenbeck + * Copyright (C) 2015 Wayne Stambaugh + * Copyright (C) 1992-2015 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 @@ -68,8 +68,8 @@ MODULE::MODULE( BOARD* parent ) : m_LocalSolderPasteMargin = 0; m_LocalSolderPasteMarginRatio = 0.0; m_ZoneConnection = UNDEFINED_CONNECTION; // Use zone setting by default - m_ThermalWidth = 0; // Use zone setting by default - m_ThermalGap = 0; // Use zone setting by default + m_ThermalWidth = 0; // Use zone setting by default + m_ThermalGap = 0; // Use zone setting by default // These are special and mandatory text fields m_Reference = new TEXTE_MODULE( this, TEXTE_MODULE::TEXT_is_REFERENCE ); @@ -112,8 +112,6 @@ MODULE::MODULE( const MODULE& aModule ) : m_Value->SetParent( this ); // Copy auxiliary data: Pads - // m_Pads.DeleteAll(); - for( D_PAD* pad = aModule.m_Pads; pad; pad = pad->Next() ) { D_PAD* newpad = new D_PAD( *pad ); @@ -176,6 +174,21 @@ MODULE::~MODULE() delete m_initial_comments; } + /** + * Function ClearAllNets + * Clear (i.e. force the ORPHANED dummy net info) the net info which + * depends on a given board for all pads of the footprint. + * This is needed when a footprint is copied between the fp editor and + * the board editor for instance, because net info become fully broken + */ +void MODULE::ClearAllNets() +{ + // Force the ORPHANED dummy net info for all pads. + // ORPHANED dummy net does not depend on a board + for( D_PAD* pad = Pads(); pad; pad = pad->Next() ) + pad->SetNetCode( NETINFO_LIST::FORCE_ORPHANED ); +} + /* Draw the anchor cross (vertical) * Must be done after the pads, because drawing the hole will erase overwrite @@ -1118,3 +1131,122 @@ void MODULE::SetOrientation( double newangle ) CalculateBoundingBox(); } +BOARD_ITEM* MODULE::DuplicateAndAddItem( const BOARD_ITEM* aItem, + bool aIncrementPadNumbers ) +{ + BOARD_ITEM* new_item = NULL; + + switch( aItem->Type() ) + { + case PCB_PAD_T: + { + D_PAD* new_pad = new D_PAD( *static_cast( aItem ) ); + + if( aIncrementPadNumbers ) + { + // Take the next available pad number + new_pad->IncrementPadName( true, true ); + } + + Pads().PushBack( new_pad ); + new_item = new_pad; + break; + } + case PCB_MODULE_TEXT_T: + { + const TEXTE_MODULE* old_text = static_cast( aItem ); + + // do not duplicate value or reference fields + // (there can only be one of each) + if( old_text->GetType() == TEXTE_MODULE::TEXT_is_DIVERS ) + { + TEXTE_MODULE* new_text = new TEXTE_MODULE( *old_text ); + + GraphicalItems().PushBack( new_text ); + new_item = new_text; + } + break; + } + case PCB_MODULE_EDGE_T: + { + EDGE_MODULE* new_edge = new EDGE_MODULE( + *static_cast(aItem) ); + + GraphicalItems().PushBack( new_edge ); + new_item = new_edge; + break; + } + case PCB_MODULE_T: + // Ignore the module itself + break; + + default: + // Un-handled item for duplication + wxASSERT_MSG( false, "Duplication not supported for items of class " + + aItem->GetClass() ); + break; + } + + return new_item; +} + + +wxString MODULE::GetNextPadName( bool aFillSequenceGaps ) const +{ + std::set usedNumbers; + + // Create a set of used pad numbers + for( D_PAD* pad = Pads(); pad; pad = pad->Next() ) + { + int padNumber = getTrailingInt( pad->GetPadName() ); + usedNumbers.insert( padNumber ); + } + + const int nextNum = getNextNumberInSequence( usedNumbers, aFillSequenceGaps ); + + return wxString::Format( wxT( "%i" ), nextNum ); +} + + +wxString MODULE::GetReferencePrefix() const +{ + wxString prefix = GetReference(); + + int strIndex = prefix.length() - 1; + while( strIndex >= 0 ) + { + const wxUniChar chr = prefix.GetChar( strIndex ); + + // numeric suffix + if( chr >= '0' && chr <= '9' ) + break; + + strIndex--; + } + + prefix = prefix.Mid( 0, strIndex ); + + return prefix; +} + + +bool MODULE::IncrementReference( bool aFillSequenceGaps ) +{ + BOARD* board = GetBoard(); + + if( !board ) + return false; + + bool success = false; + const wxString prefix = GetReferencePrefix(); + const wxString newReference = board->GetNextModuleReferenceWithPrefix( + prefix, aFillSequenceGaps ); + + if( !newReference.IsEmpty() ) + { + SetReference( newReference ); + success = true; + } + + return success; +} diff --git a/pcbnew/class_module.h b/pcbnew/class_module.h index 266b033e3f..d9df61a52e 100644 --- a/pcbnew/class_module.h +++ b/pcbnew/class_module.h @@ -1,8 +1,8 @@ /* * This program source code file is part of KiCad, a free EDA CAD application. * - * Copyright (C) 2013 Jean-Pierre Charras, jp.charras at wanadoo.fr - * Copyright (C) 1992-2013 KiCad Developers, see AUTHORS.txt for contributors. + * Copyright (C) 2015 Jean-Pierre Charras, jp.charras at wanadoo.fr + * Copyright (C) 1992-2015 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 @@ -93,7 +93,7 @@ public: void Copy( MODULE* Module ); // Copy structure - /* + /** * Function Add * adds the given item to this MODULE and takes ownership of its memory. * @param aBoardItem The item to add to this board. @@ -123,6 +123,15 @@ public: */ BOARD_ITEM* Remove( BOARD_ITEM* aBoardItem ); + /** + * Function ClearAllNets + * Clear (i.e. force the ORPHANED dummy net info) the net info which + * depends on a given board for all pads of the footprint. + * This is needed when a footprint is copied between the fp editor and + * the board editor for instance, because net info become fully broken + */ + void ClearAllNets(); + /** * Function CalculateBoundingBox * calculates the bounding box in board coordinates. @@ -396,6 +405,15 @@ public: m_Reference->SetText( aReference ); } + /** + * Function GetReference prefix + * Gets the alphabetic prefix of the module reference - e.g. + * R1 -> R + * IC34 -> IC + * @return the reference prefix (may be empty) + */ + wxString GetReferencePrefix() const; + /** * Function GetValue * @return const wxString& - the value text. @@ -422,6 +440,17 @@ public: TEXTE_MODULE& Value() const { return *m_Value; } TEXTE_MODULE& Reference() const { return *m_Reference; } + /** + * Function INcrementReference + * Increments the module's reference, if possible. A reference with + * a numerical suffix and an optional alphabetical prefix can be + * incremented: "A1" and "1" can be, "B" can't. + * + * @param aFillSequenceGaps if true, the next reference in a sequence + * like A1,A3,A4 will be A2. If false, it will be A5. + * @return true if the reference was incremented. + */ + bool IncrementReference( bool aFillSequenceGaps ); /** * Function FindPadByName @@ -453,6 +482,16 @@ public: */ unsigned GetPadCount( INCLUDE_NPTH_T aIncludeNPTH = INCLUDE_NPTH_T( INCLUDE_NPTH ) ) const; + /** + * Function GetNextPadName + * returns the next available pad name in the module + * + * @param aFillSequenceGaps true if the numbering should "fill in" gaps in + * the sequence, else return the highest value + 1 + * @return the next available pad name + */ + wxString GetNextPadName( bool aFillSequenceGaps ) const; + double GetArea() const { return m_Surface; } time_t GetLink() const { return m_Link; } @@ -464,6 +503,14 @@ public: int GetPlacementCost90() const { return m_CntRot90; } void SetPlacementCost90( int aCost ) { m_CntRot90 = aCost; } + /** + * Function DuplicateAndAddItem + * Duplicate a given item within the module + * @return the new item, or NULL if the item could not be duplicated + */ + BOARD_ITEM* DuplicateAndAddItem( const BOARD_ITEM* item, + bool aIncrementPadNumbers ); + /** * Function Add3DModel * adds \a a3DModel definition to the end of the 3D model list. diff --git a/pcbnew/class_netinfo.h b/pcbnew/class_netinfo.h index 8d8f3df89c..3cddf198e0 100644 --- a/pcbnew/class_netinfo.h +++ b/pcbnew/class_netinfo.h @@ -320,9 +320,14 @@ public: return NULL; } - ///> Constant that holds the unconnected net number (typically 0) + ///> Constant that holds the "unconnected net" number (typically 0) + ///> all items "connected" to this net are actually not connected items static const int UNCONNECTED; + ///> Constant that forces initialization of a netinfo item to the NETINFO_ITEM ORPHANED + ///> (typically -1) when calling SetNetCode od board connected items + static const int FORCE_ORPHANED; + ///> NETINFO_ITEM meaning that there was no net assigned for an item, as there was no ///> board storing net list available. static NETINFO_ITEM ORPHANED; diff --git a/pcbnew/class_netinfolist.cpp b/pcbnew/class_netinfolist.cpp index 45e1915e9f..2e03c86b50 100644 --- a/pcbnew/class_netinfolist.cpp +++ b/pcbnew/class_netinfolist.cpp @@ -292,4 +292,6 @@ NETINFO_ITEM* NETINFO_MAPPING::iterator::operator->() const const int NETINFO_LIST::UNCONNECTED = 0; +const int NETINFO_LIST::FORCE_ORPHANED = -1; + NETINFO_ITEM NETINFO_LIST::ORPHANED = NETINFO_ITEM( NULL, wxEmptyString, NETINFO_LIST::UNCONNECTED ); diff --git a/pcbnew/class_pad.cpp b/pcbnew/class_pad.cpp index 4abd48edcf..d189b31dec 100644 --- a/pcbnew/class_pad.cpp +++ b/pcbnew/class_pad.cpp @@ -408,6 +408,15 @@ void D_PAD::SetPadName( const wxString& name ) } +void D_PAD::IncrementPadName( bool aSkipUnconnectable, bool aFillSequenceGaps ) +{ + bool skip = aSkipUnconnectable && ( GetAttribute() == PAD_HOLE_NOT_PLATED ); + + if( !skip ) + SetPadName( GetParent()->GetNextPadName( aFillSequenceGaps ) ); +} + + void D_PAD::Copy( D_PAD* source ) { if( source == NULL ) diff --git a/pcbnew/class_pad.h b/pcbnew/class_pad.h index c68596bd29..c80fce4746 100644 --- a/pcbnew/class_pad.h +++ b/pcbnew/class_pad.h @@ -103,6 +103,15 @@ public: void SetPadName( const wxString& name ); // Change pad name const wxString GetPadName() const; + /** + * Function IncrementPadName + * + * Increments the pad name to the next available name in the module. + * + * @param aSkipUnconnectable skips any pads that are not connectable (for example NPTH) + */ + void IncrementPadName( bool aSkipUnconnectable, bool aFillSequenceGaps ); + bool PadNameEqual( const D_PAD* other ) const { return m_NumPadName == other->m_NumPadName; // hide tricks behind sensible API diff --git a/pcbnew/connect.cpp b/pcbnew/connect.cpp index cd4bb0d905..9e0a1b2c56 100644 --- a/pcbnew/connect.cpp +++ b/pcbnew/connect.cpp @@ -780,27 +780,21 @@ void PCB_BASE_FRAME::TestConnections() void PCB_BASE_FRAME::TestNetConnection( wxDC* aDC, int aNetCode ) { - wxString msg; - - if( aNetCode <= 0 ) // -1 = not existing net, 0 = dummy net + // Skip dummy net -1, and "not connected" net 0 (grouping all not connected pads) + if( aNetCode <= 0 ) return; if( (m_Pcb->m_Status_Pcb & LISTE_RATSNEST_ITEM_OK) == 0 ) Compile_Ratsnest( aDC, true ); // Clear the cluster identifier (subnet) of pads for this net + // Pads are grouped by netcode (and in netname alphabetic order) for( unsigned i = 0; i < m_Pcb->GetPadCount(); ++i ) { D_PAD* pad = m_Pcb->GetPad(i); - int pad_net_code = pad->GetNetCode(); - if( pad_net_code < aNetCode ) - continue; - - if( pad_net_code > aNetCode ) - break; - - pad->SetSubNet( 0 ); + if( m_Pcb->GetPad(i)->GetNetCode() == aNetCode ) + pad->SetSubNet( 0 ); } m_Pcb->Test_Connections_To_Copper_Areas( aNetCode ); @@ -810,16 +804,15 @@ void PCB_BASE_FRAME::TestNetConnection( wxDC* aDC, int aNetCode ) { CONNECTIONS connections( m_Pcb ); - TRACK* firstTrack; TRACK* lastTrack = NULL; - firstTrack = m_Pcb->m_Track.GetFirst()->GetStartNetCode( aNetCode ); + TRACK* firstTrack = m_Pcb->m_Track.GetFirst()->GetStartNetCode( aNetCode ); if( firstTrack ) lastTrack = firstTrack->GetEndNetCode( aNetCode ); if( firstTrack && lastTrack ) // i.e. if there are segments { - connections.Build_CurrNet_SubNets_Connections( firstTrack, lastTrack, firstTrack->GetNetCode() ); + connections.Build_CurrNet_SubNets_Connections( firstTrack, lastTrack, aNetCode ); } } @@ -831,6 +824,7 @@ void PCB_BASE_FRAME::TestNetConnection( wxDC* aDC, int aNetCode ) DrawGeneralRatsnest( aDC, aNetCode ); // Display results + wxString msg; int net_notconnected_count = 0; NETINFO_ITEM* net = m_Pcb->FindNet( aNetCode ); @@ -842,14 +836,15 @@ void PCB_BASE_FRAME::TestNetConnection( wxDC* aDC, int aNetCode ) net_notconnected_count++; } - msg.Printf( wxT( "links %d nc %d net:nc %d" ), - m_Pcb->GetRatsnestsCount(), m_Pcb->GetUnconnectedNetCount(), + msg.Printf( wxT( "links %d nc %d net %d: not conn %d" ), + m_Pcb->GetRatsnestsCount(), m_Pcb->GetUnconnectedNetCount(), aNetCode, net_notconnected_count ); } else - msg.Printf( wxT( "net not found: netcode %d" ),aNetCode ); + msg.Printf( wxT( "net not found: netcode %d" ), aNetCode ); SetStatusText( msg ); + return; } diff --git a/pcbnew/deltrack.cpp b/pcbnew/deltrack.cpp index 49c596c2dc..d766deb03c 100644 --- a/pcbnew/deltrack.cpp +++ b/pcbnew/deltrack.cpp @@ -44,8 +44,6 @@ TRACK* PCB_EDIT_FRAME::Delete_Segment( wxDC* DC, TRACK* aTrack ) { - int current_net_code; - if( aTrack == NULL ) return NULL; @@ -120,20 +118,20 @@ TRACK* PCB_EDIT_FRAME::Delete_Segment( wxDC* DC, TRACK* aTrack ) return NULL; } - current_net_code = aTrack->GetNetCode(); + int netcode = aTrack->GetNetCode(); + + // Remove the segment from list, but do not delete it (it will be stored i n undo list) + GetBoard()->Remove( aTrack ); - DLIST* container = (DLIST*)aTrack->GetList(); - wxASSERT( container ); GetBoard()->GetRatsnest()->Remove( aTrack ); aTrack->ViewRelease(); - container->Remove( aTrack ); // redraw the area where the track was m_canvas->RefreshDrawingRect( aTrack->GetBoundingBox() ); SaveCopyInUndoList( aTrack, UR_DELETED ); OnModify(); - TestNetConnection( DC, current_net_code ); + TestNetConnection( DC, netcode ); SetMsgPanel( GetBoard() ); return NULL; @@ -144,10 +142,10 @@ void PCB_EDIT_FRAME::Delete_Track( wxDC* DC, TRACK* aTrack ) { if( aTrack != NULL ) { - int current_net_code = aTrack->GetNetCode(); + int netcode = aTrack->GetNetCode(); Remove_One_Track( DC, aTrack ); OnModify(); - TestNetConnection( DC, current_net_code ); + TestNetConnection( DC, netcode ); } } @@ -162,10 +160,10 @@ void PCB_EDIT_FRAME::Delete_net( wxDC* DC, TRACK* aTrack ) PICKED_ITEMS_LIST itemsList; ITEM_PICKER picker( NULL, UR_DELETED ); - int net_code_delete = aTrack->GetNetCode(); + int netcode = aTrack->GetNetCode(); /* Search the first item for the given net code */ - TRACK* trackList = GetBoard()->m_Track->GetStartNetCode( net_code_delete ); + TRACK* trackList = GetBoard()->m_Track->GetStartNetCode( netcode ); /* Remove all segments having the given net code */ int ii = 0; @@ -173,7 +171,7 @@ void PCB_EDIT_FRAME::Delete_net( wxDC* DC, TRACK* aTrack ) for( TRACK* segm = trackList; segm; segm = next_track, ++ii ) { next_track = segm->Next(); - if( segm->GetNetCode() != net_code_delete ) + if( segm->GetNetCode() != netcode ) break; GetBoard()->GetRatsnest()->Remove( segm ); @@ -188,7 +186,7 @@ void PCB_EDIT_FRAME::Delete_net( wxDC* DC, TRACK* aTrack ) SaveCopyInUndoList( itemsList, UR_DELETED ); OnModify(); - TestNetConnection( DC, net_code_delete ); + TestNetConnection( DC, netcode ); SetMsgPanel( GetBoard() ); } diff --git a/pcbnew/dialogs/dialog_create_array.cpp b/pcbnew/dialogs/dialog_create_array.cpp new file mode 100644 index 0000000000..a7d95e38fa --- /dev/null +++ b/pcbnew/dialogs/dialog_create_array.cpp @@ -0,0 +1,516 @@ +/* + * This program source code file is part of KiCad, a free EDA CAD application. + * + * Copyright (C) 2014 John Beard, john.j.beard@gmail.com + * 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 + * as published by the Free Software Foundation; either version 2 + * of the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, you may find one here: + * http://www.gnu.org/licenses/old-licenses/gpl-2.0.html + * or you may search the http://www.gnu.org website for the version 2 license, + * or you may write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA + */ + +#include +#include + +#include +#include +#include + +#include "dialog_create_array.h" + + +// initialise statics +DIALOG_CREATE_ARRAY::CREATE_ARRAY_DIALOG_ENTRIES DIALOG_CREATE_ARRAY::m_options; + +// character set +// NOTE: do not change the order of this relative to the ARRAY_NUMBERING_TYPE_T enum +static const wxString charSetDescriptions[] = +{ + "Numerals (0,1,2,...,9,10)", + "Hexadecimal (0,1,...,F,10,...)", + "Alphabet, minus IOSQXZ", + "Alphabet, full 26 characters" +}; + + +DIALOG_CREATE_ARRAY::DIALOG_CREATE_ARRAY( PCB_BASE_FRAME* aParent, wxPoint aOrigPos, + ARRAY_OPTIONS** aSettings ) : + DIALOG_CREATE_ARRAY_BASE( aParent ), + CONFIG_SAVE_RESTORE_WINDOW( m_options.m_optionsSet ), + m_settings( aSettings ), + m_originalItemPosition( aOrigPos ) +{ + // Set up numbering scheme drop downs + m_choicePriAxisNumbering->Set( boost::size( charSetDescriptions ), charSetDescriptions ); + m_choiceSecAxisNumbering->Set( boost::size( charSetDescriptions ), charSetDescriptions ); + m_choiceCircNumberingType->Set( boost::size( charSetDescriptions ), charSetDescriptions );; + + m_choicePriAxisNumbering->SetSelection( 0 ); + m_choiceSecAxisNumbering->SetSelection( 0 ); + m_choiceCircNumberingType->SetSelection( 0 ); + + Add( m_entryNx, m_options.m_gridNx ); + Add( m_entryNy, m_options.m_gridNy ); + Add( m_entryDx, m_options.m_gridDx ); + Add( m_entryDy, m_options.m_gridDy ); + + Add( m_entryOffsetX, m_options.m_gridOffsetX ); + Add( m_entryOffsetY, m_options.m_gridOffsetY ); + Add( m_entryStagger, m_options.m_gridStagger ); + + Add( m_radioBoxGridStaggerType, m_options.m_gridStaggerType ); + + Add( m_radioBoxGridNumberingAxis, m_options.m_gridNumberingAxis ); + Add( m_checkBoxGridReverseNumbering, m_options.m_gridNumberingReverseAlternate ); + + Add( m_entryCentreX, m_options.m_circCentreX ); + Add( m_entryCentreY, m_options.m_circCentreY ); + Add( m_entryCircAngle, m_options.m_circAngle ); + Add( m_entryCircCount, m_options.m_circCount ); + Add( m_entryRotateItemsCb, m_options.m_circRotate ); + Add( m_entryCircNumberingStart, m_options.m_circNumberingOffset ); + + Add( m_gridTypeNotebook, m_options.m_arrayTypeTab ); + + Add( m_radioBoxGridNumberingScheme, m_options.m_grid2dArrayNumbering ); + Add( m_choicePriAxisNumbering, m_options.m_gridPriAxisNumScheme ); + Add( m_choiceSecAxisNumbering, m_options.m_gridSecAxisNumScheme ); + + Add( m_entryGridPriNumberingOffset, m_options.m_gridPriNumberingOffset ); + Add( m_entryGridSecNumberingOffset, m_options.m_gridSecNumberingOffset ); + + + RestoreConfigToControls(); + + // Load units into labels + { + const wxString lengthUnit = GetAbbreviatedUnitsLabel( g_UserUnit ); + + m_unitLabelCentreX->SetLabelText( lengthUnit ); + m_unitLabelCentreY->SetLabelText( lengthUnit ); + m_unitLabelDx->SetLabelText( lengthUnit ); + m_unitLabelDy->SetLabelText( lengthUnit ); + m_unitLabelOffsetX->SetLabelText( lengthUnit ); + m_unitLabelOffsetY->SetLabelText( lengthUnit ); + } + + // Run the callbacks once to process the dialog contents + setControlEnablement(); + calculateCircularArrayProperties(); + + Fit(); +} + + +void DIALOG_CREATE_ARRAY::OnParameterChanged( wxCommandEvent& event ) +{ + const wxObject* evObj = event.GetEventObject(); + + // some controls result in a change of enablement + if( evObj == m_radioBoxGridNumberingScheme + || evObj == m_checkBoxGridRestartNumbering ) + { + setControlEnablement(); + } + if( evObj == m_entryCentreX || evObj == m_entryCentreY ) + { + calculateCircularArrayProperties(); + } +} + + +void DIALOG_CREATE_ARRAY::OnCancelClick( wxCommandEvent& event ) +{ + EndModal( CREATE_ARRAY_ABORT ); +} + + +static const std::string& alphabetFromNumberingScheme( + DIALOG_CREATE_ARRAY::ARRAY_NUMBERING_TYPE_T type ) +{ + static const std::string alphaNumeric = "0123456789"; + static const std::string alphaHex = "0123456789ABCDEF"; + static const std::string alphaFull = "ABCDEFGHIJKLMNOPQRSTUVWXYZ"; + static const std::string alphaNoIOSQXZ = "ABCDEFGHJKLNMPRTUVWY"; + static const std::string alphaEmpty = ""; + + switch( type ) + { + case DIALOG_CREATE_ARRAY::NUMBERING_NUMERIC: + return alphaNumeric; + + case DIALOG_CREATE_ARRAY::NUMBERING_HEX: + return alphaHex; + + case DIALOG_CREATE_ARRAY::NUMBERING_ALPHA_NO_IOSQXZ: + return alphaNoIOSQXZ; + + case DIALOG_CREATE_ARRAY::NUMBERING_ALPHA_FULL: + return alphaFull; + + default: + wxASSERT_MSG( false, wxString( "Un-handled numbering scheme: " ) << type ); + } + + return alphaEmpty; +} + + +/** + * @return False for schemes like 0,1...9,10 + * True for schemes like A,B..Z,AA (where the tens column starts with char 0) + */ +static bool schemeNonUnitColsStartAt0( DIALOG_CREATE_ARRAY::ARRAY_NUMBERING_TYPE_T type ) +{ + return type == DIALOG_CREATE_ARRAY::NUMBERING_ALPHA_FULL + || type == DIALOG_CREATE_ARRAY::NUMBERING_ALPHA_NO_IOSQXZ; +} + + +static bool getNumberingOffset( const std::string& str, + DIALOG_CREATE_ARRAY::ARRAY_NUMBERING_TYPE_T type, + int& offsetToFill ) +{ + const std::string alphabet = alphabetFromNumberingScheme( type ); + + wxASSERT_MSG( !alphabet.empty(), wxString( + "Unable to determine alphabet for numbering scheme: " ) << type ); + + int offset = 0; + const int radix = alphabet.length(); + + for( unsigned i = 0; i < str.length(); i++ ) + { + int chIndex = alphabet.find( str[i], 0 ); + + if( chIndex == wxNOT_FOUND ) + return false; + + const bool start0 = schemeNonUnitColsStartAt0( type ); + + // eg "AA" is actually index 27, not 26 + if( start0 && i < str.length() - 1 ) + chIndex++; + + offset *= radix; + offset += chIndex; + } + + offsetToFill = offset; + return true; +} + + +void DIALOG_CREATE_ARRAY::OnOkClick( wxCommandEvent& event ) +{ + ARRAY_OPTIONS* newSettings = NULL; + + const wxWindow* page = m_gridTypeNotebook->GetCurrentPage(); + + if( page == m_gridPanel ) + { + ARRAY_GRID_OPTIONS* newGrid = new ARRAY_GRID_OPTIONS(); + bool ok = true; + + // ints + ok = ok && m_entryNx->GetValue().ToLong( &newGrid->m_nx ); + ok = ok && m_entryNy->GetValue().ToLong( &newGrid->m_ny ); + + newGrid->m_delta.x = DoubleValueFromString( g_UserUnit, m_entryDx->GetValue() ); + newGrid->m_delta.y = DoubleValueFromString( g_UserUnit, m_entryDy->GetValue() ); + + newGrid->m_offset.x = DoubleValueFromString( g_UserUnit, m_entryOffsetX->GetValue() ); + newGrid->m_offset.y = DoubleValueFromString( g_UserUnit, m_entryOffsetY->GetValue() ); + + ok = ok && m_entryStagger->GetValue().ToLong( &newGrid->m_stagger ); + + newGrid->m_stagger_rows = m_radioBoxGridStaggerType->GetSelection() == 0; + + newGrid->m_horizontalThenVertical = m_radioBoxGridNumberingAxis->GetSelection() == 0; + newGrid->m_reverseNumberingAlternate = m_checkBoxGridReverseNumbering->GetValue(); + + newGrid->m_2dArrayNumbering = m_radioBoxGridNumberingScheme->GetSelection() != 0; + + // this is only correct if you set the choice up according to the enum size and order + ok = ok && m_choicePriAxisNumbering->GetSelection() < NUMBERING_TYPE_Max + && m_choiceSecAxisNumbering->GetSelection() < NUMBERING_TYPE_Max; + + // mind undefined casts to enums (should not be able to happen) + if( ok ) + { + newGrid->m_priAxisNumType = + (ARRAY_NUMBERING_TYPE_T) m_choicePriAxisNumbering->GetSelection(); + newGrid->m_secAxisNumType = + (ARRAY_NUMBERING_TYPE_T) m_choiceSecAxisNumbering->GetSelection(); + } + + // Work out the offsets for the numbering + ok = ok && getNumberingOffset( + m_entryGridPriNumberingOffset->GetValue().ToStdString(), + newGrid->m_priAxisNumType, newGrid->m_numberingOffsetX ); + + if( newGrid->m_2dArrayNumbering ) + ok = ok && getNumberingOffset( + m_entryGridSecNumberingOffset->GetValue().ToStdString(), + newGrid->m_secAxisNumType, newGrid->m_numberingOffsetY ); + + newGrid->m_shouldRenumber = m_checkBoxGridRestartNumbering->GetValue(); + + // Only use settings if all values are good + if( ok ) + newSettings = newGrid; + else + delete newGrid; + } + else if( page == m_circularPanel ) + { + ARRAY_CIRCULAR_OPTIONS* newCirc = new ARRAY_CIRCULAR_OPTIONS(); + bool ok = true; + + newCirc->m_centre.x = DoubleValueFromString( g_UserUnit, m_entryCentreX->GetValue() ); + newCirc->m_centre.y = DoubleValueFromString( g_UserUnit, m_entryCentreY->GetValue() ); + + newCirc->m_angle = DoubleValueFromString( DEGREES, m_entryCircAngle->GetValue() ); + ok = ok && m_entryCircCount->GetValue().ToLong( &newCirc->m_nPts ); + + newCirc->m_rotateItems = m_entryRotateItemsCb->GetValue(); + + newCirc->m_shouldRenumber = m_checkBoxCircRestartNumbering->GetValue(); + + // This is only correct if you set the choice up according to the enum size and order + ok = ok && m_choiceCircNumberingType->GetSelection() < NUMBERING_TYPE_Max; + + // Mind undefined casts to enums (should not be able to happen) + if( ok ) + newCirc->m_numberingType = + (ARRAY_NUMBERING_TYPE_T) m_choiceCircNumberingType->GetSelection(); + + ok = ok && m_entryCircNumberingStart->GetValue().ToLong( &newCirc->m_numberingOffset ); + + // Only use settings if all values are good + if( ok ) + newSettings = newCirc; + else + delete newCirc; + } + + // If we got good settings, send them out and finish + if( newSettings ) + { + delete *m_settings; + + // assign pointer and ownership here + *m_settings = newSettings; + + ReadConfigFromControls(); + + EndModal( CREATE_ARRAY_OK ); + } +} + + +void DIALOG_CREATE_ARRAY::setControlEnablement() +{ + const bool renumber = m_checkBoxGridRestartNumbering->GetValue(); + + // If we're not renumbering, we can't set the numbering scheme + // or axis numbering types + m_radioBoxGridNumberingScheme->Enable( renumber ); + m_labelPriAxisNumbering->Enable( renumber ); + m_choicePriAxisNumbering->Enable( renumber ); + + // Disable the secondary axis numbering option if the + // numbering scheme doesn't have two axes + const bool num2d = m_radioBoxGridNumberingScheme->GetSelection() != 0; + + m_labelSecAxisNumbering->Enable( renumber && num2d ); + m_choiceSecAxisNumbering->Enable( renumber && num2d ); + + // We can only set an offset if we renumber + m_labelGridNumberingOffset->Enable( renumber ); + m_entryGridPriNumberingOffset->Enable( renumber ); + m_entryGridSecNumberingOffset->Enable( renumber && num2d ); + + + // Circular array options + const bool circRenumber = m_checkBoxCircRestartNumbering->GetValue(); + m_choiceCircNumberingType->Enable( circRenumber ); +} + + +void DIALOG_CREATE_ARRAY::calculateCircularArrayProperties() +{ + wxPoint centre; + + centre.x = DoubleValueFromString( g_UserUnit, m_entryCentreX->GetValue() ); + centre.y = DoubleValueFromString( g_UserUnit, m_entryCentreY->GetValue() ); + + // FInd the radius, etc of the circle + centre -= m_originalItemPosition; + + const double radius = VECTOR2I(centre.x, centre.y).EuclideanNorm(); + + m_labelCircRadiusValue->SetLabelText( StringFromValue( g_UserUnit, int(radius), true ) ); +} + + +// ARRAY OPTION implementation functions -------------------------------------- + +std::string DIALOG_CREATE_ARRAY::ARRAY_OPTIONS::getCoordinateNumber( int n, + ARRAY_NUMBERING_TYPE_T type ) +{ + std::string itemNum; + const std::string& alphabet = alphabetFromNumberingScheme( type ); + + if( !alphabet.empty() ) + { + const bool nonUnitColsStartAt0 = schemeNonUnitColsStartAt0( type ); + + bool firstRound = true; + int radix = alphabet.length(); + + do { + int modN = n % radix; + + if( nonUnitColsStartAt0 && !firstRound ) + modN--; // Start the "tens/hundreds/etc column" at "Ax", not "Bx" + + itemNum.insert( 0, 1, alphabet[modN] ); + + n /= radix; + firstRound = false; + } while( n ); + } + + return itemNum; +} + + +wxString DIALOG_CREATE_ARRAY::ARRAY_OPTIONS::InterpolateNumberIntoString( + int aN, const wxString& aPattern ) const +{ + wxString newStr( aPattern ); + newStr.Replace( "%s", GetItemNumber( aN ), false ); + + return newStr; +} + + +int DIALOG_CREATE_ARRAY::ARRAY_GRID_OPTIONS::GetArraySize() const +{ + return m_nx * m_ny; +} + + +wxPoint DIALOG_CREATE_ARRAY::ARRAY_GRID_OPTIONS::getGridCoords( int n ) const +{ + const int axisSize = m_horizontalThenVertical ? m_nx : m_ny; + + int x = n % axisSize; + int y = n / axisSize; + + // reverse on this row/col? + if( m_reverseNumberingAlternate && ( y % 2 ) ) + x = axisSize - x - 1; + + wxPoint coords( x, y ); + + return coords; +} + + +void DIALOG_CREATE_ARRAY::ARRAY_GRID_OPTIONS::TransformItem( int n, BOARD_ITEM* item, + const wxPoint& rotPoint ) const +{ + wxPoint point; + + wxPoint coords = getGridCoords( n ); + + // swap axes if needed + if( !m_horizontalThenVertical ) + std::swap( coords.x, coords.y ); + + point.x = coords.x * m_delta.x + coords.y * m_offset.x; + point.y = coords.y * m_delta.y + coords.x * m_offset.y; + + if( abs( m_stagger ) > 1 ) + { + const int stagger = abs( m_stagger ); + const bool sr = m_stagger_rows; + const int stagger_idx = ( ( sr ? coords.y : coords.x ) % stagger ); + + wxPoint stagger_delta( ( sr ? m_delta.x : m_offset.x ), + ( sr ? m_offset.y : m_delta.y ) ); + + // Stagger to the left/up if the sign of the stagger is negative + point += stagger_delta * copysign( stagger_idx, m_stagger ) / stagger; + } + + // this is already relative to the first array entry + item->Move( point ); +} + + +wxString DIALOG_CREATE_ARRAY::ARRAY_GRID_OPTIONS::GetItemNumber( int n ) const +{ + wxString itemNum; + + if( m_2dArrayNumbering ) + { + wxPoint coords = getGridCoords( n ); + + itemNum += getCoordinateNumber( coords.x + m_numberingOffsetX, m_priAxisNumType ); + itemNum += getCoordinateNumber( coords.y + m_numberingOffsetY, m_secAxisNumType ); + } + else + { + itemNum += getCoordinateNumber( n + m_numberingOffsetX, m_priAxisNumType ); + } + + return itemNum; +} + + +int DIALOG_CREATE_ARRAY::ARRAY_CIRCULAR_OPTIONS::GetArraySize() const +{ + return m_nPts; +} + + +void DIALOG_CREATE_ARRAY::ARRAY_CIRCULAR_OPTIONS::TransformItem( int n, BOARD_ITEM* item, + const wxPoint& rotPoint ) const +{ + double angle; + + if( m_angle == 0 ) + // angle is zero, divide evenly into m_nPts + angle = 3600.0 * n / float(m_nPts); + else + // n'th step + angle = m_angle * n; + + item->Rotate( m_centre, angle ); + + // take off the rotation (but not the translation) if needed + if( !m_rotateItems ) + item->Rotate( item->GetCenter(), -angle ); +} + + +wxString DIALOG_CREATE_ARRAY::ARRAY_CIRCULAR_OPTIONS::GetItemNumber( int aN ) const +{ + return getCoordinateNumber( aN + m_numberingOffset, m_numberingType ); +} diff --git a/pcbnew/dialogs/dialog_create_array.h b/pcbnew/dialogs/dialog_create_array.h new file mode 100644 index 0000000000..2f80d27ba0 --- /dev/null +++ b/pcbnew/dialogs/dialog_create_array.h @@ -0,0 +1,360 @@ +/* + * This program source code file is part of KiCad, a free EDA CAD application. + * + * Copyright (C) 2014 John Beard, john.j.beard@gmail.com + * 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 + * as published by the Free Software Foundation; either version 2 + * of the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, you may find one here: + * http://www.gnu.org/licenses/old-licenses/gpl-2.0.html + * or you may search the http://www.gnu.org website for the version 2 license, + * or you may write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA + */ + +#ifndef __DIALOG_CREATE_ARRAY__ +#define __DIALOG_CREATE_ARRAY__ + +// Include the wxFormBuider header base: +#include + +#include + +class CONFIG_SAVE_RESTORE_WINDOW +{ +private: + + enum CONFIG_CTRL_TYPE_T + { + CFG_CTRL_TEXT, + CFG_CTRL_CHECKBOX, + CFG_CTRL_RADIOBOX, + CFG_CTRL_CHOICE, + CFG_CTRL_TAB + }; + + struct CONFIG_CTRL_T + { + wxControl* control; + CONFIG_CTRL_TYPE_T type; + void* dest; + }; + + std::vector ctrls; + bool& valid; + +protected: + CONFIG_SAVE_RESTORE_WINDOW( bool& validFlag ) : + valid( validFlag ) + {} + + void Add( wxRadioBox* ctrl, int& dest ) + { + CONFIG_CTRL_T ctrlInfo = { ctrl, CFG_CTRL_RADIOBOX, (void*) &dest }; + + ctrls.push_back( ctrlInfo ); + } + + void Add( wxCheckBox* ctrl, bool& dest ) + { + CONFIG_CTRL_T ctrlInfo = { ctrl, CFG_CTRL_CHECKBOX, (void*) &dest }; + + ctrls.push_back( ctrlInfo ); + } + + void Add( wxTextCtrl* ctrl, std::string& dest ) + { + CONFIG_CTRL_T ctrlInfo = { ctrl, CFG_CTRL_TEXT, (void*) &dest }; + + ctrls.push_back( ctrlInfo ); + } + + void Add( wxChoice* ctrl, int& dest ) + { + CONFIG_CTRL_T ctrlInfo = { ctrl, CFG_CTRL_CHOICE, (void*) &dest }; + + ctrls.push_back( ctrlInfo ); + } + + void Add( wxNotebook* ctrl, int& dest ) + { + CONFIG_CTRL_T ctrlInfo = { ctrl, CFG_CTRL_TAB, (void*) &dest }; + + ctrls.push_back( ctrlInfo ); + } + + void ReadConfigFromControls() + { + for( std::vector::const_iterator iter = ctrls.begin(), iend = ctrls.end(); + iter != iend; ++iter ) + { + switch( iter->type ) + { + case CFG_CTRL_CHECKBOX: + *(bool*) iter->dest = static_cast( iter->control )->GetValue(); + break; + + case CFG_CTRL_TEXT: + *(std::string*) iter->dest = static_cast( iter->control )->GetValue(); + break; + + case CFG_CTRL_CHOICE: + *(int*) iter->dest = static_cast( iter->control )->GetSelection(); + break; + + case CFG_CTRL_RADIOBOX: + *(int*) iter->dest = static_cast( iter->control )->GetSelection(); + break; + + case CFG_CTRL_TAB: + *(int*) iter->dest = static_cast( iter->control )->GetSelection(); + break; + + default: + wxASSERT_MSG( false, wxString( + "Unhandled control type for config store: " ) << iter->type ); + } + } + + valid = true; + } + + void RestoreConfigToControls() + { + if( !valid ) + return; + + for( std::vector::const_iterator iter = ctrls.begin(), iend = ctrls.end(); + iter != iend; ++iter ) + { + switch( iter->type ) + { + case CFG_CTRL_CHECKBOX: + static_cast( iter->control )->SetValue( *(bool*) iter->dest ); + break; + + case CFG_CTRL_TEXT: + static_cast( iter->control )->SetValue( *(std::string*) iter->dest ); + break; + + case CFG_CTRL_CHOICE: + static_cast( iter->control )->SetSelection( *(int*) iter->dest ); + break; + + case CFG_CTRL_RADIOBOX: + static_cast( iter->control )->SetSelection( *(int*) iter->dest ); + break; + + case CFG_CTRL_TAB: + static_cast( iter->control )->SetSelection( *(int*) iter->dest ); + break; + + default: + wxASSERT_MSG( false, wxString( + "Unhandled control type for config restore: " ) << iter->type ); + } + } + } +}; + +class DIALOG_CREATE_ARRAY : public DIALOG_CREATE_ARRAY_BASE, + public CONFIG_SAVE_RESTORE_WINDOW +{ +public: + + enum CREATE_ARRAY_EDIT_T + { + CREATE_ARRAY_ABORT, ///< if not changed or error + CREATE_ARRAY_OK, ///< if successfully changed + }; + + enum ARRAY_TYPE_T + { + ARRAY_GRID, ///< A grid (x*y) array + ARRAY_CIRCULAR, ///< A circular array + }; + + // NOTE: do not change order relative to charSetDescriptions + enum ARRAY_NUMBERING_TYPE_T + { + NUMBERING_NUMERIC = 0, ///< Arabic numerals: 0,1,2,3,4,5,6,7,8,9,10,11... + NUMBERING_HEX, + NUMBERING_ALPHA_NO_IOSQXZ, /*!< Alphabet, excluding IOSQXZ + * + * Per ASME Y14.35M-1997 sec. 5.2 (previously MIL-STD-100 sec. 406.5) + * as these can be confused with numerals and are often not used + * for pin numbering on BGAs, etc + */ + NUMBERING_ALPHA_FULL, ///< Full 26-character alphabet + NUMBERING_TYPE_Max ///< Invalid maximum value, insert above here + }; + + /** + * Persistent dialog options + */ + struct ARRAY_OPTIONS + { + ARRAY_OPTIONS( ARRAY_TYPE_T aType ) : + m_type( aType ), + m_shouldRenumber( false ) + {} + + virtual ~ARRAY_OPTIONS() {}; + + ARRAY_TYPE_T m_type; + bool m_shouldRenumber; + + /*! + * Function GetArrayPositions + * Returns the set of points that represent the array + * in order, if that is important + * + * TODO: Can/should this be done with some sort of iterator? + */ + virtual void TransformItem( int n, BOARD_ITEM* item, + const wxPoint& rotPoint ) const = 0; + virtual int GetArraySize() const = 0; + virtual wxString GetItemNumber( int n ) const = 0; + virtual wxString InterpolateNumberIntoString( int n, const wxString& pattern ) const; + + bool ShouldRenumberItems() const + { + return m_shouldRenumber; + } + +protected: + static std::string getCoordinateNumber( int n, ARRAY_NUMBERING_TYPE_T type ); + }; + + struct ARRAY_GRID_OPTIONS : public ARRAY_OPTIONS + { + ARRAY_GRID_OPTIONS() : + ARRAY_OPTIONS( ARRAY_GRID ), + m_nx( 0 ), m_ny( 0 ), + m_horizontalThenVertical( true ), + m_reverseNumberingAlternate( false ), + m_stagger( 0 ), + m_stagger_rows( true ), + m_2dArrayNumbering( false ), + m_numberingOffsetX( 0 ), + m_numberingOffsetY( 0 ), + m_priAxisNumType( NUMBERING_NUMERIC ), + m_secAxisNumType( NUMBERING_NUMERIC ) + {} + + long m_nx, m_ny; + bool m_horizontalThenVertical, m_reverseNumberingAlternate; + wxPoint m_delta; + wxPoint m_offset; + long m_stagger; + bool m_stagger_rows; + bool m_2dArrayNumbering; + int m_numberingOffsetX, m_numberingOffsetY; + ARRAY_NUMBERING_TYPE_T m_priAxisNumType, m_secAxisNumType; + + void TransformItem( int n, BOARD_ITEM* item, const wxPoint& rotPoint ) const; // override virtual + int GetArraySize() const; // override virtual + wxString GetItemNumber( int n ) const; // override virtual + +private: + wxPoint getGridCoords( int n ) const; + }; + + struct ARRAY_CIRCULAR_OPTIONS : public ARRAY_OPTIONS + { + ARRAY_CIRCULAR_OPTIONS() : + ARRAY_OPTIONS( ARRAY_CIRCULAR ), + m_nPts( 0 ), + m_angle( 0.0f ), + m_rotateItems( false ), + m_numberingType( NUMBERING_NUMERIC ), + m_numberingOffset( 0 ) + {} + + long m_nPts; + double m_angle; + wxPoint m_centre; + bool m_rotateItems; + ARRAY_NUMBERING_TYPE_T m_numberingType; + long m_numberingOffset; + + void TransformItem( int n, BOARD_ITEM* item, const wxPoint& rotPoint ) const; // override virtual + int GetArraySize() const; // override virtual + wxString GetItemNumber( int n ) const; // override virtual + }; + + // Constructor and destructor + DIALOG_CREATE_ARRAY( PCB_BASE_FRAME* aParent, wxPoint aOrigPos, ARRAY_OPTIONS** settings ); + virtual ~DIALOG_CREATE_ARRAY() {}; + +private: + + /** + * The settings object returned to the caller. + * We update the caller's object and never have ownership + */ + ARRAY_OPTIONS** m_settings; + + /* + * The position of the original item(s), used for finding radius, etc + */ + const wxPoint m_originalItemPosition; + + // Event callbacks + void OnParameterChanged( wxCommandEvent& event ); + void OnCancelClick( wxCommandEvent& event ); + void OnOkClick( wxCommandEvent& event ); + + // Internal callback handlers + void setControlEnablement(); + void calculateCircularArrayProperties(); + + struct CREATE_ARRAY_DIALOG_ENTRIES + { + CREATE_ARRAY_DIALOG_ENTRIES() : + m_optionsSet( false ), + m_gridStaggerType( 0 ), + m_gridNumberingAxis( 0 ), + m_gridNumberingReverseAlternate( false ), + m_grid2dArrayNumbering( 0 ), + m_gridPriAxisNumScheme( 0 ), + m_gridSecAxisNumScheme( 0 ), + m_circRotate( false ), + m_arrayTypeTab( 0 ) + {} + + bool m_optionsSet; + + std::string m_gridNx, m_gridNy, + m_gridDx, m_gridDy, + m_gridOffsetX, m_gridOffsetY, + m_gridStagger; + + int m_gridStaggerType, m_gridNumberingAxis; + bool m_gridNumberingReverseAlternate; + int m_grid2dArrayNumbering; + int m_gridPriAxisNumScheme, m_gridSecAxisNumScheme; + std::string m_gridPriNumberingOffset, m_gridSecNumberingOffset; + + std::string m_circCentreX, m_circCentreY, + m_circAngle, m_circCount, m_circNumberingOffset; + bool m_circRotate; + + int m_arrayTypeTab; + }; + + static CREATE_ARRAY_DIALOG_ENTRIES m_options; + +}; + +#endif // __DIALOG_CREATE_ARRAY__ diff --git a/pcbnew/dialogs/dialog_create_array_base.cpp b/pcbnew/dialogs/dialog_create_array_base.cpp new file mode 100644 index 0000000000..066b6629de --- /dev/null +++ b/pcbnew/dialogs/dialog_create_array_base.cpp @@ -0,0 +1,341 @@ +/////////////////////////////////////////////////////////////////////////// +// C++ code generated with wxFormBuilder (version Jun 6 2014) +// http://www.wxformbuilder.org/ +// +// PLEASE DO "NOT" EDIT THIS FILE! +/////////////////////////////////////////////////////////////////////////// + +#include "dialog_create_array_base.h" + +/////////////////////////////////////////////////////////////////////////// + +DIALOG_CREATE_ARRAY_BASE::DIALOG_CREATE_ARRAY_BASE( wxWindow* parent, wxWindowID id, const wxString& title, const wxPoint& pos, const wxSize& size, long style ) : DIALOG_SHIM( parent, id, title, pos, size, style ) +{ + this->SetSizeHints( wxSize( -1,-1 ), wxDefaultSize ); + + wxBoxSizer* bMainSizer; + bMainSizer = new wxBoxSizer( wxVERTICAL ); + + m_gridTypeNotebook = new wxNotebook( this, wxID_ANY, wxDefaultPosition, wxDefaultSize, 0 ); + m_gridPanel = new wxPanel( m_gridTypeNotebook, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxTAB_TRAVERSAL ); + wxBoxSizer* bSizer2; + bSizer2 = new wxBoxSizer( wxHORIZONTAL ); + + wxGridBagSizer* gbSizer1; + gbSizer1 = new wxGridBagSizer( 0, 0 ); + gbSizer1->SetFlexibleDirection( wxBOTH ); + gbSizer1->SetNonFlexibleGrowMode( wxFLEX_GROWMODE_SPECIFIED ); + + m_labelNx = new wxStaticText( m_gridPanel, wxID_ANY, _("x Count:"), wxDefaultPosition, wxDefaultSize, 0 ); + m_labelNx->Wrap( -1 ); + gbSizer1->Add( m_labelNx, wxGBPosition( 0, 0 ), wxGBSpan( 1, 1 ), wxALIGN_RIGHT|wxALL|wxALIGN_CENTER_VERTICAL, 5 ); + + m_entryNx = new wxTextCtrl( m_gridPanel, wxID_ANY, _("5"), wxDefaultPosition, wxDefaultSize, 0 ); + gbSizer1->Add( m_entryNx, wxGBPosition( 0, 1 ), wxGBSpan( 1, 1 ), wxALL, 5 ); + + m_labelNy = new wxStaticText( m_gridPanel, wxID_ANY, _("y Count:"), wxDefaultPosition, wxDefaultSize, 0 ); + m_labelNy->Wrap( -1 ); + gbSizer1->Add( m_labelNy, wxGBPosition( 1, 0 ), wxGBSpan( 1, 1 ), wxALIGN_RIGHT|wxALL|wxALIGN_CENTER_VERTICAL, 5 ); + + m_entryNy = new wxTextCtrl( m_gridPanel, wxID_ANY, _("5"), wxDefaultPosition, wxDefaultSize, 0 ); + gbSizer1->Add( m_entryNy, wxGBPosition( 1, 1 ), wxGBSpan( 1, 1 ), wxALL, 5 ); + + m_labelDx = new wxStaticText( m_gridPanel, wxID_ANY, _("x Spacing:"), wxDefaultPosition, wxDefaultSize, 0 ); + m_labelDx->Wrap( -1 ); + gbSizer1->Add( m_labelDx, wxGBPosition( 2, 0 ), wxGBSpan( 1, 1 ), wxALL|wxALIGN_RIGHT|wxALIGN_CENTER_VERTICAL, 5 ); + + m_entryDx = new wxTextCtrl( m_gridPanel, wxID_ANY, _("5"), wxDefaultPosition, wxDefaultSize, 0 ); + gbSizer1->Add( m_entryDx, wxGBPosition( 2, 1 ), wxGBSpan( 1, 1 ), wxALL, 5 ); + + m_unitLabelDx = new wxStaticText( m_gridPanel, wxID_ANY, _("mm"), wxDefaultPosition, wxDefaultSize, 0 ); + m_unitLabelDx->Wrap( -1 ); + gbSizer1->Add( m_unitLabelDx, wxGBPosition( 2, 2 ), wxGBSpan( 1, 1 ), wxALL|wxALIGN_CENTER_VERTICAL, 5 ); + + m_labelDy = new wxStaticText( m_gridPanel, wxID_ANY, _("y Spacing:"), wxDefaultPosition, wxDefaultSize, 0 ); + m_labelDy->Wrap( -1 ); + gbSizer1->Add( m_labelDy, wxGBPosition( 3, 0 ), wxGBSpan( 1, 1 ), wxALL|wxALIGN_RIGHT|wxALIGN_CENTER_VERTICAL, 5 ); + + m_entryDy = new wxTextCtrl( m_gridPanel, wxID_ANY, _("5"), wxDefaultPosition, wxDefaultSize, 0 ); + gbSizer1->Add( m_entryDy, wxGBPosition( 3, 1 ), wxGBSpan( 1, 1 ), wxALL, 5 ); + + m_unitLabelDy = new wxStaticText( m_gridPanel, wxID_ANY, _("mm"), wxDefaultPosition, wxDefaultSize, 0 ); + m_unitLabelDy->Wrap( -1 ); + gbSizer1->Add( m_unitLabelDy, wxGBPosition( 3, 2 ), wxGBSpan( 1, 1 ), wxALL|wxALIGN_CENTER_VERTICAL, 5 ); + + m_labelOffsetX = new wxStaticText( m_gridPanel, wxID_ANY, _("x Offset:"), wxDefaultPosition, wxDefaultSize, 0 ); + m_labelOffsetX->Wrap( -1 ); + gbSizer1->Add( m_labelOffsetX, wxGBPosition( 4, 0 ), wxGBSpan( 1, 1 ), wxALL|wxALIGN_RIGHT|wxALIGN_CENTER_VERTICAL, 5 ); + + m_entryOffsetX = new wxTextCtrl( m_gridPanel, wxID_ANY, _("0"), wxDefaultPosition, wxDefaultSize, 0 ); + gbSizer1->Add( m_entryOffsetX, wxGBPosition( 4, 1 ), wxGBSpan( 1, 1 ), wxALL, 5 ); + + m_unitLabelOffsetX = new wxStaticText( m_gridPanel, wxID_ANY, _("mm"), wxDefaultPosition, wxDefaultSize, 0 ); + m_unitLabelOffsetX->Wrap( -1 ); + gbSizer1->Add( m_unitLabelOffsetX, wxGBPosition( 4, 2 ), wxGBSpan( 1, 1 ), wxALL|wxALIGN_CENTER_VERTICAL, 5 ); + + m_labelOffsetY = new wxStaticText( m_gridPanel, wxID_ANY, _("y Offset:"), wxDefaultPosition, wxDefaultSize, 0 ); + m_labelOffsetY->Wrap( -1 ); + gbSizer1->Add( m_labelOffsetY, wxGBPosition( 5, 0 ), wxGBSpan( 1, 1 ), wxALL|wxALIGN_RIGHT|wxALIGN_CENTER_VERTICAL, 5 ); + + m_entryOffsetY = new wxTextCtrl( m_gridPanel, wxID_ANY, _("0"), wxDefaultPosition, wxDefaultSize, 0 ); + gbSizer1->Add( m_entryOffsetY, wxGBPosition( 5, 1 ), wxGBSpan( 1, 1 ), wxALL, 5 ); + + m_unitLabelOffsetY = new wxStaticText( m_gridPanel, wxID_ANY, _("mm"), wxDefaultPosition, wxDefaultSize, 0 ); + m_unitLabelOffsetY->Wrap( -1 ); + gbSizer1->Add( m_unitLabelOffsetY, wxGBPosition( 5, 2 ), wxGBSpan( 1, 1 ), wxALL|wxALIGN_CENTER_VERTICAL, 5 ); + + m_labelStagger = new wxStaticText( m_gridPanel, wxID_ANY, _("Stagger:"), wxDefaultPosition, wxDefaultSize, 0 ); + m_labelStagger->Wrap( -1 ); + gbSizer1->Add( m_labelStagger, wxGBPosition( 6, 0 ), wxGBSpan( 1, 1 ), wxALL|wxALIGN_RIGHT|wxALIGN_CENTER_VERTICAL, 5 ); + + m_entryStagger = new wxTextCtrl( m_gridPanel, wxID_ANY, _("1"), wxDefaultPosition, wxDefaultSize, 0 ); + gbSizer1->Add( m_entryStagger, wxGBPosition( 6, 1 ), wxGBSpan( 1, 1 ), wxALL, 5 ); + + wxString m_radioBoxGridStaggerTypeChoices[] = { _("Rows"), _("Columns") }; + int m_radioBoxGridStaggerTypeNChoices = sizeof( m_radioBoxGridStaggerTypeChoices ) / sizeof( wxString ); + m_radioBoxGridStaggerType = new wxRadioBox( m_gridPanel, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, m_radioBoxGridStaggerTypeNChoices, m_radioBoxGridStaggerTypeChoices, 1, wxRA_SPECIFY_COLS ); + m_radioBoxGridStaggerType->SetSelection( 0 ); + gbSizer1->Add( m_radioBoxGridStaggerType, wxGBPosition( 7, 1 ), wxGBSpan( 1, 2 ), wxALL|wxEXPAND, 5 ); + + m_labelGridStaggerType = new wxStaticText( m_gridPanel, wxID_ANY, _("Stagger type:"), wxDefaultPosition, wxDefaultSize, 0 ); + m_labelGridStaggerType->Wrap( -1 ); + gbSizer1->Add( m_labelGridStaggerType, wxGBPosition( 7, 0 ), wxGBSpan( 1, 1 ), wxALL, 5 ); + + + bSizer2->Add( gbSizer1, 1, wxEXPAND, 5 ); + + wxBoxSizer* bSizer3; + bSizer3 = new wxBoxSizer( wxVERTICAL ); + + wxString m_radioBoxGridNumberingAxisChoices[] = { _("Horizontal, then vertical"), _("Vertical, then horizontal") }; + int m_radioBoxGridNumberingAxisNChoices = sizeof( m_radioBoxGridNumberingAxisChoices ) / sizeof( wxString ); + m_radioBoxGridNumberingAxis = new wxRadioBox( m_gridPanel, wxID_ANY, _("Numbering direction:"), wxDefaultPosition, wxDefaultSize, m_radioBoxGridNumberingAxisNChoices, m_radioBoxGridNumberingAxisChoices, 1, wxRA_SPECIFY_COLS ); + m_radioBoxGridNumberingAxis->SetSelection( 0 ); + bSizer3->Add( m_radioBoxGridNumberingAxis, 0, wxALL|wxEXPAND, 5 ); + + m_checkBoxGridReverseNumbering = new wxCheckBox( m_gridPanel, wxID_ANY, _("Reverse numbering on \nalternate rows/columns"), wxDefaultPosition, wxDefaultSize, 0 ); + bSizer3->Add( m_checkBoxGridReverseNumbering, 0, wxALL, 5 ); + + m_checkBoxGridRestartNumbering = new wxCheckBox( m_gridPanel, wxID_ANY, _("Restart numbering"), wxDefaultPosition, wxDefaultSize, 0 ); + m_checkBoxGridRestartNumbering->SetValue(true); + bSizer3->Add( m_checkBoxGridRestartNumbering, 0, wxALL, 5 ); + + wxString m_radioBoxGridNumberingSchemeChoices[] = { _("Continuous (1, 2, 3...)"), _("Co-ordinate (A1, A2, ... B1, ...)") }; + int m_radioBoxGridNumberingSchemeNChoices = sizeof( m_radioBoxGridNumberingSchemeChoices ) / sizeof( wxString ); + m_radioBoxGridNumberingScheme = new wxRadioBox( m_gridPanel, wxID_ANY, _("Numbering scheme:"), wxDefaultPosition, wxDefaultSize, m_radioBoxGridNumberingSchemeNChoices, m_radioBoxGridNumberingSchemeChoices, 1, wxRA_SPECIFY_COLS ); + m_radioBoxGridNumberingScheme->SetSelection( 0 ); + bSizer3->Add( m_radioBoxGridNumberingScheme, 0, wxALL|wxEXPAND, 5 ); + + m_labelPriAxisNumbering = new wxStaticText( m_gridPanel, wxID_ANY, _("Primary axis numbering:"), wxDefaultPosition, wxDefaultSize, 0 ); + m_labelPriAxisNumbering->Wrap( -1 ); + bSizer3->Add( m_labelPriAxisNumbering, 0, wxALL, 5 ); + + wxArrayString m_choicePriAxisNumberingChoices; + m_choicePriAxisNumbering = new wxChoice( m_gridPanel, wxID_ANY, wxDefaultPosition, wxDefaultSize, m_choicePriAxisNumberingChoices, 0 ); + m_choicePriAxisNumbering->SetSelection( 0 ); + bSizer3->Add( m_choicePriAxisNumbering, 0, wxALL|wxEXPAND, 5 ); + + m_labelSecAxisNumbering = new wxStaticText( m_gridPanel, wxID_ANY, _("Secondary axis numbering:"), wxDefaultPosition, wxDefaultSize, 0 ); + m_labelSecAxisNumbering->Wrap( -1 ); + m_labelSecAxisNumbering->Enable( false ); + + bSizer3->Add( m_labelSecAxisNumbering, 0, wxALL, 5 ); + + wxArrayString m_choiceSecAxisNumberingChoices; + m_choiceSecAxisNumbering = new wxChoice( m_gridPanel, wxID_ANY, wxDefaultPosition, wxDefaultSize, m_choiceSecAxisNumberingChoices, 0 ); + m_choiceSecAxisNumbering->SetSelection( 0 ); + m_choiceSecAxisNumbering->Enable( false ); + + bSizer3->Add( m_choiceSecAxisNumbering, 0, wxALL|wxEXPAND, 5 ); + + wxBoxSizer* bSizer5; + bSizer5 = new wxBoxSizer( wxHORIZONTAL ); + + m_labelGridNumberingOffset = new wxStaticText( m_gridPanel, wxID_ANY, _("Numbering start:"), wxDefaultPosition, wxDefaultSize, 0 ); + m_labelGridNumberingOffset->Wrap( -1 ); + bSizer5->Add( m_labelGridNumberingOffset, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5 ); + + m_entryGridPriNumberingOffset = new wxTextCtrl( m_gridPanel, wxID_ANY, _("1"), wxDefaultPosition, wxDefaultSize, 0 ); + bSizer5->Add( m_entryGridPriNumberingOffset, 0, wxALL, 5 ); + + m_entryGridSecNumberingOffset = new wxTextCtrl( m_gridPanel, wxID_ANY, _("1"), wxDefaultPosition, wxDefaultSize, 0 ); + bSizer5->Add( m_entryGridSecNumberingOffset, 0, wxALL, 5 ); + + + bSizer3->Add( bSizer5, 0, wxEXPAND, 5 ); + + + bSizer2->Add( bSizer3, 1, wxEXPAND, 5 ); + + + m_gridPanel->SetSizer( bSizer2 ); + m_gridPanel->Layout(); + bSizer2->Fit( m_gridPanel ); + m_gridTypeNotebook->AddPage( m_gridPanel, _("Grid"), true ); + m_circularPanel = new wxPanel( m_gridTypeNotebook, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxTAB_TRAVERSAL ); + wxBoxSizer* bSizer4; + bSizer4 = new wxBoxSizer( wxHORIZONTAL ); + + wxGridBagSizer* gbSizer2; + gbSizer2 = new wxGridBagSizer( 0, 0 ); + gbSizer2->SetFlexibleDirection( wxBOTH ); + gbSizer2->SetNonFlexibleGrowMode( wxFLEX_GROWMODE_SPECIFIED ); + + m_labelCentreX = new wxStaticText( m_circularPanel, wxID_ANY, _("x Centre:"), wxDefaultPosition, wxDefaultSize, 0 ); + m_labelCentreX->Wrap( -1 ); + gbSizer2->Add( m_labelCentreX, wxGBPosition( 0, 0 ), wxGBSpan( 1, 1 ), wxALL|wxALIGN_CENTER_VERTICAL|wxALIGN_RIGHT, 5 ); + + m_entryCentreX = new wxTextCtrl( m_circularPanel, wxID_ANY, _("0"), wxDefaultPosition, wxDefaultSize, 0 ); + gbSizer2->Add( m_entryCentreX, wxGBPosition( 0, 1 ), wxGBSpan( 1, 1 ), wxALL, 5 ); + + m_unitLabelCentreX = new wxStaticText( m_circularPanel, wxID_ANY, _("mm"), wxDefaultPosition, wxDefaultSize, 0 ); + m_unitLabelCentreX->Wrap( -1 ); + gbSizer2->Add( m_unitLabelCentreX, wxGBPosition( 0, 2 ), wxGBSpan( 1, 1 ), wxALL|wxALIGN_CENTER_VERTICAL, 5 ); + + m_labelCentreY = new wxStaticText( m_circularPanel, wxID_ANY, _("y Centre:"), wxDefaultPosition, wxDefaultSize, 0 ); + m_labelCentreY->Wrap( -1 ); + gbSizer2->Add( m_labelCentreY, wxGBPosition( 1, 0 ), wxGBSpan( 1, 1 ), wxALL|wxALIGN_CENTER_VERTICAL|wxALIGN_RIGHT, 5 ); + + m_entryCentreY = new wxTextCtrl( m_circularPanel, wxID_ANY, _("0"), wxDefaultPosition, wxDefaultSize, 0 ); + gbSizer2->Add( m_entryCentreY, wxGBPosition( 1, 1 ), wxGBSpan( 1, 1 ), wxALL, 5 ); + + m_unitLabelCentreY = new wxStaticText( m_circularPanel, wxID_ANY, _("mm"), wxDefaultPosition, wxDefaultSize, 0 ); + m_unitLabelCentreY->Wrap( -1 ); + gbSizer2->Add( m_unitLabelCentreY, wxGBPosition( 1, 2 ), wxGBSpan( 1, 1 ), wxALL|wxALIGN_CENTER_VERTICAL, 5 ); + + m_labelCircRadius = new wxStaticText( m_circularPanel, wxID_ANY, _("Radius:"), wxDefaultPosition, wxDefaultSize, 0 ); + m_labelCircRadius->Wrap( -1 ); + gbSizer2->Add( m_labelCircRadius, wxGBPosition( 2, 0 ), wxGBSpan( 1, 1 ), wxALIGN_CENTER_VERTICAL|wxALIGN_RIGHT|wxALL, 5 ); + + m_labelCircRadiusValue = new wxStaticText( m_circularPanel, wxID_ANY, _("0 mm"), wxDefaultPosition, wxDefaultSize, 0 ); + m_labelCircRadiusValue->Wrap( -1 ); + gbSizer2->Add( m_labelCircRadiusValue, wxGBPosition( 2, 1 ), wxGBSpan( 1, 1 ), wxALL, 5 ); + + m_labelCircAngle = new wxStaticText( m_circularPanel, wxID_ANY, _("Angle:"), wxDefaultPosition, wxDefaultSize, 0 ); + m_labelCircAngle->Wrap( -1 ); + gbSizer2->Add( m_labelCircAngle, wxGBPosition( 3, 0 ), wxGBSpan( 1, 1 ), wxALL|wxALIGN_CENTER_VERTICAL|wxALIGN_RIGHT, 5 ); + + m_entryCircAngle = new wxTextCtrl( m_circularPanel, wxID_ANY, _("0"), wxDefaultPosition, wxDefaultSize, 0 ); + m_entryCircAngle->SetToolTip( _("Positive angles represent an anti-clockwise rotation. An angle of 0 will produce a full circle divided evenly into \"Count\" portions.") ); + + gbSizer2->Add( m_entryCircAngle, wxGBPosition( 3, 1 ), wxGBSpan( 1, 1 ), wxALL, 5 ); + + m_unitLabelCircAngle = new wxStaticText( m_circularPanel, wxID_ANY, _("deg"), wxDefaultPosition, wxDefaultSize, 0 ); + m_unitLabelCircAngle->Wrap( -1 ); + gbSizer2->Add( m_unitLabelCircAngle, wxGBPosition( 3, 2 ), wxGBSpan( 1, 1 ), wxALL|wxALIGN_CENTER_VERTICAL, 5 ); + + m_labelCircCount = new wxStaticText( m_circularPanel, wxID_ANY, _("Count:"), wxDefaultPosition, wxDefaultSize, 0 ); + m_labelCircCount->Wrap( -1 ); + gbSizer2->Add( m_labelCircCount, wxGBPosition( 4, 0 ), wxGBSpan( 1, 1 ), wxALL|wxALIGN_CENTER_VERTICAL|wxALIGN_RIGHT, 5 ); + + m_entryCircCount = new wxTextCtrl( m_circularPanel, wxID_ANY, _("4"), wxDefaultPosition, wxDefaultSize, 0 ); + m_entryCircCount->SetToolTip( _("How many items in the array.") ); + + gbSizer2->Add( m_entryCircCount, wxGBPosition( 4, 1 ), wxGBSpan( 1, 1 ), wxALL, 5 ); + + m_labelCircRotate = new wxStaticText( m_circularPanel, wxID_ANY, _("Rotate:"), wxDefaultPosition, wxDefaultSize, 0 ); + m_labelCircRotate->Wrap( -1 ); + gbSizer2->Add( m_labelCircRotate, wxGBPosition( 5, 0 ), wxGBSpan( 1, 1 ), wxALL|wxALIGN_CENTER_VERTICAL|wxALIGN_RIGHT, 5 ); + + m_entryRotateItemsCb = new wxCheckBox( m_circularPanel, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0 ); + m_entryRotateItemsCb->SetValue(true); + m_entryRotateItemsCb->SetToolTip( _("Rotate the item as well as move it - multi-selections will be rotated together") ); + + gbSizer2->Add( m_entryRotateItemsCb, wxGBPosition( 5, 1 ), wxGBSpan( 1, 1 ), wxALL, 5 ); + + + bSizer4->Add( gbSizer2, 1, wxEXPAND, 5 ); + + wxBoxSizer* bSizer6; + bSizer6 = new wxBoxSizer( wxVERTICAL ); + + m_checkBoxCircRestartNumbering = new wxCheckBox( m_circularPanel, wxID_ANY, _("Restart numbering"), wxDefaultPosition, wxDefaultSize, 0 ); + m_checkBoxCircRestartNumbering->SetValue(true); + bSizer6->Add( m_checkBoxCircRestartNumbering, 0, wxALL, 5 ); + + m_labelCircNumbering = new wxStaticText( m_circularPanel, wxID_ANY, _("Numbering type:"), wxDefaultPosition, wxDefaultSize, 0 ); + m_labelCircNumbering->Wrap( -1 ); + bSizer6->Add( m_labelCircNumbering, 0, wxALL, 5 ); + + wxArrayString m_choiceCircNumberingTypeChoices; + m_choiceCircNumberingType = new wxChoice( m_circularPanel, wxID_ANY, wxDefaultPosition, wxDefaultSize, m_choiceCircNumberingTypeChoices, 0 ); + m_choiceCircNumberingType->SetSelection( 0 ); + bSizer6->Add( m_choiceCircNumberingType, 0, wxALL|wxEXPAND, 5 ); + + wxBoxSizer* bSizer7; + bSizer7 = new wxBoxSizer( wxHORIZONTAL ); + + m_labelCircNumStart = new wxStaticText( m_circularPanel, wxID_ANY, _("Numbering start:"), wxDefaultPosition, wxDefaultSize, 0 ); + m_labelCircNumStart->Wrap( -1 ); + bSizer7->Add( m_labelCircNumStart, 0, wxALIGN_CENTER_VERTICAL|wxALIGN_RIGHT|wxALL, 5 ); + + m_entryCircNumberingStart = new wxTextCtrl( m_circularPanel, wxID_ANY, _("1"), wxDefaultPosition, wxDefaultSize, 0 ); + bSizer7->Add( m_entryCircNumberingStart, 0, wxALL, 5 ); + + + bSizer6->Add( bSizer7, 0, wxEXPAND, 5 ); + + + bSizer4->Add( bSizer6, 1, wxEXPAND, 5 ); + + + m_circularPanel->SetSizer( bSizer4 ); + m_circularPanel->Layout(); + bSizer4->Fit( m_circularPanel ); + m_gridTypeNotebook->AddPage( m_circularPanel, _("Circular"), false ); + + bMainSizer->Add( m_gridTypeNotebook, 1, wxEXPAND | wxALL, 5 ); + + m_stdButtons = new wxStdDialogButtonSizer(); + m_stdButtonsOK = new wxButton( this, wxID_OK ); + m_stdButtons->AddButton( m_stdButtonsOK ); + m_stdButtonsCancel = new wxButton( this, wxID_CANCEL ); + m_stdButtons->AddButton( m_stdButtonsCancel ); + m_stdButtons->Realize(); + + bMainSizer->Add( m_stdButtons, 0, wxALL|wxEXPAND, 5 ); + + + this->SetSizer( bMainSizer ); + this->Layout(); + + // Connect Events + this->Connect( wxEVT_CLOSE_WINDOW, wxCloseEventHandler( DIALOG_CREATE_ARRAY_BASE::OnClose ) ); + m_entryNx->Connect( wxEVT_COMMAND_TEXT_ENTER, wxCommandEventHandler( DIALOG_CREATE_ARRAY_BASE::OnParameterChanged ), NULL, this ); + m_entryNy->Connect( wxEVT_COMMAND_TEXT_ENTER, wxCommandEventHandler( DIALOG_CREATE_ARRAY_BASE::OnParameterChanged ), NULL, this ); + m_entryDx->Connect( wxEVT_COMMAND_TEXT_ENTER, wxCommandEventHandler( DIALOG_CREATE_ARRAY_BASE::OnParameterChanged ), NULL, this ); + m_entryDy->Connect( wxEVT_COMMAND_TEXT_ENTER, wxCommandEventHandler( DIALOG_CREATE_ARRAY_BASE::OnParameterChanged ), NULL, this ); + m_entryOffsetX->Connect( wxEVT_COMMAND_TEXT_ENTER, wxCommandEventHandler( DIALOG_CREATE_ARRAY_BASE::OnParameterChanged ), NULL, this ); + m_entryOffsetY->Connect( wxEVT_COMMAND_TEXT_ENTER, wxCommandEventHandler( DIALOG_CREATE_ARRAY_BASE::OnParameterChanged ), NULL, this ); + m_entryStagger->Connect( wxEVT_COMMAND_TEXT_ENTER, wxCommandEventHandler( DIALOG_CREATE_ARRAY_BASE::OnParameterChanged ), NULL, this ); + m_checkBoxGridRestartNumbering->Connect( wxEVT_COMMAND_CHECKBOX_CLICKED, wxCommandEventHandler( DIALOG_CREATE_ARRAY_BASE::OnParameterChanged ), NULL, this ); + m_radioBoxGridNumberingScheme->Connect( wxEVT_COMMAND_RADIOBOX_SELECTED, wxCommandEventHandler( DIALOG_CREATE_ARRAY_BASE::OnParameterChanged ), NULL, this ); + m_entryCentreX->Connect( wxEVT_COMMAND_TEXT_UPDATED, wxCommandEventHandler( DIALOG_CREATE_ARRAY_BASE::OnParameterChanged ), NULL, this ); + m_entryCentreY->Connect( wxEVT_COMMAND_TEXT_UPDATED, wxCommandEventHandler( DIALOG_CREATE_ARRAY_BASE::OnParameterChanged ), NULL, this ); + m_entryCircAngle->Connect( wxEVT_COMMAND_TEXT_ENTER, wxCommandEventHandler( DIALOG_CREATE_ARRAY_BASE::OnParameterChanged ), NULL, this ); + m_entryCircCount->Connect( wxEVT_COMMAND_TEXT_ENTER, wxCommandEventHandler( DIALOG_CREATE_ARRAY_BASE::OnParameterChanged ), NULL, this ); + m_stdButtonsCancel->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_CREATE_ARRAY_BASE::OnCancelClick ), NULL, this ); + m_stdButtonsOK->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_CREATE_ARRAY_BASE::OnOkClick ), NULL, this ); +} + +DIALOG_CREATE_ARRAY_BASE::~DIALOG_CREATE_ARRAY_BASE() +{ + // Disconnect Events + this->Disconnect( wxEVT_CLOSE_WINDOW, wxCloseEventHandler( DIALOG_CREATE_ARRAY_BASE::OnClose ) ); + m_entryNx->Disconnect( wxEVT_COMMAND_TEXT_ENTER, wxCommandEventHandler( DIALOG_CREATE_ARRAY_BASE::OnParameterChanged ), NULL, this ); + m_entryNy->Disconnect( wxEVT_COMMAND_TEXT_ENTER, wxCommandEventHandler( DIALOG_CREATE_ARRAY_BASE::OnParameterChanged ), NULL, this ); + m_entryDx->Disconnect( wxEVT_COMMAND_TEXT_ENTER, wxCommandEventHandler( DIALOG_CREATE_ARRAY_BASE::OnParameterChanged ), NULL, this ); + m_entryDy->Disconnect( wxEVT_COMMAND_TEXT_ENTER, wxCommandEventHandler( DIALOG_CREATE_ARRAY_BASE::OnParameterChanged ), NULL, this ); + m_entryOffsetX->Disconnect( wxEVT_COMMAND_TEXT_ENTER, wxCommandEventHandler( DIALOG_CREATE_ARRAY_BASE::OnParameterChanged ), NULL, this ); + m_entryOffsetY->Disconnect( wxEVT_COMMAND_TEXT_ENTER, wxCommandEventHandler( DIALOG_CREATE_ARRAY_BASE::OnParameterChanged ), NULL, this ); + m_entryStagger->Disconnect( wxEVT_COMMAND_TEXT_ENTER, wxCommandEventHandler( DIALOG_CREATE_ARRAY_BASE::OnParameterChanged ), NULL, this ); + m_checkBoxGridRestartNumbering->Disconnect( wxEVT_COMMAND_CHECKBOX_CLICKED, wxCommandEventHandler( DIALOG_CREATE_ARRAY_BASE::OnParameterChanged ), NULL, this ); + m_radioBoxGridNumberingScheme->Disconnect( wxEVT_COMMAND_RADIOBOX_SELECTED, wxCommandEventHandler( DIALOG_CREATE_ARRAY_BASE::OnParameterChanged ), NULL, this ); + m_entryCentreX->Disconnect( wxEVT_COMMAND_TEXT_UPDATED, wxCommandEventHandler( DIALOG_CREATE_ARRAY_BASE::OnParameterChanged ), NULL, this ); + m_entryCentreY->Disconnect( wxEVT_COMMAND_TEXT_UPDATED, wxCommandEventHandler( DIALOG_CREATE_ARRAY_BASE::OnParameterChanged ), NULL, this ); + m_entryCircAngle->Disconnect( wxEVT_COMMAND_TEXT_ENTER, wxCommandEventHandler( DIALOG_CREATE_ARRAY_BASE::OnParameterChanged ), NULL, this ); + m_entryCircCount->Disconnect( wxEVT_COMMAND_TEXT_ENTER, wxCommandEventHandler( DIALOG_CREATE_ARRAY_BASE::OnParameterChanged ), NULL, this ); + m_stdButtonsCancel->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_CREATE_ARRAY_BASE::OnCancelClick ), NULL, this ); + m_stdButtonsOK->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_CREATE_ARRAY_BASE::OnOkClick ), NULL, this ); + +} diff --git a/pcbnew/dialogs/dialog_create_array_base.fbp b/pcbnew/dialogs/dialog_create_array_base.fbp new file mode 100644 index 0000000000..09c058ec23 --- /dev/null +++ b/pcbnew/dialogs/dialog_create_array_base.fbp @@ -0,0 +1,4965 @@ + + + + + + C++ + 1 + source_name + 0 + 0 + res + UTF-8 + connect + dialog_create_array_base + 1000 + none + 1 + DIALOG_CREATE_ARRAY_BASE + + . + + 1 + 1 + 1 + 1 + UI + 0 + 0 + + 0 + wxAUI_MGR_DEFAULT + + + + 1 + 1 + impl_virtual + + + + 0 + wxID_DIALOG_CREATE_ARRAY + + -1,-1 + DIALOG_CREATE_ARRAY_BASE + + 576,528 + wxDEFAULT_DIALOG_STYLE|wxRESIZE_BORDER + DIALOG_SHIM; dialog_shim.h + Create array + + + + + + + + + + + + + + OnClose + + + + + + + + + + + + + + + + + + + + + + + + + + + + + bMainSizer + wxVERTICAL + none + + 5 + wxEXPAND | wxALL + 1 + + 1 + 1 + 1 + 1 + + + + + + + + + 1 + 0 + 1 + + 1 + 0 + Dock + 0 + Left + 1 + + 1 + + 0 + 0 + wxID_ANY + + 0 + + + 0 + + 1 + m_gridTypeNotebook + 1 + + + protected + 1 + + Resizable + 1 + + + + 0 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Load From File; + Grid + 1 + + 1 + 1 + 1 + 1 + + + + + + + + 1 + 0 + 1 + + 1 + 0 + Dock + 0 + Left + 1 + + 1 + + 0 + 0 + wxID_ANY + + 0 + + + 0 + + 1 + m_gridPanel + 1 + + + protected + 1 + + Resizable + 1 + + + 0 + + + + wxTAB_TRAVERSAL + + + + + + + + + + + + + + + + + + + + + + + + + + bSizer2 + wxHORIZONTAL + none + + 5 + wxEXPAND + 1 + + + wxBOTH + + + 0 + + gbSizer1 + wxFLEX_GROWMODE_SPECIFIED + none + 0 + + 5 + 1 + 0 + wxALIGN_RIGHT|wxALL|wxALIGN_CENTER_VERTICAL + 0 + 1 + + 1 + 1 + 1 + 1 + + + + + + + + 1 + 0 + 1 + + 1 + 0 + Dock + 0 + Left + 1 + + 1 + + 0 + 0 + wxID_ANY + x Count: + + 0 + + + 0 + + 1 + m_labelNx + 1 + + + protected + 1 + + Resizable + 1 + + + + 0 + + + + + -1 + + + + + + + + + + + + + + + + + + + + + + + + + + + 5 + 1 + 1 + wxALL + 0 + 1 + + 1 + 1 + 1 + 1 + + + + + + + + 1 + 0 + 1 + + 1 + 0 + Dock + 0 + Left + 1 + + 1 + + 0 + 0 + wxID_ANY + + 0 + + + + 0 + + 1 + m_entryNx + 1 + + + protected + 1 + + Resizable + 1 + + + + 0 + + + wxFILTER_NONE + wxDefaultValidator + + 5 + + + + + + + + + + + + + + + + + + + + + + + + + + + OnParameterChanged + + + + + + + 5 + 1 + 0 + wxALIGN_RIGHT|wxALL|wxALIGN_CENTER_VERTICAL + 1 + 1 + + 1 + 1 + 1 + 1 + + + + + + + + 1 + 0 + 1 + + 1 + 0 + Dock + 0 + Left + 1 + + 1 + + 0 + 0 + wxID_ANY + y Count: + + 0 + + + 0 + + 1 + m_labelNy + 1 + + + protected + 1 + + Resizable + 1 + + + + 0 + + + + + -1 + + + + + + + + + + + + + + + + + + + + + + + + + + + 5 + 1 + 1 + wxALL + 1 + 1 + + 1 + 1 + 1 + 1 + + + + + + + + 1 + 0 + 1 + + 1 + 0 + Dock + 0 + Left + 1 + + 1 + + 0 + 0 + wxID_ANY + + 0 + + + + 0 + + 1 + m_entryNy + 1 + + + protected + 1 + + Resizable + 1 + + + + 0 + + + wxFILTER_NONE + wxDefaultValidator + + 5 + + + + + + + + + + + + + + + + + + + + + + + + + + + OnParameterChanged + + + + + + + 5 + 1 + 0 + wxALL|wxALIGN_RIGHT|wxALIGN_CENTER_VERTICAL + 2 + 1 + + 1 + 1 + 1 + 1 + + + + + + + + 1 + 0 + 1 + + 1 + 0 + Dock + 0 + Left + 1 + + 1 + + 0 + 0 + wxID_ANY + x Spacing: + + 0 + + + 0 + + 1 + m_labelDx + 1 + + + protected + 1 + + Resizable + 1 + + + + 0 + + + + + -1 + + + + + + + + + + + + + + + + + + + + + + + + + + + 5 + 1 + 1 + wxALL + 2 + 1 + + 1 + 1 + 1 + 1 + + + + + + + + 1 + 0 + 1 + + 1 + 0 + Dock + 0 + Left + 1 + + 1 + + 0 + 0 + wxID_ANY + + 0 + + + + 0 + + 1 + m_entryDx + 1 + + + protected + 1 + + Resizable + 1 + + + + 0 + + + wxFILTER_NONE + wxDefaultValidator + + 5 + + + + + + + + + + + + + + + + + + + + + + + + + + + OnParameterChanged + + + + + + + 5 + 1 + 2 + wxALL|wxALIGN_CENTER_VERTICAL + 2 + 1 + + 1 + 1 + 1 + 1 + + + + + + + + 1 + 0 + 1 + + 1 + 0 + Dock + 0 + Left + 1 + + 1 + + 0 + 0 + wxID_ANY + mm + + 0 + + + 0 + + 1 + m_unitLabelDx + 1 + + + protected + 1 + + Resizable + 1 + + + + 0 + + + + + -1 + + + + + + + + + + + + + + + + + + + + + + + + + + + 5 + 1 + 0 + wxALL|wxALIGN_RIGHT|wxALIGN_CENTER_VERTICAL + 3 + 1 + + 1 + 1 + 1 + 1 + + + + + + + + 1 + 0 + 1 + + 1 + 0 + Dock + 0 + Left + 1 + + 1 + + 0 + 0 + wxID_ANY + y Spacing: + + 0 + + + 0 + + 1 + m_labelDy + 1 + + + protected + 1 + + Resizable + 1 + + + + 0 + + + + + -1 + + + + + + + + + + + + + + + + + + + + + + + + + + + 5 + 1 + 1 + wxALL + 3 + 1 + + 1 + 1 + 1 + 1 + + + + + + + + 1 + 0 + 1 + + 1 + 0 + Dock + 0 + Left + 1 + + 1 + + 0 + 0 + wxID_ANY + + 0 + + + + 0 + + 1 + m_entryDy + 1 + + + protected + 1 + + Resizable + 1 + + + + 0 + + + wxFILTER_NONE + wxDefaultValidator + + 5 + + + + + + + + + + + + + + + + + + + + + + + + + + + OnParameterChanged + + + + + + + 5 + 1 + 2 + wxALL|wxALIGN_CENTER_VERTICAL + 3 + 1 + + 1 + 1 + 1 + 1 + + + + + + + + 1 + 0 + 1 + + 1 + 0 + Dock + 0 + Left + 1 + + 1 + + 0 + 0 + wxID_ANY + mm + + 0 + + + 0 + + 1 + m_unitLabelDy + 1 + + + protected + 1 + + Resizable + 1 + + + + 0 + + + + + -1 + + + + + + + + + + + + + + + + + + + + + + + + + + + 5 + 1 + 0 + wxALL|wxALIGN_RIGHT|wxALIGN_CENTER_VERTICAL + 4 + 1 + + 1 + 1 + 1 + 1 + + + + + + + + 1 + 0 + 1 + + 1 + 0 + Dock + 0 + Left + 1 + + 1 + + 0 + 0 + wxID_ANY + x Offset: + + 0 + + + 0 + + 1 + m_labelOffsetX + 1 + + + protected + 1 + + Resizable + 1 + + + + 0 + + + + + -1 + + + + + + + + + + + + + + + + + + + + + + + + + + + 5 + 1 + 1 + wxALL + 4 + 1 + + 1 + 1 + 1 + 1 + + + + + + + + 1 + 0 + 1 + + 1 + 0 + Dock + 0 + Left + 1 + + 1 + + 0 + 0 + wxID_ANY + + 0 + + + + 0 + + 1 + m_entryOffsetX + 1 + + + protected + 1 + + Resizable + 1 + + + + 0 + + + wxFILTER_NONE + wxDefaultValidator + + 0 + + + + + + + + + + + + + + + + + + + + + + + + + + + OnParameterChanged + + + + + + + 5 + 1 + 2 + wxALL|wxALIGN_CENTER_VERTICAL + 4 + 1 + + 1 + 1 + 1 + 1 + + + + + + + + 1 + 0 + 1 + + 1 + 0 + Dock + 0 + Left + 1 + + 1 + + 0 + 0 + wxID_ANY + mm + + 0 + + + 0 + + 1 + m_unitLabelOffsetX + 1 + + + protected + 1 + + Resizable + 1 + + + + 0 + + + + + -1 + + + + + + + + + + + + + + + + + + + + + + + + + + + 5 + 1 + 0 + wxALL|wxALIGN_RIGHT|wxALIGN_CENTER_VERTICAL + 5 + 1 + + 1 + 1 + 1 + 1 + + + + + + + + 1 + 0 + 1 + + 1 + 0 + Dock + 0 + Left + 1 + + 1 + + 0 + 0 + wxID_ANY + y Offset: + + 0 + + + 0 + + 1 + m_labelOffsetY + 1 + + + protected + 1 + + Resizable + 1 + + + + 0 + + + + + -1 + + + + + + + + + + + + + + + + + + + + + + + + + + + 5 + 1 + 1 + wxALL + 5 + 1 + + 1 + 1 + 1 + 1 + + + + + + + + 1 + 0 + 1 + + 1 + 0 + Dock + 0 + Left + 1 + + 1 + + 0 + 0 + wxID_ANY + + 0 + + + + 0 + + 1 + m_entryOffsetY + 1 + + + protected + 1 + + Resizable + 1 + + + + 0 + + + wxFILTER_NONE + wxDefaultValidator + + 0 + + + + + + + + + + + + + + + + + + + + + + + + + + + OnParameterChanged + + + + + + + 5 + 1 + 2 + wxALL|wxALIGN_CENTER_VERTICAL + 5 + 1 + + 1 + 1 + 1 + 1 + + + + + + + + 1 + 0 + 1 + + 1 + 0 + Dock + 0 + Left + 1 + + 1 + + 0 + 0 + wxID_ANY + mm + + 0 + + + 0 + + 1 + m_unitLabelOffsetY + 1 + + + protected + 1 + + Resizable + 1 + + + + 0 + + + + + -1 + + + + + + + + + + + + + + + + + + + + + + + + + + + 5 + 1 + 0 + wxALL|wxALIGN_RIGHT|wxALIGN_CENTER_VERTICAL + 6 + 1 + + 1 + 1 + 1 + 1 + + + + + + + + 1 + 0 + 1 + + 1 + 0 + Dock + 0 + Left + 1 + + 1 + + 0 + 0 + wxID_ANY + Stagger: + + 0 + + + 0 + + 1 + m_labelStagger + 1 + + + protected + 1 + + Resizable + 1 + + + + 0 + + + + + -1 + + + + + + + + + + + + + + + + + + + + + + + + + + + 5 + 1 + 1 + wxALL + 6 + 1 + + 1 + 1 + 1 + 1 + + + + + + + + 1 + 0 + 1 + + 1 + 0 + Dock + 0 + Left + 1 + + 1 + + 0 + 0 + wxID_ANY + + 0 + + + + 0 + + 1 + m_entryStagger + 1 + + + protected + 1 + + Resizable + 1 + + + + 0 + + + wxFILTER_NONE + wxDefaultValidator + + 1 + + + + + + + + + + + + + + + + + + + + + + + + + + + OnParameterChanged + + + + + + + 5 + 2 + 1 + wxALL|wxEXPAND + 7 + 1 + + 1 + 1 + 1 + 1 + + + + + + + + 1 + 0 + "Rows" "Columns" + 1 + + 1 + 0 + Dock + 0 + Left + 1 + + 1 + + 0 + 0 + wxID_ANY + + 1 + + 0 + + + 0 + + 1 + m_radioBoxGridStaggerType + 1 + + + protected + 1 + + Resizable + 0 + 1 + + wxRA_SPECIFY_COLS + + 0 + + + wxFILTER_NONE + wxDefaultValidator + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 5 + 1 + 0 + wxALL + 7 + 1 + + 1 + 1 + 1 + 1 + + + + + + + + 1 + 0 + 1 + + 1 + 0 + Dock + 0 + Left + 1 + + 1 + + 0 + 0 + wxID_ANY + Stagger type: + + 0 + + + 0 + + 1 + m_labelGridStaggerType + 1 + + + protected + 1 + + Resizable + 1 + + + + 0 + + + + + -1 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 5 + wxEXPAND + 1 + + + bSizer3 + wxVERTICAL + none + + 5 + wxALL|wxEXPAND + 0 + + 1 + 1 + 1 + 1 + + + + + + + + 1 + 0 + "Horizontal, then vertical" "Vertical, then horizontal" + 1 + + 1 + 0 + Dock + 0 + Left + 1 + + 1 + + 0 + 0 + wxID_ANY + Numbering direction: + 1 + + 0 + + + 0 + + 1 + m_radioBoxGridNumberingAxis + 1 + + + protected + 1 + + Resizable + 0 + 1 + + wxRA_SPECIFY_COLS + + 0 + + + wxFILTER_NONE + wxDefaultValidator + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 5 + wxALL + 0 + + 1 + 1 + 1 + 1 + + + + + + + + 1 + 0 + 0 + 1 + + 1 + 0 + Dock + 0 + Left + 1 + + 1 + + 0 + 0 + wxID_ANY + Reverse numbering on alternate rows/columns + + 0 + + + 0 + + 1 + m_checkBoxGridReverseNumbering + 1 + + + protected + 1 + + Resizable + 1 + + + + 0 + + + wxFILTER_NONE + wxDefaultValidator + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 5 + wxALL + 0 + + 1 + 1 + 1 + 1 + + + + + + + + 1 + 0 + 1 + 1 + + 1 + 0 + Dock + 0 + Left + 1 + + 1 + + 0 + 0 + wxID_ANY + Restart numbering + + 0 + + + 0 + + 1 + m_checkBoxGridRestartNumbering + 1 + + + protected + 1 + + Resizable + 1 + + + + 0 + + + wxFILTER_NONE + wxDefaultValidator + + + + + + OnParameterChanged + + + + + + + + + + + + + + + + + + + + + + + + + + 5 + wxALL|wxEXPAND + 0 + + 1 + 1 + 1 + 1 + + + + + + + + 1 + 0 + "Continuous (1, 2, 3...)" "Co-ordinate (A1, A2, ... B1, ...)" + 1 + + 1 + 0 + Dock + 0 + Left + 1 + + 1 + + 0 + 0 + wxID_ANY + Numbering scheme: + 1 + + 0 + + + 0 + + 1 + m_radioBoxGridNumberingScheme + 1 + + + protected + 1 + + Resizable + 0 + 1 + + wxRA_SPECIFY_COLS + + 0 + + + wxFILTER_NONE + wxDefaultValidator + + + + + + + + + + + + + + + + + + + + + + OnParameterChanged + + + + + + + + + + 5 + wxALL + 0 + + 1 + 1 + 1 + 1 + + + + + + + + 1 + 0 + 1 + + 1 + 0 + Dock + 0 + Left + 1 + + 1 + + 0 + 0 + wxID_ANY + Primary axis numbering: + + 0 + + + 0 + + 1 + m_labelPriAxisNumbering + 1 + + + protected + 1 + + Resizable + 1 + + + + 0 + + + + + -1 + + + + + + + + + + + + + + + + + + + + + + + + + + + 5 + wxALL|wxEXPAND + 0 + + 1 + 1 + 1 + 1 + + + + + + + + 1 + 0 + + 1 + + 1 + 0 + Dock + 0 + Left + 1 + + 1 + + 0 + 0 + wxID_ANY + + 0 + + + 0 + + 1 + m_choicePriAxisNumbering + 1 + + + protected + 1 + + Resizable + 0 + 1 + + + + 0 + + + wxFILTER_NONE + wxDefaultValidator + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 5 + wxALL + 0 + + 1 + 1 + 1 + 1 + + + + + + + + 1 + 0 + 1 + + 1 + 0 + Dock + 0 + Left + 0 + + 1 + + 0 + 0 + wxID_ANY + Secondary axis numbering: + + 0 + + + 0 + + 1 + m_labelSecAxisNumbering + 1 + + + protected + 1 + + Resizable + 1 + + + + 0 + + + + + -1 + + + + + + + + + + + + + + + + + + + + + + + + + + + 5 + wxALL|wxEXPAND + 0 + + 1 + 1 + 1 + 1 + + + + + + + + 1 + 0 + + 1 + + 1 + 0 + Dock + 0 + Left + 0 + + 1 + + 0 + 0 + wxID_ANY + + 0 + + + 0 + + 1 + m_choiceSecAxisNumbering + 1 + + + protected + 1 + + Resizable + 0 + 1 + + + + 0 + + + wxFILTER_NONE + wxDefaultValidator + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 5 + wxEXPAND + 0 + + + bSizer5 + wxHORIZONTAL + none + + 5 + wxALIGN_CENTER_VERTICAL|wxALL + 0 + + 1 + 1 + 1 + 1 + + + + + + + + 1 + 0 + 1 + + 1 + 0 + Dock + 0 + Left + 1 + + 1 + + 0 + 0 + wxID_ANY + Numbering start: + + 0 + + + 0 + + 1 + m_labelGridNumberingOffset + 1 + + + protected + 1 + + Resizable + 1 + + + + 0 + + + + + -1 + + + + + + + + + + + + + + + + + + + + + + + + + + + 5 + wxALL + 0 + + 1 + 1 + 1 + 1 + + + + + + + + 1 + 0 + 1 + + 1 + 0 + Dock + 0 + Left + 1 + + 1 + + 0 + 0 + wxID_ANY + + 0 + + + + 0 + + 1 + m_entryGridPriNumberingOffset + 1 + + + protected + 1 + + Resizable + 1 + + + + 0 + + + wxFILTER_NONE + wxDefaultValidator + + 1 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 5 + wxALL + 0 + + 1 + 1 + 1 + 1 + + + + + + + + 1 + 0 + 1 + + 1 + 0 + Dock + 0 + Left + 1 + + 1 + + 0 + 0 + wxID_ANY + + 0 + + + + 0 + + 1 + m_entryGridSecNumberingOffset + 1 + + + protected + 1 + + Resizable + 1 + + + + 0 + + + wxFILTER_NONE + wxDefaultValidator + + 1 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Circular + 0 + + 1 + 1 + 1 + 1 + + + + + + + + 1 + 0 + 1 + + 1 + 0 + Dock + 0 + Left + 1 + + 1 + + 0 + 0 + wxID_ANY + + 0 + + + 0 + + 1 + m_circularPanel + 1 + + + protected + 1 + + Resizable + 1 + + + 0 + + + + wxTAB_TRAVERSAL + + + + + + + + + + + + + + + + + + + + + + + + + + bSizer4 + wxHORIZONTAL + none + + 5 + wxEXPAND + 1 + + + wxBOTH + + + 0 + + gbSizer2 + wxFLEX_GROWMODE_SPECIFIED + none + 0 + + 5 + 1 + 0 + wxALL|wxALIGN_CENTER_VERTICAL|wxALIGN_RIGHT + 0 + 1 + + 1 + 1 + 1 + 1 + + + + + + + + 1 + 0 + 1 + + 1 + 0 + Dock + 0 + Left + 1 + + 1 + + 0 + 0 + wxID_ANY + x Centre: + + 0 + + + 0 + + 1 + m_labelCentreX + 1 + + + protected + 1 + + Resizable + 1 + + + + 0 + + + + + -1 + + + + + + + + + + + + + + + + + + + + + + + + + + + 5 + 1 + 1 + wxALL + 0 + 1 + + 1 + 1 + 1 + 1 + + + + + + + + 1 + 0 + 1 + + 1 + 0 + Dock + 0 + Left + 1 + + 1 + + 0 + 0 + wxID_ANY + + 0 + + + + 0 + + 1 + m_entryCentreX + 1 + + + protected + 1 + + Resizable + 1 + + + + 0 + + + wxFILTER_NONE + wxDefaultValidator + + 0 + + + + + + + + + + + + + + + + + + + + + + + + + + OnParameterChanged + + + + + + + + 5 + 1 + 2 + wxALL|wxALIGN_CENTER_VERTICAL + 0 + 1 + + 1 + 1 + 1 + 1 + + + + + + + + 1 + 0 + 1 + + 1 + 0 + Dock + 0 + Left + 1 + + 1 + + 0 + 0 + wxID_ANY + mm + + 0 + + + 0 + + 1 + m_unitLabelCentreX + 1 + + + protected + 1 + + Resizable + 1 + + + + 0 + + + + + -1 + + + + + + + + + + + + + + + + + + + + + + + + + + + 5 + 1 + 0 + wxALL|wxALIGN_CENTER_VERTICAL|wxALIGN_RIGHT + 1 + 1 + + 1 + 1 + 1 + 1 + + + + + + + + 1 + 0 + 1 + + 1 + 0 + Dock + 0 + Left + 1 + + 1 + + 0 + 0 + wxID_ANY + y Centre: + + 0 + + + 0 + + 1 + m_labelCentreY + 1 + + + protected + 1 + + Resizable + 1 + + + + 0 + + + + + -1 + + + + + + + + + + + + + + + + + + + + + + + + + + + 5 + 1 + 1 + wxALL + 1 + 1 + + 1 + 1 + 1 + 1 + + + + + + + + 1 + 0 + 1 + + 1 + 0 + Dock + 0 + Left + 1 + + 1 + + 0 + 0 + wxID_ANY + + 0 + + + + 0 + + 1 + m_entryCentreY + 1 + + + protected + 1 + + Resizable + 1 + + + + 0 + + + wxFILTER_NONE + wxDefaultValidator + + 0 + + + + + + + + + + + + + + + + + + + + + + + + + + OnParameterChanged + + + + + + + + 5 + 1 + 2 + wxALL|wxALIGN_CENTER_VERTICAL + 1 + 1 + + 1 + 1 + 1 + 1 + + + + + + + + 1 + 0 + 1 + + 1 + 0 + Dock + 0 + Left + 1 + + 1 + + 0 + 0 + wxID_ANY + mm + + 0 + + + 0 + + 1 + m_unitLabelCentreY + 1 + + + protected + 1 + + Resizable + 1 + + + + 0 + + + + + -1 + + + + + + + + + + + + + + + + + + + + + + + + + + + 5 + 1 + 0 + wxALIGN_CENTER_VERTICAL|wxALIGN_RIGHT|wxALL + 2 + 1 + + 1 + 1 + 1 + 1 + + + + + + + + 1 + 0 + 1 + + 1 + 0 + Dock + 0 + Left + 1 + + 1 + + 0 + 0 + wxID_ANY + Radius: + + 0 + + + 0 + + 1 + m_labelCircRadius + 1 + + + protected + 1 + + Resizable + 1 + + + + 0 + + + + + -1 + + + + + + + + + + + + + + + + + + + + + + + + + + + 5 + 1 + 1 + wxALL + 2 + 1 + + 1 + 1 + 1 + 1 + + + + + + + + 1 + 0 + 1 + + 1 + 0 + Dock + 0 + Left + 1 + + 1 + + 0 + 0 + wxID_ANY + 0 mm + + 0 + + + 0 + + 1 + m_labelCircRadiusValue + 1 + + + protected + 1 + + Resizable + 1 + + + + 0 + + + + + -1 + + + + + + + + + + + + + + + + + + + + + + + + + + + 5 + 1 + 0 + wxALL|wxALIGN_CENTER_VERTICAL|wxALIGN_RIGHT + 3 + 1 + + 1 + 1 + 1 + 1 + + + + + + + + 1 + 0 + 1 + + 1 + 0 + Dock + 0 + Left + 1 + + 1 + + 0 + 0 + wxID_ANY + Angle: + + 0 + + + 0 + + 1 + m_labelCircAngle + 1 + + + protected + 1 + + Resizable + 1 + + + + 0 + + + + + -1 + + + + + + + + + + + + + + + + + + + + + + + + + + + 5 + 1 + 1 + wxALL + 3 + 1 + + 1 + 1 + 1 + 1 + + + + + + + + 1 + 0 + 1 + + 1 + 0 + Dock + 0 + Left + 1 + + 1 + + 0 + 0 + wxID_ANY + + 0 + + + + 0 + + 1 + m_entryCircAngle + 1 + + + protected + 1 + + Resizable + 1 + + + + 0 + Positive angles represent an anti-clockwise rotation. An angle of 0 will produce a full circle divided evenly into "Count" portions. + + wxFILTER_NONE + wxDefaultValidator + + 0 + + + + + + + + + + + + + + + + + + + + + + + + + + + OnParameterChanged + + + + + + + 5 + 1 + 2 + wxALL|wxALIGN_CENTER_VERTICAL + 3 + 1 + + 1 + 1 + 1 + 1 + + + + + + + + 1 + 0 + 1 + + 1 + 0 + Dock + 0 + Left + 1 + + 1 + + 0 + 0 + wxID_ANY + deg + + 0 + + + 0 + + 1 + m_unitLabelCircAngle + 1 + + + protected + 1 + + Resizable + 1 + + + + 0 + + + + + -1 + + + + + + + + + + + + + + + + + + + + + + + + + + + 5 + 1 + 0 + wxALL|wxALIGN_CENTER_VERTICAL|wxALIGN_RIGHT + 4 + 1 + + 1 + 1 + 1 + 1 + + + + + + + + 1 + 0 + 1 + + 1 + 0 + Dock + 0 + Left + 1 + + 1 + + 0 + 0 + wxID_ANY + Count: + + 0 + + + 0 + + 1 + m_labelCircCount + 1 + + + protected + 1 + + Resizable + 1 + + + + 0 + + + + + -1 + + + + + + + + + + + + + + + + + + + + + + + + + + + 5 + 1 + 1 + wxALL + 4 + 1 + + 1 + 1 + 1 + 1 + + + + + + + + 1 + 0 + 1 + + 1 + 0 + Dock + 0 + Left + 1 + + 1 + + 0 + 0 + wxID_ANY + + 0 + + + + 0 + + 1 + m_entryCircCount + 1 + + + protected + 1 + + Resizable + 1 + + + + 0 + How many items in the array. + + wxFILTER_NONE + wxDefaultValidator + + 4 + + + + + + + + + + + + + + + + + + + + + + + + + + + OnParameterChanged + + + + + + + 5 + 1 + 0 + wxALL|wxALIGN_CENTER_VERTICAL|wxALIGN_RIGHT + 5 + 1 + + 1 + 1 + 1 + 1 + + + + + + + + 1 + 0 + 1 + + 1 + 0 + Dock + 0 + Left + 1 + + 1 + + 0 + 0 + wxID_ANY + Rotate: + + 0 + + + 0 + + 1 + m_labelCircRotate + 1 + + + protected + 1 + + Resizable + 1 + + + + 0 + + + + + -1 + + + + + + + + + + + + + + + + + + + + + + + + + + + 5 + 1 + 1 + wxALL + 5 + 1 + + 1 + 1 + 1 + 1 + + + + + + + + 1 + 0 + 1 + 1 + + 1 + 0 + Dock + 0 + Left + 1 + + 1 + + 0 + 0 + wxID_ANY + + + 0 + + + 0 + + 1 + m_entryRotateItemsCb + 1 + + + protected + 1 + + Resizable + 1 + + + + 0 + Rotate the item as well as move it - multi-selections will be rotated together + + wxFILTER_NONE + wxDefaultValidator + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 5 + wxEXPAND + 1 + + + bSizer6 + wxVERTICAL + none + + 5 + wxALL + 0 + + 1 + 1 + 1 + 1 + + + + + + + + 1 + 0 + 1 + 1 + + 1 + 0 + Dock + 0 + Left + 1 + + 1 + + 0 + 0 + wxID_ANY + Restart numbering + + 0 + + + 0 + + 1 + m_checkBoxCircRestartNumbering + 1 + + + protected + 1 + + Resizable + 1 + + + + 0 + + + wxFILTER_NONE + wxDefaultValidator + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 5 + wxALL + 0 + + 1 + 1 + 1 + 1 + + + + + + + + 1 + 0 + 1 + + 1 + 0 + Dock + 0 + Left + 1 + + 1 + + 0 + 0 + wxID_ANY + Numbering type: + + 0 + + + 0 + + 1 + m_labelCircNumbering + 1 + + + protected + 1 + + Resizable + 1 + + + + 0 + + + + + -1 + + + + + + + + + + + + + + + + + + + + + + + + + + + 5 + wxALL|wxEXPAND + 0 + + 1 + 1 + 1 + 1 + + + + + + + + 1 + 0 + + 1 + + 1 + 0 + Dock + 0 + Left + 1 + + 1 + + 0 + 0 + wxID_ANY + + 0 + + + 0 + + 1 + m_choiceCircNumberingType + 1 + + + protected + 1 + + Resizable + 0 + 1 + + + + 0 + + + wxFILTER_NONE + wxDefaultValidator + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 5 + wxEXPAND + 0 + + + bSizer7 + wxHORIZONTAL + none + + 5 + wxALIGN_CENTER_VERTICAL|wxALIGN_RIGHT|wxALL + 0 + + 1 + 1 + 1 + 1 + + + + + + + + 1 + 0 + 1 + + 1 + 0 + Dock + 0 + Left + 1 + + 1 + + 0 + 0 + wxID_ANY + Numbering start: + + 0 + + + 0 + + 1 + m_labelCircNumStart + 1 + + + protected + 1 + + Resizable + 1 + + + + 0 + + + + + -1 + + + + + + + + + + + + + + + + + + + + + + + + + + + 5 + wxALL + 0 + + 1 + 1 + 1 + 1 + + + + + + + + 1 + 0 + 1 + + 1 + 0 + Dock + 0 + Left + 1 + + 1 + + 0 + 0 + wxID_ANY + + 0 + + + + 0 + + 1 + m_entryCircNumberingStart + 1 + + + protected + 1 + + Resizable + 1 + + + + 0 + + + wxFILTER_NONE + wxDefaultValidator + + 1 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 5 + wxALL|wxEXPAND + 0 + + 0 + 1 + 0 + 0 + 0 + 1 + 0 + 0 + + m_stdButtons + protected + + OnCancelClick + + + + OnOkClick + + + + + + + + diff --git a/pcbnew/dialogs/dialog_create_array_base.h b/pcbnew/dialogs/dialog_create_array_base.h new file mode 100644 index 0000000000..442058e86b --- /dev/null +++ b/pcbnew/dialogs/dialog_create_array_base.h @@ -0,0 +1,121 @@ +/////////////////////////////////////////////////////////////////////////// +// C++ code generated with wxFormBuilder (version Jun 6 2014) +// http://www.wxformbuilder.org/ +// +// PLEASE DO "NOT" EDIT THIS FILE! +/////////////////////////////////////////////////////////////////////////// + +#ifndef __DIALOG_CREATE_ARRAY_BASE_H__ +#define __DIALOG_CREATE_ARRAY_BASE_H__ + +#include +#include +#include +class DIALOG_SHIM; + +#include "dialog_shim.h" +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +/////////////////////////////////////////////////////////////////////////// + +#define wxID_DIALOG_CREATE_ARRAY 1000 + +/////////////////////////////////////////////////////////////////////////////// +/// Class DIALOG_CREATE_ARRAY_BASE +/////////////////////////////////////////////////////////////////////////////// +class DIALOG_CREATE_ARRAY_BASE : public DIALOG_SHIM +{ + private: + + protected: + wxNotebook* m_gridTypeNotebook; + wxPanel* m_gridPanel; + wxStaticText* m_labelNx; + wxTextCtrl* m_entryNx; + wxStaticText* m_labelNy; + wxTextCtrl* m_entryNy; + wxStaticText* m_labelDx; + wxTextCtrl* m_entryDx; + wxStaticText* m_unitLabelDx; + wxStaticText* m_labelDy; + wxTextCtrl* m_entryDy; + wxStaticText* m_unitLabelDy; + wxStaticText* m_labelOffsetX; + wxTextCtrl* m_entryOffsetX; + wxStaticText* m_unitLabelOffsetX; + wxStaticText* m_labelOffsetY; + wxTextCtrl* m_entryOffsetY; + wxStaticText* m_unitLabelOffsetY; + wxStaticText* m_labelStagger; + wxTextCtrl* m_entryStagger; + wxRadioBox* m_radioBoxGridStaggerType; + wxStaticText* m_labelGridStaggerType; + wxRadioBox* m_radioBoxGridNumberingAxis; + wxCheckBox* m_checkBoxGridReverseNumbering; + wxCheckBox* m_checkBoxGridRestartNumbering; + wxRadioBox* m_radioBoxGridNumberingScheme; + wxStaticText* m_labelPriAxisNumbering; + wxChoice* m_choicePriAxisNumbering; + wxStaticText* m_labelSecAxisNumbering; + wxChoice* m_choiceSecAxisNumbering; + wxStaticText* m_labelGridNumberingOffset; + wxTextCtrl* m_entryGridPriNumberingOffset; + wxTextCtrl* m_entryGridSecNumberingOffset; + wxPanel* m_circularPanel; + wxStaticText* m_labelCentreX; + wxTextCtrl* m_entryCentreX; + wxStaticText* m_unitLabelCentreX; + wxStaticText* m_labelCentreY; + wxTextCtrl* m_entryCentreY; + wxStaticText* m_unitLabelCentreY; + wxStaticText* m_labelCircRadius; + wxStaticText* m_labelCircRadiusValue; + wxStaticText* m_labelCircAngle; + wxTextCtrl* m_entryCircAngle; + wxStaticText* m_unitLabelCircAngle; + wxStaticText* m_labelCircCount; + wxTextCtrl* m_entryCircCount; + wxStaticText* m_labelCircRotate; + wxCheckBox* m_entryRotateItemsCb; + wxCheckBox* m_checkBoxCircRestartNumbering; + wxStaticText* m_labelCircNumbering; + wxChoice* m_choiceCircNumberingType; + wxStaticText* m_labelCircNumStart; + wxTextCtrl* m_entryCircNumberingStart; + wxStdDialogButtonSizer* m_stdButtons; + wxButton* m_stdButtonsOK; + wxButton* m_stdButtonsCancel; + + // Virtual event handlers, overide them in your derived class + virtual void OnClose( wxCloseEvent& event ) { event.Skip(); } + virtual void OnParameterChanged( wxCommandEvent& event ) { event.Skip(); } + virtual void OnCancelClick( wxCommandEvent& event ) { event.Skip(); } + virtual void OnOkClick( wxCommandEvent& event ) { event.Skip(); } + + + public: + + DIALOG_CREATE_ARRAY_BASE( wxWindow* parent, wxWindowID id = wxID_DIALOG_CREATE_ARRAY, const wxString& title = _("Create array"), const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxSize( 576,528 ), long style = wxDEFAULT_DIALOG_STYLE|wxRESIZE_BORDER ); + ~DIALOG_CREATE_ARRAY_BASE(); + +}; + +#endif //__DIALOG_CREATE_ARRAY_BASE_H__ diff --git a/pcbnew/dialogs/dialog_footprint_wizard_list.fbp b/pcbnew/dialogs/dialog_footprint_wizard_list.fbp index a90927a424..354cfde36f 100644 --- a/pcbnew/dialogs/dialog_footprint_wizard_list.fbp +++ b/pcbnew/dialogs/dialog_footprint_wizard_list.fbp @@ -1,6 +1,6 @@ - + C++ @@ -20,8 +20,10 @@ . 1 + 1 1 1 + UI 0 0 @@ -236,7 +238,88 @@ 5 - wxEXPAND + wxEXPAND | wxALL + 0 + + 1 + 1 + 1 + 1 + + + + + + + + 1 + 0 + 1 + + 1 + 0 + Dock + 0 + Left + 1 + + 1 + + 0 + 0 + wxID_ANY + + 0 + + + 0 + + 1 + m_staticline1 + 1 + + + protected + 1 + + Resizable + 1 + + wxLI_HORIZONTAL + + 0 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 5 + wxEXPAND|wxALL 0 0 diff --git a/pcbnew/dialogs/dialog_footprint_wizard_list_base.cpp b/pcbnew/dialogs/dialog_footprint_wizard_list_base.cpp index a669fab58b..2f350a936c 100644 --- a/pcbnew/dialogs/dialog_footprint_wizard_list_base.cpp +++ b/pcbnew/dialogs/dialog_footprint_wizard_list_base.cpp @@ -1,5 +1,5 @@ /////////////////////////////////////////////////////////////////////////// -// C++ code generated with wxFormBuilder (version Oct 8 2012) +// C++ code generated with wxFormBuilder (version Jun 5 2014) // http://www.wxformbuilder.org/ // // PLEASE DO "NOT" EDIT THIS FILE! @@ -51,6 +51,9 @@ DIALOG_FOOTPRINT_WIZARD_LIST_BASE::DIALOG_FOOTPRINT_WIZARD_LIST_BASE( wxWindow* bSizerMain->Add( m_footprintWizardsGrid, 1, wxALL|wxEXPAND, 5 ); + m_staticline1 = new wxStaticLine( this, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxLI_HORIZONTAL ); + bSizerMain->Add( m_staticline1, 0, wxEXPAND | wxALL, 5 ); + m_sdbSizer = new wxStdDialogButtonSizer(); m_sdbSizerOK = new wxButton( this, wxID_OK ); m_sdbSizer->AddButton( m_sdbSizerOK ); @@ -58,7 +61,7 @@ DIALOG_FOOTPRINT_WIZARD_LIST_BASE::DIALOG_FOOTPRINT_WIZARD_LIST_BASE( wxWindow* m_sdbSizer->AddButton( m_sdbSizerCancel ); m_sdbSizer->Realize(); - bSizerMain->Add( m_sdbSizer, 0, wxEXPAND, 5 ); + bSizerMain->Add( m_sdbSizer, 0, wxEXPAND|wxALL, 5 ); this->SetSizer( bSizerMain ); diff --git a/pcbnew/dialogs/dialog_footprint_wizard_list_base.h b/pcbnew/dialogs/dialog_footprint_wizard_list_base.h index ed7a8564dd..6d0c1cba4c 100644 --- a/pcbnew/dialogs/dialog_footprint_wizard_list_base.h +++ b/pcbnew/dialogs/dialog_footprint_wizard_list_base.h @@ -1,5 +1,5 @@ /////////////////////////////////////////////////////////////////////////// -// C++ code generated with wxFormBuilder (version Oct 8 2012) +// C++ code generated with wxFormBuilder (version Jun 5 2014) // http://www.wxformbuilder.org/ // // PLEASE DO "NOT" EDIT THIS FILE! @@ -20,6 +20,7 @@ class DIALOG_SHIM; #include #include #include +#include #include #include #include @@ -36,6 +37,7 @@ class DIALOG_FOOTPRINT_WIZARD_LIST_BASE : public DIALOG_SHIM protected: wxGrid* m_footprintWizardsGrid; + wxStaticLine* m_staticline1; wxStdDialogButtonSizer* m_sdbSizer; wxButton* m_sdbSizerOK; wxButton* m_sdbSizerCancel; diff --git a/pcbnew/dialogs/dialog_fp_plugin_options_base.fbp b/pcbnew/dialogs/dialog_fp_plugin_options_base.fbp index a48a01c5bf..d68086a08c 100644 --- a/pcbnew/dialogs/dialog_fp_plugin_options_base.fbp +++ b/pcbnew/dialogs/dialog_fp_plugin_options_base.fbp @@ -1,6 +1,6 @@ - + C++ @@ -44,7 +44,7 @@ DIALOG_FP_PLUGIN_OPTIONS_BASE - -1,-1 + 678,342 wxCAPTION|wxCLOSE_BOX|wxDEFAULT_DIALOG_STYLE|wxMAXIMIZE_BOX|wxRESIZE_BORDER DIALOG_SHIM; dialog_shim.h diff --git a/pcbnew/dialogs/dialog_move_exact.cpp b/pcbnew/dialogs/dialog_move_exact.cpp new file mode 100644 index 0000000000..71efbb6257 --- /dev/null +++ b/pcbnew/dialogs/dialog_move_exact.cpp @@ -0,0 +1,210 @@ +/* + * This program source code file is part of KiCad, a free EDA CAD application. + * + * Copyright (C) 2014 John Beard, john.j.beard@gmail.com + * 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 + * as published by the Free Software Foundation; either version 2 + * of the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, you may find one here: + * http://www.gnu.org/licenses/old-licenses/gpl-2.0.html + * or you may search the http://www.gnu.org website for the version 2 license, + * or you may write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA + */ + +#include +#include + +#include + +#include "dialog_move_exact.h" + +// initialise statics +DIALOG_MOVE_EXACT::MOVE_EXACT_OPTIONS DIALOG_MOVE_EXACT::m_options; + + +DIALOG_MOVE_EXACT::DIALOG_MOVE_EXACT( PCB_BASE_FRAME* aParent, + wxPoint& translation, double& rotation ): + DIALOG_MOVE_EXACT_BASE( aParent ), + m_translation( translation ), + m_rotation( rotation ) +{ + // set the unit labels + m_xUnit->SetLabelText( GetAbbreviatedUnitsLabel( g_UserUnit ) ); + m_yUnit->SetLabelText( GetAbbreviatedUnitsLabel( g_UserUnit ) ); + // rotation is always degrees + m_rotUnit->SetLabelText( _( "deg" ) ); + + // tabbing goes through the entries in sequence + m_yEntry->MoveAfterInTabOrder( m_xEntry ); + m_rotEntry->MoveAfterInTabOrder( m_yEntry ); + + // and set up the entries according to the saved options + m_polarCoords->SetValue( m_options.polarCoords ); + m_xEntry->SetValue( wxString::FromDouble( m_options.entry1 ) ); + m_yEntry->SetValue( wxString::FromDouble( m_options.entry2 ) ); + m_rotEntry->SetValue( wxString::FromDouble( m_options.entryRotation ) ); + + Fit(); +} + + +DIALOG_MOVE_EXACT::~DIALOG_MOVE_EXACT() +{ +} + + +/*! + * Convert a given Cartesian point into a polar representation. + * + * Linear units are not considered, the answer is in the same units as given + * Angle is returned in degrees + */ +void DIALOG_MOVE_EXACT::ToPolarDeg( double x, double y, double& r, double& q ) +{ + // convert to polar coordinates + r = hypot ( x, y ); + + q = ( r != 0) ? RAD2DEG( atan2( y, x ) ) : 0; +} + + +/*! + * Get the (Cartesian) translation described by the text entries + * @param val output translation vector + * @param polar interpret as polar coords + * @return false if error (though the text conversion functions don't report errors) + */ +bool DIALOG_MOVE_EXACT::GetTranslationInIU ( wxPoint& val, bool polar ) +{ + if( polar ) + { + const int r = ValueFromTextCtrl( *m_xEntry ); + const double q = DoubleValueFromString( DEGREES, m_yEntry->GetValue() ); + + val.x = r * cos( DEG2RAD( q / 10.0 ) ); + val.y = r * sin( DEG2RAD( q / 10.0 ) ); + } + else + { + // direct read + val.x = ValueFromTextCtrl( *m_xEntry ); + val.y = ValueFromTextCtrl( *m_yEntry ); + } + + // no validation to do here, but in future, you could return false here + return true; +} + + +void DIALOG_MOVE_EXACT::OnPolarChanged( wxCommandEvent& event ) +{ + bool newPolar = m_polarCoords->IsChecked(); + wxPoint val; + + // get the value as previously stored + GetTranslationInIU( val, !newPolar ); + + if( newPolar ) + { + // convert to polar coordinates + double r, q; + ToPolarDeg( val.x, val.y, r, q); + + PutValueInLocalUnits( *m_xEntry, round( r / 10.0) * 10 ); + m_xLabel->SetLabelText( wxT( "r:" ) ); + + m_yEntry->SetValue( wxString::FromDouble( q ) ); + m_yLabel->SetLabelText( wxT( "\u03b8:" ) ); // theta + + m_yUnit->SetLabelText( GetAbbreviatedUnitsLabel( DEGREES ) ); + } + else + { + // vector is already in Cartesian, so just render out + + // note - round off the last decimal place (10nm) to prevent + // (some) rounding causing errors when round-tripping + // you can never eliminate entirely, however + PutValueInLocalUnits( *m_xEntry, round( val.x / 10.0) * 10 ); + m_xLabel->SetLabelText( wxT( "x:" ) ); + + PutValueInLocalUnits( *m_yEntry, round( val.y / 10.0) * 10 ); + m_yLabel->SetLabelText( wxT( "y:" ) ); + + m_yUnit->SetLabelText( GetAbbreviatedUnitsLabel( g_UserUnit ) ); + } +} + + +void DIALOG_MOVE_EXACT::OnClear( wxCommandEvent& event ) +{ + wxObject* obj = event.GetEventObject(); + wxTextCtrl* entry = NULL; + + if( obj == m_clearX ) + { + entry = m_xEntry; + } + else if( obj == m_clearY ) + { + entry = m_yEntry; + } + else if( obj == m_clearRot ) + { + entry = m_rotEntry; + } + + if( entry ) + entry->SetValue( "0" ); +} + + +void DIALOG_MOVE_EXACT::OnCancelClick( wxCommandEvent& event ) +{ + EndModal( MOVE_ABORT ); +} + + +void DIALOG_MOVE_EXACT::OnOkClick( wxCommandEvent& event ) +{ + m_rotation = DoubleValueFromString( DEGREES, m_rotEntry->GetValue() ); + + // for the output, we only deliver a Cartesian vector + bool ok = GetTranslationInIU( m_translation, m_polarCoords->IsChecked() ); + + if ( ok ) + { + // save the settings + m_options.polarCoords = m_polarCoords->GetValue(); + m_xEntry->GetValue().ToDouble( &m_options.entry1 ); + m_yEntry->GetValue().ToDouble( &m_options.entry2 ); + m_rotEntry->GetValue().ToDouble( &m_options.entryRotation ); + + EndModal( MOVE_OK ); + } +} + + +/*! + * Reset a text field to be 0 if it was exited while blank + */ +void DIALOG_MOVE_EXACT::OnTextFocusLost( wxFocusEvent& event ) +{ + wxTextCtrl* obj = static_cast( event.GetEventObject() ); + + if( obj->GetValue().IsEmpty() ) + obj->SetValue("0"); + + event.Skip(); +} diff --git a/pcbnew/dialogs/dialog_move_exact.fbp b/pcbnew/dialogs/dialog_move_exact.fbp new file mode 100644 index 0000000000..db4223f270 --- /dev/null +++ b/pcbnew/dialogs/dialog_move_exact.fbp @@ -0,0 +1,1281 @@ + + + + + + C++ + 1 + source_name + 0 + 0 + res + UTF-8 + connect + dialog_move_exact_base + 1000 + none + 1 + DIALOG_MOVE_EXACT_BASE + + . + + 1 + 1 + 1 + 1 + UI + 0 + 0 + + 0 + wxAUI_MGR_DEFAULT + + + + 1 + 1 + impl_virtual + + + + 0 + wxID_ANY + + -1,-1 + DIALOG_MOVE_EXACT_BASE + + -1,-1 + wxDEFAULT_DIALOG_STYLE|wxRESIZE_BORDER + DIALOG_SHIM; dialog_shim.h + Move item + + + + + + + + + + + + + + OnClose + + + + + + + + + + + + + + + + + + + + + + + + + + + + + bMainSizer + wxVERTICAL + none + + 5 + wxALL|wxEXPAND + 0 + + 1 + 1 + 1 + 1 + + + + + + + + 1 + 0 + 0 + 1 + + 1 + 0 + Dock + 0 + Left + 1 + + 1 + + 0 + 0 + wxID_ANY + Polar coordinates + + 0 + + + 0 + + 1 + m_polarCoords + 1 + + + protected + 1 + + Resizable + 1 + + + + 0 + + + wxFILTER_NONE + wxDefaultValidator + + + + + + OnPolarChanged + + + + + + + + + + + + + + + + + + + + + + + + + + 5 + wxEXPAND + 1 + + 4 + wxBOTH + 1 + + 0 + + fgSizer2 + wxFLEX_GROWMODE_SPECIFIED + none + 0 + 0 + + 5 + wxALIGN_CENTER_VERTICAL|wxALIGN_RIGHT|wxALL + 0 + + 1 + 1 + 1 + 1 + + + + + + + + 1 + 0 + 1 + + 1 + 0 + Dock + 0 + Left + 1 + + 1 + + 0 + 0 + wxID_ANY + x: + + 0 + + + 0 + + 1 + m_xLabel + 1 + + + protected + 1 + + Resizable + 1 + -1,-1 + + + 0 + + + + + -1 + + + + + + + + + + + + + + + + + + + + + + + + + + + 5 + wxALL|wxEXPAND + 0 + + 1 + 1 + 1 + 1 + + + + + + + + 1 + 0 + 1 + + 1 + 0 + Dock + 0 + Left + 1 + + 1 + + 0 + 0 + wxID_ANY + + 0 + + + + 0 + + 1 + m_xEntry + 1 + + + protected + 1 + + Resizable + 1 + + + + 0 + + + wxFILTER_NONE + wxDefaultValidator + + 0 + + + + + + + + + OnTextFocusLost + + + + + + + + + + + + + + + + + + + + + + + + + 5 + wxALIGN_CENTER_VERTICAL|wxALIGN_LEFT|wxALL + 0 + + 1 + 1 + 1 + 1 + + + + + + + + 1 + 0 + 1 + + 1 + 0 + Dock + 0 + Left + 1 + + 1 + + 0 + 0 + wxID_ANY + mm + + 0 + + + 0 + + 1 + m_xUnit + 1 + + + protected + 1 + + Resizable + 1 + + + + 0 + + + + + -1 + + + + + + + + + + + + + + + + + + + + + + + + + + + 5 + wxALL + 0 + + 1 + 1 + 1 + 1 + + + + + + + Load From Art Provider; wxART_DELETE; wxART_BUTTON + + 1 + 0 + 1 + + 1 + 0 + 0 + + Dock + 0 + Left + 1 + + 1 + + + 0 + 0 + + wxID_CLEAR + Clear + + 0 + + + 0 + + 1 + m_clearX + 1 + + + protected + 1 + + Resizable + + 1 + + wxBU_AUTODRAW + + 0 + + + wxFILTER_NONE + wxDefaultValidator + + + + + OnClear + + + + + + + + + + + + + + + + + + + + + + + + + + + 5 + wxALIGN_CENTER_VERTICAL|wxALIGN_RIGHT|wxALL + 0 + + 1 + 1 + 1 + 1 + + + + + + + + 1 + 0 + 1 + + 1 + 0 + Dock + 0 + Left + 1 + + 1 + + 0 + 0 + wxID_ANY + y: + + 0 + + + 0 + + 1 + m_yLabel + 1 + + + protected + 1 + + Resizable + 1 + + + + 0 + + + + + -1 + + + + + + + + + + + + + + + + + + + + + + + + + + + 5 + wxALL|wxEXPAND + 0 + + 1 + 1 + 1 + 1 + + + + + + + + 1 + 0 + 1 + + 1 + 0 + Dock + 0 + Left + 1 + + 1 + + 0 + 0 + wxID_ANY + + 0 + + + + 0 + + 1 + m_yEntry + 1 + + + protected + 1 + + Resizable + 1 + + + + 0 + + + wxFILTER_NONE + wxDefaultValidator + + 0 + + + + + + + + + OnTextFocusLost + + + + + + + + + + + + + + + + + + + + + + + + + 5 + wxALIGN_CENTER_VERTICAL|wxALL + 0 + + 1 + 1 + 1 + 1 + + + + + + + + 1 + 0 + 1 + + 1 + 0 + Dock + 0 + Left + 1 + + 1 + + 0 + 0 + wxID_ANY + mm + + 0 + + + 0 + + 1 + m_yUnit + 1 + + + protected + 1 + + Resizable + 1 + + + + 0 + + + + + -1 + + + + + + + + + + + + + + + + + + + + + + + + + + + 5 + wxALL + 0 + + 1 + 1 + 1 + 1 + + + + + + + Load From Art Provider; wxART_DELETE; wxART_BUTTON + + 1 + 0 + 1 + + 1 + 0 + 0 + + Dock + 0 + Left + 1 + + 1 + + + 0 + 0 + + wxID_CLEAR + Clear + + 0 + + + 0 + + 1 + m_clearY + 1 + + + protected + 1 + + Resizable + + 1 + + wxBU_AUTODRAW + + 0 + + + wxFILTER_NONE + wxDefaultValidator + + + + + OnClear + + + + + + + + + + + + + + + + + + + + + + + + + + + 5 + wxALIGN_CENTER_VERTICAL|wxALIGN_RIGHT|wxALL + 0 + + 1 + 1 + 1 + 1 + + + + + + + + 1 + 0 + 1 + + 1 + 0 + Dock + 0 + Left + 1 + + 1 + + 0 + 0 + wxID_ANY + Rotate: + + 0 + + + 0 + + 1 + m_rotLabel + 1 + + + protected + 1 + + Resizable + 1 + + + + 0 + + + + + -1 + + + + + + + + + + + + + + + + + + + + + + + + + + + 5 + wxALL|wxEXPAND + 0 + + 1 + 1 + 1 + 1 + + + + + + + + 1 + 0 + 1 + + 1 + 0 + Dock + 0 + Left + 1 + + 1 + + 0 + 0 + wxID_ANY + + 0 + + + + 0 + + 1 + m_rotEntry + 1 + + + protected + 1 + + Resizable + 1 + + + + 0 + + + wxFILTER_NONE + wxDefaultValidator + + 0 + + + + + + + + + OnTextFocusLost + + + + + + + + + + + + + + + + + + + + + + + + + 5 + wxALIGN_CENTER_VERTICAL|wxALL + 0 + + 1 + 1 + 1 + 1 + + + + + + + + 1 + 0 + 1 + + 1 + 0 + Dock + 0 + Left + 1 + + 1 + + 0 + 0 + wxID_ANY + deg + + 0 + + + 0 + + 1 + m_rotUnit + 1 + + + protected + 1 + + Resizable + 1 + + + + 0 + + + + + -1 + + + + + + + + + + + + + + + + + + + + + + + + + + + 5 + wxALL + 0 + + 1 + 1 + 1 + 1 + + + + + + + Load From Art Provider; wxART_DELETE; wxART_BUTTON + + 1 + 0 + 1 + + 1 + 0 + 0 + + Dock + 0 + Left + 1 + + 1 + + + 0 + 0 + + wxID_CLEAR + Clear + + 0 + + + 0 + + 1 + m_clearRot + 1 + + + protected + 1 + + Resizable + + 1 + + wxBU_AUTODRAW + + 0 + + + wxFILTER_NONE + wxDefaultValidator + + + + + OnClear + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 5 + wxALL|wxEXPAND + 0 + + 0 + 1 + 0 + 0 + 0 + 1 + 0 + 0 + + m_stdButtons + protected + + OnCancelClick + + + + OnOkClick + + + + + + + + diff --git a/pcbnew/dialogs/dialog_move_exact.h b/pcbnew/dialogs/dialog_move_exact.h new file mode 100644 index 0000000000..b71f871551 --- /dev/null +++ b/pcbnew/dialogs/dialog_move_exact.h @@ -0,0 +1,87 @@ +/* + * This program source code file is part of KiCad, a free EDA CAD application. + * + * Copyright (C) 2014 John Beard, john.j.beard@gmail.com + * 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 + * as published by the Free Software Foundation; either version 2 + * of the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, you may find one here: + * http://www.gnu.org/licenses/old-licenses/gpl-2.0.html + * or you may search the http://www.gnu.org website for the version 2 license, + * or you may write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA + */ + +#ifndef __DIALOG_MOVE_EXACT__ +#define __DIALOG_MOVE_EXACT__ + +// Include the wxFormBuider header base: +#include +#include + +class DIALOG_MOVE_EXACT : public DIALOG_MOVE_EXACT_BASE +{ +private: + + wxPoint& m_translation; + double& m_rotation; + +public: + + enum MOVE_EDIT_T + { + MOVE_ABORT, ///< if not changed or error + MOVE_OK, ///< if successfully changed + }; + + // Constructor and destructor + DIALOG_MOVE_EXACT( PCB_BASE_FRAME* aParent, wxPoint& translation, + double& rotation ); + ~DIALOG_MOVE_EXACT(); + +private: + + void OnTextFocusLost( wxFocusEvent& event ); + void OnPolarChanged( wxCommandEvent& event ); + void OnClear( wxCommandEvent& event ); + + void OnCancelClick( wxCommandEvent& event ); + void OnOkClick( wxCommandEvent& event ); + + void ToPolarDeg( double x, double y, double& r, double& q ); + bool GetTranslationInIU ( wxPoint& val, bool polar ); + + /** + * Persistent dialog options + */ + struct MOVE_EXACT_OPTIONS + { + bool polarCoords; + double entry1; + double entry2; + double entryRotation; + + MOVE_EXACT_OPTIONS(): + polarCoords(false), + entry1(0), + entry2(0), + entryRotation(0) + { + } + }; + + // persistent settings + static MOVE_EXACT_OPTIONS m_options; +}; + +#endif // __DIALOG_MOVE_EXACT__ diff --git a/pcbnew/dialogs/dialog_move_exact_base.cpp b/pcbnew/dialogs/dialog_move_exact_base.cpp new file mode 100644 index 0000000000..4f2644ac27 --- /dev/null +++ b/pcbnew/dialogs/dialog_move_exact_base.cpp @@ -0,0 +1,114 @@ +/////////////////////////////////////////////////////////////////////////// +// C++ code generated with wxFormBuilder (version Jun 6 2014) +// http://www.wxformbuilder.org/ +// +// PLEASE DO "NOT" EDIT THIS FILE! +/////////////////////////////////////////////////////////////////////////// + +#include "dialog_move_exact_base.h" + +/////////////////////////////////////////////////////////////////////////// + +DIALOG_MOVE_EXACT_BASE::DIALOG_MOVE_EXACT_BASE( wxWindow* parent, wxWindowID id, const wxString& title, const wxPoint& pos, const wxSize& size, long style ) : DIALOG_SHIM( parent, id, title, pos, size, style ) +{ + this->SetSizeHints( wxSize( -1,-1 ), wxDefaultSize ); + + wxBoxSizer* bMainSizer; + bMainSizer = new wxBoxSizer( wxVERTICAL ); + + m_polarCoords = new wxCheckBox( this, wxID_ANY, _("Polar coordinates"), wxDefaultPosition, wxDefaultSize, 0 ); + bMainSizer->Add( m_polarCoords, 0, wxALL|wxEXPAND, 5 ); + + wxFlexGridSizer* fgSizer2; + fgSizer2 = new wxFlexGridSizer( 0, 4, 0, 0 ); + fgSizer2->AddGrowableCol( 1 ); + fgSizer2->SetFlexibleDirection( wxBOTH ); + fgSizer2->SetNonFlexibleGrowMode( wxFLEX_GROWMODE_SPECIFIED ); + + m_xLabel = new wxStaticText( this, wxID_ANY, _("x:"), wxDefaultPosition, wxSize( -1,-1 ), 0 ); + m_xLabel->Wrap( -1 ); + fgSizer2->Add( m_xLabel, 0, wxALIGN_CENTER_VERTICAL|wxALIGN_RIGHT|wxALL, 5 ); + + m_xEntry = new wxTextCtrl( this, wxID_ANY, _("0"), wxDefaultPosition, wxDefaultSize, 0 ); + fgSizer2->Add( m_xEntry, 0, wxALL|wxEXPAND, 5 ); + + m_xUnit = new wxStaticText( this, wxID_ANY, _("mm"), wxDefaultPosition, wxDefaultSize, 0 ); + m_xUnit->Wrap( -1 ); + fgSizer2->Add( m_xUnit, 0, wxALIGN_CENTER_VERTICAL|wxALIGN_LEFT|wxALL, 5 ); + + m_clearX = new wxBitmapButton( this, wxID_CLEAR, wxArtProvider::GetBitmap( wxART_DELETE, wxART_BUTTON ), wxDefaultPosition, wxDefaultSize, wxBU_AUTODRAW ); + fgSizer2->Add( m_clearX, 0, wxALL, 5 ); + + m_yLabel = new wxStaticText( this, wxID_ANY, _("y:"), wxDefaultPosition, wxDefaultSize, 0 ); + m_yLabel->Wrap( -1 ); + fgSizer2->Add( m_yLabel, 0, wxALIGN_CENTER_VERTICAL|wxALIGN_RIGHT|wxALL, 5 ); + + m_yEntry = new wxTextCtrl( this, wxID_ANY, _("0"), wxDefaultPosition, wxDefaultSize, 0 ); + fgSizer2->Add( m_yEntry, 0, wxALL|wxEXPAND, 5 ); + + m_yUnit = new wxStaticText( this, wxID_ANY, _("mm"), wxDefaultPosition, wxDefaultSize, 0 ); + m_yUnit->Wrap( -1 ); + fgSizer2->Add( m_yUnit, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5 ); + + m_clearY = new wxBitmapButton( this, wxID_CLEAR, wxArtProvider::GetBitmap( wxART_DELETE, wxART_BUTTON ), wxDefaultPosition, wxDefaultSize, wxBU_AUTODRAW ); + fgSizer2->Add( m_clearY, 0, wxALL, 5 ); + + m_rotLabel = new wxStaticText( this, wxID_ANY, _("Rotate:"), wxDefaultPosition, wxDefaultSize, 0 ); + m_rotLabel->Wrap( -1 ); + fgSizer2->Add( m_rotLabel, 0, wxALIGN_CENTER_VERTICAL|wxALIGN_RIGHT|wxALL, 5 ); + + m_rotEntry = new wxTextCtrl( this, wxID_ANY, _("0"), wxDefaultPosition, wxDefaultSize, 0 ); + fgSizer2->Add( m_rotEntry, 0, wxALL|wxEXPAND, 5 ); + + m_rotUnit = new wxStaticText( this, wxID_ANY, _("deg"), wxDefaultPosition, wxDefaultSize, 0 ); + m_rotUnit->Wrap( -1 ); + fgSizer2->Add( m_rotUnit, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5 ); + + m_clearRot = new wxBitmapButton( this, wxID_CLEAR, wxArtProvider::GetBitmap( wxART_DELETE, wxART_BUTTON ), wxDefaultPosition, wxDefaultSize, wxBU_AUTODRAW ); + fgSizer2->Add( m_clearRot, 0, wxALL, 5 ); + + + bMainSizer->Add( fgSizer2, 1, wxEXPAND, 5 ); + + m_stdButtons = new wxStdDialogButtonSizer(); + m_stdButtonsOK = new wxButton( this, wxID_OK ); + m_stdButtons->AddButton( m_stdButtonsOK ); + m_stdButtonsCancel = new wxButton( this, wxID_CANCEL ); + m_stdButtons->AddButton( m_stdButtonsCancel ); + m_stdButtons->Realize(); + + bMainSizer->Add( m_stdButtons, 0, wxALL|wxEXPAND, 5 ); + + + this->SetSizer( bMainSizer ); + this->Layout(); + bMainSizer->Fit( this ); + + // Connect Events + this->Connect( wxEVT_CLOSE_WINDOW, wxCloseEventHandler( DIALOG_MOVE_EXACT_BASE::OnClose ) ); + m_polarCoords->Connect( wxEVT_COMMAND_CHECKBOX_CLICKED, wxCommandEventHandler( DIALOG_MOVE_EXACT_BASE::OnPolarChanged ), NULL, this ); + m_xEntry->Connect( wxEVT_KILL_FOCUS, wxFocusEventHandler( DIALOG_MOVE_EXACT_BASE::OnTextFocusLost ), NULL, this ); + m_clearX->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_MOVE_EXACT_BASE::OnClear ), NULL, this ); + m_yEntry->Connect( wxEVT_KILL_FOCUS, wxFocusEventHandler( DIALOG_MOVE_EXACT_BASE::OnTextFocusLost ), NULL, this ); + m_clearY->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_MOVE_EXACT_BASE::OnClear ), NULL, this ); + m_rotEntry->Connect( wxEVT_KILL_FOCUS, wxFocusEventHandler( DIALOG_MOVE_EXACT_BASE::OnTextFocusLost ), NULL, this ); + m_clearRot->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_MOVE_EXACT_BASE::OnClear ), NULL, this ); + m_stdButtonsCancel->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_MOVE_EXACT_BASE::OnCancelClick ), NULL, this ); + m_stdButtonsOK->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_MOVE_EXACT_BASE::OnOkClick ), NULL, this ); +} + +DIALOG_MOVE_EXACT_BASE::~DIALOG_MOVE_EXACT_BASE() +{ + // Disconnect Events + this->Disconnect( wxEVT_CLOSE_WINDOW, wxCloseEventHandler( DIALOG_MOVE_EXACT_BASE::OnClose ) ); + m_polarCoords->Disconnect( wxEVT_COMMAND_CHECKBOX_CLICKED, wxCommandEventHandler( DIALOG_MOVE_EXACT_BASE::OnPolarChanged ), NULL, this ); + m_xEntry->Disconnect( wxEVT_KILL_FOCUS, wxFocusEventHandler( DIALOG_MOVE_EXACT_BASE::OnTextFocusLost ), NULL, this ); + m_clearX->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_MOVE_EXACT_BASE::OnClear ), NULL, this ); + m_yEntry->Disconnect( wxEVT_KILL_FOCUS, wxFocusEventHandler( DIALOG_MOVE_EXACT_BASE::OnTextFocusLost ), NULL, this ); + m_clearY->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_MOVE_EXACT_BASE::OnClear ), NULL, this ); + m_rotEntry->Disconnect( wxEVT_KILL_FOCUS, wxFocusEventHandler( DIALOG_MOVE_EXACT_BASE::OnTextFocusLost ), NULL, this ); + m_clearRot->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_MOVE_EXACT_BASE::OnClear ), NULL, this ); + m_stdButtonsCancel->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_MOVE_EXACT_BASE::OnCancelClick ), NULL, this ); + m_stdButtonsOK->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_MOVE_EXACT_BASE::OnOkClick ), NULL, this ); + +} diff --git a/pcbnew/dialogs/dialog_move_exact_base.h b/pcbnew/dialogs/dialog_move_exact_base.h new file mode 100644 index 0000000000..e8072f8848 --- /dev/null +++ b/pcbnew/dialogs/dialog_move_exact_base.h @@ -0,0 +1,77 @@ +/////////////////////////////////////////////////////////////////////////// +// C++ code generated with wxFormBuilder (version Jun 6 2014) +// http://www.wxformbuilder.org/ +// +// PLEASE DO "NOT" EDIT THIS FILE! +/////////////////////////////////////////////////////////////////////////// + +#ifndef __DIALOG_MOVE_EXACT_BASE_H__ +#define __DIALOG_MOVE_EXACT_BASE_H__ + +#include +#include +#include +class DIALOG_SHIM; + +#include "dialog_shim.h" +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +/////////////////////////////////////////////////////////////////////////// + + +/////////////////////////////////////////////////////////////////////////////// +/// Class DIALOG_MOVE_EXACT_BASE +/////////////////////////////////////////////////////////////////////////////// +class DIALOG_MOVE_EXACT_BASE : public DIALOG_SHIM +{ + private: + + protected: + wxCheckBox* m_polarCoords; + wxStaticText* m_xLabel; + wxTextCtrl* m_xEntry; + wxStaticText* m_xUnit; + wxBitmapButton* m_clearX; + wxStaticText* m_yLabel; + wxTextCtrl* m_yEntry; + wxStaticText* m_yUnit; + wxBitmapButton* m_clearY; + wxStaticText* m_rotLabel; + wxTextCtrl* m_rotEntry; + wxStaticText* m_rotUnit; + wxBitmapButton* m_clearRot; + wxStdDialogButtonSizer* m_stdButtons; + wxButton* m_stdButtonsOK; + wxButton* m_stdButtonsCancel; + + // Virtual event handlers, overide them in your derived class + virtual void OnClose( wxCloseEvent& event ) { event.Skip(); } + virtual void OnPolarChanged( wxCommandEvent& event ) { event.Skip(); } + virtual void OnTextFocusLost( wxFocusEvent& event ) { event.Skip(); } + virtual void OnClear( wxCommandEvent& event ) { event.Skip(); } + virtual void OnCancelClick( wxCommandEvent& event ) { event.Skip(); } + virtual void OnOkClick( wxCommandEvent& event ) { event.Skip(); } + + + public: + + DIALOG_MOVE_EXACT_BASE( wxWindow* parent, wxWindowID id = wxID_ANY, const wxString& title = _("Move item"), const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxSize( -1,-1 ), long style = wxDEFAULT_DIALOG_STYLE|wxRESIZE_BORDER ); + ~DIALOG_MOVE_EXACT_BASE(); + +}; + +#endif //__DIALOG_MOVE_EXACT_BASE_H__ diff --git a/pcbnew/edit.cpp b/pcbnew/edit.cpp index 4e79cb43db..d4c25cdd69 100644 --- a/pcbnew/edit.cpp +++ b/pcbnew/edit.cpp @@ -54,6 +54,9 @@ #include #include +#include +#include + #include #include @@ -1188,6 +1191,19 @@ void PCB_EDIT_FRAME::Process_Special_Functions( wxCommandEvent& event ) } break; + case ID_POPUP_PCB_MOVE_EXACT: + moveExact(); + break; + + case ID_POPUP_PCB_DUPLICATE_ITEM: + case ID_POPUP_PCB_DUPLICATE_ITEM_AND_INCREMENT: + duplicateItem( id == ID_POPUP_PCB_DUPLICATE_ITEM_AND_INCREMENT ); + break; + + case ID_POPUP_PCB_CREATE_ARRAY: + createArray(); + break; + case ID_MENU_PCB_CLEAN: Clean_Pcb(); break; @@ -1486,3 +1502,208 @@ void PCB_EDIT_FRAME::OnSelectTool( wxCommandEvent& aEvent ) break; } } + + +void PCB_EDIT_FRAME::moveExact() +{ + wxPoint translation; + double rotation = 0; + + DIALOG_MOVE_EXACT dialog( this, translation, rotation ); + int ret = dialog.ShowModal(); + + if( ret == DIALOG_MOVE_EXACT::MOVE_OK ) + { + BOARD_ITEM* item = GetScreen()->GetCurItem(); + + // Could be moved or rotated + SaveCopyInUndoList( item, UR_CHANGED ); + + item->Move( translation ); + item->Rotate( item->GetPosition(), rotation ); + m_canvas->Refresh(); + } + + m_canvas->MoveCursorToCrossHair(); +} + + +void PCB_EDIT_FRAME::duplicateItem( bool aIncrement ) +{ + BOARD_ITEM* item = GetScreen()->GetCurItem(); + bool editingModule = NULL != dynamic_cast( this ); + int move_cmd = 0; + + if( item->Type() == PCB_PAD_T && !editingModule ) + { + // If it is not the module editor, then duplicate the parent module instead + item = static_cast( item )->GetParent(); + } + + BOARD_ITEM* new_item = GetBoard()->DuplicateAndAddItem( item, aIncrement ); + + SaveCopyInUndoList( new_item, UR_NEW ); + + if( new_item ) + { + switch( new_item->Type() ) + { + case PCB_MODULE_T: + move_cmd = ID_POPUP_PCB_MOVE_MODULE_REQUEST; + break; + case PCB_TEXT_T: + move_cmd = ID_POPUP_PCB_MOVE_TEXTEPCB_REQUEST; + break; + case PCB_LINE_T: + move_cmd = ID_POPUP_PCB_MOVE_DRAWING_REQUEST; + break; + case PCB_ZONE_AREA_T: + move_cmd = ID_POPUP_PCB_MOVE_ZONE_OUTLINES; + break; + case PCB_TRACE_T: + move_cmd = ID_POPUP_PCB_MOVE_TRACK_SEGMENT; + break; + case PCB_TARGET_T: + move_cmd = ID_POPUP_PCB_MOVE_MIRE_REQUEST; + break; + case PCB_DIMENSION_T: + move_cmd = ID_POPUP_PCB_MOVE_TEXT_DIMENSION_REQUEST; + break; + case PCB_PAD_T: + move_cmd = ID_POPUP_PCB_MOVE_PAD_REQUEST; + break; + default: + break; + } + + if( move_cmd ) + { + SetMsgPanel( new_item ); + SetCurItem( new_item ); + + m_canvas->MoveCursorToCrossHair(); + + // pick up the item and start moving + PostCommandMenuEvent( move_cmd ); + } + } +} + + +void PCB_BASE_EDIT_FRAME::createArray() +{ + BOARD_ITEM* item = GetScreen()->GetCurItem(); + + if( !item ) + return; + + bool editingModule = NULL != dynamic_cast( this ); + + BOARD* board = GetBoard(); + // Remember it is valid only in the module editor + MODULE* module = static_cast( item->GetParent() ); + + DIALOG_CREATE_ARRAY::ARRAY_OPTIONS* array_opts = NULL; + + const wxPoint rotPoint = item->GetCenter(); + + DIALOG_CREATE_ARRAY dialog( this, rotPoint, &array_opts ); + int ret = dialog.ShowModal(); + + if( ret == DIALOG_CREATE_ARRAY::CREATE_ARRAY_OK && array_opts != NULL ) + { + PICKED_ITEMS_LIST newItemsList; + + if( item->Type() == PCB_PAD_T && !editingModule ) + { + // If it is not the module editor, then duplicate the parent module instead + item = static_cast( item )->GetParent(); + } + + if( editingModule ) + { + // modedit saves everything upfront + SaveCopyInUndoList( board->m_Modules, UR_MODEDIT ); + } + else + { + // We may also change the original item + SaveCopyInUndoList( item, UR_CHANGED ); + } + + wxString cachedString; + + if( item->Type() == PCB_MODULE_T ) + { + cachedString = static_cast( item )->GetReferencePrefix(); + } + else if( EDA_TEXT* text = dynamic_cast( item ) ) + { + // Copy the text (not just take a reference + cachedString = text->GetText(); + } + + for( int ptN = 0; ptN < array_opts->GetArraySize(); ptN++ ) + { + BOARD_ITEM* new_item = NULL; + + if( ptN == 0 ) + { + new_item = item; + } + else + { + if( editingModule ) + new_item = module->DuplicateAndAddItem( item, true ); + else + new_item = board->DuplicateAndAddItem( item, true ); + + if( new_item ) + { + array_opts->TransformItem( ptN, new_item, rotPoint ); + newItemsList.PushItem( new_item ); + } + } + + if( !new_item || !array_opts->ShouldRenumberItems() ) + continue; + + // Renumber items + switch( new_item->Type() ) + { + case PCB_MODULE_TEXT_T: + case PCB_TEXT_T: + { + EDA_TEXT* text = dynamic_cast( new_item ); + text->SetText( array_opts->InterpolateNumberIntoString( ptN, cachedString ) ); + + break; + } + case PCB_MODULE_T: + { + const wxString padName = array_opts->GetItemNumber( ptN ); + static_cast( new_item )->SetReference( cachedString + padName ); + + break; + } + case PCB_PAD_T: + { + const wxString padName = array_opts->GetItemNumber( ptN ); + static_cast( new_item )->SetPadName( padName ); + + break; + } + default: + break; + } + } + + if( !editingModule ) + { + // pcbnew saves the new items like this + SaveCopyInUndoList( newItemsList, UR_NEW ); + } + + m_canvas->Refresh(); + } +} diff --git a/pcbnew/exporters/export_vrml.cpp b/pcbnew/exporters/export_vrml.cpp index 2674a3cd2a..07e6a94df9 100644 --- a/pcbnew/exporters/export_vrml.cpp +++ b/pcbnew/exporters/export_vrml.cpp @@ -185,7 +185,11 @@ public: colors[ VRML_COLOR_TIN ] = VRML_COLOR( .749, .756, .761, .749, .756, .761, 0, 0, 0, 0.8, 0, 0.8 ); - precision = 5; + plainPCB = false; + SetScale( 1.0 ); + SetOffset( 0.0, 0.0 ); + s_text_layer = F_Cu; + s_text_width = 1; } VRML_COLOR& GetColor( VRML_COLOR_INDEX aIndex ) @@ -889,11 +893,11 @@ static void export_vrml_zones( MODEL_VRML& aModel, BOARD* aPcb ) const CPOLYGONS_LIST& poly = zone->GetFilledPolysList(); int nvert = poly.GetCornersCount(); int i = 0; + bool cutout = false; while( i < nvert ) { int seg = vl->NewContour(); - bool first = true; if( seg < 0 ) break; @@ -914,10 +918,10 @@ static void export_vrml_zones( MODEL_VRML& aModel, BOARD* aPcb ) // KiCad ensures that the first polygon is the outline // and all others are holes - vl->EnsureWinding( seg, first ? false : true ); + vl->EnsureWinding( seg, cutout ); - if( first ) - first = false; + if( !cutout ) + cutout = true; ++i; } diff --git a/pcbnew/hotkeys.cpp b/pcbnew/hotkeys.cpp index 006c0b2651..662c81b1e7 100644 --- a/pcbnew/hotkeys.cpp +++ b/pcbnew/hotkeys.cpp @@ -108,6 +108,11 @@ static EDA_HOTKEY HkEditBoardItem( wxT( "Edit Item" ), HK_EDIT_ITEM, 'E' ); static EDA_HOTKEY HkFlipItem( wxT( "Flip Item" ), HK_FLIP_ITEM, 'F' ); static EDA_HOTKEY HkRotateItem( wxT( "Rotate Item" ), HK_ROTATE_ITEM, 'R' ); static EDA_HOTKEY HkMoveItem( wxT( "Move Item" ), HK_MOVE_ITEM, 'M' ); +static EDA_HOTKEY HkMoveItemExact( wxT( "Move Item Exactly" ), HK_MOVE_ITEM_EXACT, 'M' + GR_KB_CTRL ); +static EDA_HOTKEY HkDuplicateItem( wxT( "Duplicate Item" ), HK_DUPLICATE_ITEM, 'D' + GR_KB_CTRL ); +static EDA_HOTKEY HkDuplicateItemAndIncrement( wxT( "Duplicate Item and Increment" ), + HK_DUPLICATE_ITEM_AND_INCREMENT, 'D' + GR_KB_SHIFTCTRL ); +static EDA_HOTKEY HkCreateArray( wxT( "Create Array" ), HK_CREATE_ARRAY, 'N' + GR_KB_CTRL ); static EDA_HOTKEY HkCopyItem( wxT( "Copy Item" ), HK_COPY_ITEM, 'C' ); static EDA_HOTKEY HkDragFootprint( wxT( "Drag Item" ), HK_DRAG_ITEM, 'G' ); static EDA_HOTKEY HkGetAndMoveFootprint( wxT( "Get and Move Footprint" ), HK_GET_AND_MOVE_FOOTPRINT, 'T' ); @@ -277,7 +282,9 @@ EDA_HOTKEY* board_edit_Hotkey_List[] = &HkPlaceItem, &HkCopyItem, &HkMoveItem, &HkFlipItem, - &HkRotateItem, &HkDragFootprint, + &HkRotateItem, &HkMoveItemExact, + &HkDuplicateItem, &HkDuplicateItemAndIncrement, &HkCreateArray, + &HkDragFootprint, &HkGetAndMoveFootprint, &HkLock_Unlock_Footprint, &HkSavefile, &HkSavefileAs, &HkLoadfile, &HkFindItem, &HkEditBoardItem, &HkSwitch2CopperLayer, &HkSwitch2InnerLayer1, @@ -300,8 +307,8 @@ EDA_HOTKEY* board_edit_Hotkey_List[] = // List of hotkey descriptors for the module editor EDA_HOTKEY* module_edit_Hotkey_List[] = { &HkMoveItem, &HkRotateItem, &HkEditBoardItem, - &HkDelete, - &HkSaveModule, + &HkMoveItemExact, &HkDuplicateItem, &HkDuplicateItemAndIncrement, + &HkCreateArray, &HkDelete, &HkSaveModule, NULL }; diff --git a/pcbnew/hotkeys.h b/pcbnew/hotkeys.h index ca58a7fddd..661514a707 100644 --- a/pcbnew/hotkeys.h +++ b/pcbnew/hotkeys.h @@ -41,6 +41,7 @@ enum hotkey_id_commnand { HK_FLIP_ITEM, HK_COPY_ITEM, HK_MOVE_ITEM, + HK_MOVE_ITEM_EXACT, HK_DRAG_ITEM, HK_GET_AND_MOVE_FOOTPRINT, HK_LOCK_UNLOCK_FOOTPRINT, @@ -60,6 +61,9 @@ enum hotkey_id_commnand { HK_SWITCH_TRACK_DISPLAY_MODE, HK_FIND_ITEM, HK_EDIT_ITEM, + HK_DUPLICATE_ITEM, + HK_DUPLICATE_ITEM_AND_INCREMENT, + HK_CREATE_ARRAY, HK_PLACE_ITEM, HK_SWITCH_TRACK_WIDTH_TO_NEXT, HK_SWITCH_TRACK_WIDTH_TO_PREVIOUS, diff --git a/pcbnew/hotkeys_board_editor.cpp b/pcbnew/hotkeys_board_editor.cpp index 02ecf4ff58..f4477d4432 100644 --- a/pcbnew/hotkeys_board_editor.cpp +++ b/pcbnew/hotkeys_board_editor.cpp @@ -551,6 +551,13 @@ bool PCB_EDIT_FRAME::OnHotKey( wxDC* aDC, int aHotkeyCode, const wxPoint& aPosit OnHotkeyRotateItem( HK_FLIP_ITEM ); break; + case HK_MOVE_ITEM_EXACT: + case HK_DUPLICATE_ITEM: + case HK_DUPLICATE_ITEM_AND_INCREMENT: + case HK_CREATE_ARRAY: + OnHotkeyDuplicateOrArrayItem( HK_Descr->m_Idcommand ); + break; + case HK_SWITCH_HIGHCONTRAST_MODE: // switch to high contrast mode and refresh the canvas displ_opts->m_ContrastModeDisplay = !displ_opts->m_ContrastModeDisplay; m_canvas->Refresh(); @@ -896,7 +903,6 @@ bool PCB_EDIT_FRAME::OnHotkeyMoveItem( int aIdCommand ) return false; } - bool PCB_EDIT_FRAME::OnHotkeyPlaceItem( wxDC* aDC ) { BOARD_ITEM* item = GetCurItem(); @@ -1064,3 +1070,71 @@ bool PCB_EDIT_FRAME::OnHotkeyRotateItem( int aIdCommand ) return false; } + +bool PCB_EDIT_FRAME::OnHotkeyDuplicateOrArrayItem( int aIdCommand ) +{ + BOARD_ITEM* item = GetCurItem(); + bool itemCurrentlyEdited = item && item->GetFlags(); + + if( itemCurrentlyEdited ) + return false; + + item = PcbGeneralLocateAndDisplay(); + + if( item == NULL ) + return false; + + SetCurItem( item ); + + int evt_type = 0; // Used to post a wxCommandEvent on demand + + bool canDuplicate = true; + + switch( item->Type() ) + { + // Only handle items we know we can handle + case PCB_PAD_T: + canDuplicate = false; + // no break + case PCB_MODULE_T: + case PCB_LINE_T: + case PCB_TEXT_T: + case PCB_TRACE_T: + case PCB_ZONE_AREA_T: + case PCB_TARGET_T: + case PCB_DIMENSION_T: + switch( aIdCommand ) + { + case HK_CREATE_ARRAY: + if( canDuplicate ) + evt_type = ID_POPUP_PCB_CREATE_ARRAY; + break; + + case HK_DUPLICATE_ITEM_AND_INCREMENT: + if( canDuplicate ) + evt_type = ID_POPUP_PCB_DUPLICATE_ITEM_AND_INCREMENT; + break; + + case HK_DUPLICATE_ITEM: + if( canDuplicate ) + evt_type = ID_POPUP_PCB_DUPLICATE_ITEM; + break; + + case HK_MOVE_ITEM_EXACT: + evt_type = ID_POPUP_PCB_MOVE_EXACT; + break; + + default: + // We don't handle other commands here + break; + } + break; + + default: + wxASSERT_MSG( false, "Unhandled move, duplicate or array for " + "object type " + item->Type() ); + break; + } + + return PostCommandMenuEvent( evt_type ); +} diff --git a/pcbnew/hotkeys_module_editor.cpp b/pcbnew/hotkeys_module_editor.cpp index 918d8a493c..fb52062d15 100644 --- a/pcbnew/hotkeys_module_editor.cpp +++ b/pcbnew/hotkeys_module_editor.cpp @@ -152,31 +152,72 @@ bool FOOTPRINT_EDIT_FRAME::OnHotKey( wxDC* aDC, int aHotKey, const wxPoint& aPos OnHotkeyMoveItem( HK_MOVE_ITEM ); break; + case HK_MOVE_ITEM_EXACT: + if( blockActive ) + { + cmd.SetId( ID_POPUP_MOVE_BLOCK_EXACT ); + GetEventHandler()->ProcessEvent( cmd ); + } + else + { + OnHotkeyMoveItemExact(); + } + break; + case HK_ROTATE_ITEM: OnHotkeyRotateItem( HK_ROTATE_ITEM ); break; + + case HK_DUPLICATE_ITEM: + case HK_DUPLICATE_ITEM_AND_INCREMENT: + OnHotkeyDuplicateItem( HK_Descr->m_Idcommand ); + break; + + case HK_CREATE_ARRAY: + PostCommandMenuEvent( ID_POPUP_PCB_CREATE_ARRAY ); } return true; } -bool FOOTPRINT_EDIT_FRAME::OnHotkeyEditItem( int aIdCommand ) +BOARD_ITEM* FOOTPRINT_EDIT_FRAME::PrepareItemForHotkey( bool aFailIfCurrentlyEdited ) { BOARD_ITEM* item = GetCurItem(); bool itemCurrentlyEdited = item && item->GetFlags(); bool blockActive = GetScreen()->m_BlockLocate.GetCommand() != BLOCK_IDLE; - if( itemCurrentlyEdited || blockActive ) - return false; + if( aFailIfCurrentlyEdited ) + { + if( itemCurrentlyEdited || blockActive ) + return NULL; - item = ModeditLocateAndDisplay(); + item = ModeditLocateAndDisplay(); + } + else + { + if( blockActive ) + return NULL; + + if( !itemCurrentlyEdited ) + item = ModeditLocateAndDisplay(); + } + + // set item if we can, but don't clear if not + if( item ) + SetCurItem( item ); + + return item; +} + + +bool FOOTPRINT_EDIT_FRAME::OnHotkeyEditItem( int aIdCommand ) +{ + BOARD_ITEM* item = PrepareItemForHotkey( true ); if( item == NULL ) return false; - SetCurItem( item ); - int evt_type = 0; // Used to post a wxCommandEvent on demand switch( item->Type() ) @@ -209,35 +250,17 @@ bool FOOTPRINT_EDIT_FRAME::OnHotkeyEditItem( int aIdCommand ) break; } - if( evt_type != 0 ) - { - wxCommandEvent evt( wxEVT_COMMAND_MENU_SELECTED ); - evt.SetEventObject( this ); - evt.SetId( evt_type ); - wxPostEvent( this, evt ); - return true; - } - - return false; + return PostCommandMenuEvent( evt_type ); } bool FOOTPRINT_EDIT_FRAME::OnHotkeyDeleteItem( int aIdCommand ) { - BOARD_ITEM* item = GetCurItem(); - bool itemCurrentlyEdited = item && item->GetFlags(); - bool blockActive = GetScreen()->m_BlockLocate.GetCommand() != BLOCK_IDLE; - - if( itemCurrentlyEdited || blockActive ) - return false; - - item = ModeditLocateAndDisplay(); + BOARD_ITEM* item = PrepareItemForHotkey( true ); if( item == NULL ) return false; - SetCurItem( item ); - int evt_type = 0; // Used to post a wxCommandEvent on demand switch( item->Type() ) @@ -264,35 +287,17 @@ bool FOOTPRINT_EDIT_FRAME::OnHotkeyDeleteItem( int aIdCommand ) break; } - if( evt_type != 0 ) - { - wxCommandEvent evt( wxEVT_COMMAND_MENU_SELECTED ); - evt.SetEventObject( this ); - evt.SetId( evt_type ); - wxPostEvent( this, evt ); - return true; - } - - return false; + return PostCommandMenuEvent( evt_type ); } bool FOOTPRINT_EDIT_FRAME::OnHotkeyMoveItem( int aIdCommand ) { - BOARD_ITEM* item = GetCurItem(); - bool itemCurrentlyEdited = item && item->GetFlags(); - bool blockActive = GetScreen()->m_BlockLocate.GetCommand() != BLOCK_IDLE; - - if( itemCurrentlyEdited || blockActive ) - return false; - - item = ModeditLocateAndDisplay(); + BOARD_ITEM* item = PrepareItemForHotkey( true ); if( item == NULL ) return false; - SetCurItem( item ); - int evt_type = 0; // Used to post a wxCommandEvent on demand switch( item->Type() ) @@ -319,36 +324,71 @@ bool FOOTPRINT_EDIT_FRAME::OnHotkeyMoveItem( int aIdCommand ) break; } - if( evt_type != 0 ) + return PostCommandMenuEvent( evt_type ); +} + + +bool FOOTPRINT_EDIT_FRAME::OnHotkeyMoveItemExact() +{ + BOARD_ITEM* item = PrepareItemForHotkey( false ); + + if( item == NULL ) + return false; + + int evt_type = 0; // Used to post a wxCommandEvent on demand + + switch( item->Type() ) { - wxCommandEvent evt( wxEVT_COMMAND_MENU_SELECTED ); - evt.SetEventObject( this ); - evt.SetId( evt_type ); - wxPostEvent( this, evt ); - return true; + case PCB_PAD_T: + case PCB_MODULE_EDGE_T: + case PCB_MODULE_TEXT_T: + evt_type = ID_POPUP_PCB_MOVE_EXACT; + break; + default: + break; } - return false; + return PostCommandMenuEvent( evt_type ); +} + + +bool FOOTPRINT_EDIT_FRAME::OnHotkeyDuplicateItem( int aIdCommand ) +{ + BOARD_ITEM* item = PrepareItemForHotkey( true ); + + if( item == NULL ) + return false; + + int evt_type = 0; // Used to post a wxCommandEvent on demand + + switch( item->Type() ) + { + case PCB_PAD_T: + case PCB_MODULE_EDGE_T: + case PCB_MODULE_TEXT_T: + if( aIdCommand == HK_DUPLICATE_ITEM ) + evt_type = ID_POPUP_PCB_DUPLICATE_ITEM; + else + evt_type = ID_POPUP_PCB_DUPLICATE_ITEM_AND_INCREMENT; + + break; + + default: + break; + } + + return PostCommandMenuEvent( evt_type ); } bool FOOTPRINT_EDIT_FRAME::OnHotkeyRotateItem( int aIdCommand ) { - BOARD_ITEM* item = GetCurItem(); - bool itemCurrentlyEdited = item && item->GetFlags(); - int evt_type = 0; // Used to post a wxCommandEvent on demand - bool blockActive = GetScreen()->m_BlockLocate.GetCommand() != BLOCK_IDLE; - - if( blockActive ) - return false; - - if( !itemCurrentlyEdited ) - item = ModeditLocateAndDisplay(); + BOARD_ITEM* item = PrepareItemForHotkey( false ); if( item == NULL ) return false; - SetCurItem( item ); + int evt_type = 0; // Used to post a wxCommandEvent on demand switch( item->Type() ) { @@ -362,14 +402,5 @@ bool FOOTPRINT_EDIT_FRAME::OnHotkeyRotateItem( int aIdCommand ) break; } - if( evt_type != 0 ) - { - wxCommandEvent evt( wxEVT_COMMAND_MENU_SELECTED ); - evt.SetEventObject( this ); - evt.SetId( evt_type ); - wxPostEvent( this, evt ); - return true; - } - - return false; + return PostCommandMenuEvent( evt_type ); } diff --git a/pcbnew/kicad_netlist_reader.cpp b/pcbnew/kicad_netlist_reader.cpp index a1a0f5f25f..e3635ff1d8 100644 --- a/pcbnew/kicad_netlist_reader.cpp +++ b/pcbnew/kicad_netlist_reader.cpp @@ -35,7 +35,7 @@ using namespace NL_T; -void KICAD_NETLIST_READER::LoadNetlist() throw ( IO_ERROR, PARSE_ERROR ) +void KICAD_NETLIST_READER::LoadNetlist() throw ( IO_ERROR, PARSE_ERROR, boost::bad_pointer ) { m_parser->Parse(); diff --git a/pcbnew/kicad_plugin.cpp b/pcbnew/kicad_plugin.cpp index 939a0d034f..e2991aaac0 100644 --- a/pcbnew/kicad_plugin.cpp +++ b/pcbnew/kicad_plugin.cpp @@ -88,7 +88,6 @@ void filterNetClass( const BOARD& aBoard, NETCLASS& aNetClass ) class FP_CACHE_ITEM { wxFileName m_file_name; ///< The the full file name and path of the footprint to cache. - bool m_writable; ///< Writability status of the footprint file. wxDateTime m_mod_time; ///< The last file modified time stamp. std::auto_ptr m_module; diff --git a/pcbnew/legacy_netlist_reader.cpp b/pcbnew/legacy_netlist_reader.cpp index cefe733a3d..bfcb302c4a 100644 --- a/pcbnew/legacy_netlist_reader.cpp +++ b/pcbnew/legacy_netlist_reader.cpp @@ -35,8 +35,7 @@ #include - -void LEGACY_NETLIST_READER::LoadNetlist() throw ( IO_ERROR, PARSE_ERROR ) +void LEGACY_NETLIST_READER::LoadNetlist() throw ( IO_ERROR, PARSE_ERROR, boost::bad_pointer ) { int state = 0; bool is_comment = false; @@ -98,7 +97,8 @@ void LEGACY_NETLIST_READER::LoadNetlist() throw ( IO_ERROR, PARSE_ERROR ) } -COMPONENT* LEGACY_NETLIST_READER::loadComponent( char* aText ) throw( PARSE_ERROR ) +COMPONENT* LEGACY_NETLIST_READER::loadComponent( char* aText ) + throw( PARSE_ERROR, boost::bad_pointer ) { char* text; wxString msg; diff --git a/pcbnew/loadcmp.cpp b/pcbnew/loadcmp.cpp index 30ab1f9ad0..25c9f8ab03 100644 --- a/pcbnew/loadcmp.cpp +++ b/pcbnew/loadcmp.cpp @@ -96,12 +96,12 @@ bool FOOTPRINT_EDIT_FRAME::Load_Module_From_BOARD( MODULE* aModule ) newModule->ClearFlags(); - // Clear references to net info, because the footprint editor + // Clear references to any net info, because the footprint editor // does know any thing about nets handled by the current edited board. - // Morever the main board can change or the net info relative to this main board - // can change while editing this footprint in the footprint editor - for( D_PAD* pad = newModule->Pads(); pad; pad = pad->Next() ) - pad->SetNetCode( NETINFO_LIST::UNCONNECTED ); + // Morever we do not want to save any reference to an unknown net when + // saving the footprint in lib cache + // so we force the ORPHANED dummy net info for all pads + newModule->ClearAllNets(); SetCrossHairPosition( wxPoint( 0, 0 ) ); PlaceModule( newModule, NULL ); @@ -269,6 +269,7 @@ MODULE* PCB_BASE_FRAME::LoadModuleFromLibrary( const wxString& aLibrary, if( module ) { GetBoard()->Add( module, ADD_APPEND ); + lastComponentName = moduleName; AddHistoryComponentName( HistoryList, moduleName ); @@ -322,13 +323,22 @@ MODULE* PCB_BASE_FRAME::LoadFootprint( const FPID& aFootprintId ) MODULE* PCB_BASE_FRAME::loadFootprint( const FPID& aFootprintId ) - throw( IO_ERROR, PARSE_ERROR ) + throw( IO_ERROR, PARSE_ERROR, boost::interprocess::lock_exception ) { FP_LIB_TABLE* fptbl = Prj().PcbFootprintLibs(); wxCHECK_MSG( fptbl, NULL, wxT( "Cannot look up FPID in NULL FP_LIB_TABLE." ) ); - return fptbl->FootprintLoadWithOptionalNickname( aFootprintId ); + MODULE* module = fptbl->FootprintLoadWithOptionalNickname( aFootprintId ); + + // If the module is found, clear all net info, + // to be sure there is no broken links + // to any netinfo list (should be not needed, but it can be edited from + // the footprint editor ) + if( module ) + module->ClearAllNets(); + + return module; } diff --git a/pcbnew/magnetic_tracks_functions.cpp b/pcbnew/magnetic_tracks_functions.cpp index 884ad13301..bd7f3bc28c 100644 --- a/pcbnew/magnetic_tracks_functions.cpp +++ b/pcbnew/magnetic_tracks_functions.cpp @@ -2,7 +2,7 @@ * This program source code file is part of KiCad, a free EDA CAD application. * * Copyright (C) 2009-2014 Jean-Pierre Charras, jp.charras at wanadoo.fr - * Copyright (C) 1992-2012 KiCad Developers, see AUTHORS.txt for contributors. + * Copyright (C) 1992-2015 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 @@ -280,14 +280,16 @@ bool Magnetize( PCB_EDIT_FRAME* frame, int aCurrentTool, wxSize aGridSize, if( currTrack->Type() != PCB_VIA_T || ( currTrack->GetStart() != track->GetStart() && currTrack->GetStart() != track->GetEnd() )) { - if( distStart <= currTrack->GetWidth()/2 ) + double max_dist = currTrack->GetWidth() / 2.0f; + + if( distStart <= max_dist ) { // D(printf("nearest end is start\n");) *curpos = track->GetStart(); return true; } - if( distEnd <= currTrack->GetWidth()/2 ) + if( distEnd <= max_dist ) { // D(printf("nearest end is end\n");) *curpos = track->GetEnd(); diff --git a/pcbnew/modedit.cpp b/pcbnew/modedit.cpp index 61951c2795..d135cf880e 100644 --- a/pcbnew/modedit.cpp +++ b/pcbnew/modedit.cpp @@ -55,6 +55,8 @@ #include #include +#include +#include #include #include #include @@ -64,10 +66,13 @@ // Functions defined in block_module_editor, but used here -// These 2 functions are used in modedit to rotate or mirror the whole footprint -// so they are called with force_all = true +// These 3 functions are used in modedit to rotate, mirror or move the +// whole footprint so they are called with force_all = true void MirrorMarkedItems( MODULE* module, wxPoint offset, bool force_all = false ); void RotateMarkedItems( MODULE* module, wxPoint offset, bool force_all = false ); +void MoveMarkedItemsExactly( MODULE* module, const wxPoint& centre, + const wxPoint& translation, double rotation, + bool force_all = false ); BOARD_ITEM* FOOTPRINT_EDIT_FRAME::ModeditLocateAndDisplay( int aHotKeyCode ) @@ -635,6 +640,22 @@ void FOOTPRINT_EDIT_FRAME::Process_Special_Functions( wxCommandEvent& event ) m_canvas->MoveCursorToCrossHair(); break; + case ID_POPUP_PCB_DUPLICATE_ITEM: + duplicateItems( false ); + break; + + case ID_POPUP_PCB_DUPLICATE_ITEM_AND_INCREMENT: + duplicateItems( true ); + break; + + case ID_POPUP_PCB_MOVE_EXACT: + moveExact(); + break; + + case ID_POPUP_PCB_CREATE_ARRAY: + createArray(); + break; + case ID_POPUP_PCB_IMPORT_PAD_SETTINGS: SaveCopyInUndoList( GetBoard()->m_Modules, UR_MODEDIT ); m_canvas->MoveCursorToCrossHair(); @@ -735,6 +756,7 @@ void FOOTPRINT_EDIT_FRAME::Process_Special_Functions( wxCommandEvent& event ) case ID_MODEDIT_MODULE_ROTATE: case ID_MODEDIT_MODULE_MIRROR: + case ID_MODEDIT_MODULE_MOVE_EXACT: SaveCopyInUndoList( GetBoard()->m_Modules, UR_MODEDIT ); Transform( (MODULE*) GetScreen()->GetCurItem(), id ); m_canvas->Refresh(); @@ -799,6 +821,12 @@ void FOOTPRINT_EDIT_FRAME::Process_Special_Functions( wxCommandEvent& event ) HandleBlockEnd( &dc ); break; + case ID_POPUP_MOVE_BLOCK_EXACT: + GetScreen()->m_BlockLocate.SetCommand( BLOCK_MOVE_EXACT ); + GetScreen()->m_BlockLocate.SetMessageBlock( this ); + HandleBlockEnd( &dc ); + break; + case ID_GEN_IMPORT_DXF_FILE: InvokeDXFDialogModuleImport( this, GetBoard()->m_Modules ); m_canvas->Refresh(); @@ -812,6 +840,72 @@ void FOOTPRINT_EDIT_FRAME::Process_Special_Functions( wxCommandEvent& event ) } +void FOOTPRINT_EDIT_FRAME::moveExact() +{ + wxPoint translation; + double rotation = 0; + + DIALOG_MOVE_EXACT dialog( this, translation, rotation ); + int ret = dialog.ShowModal(); + + if( ret == DIALOG_MOVE_EXACT::MOVE_OK ) + { + SaveCopyInUndoList( GetBoard()->m_Modules, UR_MODEDIT ); + + BOARD_ITEM* item = GetScreen()->GetCurItem(); + + item->Move( translation ); + item->Rotate( item->GetPosition(), rotation ); + m_canvas->Refresh(); + } + + m_canvas->MoveCursorToCrossHair(); +} + + +void FOOTPRINT_EDIT_FRAME::duplicateItems( bool aIncrement ) +{ + SaveCopyInUndoList( GetBoard()->m_Modules, UR_MODEDIT ); + + BOARD_ITEM* item = GetScreen()->GetCurItem(); + MODULE* module = static_cast( item->GetParent() ); + + int move_cmd = 0; + + BOARD_ITEM* new_item = module->DuplicateAndAddItem( + item, aIncrement ); + + if( new_item ) + { + switch( new_item->Type() ) + { + case PCB_PAD_T: + move_cmd = ID_POPUP_PCB_MOVE_PAD_REQUEST; + break; + case PCB_MODULE_TEXT_T: + move_cmd = ID_POPUP_PCB_MOVE_TEXTMODULE_REQUEST; + break; + case PCB_MODULE_EDGE_T: + move_cmd = ID_POPUP_PCB_MOVE_EDGE; + break; + default: + break; + } + + if( move_cmd ) + { + SetMsgPanel( new_item ); + SetCurItem( new_item ); + + m_canvas->MoveCursorToCrossHair(); + + // pick up the item and start moving + PostCommandMenuEvent( move_cmd ); + } + } +} + + void FOOTPRINT_EDIT_FRAME::Transform( MODULE* module, int transform ) { switch( transform ) @@ -824,6 +918,23 @@ void FOOTPRINT_EDIT_FRAME::Transform( MODULE* module, int transform ) MirrorMarkedItems( module, wxPoint(0,0), true ); break; + case ID_MODEDIT_MODULE_MOVE_EXACT: + { + wxPoint translation; + double rotation = 0; + + DIALOG_MOVE_EXACT dialog( this, translation, rotation ); + int ret = dialog.ShowModal(); + + if( ret == DIALOG_MOVE_EXACT::MOVE_OK ) + { + MoveMarkedItemsExactly( module, wxPoint(0, 0), + translation, rotation, true ); + } + + break; + } + default: DisplayInfoMessage( this, wxT( "Not available" ) ); break; diff --git a/pcbnew/modedit_onclick.cpp b/pcbnew/modedit_onclick.cpp index edb29d005d..8c2af77fc5 100644 --- a/pcbnew/modedit_onclick.cpp +++ b/pcbnew/modedit_onclick.cpp @@ -173,7 +173,7 @@ void FOOTPRINT_EDIT_FRAME::OnLeftClick( wxDC* DC, const wxPoint& MousePos ) // so deselect the active tool SetToolID( ID_NO_TOOL_SELECTED, m_canvas->GetDefaultCursor(), wxEmptyString ); SetCurItem( NULL ); - m_canvas->Refresh(); + m_canvas->Refresh(); } break; @@ -260,6 +260,11 @@ bool FOOTPRINT_EDIT_FRAME::OnRightClick( const wxPoint& MousePos, wxMenu* PopMen AddMenuItem( PopMenu, ID_POPUP_DELETE_BLOCK, _( "Delete Block (shift+ctrl + drag mouse)" ), KiBitmap( delete_xpm ) ); + + msg = AddHotkeyName( _("Move Block Exactly" ), + g_Module_Editor_Hokeys_Descr, HK_MOVE_ITEM_EXACT ); + AddMenuItem( PopMenu, ID_POPUP_MOVE_BLOCK_EXACT, + msg, KiBitmap( move_xpm ) ); } else { @@ -286,10 +291,14 @@ bool FOOTPRINT_EDIT_FRAME::OnRightClick( const wxPoint& MousePos, wxMenu* PopMen KiBitmap( rotate_module_ccw_xpm ) ); AddMenuItem( transform_choice, ID_MODEDIT_MODULE_MIRROR, _( "Mirror" ), KiBitmap( mirror_footprint_axisY_xpm ) ); + AddMenuItem( transform_choice, ID_MODEDIT_MODULE_MOVE_EXACT, _( "Move Exactly" ), + KiBitmap( move_module_xpm ) ); + msg = AddHotkeyName( _( "Edit Footprint" ), g_Module_Editor_Hokeys_Descr, HK_EDIT_ITEM ); AddMenuItem( PopMenu, ID_POPUP_PCB_EDIT_MODULE_PRMS, msg, KiBitmap( edit_module_xpm ) ); AddMenuItem( PopMenu, transform_choice, ID_MODEDIT_TRANSFORM_MODULE, _( "Transform Footprint" ), KiBitmap( edit_xpm ) ); + break; } @@ -309,6 +318,16 @@ bool FOOTPRINT_EDIT_FRAME::OnRightClick( const wxPoint& MousePos, wxMenu* PopMen msg = AddHotkeyName( _("Delete Pad" ), g_Module_Editor_Hokeys_Descr, HK_DELETE ); AddMenuItem( PopMenu, ID_POPUP_PCB_DELETE_PAD, msg, KiBitmap( delete_pad_xpm ) ); + msg = AddHotkeyName( _( "Duplicate Pad" ), g_Module_Editor_Hokeys_Descr, HK_DUPLICATE_ITEM ); + AddMenuItem( PopMenu, ID_POPUP_PCB_DUPLICATE_ITEM, msg, KiBitmap( duplicate_pad_xpm ) ); + + msg = AddHotkeyName( _("Move Pad Exactly" ), g_Module_Editor_Hokeys_Descr, HK_MOVE_ITEM_EXACT ); + AddMenuItem( PopMenu, ID_POPUP_PCB_MOVE_EXACT, msg, KiBitmap( move_pad_xpm ) ); + + msg = AddHotkeyName( _("Create Pad Array" ), g_Module_Editor_Hokeys_Descr, HK_CREATE_ARRAY ); + AddMenuItem( PopMenu, ID_POPUP_PCB_CREATE_ARRAY, msg, KiBitmap( array_pad_xpm ) ); + + if( !flags ) { PopMenu->AppendSeparator(); @@ -331,6 +350,30 @@ bool FOOTPRINT_EDIT_FRAME::OnRightClick( const wxPoint& MousePos, wxMenu* PopMen HK_ROTATE_ITEM ); AddMenuItem( PopMenu, ID_POPUP_PCB_ROTATE_TEXTMODULE, msg, KiBitmap( rotate_field_xpm ) ); + { + // Do not show option to replicate value or reference fields + // (there can only be one of each) + + const MODULE* module = static_cast( item->GetParent() ); + const TEXTE_MODULE* text = static_cast( item ); + + if( &module->Reference() != text && &module->Value() != text ) + { + msg = AddHotkeyName( _( "Duplicate Text" ), + g_Module_Editor_Hokeys_Descr, HK_DUPLICATE_ITEM ); + AddMenuItem( PopMenu, ID_POPUP_PCB_DUPLICATE_ITEM, + msg, KiBitmap( duplicate_text_xpm ) ); + + msg = AddHotkeyName( _("Create Text Array" ), + g_Module_Editor_Hokeys_Descr, HK_CREATE_ARRAY ); + AddMenuItem( PopMenu, ID_POPUP_PCB_CREATE_ARRAY, + msg, KiBitmap( array_text_xpm ) ); + } + } + + msg = AddHotkeyName( _("Move Text Exactly" ), g_Module_Editor_Hokeys_Descr, HK_MOVE_ITEM_EXACT ); + AddMenuItem( PopMenu, ID_POPUP_PCB_MOVE_EXACT, msg, KiBitmap( move_field_xpm ) ); + if( !flags ) { msg = AddHotkeyName( _("Edit Text" ), g_Module_Editor_Hokeys_Descr, @@ -359,6 +402,15 @@ bool FOOTPRINT_EDIT_FRAME::OnRightClick( const wxPoint& MousePos, wxMenu* PopMen AddMenuItem( PopMenu, ID_POPUP_PCB_MOVE_EDGE, msg, KiBitmap( move_line_xpm ) ); } + msg = AddHotkeyName( _( "Duplicate Edge" ), g_Module_Editor_Hokeys_Descr, HK_DUPLICATE_ITEM ); + AddMenuItem( PopMenu, ID_POPUP_PCB_DUPLICATE_ITEM, msg, KiBitmap( duplicate_line_xpm ) ); + + msg = AddHotkeyName( _("Move Edge Exactly" ), g_Module_Editor_Hokeys_Descr, HK_MOVE_ITEM_EXACT ); + AddMenuItem( PopMenu, ID_POPUP_PCB_MOVE_EXACT, msg, KiBitmap( move_line_xpm ) ); + + msg = AddHotkeyName( _("Create Edge Array" ), g_Module_Editor_Hokeys_Descr, HK_CREATE_ARRAY ); + AddMenuItem( PopMenu, ID_POPUP_PCB_CREATE_ARRAY, msg, KiBitmap( array_line_xpm ) ); + if( ( flags & (IS_NEW | IS_MOVED) ) == IS_MOVED ) AddMenuItem( PopMenu, ID_POPUP_PCB_PLACE_EDGE, _( "Place edge" ), KiBitmap( checked_ok_xpm ) ); diff --git a/pcbnew/module_editor_frame.h b/pcbnew/module_editor_frame.h index 1bd3c040d1..389a0ee803 100644 --- a/pcbnew/module_editor_frame.h +++ b/pcbnew/module_editor_frame.h @@ -33,7 +33,7 @@ #include #include - +class PCB_LAYER_WIDGET; class FP_LIB_TABLE; namespace PCB { struct IFACE; } // A KIFACE_I coded in pcbnew.c @@ -145,10 +145,14 @@ public: */ bool OnHotKey( wxDC* aDC, int aHotKey, const wxPoint& aPosition, EDA_ITEM* aItem = NULL ); + BOARD_ITEM* PrepareItemForHotkey( bool failIfCurrentlyEdited ); + bool OnHotkeyEditItem( int aIdCommand ); bool OnHotkeyDeleteItem( int aIdCommand ); bool OnHotkeyMoveItem( int aIdCommand ); + bool OnHotkeyMoveItemExact(); bool OnHotkeyRotateItem( int aIdCommand ); + bool OnHotkeyDuplicateItem( int aIdCommand ); /** * Function Show3D_Frame @@ -530,6 +534,22 @@ protected: * @return a pointer to the new text, or NULL if aborted */ TEXTE_MODULE* CreateTextModule( MODULE* aModule, wxDC* aDC ); + +private: + + /** + * Function moveExact + * Move the selected item exactly, popping up a dialog to allow the + * user the enter the move delta + */ + void moveExact(); + + /** + * Function duplicateItems + * Duplicate the item under the cursor + * @param aIncrement increment the number of pad (if that is what is selected) + */ + void duplicateItems( bool aIncrement ); }; #endif // MODULE_EDITOR_FRAME_H_ diff --git a/pcbnew/moduleframe.cpp b/pcbnew/moduleframe.cpp index 55e18b4666..c2b3405c48 100644 --- a/pcbnew/moduleframe.cpp +++ b/pcbnew/moduleframe.cpp @@ -148,6 +148,7 @@ BEGIN_EVENT_TABLE( FOOTPRINT_EDIT_FRAME, PCB_BASE_FRAME ) // Module transformations EVT_MENU( ID_MODEDIT_MODULE_ROTATE, FOOTPRINT_EDIT_FRAME::Process_Special_Functions ) EVT_MENU( ID_MODEDIT_MODULE_MIRROR, FOOTPRINT_EDIT_FRAME::Process_Special_Functions ) + EVT_MENU( ID_MODEDIT_MODULE_MOVE_EXACT, FOOTPRINT_EDIT_FRAME::Process_Special_Functions ) EVT_MENU( ID_PCB_DRAWINGS_WIDTHS_SETUP, FOOTPRINT_EDIT_FRAME::Process_Special_Functions ) EVT_MENU( ID_PCB_PAD_SETUP, FOOTPRINT_EDIT_FRAME::Process_Special_Functions ) diff --git a/pcbnew/netlist_reader.h b/pcbnew/netlist_reader.h index 4d6994142b..ce9abeb89e 100644 --- a/pcbnew/netlist_reader.h +++ b/pcbnew/netlist_reader.h @@ -183,7 +183,7 @@ public: * @throw IO_ERROR if a file IO error occurs. * @throw PARSE_ERROR if an error occurs while parsing the file. */ - virtual void LoadNetlist() throw ( IO_ERROR, PARSE_ERROR ) = 0; + virtual void LoadNetlist() throw( IO_ERROR, PARSE_ERROR, boost::bad_pointer ) = 0; /** * Function GetLineReader() @@ -214,7 +214,7 @@ class LEGACY_NETLIST_READER : public NETLIST_READER * @return the new component created by parsing \a aLine * @throw PARSE_ERROR when \a aLine is not a valid component description. */ - COMPONENT* loadComponent( char* aText ) throw( PARSE_ERROR ); + COMPONENT* loadComponent( char* aText ) throw( PARSE_ERROR, boost::bad_pointer ); /** * Function loadFootprintFilters @@ -277,7 +277,7 @@ public: * @throw IO_ERROR if a file IO error occurs. * @throw PARSE_ERROR if an error occurs while parsing the file. */ - virtual void LoadNetlist() throw ( IO_ERROR, PARSE_ERROR ); + virtual void LoadNetlist() throw ( IO_ERROR, PARSE_ERROR, boost::bad_pointer ); }; @@ -392,7 +392,7 @@ public: delete m_parser; } - virtual void LoadNetlist() throw ( IO_ERROR, PARSE_ERROR ); + virtual void LoadNetlist() throw ( IO_ERROR, PARSE_ERROR, boost::bad_pointer ); }; diff --git a/pcbnew/onrightclick.cpp b/pcbnew/onrightclick.cpp index 9de056f34f..7ef2c47d9e 100644 --- a/pcbnew/onrightclick.cpp +++ b/pcbnew/onrightclick.cpp @@ -200,8 +200,27 @@ bool PCB_EDIT_FRAME::OnRightClick( const wxPoint& aMousePos, wxMenu* aPopMenu ) HK_MOVE_ITEM ); AddMenuItem( aPopMenu, ID_POPUP_PCB_MOVE_DRAWING_REQUEST, msg, KiBitmap( move_xpm ) ); - AddMenuItem( aPopMenu, ID_POPUP_PCB_EDIT_DRAWING, _( "Edit Drawing" ), - KiBitmap( edit_xpm ) ); + + msg = AddHotkeyName( _( "Duplicate Drawing" ), g_Module_Editor_Hokeys_Descr, + HK_DUPLICATE_ITEM ); + AddMenuItem( aPopMenu, ID_POPUP_PCB_DUPLICATE_ITEM, + msg, KiBitmap( duplicate_line_xpm ) ); + + msg = AddHotkeyName( _("Move Drawing Exactly" ), g_Module_Editor_Hokeys_Descr, + HK_MOVE_ITEM_EXACT ); + AddMenuItem( aPopMenu, ID_POPUP_PCB_MOVE_EXACT, + msg, KiBitmap( move_line_xpm ) ); + + msg = AddHotkeyName( _("Create Drawing Array" ), g_Module_Editor_Hokeys_Descr, + HK_CREATE_ARRAY ); + AddMenuItem( aPopMenu, ID_POPUP_PCB_CREATE_ARRAY, + msg, KiBitmap( array_line_xpm ) ); + + msg = AddHotkeyName( _( "Edit Drawing" ), g_Module_Editor_Hokeys_Descr, + HK_EDIT_ITEM ); + AddMenuItem( aPopMenu, ID_POPUP_PCB_EDIT_DRAWING, + msg, KiBitmap( edit_xpm ) ); + AddMenuItem( aPopMenu, ID_POPUP_PCB_DELETE_DRAWING, _( "Delete Drawing" ), KiBitmap( delete_xpm ) ); @@ -252,12 +271,30 @@ bool PCB_EDIT_FRAME::OnRightClick( const wxPoint& aMousePos, wxMenu* aPopMenu ) msg = AddHotkeyName( _( "Edit Dimension" ), g_Board_Editor_Hokeys_Descr, HK_EDIT_ITEM ); AddMenuItem( aPopMenu, ID_POPUP_PCB_EDIT_DIMENSION, msg, KiBitmap( edit_xpm ) ); + msg = AddHotkeyName( _( "Move Dimension Text" ), g_Board_Editor_Hokeys_Descr, HK_MOVE_ITEM ); AddMenuItem( aPopMenu, ID_POPUP_PCB_MOVE_TEXT_DIMENSION_REQUEST, msg, KiBitmap( move_text_xpm ) ); + + msg = AddHotkeyName( _( "Duplicate Dimension" ), g_Module_Editor_Hokeys_Descr, + HK_DUPLICATE_ITEM ); + AddMenuItem( aPopMenu, ID_POPUP_PCB_DUPLICATE_ITEM, + msg, KiBitmap( duplicate_text_xpm ) ); + + msg = AddHotkeyName( _("Move Dimension Exactly" ), g_Module_Editor_Hokeys_Descr, + HK_MOVE_ITEM_EXACT ); + AddMenuItem( aPopMenu, ID_POPUP_PCB_MOVE_EXACT, + msg, KiBitmap( move_text_xpm ) ); + + msg = AddHotkeyName( _("Create Dimension Array" ), g_Module_Editor_Hokeys_Descr, + HK_CREATE_ARRAY ); + AddMenuItem( aPopMenu, ID_POPUP_PCB_CREATE_ARRAY, + msg, KiBitmap( array_text_xpm ) ); + msg = AddHotkeyName( _( "Delete Dimension" ), g_Board_Editor_Hokeys_Descr, HK_DELETE ); + AddMenuItem( aPopMenu, ID_POPUP_PCB_DELETE_DIMENSION, msg, KiBitmap( delete_xpm ) ); } @@ -268,10 +305,28 @@ bool PCB_EDIT_FRAME::OnRightClick( const wxPoint& aMousePos, wxMenu* aPopMenu ) { msg = AddHotkeyName( _( "Move Target" ), g_Board_Editor_Hokeys_Descr, HK_MOVE_ITEM ); - AddMenuItem( aPopMenu, ID_POPUP_PCB_MOVE_MIRE_REQUEST, msg, KiBitmap( move_xpm ) ); + AddMenuItem( aPopMenu, ID_POPUP_PCB_MOVE_MIRE_REQUEST, + msg, KiBitmap( move_target_xpm ) ); + + msg = AddHotkeyName( _("Move Target Exactly" ), g_Module_Editor_Hokeys_Descr, + HK_MOVE_ITEM_EXACT ); + AddMenuItem( aPopMenu, ID_POPUP_PCB_MOVE_EXACT, + msg, KiBitmap( move_target_xpm ) ); + + msg = AddHotkeyName( _( "Duplicate Target" ), g_Module_Editor_Hokeys_Descr, + HK_DUPLICATE_ITEM ); + AddMenuItem( aPopMenu, ID_POPUP_PCB_DUPLICATE_ITEM, + msg, KiBitmap( duplicate_target_xpm ) ); + + msg = AddHotkeyName( _("Create Target Array" ), g_Module_Editor_Hokeys_Descr, + HK_CREATE_ARRAY ); + AddMenuItem( aPopMenu, ID_POPUP_PCB_CREATE_ARRAY, + msg, KiBitmap( array_target_xpm ) ); + msg = AddHotkeyName( _( "Edit Target" ), g_Board_Editor_Hokeys_Descr, HK_EDIT_ITEM ); AddMenuItem( aPopMenu, ID_POPUP_PCB_EDIT_MIRE, msg, KiBitmap( edit_xpm ) ); + msg = AddHotkeyName( _( "Delete Target" ), g_Board_Editor_Hokeys_Descr, HK_DELETE ); AddMenuItem( aPopMenu, ID_POPUP_PCB_DELETE_MIRE, msg, KiBitmap( delete_xpm ) ); @@ -500,10 +555,27 @@ void PCB_EDIT_FRAME::createPopupMenuForTracks( TRACK* Track, wxMenu* PopMenu ) HK_DRAG_TRACK_KEEP_SLOPE ); AddMenuItem( PopMenu, ID_POPUP_PCB_DRAG_TRACK_SEGMENT_KEEP_SLOPE, msg, KiBitmap( drag_segment_withslope_xpm ) ); + msg = AddHotkeyName( _( "Drag Segment" ), g_Board_Editor_Hokeys_Descr, HK_DRAG_ITEM ); AddMenuItem( PopMenu, ID_POPUP_PCB_DRAG_TRACK_SEGMENT, msg, KiBitmap( drag_track_segment_xpm ) ); + + msg = AddHotkeyName( _( "Duplicate Track" ), g_Module_Editor_Hokeys_Descr, + HK_DUPLICATE_ITEM ); + AddMenuItem( PopMenu, ID_POPUP_PCB_DUPLICATE_ITEM, + msg, KiBitmap( duplicate_line_xpm ) ); + + msg = AddHotkeyName( _("Move Track Exactly" ), g_Module_Editor_Hokeys_Descr, + HK_MOVE_ITEM_EXACT ); + AddMenuItem( PopMenu, ID_POPUP_PCB_MOVE_EXACT, + msg, KiBitmap( move_line_xpm ) ); + + msg = AddHotkeyName( _("Create Track Array" ), g_Module_Editor_Hokeys_Descr, + HK_CREATE_ARRAY ); + AddMenuItem( PopMenu, ID_POPUP_PCB_CREATE_ARRAY, + msg, KiBitmap( array_line_xpm ) ); + AddMenuItem( PopMenu, ID_POPUP_PCB_BREAK_TRACK, _( "Break Track" ), KiBitmap( break_line_xpm ) ); } @@ -688,7 +760,17 @@ void PCB_EDIT_FRAME::createPopUpMenuForZones( ZONE_CONTAINER* edge_zone, wxMenu* _( "Add Cutout Area" ), KiBitmap( add_zone_cutout_xpm ) ); AddMenuItem( zones_menu, ID_POPUP_PCB_ZONE_DUPLICATE, - _( "Duplicate Zone" ), KiBitmap( zone_duplicate_xpm ) ); + _( "Duplicate Zone Onto Layer" ), KiBitmap( zone_duplicate_xpm ) ); + + msg = AddHotkeyName( _( "Duplicate Zone" ), g_Module_Editor_Hokeys_Descr, + HK_DUPLICATE_ITEM ); + AddMenuItem( zones_menu, ID_POPUP_PCB_DUPLICATE_ITEM, + msg, KiBitmap( zone_duplicate_xpm ) ); + + msg = AddHotkeyName( _("Create Zone Array" ), g_Module_Editor_Hokeys_Descr, + HK_CREATE_ARRAY ); + AddMenuItem( zones_menu, ID_POPUP_PCB_CREATE_ARRAY, + msg, KiBitmap( array_zone_xpm ) ); zones_menu->AppendSeparator(); @@ -705,6 +787,11 @@ void PCB_EDIT_FRAME::createPopUpMenuForZones( ZONE_CONTAINER* edge_zone, wxMenu* msg = AddHotkeyName( _( "Move Zone" ), g_Board_Editor_Hokeys_Descr, HK_MOVE_ITEM ); AddMenuItem( zones_menu, ID_POPUP_PCB_MOVE_ZONE_OUTLINES, msg, KiBitmap( move_xpm ) ); + msg = AddHotkeyName( _("Move Zone Exactly" ), g_Module_Editor_Hokeys_Descr, + HK_MOVE_ITEM_EXACT ); + AddMenuItem( zones_menu, ID_POPUP_PCB_MOVE_EXACT, + msg, KiBitmap( move_zone_xpm ) ); + msg = AddHotkeyName( _( "Edit Zone Properties" ), g_Board_Editor_Hokeys_Descr, HK_EDIT_ITEM ); AddMenuItem( zones_menu, ID_POPUP_PCB_EDIT_ZONE_PARAMS, @@ -741,6 +828,22 @@ void PCB_EDIT_FRAME::createPopUpMenuForFootprints( MODULE* aModule, wxMenu* menu msg = AddHotkeyName( _( "Move" ), g_Board_Editor_Hokeys_Descr, HK_MOVE_ITEM ); AddMenuItem( sub_menu_footprint, ID_POPUP_PCB_MOVE_MODULE_REQUEST, msg, KiBitmap( move_module_xpm ) ); + + msg = AddHotkeyName( _( "Duplicate" ), g_Module_Editor_Hokeys_Descr, + HK_DUPLICATE_ITEM ); + AddMenuItem( menu, ID_POPUP_PCB_DUPLICATE_ITEM, + msg, KiBitmap( duplicate_module_xpm ) ); + + msg = AddHotkeyName( _("Move Exactly" ), g_Module_Editor_Hokeys_Descr, + HK_MOVE_ITEM_EXACT ); + AddMenuItem( menu, ID_POPUP_PCB_MOVE_EXACT, + msg, KiBitmap( move_module_xpm ) ); + + msg = AddHotkeyName( _("Create Array" ), g_Module_Editor_Hokeys_Descr, + HK_CREATE_ARRAY ); + AddMenuItem( menu, ID_POPUP_PCB_CREATE_ARRAY, + msg, KiBitmap( array_module_xpm ) ); + msg = AddHotkeyName( _( "Drag" ), g_Board_Editor_Hokeys_Descr, HK_DRAG_ITEM ); AddMenuItem( sub_menu_footprint, ID_POPUP_PCB_DRAG_MODULE_REQUEST, msg, KiBitmap( drag_module_xpm ) ); @@ -791,6 +894,21 @@ void PCB_EDIT_FRAME::createPopUpMenuForFpTexts( TEXTE_MODULE* FpText, wxMenu* me msg = AddHotkeyName( _( "Move" ), g_Board_Editor_Hokeys_Descr, HK_MOVE_ITEM ); AddMenuItem( sub_menu_Fp_text, ID_POPUP_PCB_MOVE_TEXTMODULE_REQUEST, msg, KiBitmap( move_field_xpm ) ); + + msg = AddHotkeyName( _( "Duplicate" ), g_Module_Editor_Hokeys_Descr, + HK_DUPLICATE_ITEM ); + AddMenuItem( menu, ID_POPUP_PCB_DUPLICATE_ITEM, + msg, KiBitmap( duplicate_text_xpm ) ); + + msg = AddHotkeyName( _("Move Exactly" ), g_Module_Editor_Hokeys_Descr, + HK_MOVE_ITEM_EXACT ); + AddMenuItem( menu, ID_POPUP_PCB_MOVE_EXACT, + msg, KiBitmap( move_text_xpm ) ); + + msg = AddHotkeyName( _("Create Array" ), g_Module_Editor_Hokeys_Descr, + HK_CREATE_ARRAY ); + AddMenuItem( menu, ID_POPUP_PCB_CREATE_ARRAY, + msg, KiBitmap( array_text_xpm ) ); } msg = AddHotkeyName( _( "Rotate" ), g_Board_Editor_Hokeys_Descr, HK_ROTATE_ITEM ); diff --git a/pcbnew/pcb_base_edit_frame.cpp b/pcbnew/pcb_base_edit_frame.cpp index e4aa24108b..22a3ad4041 100644 --- a/pcbnew/pcb_base_edit_frame.cpp +++ b/pcbnew/pcb_base_edit_frame.cpp @@ -31,3 +31,18 @@ void PCB_BASE_EDIT_FRAME::SetRotationAngle( int aRotationAngle ) m_rotationAngle = aRotationAngle; } + + +bool PCB_BASE_EDIT_FRAME::PostCommandMenuEvent( int evt_type ) +{ + if( evt_type != 0 ) + { + wxCommandEvent evt( wxEVT_COMMAND_MENU_SELECTED ); + evt.SetEventObject( this ); + evt.SetId( evt_type ); + wxPostEvent( this, evt ); + return true; + } + + return false; +} diff --git a/pcbnew/pcb_base_edit_frame.h b/pcbnew/pcb_base_edit_frame.h index 3d867874d6..430fbdcab6 100644 --- a/pcbnew/pcb_base_edit_frame.h +++ b/pcbnew/pcb_base_edit_frame.h @@ -69,9 +69,19 @@ public: int GetRotationAngle() const { return m_rotationAngle; } void SetRotationAngle( int aRotationAngle ); + bool PostCommandMenuEvent( int evt_type ); + protected: /// User defined rotation angle (in tenths of a degree). int m_rotationAngle; + + /** + * Function createArray + * Create an array of the selected item (invokes the dialogue) + * This function is shared between pcbnew and modedit, as it is virtually + * the same + */ + void createArray(); }; #endif diff --git a/pcbnew/pcb_parser.cpp b/pcbnew/pcb_parser.cpp index b08e4527f6..c9e9247b16 100644 --- a/pcbnew/pcb_parser.cpp +++ b/pcbnew/pcb_parser.cpp @@ -168,7 +168,7 @@ bool PCB_PARSER::parseBool() throw( PARSE_ERROR ) } -wxPoint PCB_PARSER::parseXY() throw( PARSE_ERROR ) +wxPoint PCB_PARSER::parseXY() throw( PARSE_ERROR, IO_ERROR ) { if( CurTok() != T_LEFT ) NeedLEFT(); @@ -200,7 +200,7 @@ void PCB_PARSER::parseXY( int* aX, int* aY ) throw( PARSE_ERROR ) } -void PCB_PARSER::parseEDA_TEXT( EDA_TEXT* aText ) throw( PARSE_ERROR ) +void PCB_PARSER::parseEDA_TEXT( EDA_TEXT* aText ) throw( PARSE_ERROR, IO_ERROR ) { wxCHECK_RET( CurTok() == T_effects, wxT( "Cannot parse " ) + GetTokenString( CurTok() ) + wxT( " as EDA_TEXT." ) ); @@ -300,7 +300,7 @@ void PCB_PARSER::parseEDA_TEXT( EDA_TEXT* aText ) throw( PARSE_ERROR ) } -S3D_MASTER* PCB_PARSER::parse3DModel() throw( PARSE_ERROR ) +S3D_MASTER* PCB_PARSER::parse3DModel() throw( PARSE_ERROR, IO_ERROR ) { wxCHECK_MSG( CurTok() == T_model, NULL, wxT( "Cannot parse " ) + GetTokenString( CurTok() ) + wxT( " as S3D_MASTER." ) ); diff --git a/pcbnew/pcb_parser.h b/pcbnew/pcb_parser.h index d42081e409..d97b346930 100644 --- a/pcbnew/pcb_parser.h +++ b/pcbnew/pcb_parser.h @@ -172,7 +172,7 @@ class PCB_PARSER : public PCB_LEXER * @throw PARSE_ERROR if the coordinate pair syntax is incorrect. * @return A wxPoint object containing the coordinate pair. */ - wxPoint parseXY() throw( PARSE_ERROR ); + wxPoint parseXY() throw( PARSE_ERROR, IO_ERROR ); void parseXY( int* aX, int* aY ) throw( PARSE_ERROR ); @@ -183,9 +183,9 @@ class PCB_PARSER : public PCB_LEXER * @throw PARSE_ERROR if the text syntax is not valid. * @param aText A point to the #EDA_TEXT object to save the parsed settings into. */ - void parseEDA_TEXT( EDA_TEXT* aText ) throw( PARSE_ERROR ); + void parseEDA_TEXT( EDA_TEXT* aText ) throw( PARSE_ERROR, IO_ERROR ); - S3D_MASTER* parse3DModel() throw( PARSE_ERROR ); + S3D_MASTER* parse3DModel() throw( PARSE_ERROR, IO_ERROR ); /** * Function parseDouble @@ -219,7 +219,7 @@ class PCB_PARSER : public PCB_LEXER return KiROUND( parseDouble() * IU_PER_MM ); } - inline int parseBoardUnits( const char* aExpected ) throw( PARSE_ERROR ) + inline int parseBoardUnits( const char* aExpected ) throw( PARSE_ERROR, IO_ERROR ) { // Use here KiROUND, not KIROUND (see comments about them) // when having a function as argument, because it will be called twice @@ -227,7 +227,7 @@ class PCB_PARSER : public PCB_LEXER return KiROUND( parseDouble( aExpected ) * IU_PER_MM ); } - inline int parseBoardUnits( PCB_KEYS_T::T aToken ) throw( PARSE_ERROR ) + inline int parseBoardUnits( PCB_KEYS_T::T aToken ) throw( PARSE_ERROR, IO_ERROR ) { return parseBoardUnits( GetTokenText( aToken ) ); } diff --git a/pcbnew/pcbnew_id.h b/pcbnew/pcbnew_id.h index 830df53a88..6740e42484 100644 --- a/pcbnew/pcbnew_id.h +++ b/pcbnew/pcbnew_id.h @@ -62,6 +62,10 @@ enum pcbnew_ids ID_POPUP_PCB_ROTATE_PAD, ID_POPUP_PCB_MOVE_PAD_REQUEST, ID_POPUP_PCB_DRAG_PAD_REQUEST, + ID_POPUP_PCB_DUPLICATE_ITEM, + ID_POPUP_PCB_DUPLICATE_ITEM_AND_INCREMENT, + ID_POPUP_PCB_MOVE_EXACT, + ID_POPUP_PCB_CREATE_ARRAY, ID_POPUP_PCB_MOVE_TEXTMODULE_REQUEST, ID_POPUP_PCB_ROTATE_TEXTMODULE, @@ -347,6 +351,7 @@ enum pcbnew_ids ID_MODEDIT_TRANSFORM_MODULE, ID_MODEDIT_MODULE_ROTATE, ID_MODEDIT_MODULE_MIRROR, + ID_MODEDIT_MODULE_MOVE_EXACT, ID_MODEDIT_IMPORT_PART, ID_MODEDIT_EXPORT_PART, ID_MODEDIT_CREATE_NEW_LIB_AND_SAVE_CURRENT_PART, diff --git a/pcbnew/router/pns_shove.cpp b/pcbnew/router/pns_shove.cpp index 1338557f1a..f761e4e3ba 100644 --- a/pcbnew/router/pns_shove.cpp +++ b/pcbnew/router/pns_shove.cpp @@ -517,13 +517,16 @@ PNS_SHOVE::SHOVE_STATUS PNS_SHOVE::pushVia( PNS_VIA* aVia, const VECTOR2I& aForc m_currentNode->Remove( aVia ); m_currentNode->Add ( pushedVia ); +#ifdef DEBUG + m_logger.Log( aVia, 0, "obstacle-via" ); +#endif + if( aVia->BelongsTo( m_currentNode ) ) delete aVia; pushedVia->SetRank( aCurrentRank - 1 ); #ifdef DEBUG - m_logger.Log( aVia, 0, "obstacle-via" ); m_logger.Log( pushedVia, 1, "pushed-via" ); #endif diff --git a/pcbnew/specctra.cpp b/pcbnew/specctra.cpp index 91b13ccc82..0b7b1041d5 100644 --- a/pcbnew/specctra.cpp +++ b/pcbnew/specctra.cpp @@ -255,7 +255,7 @@ void SPECCTRA_DB::readTIME( time_t* time_stamp ) throw( IO_ERROR ) } -void SPECCTRA_DB::LoadPCB( const wxString& filename ) throw( IO_ERROR ) +void SPECCTRA_DB::LoadPCB( const wxString& filename ) throw( IO_ERROR, boost::bad_pointer ) { FILE_LINE_READER reader( filename ); @@ -274,7 +274,7 @@ void SPECCTRA_DB::LoadPCB( const wxString& filename ) throw( IO_ERROR ) } -void SPECCTRA_DB::LoadSESSION( const wxString& filename ) throw( IO_ERROR ) +void SPECCTRA_DB::LoadSESSION( const wxString& filename ) throw( IO_ERROR, boost::bad_pointer ) { FILE_LINE_READER reader( filename ); @@ -294,7 +294,7 @@ void SPECCTRA_DB::LoadSESSION( const wxString& filename ) throw( IO_ERROR ) } -void SPECCTRA_DB::doPCB( PCB* growth ) throw( IO_ERROR ) +void SPECCTRA_DB::doPCB( PCB* growth ) throw( IO_ERROR, boost::bad_pointer ) { T tok; @@ -799,7 +799,7 @@ void SPECCTRA_DB::doSTRUCTURE_OUT( STRUCTURE_OUT* growth ) throw( IO_ERROR, boos } -void SPECCTRA_DB::doKEEPOUT( KEEPOUT* growth ) throw( IO_ERROR ) +void SPECCTRA_DB::doKEEPOUT( KEEPOUT* growth ) throw( IO_ERROR, boost::bad_pointer ) { T tok = NextTok(); @@ -975,7 +975,7 @@ void SPECCTRA_DB::doWINDOW( WINDOW* growth ) throw( IO_ERROR ) } -void SPECCTRA_DB::doBOUNDARY( BOUNDARY* growth ) throw( IO_ERROR ) +void SPECCTRA_DB::doBOUNDARY( BOUNDARY* growth ) throw( IO_ERROR, boost::bad_pointer ) { T tok = NextTok(); @@ -1197,7 +1197,7 @@ void SPECCTRA_DB::doVIA( VIA* growth ) throw( IO_ERROR ) } -void SPECCTRA_DB::doCONTROL( CONTROL* growth ) throw( IO_ERROR ) +void SPECCTRA_DB::doCONTROL( CONTROL* growth ) throw( IO_ERROR, boost::bad_pointer ) { T tok; @@ -1521,7 +1521,7 @@ void SPECCTRA_DB::doPLACE_RULE( PLACE_RULE* growth, bool expect_object_type ) th #endif -void SPECCTRA_DB::doREGION( REGION* growth ) throw( IO_ERROR ) +void SPECCTRA_DB::doREGION( REGION* growth ) throw( IO_ERROR, boost::bad_pointer ) { T tok = NextTok(); @@ -1590,7 +1590,7 @@ void SPECCTRA_DB::doREGION( REGION* growth ) throw( IO_ERROR ) } -void SPECCTRA_DB::doCLASS_CLASS( CLASS_CLASS* growth ) throw( IO_ERROR ) +void SPECCTRA_DB::doCLASS_CLASS( CLASS_CLASS* growth ) throw( IO_ERROR, boost::bad_pointer ) { T tok = NextTok(); @@ -1748,7 +1748,7 @@ void SPECCTRA_DB::doLAYER_RULE( LAYER_RULE* growth ) throw( IO_ERROR ) } -void SPECCTRA_DB::doPLACE( PLACE* growth ) throw( IO_ERROR ) +void SPECCTRA_DB::doPLACE( PLACE* growth ) throw( IO_ERROR, boost::bad_pointer ) { T tok = NextTok(); @@ -1893,7 +1893,7 @@ void SPECCTRA_DB::doCOMPONENT( COMPONENT* growth ) throw( IO_ERROR, boost::bad_p } -void SPECCTRA_DB::doPLACEMENT( PLACEMENT* growth ) throw( IO_ERROR ) +void SPECCTRA_DB::doPLACEMENT( PLACEMENT* growth ) throw( IO_ERROR, boost::bad_pointer ) { T tok; @@ -1948,7 +1948,7 @@ void SPECCTRA_DB::doPLACEMENT( PLACEMENT* growth ) throw( IO_ERROR ) } -void SPECCTRA_DB::doPADSTACK( PADSTACK* growth ) throw( IO_ERROR ) +void SPECCTRA_DB::doPADSTACK( PADSTACK* growth ) throw( IO_ERROR, boost::bad_pointer ) { T tok = NextTok(); @@ -2048,7 +2048,7 @@ void SPECCTRA_DB::doPADSTACK( PADSTACK* growth ) throw( IO_ERROR ) } -void SPECCTRA_DB::doSHAPE( SHAPE* growth ) throw( IO_ERROR ) +void SPECCTRA_DB::doSHAPE( SHAPE* growth ) throw( IO_ERROR, boost::bad_pointer ) { T tok; @@ -2274,7 +2274,7 @@ void SPECCTRA_DB::doPIN( PIN* growth ) throw( IO_ERROR ) } -void SPECCTRA_DB::doLIBRARY( LIBRARY* growth ) throw( IO_ERROR ) +void SPECCTRA_DB::doLIBRARY( LIBRARY* growth ) throw( IO_ERROR, boost::bad_pointer ) { T tok; @@ -2468,7 +2468,7 @@ L_pins: } -void SPECCTRA_DB::doTOPOLOGY( TOPOLOGY* growth ) throw( IO_ERROR ) +void SPECCTRA_DB::doTOPOLOGY( TOPOLOGY* growth ) throw( IO_ERROR, boost::bad_pointer ) { T tok; @@ -2506,7 +2506,7 @@ void SPECCTRA_DB::doTOPOLOGY( TOPOLOGY* growth ) throw( IO_ERROR ) } -void SPECCTRA_DB::doCLASS( CLASS* growth ) throw( IO_ERROR ) +void SPECCTRA_DB::doCLASS( CLASS* growth ) throw( IO_ERROR, boost::bad_pointer ) { T tok; @@ -2679,7 +2679,7 @@ void SPECCTRA_DB::doCOMP_ORDER( COMP_ORDER* growth ) throw( IO_ERROR ) } -void SPECCTRA_DB::doFROMTO( FROMTO* growth ) throw( IO_ERROR ) +void SPECCTRA_DB::doFROMTO( FROMTO* growth ) throw( IO_ERROR, boost::bad_pointer ) { T tok; @@ -2990,7 +2990,7 @@ void SPECCTRA_DB::doWIRE_VIA( WIRE_VIA* growth ) throw( IO_ERROR ) } -void SPECCTRA_DB::doWIRING( WIRING* growth ) throw( IO_ERROR ) +void SPECCTRA_DB::doWIRING( WIRING* growth ) throw( IO_ERROR, boost::bad_pointer ) { T tok; @@ -3140,7 +3140,7 @@ void SPECCTRA_DB::doHISTORY( HISTORY* growth ) throw( IO_ERROR, boost::bad_point } -void SPECCTRA_DB::doSESSION( SESSION* growth ) throw( IO_ERROR ) +void SPECCTRA_DB::doSESSION( SESSION* growth ) throw( IO_ERROR, boost::bad_pointer ) { T tok; diff --git a/pcbnew/specctra.h b/pcbnew/specctra.h index b56c483333..4a50c4664d 100644 --- a/pcbnew/specctra.h +++ b/pcbnew/specctra.h @@ -3690,7 +3690,7 @@ class SPECCTRA_DB : public SPECCTRA_LEXER */ void readTIME( time_t* time_stamp ) throw( IO_ERROR ); - void doPCB( PCB* growth ) throw( IO_ERROR ); + void doPCB( PCB* growth ) throw( IO_ERROR, boost::bad_pointer ); void doPARSER( PARSER* growth ) throw( IO_ERROR ); void doRESOLUTION( UNIT_RES* growth ) throw( IO_ERROR ); void doUNIT( UNIT_RES* growth ) throw( IO_ERROR ); @@ -3698,44 +3698,44 @@ class SPECCTRA_DB : public SPECCTRA_LEXER void doSTRUCTURE_OUT( STRUCTURE_OUT* growth ) throw( IO_ERROR, boost::bad_pointer ); void doLAYER_NOISE_WEIGHT( LAYER_NOISE_WEIGHT* growth ) throw( IO_ERROR, boost::bad_pointer ); void doLAYER_PAIR( LAYER_PAIR* growth ) throw( IO_ERROR ); - void doBOUNDARY( BOUNDARY* growth ) throw( IO_ERROR ); + void doBOUNDARY( BOUNDARY* growth ) throw( IO_ERROR, boost::bad_pointer ); void doRECTANGLE( RECTANGLE* growth ) throw( IO_ERROR ); void doPATH( PATH* growth ) throw( IO_ERROR ); void doSTRINGPROP( STRINGPROP* growth ) throw( IO_ERROR ); void doTOKPROP( TOKPROP* growth ) throw( IO_ERROR ); void doVIA( VIA* growth ) throw( IO_ERROR ); - void doCONTROL( CONTROL* growth ) throw( IO_ERROR ); + void doCONTROL( CONTROL* growth ) throw( IO_ERROR, boost::bad_pointer ); void doLAYER( LAYER* growth ) throw( IO_ERROR ); void doRULE( RULE* growth ) throw( IO_ERROR ); - void doKEEPOUT( KEEPOUT* growth ) throw( IO_ERROR ); + void doKEEPOUT( KEEPOUT* growth ) throw( IO_ERROR, boost::bad_pointer ); void doCIRCLE( CIRCLE* growth ) throw( IO_ERROR ); void doQARC( QARC* growth ) throw( IO_ERROR ); void doWINDOW( WINDOW* growth ) throw( IO_ERROR ); void doCONNECT( CONNECT* growth ) throw( IO_ERROR ); - void doREGION( REGION* growth ) throw( IO_ERROR ); - void doCLASS_CLASS( CLASS_CLASS* growth ) throw( IO_ERROR ); + void doREGION( REGION* growth ) throw( IO_ERROR, boost::bad_pointer ); + void doCLASS_CLASS( CLASS_CLASS* growth ) throw( IO_ERROR, boost::bad_pointer ); void doLAYER_RULE( LAYER_RULE* growth ) throw( IO_ERROR ); void doCLASSES( CLASSES* growth ) throw( IO_ERROR ); void doGRID( GRID* growth ) throw( IO_ERROR ); - void doPLACE( PLACE* growth ) throw( IO_ERROR ); + void doPLACE( PLACE* growth ) throw( IO_ERROR, boost::bad_pointer ); void doCOMPONENT( COMPONENT* growth ) throw( IO_ERROR, boost::bad_pointer ); - void doPLACEMENT( PLACEMENT* growth ) throw( IO_ERROR ); + void doPLACEMENT( PLACEMENT* growth ) throw( IO_ERROR, boost::bad_pointer ); void doPROPERTIES( PROPERTIES* growth ) throw( IO_ERROR ); - void doPADSTACK( PADSTACK* growth ) throw( IO_ERROR ); - void doSHAPE( SHAPE* growth ) throw( IO_ERROR ); + void doPADSTACK( PADSTACK* growth ) throw( IO_ERROR, boost::bad_pointer ); + void doSHAPE( SHAPE* growth ) throw( IO_ERROR, boost::bad_pointer ); void doIMAGE( IMAGE* growth ) throw( IO_ERROR, boost::bad_pointer ); - void doLIBRARY( LIBRARY* growth ) throw( IO_ERROR ); + void doLIBRARY( LIBRARY* growth ) throw( IO_ERROR, boost::bad_pointer ); void doPIN( PIN* growth ) throw( IO_ERROR ); void doNET( NET* growth ) throw( IO_ERROR, boost::bad_pointer ); void doNETWORK( NETWORK* growth ) throw( IO_ERROR, boost::bad_pointer ); - void doCLASS( CLASS* growth ) throw( IO_ERROR ); - void doTOPOLOGY( TOPOLOGY* growth ) throw( IO_ERROR ); - void doFROMTO( FROMTO* growth ) throw( IO_ERROR ); + void doCLASS( CLASS* growth ) throw( IO_ERROR, boost::bad_pointer ); + void doTOPOLOGY( TOPOLOGY* growth ) throw( IO_ERROR, boost::bad_pointer ); + void doFROMTO( FROMTO* growth ) throw( IO_ERROR, boost::bad_pointer ); void doCOMP_ORDER( COMP_ORDER* growth ) throw( IO_ERROR ); void doWIRE( WIRE* growth ) throw( IO_ERROR, boost::bad_pointer ); void doWIRE_VIA( WIRE_VIA* growth ) throw( IO_ERROR ); - void doWIRING( WIRING* growth ) throw( IO_ERROR ); - void doSESSION( SESSION* growth ) throw( IO_ERROR ); + void doWIRING( WIRING* growth ) throw( IO_ERROR, boost::bad_pointer ); + void doSESSION( SESSION* growth ) throw( IO_ERROR, boost::bad_pointer ); void doANCESTOR( ANCESTOR* growth ) throw( IO_ERROR ); void doHISTORY( HISTORY* growth ) throw( IO_ERROR, boost::bad_pointer ); void doROUTE( ROUTE* growth ) throw( IO_ERROR, boost::bad_pointer ); @@ -3752,7 +3752,7 @@ class SPECCTRA_DB : public SPECCTRA_LEXER * @param aBoard The BOARD to get information from in order to make the BOUNDARY. * @param aBoundary The empty BOUNDARY to fill in. */ - void fillBOUNDARY( BOARD* aBoard, BOUNDARY* aBoundary ) throw( IO_ERROR ); + void fillBOUNDARY( BOARD* aBoard, BOUNDARY* aBoundary ) throw( IO_ERROR, boost::bad_pointer ); /** * Function makeIMAGE @@ -3895,7 +3895,7 @@ public: * @param filename The name of the dsn file to load. * @throw IO_ERROR if there is a lexer or parser error. */ - void LoadPCB( const wxString& filename ) throw( IO_ERROR ); + void LoadPCB( const wxString& filename ) throw( IO_ERROR, boost::bad_pointer ); /** * Function LoadSESSION @@ -3907,7 +3907,7 @@ public: * @param filename The name of the dsn file to load. * @throw IO_ERROR if there is a lexer or parser error. */ - void LoadSESSION( const wxString& filename ) throw( IO_ERROR ); + void LoadSESSION( const wxString& filename ) throw( IO_ERROR, boost::bad_pointer ); void ThrowIOError( const wxString& fmt, ... ) throw( IO_ERROR ); @@ -3933,7 +3933,7 @@ public: * * @param aBoard The BOARD to convert to a PCB. */ - void FromBOARD( BOARD* aBoard ) throw( IO_ERROR ); + void FromBOARD( BOARD* aBoard ) throw( IO_ERROR, boost::bad_ptr_container_operation ); /** * Function FromSESSION diff --git a/pcbnew/specctra_export.cpp b/pcbnew/specctra_export.cpp index ba47d5710c..1c6a548095 100644 --- a/pcbnew/specctra_export.cpp +++ b/pcbnew/specctra_export.cpp @@ -889,7 +889,8 @@ static void makeCircle( PATH* aPath, DRAWSEGMENT* aGraphic ) } -void SPECCTRA_DB::fillBOUNDARY( BOARD* aBoard, BOUNDARY* boundary ) throw( IO_ERROR ) +void SPECCTRA_DB::fillBOUNDARY( BOARD* aBoard, BOUNDARY* boundary ) + throw( IO_ERROR, boost::bad_pointer ) { PCB_TYPE_COLLECTOR items; @@ -1369,7 +1370,8 @@ typedef std::set STRINGSET; typedef std::pair STRINGSET_PAIR; -void SPECCTRA_DB::FromBOARD( BOARD* aBoard ) throw( IO_ERROR ) +void SPECCTRA_DB::FromBOARD( BOARD* aBoard ) + throw( IO_ERROR, boost::bad_ptr_container_operation ) { PCB_TYPE_COLLECTOR items; diff --git a/pcbnew/tools/common_actions.cpp b/pcbnew/tools/common_actions.cpp index c35372ea27..1d511a0558 100644 --- a/pcbnew/tools/common_actions.cpp +++ b/pcbnew/tools/common_actions.cpp @@ -56,7 +56,7 @@ TOOL_ACTION COMMON_ACTIONS::findDummy( "pcbnew.Find.Dummy", // only block the ho AS_GLOBAL, MD_CTRL + int( 'F' ) ); TOOL_ACTION COMMON_ACTIONS::findMove( "pcbnew.InteractiveSelection.FindMove", - AS_GLOBAL, 'T'); + AS_GLOBAL, 'T' ); // Edit tool actions @@ -64,6 +64,22 @@ TOOL_ACTION COMMON_ACTIONS::editActivate( "pcbnew.InteractiveEdit", AS_GLOBAL, 'M', "Move", "Moves the selected item(s)", AF_ACTIVATE ); +TOOL_ACTION COMMON_ACTIONS::duplicate( "pcbnew.InteractiveEdit.duplicate", + AS_GLOBAL, MD_CTRL + int( 'D' ), + "Duplicate", "Duplicates the selected item(s)" ); + +TOOL_ACTION COMMON_ACTIONS::duplicateIncrement( "pcbnew.InteractiveEdit.duplicateIncrementPads", + AS_GLOBAL, MD_CTRL + MD_SHIFT + int( 'D' ), + "Duplicate", "Duplicates the selected item(s), incrementing pad numbers" ); + +TOOL_ACTION COMMON_ACTIONS::moveExact( "pcbnew.InteractiveEdit.moveExact", + AS_GLOBAL, MD_CTRL + int( 'M' ), + "Move Exactly...", "Moves the selected item(s) by an exact amount" ); + +TOOL_ACTION COMMON_ACTIONS::createArray( "pcbnew.InteractiveEdit.createArray", + AS_GLOBAL, MD_CTRL + int( 'N' ), + "Create array", "Create array", AF_ACTIVATE ); + TOOL_ACTION COMMON_ACTIONS::rotate( "pcbnew.InteractiveEdit.rotate", AS_GLOBAL, 'R', "Rotate", "Rotates selected item(s)" ); diff --git a/pcbnew/tools/common_actions.h b/pcbnew/tools/common_actions.h index 73849a755e..b05e4d3c73 100644 --- a/pcbnew/tools/common_actions.h +++ b/pcbnew/tools/common_actions.h @@ -65,6 +65,15 @@ public: /// Activation of the edit tool static TOOL_ACTION properties; + /// Activation of the exact move tool + static TOOL_ACTION moveExact; + + /// Activation of the duplication tool + static TOOL_ACTION duplicate; + + /// Activation of the duplication tool with incrementing (e.g. pad number) + static TOOL_ACTION duplicateIncrement; + /// Deleting a BOARD_ITEM static TOOL_ACTION remove; @@ -204,6 +213,9 @@ public: /// Tool for quick pad enumeration static TOOL_ACTION enumeratePads; + /// Tool for creating an array of objects + static TOOL_ACTION createArray; + /// Copying module items to clipboard static TOOL_ACTION copyItems; diff --git a/pcbnew/tools/edit_tool.cpp b/pcbnew/tools/edit_tool.cpp index 1747a8be71..b602104af6 100644 --- a/pcbnew/tools/edit_tool.cpp +++ b/pcbnew/tools/edit_tool.cpp @@ -26,6 +26,8 @@ #include #include #include +#include +#include #include #include @@ -42,9 +44,13 @@ #include "selection_tool.h" #include "edit_tool.h" +#include +#include + EDIT_TOOL::EDIT_TOOL() : TOOL_INTERACTIVE( "pcbnew.InteractiveEdit" ), m_selectionTool( NULL ), - m_dragging( false ), m_editModules( false ), m_updateFlag( KIGFX::VIEW_ITEM::NONE ) + m_dragging( false ), m_editModules( false ), m_undoInhibit( 0 ), + m_updateFlag( KIGFX::VIEW_ITEM::NONE ) { } @@ -73,6 +79,9 @@ bool EDIT_TOOL::Init() m_selectionTool->AddMenuItem( COMMON_ACTIONS::flip, SELECTION_CONDITIONS::NotEmpty ); m_selectionTool->AddMenuItem( COMMON_ACTIONS::remove, SELECTION_CONDITIONS::NotEmpty ); m_selectionTool->AddMenuItem( COMMON_ACTIONS::properties, SELECTION_CONDITIONS::NotEmpty ); + m_selectionTool->AddMenuItem( COMMON_ACTIONS::moveExact, SELECTION_CONDITIONS::NotEmpty ); + m_selectionTool->AddMenuItem( COMMON_ACTIONS::duplicate, SELECTION_CONDITIONS::NotEmpty ); + m_selectionTool->AddMenuItem( COMMON_ACTIONS::createArray, SELECTION_CONDITIONS::NotEmpty ); m_offset.x = 0; m_offset.y = 0; @@ -112,6 +121,9 @@ int EDIT_TOOL::Main( const TOOL_EVENT& aEvent ) controls->SetSnapping( true ); controls->ForceCursorPosition( false ); + // cumulative translation + wxPoint totalMovement( 0, 0 ); + // Main loop: keep receiving events while( OPT_TOOL_EVENT evt = Wait() ) { @@ -147,9 +159,41 @@ int EDIT_TOOL::Main( const TOOL_EVENT& aEvent ) break; // exit the loop, as there is no further processing for removed items } + else if( evt->IsAction( &COMMON_ACTIONS::duplicate ) ) + { + // On duplicate, stop moving this item + // The duplicate tool should then select the new item and start + // a new move procedure + break; + } + else if( evt->IsAction( &COMMON_ACTIONS::moveExact ) ) + { + // Can't do this, because the selection will then contain + // stale pointers and it will all go horribly wrong... + //editFrame->RestoreCopyFromUndoList( dummy ); + // + // So, instead, reset the position manually + for( unsigned int i = 0; i < selection.items.GetCount(); ++i ) + { + BOARD_ITEM* item = selection.Item( i ); + item->SetPosition( item->GetPosition() - totalMovement ); + + // And what about flipping and rotation? + // for now, they won't be undone, but maybe that is how + // it should be, so you can flip and move exact in the + // same action? + } + + // This causes a double event, so we will get the dialogue + // correctly, somehow - why does Rotate not? + //MoveExact( aEvent ); + break; // exit the loop - we move exactly, so we have + // finished moving + } } - else if( evt->IsMotion() || evt->IsDrag( BUT_LEFT ) ) + else if( evt->IsAction( &COMMON_ACTIONS::editActivate ) + || evt->IsMotion() || evt->IsDrag( BUT_LEFT ) ) { m_cursor = controls->GetCursorPosition(); @@ -158,6 +202,8 @@ int EDIT_TOOL::Main( const TOOL_EVENT& aEvent ) wxPoint movement = wxPoint( m_cursor.x, m_cursor.y ) - selection.Item( 0 )->GetPosition(); + totalMovement += movement; + // Drag items to the current cursor position for( unsigned int i = 0; i < selection.items.GetCount(); ++i ) selection.Item( i )->Move( movement + m_offset ); @@ -170,8 +216,11 @@ int EDIT_TOOL::Main( const TOOL_EVENT& aEvent ) break; // Save items, so changes can be undone - editFrame->OnModify(); - editFrame->SaveCopyInUndoList( selection.items, UR_CHANGED ); + if( !isUndoInhibited() ) + { + editFrame->OnModify(); + editFrame->SaveCopyInUndoList( selection.items, UR_CHANGED ); + } if( selection.Size() == 1 ) { @@ -197,6 +246,7 @@ int EDIT_TOOL::Main( const TOOL_EVENT& aEvent ) controls->SetAutoPan( true ); m_dragging = true; + incUndoInhibit(); } selection.group->ViewUpdate( KIGFX::VIEW_ITEM::GEOMETRY ); @@ -207,6 +257,9 @@ int EDIT_TOOL::Main( const TOOL_EVENT& aEvent ) break; // Finish } + if( m_dragging ) + decUndoInhibit(); + m_dragging = false; m_offset.x = 0; m_offset.y = 0; @@ -326,7 +379,8 @@ int EDIT_TOOL::Rotate( const TOOL_EVENT& aEvent ) wxPoint rotatePoint = getModificationPoint( selection ); - if( !m_dragging ) // If it is being dragged, then it is already saved with UR_CHANGED flag + // If it is being dragged, then it is already saved with UR_CHANGED flag + if( !isUndoInhibited() ) { editFrame->OnModify(); editFrame->SaveCopyInUndoList( selection.items, UR_ROTATED, rotatePoint ); @@ -380,7 +434,7 @@ int EDIT_TOOL::Flip( const TOOL_EVENT& aEvent ) wxPoint flipPoint = getModificationPoint( selection ); - if( !m_dragging ) // If it is being dragged, then it is already saved with UR_CHANGED flag + if( !isUndoInhibited() ) // If it is being dragged, then it is already saved with UR_CHANGED flag { editFrame->OnModify(); editFrame->SaveCopyInUndoList( selection.items, UR_FLIPPED, flipPoint ); @@ -534,6 +588,320 @@ void EDIT_TOOL::remove( BOARD_ITEM* aItem ) } +int EDIT_TOOL::MoveExact( const TOOL_EVENT& aEvent ) +{ + const SELECTION& selection = m_selectionTool->GetSelection(); + + // Shall the selection be cleared at the end? + bool unselect = selection.Empty(); + + if( !makeSelection( selection ) || m_selectionTool->CheckLock() ) + { + setTransitions(); + + return 0; + } + + wxPoint translation; + double rotation = 0; + + PCB_BASE_FRAME* editFrame = getEditFrame(); + + DIALOG_MOVE_EXACT dialog( editFrame, translation, rotation ); + int ret = dialog.ShowModal(); + + if( ret == DIALOG_MOVE_EXACT::MOVE_OK ) + { + if( !isUndoInhibited() ) + { + editFrame->OnModify(); + // Record an action of move and rotate + editFrame->SaveCopyInUndoList( selection.items, UR_CHANGED ); + } + + VECTOR2I rp = selection.GetCenter(); + wxPoint rotPoint( rp.x, rp.y ); + + for( unsigned int i = 0; i < selection.items.GetCount(); ++i ) + { + BOARD_ITEM* item = selection.Item( i ); + + item->Move( translation ); + item->Rotate( rotPoint, rotation ); + + if( !m_dragging ) + item->ViewUpdate( KIGFX::VIEW_ITEM::GEOMETRY ); + } + + updateRatsnest( m_dragging ); + + if( m_dragging ) + selection.group->ViewUpdate( KIGFX::VIEW_ITEM::GEOMETRY ); + else + getModel()->GetRatsnest()->Recalculate(); + + if( unselect ) + m_toolMgr->RunAction( COMMON_ACTIONS::selectionClear, true ); + + m_toolMgr->RunAction( COMMON_ACTIONS::pointEditorUpdate, true ); + } + + setTransitions(); + + return 0; +} + + +int EDIT_TOOL::Duplicate( const TOOL_EVENT& aEvent ) +{ + bool increment = aEvent.IsAction( &COMMON_ACTIONS::duplicateIncrement ); + + // first, check if we have a selection, or try to get one + SELECTION_TOOL* selTool = m_toolMgr->GetTool(); + const SELECTION& selection = selTool->GetSelection(); + + // Be sure that there is at least one item that we can modify + if( !makeSelection( selection ) || selTool->CheckLock() ) + { + setTransitions(); + return 0; + } + + // we have a selection to work on now, so start the tool process + + PCB_BASE_FRAME* editFrame = getEditFrame(); + editFrame->OnModify(); + + // prevent other tools making undo points while the duplicate is going on + // so that if you cancel, you don't get a duplicate object hiding over + // the original + incUndoInhibit(); + + std::vector old_items; + + for( int i = 0; i < selection.Size(); ++i ) + { + BOARD_ITEM* item = selection.Item( i ); + + if( item ) + old_items.push_back( item ); + } + + for( unsigned i = 0; i < old_items.size(); ++i ) + { + BOARD_ITEM* item = old_items[i]; + + // Unselect the item, so we won't pick it up again + // Do this first, so a single-item duplicate will correctly call + // SetCurItem and show the item properties + m_toolMgr->RunAction( COMMON_ACTIONS::unselectItem, true, item ); + + BOARD_ITEM* new_item = NULL; + + if( m_editModules ) + new_item = editFrame->GetBoard()->m_Modules->DuplicateAndAddItem( item, increment ); + else + new_item = editFrame->GetBoard()->DuplicateAndAddItem( item, increment ); + + if( new_item ) + { + if( new_item->Type() == PCB_MODULE_T ) + { + static_cast( new_item )->RunOnChildren( boost::bind( &KIGFX::VIEW::Add, + getView(), _1 ) ); + } + + editFrame->GetGalCanvas()->GetView()->Add( new_item ); + + // Select the new item, so we can pick it up + m_toolMgr->RunAction( COMMON_ACTIONS::selectItem, true, new_item ); + } + } + + // record the new items as added + editFrame->SaveCopyInUndoList( selection.items, UR_NEW ); + + editFrame->DisplayToolMsg( wxString::Format( _( "Duplicated %d item(s)" ), + (int) old_items.size() ) ); + + // pick up the selected item(s) and start moving + // this works well for "dropping" copies around + TOOL_EVENT evt = COMMON_ACTIONS::editActivate.MakeEvent(); + Main( evt ); + + // and re-enable undos + decUndoInhibit(); + + setTransitions(); + + return 0; +} + + +int EDIT_TOOL::CreateArray( const TOOL_EVENT& aEvent ) +{ + // first, check if we have a selection, or try to get one + SELECTION_TOOL* selTool = m_toolMgr->GetTool(); + const SELECTION& selection = selTool->GetSelection(); + + // Be sure that there is at least one item that we can modify + if( !makeSelection( selection ) || selTool->CheckLock() ) + { + setTransitions(); + return 0; + } + + bool originalItemsModified = false; + + // we have a selection to work on now, so start the tool process + + PCB_BASE_FRAME* editFrame = getEditFrame(); + editFrame->OnModify(); + + if( m_editModules ) + { + // Module editors do their undo point upfront for the whole module + editFrame->SaveCopyInUndoList( editFrame->GetBoard()->m_Modules, UR_MODEDIT ); + } + else + { + // We may also change the original item + editFrame->SaveCopyInUndoList( selection.items, UR_CHANGED ); + } + + DIALOG_CREATE_ARRAY::ARRAY_OPTIONS* array_opts = NULL; + + VECTOR2I rp = selection.GetCenter(); + const wxPoint rotPoint( rp.x, rp.y ); + + DIALOG_CREATE_ARRAY dialog( editFrame, rotPoint, &array_opts ); + int ret = dialog.ShowModal(); + + if( ret == DIALOG_CREATE_ARRAY::CREATE_ARRAY_OK && array_opts != NULL ) + { + PICKED_ITEMS_LIST newItemList; + + for( int i = 0; i < selection.Size(); ++i ) + { + BOARD_ITEM* item = selection.Item( i ); + + if( !item ) + continue; + + wxString cachedString; + + if( item->Type() == PCB_MODULE_T ) + { + cachedString = static_cast( item )->GetReferencePrefix(); + } + else if( EDA_TEXT* text = dynamic_cast( item ) ) + { + // Copy the text (not just take a reference + cachedString = text->GetText(); + } + + // iterate across the array, laying out the item at the + // correct position + const unsigned nPoints = array_opts->GetArraySize(); + + for( unsigned ptN = 0; ptN < nPoints; ++ptN ) + { + BOARD_ITEM* newItem = NULL; + + if( ptN == 0 ) + { + newItem = item; + } + else + { + // if renumbering, no need to increment + const bool increment = !array_opts->ShouldRenumberItems(); + + if( m_editModules ) + newItem = editFrame->GetBoard()->m_Modules->DuplicateAndAddItem( item, increment ); + else + newItem = editFrame->GetBoard()->DuplicateAndAddItem( item, increment ); + + if( newItem ) + { + array_opts->TransformItem( ptN, newItem, rotPoint ); + + m_toolMgr->RunAction( COMMON_ACTIONS::unselectItem, true, newItem ); + + newItemList.PushItem( newItem ); + + if( newItem->Type() == PCB_MODULE_T) + { + static_cast( newItem )->RunOnChildren( boost::bind( &KIGFX::VIEW::Add, + getView(), _1 ) ); + } + + editFrame->GetGalCanvas()->GetView()->Add( newItem ); + getModel()->GetRatsnest()->Update( newItem ); + } + } + + // set the number if needed: + if( array_opts->ShouldRenumberItems() ) + { + switch( newItem->Type() ) + { + case PCB_PAD_T: + { + const wxString padName = array_opts->GetItemNumber( ptN ); + static_cast( newItem )->SetPadName( padName ); + + originalItemsModified = true; + break; + } + case PCB_MODULE_T: + { + const wxString moduleName = array_opts->GetItemNumber( ptN ); + MODULE* module = static_cast( newItem ); + module->SetReference( cachedString + moduleName ); + + originalItemsModified = true; + break; + } + case PCB_MODULE_TEXT_T: + case PCB_TEXT_T: + { + EDA_TEXT* text = dynamic_cast( newItem ); + text->SetText( array_opts->InterpolateNumberIntoString( ptN, cachedString ) ); + + originalItemsModified = true; + break; + } + default: + // no renumbering of other items + break; + } + } + } + } + + if( !m_editModules ) + { + if( originalItemsModified ) + { + // Update the appearance of the original items + selection.group->ItemsViewUpdate( KIGFX::VIEW_ITEM::GEOMETRY ); + } + + // Add all items as a single undo point for PCB editors + // TODO: Can this be merged into the previous undo point (where + // we saved the original items) + editFrame->SaveCopyInUndoList( newItemList, UR_NEW ); + } + } + + getModel()->GetRatsnest()->Recalculate(); + setTransitions(); + + return 0; +} + + void EDIT_TOOL::setTransitions() { Go( &EDIT_TOOL::Main, COMMON_ACTIONS::editActivate.MakeEvent() ); @@ -541,6 +909,10 @@ void EDIT_TOOL::setTransitions() Go( &EDIT_TOOL::Flip, COMMON_ACTIONS::flip.MakeEvent() ); Go( &EDIT_TOOL::Remove, COMMON_ACTIONS::remove.MakeEvent() ); Go( &EDIT_TOOL::Properties, COMMON_ACTIONS::properties.MakeEvent() ); + Go( &EDIT_TOOL::MoveExact, COMMON_ACTIONS::moveExact.MakeEvent() ); + Go( &EDIT_TOOL::Duplicate, COMMON_ACTIONS::duplicate.MakeEvent() ); + Go( &EDIT_TOOL::Duplicate, COMMON_ACTIONS::duplicateIncrement.MakeEvent() ); + Go( &EDIT_TOOL::CreateArray,COMMON_ACTIONS::createArray.MakeEvent() ); } diff --git a/pcbnew/tools/edit_tool.h b/pcbnew/tools/edit_tool.h index ca50fc01ec..ce2e9d957f 100644 --- a/pcbnew/tools/edit_tool.h +++ b/pcbnew/tools/edit_tool.h @@ -91,6 +91,28 @@ public: */ int Remove( const TOOL_EVENT& aEvent ); + /** + * Function Duplicate() + * + * Duplicates a selection and starts a move action + */ + int Duplicate( const TOOL_EVENT& aEvent ); + + /** + * Function MoveExact() + * + * Invokes a dialog box to allow moving of the item by an exact amount. + */ + int MoveExact( const TOOL_EVENT& aEvent ); + + /** + * Function CreateArray() + * + * Creates an array of the selected items, invoking the array editor dialog + * to set the array options + */ + int CreateArray( const TOOL_EVENT& aEvent ); + /** * Function EditModules() * @@ -120,6 +142,9 @@ private: /// Edit module mode flag bool m_editModules; + /// Counter of undo inhibitions. When zero, undo is not inhibited. + int m_undoInhibit; + ///> Removes and frees a single BOARD_ITEM. void remove( BOARD_ITEM* aItem ); @@ -151,6 +176,40 @@ private: ///> Updates view with the changes in the list. void processChanges( const PICKED_ITEMS_LIST* aList ); + + /** + * Increments the undo inhibit counter. This will indicate that tools + * should not create an undo point, as another tool is doing it already, + * and considers that its operation is atomic, even if it calls another one + * (for example a duplicate calls a move). + */ + inline void incUndoInhibit() + { + m_undoInhibit++; + } + + /** + * Decrements the inhibit counter. An assert is raised if the counter drops + * below zero. + */ + inline void decUndoInhibit() + { + m_undoInhibit--; + + wxASSERT_MSG( m_undoInhibit >= 0, wxT( "Undo inhibit count decremented past zero" ) ); + } + + /** + * Report if the tool manager has been told at least once that undo + * points should not be created. This can be ignored if the undo point + * is still required. + * + * @return true if undo are inhibited + */ + inline bool isUndoInhibited() const + { + return m_undoInhibit > 0; + } }; #endif diff --git a/pcbnew/tools/module_tools.cpp b/pcbnew/tools/module_tools.cpp index fb05448385..1d32d17b8b 100644 --- a/pcbnew/tools/module_tools.cpp +++ b/pcbnew/tools/module_tools.cpp @@ -1,7 +1,7 @@ /* * This program source code file is part of KiCad, a free EDA CAD application. * - * Copyright (C) 2014 CERN + * Copyright (C) 2014-2015 CERN * @author Maciej Suminski * * This program is free software; you can redistribute it and/or @@ -82,44 +82,6 @@ bool MODULE_TOOLS::Init() } -static wxString getNextPadName( MODULE* aModule ) -{ - std::set usedNumbers; - - // Create a set of used pad numbers - for( D_PAD* pad = aModule->Pads(); pad; pad = pad->Next() ) - { - wxString padName = pad->GetPadName(); - int padNumber = 0; - int base = 1; - - // Trim and extract the trailing numeric part - while( padName.Len() && padName.Last() >= '0' && padName.Last() <= '9' ) - { - padNumber += ( padName.Last() - '0' ) * base; - padName.RemoveLast(); - base *= 10; - } - - usedNumbers.insert( padNumber ); - } - - int candidate = *usedNumbers.begin(); - - // Look for a gap in pad numbering - for( std::set::iterator it = usedNumbers.begin(), - itEnd = usedNumbers.end(); it != itEnd; ++it ) - { - if( *it - candidate > 1 ) - break; - - candidate = *it; - } - - return wxString::Format( wxT( "%i" ), ++candidate ); -} - - int MODULE_TOOLS::PlacePad( const TOOL_EVENT& aEvent ) { m_frame->SetToolID( ID_MODEDIT_PAD_TOOL, wxCURSOR_PENCIL, _( "Add pads" ) ); @@ -190,14 +152,8 @@ int MODULE_TOOLS::PlacePad( const TOOL_EVENT& aEvent ) // ( pad position for module orient, 0, and relative to the module position) pad->SetLocalCoord(); - /* NPTH pads take empty pad number (since they can't be connected), - * other pads get incremented from the last one edited */ - wxString padName; - - if( pad->GetAttribute() != PAD_HOLE_NOT_PLATED ) - padName = getNextPadName( module ); - - pad->SetPadName( padName ); + // Take the next available pad number + pad->IncrementPadName( true, true ); // Handle the view aspect preview.Remove( pad ); @@ -239,7 +195,7 @@ int MODULE_TOOLS::EnumeratePads( const TOOL_EVENT& aEvent ) guide.SetIgnoreModulesVals( true ); guide.SetIgnoreModulesRefs( true ); - // Create a set containing all pads (to avoid double adding to a list) + // Create a set containing all pads (to avoid double adding to the list) for( D_PAD* p = module->Pads(); p; p = p->Next() ) allPads.insert( p ); @@ -261,42 +217,76 @@ int MODULE_TOOLS::EnumeratePads( const TOOL_EVENT& aEvent ) m_toolMgr->RunAction( COMMON_ACTIONS::selectionClear, true ); m_controls->ShowCursor( true ); + VECTOR2I oldCursorPos = m_controls->GetCursorPosition(); + std::list selectedPads; while( OPT_TOOL_EVENT evt = Wait() ) { if( evt->IsDrag( BUT_LEFT ) || evt->IsClick( BUT_LEFT ) ) { - // Add pads to the list according to the selection order + selectedPads.clear(); VECTOR2I cursorPos = m_controls->GetCursorPosition(); - collector.Empty(); - collector.Collect( m_board, types, wxPoint( cursorPos.x, cursorPos.y ), guide ); - - for( int i = 0; i < collector.GetCount(); ++i ) + if( evt->IsClick( BUT_LEFT ) ) { - if( collector[i]->Type() == PCB_PAD_T ) + oldCursorPos = m_controls->GetCursorPosition(); + collector.Empty(); + collector.Collect( m_board, types, wxPoint( cursorPos.x, cursorPos.y ), guide ); + + for( int i = 0; i < collector.GetCount(); ++i ) { - D_PAD* pad = static_cast( collector[i] ); - - std::set::iterator it = allPads.find( pad ); - - // Add the pad to the list, if it was not selected previously.. - if( it != allPads.end() ) - { - allPads.erase( it ); - pads.push_back( pad ); - pad->SetSelected(); - } - - // ..or remove it from the list if it was clicked - else if( evt->IsClick( BUT_LEFT ) ) - { - allPads.insert( pad ); - pads.remove( pad ); - pad->ClearSelected(); - } + if( collector[i]->Type() == PCB_PAD_T ) + selectedPads.push_back( static_cast( collector[i] ) ); } } + else //evt->IsDrag( BUT_LEFT ) + { + // wxWidgets deliver mouse move events not frequently enough, resulting in skipping + // pads if the user moves cursor too fast. To solve it, create a line that approximates + // the mouse move and select items intersecting with the line. + int distance = ( cursorPos - oldCursorPos ).EuclideanNorm(); + int segments = distance / 100000 + 1; + const wxPoint LINE_STEP( ( cursorPos - oldCursorPos ).x / segments, + ( cursorPos - oldCursorPos ).y / segments ); + + collector.Empty(); + for( int j = 0; j < segments; ++j ) { + collector.Collect( m_board, types, + wxPoint( oldCursorPos.x, oldCursorPos.y ) + j * LINE_STEP, + guide ); + + for( int i = 0; i < collector.GetCount(); ++i ) + { + if( collector[i]->Type() == PCB_PAD_T ) + selectedPads.push_back( static_cast( collector[i] ) ); + } + } + + selectedPads.unique(); + } + + BOOST_FOREACH( D_PAD* pad, selectedPads ) + { + std::set::iterator it = allPads.find( pad ); + + // Add the pad to the list, if it was not selected previously.. + if( it != allPads.end() ) + { + allPads.erase( it ); + pads.push_back( pad ); + pad->SetSelected(); + } + + // ..or remove it from the list if it was clicked + else if( evt->IsClick( BUT_LEFT ) ) + { + allPads.insert( pad ); + pads.remove( pad ); + pad->ClearSelected(); + } + } + + oldCursorPos = cursorPos; } else if( ( evt->IsKeyPressed() && evt->KeyCode() == WXK_RETURN ) || diff --git a/pcbnew/tools/module_tools.h b/pcbnew/tools/module_tools.h index e969126625..8b001d7518 100644 --- a/pcbnew/tools/module_tools.h +++ b/pcbnew/tools/module_tools.h @@ -77,6 +77,13 @@ public: */ int PasteItems( const TOOL_EVENT& aEvent ); + /** + * Function CreateArray + * + * Creates an array of objects using settings from a dialog + */ + int CreateArray( TOOL_EVENT& aEvent ); + /** * Function ModuleTextOutlines() * diff --git a/pcbnew/tools/selection_tool.cpp b/pcbnew/tools/selection_tool.cpp index fbbec3e43f..dc9832a17d 100644 --- a/pcbnew/tools/selection_tool.cpp +++ b/pcbnew/tools/selection_tool.cpp @@ -931,6 +931,30 @@ void SELECTION::clear() } +VECTOR2I SELECTION::GetCenter() const +{ + VECTOR2I centre; + + if( Size() == 1 ) + { + centre = Item( 0 )->GetCenter(); + } + else + { + EDA_RECT bbox = Item( 0 )->GetBoundingBox(); + for( unsigned int i = 1; i < items.GetCount(); ++i ) + { + BOARD_ITEM* item = Item( i ); + bbox.Merge( item->GetBoundingBox() ); + } + + centre = bbox.Centre(); + } + + return centre; +} + + const TOOL_EVENT SELECTION_TOOL::SelectedEvent( TC_MESSAGE, TA_ACTION, "pcbnew.InteractiveSelection.selected" ); const TOOL_EVENT SELECTION_TOOL::UnselectedEvent( TC_MESSAGE, TA_ACTION, "pcbnew.InteractiveSelection.unselected" ); const TOOL_EVENT SELECTION_TOOL::ClearedEvent( TC_MESSAGE, TA_ACTION, "pcbnew.InteractiveSelection.cleared" ); diff --git a/pcbnew/tools/selection_tool.h b/pcbnew/tools/selection_tool.h index b90ff268e9..ad6e03e6c3 100644 --- a/pcbnew/tools/selection_tool.h +++ b/pcbnew/tools/selection_tool.h @@ -70,6 +70,8 @@ struct SELECTION return static_cast( items.GetPickedItem( aIndex ) ); } + VECTOR2I GetCenter() const; + private: /// Clears both the VIEW_GROUP and set of selected items. Please note that it does not /// change properties of selected items (e.g. selection flag). diff --git a/utils/idftools/idf_common.cpp b/utils/idftools/idf_common.cpp index 948bf23c66..0d0a24bbb0 100644 --- a/utils/idftools/idf_common.cpp +++ b/utils/idftools/idf_common.cpp @@ -950,7 +950,7 @@ void IDF3::GetOutline( std::list& aLines, PrintSeg( *bl ); #endif aOutline.push( *bl ); - aLines.erase( bl ); + bl = aLines.erase( bl ); } continue; @@ -982,7 +982,7 @@ void IDF3::GetOutline( std::list& aLines, printSeg( *bl ); #endif aOutline.push( *bl ); - aLines.erase( bl ); + bl = aLines.erase( bl ); } continue; diff --git a/utils/idftools/idf_cylinder.cpp b/utils/idftools/idf_cylinder.cpp index 3c164f7ead..de39d045b4 100644 --- a/utils/idftools/idf_cylinder.cpp +++ b/utils/idftools/idf_cylinder.cpp @@ -426,14 +426,13 @@ void make_vcyl( bool inch, bool axial, double dia, double length, void make_hcyl( bool inch, bool axial, double dia, double length, double z, double wireDia ) { - bool ok = false; stringstream tstr; string line; double pitch = 0.0; double lead = 0.0; // lead length for radial leads - ok = false; + bool ok = false; while( !ok ) { if( axial ) diff --git a/utils/idftools/idf_outlines.cpp b/utils/idftools/idf_outlines.cpp index bd1e2a3a44..3d2cfa303d 100644 --- a/utils/idftools/idf_outlines.cpp +++ b/utils/idftools/idf_outlines.cpp @@ -377,7 +377,7 @@ void BOARD_OUTLINE::readOutlines( std::ifstream& aBoardFile, IDF3::IDF_VERSION a } // verify winding of previous outline - if( ( loopidx = 0 && !op->IsCCW() ) + if( ( loopidx == 0 && !op->IsCCW() ) || ( loopidx > 0 && op->IsCCW() ) ) { ostringstream ostr; @@ -2232,10 +2232,11 @@ PLACE_OUTLINE::PLACE_OUTLINE( IDF3_BOARD* aParent ) setParent( aParent ); outlineType = OTLN_PLACE; single = true; - thickness = 0.0; + thickness = -1.0; side = LYR_INVALID; } + bool PLACE_OUTLINE::SetSide( IDF3::IDF_LAYER aSide ) { #ifndef DISABLE_IDF_OWNERSHIP @@ -2424,64 +2425,74 @@ void PLACE_OUTLINE::readData( std::ifstream& aBoardFile, const std::string& aHea throw( IDF_ERROR( __FILE__, __FUNCTION__, __LINE__, ostr.str() ) ); } - if( !GetIDFString( iline, token, quoted, idx ) ) + if( GetIDFString( iline, token, quoted, idx ) ) { - ostringstream ostr; + std::stringstream teststr; + teststr << token; - ostr << "\n* invalid outline: " << GetOutlineTypeString( outlineType ) << "\n"; - ostr << "* violation: no height specified\n"; - ostr << "* line: '" << iline << "'\n"; - ostr << "* file position: " << pos; + teststr >> thickness; + + if( teststr.fail() ) + { + ostringstream ostr; + + ostr << "\n* invalid outline: " << GetOutlineTypeString( outlineType ) << "\n"; + ostr << "* violation: invalid height\n"; + ostr << "* line: '" << iline << "'\n"; + ostr << "* file position: " << pos; + + throw( IDF_ERROR( __FILE__, __FUNCTION__, __LINE__, ostr.str() ) ); + } + + if( thickness < 0.0 ) + { + ostringstream ostr; + + ostr << "\n* invalid outline: " << GetOutlineTypeString( outlineType ) << "\n"; + ostr << "* violation: thickness < 0\n"; + ostr << "* line: '" << iline << "'\n"; + ostr << "* file position: " << pos; + + throw( IDF_ERROR( __FILE__, __FUNCTION__, __LINE__, ostr.str() ) ); + } + + if( unit == UNIT_THOU ) + { + thickness *= IDF_THOU_TO_MM; + } + else if( ( aIdfVersion == IDF_V2 ) && ( unit == UNIT_TNM ) ) + { + thickness *= IDF_TNM_TO_MM; + } + else if( unit != UNIT_MM ) + { + ostringstream ostr; + ostr << "\n* BUG: invalid UNIT type: " << unit; + + throw( IDF_ERROR( __FILE__, __FUNCTION__, __LINE__, ostr.str() ) ); + } + + if( thickness < 0.0 ) + thickness = 0.0; - throw( IDF_ERROR( __FILE__, __FUNCTION__, __LINE__, ostr.str() ) ); } - - std::stringstream teststr; - teststr << token; - - teststr >> thickness; - if( teststr.fail() ) + else { - ostringstream ostr; + // for OTLN_PLACE, thickness may be omitted, but is required for OTLN_PLACE_KEEPOUT + if( outlineType == OTLN_PLACE_KEEPOUT ) + { + ostringstream ostr; - ostr << "\n* invalid outline: " << GetOutlineTypeString( outlineType ) << "\n"; - ostr << "* violation: invalid height\n"; - ostr << "* line: '" << iline << "'\n"; - ostr << "* file position: " << pos; + ostr << "\n* invalid outline: " << GetOutlineTypeString( outlineType ) << "\n"; + ostr << "* violation: missing thickness\n"; + ostr << "* line: '" << iline << "'\n"; + ostr << "* file position: " << pos; - throw( IDF_ERROR( __FILE__, __FUNCTION__, __LINE__, ostr.str() ) ); + throw( IDF_ERROR( __FILE__, __FUNCTION__, __LINE__, ostr.str() ) ); + } + + thickness = -1.0; } - - if( thickness < 0.0 ) - { - ostringstream ostr; - - ostr << "\n* invalid outline: " << GetOutlineTypeString( outlineType ) << "\n"; - ostr << "* violation: thickness < 0\n"; - ostr << "* line: '" << iline << "'\n"; - ostr << "* file position: " << pos; - - throw( IDF_ERROR( __FILE__, __FUNCTION__, __LINE__, ostr.str() ) ); - } - - if( unit == UNIT_THOU ) - { - thickness *= IDF_THOU_TO_MM; - } - else if( ( aIdfVersion == IDF_V2 ) && ( unit == UNIT_TNM ) ) - { - thickness *= IDF_TNM_TO_MM; - } - else if( unit != UNIT_MM ) - { - ostringstream ostr; - ostr << "\n* BUG: invalid UNIT type: " << unit; - - throw( IDF_ERROR( __FILE__, __FUNCTION__, __LINE__, ostr.str() ) ); - } - - if( thickness < 0.0 ) - thickness = 0.0; } else { @@ -2574,12 +2585,20 @@ void PLACE_OUTLINE::writeData( std::ofstream& aBoardFile ) break; } - aBoardFile << " "; - - if( unit != UNIT_THOU ) - aBoardFile << setiosflags(ios::fixed) << setprecision(5) << thickness << "\n"; + // thickness is optional for OTLN_PLACE, but mandatory for OTLN_PLACE_KEEPOUT + if( thickness < 0.0 && outlineType == OTLN_PLACE_KEEPOUT) + { + aBoardFile << "\n"; + } else - aBoardFile << setiosflags(ios::fixed) << setprecision(1) << (thickness / IDF_THOU_TO_MM) << "\n"; + { + aBoardFile << " "; + + if( unit != UNIT_THOU ) + aBoardFile << setiosflags(ios::fixed) << setprecision(5) << thickness << "\n"; + else + aBoardFile << setiosflags(ios::fixed) << setprecision(1) << (thickness / IDF_THOU_TO_MM) << "\n"; + } // write RECORD 3 writeOutlines( aBoardFile ); diff --git a/utils/idftools/idf_outlines.h b/utils/idftools/idf_outlines.h index d52c9ff052..33957e7d84 100644 --- a/utils/idftools/idf_outlines.h +++ b/utils/idftools/idf_outlines.h @@ -498,7 +498,6 @@ private: protected: IDF3::IDF_LAYER side; // Board Side [TOP/BOTTOM/BOTH ONLY] (IDF spec) - double height; // Max Height (IDF spec) public: PLACE_OUTLINE( IDF3_BOARD* aParent ); diff --git a/utils/idftools/idf_parser.cpp b/utils/idftools/idf_parser.cpp index cd662b12fc..68a45d7f7c 100644 --- a/utils/idftools/idf_parser.cpp +++ b/utils/idftools/idf_parser.cpp @@ -1050,9 +1050,7 @@ bool IDF3_COMPONENT::DelDrill( double aDia, double aXpos, double aYpos ) { val = true; delete *itS; - drills.erase( itS ); - itS = drills.begin(); - itE = drills.end(); + itS = drills.erase( itS ); continue; } ++itS; @@ -1341,6 +1339,7 @@ IDF3_BOARD::IDF3_BOARD( IDF3::CAD_TYPE aCadType ) brdFileVersion = 0; libFileVersion = 0; iRefDes = 0; + unit = UNIT_MM; // unlike other outlines which are created as necessary, // the board outline always exists and its parent must @@ -2002,14 +2001,13 @@ void IDF3_BOARD::readBrdSection( std::ifstream& aBoardFile, IDF3::FILE_STATE& aB if( olnOther.insert( pair(op->GetOutlineIdentifier(), op) ).second == false ) { - delete op; - ostringstream ostr; ostr << "invalid IDF file\n"; ostr << "* Violation of specification. Non-unique ID in OTHER_OUTLINE '"; ostr << op->GetOutlineIdentifier() << "'\n"; ostr << "* line: '" << iline << "'\n"; ostr << "* pos: " << pos; + delete op; throw( IDF_ERROR( __FILE__, __FUNCTION__, __LINE__, ostr.str() ) ); } @@ -2427,12 +2425,18 @@ void IDF3_BOARD::readLibSection( std::ifstream& aLibFile, IDF3::FILE_STATE& aLib while( !FetchIDFLine( aLibFile, iline, isComment, pos ) && aLibFile.good() ); if( !aLibFile.good() && !aLibFile.eof() ) + { + delete pout; throw( IDF_ERROR( __FILE__, __FUNCTION__, __LINE__, "problems reading library section" ) ); + } // no data was read; this only happens at eof() if( iline.empty() ) + { + delete pout; return; + } if( isComment ) { @@ -2450,6 +2454,7 @@ void IDF3_BOARD::readLibSection( std::ifstream& aLibFile, IDF3::FILE_STATE& aLib ostr << "* Violation of specification: quoted string where .ELECTRICAL or .MECHANICAL expected\n"; ostr << "* line: '" << iline << "'\n"; ostr << "* pos: " << pos; + delete pout; throw( IDF_ERROR( __FILE__, __FUNCTION__, __LINE__, ostr.str() ) ); } @@ -2491,6 +2496,7 @@ void IDF3_BOARD::readLibSection( std::ifstream& aLibFile, IDF3::FILE_STATE& aLib ostr << "* Violation of specification: multiple outlines have the same GEOM and PART name\n"; ostr << "* line: '" << iline << "'\n"; ostr << "* pos: " << pos; + delete pout; throw( IDF_ERROR( __FILE__, __FUNCTION__, __LINE__, ostr.str() ) ); } @@ -2504,11 +2510,14 @@ void IDF3_BOARD::readLibSection( std::ifstream& aLibFile, IDF3::FILE_STATE& aLib ostr << "* Expecting .ELECTRICAL or .MECHANICAL, got '" << token << "'\n"; ostr << "* line: '" << iline << "'\n"; ostr << "* pos: " << pos; + delete pout; throw( IDF_ERROR( __FILE__, __FUNCTION__, __LINE__, ostr.str() ) ); } } + delete pout; + if( !aLibFile.eof() ) throw( IDF_ERROR( __FILE__, __FUNCTION__, __LINE__, "problems reading IDF library file" ) ); @@ -3429,10 +3438,6 @@ bool IDF3_BOARD::DelBoardDrill( double aDia, double aXpos, double aYpos ) switch( keyo ) { - case UNOWNED: - ostr << "UNOWNED"; - break; - case ECAD: ostr << "ECAD"; break; diff --git a/utils/idftools/vrml_layer.cpp b/utils/idftools/vrml_layer.cpp index 54e8cedd90..8db5fae3a6 100644 --- a/utils/idftools/vrml_layer.cpp +++ b/utils/idftools/vrml_layer.cpp @@ -178,6 +178,8 @@ VRML_LAYER::VRML_LAYER() fix = false; Fault = false; idx = 0; + hidx = 0; + eidx = 0; ord = 0; glcmd = 0; pholes = NULL; diff --git a/utils/idftools/vrml_layer.h b/utils/idftools/vrml_layer.h index 2c7511da71..92b5891b39 100644 --- a/utils/idftools/vrml_layer.h +++ b/utils/idftools/vrml_layer.h @@ -100,7 +100,6 @@ private: bool fix; // when true, no more vertices may be added by the user int idx; // vertex index (number of contained vertices) int ord; // vertex order (number of ordered vertices) - unsigned int idxout; // outline index to first point in 3D outline std::vector vertices; // vertices of all contours std::vector*> contours; // lists of vertices for each contour std::vectorpth; // indicates whether a 'contour' is a PTH or not