Compare commits
261 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| f9a2dced07 | |||
| 52157acbfe | |||
| 17f220590b | |||
| 33027b8f66 | |||
| 064a9688c0 | |||
| c1ec63d4f9 | |||
| 995b2c517d | |||
| a8c0bc0430 | |||
| 902629c139 | |||
| 63e638cfab | |||
| 48b520a098 | |||
| b55352da7e | |||
| cd41a42775 | |||
| 6f82cec3a4 | |||
| 2f9cd25850 | |||
| 865bb54591 | |||
| 6d26e8e3e8 | |||
| 9c50a9fa4a | |||
| 406dd58002 | |||
| bd7ba5f6b1 | |||
| d174cff9ae | |||
| bbce24ab32 | |||
| ad2c5b40ff | |||
| 8e0784d4fa | |||
| 926818097b | |||
| fd65bd8e6e | |||
| d53c6f8abe | |||
| 2512375988 | |||
| 4b4d082fa4 | |||
| 374dfdbe16 | |||
| 3c476157c1 | |||
| 3af058a281 | |||
| 8a1e400d81 | |||
| fb4fa9ae41 | |||
| ede0ab5b79 | |||
| 2723898ff4 | |||
| b470d9ed8a | |||
| f0446aab90 | |||
| be3ee24826 | |||
| 68a1f9e512 | |||
| bf90966901 | |||
| 7a5e9cce6d | |||
| 3f7da644eb | |||
| e424dbea2d | |||
| 4d1fcff732 | |||
| dac08643c3 | |||
| 95fcf53353 | |||
| 7dc6abd533 | |||
| 042b49ee7b | |||
| 6a1dfd6e32 | |||
| b2855e6288 | |||
| 86f9f169cd | |||
| 9052b063de | |||
| 1a6be90c4f | |||
| 55de16e874 | |||
| ef2bb0b621 | |||
| 09d4543071 | |||
| 7ef63f0159 | |||
| d0e34bf013 | |||
| 46a17ff272 | |||
| 51cc4b8811 | |||
| 5634dfa6ed | |||
| 5a8d56f3db | |||
| 0c5ea8565d | |||
| 1431bd1143 | |||
| 7a3a7d1af6 | |||
| 761ddcad21 | |||
| 8aabdcff9c | |||
| 29d58ae063 | |||
| 90ef84b958 | |||
| 9cebea5f11 | |||
| b7b955e37b | |||
| 87d4249d9f | |||
| 8bf5240d60 | |||
| 20bebeb543 | |||
| 1f4b288664 | |||
| 5cf346c233 | |||
| 617755f991 | |||
| 45329ceafa | |||
| 69858ab4c0 | |||
| c53a1e00f6 | |||
| 178a36fc66 | |||
| 8ce38d3820 | |||
| e0802dcd26 | |||
| c8a1c5c707 | |||
| 59091ec263 | |||
| 92fbc42214 | |||
| 00226cb0f2 | |||
| 7128f6adf0 | |||
| 38a7cb9731 | |||
| b6e7bf4768 | |||
| d600fd3498 | |||
| 48bad152bb | |||
| da80c6796d | |||
| 48d347ce45 | |||
| 76139ac110 | |||
| 1d65480097 | |||
| 338b7e4c78 | |||
| 5b64231b33 | |||
| cdaf829404 | |||
| e920cdf809 | |||
| 28ad719db6 | |||
| 83b5c5bf7f | |||
| f76678d20c | |||
| 9b46ed2449 | |||
| 70ab4c8e8d | |||
| 24d049c017 | |||
| 54c68080f5 | |||
| 16d63b7772 | |||
| 797cb2aaac | |||
| 2044fe591d | |||
| d5baea21cd | |||
| b59c334edb | |||
| bb8719b9d5 | |||
| 817c4645eb | |||
| f1462e9fd6 | |||
| 32aabaf010 | |||
| 72b7f9fe10 | |||
| 4d5b5d3791 | |||
| 4694a2622e | |||
| 92ba60628e | |||
| 2be352b9f9 | |||
| 8afb8190af | |||
| 275afdc1d5 | |||
| 3a8ad7165b | |||
| bbe70e2f67 | |||
| 4a5f74422c | |||
| 7053981835 | |||
| 895314b639 | |||
| 6253b878a0 | |||
| 5855a9ed89 | |||
| c861c31f24 | |||
| 87d55402e4 | |||
| 7168441a1b | |||
| 5d4e2aa595 | |||
| 2a91ba35c1 | |||
| 2553da38b4 | |||
| 8d8f96b094 | |||
| eb1164fc93 | |||
| a4aa447b95 | |||
| 53dbd3bb02 | |||
| 781e98acbc | |||
| ab70124b68 | |||
| c117708220 | |||
| 68d9b3cbf7 | |||
| aac4f30b7d | |||
| a2e9c0ea73 | |||
| 0f4eefc9fc | |||
| 19d9dcdd2a | |||
| 38c68b008c | |||
| 8f2060a3f6 | |||
| 837dba2419 | |||
| 2d092437f4 | |||
| c38da73151 | |||
| 37c5885946 | |||
| 2c2f69d05c | |||
| 592c2c6872 | |||
| 6b2bb4d808 | |||
| 8cd289cf69 | |||
| 30d07ac556 | |||
| 39f5c04821 | |||
| 161c7a38bc | |||
| a95360154d | |||
| 5f072eb7d5 | |||
| 1febd61583 | |||
| 0d8c066e05 | |||
| 6e6d88ec2e | |||
| 9db7a7f6f7 | |||
| 16d1a80f6e | |||
| b8ea9c59db | |||
| 962ccab3ed | |||
| 1fe956c069 | |||
| d9db4f7bfd | |||
| 0d93be0af2 | |||
| bda1f684fc | |||
| 7fdfd77422 | |||
| 49ba218264 | |||
| f117f14b58 | |||
| c143e49d94 | |||
| 627255f464 | |||
| ba90ef6c5f | |||
| 6a65f918f1 | |||
| ef419fee0a | |||
| c399b87fce | |||
| 20dffba10f | |||
| c07ac8b3db | |||
| f25d74628b | |||
| ebb3e04718 | |||
| d971cbefcb | |||
| e317818076 | |||
| f89d5f9949 | |||
| d45ce2f659 | |||
| 09a2d50e09 | |||
| d9ec998ff0 | |||
| 7563f51212 | |||
| 1101eb9f94 | |||
| 5a8845ad22 | |||
| 897ac863fc | |||
| f4080741b3 | |||
| c1018b1ff3 | |||
| e40f8f3a49 | |||
| 4bfcc42c10 | |||
| 1e5d93b54f | |||
| 75eb2b96d8 | |||
| 7a6f6d3fe9 | |||
| 117afb068f | |||
| bf61dfa008 | |||
| a2b197ad0e | |||
| 7be6d780c2 | |||
| fb6d9d7f74 | |||
| be87e71d53 | |||
| 8612010979 | |||
| b860dcb676 | |||
| eb676233fd | |||
| edacc3fbf1 | |||
| 01f56a070e | |||
| 83d1d57363 | |||
| c63230dec6 | |||
| ee1263ff53 | |||
| 1c7c0db7c7 | |||
| dc4a6732be | |||
| 3f5b65842d | |||
| ea0d9076e7 | |||
| bd97aaa63e | |||
| e811b9a2dd | |||
| 8524042352 | |||
| 5b24003f6c | |||
| 71ea56dea4 | |||
| 362eec7ee3 | |||
| c63c3d1891 | |||
| 058f6e0a9b | |||
| e3eaa50600 | |||
| f4b5b65342 | |||
| 624d88dff9 | |||
| c04a183141 | |||
| 1831e034be | |||
| 2dcff109df | |||
| 936040fe8b | |||
| 092c11b054 | |||
| 43b8adad1a | |||
| e05c8f8852 | |||
| 485e89f7a5 | |||
| 611311697e | |||
| 5bd3a9cca8 | |||
| f4d4f23876 | |||
| 827abb01a3 | |||
| 370ce6a74d | |||
| 9f2ca9b4d6 | |||
| b21f37e22f | |||
| 9dd8bc1060 | |||
| 511e862cfe | |||
| ed153bd7d7 | |||
| 6971e409bf | |||
| ea1a1a43c0 | |||
| 7890d78801 | |||
| 82631db1bb | |||
| fbc6c8f8f4 | |||
| 4e13677281 | |||
| ba276fe470 | |||
| 4d47857738 | |||
| 08c216e796 |
+85
-14
@@ -1,10 +1,11 @@
|
||||
##########################################################################
|
||||
# Build KiCad on Fedora and save the results
|
||||
##########################################################################
|
||||
fedora_build_linux:
|
||||
.fedora_build_linux_base:
|
||||
stage: build
|
||||
tags:
|
||||
- kicad-fedora
|
||||
# Don't tag until we have separate CI for MRs
|
||||
# tags:
|
||||
# - kicad-fedora
|
||||
image: registry.gitlab.com/kicad/kicad-ci/source_containers/master/fedora:34
|
||||
extends: .only_code
|
||||
interruptible: false
|
||||
@@ -22,7 +23,7 @@ fedora_build_linux:
|
||||
- cd build/linux
|
||||
- cmake
|
||||
-G Ninja
|
||||
-DCMAKE_BUILD_TYPE=Debug
|
||||
-DCMAKE_BUILD_TYPE=RelWithDebInfo
|
||||
-DKICAD_STDLIB_LIGHT_DEBUG=ON
|
||||
-DKICAD_USE_OCC=ON
|
||||
-DKICAD_SPICE=ON
|
||||
@@ -42,15 +43,31 @@ fedora_build_linux:
|
||||
- build/linux/pcbnew/_pcbnew.so
|
||||
- build/linux/qa/
|
||||
- build/linux/compilation_log.txt
|
||||
exclude:
|
||||
- build/linux/**/*.o
|
||||
- build/linux/**/*.a
|
||||
|
||||
# This split is to ensure we can always use our runner for our jobs
|
||||
fedora_build_linux_kicad:
|
||||
extends: .fedora_build_linux_base
|
||||
tags:
|
||||
- kicad-fedora
|
||||
only:
|
||||
variables:
|
||||
- $CI_PROJECT_ROOT_NAMESPACE == "kicad"
|
||||
|
||||
fedora_build_linux_public:
|
||||
extends: .fedora_build_linux_base
|
||||
except:
|
||||
variables:
|
||||
- $CI_PROJECT_ROOT_NAMESPACE == "kicad"
|
||||
|
||||
|
||||
# Upload the compilation log in an easily downloadable form
|
||||
fedora_report_build_warn:
|
||||
.fedora_report_build_warn:
|
||||
stage: report
|
||||
extends: .only_code
|
||||
when: always
|
||||
needs:
|
||||
- job: fedora_build_linux
|
||||
artifacts: true
|
||||
script:
|
||||
- echo "Uploading compilation log"
|
||||
- cp build/linux/compilation_log.txt compilation_log.txt
|
||||
@@ -61,14 +78,32 @@ fedora_report_build_warn:
|
||||
paths:
|
||||
- compilation_log.txt
|
||||
|
||||
fedora_report_build_warn_kicad:
|
||||
extends: .fedora_report_build_warn
|
||||
tags:
|
||||
- kicad-fedora
|
||||
needs:
|
||||
- job: fedora_build_linux_kicad
|
||||
artifacts: true
|
||||
only:
|
||||
variables:
|
||||
- $CI_PROJECT_ROOT_NAMESPACE == "kicad"
|
||||
|
||||
fedora_report_build_warn_public:
|
||||
extends: .fedora_report_build_warn
|
||||
needs:
|
||||
- job: fedora_build_linux_public
|
||||
artifacts: true
|
||||
except:
|
||||
variables:
|
||||
- $CI_PROJECT_ROOT_NAMESPACE == "kicad"
|
||||
|
||||
|
||||
# Report on the metrics of the code
|
||||
fedora_report_metrics:
|
||||
.fedora_report_metrics:
|
||||
stage: report
|
||||
extends: .only_code
|
||||
when: always
|
||||
needs:
|
||||
- job: fedora_build_linux
|
||||
artifacts: true
|
||||
script:
|
||||
- cat build/linux/compilation_log.txt | { grep "warning:" || test $? = 1; } | awk 'END{print "number_of_fedora_warnings "NR}' > metrics.txt
|
||||
- cat metrics.txt
|
||||
@@ -76,11 +111,30 @@ fedora_report_metrics:
|
||||
reports:
|
||||
metrics: metrics.txt
|
||||
|
||||
fedora_report_metrics_kicad:
|
||||
extends: .fedora_report_metrics
|
||||
tags:
|
||||
- kicad-fedora
|
||||
needs:
|
||||
- job: fedora_build_linux_kicad
|
||||
artifacts: true
|
||||
only:
|
||||
variables:
|
||||
- $CI_PROJECT_ROOT_NAMESPACE == "kicad"
|
||||
|
||||
fedora_report_metrics_public:
|
||||
extends: .fedora_report_metrics
|
||||
needs:
|
||||
- job: fedora_build_linux_public
|
||||
artifacts: true
|
||||
except:
|
||||
variables:
|
||||
- $CI_PROJECT_ROOT_NAMESPACE == "kicad"
|
||||
|
||||
##########################################################################
|
||||
# Run the code unit tests.
|
||||
##########################################################################
|
||||
fedora_qa:
|
||||
.fedora_qa:
|
||||
extends:
|
||||
- .unit_test
|
||||
- .only_code
|
||||
@@ -88,6 +142,23 @@ fedora_qa:
|
||||
matrix:
|
||||
# The name of the test without the qa_ prefix
|
||||
- TEST: [python, common, gerbview, pcbnew, eeschema, kimath, sexpr, kicad2step]
|
||||
|
||||
fedora_qa_kicad:
|
||||
extends: .fedora_qa
|
||||
tags:
|
||||
- kicad-fedora
|
||||
needs:
|
||||
- job: fedora_build_linux
|
||||
- job: fedora_build_linux_kicad
|
||||
artifacts: true
|
||||
only:
|
||||
variables:
|
||||
- $CI_PROJECT_ROOT_NAMESPACE == "kicad"
|
||||
|
||||
fedora_qa_public:
|
||||
extends: .fedora_qa
|
||||
needs:
|
||||
- job: fedora_build_linux_public
|
||||
artifacts: true
|
||||
except:
|
||||
variables:
|
||||
- $CI_PROJECT_ROOT_NAMESPACE == "kicad"
|
||||
|
||||
@@ -194,12 +194,13 @@ S3D_CACHE::S3D_CACHE()
|
||||
|
||||
S3D_CACHE::~S3D_CACHE()
|
||||
{
|
||||
COMMON_SETTINGS* commonSettings = Pgm().GetCommonSettings();
|
||||
|
||||
FlushCache();
|
||||
|
||||
// We'll delete ".3dc" cache files older than this many days
|
||||
int clearCacheInterval = commonSettings->m_System.clear_3d_cache_interval;
|
||||
int clearCacheInterval = 0;
|
||||
|
||||
if( Pgm().GetCommonSettings() )
|
||||
clearCacheInterval = Pgm().GetCommonSettings()->m_System.clear_3d_cache_interval;
|
||||
|
||||
// An interval of zero means the user doesn't want to ever clear the cache
|
||||
|
||||
|
||||
@@ -926,7 +926,7 @@ bool RENDER_3D_OPENGL::Redraw( bool aIsMoving, REPORTER* aStatusReporter,
|
||||
glTexEnvi( GL_TEXTURE_ENV, GL_SRC0_ALPHA, GL_PRIMARY_COLOR );
|
||||
glTexEnvi( GL_TEXTURE_ENV, GL_OPERAND0_ALPHA, GL_SRC_ALPHA );
|
||||
glTexEnvi( GL_TEXTURE_ENV, GL_SRC1_ALPHA, GL_CONSTANT );
|
||||
glTexEnvi( GL_TEXTURE_ENV, GL_OPERAND1_ALPHA, GL_CONSTANT );
|
||||
glTexEnvi( GL_TEXTURE_ENV, GL_OPERAND1_ALPHA, GL_SRC_ALPHA );
|
||||
|
||||
render3dModels( false, true );
|
||||
render3dModels( true, true );
|
||||
|
||||
+6
-6
@@ -779,12 +779,6 @@ set( INC_AFTER
|
||||
find_package( SWIG 3.0 REQUIRED )
|
||||
include( ${SWIG_USE_FILE} )
|
||||
|
||||
# pybind11 is header-only, so include the subdir
|
||||
add_subdirectory(thirdparty/pybind11)
|
||||
|
||||
# Make sure that we get our pybind11 and not the system pybind11 (ours is patched to work with wx)
|
||||
include_directories( BEFORE SYSTEM ${PYBIND11_INCLUDE_DIR} )
|
||||
|
||||
set( PythonInterp_FIND_VERSION 3.6 )
|
||||
set( PythonLibs_FIND_VERSION 3.6 )
|
||||
|
||||
@@ -826,6 +820,12 @@ message( STATUS "Python module install path: ${PYTHON_DEST}" )
|
||||
|
||||
find_package( PythonLibs 3.6 REQUIRED )
|
||||
|
||||
# pybind11 is header-only, so include the subdir
|
||||
add_subdirectory(thirdparty/pybind11)
|
||||
|
||||
# Make sure that we get our pybind11 and not the system pybind11 (ours is patched to work with wx)
|
||||
include_directories( BEFORE SYSTEM ${PYBIND11_INCLUDE_DIR} )
|
||||
|
||||
# Infrequently needed headers go at end of search paths, append to INC_AFTER which
|
||||
# although is used for all components, should be a harmless hit for something like eeschema
|
||||
# so long as unused search paths are at the end like this.
|
||||
|
||||
@@ -36,9 +36,9 @@ string( REGEX MATCH
|
||||
if( CMAKE_MATCH_COUNT EQUAL 3 )
|
||||
# Match slot 0 is the full string, so we want slots 1 & 2
|
||||
set( KICAD_MAJOR_MINOR_VERSION "${CMAKE_MATCH_1}.${CMAKE_MATCH_2}" )
|
||||
set( KICAD_MAJOR_MINOR_VERSION_TUPLE "{ ${CMAKE_MATCH_1}, ${CMAKE_MATCH_2} }" )
|
||||
|
||||
set( KICAD_MAJOR_MINOR_PATCH_VERSION "${CMAKE_MATCH_1}.${CMAKE_MATCH_2}.${CMAKE_MATCH_3}" )
|
||||
set( KICAD_MAJOR_MINOR_PATCH_TUPLE "{ ${CMAKE_MATCH_1}, ${CMAKE_MATCH_2}, ${CMAKE_MATCH_3} }" )
|
||||
|
||||
set( KICAD_MAJOR_VERSION "${CMAKE_MATCH_1}" )
|
||||
set( KICAD_MINOR_VERSION "${CMAKE_MATCH_2}" )
|
||||
@@ -67,7 +67,7 @@ set( _wvh_new_version_text
|
||||
#define KICAD_MINOR_VERSION \"${KICAD_MINOR_VERSION}\"
|
||||
#define KICAD_PATCH_VERSION \"${KICAD_PATCH_VERSION}\"
|
||||
#define KICAD_MAJOR_MINOR_VERSION \"${KICAD_MAJOR_MINOR_VERSION}\"
|
||||
#define KICAD_MAJOR_MINOR_VERSION_TUPLE ${KICAD_MAJOR_MINOR_VERSION_TUPLE}
|
||||
#define KICAD_MAJOR_MINOR_PATCH_TUPLE ${KICAD_MAJOR_MINOR_PATCH_TUPLE}
|
||||
#define KICAD_WIN32_RC_PRODVER ${KICAD_WIN32_RC_PRODVER}
|
||||
#define KICAD_WIN32_RC_PRODVER_STR \"${KICAD_WIN32_RC_PRODVER_STR}\"
|
||||
#define KICAD_WIN32_RC_FILEVER ${KICAD_WIN32_RC_FILEVER}
|
||||
|
||||
@@ -75,11 +75,15 @@ if( ${PYTHON_ROOT_DIR} )
|
||||
find_program(PYTHON_EXECUTABLE NAMES ${_Python_NAMES}
|
||||
PATHS ${PYTHON_ROOT_DIR}
|
||||
NO_DEFAULT_PATH )
|
||||
elseif(VCPKG_TOOLCHAIN)
|
||||
# Our VCPKG usage will always place it in a known location
|
||||
find_program(PYTHON_EXECUTABLE
|
||||
NAMES ${_Python_NAMES}
|
||||
PATHS "${VCPKG_INSTALLED_DIR}/${VCPKG_TARGET_TRIPLET}/tools/python3"
|
||||
)
|
||||
else()
|
||||
if(NOT VCPKG_TOOLCHAIN)
|
||||
# If there is no specific path given, look for python in the path
|
||||
find_program(PYTHON_EXECUTABLE NAMES ${_Python_NAMES})
|
||||
endif()
|
||||
# If there is no specific path given, look for python in the path
|
||||
find_program(PYTHON_EXECUTABLE NAMES ${_Python_NAMES})
|
||||
endif()
|
||||
|
||||
# Set up the versions we know about, in the order we will search. Always add
|
||||
@@ -112,8 +116,6 @@ if(NOT PYTHON_EXECUTABLE)
|
||||
list( APPEND _Python_PPATHS "C:/python/${_CURRENT_VERSION}.2" )
|
||||
list( APPEND _Python_PPATHS "C:/python/${_CURRENT_VERSION}.1" )
|
||||
list( APPEND _Python_PPATHS "C:/python/${_CURRENT_VERSION}.0" )
|
||||
elseif(VCPKG_TOOLCHAIN)
|
||||
list( APPEND _Python_PPATHS "${_VCPKG_INSTALLED_DIR}/${VCPKG_TARGET_TRIPLET}/tools/python3" )
|
||||
else()
|
||||
list( APPEND _Python_PPATHS [HKEY_LOCAL_MACHINE\\SOFTWARE\\Python\\PythonCore\\${_CURRENT_VERSION}\\InstallPath] )
|
||||
endif()
|
||||
|
||||
@@ -40,7 +40,7 @@ if( VCPKG_TOOLCHAIN )
|
||||
# python 3.8+ requires us to use python to add additional load directories (PATH no longer supported)
|
||||
# vcpkg does not copy all the dlls into the python folder so we need this for development
|
||||
# as the wxpython modules need the wxwidgets library DLLs to load
|
||||
set( _py_dll "import os;os.add_dll_directory(\"${_VCPKG_INSTALLED_DIR}/${VCPKG_TARGET_TRIPLET}/bin\");os.add_dll_directory(\"${_VCPKG_INSTALLED_DIR}/${VCPKG_TARGET_TRIPLET}/debug/bin\");" )
|
||||
set( _py_dll "import os;os.add_dll_directory(\"${VCPKG_INSTALLED_DIR}/${VCPKG_TARGET_TRIPLET}/bin\");os.add_dll_directory(\"${VCPKG_INSTALLED_DIR}/${VCPKG_TARGET_TRIPLET}/debug/bin\");" )
|
||||
else()
|
||||
set( _py_dll "" )
|
||||
endif()
|
||||
|
||||
@@ -293,6 +293,7 @@ if(wxWidgets_FIND_STYLE STREQUAL "win32")
|
||||
# Find wxWidgets multilib base libraries.
|
||||
find_library(WX_base${_DBG}
|
||||
NAMES
|
||||
wxbase32${_UCD}${_DBG}
|
||||
wxbase31${_UCD}${_DBG}
|
||||
wxbase30${_UCD}${_DBG}
|
||||
wxbase29${_UCD}${_DBG}
|
||||
@@ -307,6 +308,7 @@ if(wxWidgets_FIND_STYLE STREQUAL "win32")
|
||||
foreach(LIB net odbc xml)
|
||||
find_library(WX_${LIB}${_DBG}
|
||||
NAMES
|
||||
wxbase32${_UCD}${_DBG}_${LIB}
|
||||
wxbase31${_UCD}${_DBG}_${LIB}
|
||||
wxbase30${_UCD}${_DBG}_${LIB}
|
||||
wxbase29${_UCD}${_DBG}_${LIB}
|
||||
@@ -323,6 +325,7 @@ if(wxWidgets_FIND_STYLE STREQUAL "win32")
|
||||
# Find wxWidgets monolithic library.
|
||||
find_library(WX_mono${_DBG}
|
||||
NAMES
|
||||
wx${_PF}${_UNV}32${_UCD}${_DBG}
|
||||
wx${_PF}${_UNV}31${_UCD}${_DBG}
|
||||
wx${_PF}${_UNV}30${_UCD}${_DBG}
|
||||
wx${_PF}${_UNV}29${_UCD}${_DBG}
|
||||
@@ -340,6 +343,7 @@ if(wxWidgets_FIND_STYLE STREQUAL "win32")
|
||||
stc ribbon propgrid webview)
|
||||
find_library(WX_${LIB}${_DBG}
|
||||
NAMES
|
||||
wx${_PF}${_UNV}32${_UCD}${_DBG}_${LIB}
|
||||
wx${_PF}${_UNV}31${_UCD}${_DBG}_${LIB}
|
||||
wx${_PF}${_UNV}30${_UCD}${_DBG}_${LIB}
|
||||
wx${_PF}${_UNV}29${_UCD}${_DBG}_${LIB}
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
# This program source code file is part of KICAD, a free EDA CAD application.
|
||||
#
|
||||
# Copyright (C) 2016 Wayne Stambaugh <stambaughw@gmail.com>
|
||||
# Copyright (C) 2016-2021 KiCad Developers, see AUTHORS.txt for contributors.
|
||||
# Copyright (C) 2016-2022 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
|
||||
@@ -37,7 +37,7 @@
|
||||
# KiCad.
|
||||
#
|
||||
# Note: This version string should follow the semantic versioning system
|
||||
set( KICAD_SEMANTIC_VERSION "6.0.5" )
|
||||
set( KICAD_SEMANTIC_VERSION "6.0.7" )
|
||||
|
||||
# Default the version to the semantic version.
|
||||
# This is overridden by the git repository tag though (if using git)
|
||||
|
||||
@@ -619,8 +619,8 @@ set( TMP_DIR "${CMAKE_CURRENT_BINARY_DIR}/tmp" )
|
||||
# generate logs is useful only if you have problems
|
||||
set( CREATE_LOG_FILES true )
|
||||
|
||||
set( BITMAP_INFO_FILE "${CMAKE_SOURCE_DIR}/include/bitmaps/bitmap_info.h" )
|
||||
set( BITMAP_INFO_TEMPLATE "${CMAKE_SOURCE_DIR}/include/bitmaps/bitmap_info.h.in" )
|
||||
set( BITMAP_INFO_FILE "${CMAKE_SOURCE_DIR}/common/bitmap_info.cpp" )
|
||||
set( BITMAP_INFO_TEMPLATE "${CMAKE_SOURCE_DIR}/include/bitmaps/bitmap_info.cpp.in" )
|
||||
set( BITMAP_INFO_LIST "" )
|
||||
|
||||
set( ALL_PNGS "" )
|
||||
@@ -739,7 +739,7 @@ function( bitmap_dir pngWidth pngHeight bmapList )
|
||||
png2png( ${tmpFile} ${pngPath} )
|
||||
|
||||
set( bitmapInfo
|
||||
" { BITMAPS::${bmn}, wxT( \"${pngFile}\" ), ${pngHeight}, wxT( \"${theme}\" ) },\n"
|
||||
" aBitmapInfoCache[BITMAPS::${bmn}].emplace_back( BITMAPS::${bmn}, wxT( \"${pngFile}\" ), ${pngHeight}, wxT( \"${theme}\" ) );\n"
|
||||
)
|
||||
|
||||
set( BITMAP_INFO_LIST "${BITMAP_INFO_LIST}${bitmapInfo}" )
|
||||
|
||||
@@ -315,6 +315,7 @@ set( COMMON_SRCS
|
||||
bin_mod.cpp
|
||||
bitmap.cpp
|
||||
bitmap_base.cpp
|
||||
bitmap_info.cpp
|
||||
bitmap_store.cpp
|
||||
board_printout.cpp
|
||||
build_version.cpp
|
||||
|
||||
@@ -226,22 +226,17 @@ wxString StringFromValue( EDA_UNITS aUnits, double aValue, bool aAddUnitSymbol,
|
||||
|
||||
if( value_to_print != 0.0 && fabs( value_to_print ) <= 0.0001 )
|
||||
{
|
||||
len = sprintf( buf, "%.10f", value_to_print );
|
||||
len = snprintf( buf, sizeof( buf ) - 1, "%.10f", value_to_print );
|
||||
|
||||
while( --len > 0 && buf[len] == '0' )
|
||||
buf[len] = '\0';
|
||||
|
||||
if( buf[len]=='.' || buf[len]==',' )
|
||||
if( len >= 0 && ( buf[len]=='.' || buf[len]==',' ) )
|
||||
buf[len] = '\0';
|
||||
else
|
||||
++len;
|
||||
}
|
||||
else
|
||||
{
|
||||
if( aUnits == EDA_UNITS::MILS )
|
||||
len = sprintf( buf, "%.7g", value_to_print );
|
||||
else
|
||||
len = sprintf( buf, "%.10g", value_to_print );
|
||||
snprintf( buf, sizeof( buf ) - 1, "%.10g", value_to_print );
|
||||
}
|
||||
|
||||
wxString stringValue( buf, wxConvUTF8 );
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -101,7 +101,7 @@ BITMAP_STORE::BITMAP_STORE()
|
||||
{
|
||||
wxFileName path( PATHS::GetStockDataPath() + wxT( "/resources" ), IMAGE_ARCHIVE );
|
||||
|
||||
wxLogTrace( traceBitmaps, wxT( "Loading bitmaps from " ) + path.GetFullPath() );
|
||||
wxLogTrace( traceBitmaps, "Loading bitmaps from " + path.GetFullPath() );
|
||||
|
||||
m_archive = std::make_unique<ASSET_ARCHIVE>( path.GetFullPath() );
|
||||
|
||||
@@ -148,8 +148,8 @@ wxImage BITMAP_STORE::getImage( BITMAPS aBitmapId, int aHeight )
|
||||
|
||||
if( count < 0 )
|
||||
{
|
||||
wxLogTrace( traceBitmaps, wxT( "Bitmap for %d, %d, %s has an info tag with file %s," )
|
||||
wxT( "but that file could not be found in the archive!" ),
|
||||
wxLogTrace( traceBitmaps, "Bitmap for %d, %d, %s has an info tag with file %s,"
|
||||
"but that file could not be found in the archive!",
|
||||
aBitmapId, aHeight, m_theme );
|
||||
data = s_imageNotFound;
|
||||
count = sizeof( s_imageNotFound );
|
||||
@@ -204,7 +204,7 @@ wxString BITMAP_STORE::computeBitmapName( BITMAPS aBitmapId, int aHeight )
|
||||
{
|
||||
if( !m_bitmapInfoCache.count( aBitmapId ) )
|
||||
{
|
||||
wxLogTrace( traceBitmaps, wxT( "No bitmap info available for %d" ), aBitmapId );
|
||||
wxLogTrace( traceBitmaps, "No bitmap info available for %d", aBitmapId );
|
||||
return wxEmptyString;
|
||||
}
|
||||
|
||||
@@ -224,7 +224,7 @@ wxString BITMAP_STORE::computeBitmapName( BITMAPS aBitmapId, int aHeight )
|
||||
|
||||
if( fn.IsEmpty() )
|
||||
{
|
||||
wxLogTrace( traceBitmaps, wxT( "No bitmap found matching ID %d, height %d, theme %s" ),
|
||||
wxLogTrace( traceBitmaps, "No bitmap found matching ID %d, height %d, theme %s",
|
||||
aBitmapId, aHeight, m_theme );
|
||||
return m_bitmapInfoCache.at( aBitmapId ).begin()->filename;
|
||||
}
|
||||
@@ -235,6 +235,5 @@ wxString BITMAP_STORE::computeBitmapName( BITMAPS aBitmapId, int aHeight )
|
||||
|
||||
void BITMAP_STORE::buildBitmapInfoCache()
|
||||
{
|
||||
for( const BITMAP_INFO& entry : g_BitmapInfo )
|
||||
m_bitmapInfoCache[entry.id].emplace_back( entry );
|
||||
BuildBitmapInfo( m_bitmapInfoCache );
|
||||
}
|
||||
|
||||
@@ -116,6 +116,10 @@ void BOARD_PRINTOUT::DrawPage( const wxString& aLayerName, int aPageNum, int aPa
|
||||
{
|
||||
for( int i = 0; i < LAYER_ID_COUNT; ++i )
|
||||
dstSettings->SetLayerColor( i, COLOR4D::BLACK );
|
||||
|
||||
// In B&W mode, draw the background only in wxhite, because any other color
|
||||
// will be replaced by a black background
|
||||
dstSettings->SetBackgroundColor( COLOR4D::WHITE );
|
||||
}
|
||||
else // color enabled
|
||||
{
|
||||
|
||||
@@ -25,6 +25,7 @@
|
||||
#include <dialog_shim.h>
|
||||
#include <ignore.h>
|
||||
#include <kiway_player.h>
|
||||
#include <kiway.h>
|
||||
#include <pgm_base.h>
|
||||
#include <tool/tool_manager.h>
|
||||
#include <kiplatform/ui.h>
|
||||
@@ -122,6 +123,9 @@ DIALOG_SHIM::DIALOG_SHIM( wxWindow* aParent, wxWindowID id, const wxString& titl
|
||||
if( kiwayHolder )
|
||||
SetKiway( this, &kiwayHolder->Kiway() );
|
||||
|
||||
if( HasKiway() )
|
||||
Kiway().SetBlockingDialog( this );
|
||||
|
||||
Bind( wxEVT_CLOSE_WINDOW, &DIALOG_SHIM::OnCloseWindow, this );
|
||||
Bind( wxEVT_BUTTON, &DIALOG_SHIM::OnButton, this );
|
||||
|
||||
@@ -143,6 +147,9 @@ DIALOG_SHIM::~DIALOG_SHIM()
|
||||
if( IsQuasiModal() )
|
||||
EndQuasiModal( wxID_CANCEL );
|
||||
|
||||
if( HasKiway() )
|
||||
Kiway().SetBlockingDialog( nullptr );
|
||||
|
||||
if( m_qmodal_parent_disabler )
|
||||
delete m_qmodal_parent_disabler; // usually NULL by now
|
||||
}
|
||||
|
||||
+1
-6
@@ -71,19 +71,14 @@ static const wxFileTypeInfo EDAfallbacks[] =
|
||||
};
|
||||
|
||||
|
||||
bool GetAssociatedDocument( wxWindow* aParent, const wxString& aDocName, PROJECT* aProject )
|
||||
bool GetAssociatedDocument( wxWindow* aParent, const wxString& aDocName, PROJECT* aProject, SEARCH_STACK* aPaths )
|
||||
{
|
||||
SEARCH_STACK* aPaths = nullptr;
|
||||
wxString docname;
|
||||
wxString fullfilename;
|
||||
wxString msg;
|
||||
wxString command;
|
||||
bool success = false;
|
||||
|
||||
#if defined( EESCHEMA )
|
||||
SEARCH_STACK* aPaths = aProject ? aProject->SchSearchS() : nullptr;
|
||||
#endif
|
||||
|
||||
// Is an internet url
|
||||
static const std::vector<wxString> url_header =
|
||||
{
|
||||
|
||||
@@ -387,6 +387,9 @@ void EDA_DRAW_FRAME::OnSelectGrid( wxCommandEvent& event )
|
||||
|
||||
UpdateStatusBar();
|
||||
m_canvas->Refresh();
|
||||
// Needed on Windows because clicking on m_gridSelectBox remove the focus from m_canvas
|
||||
// (Windows specific
|
||||
m_canvas->SetFocus();
|
||||
}
|
||||
|
||||
|
||||
@@ -463,6 +466,9 @@ void EDA_DRAW_FRAME::OnSelectZoom( wxCommandEvent& event )
|
||||
m_toolManager->RunAction( ACTIONS::zoomPreset, true, static_cast<intptr_t>( id ) );
|
||||
UpdateStatusBar();
|
||||
m_canvas->Refresh();
|
||||
// Needed on Windows because clicking on m_zoomSelectBox remove the focus from m_canvas
|
||||
// (Windows specific
|
||||
m_canvas->SetFocus();
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -106,7 +106,7 @@ bool SHADER::Link()
|
||||
|
||||
// Check the Link state
|
||||
GLint tmp;
|
||||
glGetObjectParameterivARB( programNumber, GL_OBJECT_LINK_STATUS_ARB, &tmp );
|
||||
glGetProgramiv( programNumber, GL_LINK_STATUS, &tmp );
|
||||
isShaderLinked = !!tmp;
|
||||
|
||||
#ifdef DEBUG
|
||||
|
||||
+14
-1
@@ -50,7 +50,7 @@ int KIWAY::m_kiface_version[KIWAY_FACE_COUNT];
|
||||
|
||||
|
||||
KIWAY::KIWAY( PGM_BASE* aProgram, int aCtlBits, wxFrame* aTop ):
|
||||
m_program( aProgram ), m_ctl( aCtlBits ), m_top( nullptr )
|
||||
m_program( aProgram ), m_ctl( aCtlBits ), m_top( nullptr ), m_blockingDialog( wxID_NONE )
|
||||
{
|
||||
SetTop( aTop ); // hook player_destroy_handler() into aTop.
|
||||
|
||||
@@ -606,6 +606,19 @@ void KIWAY::ProjectChanged()
|
||||
}
|
||||
}
|
||||
|
||||
wxWindow* KIWAY::GetBlockingDialog()
|
||||
{
|
||||
return wxWindow::FindWindowById( m_blockingDialog );
|
||||
}
|
||||
|
||||
void KIWAY::SetBlockingDialog( wxWindow* aWin )
|
||||
{
|
||||
if( !aWin )
|
||||
m_blockingDialog = wxID_NONE;
|
||||
else
|
||||
m_blockingDialog = aWin->GetId();
|
||||
}
|
||||
|
||||
|
||||
bool KIWAY::ProcessEvent( wxEvent& aEvent )
|
||||
{
|
||||
|
||||
+63
-60
@@ -1,7 +1,7 @@
|
||||
/*
|
||||
* This program source code file is part of KiCad, a free EDA CAD application.
|
||||
*
|
||||
* Copyright (C) 2020 KiCad Developers, see AUTHORS.txt for contributors.
|
||||
* Copyright (C) 2022 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
|
||||
@@ -23,79 +23,82 @@
|
||||
/**
|
||||
* Returns the default display name for a given layer. These are not the same as the canonical
|
||||
* name in LSET::Name(), which is used in board files and cannot be translated or changed.
|
||||
* WARNING: do not translate board physical layers names (F.Cu to User.9): because canonical names
|
||||
* are used in files (boards and fab files), using translated names in UI create mistakes for users.
|
||||
* Board physical layers names must be seen as proper nouns.
|
||||
*/
|
||||
wxString LayerName( int aLayer )
|
||||
{
|
||||
switch( aLayer )
|
||||
{
|
||||
// PCB_LAYER_ID
|
||||
case F_Cu: return _( "F.Cu" );
|
||||
case In1_Cu: return _( "In1.Cu" );
|
||||
case In2_Cu: return _( "In2.Cu" );
|
||||
case In3_Cu: return _( "In3.Cu" );
|
||||
case In4_Cu: return _( "In4.Cu" );
|
||||
case In5_Cu: return _( "In5.Cu" );
|
||||
case In6_Cu: return _( "In6.Cu" );
|
||||
case In7_Cu: return _( "In7.Cu" );
|
||||
case In8_Cu: return _( "In8.Cu" );
|
||||
case In9_Cu: return _( "In9.Cu" );
|
||||
case In10_Cu: return _( "In10.Cu" );
|
||||
case In11_Cu: return _( "In11.Cu" );
|
||||
case In12_Cu: return _( "In12.Cu" );
|
||||
case In13_Cu: return _( "In13.Cu" );
|
||||
case In14_Cu: return _( "In14.Cu" );
|
||||
case In15_Cu: return _( "In15.Cu" );
|
||||
case In16_Cu: return _( "In16.Cu" );
|
||||
case In17_Cu: return _( "In17.Cu" );
|
||||
case In18_Cu: return _( "In18.Cu" );
|
||||
case In19_Cu: return _( "In19.Cu" );
|
||||
case In20_Cu: return _( "In20.Cu" );
|
||||
case In21_Cu: return _( "In21.Cu" );
|
||||
case In22_Cu: return _( "In22.Cu" );
|
||||
case In23_Cu: return _( "In23.Cu" );
|
||||
case In24_Cu: return _( "In24.Cu" );
|
||||
case In25_Cu: return _( "In25.Cu" );
|
||||
case In26_Cu: return _( "In26.Cu" );
|
||||
case In27_Cu: return _( "In27.Cu" );
|
||||
case In28_Cu: return _( "In28.Cu" );
|
||||
case In29_Cu: return _( "In29.Cu" );
|
||||
case In30_Cu: return _( "In30.Cu" );
|
||||
case B_Cu: return _( "B.Cu" );
|
||||
case F_Cu: return wxT( "F.Cu" );
|
||||
case In1_Cu: return wxT( "In1.Cu" );
|
||||
case In2_Cu: return wxT( "In2.Cu" );
|
||||
case In3_Cu: return wxT( "In3.Cu" );
|
||||
case In4_Cu: return wxT( "In4.Cu" );
|
||||
case In5_Cu: return wxT( "In5.Cu" );
|
||||
case In6_Cu: return wxT( "In6.Cu" );
|
||||
case In7_Cu: return wxT( "In7.Cu" );
|
||||
case In8_Cu: return wxT( "In8.Cu" );
|
||||
case In9_Cu: return wxT( "In9.Cu" );
|
||||
case In10_Cu: return wxT( "In10.Cu" );
|
||||
case In11_Cu: return wxT( "In11.Cu" );
|
||||
case In12_Cu: return wxT( "In12.Cu" );
|
||||
case In13_Cu: return wxT( "In13.Cu" );
|
||||
case In14_Cu: return wxT( "In14.Cu" );
|
||||
case In15_Cu: return wxT( "In15.Cu" );
|
||||
case In16_Cu: return wxT( "In16.Cu" );
|
||||
case In17_Cu: return wxT( "In17.Cu" );
|
||||
case In18_Cu: return wxT( "In18.Cu" );
|
||||
case In19_Cu: return wxT( "In19.Cu" );
|
||||
case In20_Cu: return wxT( "In20.Cu" );
|
||||
case In21_Cu: return wxT( "In21.Cu" );
|
||||
case In22_Cu: return wxT( "In22.Cu" );
|
||||
case In23_Cu: return wxT( "In23.Cu" );
|
||||
case In24_Cu: return wxT( "In24.Cu" );
|
||||
case In25_Cu: return wxT( "In25.Cu" );
|
||||
case In26_Cu: return wxT( "In26.Cu" );
|
||||
case In27_Cu: return wxT( "In27.Cu" );
|
||||
case In28_Cu: return wxT( "In28.Cu" );
|
||||
case In29_Cu: return wxT( "In29.Cu" );
|
||||
case In30_Cu: return wxT( "In30.Cu" );
|
||||
case B_Cu: return wxT( "B.Cu" );
|
||||
|
||||
// Technicals
|
||||
case B_Adhes: return _( "B.Adhesive" );
|
||||
case F_Adhes: return _( "F.Adhesive" );
|
||||
case B_Paste: return _( "B.Paste" );
|
||||
case F_Paste: return _( "F.Paste" );
|
||||
case B_SilkS: return _( "B.Silkscreen" );
|
||||
case F_SilkS: return _( "F.Silkscreen" );
|
||||
case B_Mask: return _( "B.Mask" );
|
||||
case F_Mask: return _( "F.Mask" );
|
||||
case B_Adhes: return wxT( "B.Adhesive" );
|
||||
case F_Adhes: return wxT( "F.Adhesive" );
|
||||
case B_Paste: return wxT( "B.Paste" );
|
||||
case F_Paste: return wxT( "F.Paste" );
|
||||
case B_SilkS: return wxT( "B.Silkscreen" );
|
||||
case F_SilkS: return wxT( "F.Silkscreen" );
|
||||
case B_Mask: return wxT( "B.Mask" );
|
||||
case F_Mask: return wxT( "F.Mask" );
|
||||
|
||||
// Users
|
||||
case Dwgs_User: return _( "User.Drawings" );
|
||||
case Cmts_User: return _( "User.Comments" );
|
||||
case Eco1_User: return _( "User.Eco1" );
|
||||
case Eco2_User: return _( "User.Eco2" );
|
||||
case Edge_Cuts: return _( "Edge.Cuts" );
|
||||
case Margin: return _( "Margin" );
|
||||
case Dwgs_User: return wxT( "User.Drawings" );
|
||||
case Cmts_User: return wxT( "User.Comments" );
|
||||
case Eco1_User: return wxT( "User.Eco1" );
|
||||
case Eco2_User: return wxT( "User.Eco2" );
|
||||
case Edge_Cuts: return wxT( "Edge.Cuts" );
|
||||
case Margin: return wxT( "Margin" );
|
||||
|
||||
// Footprint
|
||||
case F_CrtYd: return _( "F.Courtyard" );
|
||||
case B_CrtYd: return _( "B.Courtyard" );
|
||||
case F_Fab: return _( "F.Fab" );
|
||||
case B_Fab: return _( "B.Fab" );
|
||||
case F_CrtYd: return wxT( "F.Courtyard" );
|
||||
case B_CrtYd: return wxT( "B.Courtyard" );
|
||||
case F_Fab: return wxT( "F.Fab" );
|
||||
case B_Fab: return wxT( "B.Fab" );
|
||||
|
||||
// User definable layers.
|
||||
case User_1: return _( "User.1" );
|
||||
case User_2: return _( "User.2" );
|
||||
case User_3: return _( "User.3" );
|
||||
case User_4: return _( "User.4" );
|
||||
case User_5: return _( "User.5" );
|
||||
case User_6: return _( "User.6" );
|
||||
case User_7: return _( "User.7" );
|
||||
case User_8: return _( "User.8" );
|
||||
case User_9: return _( "User.9" );
|
||||
case User_1: return wxT( "User.1" );
|
||||
case User_2: return wxT( "User.2" );
|
||||
case User_3: return wxT( "User.3" );
|
||||
case User_4: return wxT( "User.4" );
|
||||
case User_5: return wxT( "User.5" );
|
||||
case User_6: return wxT( "User.6" );
|
||||
case User_7: return wxT( "User.7" );
|
||||
case User_8: return wxT( "User.8" );
|
||||
case User_9: return wxT( "User.9" );
|
||||
|
||||
// Rescue
|
||||
case Rescue: return _( "Rescue" );
|
||||
|
||||
+4
-4
@@ -203,7 +203,7 @@ wxString PATHS::GetStockSymbolsPath()
|
||||
{
|
||||
wxString path;
|
||||
|
||||
path = GetStockDataPath() + wxT( "/symbols" );
|
||||
path = GetStockEDALibraryPath() + wxT( "/symbols" );
|
||||
|
||||
return path;
|
||||
}
|
||||
@@ -213,7 +213,7 @@ wxString PATHS::GetStockFootprintsPath()
|
||||
{
|
||||
wxString path;
|
||||
|
||||
path = GetStockDataPath() + wxT( "/footprints" );
|
||||
path = GetStockEDALibraryPath() + wxT( "/footprints" );
|
||||
|
||||
return path;
|
||||
}
|
||||
@@ -223,7 +223,7 @@ wxString PATHS::GetStock3dmodelsPath()
|
||||
{
|
||||
wxString path;
|
||||
|
||||
path = GetStockDataPath() + wxT( "/3dmodels" );
|
||||
path = GetStockEDALibraryPath() + wxT( "/3dmodels" );
|
||||
|
||||
return path;
|
||||
}
|
||||
@@ -243,7 +243,7 @@ wxString PATHS::GetStockTemplatesPath()
|
||||
{
|
||||
wxString path;
|
||||
|
||||
path = GetStockDataPath() + wxT( "/template" );
|
||||
path = GetStockEDALibraryPath() + wxT( "/template" );
|
||||
|
||||
return path;
|
||||
}
|
||||
|
||||
+1
-1
@@ -384,7 +384,7 @@ void PGM_BASE::SaveCommonSettings()
|
||||
|
||||
COMMON_SETTINGS* PGM_BASE::GetCommonSettings() const
|
||||
{
|
||||
return m_settings_manager ? GetSettingsManager().GetCommonSettings() : nullptr;
|
||||
return m_settings_manager ? m_settings_manager->GetCommonSettings() : nullptr;
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -1252,7 +1252,7 @@ void GERBER_PLOTTER::FlashPadCircle( const wxPoint& pos, int diametre, OUTLINE_M
|
||||
|
||||
SetCurrentLineWidth( USE_DEFAULT_LINE_WIDTH );
|
||||
|
||||
Circle( pos, diametre - m_currentPenWidth, FILL_T::NO_FILL, DO_NOT_SET_LINE_WIDTH );
|
||||
Circle( pos, diametre, FILL_T::NO_FILL, DO_NOT_SET_LINE_WIDTH );
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -1372,10 +1372,8 @@ void GERBER_PLOTTER::FlashPadRect( const wxPoint& pos, const wxSize& aSize,
|
||||
formatNetAttribute( &gbr_metadata->m_NetlistMetadata );
|
||||
|
||||
SetCurrentLineWidth( USE_DEFAULT_LINE_WIDTH );
|
||||
Rect( wxPoint( pos.x - (size.x - GetCurrentLineWidth()) / 2,
|
||||
pos.y - (size.y - GetCurrentLineWidth()) / 2 ),
|
||||
wxPoint( pos.x + (size.x - GetCurrentLineWidth()) / 2,
|
||||
pos.y + (size.y - GetCurrentLineWidth()) / 2 ),
|
||||
Rect( wxPoint( pos.x - ( size.x / 2 ), pos.y - ( size.y / 2 ) ),
|
||||
wxPoint( pos.x + ( size.x / 2 ), pos.y + ( size.y / 2 ) ),
|
||||
FILL_T::NO_FILL, GetCurrentLineWidth() );
|
||||
}
|
||||
else
|
||||
@@ -1445,7 +1443,6 @@ void GERBER_PLOTTER::FlashPadRoundRect( const wxPoint& aPadPos, const wxSize& aS
|
||||
0.0, 0, 0, GetPlotterArcHighDef(), ERROR_INSIDE );
|
||||
|
||||
SetCurrentLineWidth( USE_DEFAULT_LINE_WIDTH, &gbr_metadata );
|
||||
outline.Inflate( -GetCurrentLineWidth()/2, 16 );
|
||||
|
||||
std::vector< wxPoint > cornerList;
|
||||
// TransformRoundRectToPolygon creates only one convex polygon
|
||||
@@ -1657,7 +1654,6 @@ void GERBER_PLOTTER::FlashPadCustom( const wxPoint& aPadPos, const wxSize& aSize
|
||||
if( aTraceMode != FILLED )
|
||||
{
|
||||
SetCurrentLineWidth( USE_DEFAULT_LINE_WIDTH, &gbr_metadata );
|
||||
polyshape.Inflate( -GetCurrentLineWidth()/2, 16 );
|
||||
}
|
||||
|
||||
std::vector< wxPoint > cornerList;
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
* This program source code file is part of KiCad, a free EDA CAD application.
|
||||
*
|
||||
* Copyright (C) 2017 Jean-Pierre Charras, jp.charras at wanadoo.fr
|
||||
* Copyright (C) 2020-2021 KiCad Developers, see AUTHORS.txt for contributors.
|
||||
* Copyright (C) 2020-2022 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
|
||||
@@ -486,7 +486,7 @@ void HPGL_PLOTTER::PlotPoly( const std::vector<wxPoint>& aCornerList, FILL_T aFi
|
||||
m_current_item->content << hpgl_end_polygon_cmd; // Close, fill polygon and draw outlines
|
||||
m_current_item->pen_returns = true;
|
||||
}
|
||||
else if( aWidth > 0 )
|
||||
else if( aWidth != 0 )
|
||||
{
|
||||
// Plot only the polygon outline.
|
||||
for( unsigned ii = 1; ii < aCornerList.size(); ii++ )
|
||||
@@ -659,10 +659,10 @@ void HPGL_PLOTTER::FlashPadCircle( const wxPoint& pos, int diametre,
|
||||
// if filled mode, the pen diameter is removed from diameter
|
||||
// to keep the pad size
|
||||
radius -= KiROUND( penDiameter ) / 2;
|
||||
}
|
||||
|
||||
if( radius < 0 )
|
||||
radius = 0;
|
||||
if( radius < 0 )
|
||||
radius = 0;
|
||||
}
|
||||
|
||||
double rsize = userToDeviceSize( radius );
|
||||
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
* This program source code file is part of KiCad, a free EDA CAD application.
|
||||
*
|
||||
* Copyright (C) 2017 Jean-Pierre Charras, jp.charras at wanadoo.fr
|
||||
* Copyright (C) 2020-2021 KiCad Developers, see AUTHORS.txt for contributors.
|
||||
* Copyright (C) 2020-2022 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
|
||||
@@ -127,13 +127,7 @@ void PSLIKE_PLOTTER::FlashPadCircle( const wxPoint& aPadPos, int aDiameter,
|
||||
else // Plot a ring:
|
||||
{
|
||||
SetCurrentLineWidth( USE_DEFAULT_LINE_WIDTH );
|
||||
int linewidth = GetCurrentLineWidth();
|
||||
|
||||
// avoid aDiameter <= 1 )
|
||||
if( linewidth > aDiameter-2 )
|
||||
linewidth = aDiameter-2;
|
||||
|
||||
Circle( aPadPos, aDiameter - linewidth, FILL_T::NO_FILL, linewidth );
|
||||
Circle( aPadPos, aDiameter, FILL_T::NO_FILL, GetCurrentLineWidth() );
|
||||
}
|
||||
|
||||
SetCurrentLineWidth( USE_DEFAULT_LINE_WIDTH );
|
||||
@@ -152,15 +146,6 @@ void PSLIKE_PLOTTER::FlashPadRect( const wxPoint& aPadPos, const wxSize& aSize,
|
||||
else
|
||||
SetCurrentLineWidth( USE_DEFAULT_LINE_WIDTH );
|
||||
|
||||
size.x -= GetCurrentLineWidth();
|
||||
size.y -= GetCurrentLineWidth();
|
||||
|
||||
if( size.x < 1 )
|
||||
size.x = 1;
|
||||
|
||||
if( size.y < 1 )
|
||||
size.y = 1;
|
||||
|
||||
int dx = size.x / 2;
|
||||
int dy = size.y / 2;
|
||||
|
||||
@@ -203,9 +188,6 @@ void PSLIKE_PLOTTER::FlashPadRoundRect( const wxPoint& aPadPos, const wxSize& aS
|
||||
else
|
||||
{
|
||||
SetCurrentLineWidth( USE_DEFAULT_LINE_WIDTH );
|
||||
size.x -= GetCurrentLineWidth();
|
||||
size.y -= GetCurrentLineWidth();
|
||||
aCornerRadius -= GetCurrentLineWidth() / 2;
|
||||
}
|
||||
|
||||
|
||||
@@ -243,8 +225,6 @@ void PSLIKE_PLOTTER::FlashPadCustom( const wxPoint& aPadPos, const wxSize& aSize
|
||||
else
|
||||
{
|
||||
SetCurrentLineWidth( USE_DEFAULT_LINE_WIDTH );
|
||||
size.x -= GetCurrentLineWidth();
|
||||
size.y -= GetCurrentLineWidth();
|
||||
}
|
||||
|
||||
|
||||
@@ -283,23 +263,6 @@ void PSLIKE_PLOTTER::FlashPadTrapez( const wxPoint& aPadPos, const wxPoint *aCor
|
||||
else
|
||||
{
|
||||
SetCurrentLineWidth( USE_DEFAULT_LINE_WIDTH );
|
||||
int w = GetCurrentLineWidth();
|
||||
|
||||
// offset polygon by w
|
||||
// coord[0] is assumed the lower left
|
||||
// coord[1] is assumed the upper left
|
||||
// coord[2] is assumed the upper right
|
||||
// coord[3] is assumed the lower right
|
||||
|
||||
/* Trace the outline. */
|
||||
cornerList[0].x += w;
|
||||
cornerList[0].y -= w;
|
||||
cornerList[1].x += w;
|
||||
cornerList[1].y += w;
|
||||
cornerList[2].x -= w;
|
||||
cornerList[2].y += w;
|
||||
cornerList[3].x -= w;
|
||||
cornerList[3].y -= w;
|
||||
}
|
||||
|
||||
for( int ii = 0; ii < 4; ii++ )
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
* This program source code file is part of KiCad, a free EDA CAD application.
|
||||
*
|
||||
* Copyright (C) 2017 Jean-Pierre Charras, jp.charras at wanadoo.fr
|
||||
* Copyright (C) 2017-2021 KiCad Developers, see AUTHORS.txt for contributors.
|
||||
* Copyright (C) 2017-2022 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
|
||||
@@ -486,7 +486,7 @@ void PLOTTER::sketchOval( const wxPoint& pos, const wxSize& aSize, double orient
|
||||
}
|
||||
|
||||
deltaxy = size.y - size.x; /* distance between centers of the oval */
|
||||
radius = ( size.x - width ) / 2;
|
||||
radius = size.x / 2;
|
||||
cx = -radius;
|
||||
cy = -deltaxy / 2;
|
||||
RotatePoint( &cx, &cy, orient );
|
||||
|
||||
@@ -2258,6 +2258,10 @@ void CADSTAR_ARCHIVE_PARSER::ATTRCOLORS::Parse( XNODE* aNode, PARSER_CONTEXT* aC
|
||||
attrcol.Parse( cNode, aContext );
|
||||
AttributeColors.insert( { attrcol.AttributeID, attrcol } );
|
||||
}
|
||||
else if( cNodeName == wxT( "INVISIBLE" ) )
|
||||
{
|
||||
IsVisible = false;
|
||||
}
|
||||
else
|
||||
{
|
||||
THROW_UNKNOWN_NODE_IO_ERROR( cNodeName, aNode->GetName() );
|
||||
|
||||
@@ -1253,6 +1253,8 @@ public:
|
||||
DFLTSETTINGS DefaultSettings;
|
||||
std::map<ATTRIBUTE_ID, ATTRCOL> AttributeColors;
|
||||
|
||||
bool IsVisible = true; // unclear what this represents - maybe all attributes are hidden?
|
||||
|
||||
void Parse( XNODE* aNode, PARSER_CONTEXT* aContext ) override;
|
||||
};
|
||||
|
||||
|
||||
@@ -96,7 +96,12 @@ static struct PGM_SINGLE_TOP : public PGM_BASE
|
||||
KIWAY_PLAYER* frame = (KIWAY_PLAYER*) App().GetTopWindow();
|
||||
#endif
|
||||
if( frame )
|
||||
{
|
||||
if( wxWindow* blocking_win = frame->Kiway().GetBlockingDialog() )
|
||||
blocking_win->Close( true );
|
||||
|
||||
frame->OpenProjectFiles( std::vector<wxString>( 1, aFileName ) );
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -335,7 +335,12 @@ void ACTION_TOOLBAR::doSelectAction( ACTION_GROUP* aGroup, const TOOL_ACTION& aA
|
||||
// Update the item information
|
||||
item->SetShortHelp( aAction.GetDescription() );
|
||||
item->SetBitmap( KiScaledBitmap( aAction.GetIcon(), GetParent() ) );
|
||||
#if wxCHECK_VERSION( 3, 1, 6 )
|
||||
item->SetDisabledBitmap(
|
||||
MakeDisabledBitmap( item->GetBitmapBundle().GetBitmapFor( GetParent() ) ) );
|
||||
#else
|
||||
item->SetDisabledBitmap( MakeDisabledBitmap( item->GetBitmap() ) );
|
||||
#endif
|
||||
|
||||
// Register a new handler with the new UI conditions
|
||||
if( m_toolManager )
|
||||
|
||||
@@ -177,6 +177,13 @@ int COMMON_CONTROL::ShowPlayer( const TOOL_EVENT& aEvent )
|
||||
if( wxWindow::FindFocus() != editor )
|
||||
editor->SetFocus();
|
||||
|
||||
// If the player is currently blocked, focus the user attention on the correct window
|
||||
if( wxWindow* blocking_win = editor->Kiway().GetBlockingDialog() )
|
||||
{
|
||||
blocking_win->Raise();
|
||||
blocking_win->SetFocus();
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
@@ -452,7 +452,7 @@ void TOOL_DISPATCHER::DispatchWxEvent( wxEvent& aEvent )
|
||||
{
|
||||
wxWindow* holderWindow = dynamic_cast<wxWindow*>( m_toolMgr->GetToolHolder() );
|
||||
|
||||
#if defined( _WIN32 )
|
||||
#if defined( _WIN32 ) || defined( __WXGTK__ )
|
||||
// Mouse events may trigger regardless of window status (windows feature)
|
||||
// However we need to avoid focus fighting (especially modals)
|
||||
if( holderWindow && KIPLATFORM::UI::IsWindowActive( holderWindow ) )
|
||||
|
||||
@@ -206,7 +206,8 @@ TOOL_MANAGER::TOOL_MANAGER() :
|
||||
m_warpMouseAfterContextMenu( true ),
|
||||
m_menuActive( false ),
|
||||
m_menuOwner( -1 ),
|
||||
m_activeState( nullptr )
|
||||
m_activeState( nullptr ),
|
||||
m_shuttingDown( false )
|
||||
{
|
||||
m_actionMgr = new ACTION_MANAGER( this );
|
||||
}
|
||||
@@ -313,6 +314,9 @@ VECTOR2D TOOL_MANAGER::GetCursorPosition() const
|
||||
|
||||
bool TOOL_MANAGER::RunAction( const TOOL_ACTION& aAction, bool aNow, void* aParam )
|
||||
{
|
||||
if( m_shuttingDown )
|
||||
return true;
|
||||
|
||||
bool handled = false;
|
||||
TOOL_EVENT event = aAction.MakeEvent();
|
||||
|
||||
@@ -446,10 +450,22 @@ bool TOOL_MANAGER::runTool( TOOL_BASE* aTool )
|
||||
|
||||
void TOOL_MANAGER::ShutdownAllTools()
|
||||
{
|
||||
m_shuttingDown = true;
|
||||
|
||||
// Create a temporary list of tools to iterate over since when the tools shutdown
|
||||
// they remove themselves from the list automatically (invalidating the iterator)
|
||||
ID_LIST tmpList = m_activeTools;
|
||||
|
||||
// Make sure each tool knows that it is shutting down, so that loops get shut down
|
||||
// at the dispatcher
|
||||
for( auto id : tmpList )
|
||||
{
|
||||
if( m_toolIdIndex.count( id ) == 0 )
|
||||
continue;
|
||||
|
||||
m_toolIdIndex[id]->shutdown = true;
|
||||
}
|
||||
|
||||
for( auto id : tmpList )
|
||||
{
|
||||
ShutdownTool( id );
|
||||
@@ -949,6 +965,11 @@ TOOL_MANAGER::ID_LIST::iterator TOOL_MANAGER::finishTool( TOOL_STATE* aState )
|
||||
|
||||
bool TOOL_MANAGER::ProcessEvent( const TOOL_EVENT& aEvent )
|
||||
{
|
||||
// Once the tool manager is shutting down, don't start
|
||||
// activating more tools
|
||||
if( m_shuttingDown )
|
||||
return true;
|
||||
|
||||
bool handled = processEvent( aEvent );
|
||||
|
||||
TOOL_STATE* activeTool = GetCurrentToolState();
|
||||
|
||||
@@ -459,8 +459,8 @@ void WX_VIEW_CONTROLS::onEnter( wxMouseEvent& aEvent )
|
||||
return;
|
||||
}
|
||||
|
||||
#if defined( _WIN32 )
|
||||
// Win32 transmits mouse move and wheel events to all controls below the mouse regardless
|
||||
#if defined( _WIN32 ) || defined( __WXGTK__ )
|
||||
// Win32 and some *nix WMs transmit mouse move and wheel events to all controls below the mouse regardless
|
||||
// of focus. Forcing the focus here will cause the EDA FRAMES to immediately become the
|
||||
// top level active window.
|
||||
if( m_parentPanel->GetParent() != nullptr )
|
||||
|
||||
@@ -298,10 +298,11 @@ void GRID_CELL_FOOTPRINT_ID_EDITOR::Create( wxWindow* aParent, wxWindowID aId,
|
||||
class TEXT_BUTTON_URL : public wxComboCtrl
|
||||
{
|
||||
public:
|
||||
TEXT_BUTTON_URL( wxWindow* aParent, DIALOG_SHIM* aParentDlg ) :
|
||||
TEXT_BUTTON_URL( wxWindow* aParent, DIALOG_SHIM* aParentDlg, SEARCH_STACK* aSearchStack ) :
|
||||
wxComboCtrl( aParent, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize,
|
||||
wxTE_PROCESS_ENTER ),
|
||||
m_dlg( aParentDlg )
|
||||
m_dlg( aParentDlg ),
|
||||
m_searchStack( aSearchStack )
|
||||
{
|
||||
SetButtonBitmaps( KiBitmap( BITMAPS::www ) );
|
||||
|
||||
@@ -320,17 +321,18 @@ protected:
|
||||
wxString filename = GetValue();
|
||||
|
||||
if( !filename.IsEmpty() && filename != wxT( "~" ) )
|
||||
GetAssociatedDocument( m_dlg, GetValue(), &m_dlg->Prj() );
|
||||
GetAssociatedDocument( m_dlg, GetValue(), &m_dlg->Prj(), m_searchStack );
|
||||
}
|
||||
|
||||
DIALOG_SHIM* m_dlg;
|
||||
SEARCH_STACK* m_searchStack;
|
||||
};
|
||||
|
||||
|
||||
void GRID_CELL_URL_EDITOR::Create( wxWindow* aParent, wxWindowID aId,
|
||||
wxEvtHandler* aEventHandler )
|
||||
{
|
||||
m_control = new TEXT_BUTTON_URL( aParent, m_dlg );
|
||||
m_control = new TEXT_BUTTON_URL( aParent, m_dlg, m_searchStack );
|
||||
|
||||
#if wxUSE_VALIDATORS
|
||||
// validate text in textctrl, if validator is set
|
||||
|
||||
@@ -250,7 +250,7 @@ bool UNIT_BINDER::Validate( double aMin, double aMax, EDA_UNITS aUnits )
|
||||
}
|
||||
|
||||
|
||||
void UNIT_BINDER::SetValue( int aValue )
|
||||
void UNIT_BINDER::SetValue( long long int aValue )
|
||||
{
|
||||
double value = aValue;
|
||||
double displayValue = m_originTransforms.ToDisplay( value, m_coordType );
|
||||
|
||||
@@ -276,9 +276,10 @@ void CVPCB_MAINFRAME::setupUIConditions()
|
||||
#define ENABLE( x ) ACTION_CONDITIONS().Enable( x )
|
||||
#define CHECK( x ) ACTION_CONDITIONS().Check( x )
|
||||
|
||||
mgr->SetConditions( CVPCB_ACTIONS::saveAssociations, ENABLE( cond.ContentModified() ) );
|
||||
mgr->SetConditions( ACTIONS::undo, ENABLE( cond.UndoAvailable() ) );
|
||||
mgr->SetConditions( ACTIONS::redo, ENABLE( cond.RedoAvailable() ) );
|
||||
mgr->SetConditions( CVPCB_ACTIONS::saveAssociationsToSchematic, ENABLE( cond.ContentModified() ) );
|
||||
mgr->SetConditions( CVPCB_ACTIONS::saveAssociationsToFile, ENABLE( cond.ContentModified() ) );
|
||||
mgr->SetConditions( ACTIONS::undo, ENABLE( cond.UndoAvailable() ) );
|
||||
mgr->SetConditions( ACTIONS::redo, ENABLE( cond.RedoAvailable() ) );
|
||||
|
||||
auto compFilter =
|
||||
[this] ( const SELECTION& )
|
||||
@@ -327,7 +328,7 @@ void CVPCB_MAINFRAME::setupEventHandlers()
|
||||
[this]( wxCommandEvent& )
|
||||
{
|
||||
// saveAssociations must be run immediately
|
||||
GetToolManager()->RunAction( CVPCB_ACTIONS::saveAssociations, true );
|
||||
GetToolManager()->RunAction( CVPCB_ACTIONS::saveAssociationsToFile, true );
|
||||
} );
|
||||
|
||||
// Connect the handlers for the ok/cancel buttons
|
||||
@@ -335,7 +336,7 @@ void CVPCB_MAINFRAME::setupEventHandlers()
|
||||
[this]( wxCommandEvent& )
|
||||
{
|
||||
// saveAssociations must be run immediately, before running Close( true )
|
||||
GetToolManager()->RunAction( CVPCB_ACTIONS::saveAssociations, true );
|
||||
GetToolManager()->RunAction( CVPCB_ACTIONS::saveAssociationsToSchematic, true );
|
||||
Close( true );
|
||||
}, wxID_OK );
|
||||
Bind( wxEVT_BUTTON,
|
||||
|
||||
+1
-1
@@ -46,7 +46,7 @@ void CVPCB_MAINFRAME::ReCreateMenuBar()
|
||||
//
|
||||
ACTION_MENU* fileMenu = new ACTION_MENU( false, tool );
|
||||
|
||||
fileMenu->Add( CVPCB_ACTIONS::saveAssociations );
|
||||
fileMenu->Add( CVPCB_ACTIONS::saveAssociationsToSchematic );
|
||||
fileMenu->AppendSeparator();
|
||||
fileMenu->AddClose( _( "Assign Footprints" ) );
|
||||
|
||||
|
||||
@@ -46,7 +46,7 @@ void CVPCB_MAINFRAME::ReCreateHToolbar()
|
||||
m_mainToolBar->SetAuiManager( &m_auimgr );
|
||||
}
|
||||
|
||||
m_mainToolBar->Add( CVPCB_ACTIONS::saveAssociations );
|
||||
m_mainToolBar->Add( CVPCB_ACTIONS::saveAssociationsToSchematic );
|
||||
|
||||
m_mainToolBar->AddScaledSeparator( this );
|
||||
m_mainToolBar->Add( ACTIONS::showFootprintLibTable );
|
||||
|
||||
@@ -61,13 +61,20 @@ TOOL_ACTION CVPCB_ACTIONS::showEquFileTable( "cvpcb.Control.ShowEquFileTable",
|
||||
_( "Configure footprint association file (.equ) list. These files are "
|
||||
"used to automatically assign footprint names from symbol values." ) );
|
||||
|
||||
TOOL_ACTION CVPCB_ACTIONS::saveAssociations( "cvpcb.Control.SaveAssociations",
|
||||
TOOL_ACTION CVPCB_ACTIONS::saveAssociationsToSchematic( "cvpcb.Control.SaveAssociationsToSchematic",
|
||||
AS_GLOBAL,
|
||||
MD_CTRL + 'S', LEGACY_HK_NAME( "Save" ),
|
||||
_( "Save to Schematic" ),
|
||||
_( "Save footprint associations in schematic symbol footprint fields" ),
|
||||
BITMAPS::save );
|
||||
|
||||
TOOL_ACTION CVPCB_ACTIONS::saveAssociationsToFile( "cvpcb.Control.SaveAssociationsToFile",
|
||||
AS_GLOBAL,
|
||||
MD_CTRL + 'S', LEGACY_HK_NAME( "Save" ),
|
||||
_( "Save to Schematic and File" ),
|
||||
_( "Save footprint associations in schematic symbol footprint fields and schematic files" ),
|
||||
BITMAPS::save );
|
||||
|
||||
// Actions to navigate the display
|
||||
TOOL_ACTION CVPCB_ACTIONS::changeFocusRight( "cvpcb.Control.changeFocusRight",
|
||||
AS_GLOBAL,
|
||||
|
||||
@@ -53,7 +53,8 @@ public:
|
||||
static TOOL_ACTION gotoNextNA;
|
||||
|
||||
/// Management actions
|
||||
static TOOL_ACTION saveAssociations;
|
||||
static TOOL_ACTION saveAssociationsToSchematic;
|
||||
static TOOL_ACTION saveAssociationsToFile;
|
||||
static TOOL_ACTION showEquFileTable;
|
||||
|
||||
/// Footprint Association actions
|
||||
|
||||
@@ -167,6 +167,9 @@ int CVPCB_CONTROL::ShowFootprintViewer( const TOOL_EVENT& aEvent )
|
||||
}
|
||||
else
|
||||
{
|
||||
if( wxWindow* blocking_win = fpframe->Kiway().GetBlockingDialog() )
|
||||
blocking_win->Close( true );
|
||||
|
||||
if( fpframe->IsIconized() )
|
||||
fpframe->Iconize( false );
|
||||
|
||||
@@ -210,13 +213,20 @@ int CVPCB_CONTROL::ShowEquFileTable( const TOOL_EVENT& aEvent )
|
||||
}
|
||||
|
||||
|
||||
int CVPCB_CONTROL::SaveAssociations( const TOOL_EVENT& aEvent )
|
||||
int CVPCB_CONTROL::SaveAssociationsToFile( const TOOL_EVENT& aEvent )
|
||||
{
|
||||
m_frame->SaveFootprintAssociation( true );
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
int CVPCB_CONTROL::SaveAssociationsToSchematic( const TOOL_EVENT& aEvent )
|
||||
{
|
||||
m_frame->SaveFootprintAssociation( false );
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
int CVPCB_CONTROL::ToNA( const TOOL_EVENT& aEvent )
|
||||
{
|
||||
int tmp = aEvent.Parameter<intptr_t>();
|
||||
@@ -231,8 +241,9 @@ int CVPCB_CONTROL::ToNA( const TOOL_EVENT& aEvent )
|
||||
return 0;
|
||||
|
||||
// Extract the current selection
|
||||
unsigned int curSel = -1;
|
||||
unsigned int newSel = -1;
|
||||
bool changeSel = false;
|
||||
unsigned int newSel = UINT_MAX;
|
||||
|
||||
switch( dir )
|
||||
{
|
||||
case CVPCB_MAINFRAME::ITEM_NEXT:
|
||||
@@ -240,11 +251,12 @@ int CVPCB_CONTROL::ToNA( const TOOL_EVENT& aEvent )
|
||||
newSel = tempSel.front();
|
||||
|
||||
// Find the next index in the component list
|
||||
for( unsigned int i : naComp )
|
||||
for( unsigned int idx : naComp )
|
||||
{
|
||||
if( i > newSel )
|
||||
if( idx > newSel )
|
||||
{
|
||||
newSel = i;
|
||||
changeSel = true;
|
||||
newSel = idx;
|
||||
break;
|
||||
}
|
||||
}
|
||||
@@ -255,7 +267,19 @@ int CVPCB_CONTROL::ToNA( const TOOL_EVENT& aEvent )
|
||||
if( !tempSel.empty() )
|
||||
{
|
||||
newSel = tempSel.front();
|
||||
curSel = newSel - 1; // Break one before the current selection
|
||||
|
||||
// Find the previous index in the component list
|
||||
for( int jj = naComp.size()-1; jj >= 0; jj-- )
|
||||
{
|
||||
unsigned idx = naComp[jj];
|
||||
|
||||
if( idx < newSel )
|
||||
{
|
||||
changeSel = true;
|
||||
newSel = idx;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
break;
|
||||
@@ -264,18 +288,9 @@ int CVPCB_CONTROL::ToNA( const TOOL_EVENT& aEvent )
|
||||
wxASSERT_MSG( false, wxT( "Invalid direction" ) );
|
||||
}
|
||||
|
||||
// Find the next index in the component list
|
||||
for( unsigned int i : naComp )
|
||||
{
|
||||
if( i >= curSel )
|
||||
{
|
||||
newSel = i;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
// Set the component selection
|
||||
m_frame->SetSelectedComponent( newSel );
|
||||
// Set the new component selection
|
||||
if( changeSel )
|
||||
m_frame->SetSelectedComponent( newSel );
|
||||
|
||||
return 0;
|
||||
}
|
||||
@@ -310,7 +325,8 @@ void CVPCB_CONTROL::setTransitions()
|
||||
|
||||
// Management actions
|
||||
Go( &CVPCB_CONTROL::ShowEquFileTable, CVPCB_ACTIONS::showEquFileTable.MakeEvent() );
|
||||
Go( &CVPCB_CONTROL::SaveAssociations, CVPCB_ACTIONS::saveAssociations.MakeEvent() );
|
||||
Go( &CVPCB_CONTROL::SaveAssociationsToSchematic, CVPCB_ACTIONS::saveAssociationsToSchematic.MakeEvent() );
|
||||
Go( &CVPCB_CONTROL::SaveAssociationsToFile,CVPCB_ACTIONS::saveAssociationsToFile.MakeEvent() );
|
||||
|
||||
// Navigation actions
|
||||
Go( &CVPCB_CONTROL::ToNA, CVPCB_ACTIONS::gotoNextNA.MakeEvent() );
|
||||
|
||||
@@ -75,7 +75,14 @@ public:
|
||||
*
|
||||
* @param aEvent is the event generated by the tool framework
|
||||
*/
|
||||
int SaveAssociations( const TOOL_EVENT& aEvent );
|
||||
int SaveAssociationsToSchematic( const TOOL_EVENT& aEvent );
|
||||
|
||||
/**
|
||||
* Save the associations to the schematic and save schematic to file.
|
||||
*
|
||||
* @param aEvent is the event generated by the tool framework
|
||||
*/
|
||||
int SaveAssociationsToFile( const TOOL_EVENT& aEvent );
|
||||
|
||||
/**
|
||||
* Create or Update the frame showing the current highlighted footprint
|
||||
|
||||
@@ -49,10 +49,7 @@ void SCH_EDIT_FRAME::mapExistingAnnotation( std::map<wxString, wxString>& aMap )
|
||||
|
||||
curr_full_uuid.push_back( symbol->m_Uuid );
|
||||
|
||||
wxString ref = symbol->GetRef( curr_sheetpath );
|
||||
|
||||
if( symbol->GetUnitCount() > 1 )
|
||||
ref << LIB_SYMBOL::SubReference( symbol->GetUnitSelection( curr_sheetpath ) );
|
||||
wxString ref = symbol->GetRef( curr_sheetpath, true );
|
||||
|
||||
if( symbol->IsAnnotated( curr_sheetpath ) )
|
||||
aMap[ curr_full_uuid.AsString() ] = ref;
|
||||
|
||||
@@ -2714,8 +2714,21 @@ bool CONNECTION_GRAPH::ercCheckNoConnects( const CONNECTION_SUBGRAPH* aSubgraph
|
||||
{
|
||||
case SCH_PIN_T:
|
||||
{
|
||||
if( !pins.empty() )
|
||||
has_other_connections = true;
|
||||
// Stacked pins do not count as other connections but non-stacked pins do
|
||||
if( !has_other_connections && !pins.empty() )
|
||||
{
|
||||
SCH_PIN* pin = static_cast<SCH_PIN*>( item );
|
||||
|
||||
for( SCH_PIN* other_pin : pins )
|
||||
{
|
||||
if( other_pin->GetParent() != pin->GetParent()
|
||||
|| other_pin->GetPosition() != pin->GetPosition() )
|
||||
{
|
||||
has_other_connections = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
pins.emplace_back( static_cast<SCH_PIN*>( item ) );
|
||||
|
||||
|
||||
@@ -379,7 +379,8 @@ void SCH_EDIT_FRAME::ExecuteRemoteCommand( const char* cmdline )
|
||||
}
|
||||
|
||||
|
||||
std::string FormatProbeItem( EDA_ITEM* aItem, SCH_SYMBOL* aSymbol )
|
||||
std::string FormatProbeItem( const SCH_SHEET_PATH& aCurrentSheet, EDA_ITEM* aItem,
|
||||
SCH_SYMBOL* aSymbol )
|
||||
{
|
||||
// This is a keyword followed by a quoted string.
|
||||
|
||||
@@ -403,20 +404,8 @@ std::string FormatProbeItem( EDA_ITEM* aItem, SCH_SYMBOL* aSymbol )
|
||||
{
|
||||
// For cross probing, we need the full path of the sheet, because
|
||||
// in complex hierarchies the sheet uuid of not unique
|
||||
SCH_SHEET* sheet = (SCH_SHEET*)aItem;
|
||||
wxString full_path;
|
||||
|
||||
SCH_SHEET* parent = sheet;
|
||||
while( (parent = dynamic_cast<SCH_SHEET*>( parent->GetParent() ) ) )
|
||||
{
|
||||
if( parent->GetParent() ) // The root sheet has no parent and path is just "/"
|
||||
{
|
||||
full_path.Prepend( parent->m_Uuid.AsString() );
|
||||
full_path.Prepend( "/" );
|
||||
}
|
||||
}
|
||||
|
||||
full_path += "/" + sheet->m_Uuid.AsString();
|
||||
wxString full_path = aCurrentSheet.PathAsString() + aItem->m_Uuid.AsString();
|
||||
|
||||
return StrPrintf( "$SHEET: \"%s\"", TO_UTF8( full_path ) );
|
||||
}
|
||||
@@ -454,7 +443,7 @@ void SCH_EDIT_FRAME::SendMessageToPCBNEW( EDA_ITEM* aObjectToSync, SCH_SYMBOL* a
|
||||
if( !aObjectToSync )
|
||||
return;
|
||||
|
||||
std::string packet = FormatProbeItem( aObjectToSync, aLibItem );
|
||||
std::string packet = FormatProbeItem( GetCurrentSheet(), aObjectToSync, aLibItem );
|
||||
|
||||
if( !packet.empty() )
|
||||
{
|
||||
|
||||
@@ -283,7 +283,7 @@ DIALOG_GLOBAL_EDIT_TEXT_AND_GRAPHICS_BASE::DIALOG_GLOBAL_EDIT_TEXT_AND_GRAPHICS_
|
||||
fgSizer1->Add( m_staticline3, 0, wxEXPAND|wxTOP|wxBOTTOM, 7 );
|
||||
|
||||
m_staticline4 = new wxStaticLine( m_specifiedValues, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxLI_HORIZONTAL );
|
||||
fgSizer1->Add( m_staticline4, 0, wxEXPAND|wxBOTTOM, 7 );
|
||||
fgSizer1->Add( m_staticline4, 0, wxEXPAND|wxTOP|wxBOTTOM, 7 );
|
||||
|
||||
m_staticline5 = new wxStaticLine( m_specifiedValues, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxLI_HORIZONTAL );
|
||||
fgSizer1->Add( m_staticline5, 0, wxEXPAND|wxTOP|wxBOTTOM|wxRIGHT, 7 );
|
||||
|
||||
@@ -2956,7 +2956,7 @@
|
||||
</object>
|
||||
<object class="sizeritem" expanded="1">
|
||||
<property name="border">7</property>
|
||||
<property name="flag">wxEXPAND|wxBOTTOM</property>
|
||||
<property name="flag">wxEXPAND|wxTOP|wxBOTTOM</property>
|
||||
<property name="proportion">0</property>
|
||||
<object class="wxStaticLine" expanded="1">
|
||||
<property name="BottomDockable">1</property>
|
||||
|
||||
@@ -72,7 +72,7 @@ DIALOG_LIB_SYMBOL_PROPERTIES::DIALOG_LIB_SYMBOL_PROPERTIES( SYMBOL_EDIT_FRAME* a
|
||||
m_grid->ShowHideColumns( cfg->m_EditSymbolVisibleColumns );
|
||||
|
||||
wxGridCellAttr* attr = new wxGridCellAttr;
|
||||
attr->SetEditor( new GRID_CELL_URL_EDITOR( this ) );
|
||||
attr->SetEditor( new GRID_CELL_URL_EDITOR( this, Prj().SchSearchS() ) );
|
||||
m_grid->SetAttr( DATASHEET_FIELD, FDC_VALUE, attr );
|
||||
|
||||
m_SymbolNameCtrl->SetValidator( SCH_FIELD_VALIDATOR( true, VALUE_FIELD ) );
|
||||
@@ -308,7 +308,7 @@ bool DIALOG_LIB_SYMBOL_PROPERTIES::TransferDataFromWindow()
|
||||
return false;
|
||||
|
||||
// We need to keep the name and the value the same at the moment!
|
||||
wxString newName = m_fields->at( VALUE_FIELD ).GetText();
|
||||
wxString newName = EscapeString( m_fields->at( VALUE_FIELD ).GetText(), CTX_LIBID );
|
||||
wxString oldName = m_libEntry->GetName();
|
||||
|
||||
if( oldName != newName )
|
||||
@@ -471,7 +471,10 @@ void DIALOG_LIB_SYMBOL_PROPERTIES::OnSymbolNameKillFocus( wxFocusEvent& event )
|
||||
m_delayedFocusPage = 0;
|
||||
|
||||
if( m_SymbolNameCtrl->GetValidator()->Validate( m_SymbolNameCtrl ) )
|
||||
{
|
||||
m_delayedFocusCtrl = nullptr;
|
||||
m_delayedFocusPage = -1;
|
||||
}
|
||||
}
|
||||
|
||||
event.Skip();
|
||||
|
||||
@@ -802,7 +802,7 @@ void DIALOG_PLOT_SCHEMATIC::createPDFFile( bool aPlotAll, bool aPlotDrawingSheet
|
||||
plotter->SetRenderSettings( aRenderSettings );
|
||||
plotter->SetColorMode( getModeColor() );
|
||||
plotter->SetCreator( wxT( "Eeschema-PDF" ) );
|
||||
plotter->SetTitle( m_parent->GetTitleBlock().GetTitle() );
|
||||
plotter->SetTitle( ExpandTextVars( m_parent->GetTitleBlock().GetTitle(), &m_parent->Prj() ) );
|
||||
|
||||
wxString msg;
|
||||
wxFileName plotFileName;
|
||||
|
||||
@@ -171,6 +171,12 @@ bool DIALOG_PRINT_USING_PRINTER::TransferDataToWindow()
|
||||
{
|
||||
EESCHEMA_SETTINGS* cfg = m_parent->eeconfig();
|
||||
|
||||
if( cfg->m_Printing.monochrome )
|
||||
{
|
||||
m_checkBackgroundColor->SetValue( false );
|
||||
m_checkBackgroundColor->Enable( false );
|
||||
}
|
||||
|
||||
m_checkReference->SetValue( cfg->m_Printing.title_block );
|
||||
m_checkMonochrome->SetValue( cfg->m_Printing.monochrome );
|
||||
m_checkBackgroundColor->SetValue( cfg->m_Printing.background );
|
||||
@@ -246,7 +252,10 @@ void DIALOG_PRINT_USING_PRINTER::SavePrintOptions()
|
||||
|
||||
cfg->m_Printing.monochrome = m_checkMonochrome->IsChecked();
|
||||
cfg->m_Printing.title_block = m_checkReference->IsChecked();
|
||||
cfg->m_Printing.background = m_checkBackgroundColor->IsChecked();
|
||||
|
||||
if( m_checkBackgroundColor->IsEnabled() )
|
||||
cfg->m_Printing.background = m_checkBackgroundColor->IsChecked();
|
||||
|
||||
cfg->m_Printing.use_theme = m_checkUseColorTheme->IsChecked();
|
||||
|
||||
COLOR_SETTINGS* theme = static_cast<COLOR_SETTINGS*>(
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
* This program source code file is part of KiCad, a free EDA CAD application.
|
||||
*
|
||||
* Copyright (C) 2010 Wayne Stambaugh <stambaughw@verizon.net>
|
||||
* Copyright (C) 2010-2019 KiCad Developers, see AUTHORS.txt for contributors.
|
||||
* Copyright (C) 2010-2022 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
|
||||
@@ -196,6 +196,14 @@ void DIALOG_SCH_FIND::OnReplaceWithEnter( wxCommandEvent& aEvent )
|
||||
|
||||
void DIALOG_SCH_FIND::OnOptions( wxCommandEvent& aEvent )
|
||||
{
|
||||
updateFlags();
|
||||
m_findDirty = true;
|
||||
}
|
||||
|
||||
|
||||
void DIALOG_SCH_FIND::updateFlags()
|
||||
{
|
||||
// Rebuild the search flags in m_findReplaceData from dialog settings
|
||||
int flags = 0;
|
||||
|
||||
if( m_radioForward->GetValue() )
|
||||
@@ -223,12 +231,13 @@ void DIALOG_SCH_FIND::OnOptions( wxCommandEvent& aEvent )
|
||||
flags |= FR_REPLACE_REFERENCES;
|
||||
|
||||
m_findReplaceData->SetFlags( flags );
|
||||
m_findDirty = true;
|
||||
}
|
||||
|
||||
|
||||
void DIALOG_SCH_FIND::OnFind( wxCommandEvent& aEvent )
|
||||
{
|
||||
updateFlags(); // Ensure search flags are up to date
|
||||
|
||||
int index = m_comboFind->FindString( m_comboFind->GetValue(), true );
|
||||
|
||||
if( index == wxNOT_FOUND )
|
||||
@@ -250,6 +259,8 @@ void DIALOG_SCH_FIND::OnFind( wxCommandEvent& aEvent )
|
||||
|
||||
void DIALOG_SCH_FIND::OnReplace( wxCommandEvent& aEvent )
|
||||
{
|
||||
updateFlags(); // Ensure search flags are up to date
|
||||
|
||||
int index = m_comboReplace->FindString( m_comboReplace->GetValue(), true );
|
||||
|
||||
if( index == wxNOT_FOUND )
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
* This program source code file is part of KiCad, a free EDA CAD application.
|
||||
*
|
||||
* Copyright (C) 2010 Wayne Stambaugh <stambaughw@gmail.com>
|
||||
* Copyright (C) 2010-2021 KiCad Developers, see AUTHORS.txt for contributors.
|
||||
* Copyright (C) 2010-2022 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
|
||||
@@ -75,6 +75,9 @@ protected:
|
||||
void OnFind( wxCommandEvent& aEvent ) override;
|
||||
void OnReplace( wxCommandEvent& aEvent ) override;
|
||||
|
||||
// Rebuild the search flags from dialog settings
|
||||
void updateFlags();
|
||||
|
||||
SCH_EDIT_FRAME* m_frame;
|
||||
SCH_EDITOR_CONTROL* m_editorControl;
|
||||
wxFindReplaceData* m_findReplaceData;
|
||||
|
||||
@@ -37,6 +37,7 @@
|
||||
#include <sch_reference_list.h>
|
||||
#include <schematic.h>
|
||||
#include <tools/sch_editor_control.h>
|
||||
#include <kiplatform/ui.h>
|
||||
#include <widgets/grid_text_button_helpers.h>
|
||||
#include <widgets/wx_grid.h>
|
||||
#include <wx/grid.h>
|
||||
@@ -114,7 +115,7 @@ protected:
|
||||
{
|
||||
wxString datasheet_uri = m_grid->GetCellValue( m_grid->GetGridCursorRow(),
|
||||
DATASHEET_FIELD );
|
||||
GetAssociatedDocument( m_dlg, datasheet_uri, &m_dlg->Prj() );
|
||||
GetAssociatedDocument( m_dlg, datasheet_uri, &m_dlg->Prj(), m_dlg->Prj().SchSearchS() );
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -778,7 +779,7 @@ DIALOG_SYMBOL_FIELDS_TABLE::DIALOG_SYMBOL_FIELDS_TABLE( SCH_EDIT_FRAME* parent )
|
||||
|
||||
// set datasheet column viewer button
|
||||
attr = new wxGridCellAttr;
|
||||
attr->SetEditor( new GRID_CELL_URL_EDITOR( this ) );
|
||||
attr->SetEditor( new GRID_CELL_URL_EDITOR( this, Prj().SchSearchS() ) );
|
||||
m_grid->SetColAttr( DATASHEET_FIELD, attr );
|
||||
|
||||
// set quantities column attributes
|
||||
@@ -1179,8 +1180,8 @@ void DIALOG_SYMBOL_FIELDS_TABLE::OnTableItemContextMenu( wxGridEvent& event )
|
||||
|
||||
void DIALOG_SYMBOL_FIELDS_TABLE::OnSizeFieldList( wxSizeEvent& event )
|
||||
{
|
||||
int nameColWidth = event.GetSize().GetX() - m_showColWidth - m_groupByColWidth
|
||||
- wxSystemSettings::GetMetric( wxSYS_VSCROLL_X );
|
||||
int nameColWidth = KIPLATFORM::UI::GetUnobscuredSize( m_fieldsCtrl ).x - m_showColWidth
|
||||
- m_groupByColWidth;
|
||||
|
||||
// GTK loses its head and messes these up when resizing the splitter bar:
|
||||
m_fieldsCtrl->GetColumn( SHOW_FIELD_COLUMN )->SetWidth( m_showColWidth );
|
||||
@@ -1189,6 +1190,8 @@ void DIALOG_SYMBOL_FIELDS_TABLE::OnSizeFieldList( wxSizeEvent& event )
|
||||
m_fieldsCtrl->GetColumn( CANONICAL_NAME_COLUMN )->SetHidden( true );
|
||||
m_fieldsCtrl->GetColumn( DISPLAY_NAME_COLUMN )->SetWidth( nameColWidth );
|
||||
|
||||
m_fieldsCtrl->Refresh(); // To refresh checkboxes on Windows.
|
||||
|
||||
event.Skip();
|
||||
}
|
||||
|
||||
|
||||
@@ -635,7 +635,7 @@ bool DIALOG_SYMBOL_PROPERTIES::TransferDataFromWindow()
|
||||
|
||||
switch( m_mirrorCtrl->GetSelection() )
|
||||
{
|
||||
case 0: break;
|
||||
case 0: break;
|
||||
case 1: m_symbol->SetOrientation( SYM_MIRROR_X ); break;
|
||||
case 2: m_symbol->SetOrientation( SYM_MIRROR_Y ); break;
|
||||
}
|
||||
|
||||
@@ -176,17 +176,22 @@ bool DIALOG_TEXT_AND_LABEL_PROPERTIES::TransferDataToWindow()
|
||||
if( !wxDialog::TransferDataToWindow() )
|
||||
return false;
|
||||
|
||||
SCHEMATIC& schematic = m_Parent->Schematic();
|
||||
|
||||
if( m_CurrentText->Type() == SCH_TEXT_T )
|
||||
{
|
||||
SCHEMATIC& schematic = m_Parent->Schematic();
|
||||
|
||||
// show text variable cross-references in a human-readable format
|
||||
m_valueMultiLine->SetValue( schematic.ConvertKIIDsToRefs( m_CurrentText->GetText() ) );
|
||||
}
|
||||
else
|
||||
{
|
||||
// show control characters in a human-readable format
|
||||
m_activeTextEntry->SetValue( UnescapeString( m_CurrentText->GetText() ) );
|
||||
wxString text = UnescapeString( m_CurrentText->GetText() );
|
||||
|
||||
// show text variable cross-references in a human-readable format
|
||||
text = schematic.ConvertKIIDsToRefs( text );
|
||||
|
||||
m_activeTextEntry->SetValue( text );
|
||||
}
|
||||
|
||||
if( m_valueCombo->IsShown() )
|
||||
@@ -315,7 +320,8 @@ bool DIALOG_TEXT_AND_LABEL_PROPERTIES::TransferDataFromWindow()
|
||||
if( !m_textSize.Validate( 0.01, 1000.0, EDA_UNITS::MILLIMETRES ) )
|
||||
return false;
|
||||
|
||||
wxString text;
|
||||
SCHEMATIC& schematic = m_Parent->Schematic();
|
||||
wxString text;
|
||||
|
||||
/* save old text in undo list if not already in edit */
|
||||
if( m_CurrentText->GetEditFlags() == 0 )
|
||||
@@ -325,8 +331,7 @@ bool DIALOG_TEXT_AND_LABEL_PROPERTIES::TransferDataFromWindow()
|
||||
|
||||
if( m_CurrentText->Type() == SCH_TEXT_T )
|
||||
{
|
||||
// convert any text variable cross-references to their UUIDs
|
||||
text = m_Parent->Schematic().ConvertRefsToKIIDs( m_valueMultiLine->GetValue() );
|
||||
text = m_valueMultiLine->GetValue();
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -334,6 +339,9 @@ bool DIALOG_TEXT_AND_LABEL_PROPERTIES::TransferDataFromWindow()
|
||||
text = EscapeString( m_activeTextEntry->GetValue(), CTX_NETNAME );
|
||||
}
|
||||
|
||||
// convert any text variable cross-references to their UUIDs
|
||||
text = schematic.ConvertRefsToKIIDs( text );
|
||||
|
||||
if( !text.IsEmpty() )
|
||||
{
|
||||
#ifdef __WXMAC__
|
||||
|
||||
@@ -30,7 +30,7 @@
|
||||
|
||||
// Saved dialog settings
|
||||
DIALOG_UPDATE_FROM_PCB::DIALOG_UPDATE_FROM_PCB_SAVED_STATE
|
||||
DIALOG_UPDATE_FROM_PCB::s_savedDialogState{ true, true, true, true, false };
|
||||
DIALOG_UPDATE_FROM_PCB::s_savedDialogState{ false, true, true, true, false };
|
||||
|
||||
|
||||
DIALOG_UPDATE_FROM_PCB::DIALOG_UPDATE_FROM_PCB( SCH_EDIT_FRAME* aParent )
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
*
|
||||
* Copyright (C) 2017 Wayne Stambaugh <stambaughw@gmail.com>
|
||||
* Copyright (C) 2021 CERN
|
||||
* Copyright (C) 2017-2021 KiCad Developers, see AUTHORS.txt for contributors.
|
||||
* Copyright (C) 2017-2022 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
|
||||
@@ -510,12 +510,11 @@ void PANEL_SYM_LIB_TABLE::browseLibrariesHandler( wxCommandEvent& event )
|
||||
wxString detailedMsg = _( "One of the nicknames will need to be changed after "
|
||||
"adding this library." );
|
||||
|
||||
wxArrayString files;
|
||||
dlg.GetFilenames( files );
|
||||
wxArrayString filePathsList;
|
||||
dlg.GetPaths( filePathsList );
|
||||
|
||||
for( const wxString& file : files )
|
||||
for( const wxString& filePath : filePathsList )
|
||||
{
|
||||
wxString filePath = dlg.GetDirectory() + wxFileName::GetPathSeparator() + file;
|
||||
wxFileName fn( filePath );
|
||||
wxString nickname = LIB_ID::FixIllegalChars( fn.GetName(), true );
|
||||
bool doAdd = true;
|
||||
@@ -561,7 +560,7 @@ void PANEL_SYM_LIB_TABLE::browseLibrariesHandler( wxCommandEvent& event )
|
||||
}
|
||||
}
|
||||
|
||||
if( !files.IsEmpty() )
|
||||
if( !filePathsList.IsEmpty() )
|
||||
{
|
||||
m_cur_grid->MakeCellVisible( m_cur_grid->GetNumberRows() - 1, 0 );
|
||||
m_cur_grid->SetGridCursor( m_cur_grid->GetNumberRows() - 1, 1 );
|
||||
|
||||
@@ -119,7 +119,8 @@ void FIELDS_GRID_TABLE<T>::initGrid( WX_GRID* aGrid )
|
||||
m_footprintAttr->SetEditor( fpIdEditor );
|
||||
|
||||
m_urlAttr = new wxGridCellAttr;
|
||||
GRID_CELL_URL_EDITOR* urlEditor = new GRID_CELL_URL_EDITOR( m_dialog );
|
||||
GRID_CELL_URL_EDITOR* urlEditor = new GRID_CELL_URL_EDITOR( m_dialog,
|
||||
m_frame->Prj().SchSearchS() );
|
||||
urlEditor->SetValidator( m_urlValidator );
|
||||
m_urlAttr->SetEditor( urlEditor );
|
||||
|
||||
@@ -502,7 +503,7 @@ void FIELDS_GRID_TABLE<T>::SetValue( int aRow, int aCol, const wxString &aValue
|
||||
value = fn.GetFullPath();
|
||||
}
|
||||
}
|
||||
else if( m_parentType == SCH_SYMBOL_T && aRow == VALUE_FIELD )
|
||||
else if( m_parentType == LIB_SYMBOL_T && aRow == VALUE_FIELD )
|
||||
{
|
||||
value = EscapeString( value, CTX_LIBID );
|
||||
}
|
||||
@@ -647,7 +648,7 @@ void FIELDS_GRID_TRICKS::doPopupSelection( wxCommandEvent& event )
|
||||
else if (event.GetId() == MYID_SHOW_DATASHEET )
|
||||
{
|
||||
wxString datasheet_uri = m_grid->GetCellValue( DATASHEET_FIELD, FDC_VALUE );
|
||||
GetAssociatedDocument( m_dlg, datasheet_uri, &m_dlg->Prj() );
|
||||
GetAssociatedDocument( m_dlg, datasheet_uri, &m_dlg->Prj(), m_dlg->Prj().SchSearchS() );
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
+30
-1
@@ -205,6 +205,34 @@ void HIERARCHY_NAVIG_DLG::buildHierarchyTree( SCH_SHEET_PATH* aList, wxTreeItemI
|
||||
}
|
||||
|
||||
|
||||
void HIERARCHY_NAVIG_DLG::UpdateHierarchySelection()
|
||||
{
|
||||
m_currSheet = m_SchFrameEditor->GetCurrentSheet();
|
||||
|
||||
std::function<void( const wxTreeItemId& )> selectSheet = [&]( const wxTreeItemId& id )
|
||||
{
|
||||
wxCHECK_RET( id.IsOk(), wxT( "Invalid tree item" ) );
|
||||
|
||||
TreeItemData* itemData = static_cast<TreeItemData*>( m_Tree->GetItemData( id ) );
|
||||
if( itemData->m_SheetPath == m_currSheet )
|
||||
{
|
||||
m_Tree->EnsureVisible( id );
|
||||
m_Tree->SelectItem( id );
|
||||
}
|
||||
|
||||
wxTreeItemIdValue cookie = id;
|
||||
wxTreeItemId child = m_Tree->GetFirstChild( id, cookie );
|
||||
while( child.IsOk() )
|
||||
{
|
||||
selectSheet( child );
|
||||
child = m_Tree->GetNextChild( child, cookie );
|
||||
}
|
||||
};
|
||||
|
||||
selectSheet( m_Tree->GetRootItem() );
|
||||
}
|
||||
|
||||
|
||||
void HIERARCHY_NAVIG_DLG::UpdateHierarchyTree()
|
||||
{
|
||||
Freeze();
|
||||
@@ -315,5 +343,6 @@ void SCH_EDIT_FRAME::DisplayCurrentSheet()
|
||||
TOOL_EVENT dummy;
|
||||
editTool->UpdateNetHighlighting( dummy );
|
||||
|
||||
UpdateHierarchyNavigator();
|
||||
if( FindHierarchyNavigator() )
|
||||
FindHierarchyNavigator()->UpdateHierarchySelection();
|
||||
}
|
||||
|
||||
@@ -76,6 +76,11 @@ public:
|
||||
*/
|
||||
void UpdateHierarchyTree();
|
||||
|
||||
/**
|
||||
* Updates the tree's selection to match current page
|
||||
*/
|
||||
void UpdateHierarchySelection();
|
||||
|
||||
private:
|
||||
/**
|
||||
* Create the hierarchical tree of the schematic.
|
||||
|
||||
@@ -73,6 +73,7 @@ EDA_ITEM* LIB_TEXT::Clone() const
|
||||
{
|
||||
LIB_TEXT* newitem = new LIB_TEXT( nullptr );
|
||||
|
||||
newitem->m_parent = m_parent;
|
||||
newitem->m_unit = m_unit;
|
||||
newitem->m_convert = m_convert;
|
||||
newitem->m_flags = m_flags;
|
||||
|
||||
@@ -63,9 +63,20 @@ wxString NETLIST_EXPORTER_PSPICE::GetSpiceDevice( const wxString& aSymbol ) cons
|
||||
|
||||
bool NETLIST_EXPORTER_PSPICE::WriteNetlist( const wxString& aOutFileName, unsigned aNetlistOptions )
|
||||
{
|
||||
FILE_OUTPUTFORMATTER outputFile( aOutFileName, wxT( "wt" ), '\'' );
|
||||
try
|
||||
{
|
||||
FILE_OUTPUTFORMATTER outputFile( aOutFileName, wxT( "wt" ), '\'' );
|
||||
|
||||
return Format( &outputFile, aNetlistOptions );
|
||||
|
||||
return Format( &outputFile, aNetlistOptions );
|
||||
}
|
||||
catch( IO_ERROR& )
|
||||
{
|
||||
wxString msg;
|
||||
msg.Printf( _( "Failed to create file '%s'." ), aOutFileName );
|
||||
DisplayError( nullptr, msg );
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
+55
-31
@@ -34,6 +34,7 @@
|
||||
#include <sch_sheet.h>
|
||||
#include <sch_edit_frame.h>
|
||||
#include <schematic.h>
|
||||
#include <string_utils.h>
|
||||
#include <symbol_lib_table.h>
|
||||
#include <wildcards_and_files_ext.h>
|
||||
|
||||
@@ -100,17 +101,6 @@ static LIB_SYMBOL* findSymbol( const wxString& aName, SYMBOL_LIBS* aLibs, bool a
|
||||
|
||||
symbol = each_lib.FindSymbol( aName );
|
||||
|
||||
// At some point during V5 development, the LIB_ID delimiter character ':' was
|
||||
// replaced by '_' when writing the symbol cache library so we have to test for
|
||||
// the LIB_NICKNAME_LIB_SYMBOL_NAME case.
|
||||
if( symbol == nullptr && each_lib.IsCache() )
|
||||
{
|
||||
wxString name = aName;
|
||||
|
||||
if( name.Replace( wxT( ":" ), wxT( "_" ) ) )
|
||||
symbol = each_lib.FindSymbol( name );
|
||||
}
|
||||
|
||||
if( symbol )
|
||||
break;
|
||||
}
|
||||
@@ -160,7 +150,7 @@ void RESCUE_CASE_CANDIDATE::FindRescues( RESCUER& aRescuer,
|
||||
for( SCH_SYMBOL* eachSymbol : *( aRescuer.GetSymbols() ) )
|
||||
{
|
||||
symbol_name = eachSymbol->GetLibId().GetLibItemName();
|
||||
search_name = LIB_ID::FixIllegalChars( symbol_name, false );
|
||||
search_name = EscapeString ( symbol_name, CTX_LIBID );
|
||||
|
||||
if( last_symbol_name != symbol_name )
|
||||
{
|
||||
@@ -265,7 +255,7 @@ void RESCUE_CACHE_CANDIDATE::FindRescues( RESCUER& aRescuer,
|
||||
for( SCH_SYMBOL* eachSymbol : *( aRescuer.GetSymbols() ) )
|
||||
{
|
||||
symbol_name = eachSymbol->GetLibId().GetLibItemName();
|
||||
search_name = LIB_ID::FixIllegalChars( symbol_name, false );
|
||||
search_name = EscapeString ( symbol_name, CTX_LIBID );
|
||||
|
||||
if( old_symbol_name != symbol_name )
|
||||
{
|
||||
@@ -388,6 +378,8 @@ void RESCUE_SYMBOL_LIB_TABLE_CANDIDATE::FindRescues(
|
||||
LIB_SYMBOL* lib_match = nullptr;
|
||||
LIB_ID old_symbol_id;
|
||||
|
||||
wxString escapedSymbolName;
|
||||
|
||||
for( SCH_SYMBOL* eachSymbol : *( aRescuer.GetSymbols() ) )
|
||||
{
|
||||
const LIB_ID& symbol_id = eachSymbol->GetLibId();
|
||||
@@ -398,11 +390,25 @@ void RESCUE_SYMBOL_LIB_TABLE_CANDIDATE::FindRescues(
|
||||
// Search the symbol names candidates only once for this group:
|
||||
old_symbol_id = symbol_id;
|
||||
|
||||
escapedSymbolName = EscapeString( symbol_id.Format().wx_str(), CTX_LIBID );
|
||||
|
||||
// Get the library symbol from the cache library. It will be a flattened
|
||||
// symbol by default (no inheritance).
|
||||
cache_match = findSymbol( symbol_id.Format().wx_str(), aRescuer.GetPrj()->SchLibs(),
|
||||
cache_match = findSymbol( escapedSymbolName, aRescuer.GetPrj()->SchLibs(),
|
||||
true );
|
||||
|
||||
// At some point during V5 development, the LIB_ID delimiter character ':' was
|
||||
// replaced by '_' when writing the symbol cache library so we have to test for
|
||||
// the LIB_NICKNAME_LIB_SYMBOL_NAME case.
|
||||
if( !cache_match )
|
||||
{
|
||||
escapedSymbolName = EscapeString( symbol_id.GetLibNickname().wx_str() +
|
||||
wxT( "_" ) + symbol_id.GetLibItemName().wx_str(),
|
||||
CTX_LIBID );
|
||||
cache_match = findSymbol( escapedSymbolName, aRescuer.GetPrj()->SchLibs(),
|
||||
true );
|
||||
}
|
||||
|
||||
// Get the library symbol from the symbol library table.
|
||||
lib_match = SchGetLibSymbol( symbol_id, aRescuer.GetPrj()->SchSymbolLibTable() );
|
||||
|
||||
@@ -663,13 +669,13 @@ void LEGACY_RESCUER::OpenRescueLibrary()
|
||||
wxFileName fn = GetRescueLibraryFileName( m_schematic );
|
||||
|
||||
std::unique_ptr<SYMBOL_LIB> rescue_lib = std::make_unique<SYMBOL_LIB>( SCH_LIB_TYPE::LT_EESCHEMA,
|
||||
fn.GetFullPath() );
|
||||
fn.GetFullPath() );
|
||||
|
||||
m_rescue_lib = std::move( rescue_lib );
|
||||
m_rescue_lib->EnableBuffering();
|
||||
|
||||
// If a rescue library already exists copy the contents of that library so we do not
|
||||
// lose an previous rescues.
|
||||
// lose any previous rescues.
|
||||
SYMBOL_LIB* rescueLib = m_prj->SchLibs()->FindLibrary( fn.GetName() );
|
||||
|
||||
if( rescueLib )
|
||||
@@ -804,6 +810,27 @@ void SYMBOL_LIB_TABLE_RESCUER::OpenRescueLibrary()
|
||||
{
|
||||
m_pi.set( SCH_IO_MGR::FindPlugin( SCH_IO_MGR::SCH_LEGACY ) );
|
||||
(*m_properties)[ SCH_LEGACY_PLUGIN::PropBuffering ] = "";
|
||||
|
||||
wxFileName fn = GetRescueLibraryFileName( m_schematic );
|
||||
|
||||
// If a rescue library already exists copy the contents of that library so we do not
|
||||
// lose any previous rescues.
|
||||
if( m_prj->SchSymbolLibTable()->HasLibrary( fn.GetName() ) )
|
||||
{
|
||||
std::vector<LIB_SYMBOL*> symbols;
|
||||
|
||||
try
|
||||
{
|
||||
m_prj->SchSymbolLibTable()->LoadSymbolLib( symbols, fn.GetName() );
|
||||
}
|
||||
catch( ... /* IO_ERROR */ )
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
for( LIB_SYMBOL* symbol : symbols )
|
||||
AddSymbol( symbol );
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -812,21 +839,21 @@ bool SYMBOL_LIB_TABLE_RESCUER::WriteRescueLibrary( wxWindow *aParent )
|
||||
wxString msg;
|
||||
wxFileName fn = GetRescueLibraryFileName( m_schematic );
|
||||
|
||||
try
|
||||
{
|
||||
m_pi->SaveLibrary( fn.GetFullPath() );
|
||||
}
|
||||
catch( const IO_ERROR& ioe )
|
||||
{
|
||||
msg.Printf( _( "Failed to save rescue library %s." ), fn.GetFullPath() );
|
||||
DisplayErrorMessage( aParent, msg, ioe.What() );
|
||||
return false;
|
||||
}
|
||||
|
||||
// If the rescue library already exists in the symbol library table no need save it to add
|
||||
// it to the table.
|
||||
if( !m_prj->SchSymbolLibTable()->HasLibrary( fn.GetName() ) )
|
||||
{
|
||||
try
|
||||
{
|
||||
m_pi->SaveLibrary( fn.GetFullPath() );
|
||||
}
|
||||
catch( const IO_ERROR& ioe )
|
||||
{
|
||||
msg.Printf( _( "Failed to save rescue library %s." ), fn.GetFullPath() );
|
||||
DisplayErrorMessage( aParent, msg, ioe.What() );
|
||||
return false;
|
||||
}
|
||||
|
||||
wxString uri = wxT( "${KIPRJMOD}/" ) + fn.GetFullName();
|
||||
wxString libNickname = fn.GetName();
|
||||
|
||||
@@ -874,10 +901,7 @@ void SYMBOL_LIB_TABLE_RESCUER::AddSymbol( LIB_SYMBOL* aNewSymbol )
|
||||
|
||||
try
|
||||
{
|
||||
if( !m_prj->SchSymbolLibTable()->HasLibrary( fn.GetName() ) )
|
||||
m_pi->SaveSymbol( fn.GetFullPath(), new LIB_SYMBOL( *aNewSymbol ), m_properties.get() );
|
||||
else
|
||||
m_prj->SchSymbolLibTable()->SaveSymbol( fn.GetName(), new LIB_SYMBOL( *aNewSymbol ) );
|
||||
m_pi->SaveSymbol( fn.GetFullPath(), new LIB_SYMBOL( *aNewSymbol ), m_properties.get() );
|
||||
}
|
||||
catch( ... /* IO_ERROR */ )
|
||||
{
|
||||
|
||||
@@ -27,6 +27,7 @@
|
||||
|
||||
#include <convert_to_biu.h>
|
||||
#include <ki_exception.h>
|
||||
#include <math/util.h>
|
||||
|
||||
#include <wx/log.h>
|
||||
|
||||
@@ -43,7 +44,12 @@ ALTIUM_SCH_RECORD ReadRecord( const std::map<wxString, wxString>& aProps )
|
||||
|
||||
constexpr int Altium2KiCadUnit( const int val, const int frac )
|
||||
{
|
||||
return Mils2iu( val ) * 10 + Mils2iu( frac ) / 10000; // TODO: correct, rounding issues?
|
||||
constexpr double int_limit = ( std::numeric_limits<int>::max() - 10 ) / 2.54;
|
||||
|
||||
double dbase = 10 * Mils2iu( val );
|
||||
double dfrac = Mils2iu( frac ) / 10000.0;
|
||||
|
||||
return KiROUND( Clamp<double>( -int_limit, ( dbase + dfrac ) / 10.0, int_limit ) ) * 10;
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -692,15 +692,21 @@ void SCH_EAGLE_PLUGIN::loadSchematic( wxXmlNode* aSchematicNode )
|
||||
if( sheet_count > 1 )
|
||||
{
|
||||
int x, y, i;
|
||||
i = 1;
|
||||
i = 2;
|
||||
x = 1;
|
||||
y = 1;
|
||||
|
||||
SCH_SHEET_PATH rootsheetpath;
|
||||
rootsheetpath.push_back( m_rootSheet );
|
||||
m_rootSheet->AddInstance( rootsheetpath );
|
||||
m_rootSheet->SetPageNumber( rootsheetpath, wxT( "1" ) );
|
||||
|
||||
while( sheetNode )
|
||||
{
|
||||
wxPoint pos = wxPoint( x * Mils2iu( 1000 ), y * Mils2iu( 1000 ) );
|
||||
std::unique_ptr<SCH_SHEET> sheet = std::make_unique<SCH_SHEET>( m_rootSheet, pos );
|
||||
SCH_SCREEN* screen = new SCH_SCREEN( m_schematic );
|
||||
wxString pageNo = wxString::Format( wxT( "%d" ), i );
|
||||
|
||||
sheet->SetScreen( screen );
|
||||
sheet->GetScreen()->SetFileName( sheet->GetFileName() );
|
||||
@@ -711,10 +717,10 @@ void SCH_EAGLE_PLUGIN::loadSchematic( wxXmlNode* aSchematicNode )
|
||||
|
||||
SCH_SHEET_PATH sheetpath;
|
||||
m_rootSheet->LocatePathOfScreen( m_currentSheet->GetScreen(), &sheetpath );
|
||||
sheetpath.push_back( m_currentSheet );
|
||||
|
||||
m_currentSheet->AddInstance( sheetpath );
|
||||
m_currentSheet->SetPageNumber( sheetpath, pageNo );
|
||||
m_rootSheet->AddInstance( sheetpath );
|
||||
m_rootSheet->SetPageNumber( sheetpath, wxString::Format( wxT( "%d" ), i ) );
|
||||
m_rootSheet->SetPageNumber( sheetpath, pageNo );
|
||||
|
||||
sheetNode = sheetNode->GetNext();
|
||||
x += 2;
|
||||
|
||||
@@ -2833,7 +2833,13 @@ LIB_SYMBOL* SCH_LEGACY_PLUGIN_CACHE::LoadPart( LINE_READER& aReader, int aMajorV
|
||||
wxString name, prefix, tmp;
|
||||
|
||||
name = tokens.GetNextToken();
|
||||
name = EscapeString( name, CTX_LIBID );
|
||||
|
||||
// Don't escape symbol library name if it's already been escaped. Given that the original
|
||||
// change to escape the symbol library name has resulted in rescue libraries with escaped
|
||||
// names, we will have to live with the consequences.
|
||||
if( name == UnescapeString( name ) )
|
||||
name = EscapeString( name, CTX_LIBID );
|
||||
|
||||
pos += name.size() + 1;
|
||||
|
||||
prefix = tokens.GetNextToken();
|
||||
|
||||
@@ -134,7 +134,7 @@ public:
|
||||
|
||||
int CompareRef( const SCH_REFERENCE& item ) const
|
||||
{
|
||||
return m_ref.compare( item.m_ref );
|
||||
return m_ref.CmpNoCase( item.m_ref );
|
||||
}
|
||||
|
||||
int CompareLibName( const SCH_REFERENCE& item ) const
|
||||
@@ -168,7 +168,7 @@ private:
|
||||
friend class SCH_REFERENCE_LIST;
|
||||
|
||||
/// Symbol reference prefix, without number (for IC1, this is IC) )
|
||||
UTF8 m_ref; // it's private, use the accessors please
|
||||
wxString m_ref; // it's private, use the accessors please
|
||||
SCH_SYMBOL* m_rootSymbol; ///< The symbol associated the reference object.
|
||||
LIB_SYMBOL* m_libPart; ///< The source symbol from a library.
|
||||
wxPoint m_symbolPos; ///< The physical position of the symbol in schematic
|
||||
@@ -454,7 +454,7 @@ public:
|
||||
|
||||
printf( " [%-2d] ref:%-8s num:%-3d lib_part:%s\n",
|
||||
i,
|
||||
schref.m_ref.c_str(),
|
||||
schref.m_ref.ToStdString().c_str(),
|
||||
schref.m_numRef,
|
||||
TO_UTF8( schref.GetLibPart()->GetName() ) );
|
||||
}
|
||||
|
||||
@@ -225,6 +225,11 @@ public:
|
||||
{
|
||||
return type_tree->end( m_rect );
|
||||
}
|
||||
|
||||
bool empty()
|
||||
{
|
||||
return type_tree->Count() == 0;
|
||||
}
|
||||
};
|
||||
|
||||
EE_TYPE OfType( KICAD_T aType ) const
|
||||
|
||||
+31
-3
@@ -838,9 +838,10 @@ void SCH_SCREEN::Print( const RENDER_SETTINGS* aSettings )
|
||||
void SCH_SCREEN::Plot( PLOTTER* aPlotter ) const
|
||||
{
|
||||
// Ensure links are up to date, even if a library was reloaded for some reason:
|
||||
std::vector< SCH_ITEM* > junctions;
|
||||
std::vector< SCH_ITEM* > bitmaps;
|
||||
std::vector< SCH_ITEM* > other;
|
||||
std::vector<SCH_ITEM*> junctions;
|
||||
std::vector<SCH_ITEM*> bitmaps;
|
||||
std::vector<SCH_SYMBOL*> symbols;
|
||||
std::vector<SCH_ITEM*> other;
|
||||
|
||||
for( SCH_ITEM* item : Items() )
|
||||
{
|
||||
@@ -853,6 +854,21 @@ void SCH_SCREEN::Plot( PLOTTER* aPlotter ) const
|
||||
bitmaps.push_back( item );
|
||||
else
|
||||
other.push_back( item );
|
||||
|
||||
// Where the symbols overlap each other, we need to plot the text items a second
|
||||
// time to get them on top of the overlapping element. This collection is in addition
|
||||
// to the symbols already collected in `other`
|
||||
if( item->Type() == SCH_SYMBOL_T )
|
||||
{
|
||||
for( SCH_ITEM* sym : m_rtree.Overlapping( SCH_SYMBOL_T, item->GetBoundingBox() ) )
|
||||
{
|
||||
if( sym != item )
|
||||
{
|
||||
symbols.push_back( static_cast<SCH_SYMBOL*>( item ) );
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/// Sort to ensure plot-order consistency with screen drawing
|
||||
@@ -882,6 +898,18 @@ void SCH_SCREEN::Plot( PLOTTER* aPlotter ) const
|
||||
item->Plot( aPlotter );
|
||||
}
|
||||
|
||||
// After plotting the symbols as a group above (in `other`), we need to overplot the pins
|
||||
// and symbols to ensure that they are always visible
|
||||
for( const SCH_SYMBOL* sym :symbols )
|
||||
{
|
||||
aPlotter->SetCurrentLineWidth( std::max( sym->GetPenWidth(), defaultPenWidth ) );
|
||||
|
||||
for( SCH_FIELD field : sym->GetFields() )
|
||||
field.Plot( aPlotter );
|
||||
|
||||
sym->PlotPins( aPlotter );
|
||||
}
|
||||
|
||||
for( const SCH_ITEM* item : junctions )
|
||||
{
|
||||
aPlotter->SetCurrentLineWidth( std::max( item->GetPenWidth(), defaultPenWidth ) );
|
||||
|
||||
@@ -97,7 +97,7 @@ namespace std
|
||||
|
||||
SCH_SHEET_PATH::SCH_SHEET_PATH()
|
||||
{
|
||||
m_virtualPageNumber = 0;
|
||||
m_virtualPageNumber = 1;
|
||||
m_current_hash = 0;
|
||||
}
|
||||
|
||||
|
||||
+53
-2
@@ -886,7 +886,7 @@ void SCH_SYMBOL::GetLibPins( std::vector<LIB_PIN*>& aPinsList ) const
|
||||
}
|
||||
|
||||
|
||||
SCH_PIN* SCH_SYMBOL::GetPin( LIB_PIN* aLibPin )
|
||||
SCH_PIN* SCH_SYMBOL::GetPin( LIB_PIN* aLibPin ) const
|
||||
{
|
||||
wxASSERT( m_pinMap.count( aLibPin ) );
|
||||
return m_pins[ m_pinMap.at( aLibPin ) ].get();
|
||||
@@ -1877,10 +1877,32 @@ void SCH_SYMBOL::Plot( PLOTTER* aPlotter ) const
|
||||
{
|
||||
if( m_part )
|
||||
{
|
||||
LIB_PINS libPins;
|
||||
m_part->GetPins( libPins, GetUnit(), GetConvert() );
|
||||
|
||||
// Copy the source so we can re-orient and translate it.
|
||||
LIB_SYMBOL tempSymbol( *m_part );
|
||||
LIB_PINS tempPins;
|
||||
tempSymbol.GetPins( tempPins, GetUnit(), GetConvert() );
|
||||
|
||||
// Copy the pin info from the symbol to the temp pins
|
||||
for( unsigned i = 0; i < tempPins.size(); ++ i )
|
||||
{
|
||||
SCH_PIN* symbolPin = GetPin( libPins[ i ] );
|
||||
LIB_PIN* tempPin = tempPins[ i ];
|
||||
|
||||
tempPin->SetName( symbolPin->GetShownName() );
|
||||
tempPin->SetType( symbolPin->GetType() );
|
||||
tempPin->SetShape( symbolPin->GetShape() );
|
||||
|
||||
if( symbolPin->IsDangling() )
|
||||
tempPin->SetFlags( IS_DANGLING );
|
||||
}
|
||||
|
||||
TRANSFORM temp = GetTransform();
|
||||
aPlotter->StartBlock( nullptr );
|
||||
|
||||
m_part->Plot( aPlotter, GetUnit(), GetConvert(), m_pos, temp );
|
||||
tempSymbol.Plot( aPlotter, GetUnit(), GetConvert(), m_pos, temp );
|
||||
|
||||
for( SCH_FIELD field : m_fields )
|
||||
field.Plot( aPlotter );
|
||||
@@ -1890,6 +1912,35 @@ void SCH_SYMBOL::Plot( PLOTTER* aPlotter ) const
|
||||
}
|
||||
|
||||
|
||||
void SCH_SYMBOL::PlotPins( PLOTTER* aPlotter ) const
|
||||
{
|
||||
if( m_part )
|
||||
{
|
||||
LIB_PINS libPins;
|
||||
m_part->GetPins( libPins, GetUnit(), GetConvert() );
|
||||
|
||||
// Copy the source to stay const
|
||||
LIB_SYMBOL tempSymbol( *m_part );
|
||||
LIB_PINS tempPins;
|
||||
tempSymbol.GetPins( tempPins, GetUnit(), GetConvert() );
|
||||
|
||||
TRANSFORM transform = GetTransform();
|
||||
|
||||
// Copy the pin info from the symbol to the temp pins
|
||||
for( unsigned i = 0; i < tempPins.size(); ++ i )
|
||||
{
|
||||
SCH_PIN* symbolPin = GetPin( libPins[ i ] );
|
||||
LIB_PIN* tempPin = tempPins[ i ];
|
||||
|
||||
tempPin->SetName( symbolPin->GetShownName() );
|
||||
tempPin->SetType( symbolPin->GetType() );
|
||||
tempPin->SetShape( symbolPin->GetShape() );
|
||||
tempPin->Plot( aPlotter, m_pos, false, transform);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
bool SCH_SYMBOL::HasBrightenedPins()
|
||||
{
|
||||
for( const auto& pin : m_pins )
|
||||
|
||||
@@ -456,7 +456,7 @@ public:
|
||||
*/
|
||||
void GetLibPins( std::vector<LIB_PIN*>& aPinsList ) const;
|
||||
|
||||
SCH_PIN* GetPin( LIB_PIN* aLibPin );
|
||||
SCH_PIN* GetPin( LIB_PIN* aLibPin ) const;
|
||||
|
||||
/**
|
||||
* Retrieve a list of the SCH_PINs for the given sheet path.
|
||||
@@ -650,6 +650,14 @@ public:
|
||||
|
||||
void Plot( PLOTTER* aPlotter ) const override;
|
||||
|
||||
/**
|
||||
* Plot just the symbol pins. This is separated to match the GAL display order. The pins are
|
||||
* ALSO plotted with the symbol group. This replotting allows us to ensure that they are shown above
|
||||
* other elements in the schematic
|
||||
* @param aPlotter
|
||||
*/
|
||||
void PlotPins( PLOTTER* aPlotter ) const;
|
||||
|
||||
EDA_ITEM* Clone() const override;
|
||||
|
||||
#if defined(DEBUG)
|
||||
|
||||
+10
-13
@@ -619,21 +619,18 @@ wxString SCH_TEXT::GetShownText( int aDepth ) const
|
||||
return true;
|
||||
}
|
||||
|
||||
if( Type() == SCH_TEXT_T )
|
||||
if( token->Contains( ':' ) )
|
||||
{
|
||||
if( token->Contains( ':' ) )
|
||||
{
|
||||
if( Schematic()->ResolveCrossReference( token, aDepth ) )
|
||||
return true;
|
||||
}
|
||||
else
|
||||
{
|
||||
SCHEMATIC* schematic = Schematic();
|
||||
SCH_SHEET* sheet = schematic ? schematic->CurrentSheet().Last() : nullptr;
|
||||
if( Schematic()->ResolveCrossReference( token, aDepth ) )
|
||||
return true;
|
||||
}
|
||||
else
|
||||
{
|
||||
SCHEMATIC* schematic = Schematic();
|
||||
SCH_SHEET* sheet = schematic ? schematic->CurrentSheet().Last() : nullptr;
|
||||
|
||||
if( sheet && sheet->ResolveTextVar( token, aDepth + 1 ) )
|
||||
return true;
|
||||
}
|
||||
if( sheet && sheet->ResolveTextVar( token, aDepth + 1 ) )
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
|
||||
@@ -1528,6 +1528,11 @@ void SIM_PLOT_FRAME::onProbe( wxCommandEvent& event )
|
||||
if( m_schematicFrame == nullptr )
|
||||
return;
|
||||
|
||||
wxWindow* blocking_dialog = m_schematicFrame->Kiway().GetBlockingDialog();
|
||||
|
||||
if( blocking_dialog )
|
||||
blocking_dialog->Close( true );
|
||||
|
||||
m_schematicFrame->GetToolManager()->RunAction( EE_ACTIONS::simProbe );
|
||||
m_schematicFrame->Raise();
|
||||
}
|
||||
@@ -1540,6 +1545,11 @@ void SIM_PLOT_FRAME::onTune( wxCommandEvent& event )
|
||||
if( m_schematicFrame == nullptr )
|
||||
return;
|
||||
|
||||
wxWindow* blocking_dialog = m_schematicFrame->Kiway().GetBlockingDialog();
|
||||
|
||||
if( blocking_dialog )
|
||||
blocking_dialog->Close( true );
|
||||
|
||||
m_schematicFrame->GetToolManager()->RunAction( EE_ACTIONS::simTune );
|
||||
m_schematicFrame->Raise();
|
||||
}
|
||||
|
||||
@@ -1119,6 +1119,9 @@ void SYMBOL_EDIT_FRAME::CommonSettingsChanged( bool aEnvVarsChanged, bool aTextV
|
||||
GetCanvas()->GetGAL()->SetAxesColor( m_colorSettings->GetColor( LAYER_SCHEMATIC_GRID_AXES ) );
|
||||
GetCanvas()->GetGAL()->DrawGrid();
|
||||
|
||||
GetCanvas()->GetView()->UpdateAllItems( KIGFX::ALL );
|
||||
GetCanvas()->Refresh();
|
||||
|
||||
RecreateToolbars();
|
||||
|
||||
if( aEnvVarsChanged )
|
||||
@@ -1166,6 +1169,7 @@ void SYMBOL_EDIT_FRAME::RebuildView()
|
||||
GetCanvas()->GetView()->HideDrawingSheet();
|
||||
GetCanvas()->GetView()->ClearHiddenFlags();
|
||||
|
||||
GetCanvas()->GetView()->UpdateAllItems( KIGFX::ALL );
|
||||
GetCanvas()->Refresh();
|
||||
}
|
||||
|
||||
|
||||
@@ -225,30 +225,38 @@ bool SYMBOL_LIBRARY_MANAGER::SaveLibrary( const wxString& aLibrary, const wxStri
|
||||
{
|
||||
LIB_SYMBOL* newSymbol;
|
||||
|
||||
if( symbol->IsAlias() )
|
||||
try
|
||||
{
|
||||
std::shared_ptr< LIB_SYMBOL > oldParent = symbol->GetParent().lock();
|
||||
|
||||
wxCHECK_MSG( oldParent, false,
|
||||
wxString::Format( wxT( "Derived symbol '%s' found with undefined parent." ),
|
||||
symbol->GetName() ) );
|
||||
|
||||
LIB_SYMBOL* libParent = pi->LoadSymbol( aLibrary, oldParent->GetName(),
|
||||
&properties );
|
||||
|
||||
if( !libParent )
|
||||
if( symbol->IsAlias() )
|
||||
{
|
||||
libParent = new LIB_SYMBOL( *oldParent.get() );
|
||||
pi->SaveSymbol( aLibrary, libParent, &properties );
|
||||
}
|
||||
std::shared_ptr< LIB_SYMBOL > oldParent = symbol->GetParent().lock();
|
||||
|
||||
newSymbol = new LIB_SYMBOL( *symbol );
|
||||
newSymbol->SetParent( libParent );
|
||||
pi->SaveSymbol( aLibrary, newSymbol, &properties );
|
||||
wxCHECK_MSG( oldParent, false,
|
||||
wxString::Format( wxT( "Derived symbol '%s' found with undefined parent." ),
|
||||
symbol->GetName() ) );
|
||||
|
||||
LIB_SYMBOL* libParent = pi->LoadSymbol( aLibrary, oldParent->GetName(),
|
||||
&properties );
|
||||
|
||||
if( !libParent )
|
||||
{
|
||||
libParent = new LIB_SYMBOL( *oldParent.get() );
|
||||
pi->SaveSymbol( aLibrary, libParent, &properties );
|
||||
}
|
||||
|
||||
newSymbol = new LIB_SYMBOL( *symbol );
|
||||
newSymbol->SetParent( libParent );
|
||||
pi->SaveSymbol( aLibrary, newSymbol, &properties );
|
||||
}
|
||||
else if( !pi->LoadSymbol( aLibrary, symbol->GetName(), &properties ) )
|
||||
{
|
||||
pi->SaveSymbol( aLibrary, new LIB_SYMBOL( *symbol ), &properties );
|
||||
}
|
||||
}
|
||||
else if( !pi->LoadSymbol( aLibrary, symbol->GetName(), &properties ) )
|
||||
catch( ... )
|
||||
{
|
||||
pi->SaveSymbol( aLibrary, new LIB_SYMBOL( *symbol ), &properties );
|
||||
res = false;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -951,11 +959,23 @@ bool SYMBOL_LIBRARY_MANAGER::LIB_BUFFER::SaveBuffer( std::shared_ptr<SYMBOL_BUFF
|
||||
PROPERTIES properties;
|
||||
properties.emplace( SCH_LEGACY_PLUGIN::PropBuffering, wxEmptyString );
|
||||
|
||||
wxString errorMsg = _( "Error saving symbol %s to library '%s'." ) + wxS( "\n%s" );
|
||||
|
||||
// Delete the original symbol if the symbol name has been changed.
|
||||
if( libSymbol->GetName() != originalSymbol->GetName() )
|
||||
{
|
||||
if( aLibTable->LoadSymbol( m_libName, originalSymbol->GetName() ) )
|
||||
aLibTable->DeleteSymbol( m_libName, originalSymbol->GetName() );
|
||||
// DeleteSymbol may throw
|
||||
try
|
||||
{
|
||||
if( aLibTable->LoadSymbol( m_libName, originalSymbol->GetName() ) )
|
||||
aLibTable->DeleteSymbol( m_libName, originalSymbol->GetName() );
|
||||
}
|
||||
catch( const IO_ERROR& ioe )
|
||||
{
|
||||
wxLogError( errorMsg, UnescapeString( originalSymbol->GetName() ), m_libName,
|
||||
ioe.What() );
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
if( libSymbol->IsAlias() )
|
||||
@@ -1046,8 +1066,17 @@ bool SYMBOL_LIBRARY_MANAGER::LIB_BUFFER::SaveBuffer( std::shared_ptr<SYMBOL_BUFF
|
||||
// Delete the original symbol if the symbol name has been changed.
|
||||
if( libSymbol->GetName() != originalSymbol->GetName() )
|
||||
{
|
||||
if( aPlugin->LoadSymbol( aFileName, originalSymbol->GetName() ) )
|
||||
aPlugin->DeleteSymbol( aFileName, originalSymbol->GetName(), &properties );
|
||||
try
|
||||
{
|
||||
if( aPlugin->LoadSymbol( aFileName, originalSymbol->GetName() ) )
|
||||
aPlugin->DeleteSymbol( aFileName, originalSymbol->GetName(), &properties );
|
||||
}
|
||||
catch( const IO_ERROR& ioe )
|
||||
{
|
||||
wxLogError( errorMsg, UnescapeString( originalSymbol->GetName() ), aFileName,
|
||||
ioe.What() );
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
if( libSymbol->IsAlias() )
|
||||
|
||||
@@ -460,7 +460,11 @@ void SYMBOL_VIEWER_FRAME::onUpdateUnitChoice( wxUpdateUIEvent& aEvent )
|
||||
m_unitChoice->Clear();
|
||||
|
||||
for( int ii = 0; ii < unit_count; ii++ )
|
||||
m_unitChoice->Append( wxString::Format( _( "Unit %c" ), 'A' + ii ) );
|
||||
{
|
||||
wxString sub = LIB_SYMBOL::SubReference( ii + 1, false );
|
||||
wxString unit = wxString::Format( _( "Unit %s" ), sub );
|
||||
m_unitChoice->Append( unit );
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
* This program source code file is part of KiCad, a free EDA CAD application.
|
||||
*
|
||||
* Copyright (C) 2019 Alexander Shuklin <Jasuramme@gmail.com>
|
||||
* Copyright (C) 2004-2021 KiCad Developers, see AUTHORS.txt for contributors.
|
||||
* Copyright (C) 2004-2022 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
|
||||
@@ -112,6 +112,9 @@ bool BACK_ANNOTATE::FetchNetlistFromPCB( std::string& aNetlist )
|
||||
frame->OpenProjectFiles( std::vector<wxString>( 1, fn.GetFullPath() ) );
|
||||
}
|
||||
|
||||
if( wxWindow* blocking_win = frame->Kiway().GetBlockingDialog() )
|
||||
blocking_win->Close( true );
|
||||
|
||||
m_frame->Kiway().ExpressMail( FRAME_PCB_EDITOR, MAIL_PCB_GET_NETLIST, aNetlist );
|
||||
return true;
|
||||
}
|
||||
@@ -290,7 +293,7 @@ void BACK_ANNOTATE::checkForUnusedSymbols()
|
||||
wxString msg = wxString::Format( _( "Footprint '%s' is not present on PCB. "
|
||||
"Corresponding symbols in schematic must be "
|
||||
"manually deleted (if desired)." ),
|
||||
m_refs[i].GetFullRef() );
|
||||
m_refs[i].GetRef() );
|
||||
m_reporter.ReportTail( msg, RPT_SEVERITY_WARNING );
|
||||
}
|
||||
|
||||
@@ -327,7 +330,7 @@ void BACK_ANNOTATE::applyChangelist()
|
||||
{
|
||||
++m_changesCount;
|
||||
msg.Printf( _( "Change '%s' reference designator to '%s'." ),
|
||||
ref.GetFullRef(),
|
||||
ref.GetRef(),
|
||||
fpData.m_ref );
|
||||
|
||||
if( !m_dryRun )
|
||||
@@ -344,7 +347,7 @@ void BACK_ANNOTATE::applyChangelist()
|
||||
{
|
||||
++m_changesCount;
|
||||
msg.Printf( _( "Change %s footprint assignment from '%s' to '%s'." ),
|
||||
ref.GetFullRef(),
|
||||
ref.GetRef(),
|
||||
oldFootprint,
|
||||
fpData.m_footprint );
|
||||
|
||||
@@ -362,7 +365,7 @@ void BACK_ANNOTATE::applyChangelist()
|
||||
{
|
||||
++m_changesCount;
|
||||
msg.Printf( _( "Change %s value from '%s' to '%s'." ),
|
||||
ref.GetFullRef(),
|
||||
ref.GetRef(),
|
||||
oldValue,
|
||||
fpData.m_value );
|
||||
|
||||
@@ -387,7 +390,7 @@ void BACK_ANNOTATE::applyChangelist()
|
||||
if( !pin )
|
||||
{
|
||||
msg.Printf( _( "Cannot find %s pin '%s'." ),
|
||||
ref.GetFullRef(),
|
||||
ref.GetRef(),
|
||||
pinNumber );
|
||||
m_reporter.ReportHead( msg, RPT_SEVERITY_ERROR );
|
||||
|
||||
@@ -398,7 +401,7 @@ void BACK_ANNOTATE::applyChangelist()
|
||||
|
||||
if( connection && connection->Name( true ) != shortNetName )
|
||||
{
|
||||
processNetNameChange( ref.GetFullRef(), pin, connection,
|
||||
processNetNameChange( ref.GetRef(), pin, connection,
|
||||
connection->Name( true ), shortNetName );
|
||||
}
|
||||
}
|
||||
@@ -410,8 +413,6 @@ void BACK_ANNOTATE::applyChangelist()
|
||||
m_frame->RecalculateConnections( NO_CLEANUP );
|
||||
m_frame->UpdateNetHighlightStatus();
|
||||
}
|
||||
|
||||
m_reporter.ReportHead( msg, RPT_SEVERITY_INFO );
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -646,7 +646,8 @@ TOOL_ACTION EE_ACTIONS::toggleHiddenFields( "eeschema.EditorControl.showHiddenFi
|
||||
_( "Show Hidden Fields" ), _( "Toggle display of hidden text fields" ) );
|
||||
|
||||
TOOL_ACTION EE_ACTIONS::toggleForceHV( "eeschema.EditorControl.forceHVLines",
|
||||
AS_GLOBAL, 0, "",
|
||||
AS_GLOBAL,
|
||||
MD_SHIFT + ' ', "",
|
||||
_( "Force H/V Wires and Buses" ), _( "Switch H & V only mode for new wires and buses" ),
|
||||
BITMAPS::lines90 );
|
||||
|
||||
|
||||
@@ -245,9 +245,17 @@ int EE_INSPECTION_TOOL::CheckSymbol( const TOOL_EVENT& aEvent )
|
||||
LIB_PIN* pin = pinList[ii - 1];
|
||||
LIB_PIN* next = pinList[ii];
|
||||
|
||||
if( pin->GetNumber() != next->GetNumber() || pin->GetConvert() != next->GetConvert() )
|
||||
if( pin->GetNumber() != next->GetNumber() )
|
||||
continue;
|
||||
|
||||
// Pins are not duplicated only if they are in different convert bodies
|
||||
// (but GetConvert() == 0 means commun to all convert bodies)
|
||||
if( pin->GetConvert() != 0 && next->GetConvert() != 0 )
|
||||
{
|
||||
if( pin->GetConvert() != next->GetConvert() )
|
||||
continue;
|
||||
}
|
||||
|
||||
wxString pinName;
|
||||
wxString nextName;
|
||||
|
||||
@@ -474,6 +482,9 @@ int EE_INSPECTION_TOOL::RunSimulation( const TOOL_EVENT& aEvent )
|
||||
if( !simFrame )
|
||||
return -1;
|
||||
|
||||
if( wxWindow* blocking_win = simFrame->Kiway().GetBlockingDialog() )
|
||||
blocking_win->Close( true );
|
||||
|
||||
simFrame->Show( true );
|
||||
|
||||
// On Windows, Raise() does not bring the window on screen, when iconized
|
||||
@@ -527,7 +538,7 @@ int EE_INSPECTION_TOOL::ShowDatasheet( const TOOL_EVENT& aEvent )
|
||||
}
|
||||
else
|
||||
{
|
||||
GetAssociatedDocument( m_frame, datasheet, &m_frame->Prj() );
|
||||
GetAssociatedDocument( m_frame, datasheet, &m_frame->Prj(), m_frame->Prj().SchSearchS() );
|
||||
}
|
||||
|
||||
return 0;
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
* This program source code file is part of KiCad, a free EDA CAD application.
|
||||
*
|
||||
* Copyright (C) 2019 CERN
|
||||
* Copyright (C) 2019-2021 KiCad Developers, see AUTHORS.txt for contributors.
|
||||
* Copyright (C) 2019-2022 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
|
||||
@@ -133,6 +133,8 @@ protected:
|
||||
///< parents.
|
||||
void saveCopyInUndoList( EDA_ITEM* aItem, UNDO_REDO aType, bool aAppend = false )
|
||||
{
|
||||
wxASSERT( aItem );
|
||||
|
||||
KICAD_T itemType = aItem->Type();
|
||||
bool selected = aItem->IsSelected();
|
||||
|
||||
|
||||
@@ -348,6 +348,7 @@ int SCH_DRAWING_TOOLS::PlaceSymbol( const TOOL_EVENT& aEvent )
|
||||
{
|
||||
symbol->SetPosition( (wxPoint)cursorPos );
|
||||
m_view->Update( symbol );
|
||||
m_frame->SetMsgPanel( symbol );
|
||||
}
|
||||
else if( symbol && evt->IsAction( &ACTIONS::doDelete ) )
|
||||
{
|
||||
@@ -570,6 +571,7 @@ int SCH_DRAWING_TOOLS::PlaceImage( const TOOL_EVENT& aEvent )
|
||||
m_view->ClearPreview();
|
||||
m_view->AddToPreview( image->Clone() );
|
||||
m_view->RecacheAllItems(); // Bitmaps are cached in Opengl
|
||||
m_frame->SetMsgPanel( image );
|
||||
}
|
||||
else if( image && evt->IsAction( &ACTIONS::doDelete ) )
|
||||
{
|
||||
@@ -775,6 +777,7 @@ int SCH_DRAWING_TOOLS::SingleClickPlace( const TOOL_EVENT& aEvent )
|
||||
previewItem->SetPosition( (wxPoint)cursorPos );
|
||||
m_view->ClearPreview();
|
||||
m_view->AddToPreview( previewItem->Clone() );
|
||||
m_frame->SetMsgPanel( previewItem );
|
||||
}
|
||||
else if( evt->Category() == TC_COMMAND )
|
||||
{
|
||||
@@ -1031,6 +1034,7 @@ int SCH_DRAWING_TOOLS::TwoClickPlace( const TOOL_EVENT& aEvent )
|
||||
{
|
||||
m_view->AddToPreview( aChild->Clone() );
|
||||
} );
|
||||
m_frame->SetMsgPanel( item );
|
||||
};
|
||||
|
||||
auto cleanup =
|
||||
@@ -1420,6 +1424,7 @@ int SCH_DRAWING_TOOLS::DrawSheet( const TOOL_EVENT& aEvent )
|
||||
sizeSheet( sheet, cursorPos );
|
||||
m_view->ClearPreview();
|
||||
m_view->AddToPreview( sheet->Clone() );
|
||||
m_frame->SetMsgPanel( sheet );
|
||||
}
|
||||
else if( evt->IsClick( BUT_RIGHT ) )
|
||||
{
|
||||
|
||||
@@ -1201,22 +1201,35 @@ int SCH_EDIT_TOOL::EditField( const TOOL_EVENT& aEvent )
|
||||
int SCH_EDIT_TOOL::AutoplaceFields( const TOOL_EVENT& aEvent )
|
||||
{
|
||||
EE_SELECTION& selection = m_selectionTool->RequestSelection( rotatableItems );
|
||||
SCH_ITEM* head = static_cast<SCH_ITEM*>( selection.Front() );
|
||||
bool moving = head && head->IsMoving();
|
||||
|
||||
if( selection.Empty() )
|
||||
return 0;
|
||||
|
||||
SCH_ITEM* head = static_cast<SCH_ITEM*>( selection.Front() );
|
||||
bool moving = head && head->IsMoving();
|
||||
std::vector<SCH_ITEM*> autoplaceItems;
|
||||
|
||||
for( unsigned ii = 0; ii < selection.GetSize(); ii++ )
|
||||
{
|
||||
SCH_ITEM* sch_item = static_cast<SCH_ITEM*>( selection.GetItem( ii ) );
|
||||
SCH_ITEM* item = static_cast<SCH_ITEM*>( selection.GetItem( ii ) );
|
||||
|
||||
if( item->IsType( EE_COLLECTOR::FieldOwners ) )
|
||||
autoplaceItems.push_back( item );
|
||||
else if( item->GetParent() && item->GetParent()->IsType( EE_COLLECTOR::FieldOwners ) )
|
||||
autoplaceItems.push_back( static_cast<SCH_ITEM*>( item->GetParent() ) );
|
||||
}
|
||||
|
||||
bool appendUndo = false;
|
||||
|
||||
for( SCH_ITEM* sch_item : autoplaceItems )
|
||||
{
|
||||
if( !moving && !sch_item->IsNew() )
|
||||
saveCopyInUndoList( sch_item, UNDO_REDO::CHANGED, ii > 0 );
|
||||
{
|
||||
saveCopyInUndoList( sch_item, UNDO_REDO::CHANGED, appendUndo );
|
||||
appendUndo = true;
|
||||
}
|
||||
|
||||
if( sch_item->IsType( EE_COLLECTOR::FieldOwners ) )
|
||||
sch_item->AutoplaceFields( m_frame->GetScreen(), /* aManual */ true );
|
||||
sch_item->AutoplaceFields( m_frame->GetScreen(), /* aManual */ true );
|
||||
|
||||
updateItem( sch_item, true );
|
||||
}
|
||||
@@ -1381,6 +1394,9 @@ int SCH_EDIT_TOOL::Properties( const TOOL_EVENT& aEvent )
|
||||
auto editor = (SYMBOL_EDIT_FRAME*) m_frame->Kiway().Player( FRAME_SCH_SYMBOL_EDITOR,
|
||||
true );
|
||||
|
||||
if( wxWindow* blocking_win = editor->Kiway().GetBlockingDialog() )
|
||||
blocking_win->Close( true );
|
||||
|
||||
editor->LoadSymbolFromSchematic( symbol );
|
||||
|
||||
editor->Show( true );
|
||||
@@ -1391,6 +1407,9 @@ int SCH_EDIT_TOOL::Properties( const TOOL_EVENT& aEvent )
|
||||
auto editor = (SYMBOL_EDIT_FRAME*) m_frame->Kiway().Player( FRAME_SCH_SYMBOL_EDITOR,
|
||||
true );
|
||||
|
||||
if( wxWindow* blocking_win = editor->Kiway().GetBlockingDialog() )
|
||||
blocking_win->Close( true );
|
||||
|
||||
editor->LoadSymbol( symbol->GetLibId(), symbol->GetUnit(), symbol->GetConvert() );
|
||||
|
||||
editor->Show( true );
|
||||
|
||||
@@ -499,18 +499,17 @@ int SCH_EDITOR_CONTROL::FindNext( const TOOL_EVENT& aEvent )
|
||||
continue;
|
||||
}
|
||||
|
||||
SCH_SCREEN* screen = sheet->LastScreen();
|
||||
sheet->UpdateAllScreenReferences();
|
||||
|
||||
item = nextMatch( screen, sheet, nullptr, data );
|
||||
item = nextMatch( sheet->LastScreen(), sheet, nullptr, data );
|
||||
|
||||
if( item )
|
||||
{
|
||||
m_frame->Schematic().SetCurrentSheet( *sheet );
|
||||
m_frame->GetCurrentSheet().UpdateAllScreenReferences();
|
||||
|
||||
screen->TestDanglingEnds();
|
||||
sheet->LastScreen()->TestDanglingEnds();
|
||||
|
||||
m_frame->SetScreen( screen );
|
||||
m_frame->SetScreen( sheet->LastScreen() );
|
||||
m_frame->UpdateHierarchyNavigator();
|
||||
UpdateFind( ACTIONS::updateFind.MakeEvent() );
|
||||
|
||||
@@ -766,6 +765,9 @@ int SCH_EDITOR_CONTROL::SimProbe( const TOOL_EVENT& aEvent )
|
||||
if( !simFrame ) // Defensive coding; shouldn't happen.
|
||||
return 0;
|
||||
|
||||
if( wxWindow* blocking_win = simFrame->Kiway().GetBlockingDialog() )
|
||||
blocking_win->Close( true );
|
||||
|
||||
// Deactivate other tools; particularly important if another PICKER is currently running
|
||||
Activate();
|
||||
|
||||
@@ -913,7 +915,12 @@ int SCH_EDITOR_CONTROL::SimTune( const TOOL_EVENT& aEvent )
|
||||
KIWAY_PLAYER* simFrame = m_frame->Kiway().Player( FRAME_SIMULATOR, false );
|
||||
|
||||
if( simFrame )
|
||||
{
|
||||
if( wxWindow* blocking_win = simFrame->Kiway().GetBlockingDialog() )
|
||||
blocking_win->Close( true );
|
||||
|
||||
static_cast<SIM_PLOT_FRAME*>( simFrame )->AddTuner( symbol );
|
||||
}
|
||||
|
||||
// We do not really want to keep a symbol selected in schematic,
|
||||
// so clear the current selection
|
||||
@@ -1987,6 +1994,9 @@ int SCH_EDITOR_CONTROL::EditWithSymbolEditor( const TOOL_EVENT& aEvent )
|
||||
|
||||
if( symbolEditor )
|
||||
{
|
||||
if( wxWindow* blocking_win = symbolEditor->Kiway().GetBlockingDialog() )
|
||||
blocking_win->Close( true );
|
||||
|
||||
if( aEvent.IsAction( &EE_ACTIONS::editWithLibEdit ) )
|
||||
symbolEditor->LoadSymbolFromSchematic( symbol );
|
||||
else if( aEvent.IsAction( &EE_ACTIONS::editLibSymbolWithLibEdit ) )
|
||||
|
||||
@@ -518,6 +518,11 @@ int SYMBOL_EDITOR_CONTROL::AddSymbolToSchematic( const TOOL_EVENT& aEvent )
|
||||
return 0;
|
||||
}
|
||||
|
||||
wxWindow* blocking_dialog = schframe->Kiway().GetBlockingDialog();
|
||||
|
||||
if( blocking_dialog )
|
||||
blocking_dialog->Close( true );
|
||||
|
||||
wxCHECK( libSymbol->GetLibId().IsValid(), 0 );
|
||||
|
||||
SCH_SYMBOL* symbol = new SCH_SYMBOL( *libSymbol, libId, &schframe->GetCurrentSheet(),
|
||||
@@ -529,7 +534,7 @@ int SYMBOL_EDITOR_CONTROL::AddSymbolToSchematic( const TOOL_EVENT& aEvent )
|
||||
symbol->AutoplaceFields( /* aScreen */ nullptr, /* aManual */ false );
|
||||
|
||||
schframe->Raise();
|
||||
schframe->GetToolManager()->RunAction( EE_ACTIONS::placeSymbol, true, symbol );
|
||||
schframe->GetToolManager()->RunAction( EE_ACTIONS::placeSymbol, false, symbol );
|
||||
}
|
||||
|
||||
return 0;
|
||||
|
||||
@@ -290,6 +290,7 @@ int SYMBOL_EDITOR_DRAWING_TOOLS::TwoClickPlace( const TOOL_EVENT& aEvent )
|
||||
|
||||
controls->SetAutoPan( false );
|
||||
controls->CaptureCursor( false );
|
||||
controls->ForceCursorPosition( false );
|
||||
m_frame->GetCanvas()->SetCurrentCursor( KICURSOR::ARROW );
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -484,18 +484,11 @@ void GBR_TO_PCB_EXPORTER::writePcbHeader( const LAYER_NUM* aLayerLookUpTable )
|
||||
void GBR_TO_PCB_EXPORTER::writePcbPolygon( const SHAPE_POLY_SET& aPolys, LAYER_NUM aLayer,
|
||||
const wxPoint& aOffset )
|
||||
{
|
||||
SHAPE_POLY_SET polys = aPolys;
|
||||
|
||||
// Cleanup the polygon
|
||||
polys.Simplify( SHAPE_POLY_SET::PM_STRICTLY_SIMPLE );
|
||||
|
||||
// Ensure the polygon is valid:
|
||||
if( polys.OutlineCount() == 0 )
|
||||
if( aPolys.OutlineCount() == 0 )
|
||||
return;
|
||||
|
||||
polys.Fracture( SHAPE_POLY_SET::PM_STRICTLY_SIMPLE );
|
||||
|
||||
SHAPE_LINE_CHAIN& poly = polys.Outline( 0 );
|
||||
const SHAPE_LINE_CHAIN& poly = aPolys.COutline( 0 );
|
||||
|
||||
fprintf( m_fp, "(gr_poly (pts " );
|
||||
|
||||
@@ -532,7 +525,7 @@ void GBR_TO_PCB_EXPORTER::writePcbPolygon( const SHAPE_POLY_SET& aPolys, LAYER_N
|
||||
void GBR_TO_PCB_EXPORTER::writePcbZoneItem( const GERBER_DRAW_ITEM* aGbrItem, LAYER_NUM aLayer )
|
||||
{
|
||||
SHAPE_POLY_SET polys = aGbrItem->m_Polygon;
|
||||
polys.Simplify( SHAPE_POLY_SET::PM_STRICTLY_SIMPLE );
|
||||
polys.Simplify( SHAPE_POLY_SET::PM_FAST );
|
||||
|
||||
if( polys.OutlineCount() == 0 )
|
||||
return;
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
* This program source code file is part of KiCad, a free EDA CAD application.
|
||||
*
|
||||
* Copyright (C) 2017 Jon Evans <jon@craftyjon.com>
|
||||
* Copyright (C) 2021 KiCad Developers, see AUTHORS.txt for contributors.
|
||||
* Copyright (C) 2022 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
|
||||
@@ -299,8 +299,11 @@ void GERBVIEW_PAINTER::draw( /*const*/ GERBER_DRAW_ITEM* aItem, int aLayer )
|
||||
// On Opengl, a not convex filled polygon is usually drawn by using triangles as primitives.
|
||||
// CacheTriangulation() can create basic triangle primitives to draw the polygon solid shape
|
||||
// on Opengl
|
||||
// We use the fastest CacheTriangulation calculation mode: no partition created because
|
||||
// the partition is useless in Gerbview, and very time consumming (optimized only
|
||||
// for pcbnew that has different internal unit)
|
||||
if( m_gal->IsOpenGlEngine() && !aItem->m_AbsolutePolygon.IsTriangulationUpToDate() )
|
||||
aItem->m_AbsolutePolygon.CacheTriangulation();
|
||||
aItem->m_AbsolutePolygon.CacheTriangulation( false /* fastest triangulation calculation mode */ );
|
||||
|
||||
m_gal->DrawPolygon( aItem->m_AbsolutePolygon );
|
||||
}
|
||||
|
||||
@@ -1,8 +1,7 @@
|
||||
|
||||
/*
|
||||
* This program source code file is part of KiCad, a free EDA CAD application.
|
||||
*
|
||||
* Copyright (C) 2021 KiCad Developers, see AUTHORS.txt for contributors.
|
||||
* Copyright (C) 2022 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
|
||||
@@ -22,25 +21,10 @@
|
||||
* This file is auto-generated by CMake when MAINTAIN_PNGS is on. Do not edit by hand!
|
||||
*/
|
||||
|
||||
#ifndef KICAD_BITMAP_INFO_H
|
||||
#define KICAD_BITMAP_INFO_H
|
||||
|
||||
#include <vector>
|
||||
#include <bitmaps/bitmaps_list.h>
|
||||
#include <bitmaps/bitmap_info.h>
|
||||
|
||||
#include <wx/string.h> // wxT
|
||||
|
||||
struct BITMAP_INFO
|
||||
void BuildBitmapInfo( std::unordered_map<BITMAPS, std::vector<BITMAP_INFO>>& aBitmapInfoCache )
|
||||
{
|
||||
BITMAPS id;
|
||||
wxString filename;
|
||||
int height;
|
||||
wxString theme;
|
||||
};
|
||||
|
||||
|
||||
const std::vector<BITMAP_INFO> g_BitmapInfo = {
|
||||
${BITMAP_INFO_LIST}
|
||||
};
|
||||
|
||||
#endif // KICAD_BITMAP_INFO_H
|
||||
+13
-1029
File diff suppressed because it is too large
Load Diff
+3
-1
@@ -40,8 +40,10 @@
|
||||
*
|
||||
* @param aParent main frame.
|
||||
* @param aDocName filename of file to open (Full filename or short filename).
|
||||
* @param aPaths Additional paths to search for local disk datasheet files
|
||||
*/
|
||||
bool GetAssociatedDocument( wxWindow* aParent, const wxString& aDocName, PROJECT* aProject );
|
||||
bool GetAssociatedDocument( wxWindow* aParent, const wxString& aDocName, PROJECT* aProject,
|
||||
SEARCH_STACK* aPaths = nullptr );
|
||||
|
||||
|
||||
#endif /* __INCLUDE__EDA_DOC_H__ */
|
||||
|
||||
+44
-44
@@ -24,7 +24,7 @@
|
||||
#ifndef GL_UTILS_H
|
||||
#define GL_UTILS_H
|
||||
|
||||
#include <gal/opengl/kiglew.h> // Must be included first
|
||||
#include <gal/opengl/kiglew.h> // Must be included first
|
||||
#include <wx/glcanvas.h>
|
||||
#include <wx/utils.h>
|
||||
|
||||
@@ -45,62 +45,63 @@ public:
|
||||
/// Windows would include <wglext.h> and call wglSwapIntervalEXT
|
||||
#if defined( __linux__ ) && !defined( KICAD_USE_EGL )
|
||||
|
||||
Display *dpy = glXGetCurrentDisplay();
|
||||
GLXDrawable drawable = glXGetCurrentDrawable();
|
||||
std::string vendor( reinterpret_cast<const char*>( glGetString( GL_VENDOR ) ) );
|
||||
bool is_mesa = ( vendor.find( "Mesa" ) != std::string::npos );
|
||||
|
||||
if( !is_mesa && glXSwapIntervalEXT && glXQueryDrawable && dpy && drawable )
|
||||
if( Display* dpy = glXGetCurrentDisplay() )
|
||||
{
|
||||
GLXDrawable drawable = glXGetCurrentDrawable();
|
||||
|
||||
std::string exts( glXQueryExtensionsString( dpy, DefaultScreen( dpy ) ) );
|
||||
|
||||
if( aVal < 0 )
|
||||
if( glXSwapIntervalEXT && glXQueryDrawable && drawable
|
||||
&& exts.find( "GLX_EXT_swap_control" ) != std::string::npos )
|
||||
{
|
||||
if( exts.find( "GLX_EXT_swap_control_tear" ) == std::string::npos )
|
||||
if( aVal < 0 )
|
||||
{
|
||||
aVal = 0;
|
||||
}
|
||||
else
|
||||
{
|
||||
// Even though the extensions might be available,
|
||||
// we need to be sure that late/adaptive swaps are
|
||||
// enabled on the drawable.
|
||||
|
||||
unsigned lateSwapsEnabled = 0;
|
||||
glXQueryDrawable( dpy, drawable, GLX_LATE_SWAPS_TEAR_EXT, &lateSwapsEnabled );
|
||||
|
||||
if( !lateSwapsEnabled )
|
||||
if( exts.find( "GLX_EXT_swap_control_tear" ) == std::string::npos )
|
||||
{
|
||||
aVal = 0;
|
||||
}
|
||||
else
|
||||
{
|
||||
// Even though the extensions might be available,
|
||||
// we need to be sure that late/adaptive swaps are
|
||||
// enabled on the drawable.
|
||||
|
||||
unsigned lateSwapsEnabled = 0;
|
||||
glXQueryDrawable( dpy, drawable, GLX_LATE_SWAPS_TEAR_EXT,
|
||||
&lateSwapsEnabled );
|
||||
|
||||
if( !lateSwapsEnabled )
|
||||
{
|
||||
aVal = 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
unsigned clampedInterval;
|
||||
glXSwapIntervalEXT( dpy, drawable, aVal );
|
||||
glXQueryDrawable( dpy, drawable, GLX_SWAP_INTERVAL_EXT, &clampedInterval );
|
||||
|
||||
return clampedInterval;
|
||||
}
|
||||
|
||||
unsigned clampedInterval;
|
||||
glXSwapIntervalEXT( dpy, drawable, aVal );
|
||||
glXQueryDrawable( dpy, drawable, GLX_SWAP_INTERVAL_EXT, &clampedInterval );
|
||||
if( glXSwapIntervalMESA && glXGetSwapIntervalMESA
|
||||
&& exts.find( "GLX_MESA_swap_control" ) != std::string::npos )
|
||||
{
|
||||
if( aVal < 0 )
|
||||
aVal = 0;
|
||||
|
||||
return clampedInterval;
|
||||
}
|
||||
glXSwapIntervalMESA( aVal );
|
||||
return glXGetSwapIntervalMESA();
|
||||
}
|
||||
|
||||
if( glXSwapIntervalMESA &&glXGetSwapIntervalMESA )
|
||||
{
|
||||
if( aVal < 0 )
|
||||
aVal = 0;
|
||||
if( aVal > 0 && glXSwapIntervalSGI
|
||||
&& exts.find( "GLX_SGI_swap_control" ) != std::string::npos )
|
||||
{
|
||||
if( glXSwapIntervalSGI( aVal ) )
|
||||
glXSwapIntervalSGI( 1 );
|
||||
|
||||
glXSwapIntervalMESA( aVal );
|
||||
return glXGetSwapIntervalMESA();
|
||||
}
|
||||
|
||||
if( glXSwapIntervalSGI )
|
||||
{
|
||||
if( aVal < 1 )
|
||||
aVal = 1;
|
||||
|
||||
if( glXSwapIntervalSGI( aVal ) )
|
||||
glXSwapIntervalSGI( 1 );
|
||||
|
||||
return 1;
|
||||
return 1;
|
||||
}
|
||||
}
|
||||
|
||||
return std::numeric_limits<int>::max();
|
||||
@@ -111,4 +112,3 @@ public:
|
||||
};
|
||||
|
||||
#endif /* GL_CONTEXT_MANAGER_H */
|
||||
|
||||
|
||||
@@ -27,13 +27,12 @@
|
||||
|
||||
#include <unordered_map>
|
||||
|
||||
#include <eda_rect.h>
|
||||
#include <wx/string.h>
|
||||
|
||||
// First some utility classes and functions
|
||||
|
||||
/// Equality test for "const char*" type used in very specialized KEYWORD_MAP below
|
||||
struct iequal_to : std::binary_function< const char*, const char*, bool >
|
||||
struct iequal_to
|
||||
{
|
||||
bool operator()( const char* x, const char* y ) const
|
||||
{
|
||||
@@ -77,7 +76,7 @@ struct fnv_1a
|
||||
|
||||
|
||||
/// Hash function for wxString, counterpart of std::string hash
|
||||
struct WXSTRING_HASH : std::unary_function<wxString, std::size_t>
|
||||
struct WXSTRING_HASH
|
||||
{
|
||||
std::size_t operator()( const wxString& aString ) const
|
||||
{
|
||||
@@ -128,9 +127,5 @@ struct WXSTRING_HASH : std::unary_function<wxString, std::size_t>
|
||||
*/
|
||||
typedef std::unordered_map< const char*, int, fnv_1a, iequal_to > KEYWORD_MAP;
|
||||
|
||||
/// Map a C string to an EDA_RECT.
|
||||
/// The key is the classname of the derived wxformbuilder dialog.
|
||||
typedef std::unordered_map< std::string, EDA_RECT > RECT_MAP;
|
||||
|
||||
|
||||
#endif // HASHTABLES_H_
|
||||
|
||||
@@ -392,6 +392,13 @@ public:
|
||||
|
||||
bool ProcessEvent( wxEvent& aEvent ) override;
|
||||
|
||||
/**
|
||||
* Gets the window pointer to the blocking dialog (to send it signals)
|
||||
* @return Pointer to blocking dialog window or null if none
|
||||
*/
|
||||
wxWindow* GetBlockingDialog();
|
||||
void SetBlockingDialog( wxWindow* aWin );
|
||||
|
||||
private:
|
||||
/// Get the [path &] name of the DSO holding the requested FACE_T.
|
||||
const wxString dso_search_path( FACE_T aFaceId );
|
||||
@@ -426,6 +433,8 @@ private:
|
||||
|
||||
wxFrame* m_top; // Usually m_top is the Project manager
|
||||
|
||||
wxWindowID m_blockingDialog;
|
||||
|
||||
// An array to store the window ID of PLAYER frames which were run.
|
||||
// A non empty name means only a PLAYER was run at least one time.
|
||||
// Empty entries are represented by wxID_NONE.
|
||||
|
||||
@@ -56,6 +56,15 @@ public:
|
||||
return *m_kiway;
|
||||
}
|
||||
|
||||
/**
|
||||
* Safety check before asking for the Kiway reference
|
||||
* @return true if kiway is non-null
|
||||
*/
|
||||
bool HasKiway() const
|
||||
{
|
||||
return m_kiway != nullptr;
|
||||
}
|
||||
|
||||
/**
|
||||
* Return a reference to the #PROJECT associated with this #KIWAY.
|
||||
*/
|
||||
|
||||
@@ -578,6 +578,9 @@ private:
|
||||
|
||||
///< Pointer to the state object corresponding to the currently executed tool.
|
||||
TOOL_STATE* m_activeState;
|
||||
|
||||
///< True if the tool manager is shutting down (don't process additional events)
|
||||
bool m_shuttingDown;
|
||||
};
|
||||
|
||||
#endif // __TOOL_MANAGER_H
|
||||
|
||||
@@ -114,8 +114,8 @@ protected:
|
||||
class GRID_CELL_URL_EDITOR : public GRID_CELL_TEXT_BUTTON
|
||||
{
|
||||
public:
|
||||
GRID_CELL_URL_EDITOR( DIALOG_SHIM* aParent ) :
|
||||
m_dlg( aParent )
|
||||
GRID_CELL_URL_EDITOR( DIALOG_SHIM* aParent, SEARCH_STACK* aSearchStack = nullptr ) :
|
||||
m_dlg( aParent ), m_searchStack( aSearchStack )
|
||||
{ }
|
||||
|
||||
wxGridCellEditor* Clone() const override
|
||||
@@ -127,6 +127,7 @@ public:
|
||||
|
||||
protected:
|
||||
DIALOG_SHIM* m_dlg;
|
||||
SEARCH_STACK* m_searchStack;
|
||||
};
|
||||
|
||||
|
||||
|
||||
@@ -84,7 +84,7 @@ public:
|
||||
/**
|
||||
* Set new value (in Internal Units) for the text field, taking care of units conversion.
|
||||
*/
|
||||
virtual void SetValue( int aValue );
|
||||
virtual void SetValue( long long int aValue );
|
||||
|
||||
void SetValue( const wxString& aValue );
|
||||
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user