Compare commits
429 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 3abcdb7e63 | |||
| c45aa734b0 | |||
| a35b89258a | |||
| 408bf85cf5 | |||
| ba34cd629e | |||
| 81dba33c8f | |||
| 2b238de012 | |||
| c0ce4cb0bc | |||
| f379fa4f7f | |||
| 4e67b94b00 | |||
| bb0f3550e0 | |||
| ce1f166aa8 | |||
| 437cd8b1e5 | |||
| 3e8532264e | |||
| 9b15717349 | |||
| 73d00cc5d7 | |||
| 295aa15c3d | |||
| 50adb45c33 | |||
| a1a44db01d | |||
| b2f68854b2 | |||
| 42f844826d | |||
| 52ca321b11 | |||
| 5af5511dfe | |||
| f06f205886 | |||
| 030a562ba6 | |||
| 2393165ada | |||
| e593e0b014 | |||
| 42dae1504a | |||
| 440d324c9e | |||
| 29cadaf54e | |||
| 83eb9e03b1 | |||
| b324abefe5 | |||
| b72675ba92 | |||
| 70b69af313 | |||
| 83f135315c | |||
| c276280e5c | |||
| 07481cd4ca | |||
| 8a9ee0f9e1 | |||
| 9a823ca61b | |||
| 5afeb45a84 | |||
| 45da795668 | |||
| 87a8e69632 | |||
| d57caf2ad7 | |||
| 7f1c2461b5 | |||
| 26104c83ba | |||
| 6d14ce24aa | |||
| e760579828 | |||
| 7640246097 | |||
| e25d937fd8 | |||
| ea3f6c8406 | |||
| bf272e379f | |||
| 0acea2e386 | |||
| 83305dd407 | |||
| 1d5db513a1 | |||
| 9d0d45450b | |||
| 9bce3c243a | |||
| ace0032c82 | |||
| cd30711cf8 | |||
| a3da0b9af6 | |||
| 32a11e4df0 | |||
| 5606714952 | |||
| 9af666ba34 | |||
| 4d9802760e | |||
| c3496d61eb | |||
| 1e09f0e8b0 | |||
| c2c4609272 | |||
| 9328cf42c5 | |||
| 93f23dbdcd | |||
| 9e9b38ef6a | |||
| 5e409f0f6c | |||
| 408e7fed29 | |||
| 85ce1a2a20 | |||
| c1947c108b | |||
| d2916bf399 | |||
| 93f973d825 | |||
| 72503c47c6 | |||
| db96624990 | |||
| 962df45b65 | |||
| f92d25e00b | |||
| 64220656e9 | |||
| 39940fe5ab | |||
| 40977514ce | |||
| cfde5300d7 | |||
| 30c83ed055 | |||
| 64acd8bd47 | |||
| ca4da4706a | |||
| 1005f75cdb | |||
| f637a820b6 | |||
| 47cb817a86 | |||
| 7769069078 | |||
| 411d57396c | |||
| 5f00847a86 | |||
| 36a0c2a9cc | |||
| 4ac48ad829 | |||
| 3bca4f8835 | |||
| afc491c5a5 | |||
| f75104d456 | |||
| 1f3bb83a06 | |||
| efc75047c1 | |||
| 7b5e3feb19 | |||
| fec9331b48 | |||
| a12ae5050a | |||
| 82e8e38054 | |||
| 57de5a6b65 | |||
| 675a5a6e7b | |||
| 6c617d84ca | |||
| 7f71eef45b | |||
| b50d7adaeb | |||
| 027b745124 | |||
| c9c31fcbc2 | |||
| 45c20bec49 | |||
| fe0d09222d | |||
| 28d755ac27 | |||
| 37d9186e2d | |||
| c076239915 | |||
| ca34cea2c1 | |||
| 4c064e41f6 | |||
| 650caae323 | |||
| 06e612661c | |||
| ee4e4d0773 | |||
| 147b11abe0 | |||
| df9cf0a0c3 | |||
| b1ce6be634 | |||
| 3f448a7eaa | |||
| 5214290000 | |||
| fcd7e827e6 | |||
| 466f1283c1 | |||
| 39dd51490d | |||
| 120ceade06 | |||
| f3caac5bfd | |||
| 7bd073b5cb | |||
| af40ddd0e1 | |||
| e59d8b0a2d | |||
| 7113f1f879 | |||
| 31db2b8525 | |||
| 3363fdb248 | |||
| 983f389b24 | |||
| 8d48a56b4a | |||
| 2460276e85 | |||
| 70f2e80dd1 | |||
| 8a5233912f | |||
| c2a6906c31 | |||
| b05fd8f209 | |||
| f3a906dc86 | |||
| a5b676fa0e | |||
| 38b75db12c | |||
| fb2cf7b8be | |||
| ac28ed9888 | |||
| d9fef3da72 | |||
| 61bb793324 | |||
| ccb416eead | |||
| 6e10a496ef | |||
| e06e65cdde | |||
| 832c689345 | |||
| 0580fc6819 | |||
| 0f882d91e5 | |||
| 2fdddb970f | |||
| 0321d96b1e | |||
| ce92c676e6 | |||
| bb5fd5a2ec | |||
| 41a9293106 | |||
| 3c4f8a335f | |||
| 1a6e9538cd | |||
| 06baaa33fa | |||
| cd5b4ec8f2 | |||
| 58451335cb | |||
| e7dd9f9337 | |||
| 7bf66be2ac | |||
| 0bc97b7952 | |||
| 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"
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
* This program source code file is part of KiCad, a free EDA CAD application.
|
||||
*
|
||||
* Copyright (C) 2015-2016 Cirilo Bernardo <cirilo.bernardo@gmail.com>
|
||||
* Copyright (C) 2018-2020 KiCad Developers, see AUTHORS.txt for contributors.
|
||||
* Copyright (C) 2018-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
|
||||
@@ -29,7 +29,6 @@
|
||||
|
||||
#include <wx/datetime.h>
|
||||
#include <wx/dir.h>
|
||||
#include <wx/filename.h>
|
||||
#include <wx/log.h>
|
||||
#include <wx/stdpaths.h>
|
||||
|
||||
@@ -55,6 +54,7 @@
|
||||
#include <project.h>
|
||||
#include <settings/common_settings.h>
|
||||
#include <settings/settings_manager.h>
|
||||
#include <wx_filename.h>
|
||||
|
||||
|
||||
#define MASK_3D_CACHE "3D_CACHE"
|
||||
@@ -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
|
||||
|
||||
@@ -513,7 +514,7 @@ bool S3D_CACHE::Set3DConfigDir( const wxString& aConfigDir )
|
||||
|
||||
wxFileName cfgdir( ExpandEnvVarSubstitutions( aConfigDir, m_project ), wxEmptyString );
|
||||
|
||||
cfgdir.Normalize();
|
||||
cfgdir.Normalize( FN_NORMALIZE_FLAGS );
|
||||
|
||||
if( !cfgdir.DirExists() )
|
||||
{
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
* This program source code file is part of KiCad, a free EDA CAD application.
|
||||
*
|
||||
* Copyright (C) 2015-2016 Cirilo Bernardo <cirilo.bernardo@gmail.com>
|
||||
* Copyright (C) 2020 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
|
||||
@@ -29,13 +29,13 @@
|
||||
|
||||
#include <wx/dir.h>
|
||||
#include <wx/dynlib.h>
|
||||
#include <wx/filename.h>
|
||||
#include <wx/log.h>
|
||||
#include <wx/stdpaths.h>
|
||||
#include <wx/string.h>
|
||||
|
||||
#include <common.h>
|
||||
#include <paths.h>
|
||||
#include <wx_filename.h>
|
||||
#include "3d_plugin_manager.h"
|
||||
#include "plugins/3d/3d_plugin.h"
|
||||
#include "3d_cache/sg/scenegraph.h"
|
||||
@@ -153,24 +153,14 @@ void S3D_PLUGIN_MANAGER::loadPlugins( void )
|
||||
|
||||
fn.AssignDir( PATHS::GetStockPlugins3DPath() );
|
||||
checkPluginPath( std::string( fn.GetPathWithSep().ToUTF8() ), searchpaths );
|
||||
|
||||
// check for per-user third party plugins
|
||||
// note: GetUserDataDir() gives '.pcbnew' rather than '.kicad' since it uses the exe name;
|
||||
fn.AssignDir( PATHS::GetUserPlugins3DPath() );
|
||||
checkPluginPath( fn.GetPathWithSep(), searchpaths );
|
||||
#else
|
||||
|
||||
// Search path on OS X is
|
||||
// (1) User ~/Library/Application Support/kicad/PlugIns/3d
|
||||
checkPluginPath( PATHS::GetOSXKicadUserDataDir() + wxT( "/PlugIns/3d" ), searchpaths );
|
||||
|
||||
// (2) Machine /Library/Application Support/kicad/PlugIns/3d
|
||||
// (1) Machine /Library/Application Support/kicad/PlugIns/3d
|
||||
checkPluginPath( PATHS::GetOSXKicadMachineDataDir() + wxT( "/PlugIns/3d" ), searchpaths );
|
||||
|
||||
// (3) Bundle kicad.app/Contents/PlugIns/3d
|
||||
// (2) Bundle kicad.app/Contents/PlugIns/3d
|
||||
fn.AssignDir( PATHS::GetStockPlugins3DPath() );
|
||||
checkPluginPath( fn.GetPathWithSep(), searchpaths );
|
||||
|
||||
#endif
|
||||
|
||||
std::list< wxString >::iterator sPL = searchpaths.begin();
|
||||
@@ -288,7 +278,7 @@ void S3D_PLUGIN_MANAGER::checkPluginName( const wxString& aPath,
|
||||
|
||||
wxFileName path( ExpandEnvVarSubstitutions( aPath, nullptr ) );
|
||||
|
||||
path.Normalize();
|
||||
path.Normalize( FN_NORMALIZE_FLAGS );
|
||||
|
||||
// determine if the path is already in the list
|
||||
wxString wxpath = path.GetFullPath();
|
||||
@@ -326,7 +316,7 @@ void S3D_PLUGIN_MANAGER::checkPluginPath( const wxString& aPath,
|
||||
else
|
||||
path.Assign( aPath, wxEmptyString );
|
||||
|
||||
path.Normalize();
|
||||
path.Normalize( FN_NORMALIZE_FLAGS );
|
||||
|
||||
if( !wxFileName::DirExists( path.GetFullPath() ) )
|
||||
return;
|
||||
|
||||
@@ -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 );
|
||||
|
||||
@@ -111,7 +111,7 @@ TOOL_ACTION EDA_3D_ACTIONS::resetView( "3DViewer.Control.resetView",
|
||||
|
||||
TOOL_ACTION EDA_3D_ACTIONS::flipView( "3DViewer.Control.flipView",
|
||||
AS_ACTIVE,
|
||||
0, "",
|
||||
'F', "",
|
||||
_( "Flip Board" ), _( "Flip the board view" ),
|
||||
BITMAPS::flip_board, AF_NONE, (void*) ID_VIEW3D_FLIP );
|
||||
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
*
|
||||
* Copyright (C) 2016 Mario Luzeiro <mrluzeiro@ua.pt>
|
||||
* Copyright (C) 2016 Cirilo Bernardo <cirilo.bernardo@gmail.com>
|
||||
* 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
|
||||
@@ -34,6 +34,7 @@
|
||||
#include <common_ogl/ogl_attr_list.h>
|
||||
#include <filename_resolver.h>
|
||||
#include <pcbnew/footprint.h>
|
||||
#include <wx_filename.h>
|
||||
|
||||
#include <wx/filedlg.h>
|
||||
|
||||
@@ -164,7 +165,7 @@ bool DIALOG_SELECT_3DMODEL::TransferDataFromWindow()
|
||||
// file selection mode: retrieve the filename and specify a
|
||||
// path relative to one of the config paths
|
||||
wxFileName fname = m_FileTree->GetFilePath();
|
||||
fname.Normalize();
|
||||
fname.Normalize( FN_NORMALIZE_FLAGS | wxPATH_NORM_ENV_VARS );
|
||||
m_model->m_Filename = m_resolver->ShortenPath( fname.GetFullPath() );
|
||||
|
||||
return 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.8" )
|
||||
|
||||
# Default the version to the semantic version.
|
||||
# This is overridden by the git repository tag though (if using git)
|
||||
|
||||
@@ -503,21 +503,22 @@ void BITMAPCONV_INFO::createOutputData( BMP2CMP_MOD_LAYER aModLayer )
|
||||
polyset_areas.BooleanSubtract( polyset_holes, SHAPE_POLY_SET::PM_STRICTLY_SIMPLE );
|
||||
|
||||
// Ensure there are no self intersecting polygons
|
||||
polyset_areas.NormalizeAreaOutlines();
|
||||
|
||||
// Convert polygon with holes to a unique polygon
|
||||
polyset_areas.Fracture( SHAPE_POLY_SET::PM_STRICTLY_SIMPLE );
|
||||
|
||||
// Output current resulting polygon(s)
|
||||
for( int ii = 0; ii < polyset_areas.OutlineCount(); ii++ )
|
||||
if( polyset_areas.NormalizeAreaOutlines() )
|
||||
{
|
||||
SHAPE_LINE_CHAIN& poly = polyset_areas.Outline( ii );
|
||||
outputOnePolygon( poly, getBoardLayerName( aModLayer ));
|
||||
}
|
||||
// Convert polygon with holes to a unique polygon
|
||||
polyset_areas.Fracture( SHAPE_POLY_SET::PM_STRICTLY_SIMPLE );
|
||||
|
||||
polyset_areas.RemoveAllContours();
|
||||
polyset_holes.RemoveAllContours();
|
||||
main_outline = true;
|
||||
// Output current resulting polygon(s)
|
||||
for( int ii = 0; ii < polyset_areas.OutlineCount(); ii++ )
|
||||
{
|
||||
SHAPE_LINE_CHAIN& poly = polyset_areas.Outline( ii );
|
||||
outputOnePolygon( poly, getBoardLayerName( aModLayer ));
|
||||
}
|
||||
|
||||
polyset_areas.RemoveAllContours();
|
||||
polyset_holes.RemoveAllContours();
|
||||
main_outline = true;
|
||||
}
|
||||
}
|
||||
|
||||
paths = paths->next;
|
||||
|
||||
@@ -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 );
|
||||
|
||||
@@ -251,6 +251,16 @@ void BITMAP_BASE::DrawBitmap( wxDC* aDC, const wxPoint& aPos )
|
||||
aDC->GetLogicalOrigin( &logicalOriginX, &logicalOriginY );
|
||||
|
||||
bool useTransform = aDC->CanUseTransformMatrix();
|
||||
|
||||
// We already have issues to draw a bitmap on the wxDC, depending on wxWidgets version.
|
||||
// Now we have an issue on wxWidgets 3.1.6 and later to fix the clipboard
|
||||
// and the bitmap position when using TransformMatrix
|
||||
// So for version >= 3.1.6 do not use it
|
||||
// Be carefull before changing the code.
|
||||
#if wxCHECK_VERSION( 3, 1, 6 )
|
||||
useTransform = false;
|
||||
#endif
|
||||
|
||||
wxAffineMatrix2D init_matrix = aDC->GetTransformMatrix();
|
||||
|
||||
wxPoint clipAreaPos;
|
||||
@@ -261,8 +271,12 @@ void BITMAP_BASE::DrawBitmap( wxDC* aDC, const wxPoint& aPos )
|
||||
matrix.Translate( pos.x, pos.y );
|
||||
matrix.Scale( GetScalingFactor(), GetScalingFactor() );
|
||||
aDC->SetTransformMatrix( matrix );
|
||||
// Needed on wx <= 3.1.5, and this is strange...
|
||||
// Nevertheless, this code has problem (the bitmap is not seen)
|
||||
// with wx version > 3.1.5
|
||||
clipAreaPos.x = pos.x;
|
||||
clipAreaPos.y = pos.y;
|
||||
|
||||
pos.x = pos.y = 0;
|
||||
}
|
||||
else
|
||||
|
||||
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
|
||||
{
|
||||
@@ -132,6 +136,9 @@ void BOARD_PRINTOUT::DrawPage( const wxString& aLayerName, int aPageNum, int aPa
|
||||
|
||||
setupPainter( *painter );
|
||||
setupViewLayers( *view, m_settings.m_LayerSet );
|
||||
dstSettings->SetPrintLayers( m_settings.m_LayerSet );
|
||||
|
||||
dstSettings->SetLayerName( aLayerName );
|
||||
|
||||
wxSize sheetSizeMils = m_settings.m_pageInfo.GetSizeMils();
|
||||
VECTOR2I sheetSizeIU( milsToIU( sheetSizeMils.GetWidth() ),
|
||||
|
||||
@@ -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,7 +1,7 @@
|
||||
/*
|
||||
* This program source code file is part of KiCad, a free EDA CAD application.
|
||||
*
|
||||
* Copyright (C) 2018-2021 KiCad Developers, see AUTHORS.txt for contributors.
|
||||
* Copyright (C) 2018-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
|
||||
@@ -396,13 +396,18 @@ void DIALOG_COLOR_PICKER::drawRGBPalette()
|
||||
|
||||
// Use Y axis from bottom to top and origin to center
|
||||
bitmapDC.SetAxisOrientation( true, true );
|
||||
#if wxCHECK_VERSION( 3, 1, 7 )
|
||||
// For some reason, SetDeviceOrigin has changed in wxWidgets 3.1.6 or 3.1.7
|
||||
bitmapDC.SetDeviceOrigin( half_size, -half_size );
|
||||
#else
|
||||
bitmapDC.SetDeviceOrigin( half_size, half_size );
|
||||
#endif
|
||||
|
||||
// Reserve room to draw cursors inside the bitmap
|
||||
half_size -= m_cursorsSize/2;
|
||||
|
||||
// Draw the 3 RGB cursors, using white color to make them always visible:
|
||||
wxPen pen( wxColor( 255, 255, 255 ) );
|
||||
wxPen pen( wxColor( 255, 255, 255 ), 2 ); // use 2 pixels for pen size
|
||||
wxBrush brush( wxColor( 0, 0, 0 ), wxBRUSHSTYLE_TRANSPARENT );
|
||||
bitmapDC.SetPen( pen );
|
||||
bitmapDC.SetBrush( brush );
|
||||
@@ -461,7 +466,12 @@ void DIALOG_COLOR_PICKER::drawHSVPalette()
|
||||
|
||||
// Use Y axis from bottom to top and origin to center
|
||||
bitmapDC.SetAxisOrientation( true, true );
|
||||
#if wxCHECK_VERSION( 3, 1, 7 )
|
||||
// For some reason, SetDeviceOrigin has changed in wxWidgets 3.1.6 or 3.1.7
|
||||
bitmapDC.SetDeviceOrigin( half_size, -half_size );
|
||||
#else
|
||||
bitmapDC.SetDeviceOrigin( half_size, half_size );
|
||||
#endif
|
||||
|
||||
// Reserve room to draw cursors inside the bitmap
|
||||
half_size -= m_cursorsSize / 2;
|
||||
@@ -470,7 +480,7 @@ void DIALOG_COLOR_PICKER::drawHSVPalette()
|
||||
m_cursorBitmapHSV.x = cos( m_hue * M_PI / 180.0 ) * half_size * m_sat;
|
||||
m_cursorBitmapHSV.y = sin( m_hue * M_PI / 180.0 ) * half_size * m_sat;
|
||||
|
||||
wxPen pen( wxColor( 0, 0, 0 ) );
|
||||
wxPen pen( wxColor( 0, 0, 0 ), 2 ); // Use 2 pixels as pensize
|
||||
wxBrush brush( wxColor( 0, 0, 0 ), wxBRUSHSTYLE_TRANSPARENT );
|
||||
bitmapDC.SetPen( pen );
|
||||
bitmapDC.SetBrush( brush );
|
||||
|
||||
@@ -45,6 +45,8 @@ DIALOG_PASTE_SPECIAL::DIALOG_PASTE_SPECIAL( wxWindow* aParent,
|
||||
"with '%s'." ),
|
||||
aReplacement ) );
|
||||
|
||||
m_sdbSizerOK->SetFocus();
|
||||
|
||||
// Now all widgets have the size fixed, call FinishDialogSettings
|
||||
finishDialogSettings();
|
||||
}
|
||||
|
||||
@@ -174,6 +174,11 @@ void EDA_DRAW_PANEL_GAL::onPaint( wxPaintEvent& WXUNUSED( aEvent ) )
|
||||
|
||||
void EDA_DRAW_PANEL_GAL::DoRePaint()
|
||||
{
|
||||
if( !m_refreshMutex.try_lock() )
|
||||
return;
|
||||
|
||||
std::lock_guard<std::mutex> lock( m_refreshMutex, std::adopt_lock );
|
||||
|
||||
// Repaint the canvas, and fix scrollbar cursors
|
||||
// Usually called by a OnPaint event, but because it does not use a wxPaintDC,
|
||||
// it can be called outside a wxPaintEvent.
|
||||
|
||||
@@ -83,6 +83,7 @@ void DS_PROXY_VIEW_ITEM::buildDrawList( VIEW* aView, DS_DRAW_ITEM_LIST* aDrawLis
|
||||
aDrawList->SetSheetCount( m_sheetCount );
|
||||
aDrawList->SetFileName( fileName );
|
||||
aDrawList->SetSheetName( sheetName );
|
||||
aDrawList->SetSheetLayer( settings->GetLayerName() );
|
||||
aDrawList->SetProject( m_project );
|
||||
|
||||
aDrawList->BuildDrawItemsList( *m_pageInfo, *m_titleBlock );
|
||||
|
||||
+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();
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -365,7 +365,7 @@ void EDA_SHAPE::flip( const wxPoint& aCentre, bool aFlipLeftRight )
|
||||
|
||||
void EDA_SHAPE::RebuildBezierToSegmentsPointsList( int aMinSegLen )
|
||||
{
|
||||
// Has meaning only for S_CURVE DRAW_SEGMENT shape
|
||||
// Has meaning only for SHAPE_T::BEZIER
|
||||
if( m_shape != SHAPE_T::BEZIER )
|
||||
{
|
||||
m_bezierPoints.clear();
|
||||
|
||||
@@ -26,7 +26,6 @@
|
||||
#include <mutex>
|
||||
#include <sstream>
|
||||
|
||||
#include <wx/filename.h>
|
||||
#include <wx/log.h>
|
||||
#include <wx/msgdlg.h>
|
||||
#include <pgm_base.h>
|
||||
@@ -34,6 +33,7 @@
|
||||
|
||||
#include "common.h"
|
||||
#include "filename_resolver.h"
|
||||
#include <wx_filename.h>
|
||||
|
||||
// configuration file version
|
||||
#define CFGFILE_VERSION 1
|
||||
@@ -66,7 +66,7 @@ bool FILENAME_RESOLVER::Set3DConfigDir( const wxString& aConfigDir )
|
||||
|
||||
wxFileName cfgdir( ExpandEnvVarSubstitutions( aConfigDir, m_project ), wxEmptyString );
|
||||
|
||||
cfgdir.Normalize();
|
||||
cfgdir.Normalize( FN_NORMALIZE_FLAGS );
|
||||
|
||||
if( !cfgdir.DirExists() )
|
||||
return false;
|
||||
@@ -87,7 +87,7 @@ bool FILENAME_RESOLVER::SetProject( PROJECT* aProject, bool* flgChanged )
|
||||
|
||||
wxFileName projdir( ExpandEnvVarSubstitutions( aProject->GetProjectPath(), aProject ), wxEmptyString );
|
||||
|
||||
projdir.Normalize();
|
||||
projdir.Normalize( FN_NORMALIZE_FLAGS );
|
||||
|
||||
if( !projdir.DirExists() )
|
||||
return false;
|
||||
@@ -189,7 +189,7 @@ bool FILENAME_RESOLVER::createPathList()
|
||||
else
|
||||
{
|
||||
fndummy.Assign( pathVal, wxEmptyString );
|
||||
fndummy.Normalize();
|
||||
fndummy.Normalize( FN_NORMALIZE_FLAGS );
|
||||
lpath.m_Pathexp = fndummy.GetFullPath();
|
||||
}
|
||||
|
||||
@@ -269,7 +269,7 @@ wxString FILENAME_RESOLVER::ResolvePath( const wxString& aFileName )
|
||||
// working directory (which is not necessarily the current project directory)
|
||||
if( tmpFN.FileExists() )
|
||||
{
|
||||
tmpFN.Normalize();
|
||||
tmpFN.Normalize( FN_NORMALIZE_FLAGS );
|
||||
tname = tmpFN.GetFullPath();
|
||||
|
||||
// special case: if a path begins with ${ENV_VAR} but is not in the resolver's path list
|
||||
@@ -316,7 +316,7 @@ wxString FILENAME_RESOLVER::ResolvePath( const wxString& aFileName )
|
||||
if( wxFileName::FileExists( fullPath ) )
|
||||
{
|
||||
tmpFN.Assign( fullPath );
|
||||
tmpFN.Normalize();
|
||||
tmpFN.Normalize( FN_NORMALIZE_FLAGS );
|
||||
tname = tmpFN.GetFullPath();
|
||||
return tname;
|
||||
}
|
||||
@@ -333,7 +333,7 @@ wxString FILENAME_RESOLVER::ResolvePath( const wxString& aFileName )
|
||||
fullPath = ExpandEnvVarSubstitutions( fullPath, m_project );
|
||||
fpath.Assign( fullPath );
|
||||
|
||||
if( fpath.Normalize() && fpath.FileExists() )
|
||||
if( fpath.Normalize( FN_NORMALIZE_FLAGS ) && fpath.FileExists() )
|
||||
{
|
||||
tname = fpath.GetFullPath();
|
||||
return tname;
|
||||
@@ -381,7 +381,7 @@ wxString FILENAME_RESOLVER::ResolvePath( const wxString& aFileName )
|
||||
|
||||
wxFileName tmp( fullPath );
|
||||
|
||||
if( tmp.Normalize() )
|
||||
if( tmp.Normalize( FN_NORMALIZE_FLAGS ) )
|
||||
tname = tmp.GetFullPath();
|
||||
|
||||
return tname;
|
||||
@@ -422,7 +422,7 @@ bool FILENAME_RESOLVER::addPath( const SEARCH_PATH& aPath )
|
||||
|
||||
wxFileName path( ExpandEnvVarSubstitutions( tpath.m_Pathvar, m_project ), wxEmptyString );
|
||||
|
||||
path.Normalize();
|
||||
path.Normalize( FN_NORMALIZE_FLAGS );
|
||||
|
||||
if( !path.DirExists() )
|
||||
{
|
||||
@@ -496,7 +496,11 @@ bool FILENAME_RESOLVER::readPathList()
|
||||
}
|
||||
|
||||
wxFileName cfgpath( m_configDir, RESOLVER_CONFIG );
|
||||
cfgpath.Normalize();
|
||||
|
||||
// This should be the same as wxWidgets 3.0 wxPATH_NORM_ALL which is deprecated in 3.1.
|
||||
// There are known issues with environment variable expansion so maybe we should be using
|
||||
// our own ExpandEnvVarSubstitutions() here instead.
|
||||
cfgpath.Normalize( FN_NORMALIZE_FLAGS | wxPATH_NORM_ENV_VARS );
|
||||
wxString cfgname = cfgpath.GetFullPath();
|
||||
|
||||
size_t nitems = m_paths.size();
|
||||
@@ -716,7 +720,7 @@ void FILENAME_RESOLVER::checkEnvVarPath( const wxString& aPath )
|
||||
wxFileName tmpFN( ExpandEnvVarSubstitutions( lpath.m_Alias, m_project ), wxEmptyString );
|
||||
|
||||
wxUniChar psep = tmpFN.GetPathSeparator();
|
||||
tmpFN.Normalize();
|
||||
tmpFN.Normalize( FN_NORMALIZE_FLAGS );
|
||||
|
||||
if( !tmpFN.DirExists() )
|
||||
return;
|
||||
|
||||
@@ -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
|
||||
|
||||
+6
-8
@@ -41,14 +41,11 @@
|
||||
static std::mutex rng_mutex;
|
||||
|
||||
// Static rng and generators are used because the overhead of constant seeding is expensive
|
||||
// We break out the rng separately from the generator because we want to control seeding in cases like unit tests
|
||||
#if BOOST_VERSION >= 106700
|
||||
static boost::uuids::detail::random_provider seeder; // required to ensure the rng has a random initial seed
|
||||
#else
|
||||
static boost::uuids::detail::seed_rng seeder; // required to ensure the rng has a random initial seed
|
||||
#endif
|
||||
static boost::mt19937 rng( seeder );
|
||||
static boost::uuids::basic_random_generator<boost::mt19937> randomGenerator( rng );
|
||||
// We rely on the default non-arg constructor of basic_random_generator to provide a random seed.
|
||||
// We use a separate rng object for cases where we want to control the basic_random_generator
|
||||
// initial seed by calling SeedGenerator from unit tests and other special cases.
|
||||
static boost::mt19937 rng;
|
||||
static boost::uuids::basic_random_generator<boost::mt19937> randomGenerator;
|
||||
|
||||
// These don't have the same performance penalty, but we might as well be consistent
|
||||
static boost::uuids::string_generator stringGenerator;
|
||||
@@ -279,6 +276,7 @@ void KIID::CreateNilUuids( bool aNil )
|
||||
void KIID::SeedGenerator( unsigned int aSeed )
|
||||
{
|
||||
rng.seed( aSeed );
|
||||
randomGenerator = boost::uuids::basic_random_generator<boost::mt19937>( rng );
|
||||
}
|
||||
|
||||
|
||||
|
||||
+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++ )
|
||||
|
||||
@@ -84,6 +84,7 @@ void PlotDrawingSheet( PLOTTER* plotter, const PROJECT* aProject, const TITLE_BL
|
||||
drawList.SetSheetCount( aSheetCount );
|
||||
drawList.SetFileName( fn.GetFullName() ); // Print only the short filename
|
||||
drawList.SetSheetName( aSheetDesc );
|
||||
drawList.SetSheetLayer( plotter->RenderSettings()->GetLayerName() );
|
||||
drawList.SetProject( aProject );
|
||||
drawList.SetIsFirstPage( aIsFirstPage );
|
||||
|
||||
|
||||
@@ -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;
|
||||
};
|
||||
|
||||
|
||||
+2
-2
@@ -1,7 +1,7 @@
|
||||
/*
|
||||
* This program source code file is part of KiCad, a free EDA CAD application.
|
||||
*
|
||||
* Copyright (C) 2014-2021 KiCad Developers, see AUTHORS.txt for contributors.
|
||||
* Copyright (C) 2014-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
|
||||
@@ -273,7 +273,7 @@ const wxString PROJECT::AbsolutePath( const wxString& aFileName ) const
|
||||
if( !fn.IsAbsolute() )
|
||||
{
|
||||
wxString pro_dir = wxPathOnly( GetProjectFullName() );
|
||||
fn.Normalize( wxPATH_NORM_ALL, pro_dir );
|
||||
fn.Normalize( FN_NORMALIZE_FLAGS | wxPATH_NORM_ENV_VARS, pro_dir );
|
||||
}
|
||||
|
||||
return fn.GetFullPath();
|
||||
|
||||
+1
-1
@@ -466,7 +466,7 @@ void RC_TREE_MODEL::DeleteCurrentItem( bool aDeep )
|
||||
|
||||
void RC_TREE_MODEL::DeleteItems( bool aCurrentOnly, bool aIncludeExclusions, bool aDeep )
|
||||
{
|
||||
RC_TREE_NODE* current_node = ToNode( m_view->GetCurrentItem() );
|
||||
RC_TREE_NODE* current_node = m_view ? ToNode( m_view->GetCurrentItem() ) : nullptr;
|
||||
const std::shared_ptr<RC_ITEM> current_item = current_node ? current_node->m_RcItem : nullptr;
|
||||
|
||||
/// Keep a vector of elements to free after wxWidgets is definitely done accessing them
|
||||
|
||||
@@ -22,6 +22,7 @@
|
||||
|
||||
#include <settings/json_settings_internals.h>
|
||||
#include <settings/nested_settings.h>
|
||||
#include <locale_io.h>
|
||||
|
||||
NESTED_SETTINGS::NESTED_SETTINGS( const std::string& aName, int aVersion, JSON_SETTINGS* aParent,
|
||||
const std::string& aPath ) :
|
||||
@@ -116,6 +117,8 @@ bool NESTED_SETTINGS::SaveToFile( const wxString& aDirectory, bool aForce )
|
||||
if( !m_parent )
|
||||
return false;
|
||||
|
||||
LOCALE_IO dummy;
|
||||
|
||||
try
|
||||
{
|
||||
bool modified = Store();
|
||||
|
||||
@@ -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 ) );
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
+2
-15
@@ -145,13 +145,6 @@ wxString EscapeString( const wxString& aSource, ESCAPE_CONTEXT aContext )
|
||||
wxString converted;
|
||||
std::vector<bool> braceStack; // true == formatting construct
|
||||
|
||||
auto hasFormattingPrefix =
|
||||
[&]()
|
||||
{
|
||||
static wxString prefixes = wxT( "~_^" );
|
||||
return !converted.IsEmpty() && prefixes.Find( converted.Last() ) >= 0;
|
||||
};
|
||||
|
||||
converted.reserve( aSource.length() );
|
||||
|
||||
for( wxUniChar c: aSource )
|
||||
@@ -167,9 +160,7 @@ wxString EscapeString( const wxString& aSource, ESCAPE_CONTEXT aContext )
|
||||
}
|
||||
else if( aContext == CTX_LIBID )
|
||||
{
|
||||
if( c == '{' && !hasFormattingPrefix() )
|
||||
converted += wxT( "{brace}" );
|
||||
else if( c == '/' )
|
||||
if( c == '/' )
|
||||
converted += wxT( "{slash}" );
|
||||
else if( c == '\\' )
|
||||
converted += wxT( "{backslash}" );
|
||||
@@ -202,9 +193,7 @@ wxString EscapeString( const wxString& aSource, ESCAPE_CONTEXT aContext )
|
||||
}
|
||||
else if( aContext == CTX_FILENAME )
|
||||
{
|
||||
if( c == '{' )
|
||||
converted += wxT( "{brace}" );
|
||||
else if( c == '/' )
|
||||
if( c == '/' )
|
||||
converted += wxT( "{slash}" );
|
||||
else if( c == '\\' )
|
||||
converted += wxT( "{backslash}" );
|
||||
@@ -229,8 +218,6 @@ wxString EscapeString( const wxString& aSource, ESCAPE_CONTEXT aContext )
|
||||
{
|
||||
if( c == ' ' )
|
||||
converted += wxT( "{space}" );
|
||||
else if( c == '{' )
|
||||
converted += wxT( "{brace}" );
|
||||
else
|
||||
converted += c;
|
||||
}
|
||||
|
||||
@@ -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 ) )
|
||||
|
||||
@@ -242,6 +242,13 @@ bool TOOL_EVENT::IsMoveTool() const
|
||||
}
|
||||
|
||||
|
||||
bool TOOL_EVENT::IsEditorTool() const
|
||||
{
|
||||
return ( m_commandStr
|
||||
&& m_commandStr.value().find( "InteractiveEdit" ) != GetCommandStr()->npos );
|
||||
}
|
||||
|
||||
|
||||
bool TOOL_EVENT::IsSimulator() const
|
||||
{
|
||||
return( m_commandStr.is_initialized()
|
||||
|
||||
@@ -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();
|
||||
|
||||
@@ -248,7 +248,7 @@ void WX_VIEW_CONTROLS::onMotion( wxMouseEvent& aEvent )
|
||||
{
|
||||
if( !justWarped )
|
||||
{
|
||||
m_parentPanel->WarpPointer( x + warpX, y + warpY );
|
||||
KIPLATFORM::UI::WarpPointer( m_parentPanel, x + warpX, y + warpY );
|
||||
m_dragStartPoint += VECTOR2D( warpX, warpY );
|
||||
justWarped = true;
|
||||
}
|
||||
@@ -288,7 +288,7 @@ void WX_VIEW_CONTROLS::onMotion( wxMouseEvent& aEvent )
|
||||
{
|
||||
if( !justWarped )
|
||||
{
|
||||
m_parentPanel->WarpPointer( x, y + warpY );
|
||||
KIPLATFORM::UI::WarpPointer( m_parentPanel, x, y + warpY );
|
||||
m_dragStartPoint += VECTOR2D( 0, warpY );
|
||||
justWarped = true;
|
||||
}
|
||||
@@ -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 )
|
||||
@@ -507,6 +507,18 @@ void WX_VIEW_CONTROLS::onTimer( wxTimerEvent& aEvent )
|
||||
return;
|
||||
}
|
||||
|
||||
#ifdef __WXMSW__
|
||||
// Hackfix: It's possible for the mouse to leave the canvas
|
||||
// without triggering any leave events on windows
|
||||
// Use a MSW only wx function
|
||||
if( !m_parentPanel->IsMouseInWindow() )
|
||||
{
|
||||
m_panTimer.Stop();
|
||||
m_state = IDLE;
|
||||
return;
|
||||
}
|
||||
#endif
|
||||
|
||||
if( !m_parentPanel->HasFocus() )
|
||||
break;
|
||||
|
||||
@@ -741,17 +753,17 @@ void WX_VIEW_CONTROLS::WarpCursor( const VECTOR2D& aPosition, bool aWorldCoordin
|
||||
if( aWarpView )
|
||||
{
|
||||
m_view->SetCenter( clampedPosition );
|
||||
m_parentPanel->WarpPointer( screenSize.x / 2, screenSize.y / 2 );
|
||||
KIPLATFORM::UI::WarpPointer( m_parentPanel, screenSize.x / 2, screenSize.y / 2 );
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
m_parentPanel->WarpPointer( screenPos.x, screenPos.y );
|
||||
KIPLATFORM::UI::WarpPointer( m_parentPanel, screenPos.x, screenPos.y );
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
m_parentPanel->WarpPointer( aPosition.x, aPosition.y );
|
||||
KIPLATFORM::UI::WarpPointer( m_parentPanel, aPosition.x, aPosition.y );
|
||||
}
|
||||
|
||||
refreshMouse();
|
||||
@@ -766,7 +778,7 @@ void WX_VIEW_CONTROLS::CenterOnCursor() const
|
||||
if( GetMousePosition( false ) != screenCenter )
|
||||
{
|
||||
m_view->SetCenter( GetCursorPosition() );
|
||||
m_parentPanel->WarpPointer( KiROUND( screenSize.x / 2 ), KiROUND( screenSize.y / 2 ) );
|
||||
KIPLATFORM::UI::WarpPointer( m_parentPanel, KiROUND( screenSize.x / 2 ), KiROUND( screenSize.y / 2 ) );
|
||||
}
|
||||
}
|
||||
|
||||
@@ -877,7 +889,7 @@ void WX_VIEW_CONTROLS::handleCursorCapture( int x, int y )
|
||||
}
|
||||
|
||||
if( warp )
|
||||
m_parentPanel->WarpPointer( x, y );
|
||||
KIPLATFORM::UI::WarpPointer( m_parentPanel, x, y );
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -237,7 +237,9 @@ bool PAGED_DIALOG::TransferDataToWindow()
|
||||
}
|
||||
}
|
||||
|
||||
m_treebook->SetSelection( (unsigned) std::max( 0, lastPageIndex ) );
|
||||
lastPageIndex = std::max( 0, lastPageIndex );
|
||||
m_treebook->ChangeSelection( lastPageIndex );
|
||||
UpdateResetButton( lastPageIndex );
|
||||
|
||||
return true;
|
||||
}
|
||||
@@ -360,18 +362,17 @@ void PAGED_DIALOG::OnUpdateUI( wxUpdateUIEvent& event )
|
||||
}
|
||||
|
||||
|
||||
void PAGED_DIALOG::OnPageChange( wxBookCtrlEvent& event )
|
||||
void PAGED_DIALOG::UpdateResetButton( int aPage )
|
||||
{
|
||||
size_t page = event.GetSelection();
|
||||
|
||||
// Enable the reset button only if the page is re-settable
|
||||
if( m_resetButton )
|
||||
{
|
||||
if( auto panel = dynamic_cast<RESETTABLE_PANEL*>( m_treebook->GetPage( page ) ) )
|
||||
if( auto panel = dynamic_cast<RESETTABLE_PANEL*>( m_treebook->GetPage( aPage ) ) )
|
||||
{
|
||||
m_resetButton->SetLabel( wxString::Format( _( "Reset %s to Defaults" ),
|
||||
m_treebook->GetPageText( page ) ) );
|
||||
m_resetButton->SetToolTip( panel->GetResetTooltip() );
|
||||
m_treebook->GetPageText( aPage ) ) );
|
||||
m_resetButton->SetToolTip( panel->GetHelpTextAtPoint( wxPoint( -INT_MAX, INT_MAX ),
|
||||
wxHelpEvent::Origin_Unknown ) );
|
||||
m_resetButton->Enable( true );
|
||||
}
|
||||
else
|
||||
@@ -382,20 +383,27 @@ void PAGED_DIALOG::OnPageChange( wxBookCtrlEvent& event )
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
// Work around an OSX bug where the wxGrid children don't get placed correctly until
|
||||
// the first resize event
|
||||
#ifdef __WXMAC__
|
||||
if( page + 1 <= m_macHack.size() && m_macHack[ page ] )
|
||||
|
||||
void PAGED_DIALOG::OnPageChange( wxBookCtrlEvent& event )
|
||||
{
|
||||
int page = event.GetSelection();
|
||||
|
||||
// Use the first sub-page when a tree level node is selected.
|
||||
if( m_treebook->GetCurrentPage()->GetChildren().IsEmpty() )
|
||||
{
|
||||
wxSize pageSize = m_treebook->GetPage( page )->GetSize();
|
||||
pageSize.x -= 5;
|
||||
pageSize.y += 2;
|
||||
unsigned next = page + 1;
|
||||
|
||||
m_treebook->GetPage( page )->SetSize( pageSize );
|
||||
m_macHack[ page ] = false;
|
||||
if( next < m_treebook->GetPageCount() )
|
||||
m_treebook->ChangeSelection( next );
|
||||
}
|
||||
#endif
|
||||
|
||||
UpdateResetButton( page );
|
||||
|
||||
wxSizeEvent evt( wxDefaultSize );
|
||||
|
||||
wxQueueEvent( m_treebook, evt.Clone() );
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -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 );
|
||||
|
||||
+62
-18
@@ -60,8 +60,9 @@
|
||||
#define CVPCB_MAINFRAME_NAME wxT( "CvpcbFrame" )
|
||||
|
||||
CVPCB_MAINFRAME::CVPCB_MAINFRAME( KIWAY* aKiway, wxWindow* aParent ) :
|
||||
KIWAY_PLAYER( aKiway, aParent, FRAME_CVPCB, _( "Assign Footprints" ), wxDefaultPosition,
|
||||
wxDefaultSize, KICAD_DEFAULT_DRAWFRAME_STYLE, CVPCB_MAINFRAME_NAME )
|
||||
KIWAY_PLAYER( aKiway, aParent, FRAME_CVPCB, _( "Assign Footprints" ), wxDefaultPosition,
|
||||
wxDefaultSize, KICAD_DEFAULT_DRAWFRAME_STYLE, CVPCB_MAINFRAME_NAME ),
|
||||
m_viewerPendingUpdate( false )
|
||||
{
|
||||
m_symbolsListBox = nullptr;
|
||||
m_footprintListBox = nullptr;
|
||||
@@ -276,9 +277,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 +329,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 +337,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,
|
||||
@@ -419,11 +421,20 @@ void CVPCB_MAINFRAME::OnEnterFilteringText( wxCommandEvent& aEvent )
|
||||
// If the option FOOTPRINTS_LISTBOX::FILTERING_BY_TEXT_PATTERN is set, update the list
|
||||
// of available footprints which match the filter
|
||||
|
||||
long pos = m_tcFilterString->GetInsertionPoint();
|
||||
wxListEvent l_event;
|
||||
OnSelectComponent( l_event );
|
||||
m_tcFilterString->SetFocus();
|
||||
m_tcFilterString->SetInsertionPoint( pos );
|
||||
COMPONENT* symbol = GetSelectedComponent();
|
||||
wxString libraryName = m_librariesListBox->GetSelectedLibrary();
|
||||
|
||||
m_footprintListBox->SetFootprints( *m_FootprintsList, libraryName, symbol,
|
||||
m_tcFilterString->GetValue(), m_filteringOptions );
|
||||
|
||||
if( symbol && symbol->GetFPID().IsValid() )
|
||||
m_footprintListBox->SetSelectedFootprint( symbol->GetFPID() );
|
||||
else if( m_footprintListBox->GetSelection() >= 0 )
|
||||
m_footprintListBox->SetSelection( m_footprintListBox->GetSelection(), false );
|
||||
|
||||
RefreshFootprintViewer();
|
||||
|
||||
DisplayStatus();
|
||||
}
|
||||
|
||||
|
||||
@@ -432,22 +443,58 @@ void CVPCB_MAINFRAME::OnSelectComponent( wxListEvent& event )
|
||||
if( m_skipComponentSelect )
|
||||
return;
|
||||
|
||||
wxString libraryName;
|
||||
COMPONENT* symbol = GetSelectedComponent();
|
||||
libraryName = m_librariesListBox->GetSelectedLibrary();
|
||||
wxString libraryName = m_librariesListBox->GetSelectedLibrary();
|
||||
|
||||
m_footprintListBox->SetFootprints( *m_FootprintsList, libraryName, symbol,
|
||||
m_tcFilterString->GetValue(), m_filteringOptions );
|
||||
|
||||
if( symbol && symbol->GetFPID().IsValid() )
|
||||
m_footprintListBox->SetSelectedFootprint( symbol->GetFPID() );
|
||||
else
|
||||
else if( m_footprintListBox->GetSelection() >= 0 )
|
||||
m_footprintListBox->SetSelection( m_footprintListBox->GetSelection(), false );
|
||||
|
||||
RefreshFootprintViewer();
|
||||
|
||||
refreshAfterSymbolSearch( symbol );
|
||||
}
|
||||
|
||||
|
||||
void CVPCB_MAINFRAME::RefreshFootprintViewer()
|
||||
{
|
||||
if( GetFootprintViewerFrame() && !m_viewerPendingUpdate )
|
||||
{
|
||||
Bind( wxEVT_IDLE, &CVPCB_MAINFRAME::updateFootprintViewerOnIdle, this );
|
||||
m_viewerPendingUpdate = true;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
void CVPCB_MAINFRAME::updateFootprintViewerOnIdle( wxIdleEvent& aEvent )
|
||||
{
|
||||
Unbind( wxEVT_IDLE, &CVPCB_MAINFRAME::updateFootprintViewerOnIdle, this );
|
||||
m_viewerPendingUpdate = false;
|
||||
|
||||
// On some plateforms (OSX) the focus is lost when the viewers (fp and 3D viewers)
|
||||
// are opened and refreshed when a new footprint is selected.
|
||||
// If the listbox has the focus before selecting a new footprint, it will be forced
|
||||
// after selection.
|
||||
bool footprintListHasFocus = m_footprintListBox->HasFocus();
|
||||
bool symbolListHasFocus = m_symbolsListBox->HasFocus();
|
||||
|
||||
// If the footprint view window is displayed, update the footprint.
|
||||
if( GetFootprintViewerFrame() )
|
||||
GetToolManager()->RunAction( CVPCB_ACTIONS::showFootprintViewer, true );
|
||||
|
||||
DisplayStatus();
|
||||
|
||||
if( footprintListHasFocus )
|
||||
m_footprintListBox->SetFocus();
|
||||
else if( symbolListHasFocus )
|
||||
m_symbolsListBox->SetFocus();
|
||||
}
|
||||
|
||||
|
||||
void CVPCB_MAINFRAME::LoadSettings( APP_SETTINGS_BASE* aCfg )
|
||||
{
|
||||
EDA_BASE_FRAME::LoadSettings( aCfg );
|
||||
@@ -651,9 +698,6 @@ void CVPCB_MAINFRAME::refreshAfterSymbolSearch( COMPONENT* aSymbol )
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if( GetFootprintViewerFrame() )
|
||||
m_toolManager->RunAction( CVPCB_ACTIONS::showFootprintViewer, true );
|
||||
}
|
||||
|
||||
SendMessageToEESCHEMA();
|
||||
|
||||
+11
-3
@@ -330,6 +330,8 @@ public:
|
||||
*/
|
||||
wxString GetSelectedFootprint();
|
||||
|
||||
void RefreshFootprintViewer();
|
||||
|
||||
void SetStatusText( const wxString& aText, int aNumber = 0 ) override;
|
||||
|
||||
protected:
|
||||
@@ -351,6 +353,10 @@ private:
|
||||
*/
|
||||
void setupEventHandlers();
|
||||
|
||||
void onTextFilterChanged( wxCommandEvent& event );
|
||||
|
||||
void updateFootprintViewerOnIdle( wxIdleEvent& aEvent );
|
||||
|
||||
/**
|
||||
* Read the .equ files and populate the list of equivalents.
|
||||
*
|
||||
@@ -398,9 +404,11 @@ private:
|
||||
ACTION_MENU* m_footprintContextMenu;
|
||||
ACTION_MENU* m_symbolsContextMenu;
|
||||
|
||||
// Undo/Redo item lists
|
||||
CVPCB_UNDO_REDO_LIST m_undoList;
|
||||
CVPCB_UNDO_REDO_LIST m_redoList;
|
||||
CVPCB_UNDO_REDO_LIST m_undoList;
|
||||
CVPCB_UNDO_REDO_LIST m_redoList;
|
||||
|
||||
bool m_viewerPendingUpdate;
|
||||
|
||||
};
|
||||
|
||||
#endif //#ifndef _CVPCB_MAINFRAME_H_
|
||||
|
||||
@@ -62,13 +62,15 @@ BEGIN_EVENT_TABLE( DISPLAY_FOOTPRINTS_FRAME, PCB_BASE_FRAME )
|
||||
EVT_CLOSE( DISPLAY_FOOTPRINTS_FRAME::OnCloseWindow )
|
||||
EVT_CHOICE( ID_ON_ZOOM_SELECT, DISPLAY_FOOTPRINTS_FRAME::OnSelectZoom )
|
||||
EVT_CHOICE( ID_ON_GRID_SELECT, DISPLAY_FOOTPRINTS_FRAME::OnSelectGrid )
|
||||
EVT_MENU( ID_GRID_SETTINGS, DISPLAY_FOOTPRINTS_FRAME::OnGridSettings )
|
||||
END_EVENT_TABLE()
|
||||
|
||||
|
||||
DISPLAY_FOOTPRINTS_FRAME::DISPLAY_FOOTPRINTS_FRAME( KIWAY* aKiway, wxWindow* aParent ) :
|
||||
PCB_BASE_FRAME( aKiway, aParent, FRAME_CVPCB_DISPLAY, _( "Footprint Viewer" ),
|
||||
wxDefaultPosition, wxDefaultSize,
|
||||
KICAD_DEFAULT_DRAWFRAME_STYLE, FOOTPRINTVIEWER_FRAME_NAME )
|
||||
PCB_BASE_FRAME( aKiway, aParent, FRAME_CVPCB_DISPLAY, _( "Footprint Viewer" ),
|
||||
wxDefaultPosition, wxDefaultSize,
|
||||
KICAD_DEFAULT_DRAWFRAME_STYLE, FOOTPRINTVIEWER_FRAME_NAME ),
|
||||
m_currentComp( nullptr )
|
||||
{
|
||||
// Give an icon
|
||||
wxIcon icon;
|
||||
@@ -451,21 +453,20 @@ FOOTPRINT* DISPLAY_FOOTPRINTS_FRAME::GetFootprint( const wxString& aFootprintNam
|
||||
void DISPLAY_FOOTPRINTS_FRAME::InitDisplay()
|
||||
{
|
||||
CVPCB_MAINFRAME* parentframe = (CVPCB_MAINFRAME *) GetParent();
|
||||
COMPONENT* comp = parentframe->GetSelectedComponent();
|
||||
FOOTPRINT* footprint = nullptr;
|
||||
const FOOTPRINT_INFO* fpInfo = nullptr;
|
||||
|
||||
GetBoard()->DeleteAllFootprints();
|
||||
GetCanvas()->GetView()->Clear();
|
||||
|
||||
wxString footprintName = parentframe->GetSelectedFootprint();
|
||||
|
||||
if( footprintName.IsEmpty() )
|
||||
{
|
||||
COMPONENT* comp = parentframe->GetSelectedComponent();
|
||||
if( footprintName.IsEmpty() && comp )
|
||||
footprintName = comp->GetFPID().Format();
|
||||
|
||||
if( comp )
|
||||
footprintName = comp->GetFPID().GetUniStringLibId();
|
||||
}
|
||||
if( m_currentFootprint == footprintName && m_currentComp == comp )
|
||||
return;
|
||||
|
||||
GetBoard()->DeleteAllFootprints();
|
||||
GetCanvas()->GetView()->Clear();
|
||||
|
||||
INFOBAR_REPORTER infoReporter( m_infoBar );
|
||||
m_infoBar->Dismiss();
|
||||
@@ -480,7 +481,11 @@ void DISPLAY_FOOTPRINTS_FRAME::InitDisplay()
|
||||
}
|
||||
|
||||
if( footprint )
|
||||
{
|
||||
GetBoard()->Add( footprint );
|
||||
m_currentFootprint = footprintName;
|
||||
m_currentComp = comp;
|
||||
}
|
||||
|
||||
if( fpInfo )
|
||||
SetStatusText( wxString::Format( _( "Lib: %s" ), fpInfo->GetLibNickname() ), 0 );
|
||||
|
||||
@@ -114,6 +114,10 @@ public:
|
||||
|
||||
protected:
|
||||
void setupUIConditions() override;
|
||||
|
||||
private:
|
||||
wxString m_currentFootprint;
|
||||
COMPONENT* m_currentComp;
|
||||
};
|
||||
|
||||
#endif // DISPLAY_FOOTPRINTS_FRAME_H
|
||||
|
||||
@@ -99,15 +99,15 @@ wxString FOOTPRINTS_LISTBOX::OnGetItemText( long item, long column ) const
|
||||
}
|
||||
|
||||
|
||||
void FOOTPRINTS_LISTBOX::SetSelection( int index, bool State )
|
||||
void FOOTPRINTS_LISTBOX::SetSelection( int aIndex, bool aState )
|
||||
{
|
||||
if( index >= GetCount() )
|
||||
index = GetCount() - 1;
|
||||
if( aIndex >= GetCount() )
|
||||
aIndex = GetCount() - 1;
|
||||
|
||||
if( (index >= 0) && (GetCount() > 0) )
|
||||
if(( aIndex >= 0) && ( GetCount() > 0) )
|
||||
{
|
||||
Select( index, State );
|
||||
EnsureVisible( index );
|
||||
Select( aIndex, aState );
|
||||
EnsureVisible( aIndex );
|
||||
Refresh();
|
||||
}
|
||||
}
|
||||
@@ -156,7 +156,7 @@ void FOOTPRINTS_LISTBOX::SetFootprints( FOOTPRINT_LIST& aList, const wxString& a
|
||||
if( GetSelection() >= 0 && GetSelection() < (int)m_footprintList.GetCount() )
|
||||
oldSelection = m_footprintList[ GetSelection() ];
|
||||
|
||||
for( auto& i: filter )
|
||||
for( const FOOTPRINT_INFO& i : filter )
|
||||
{
|
||||
msg.Printf( wxT( "%3d %s:%s" ),
|
||||
int( newList.GetCount() + 1 ),
|
||||
@@ -199,23 +199,7 @@ END_EVENT_TABLE()
|
||||
|
||||
void FOOTPRINTS_LISTBOX::OnLeftClick( wxListEvent& event )
|
||||
{
|
||||
if( m_footprintList.IsEmpty() )
|
||||
return;
|
||||
|
||||
// On some plateforms (OSX) the focus is lost when the viewers (fp and 3D viewers)
|
||||
// are opened and refreshed when a new footprint is selected.
|
||||
// If the listbox has the focus before selecting a new footprint, it will be forced
|
||||
// after selection.
|
||||
bool hasFocus = HasFocus();
|
||||
|
||||
// If the footprint view window is displayed, update the footprint.
|
||||
if( GetParent()->GetFootprintViewerFrame() )
|
||||
GetParent()->GetToolManager()->RunAction( CVPCB_ACTIONS::showFootprintViewer, true );
|
||||
|
||||
GetParent()->DisplayStatus();
|
||||
|
||||
if( hasFocus )
|
||||
SetFocus();
|
||||
GetParent()->RefreshFootprintViewer();
|
||||
}
|
||||
|
||||
|
||||
|
||||
+1
-1
@@ -100,7 +100,7 @@ public:
|
||||
~FOOTPRINTS_LISTBOX();
|
||||
|
||||
int GetCount();
|
||||
void SetSelection( int index, bool State = true );
|
||||
void SetSelection( int aIndex, bool aState = true );
|
||||
void SetSelectedFootprint( const LIB_ID& aFPID );
|
||||
void SetString( unsigned linecount, const wxString& text );
|
||||
void AppendLine( const wxString& text );
|
||||
|
||||
+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
|
||||
|
||||
@@ -161,12 +161,15 @@ int CVPCB_CONTROL::ShowFootprintViewer( const TOOL_EVENT& aEvent )
|
||||
|
||||
if( !fpframe )
|
||||
{
|
||||
fpframe = (DISPLAY_FOOTPRINTS_FRAME*) m_frame->Kiway().Player(
|
||||
FRAME_CVPCB_DISPLAY, true, m_frame );
|
||||
fpframe = (DISPLAY_FOOTPRINTS_FRAME*) m_frame->Kiway().Player( FRAME_CVPCB_DISPLAY, true,
|
||||
m_frame );
|
||||
fpframe->Show( true );
|
||||
}
|
||||
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
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -1,7 +1,7 @@
|
||||
/*
|
||||
* This program source code file is part of KiCad, a free EDA CAD application.
|
||||
*
|
||||
* 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
|
||||
@@ -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;
|
||||
@@ -185,10 +182,6 @@ void SCH_EDIT_FRAME::AnnotateSymbols( ANNOTATE_SCOPE_T aAnnotateScope,
|
||||
// Store previous annotations for building info messages
|
||||
mapExistingAnnotation( previousAnnotation );
|
||||
|
||||
// If it is an annotation for all the symbols, reset previous annotation.
|
||||
if( aResetAnnotation )
|
||||
DeleteAnnotation( aAnnotateScope, &appendUndo );
|
||||
|
||||
// Set sheet number and number of sheets.
|
||||
SetSheetNumberAndCount();
|
||||
|
||||
@@ -208,6 +201,12 @@ void SCH_EDIT_FRAME::AnnotateSymbols( ANNOTATE_SCOPE_T aAnnotateScope,
|
||||
break;
|
||||
}
|
||||
|
||||
// Remove annotation only updates the "new" flag to indicate to the algorithm
|
||||
// that these references must be reannotated, but keeps the original reference
|
||||
// so that we can reannotate multi-unit symbols together.
|
||||
if( aResetAnnotation )
|
||||
references.RemoveAnnotation();
|
||||
|
||||
// Build additional list of references to be used during reannotation
|
||||
// to avoid duplicate designators (no additional references when annotating
|
||||
// the full schematic)
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
*
|
||||
* Copyright (C) 1992-2018 jean-pierre Charras <jp.charras at wanadoo.fr>
|
||||
* Copyright (C) 1992-2011 Wayne Stambaugh <stambaughw@gmail.com>
|
||||
* Copyright (C) 1992-2021 KiCad Developers, see AUTHORS.txt for contributors.
|
||||
* Copyright (C) 1992-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
|
||||
@@ -29,6 +29,7 @@
|
||||
*/
|
||||
|
||||
#include <sch_reference_list.h>
|
||||
#include <core/kicad_algo.h>
|
||||
|
||||
#include <wx/regex.h>
|
||||
#include <algorithm>
|
||||
@@ -48,7 +49,7 @@ void SCH_REFERENCE_LIST::RemoveItem( unsigned int aIndex )
|
||||
}
|
||||
|
||||
|
||||
bool SCH_REFERENCE_LIST::Contains( const SCH_REFERENCE& aItem )
|
||||
bool SCH_REFERENCE_LIST::Contains( const SCH_REFERENCE& aItem ) const
|
||||
{
|
||||
for( unsigned ii = 0; ii < GetCount(); ii++ )
|
||||
{
|
||||
@@ -154,14 +155,14 @@ bool SCH_REFERENCE_LIST::sortByTimeStamp( const SCH_REFERENCE& item1,
|
||||
}
|
||||
|
||||
|
||||
int SCH_REFERENCE_LIST::FindUnit( size_t aIndex, int aUnit ) const
|
||||
int SCH_REFERENCE_LIST::FindUnit( size_t aIndex, int aUnit, bool aIncludeNew ) const
|
||||
{
|
||||
int NumRef = flatList[aIndex].m_numRef;
|
||||
|
||||
for( size_t ii = 0; ii < flatList.size(); ii++ )
|
||||
{
|
||||
if( ( aIndex == ii )
|
||||
|| ( flatList[ii].m_isNew )
|
||||
|| ( flatList[ii].m_isNew && !aIncludeNew )
|
||||
|| ( flatList[ii].m_numRef != NumRef )
|
||||
|| ( flatList[aIndex].CompareRef( flatList[ii] ) != 0 ) )
|
||||
continue;
|
||||
@@ -210,34 +211,98 @@ void SCH_REFERENCE_LIST::GetRefsInUse( int aIndex, std::vector< int >& aIdList,
|
||||
aIdList.push_back( ref.m_numRef );
|
||||
}
|
||||
|
||||
sort( aIdList.begin(), aIdList.end() );
|
||||
std::sort( aIdList.begin(), aIdList.end() );
|
||||
|
||||
// Ensure each reference number appears only once. If there are symbols with
|
||||
// multiple parts per package the same number will be stored for each part.
|
||||
std::vector< int >::iterator it = unique( aIdList.begin(), aIdList.end() );
|
||||
|
||||
// Using the C++ unique algorithm only moves the duplicate entries to the end of
|
||||
// of the array. This removes the duplicate entries from the array.
|
||||
aIdList.resize( it - aIdList.begin() );
|
||||
alg::remove_duplicates( aIdList );
|
||||
}
|
||||
|
||||
|
||||
int SCH_REFERENCE_LIST::GetLastReference( int aIndex, int aMinValue ) const
|
||||
std::vector<int> SCH_REFERENCE_LIST::GetUnitsMatchingRef( const SCH_REFERENCE& aRef ) const
|
||||
{
|
||||
int lastNumber = aMinValue;
|
||||
std::vector<int> unitsList;
|
||||
|
||||
// Always add this reference to the list
|
||||
unitsList.push_back( aRef.m_unit );
|
||||
|
||||
for( SCH_REFERENCE ref : flatList )
|
||||
{
|
||||
if( ref.CompareValue( aRef ) != 0 )
|
||||
continue;
|
||||
|
||||
if( ref.CompareLibName( aRef ) != 0 )
|
||||
continue;
|
||||
|
||||
// Split if needed before comparing ref and number
|
||||
if( ref.IsSplitNeeded() )
|
||||
ref.Split();
|
||||
|
||||
if( ref.CompareRef( aRef ) != 0 )
|
||||
continue;
|
||||
|
||||
if( ref.m_numRef != aRef.m_numRef )
|
||||
continue;
|
||||
|
||||
unitsList.push_back( ref.m_unit );
|
||||
}
|
||||
|
||||
std::sort( unitsList.begin(), unitsList.end() );
|
||||
|
||||
// Ensure each reference number appears only once. If there are symbols with
|
||||
// multiple parts per package the same number will be stored for each part.
|
||||
alg::remove_duplicates( unitsList );
|
||||
|
||||
return unitsList;
|
||||
}
|
||||
|
||||
|
||||
int SCH_REFERENCE_LIST::FindFirstUnusedReference( const SCH_REFERENCE& aRef, int aMinValue,
|
||||
const std::vector<int>& aRequiredUnits ) const
|
||||
{
|
||||
// Create a map of references indexed by reference number, only including those with the same
|
||||
// reference prefix as aRef
|
||||
std::map<int, std::vector<SCH_REFERENCE>> refNumberMap;
|
||||
|
||||
for( const SCH_REFERENCE& ref : flatList )
|
||||
{
|
||||
// search only for the current reference prefix:
|
||||
if( flatList[aIndex].CompareRef( ref ) != 0 )
|
||||
if( ref.CompareRef( aRef ) != 0 )
|
||||
continue;
|
||||
|
||||
// update max value for the current reference prefix
|
||||
if( lastNumber < ref.m_numRef )
|
||||
lastNumber = ref.m_numRef;
|
||||
if( ref.m_isNew )
|
||||
continue; // It will be reannotated
|
||||
|
||||
refNumberMap[ref.m_numRef].push_back( ref );
|
||||
}
|
||||
|
||||
return lastNumber;
|
||||
// Start at the given minimum value
|
||||
int minFreeNumber = aMinValue;
|
||||
|
||||
for( ; refNumberMap[minFreeNumber].size() > 0; ++minFreeNumber )
|
||||
{
|
||||
auto isNumberInUse = [&]() -> bool
|
||||
{
|
||||
for( const int& unit : aRequiredUnits )
|
||||
{
|
||||
for( const SCH_REFERENCE& ref : refNumberMap[minFreeNumber] )
|
||||
{
|
||||
if( ref.CompareLibName( aRef ) || ref.CompareValue( aRef )
|
||||
|| ref.GetUnit() == unit )
|
||||
{
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return false;
|
||||
};
|
||||
|
||||
if( !isNumberInUse() )
|
||||
return minFreeNumber;
|
||||
}
|
||||
|
||||
return minFreeNumber;
|
||||
}
|
||||
|
||||
|
||||
@@ -261,7 +326,7 @@ std::vector<SYMBOL_INSTANCE_REFERENCE> SCH_REFERENCE_LIST::GetSymbolInstances()
|
||||
}
|
||||
|
||||
|
||||
int SCH_REFERENCE_LIST::CreateFirstFreeRefId( std::vector<int>& aIdList, int aFirstValue )
|
||||
int SCH_REFERENCE_LIST::createFirstFreeRefId( std::vector<int>& aIdList, int aFirstValue )
|
||||
{
|
||||
int expectedId = aFirstValue;
|
||||
|
||||
@@ -327,9 +392,9 @@ void SCH_REFERENCE_LIST::ReannotateDuplicates( const SCH_REFERENCE_LIST& aAdditi
|
||||
if( refstr[refstr.Len() - 1] == '?' )
|
||||
continue;
|
||||
|
||||
lockedSymbols[refstr].AddItem( ref );
|
||||
|
||||
ref.m_isNew = true; // We want to reannotate all references
|
||||
|
||||
lockedSymbols[refstr].AddItem( ref );
|
||||
}
|
||||
|
||||
Annotate( false, 0, 0, lockedSymbols, aAdditionalReferences, true );
|
||||
@@ -390,10 +455,6 @@ void SCH_REFERENCE_LIST::Annotate( bool aUseSheetNum, int aSheetIntervalId, int
|
||||
else
|
||||
minRefId = aStartNumber + 1;
|
||||
|
||||
// This is the list of all Id already in use for a given reference prefix.
|
||||
// Will be refilled for each new reference prefix.
|
||||
std::vector<int>idList;
|
||||
GetRefsInUse( first, idList, minRefId );
|
||||
|
||||
for( unsigned ii = 0; ii < flatList.size(); ii++ )
|
||||
{
|
||||
@@ -435,23 +496,20 @@ void SCH_REFERENCE_LIST::Annotate( bool aUseSheetNum, int aSheetIntervalId, int
|
||||
minRefId = ref_unit.m_sheetNum * aSheetIntervalId + 1;
|
||||
else
|
||||
minRefId = aStartNumber + 1;
|
||||
|
||||
GetRefsInUse( first, idList, minRefId );
|
||||
}
|
||||
|
||||
// Find references greater than current reference (unless not annotated)
|
||||
if( aStartAtCurrent && ref_unit.m_numRef > 0 )
|
||||
{
|
||||
minRefId = ref_unit.m_numRef;
|
||||
GetRefsInUse( first, idList, minRefId );
|
||||
}
|
||||
|
||||
// Annotation of one part per package symbols (trivial case).
|
||||
if( ref_unit.GetLibPart()->GetUnitCount() <= 1 )
|
||||
{
|
||||
if( ref_unit.m_isNew )
|
||||
{
|
||||
LastReferenceNumber = CreateFirstFreeRefId( idList, minRefId );
|
||||
std::vector<int> idList;
|
||||
GetRefsInUse( first, idList, minRefId );
|
||||
LastReferenceNumber = createFirstFreeRefId( idList, minRefId );
|
||||
ref_unit.m_numRef = LastReferenceNumber;
|
||||
}
|
||||
|
||||
@@ -463,45 +521,46 @@ void SCH_REFERENCE_LIST::Annotate( bool aUseSheetNum, int aSheetIntervalId, int
|
||||
// Annotation of multi-unit parts ( n units per part ) (complex case)
|
||||
NumberOfUnits = ref_unit.GetLibPart()->GetUnitCount();
|
||||
|
||||
if( ref_unit.m_isNew )
|
||||
{
|
||||
LastReferenceNumber = CreateFirstFreeRefId( idList, minRefId );
|
||||
ref_unit.m_numRef = LastReferenceNumber;
|
||||
|
||||
ref_unit.m_flag = 1;
|
||||
}
|
||||
|
||||
// If this symbol is in aLockedUnitMap, copy the annotation to all
|
||||
// symbols that are not it
|
||||
if( lockedList != nullptr )
|
||||
{
|
||||
unsigned n_refs = lockedList->GetCount();
|
||||
std::vector<int> units = lockedList->GetUnitsMatchingRef( ref_unit );
|
||||
|
||||
for( unsigned thisRefI = 0; thisRefI < n_refs; ++thisRefI )
|
||||
if( ref_unit.m_isNew )
|
||||
{
|
||||
SCH_REFERENCE &thisRef = (*lockedList)[thisRefI];
|
||||
LastReferenceNumber = FindFirstUnusedReference( ref_unit, minRefId, units );
|
||||
ref_unit.m_numRef = LastReferenceNumber;
|
||||
ref_unit.m_isNew = false;
|
||||
ref_unit.m_flag = 1;
|
||||
}
|
||||
|
||||
if( thisRef.IsSameInstance( ref_unit ) )
|
||||
for( unsigned lockedRefI = 0; lockedRefI < n_refs; ++lockedRefI )
|
||||
{
|
||||
SCH_REFERENCE& lockedRef = ( *lockedList )[lockedRefI];
|
||||
|
||||
if( lockedRef.IsSameInstance( ref_unit ) )
|
||||
{
|
||||
// This is the symbol we're currently annotating. Hold the unit!
|
||||
ref_unit.m_unit = thisRef.m_unit;
|
||||
ref_unit.m_unit = lockedRef.m_unit;
|
||||
// lock this new full reference
|
||||
inUseRefs.insert( buildFullReference( ref_unit ) );
|
||||
}
|
||||
|
||||
if( thisRef.CompareValue( ref_unit ) != 0 )
|
||||
if( lockedRef.CompareValue( ref_unit ) != 0 )
|
||||
continue;
|
||||
|
||||
if( thisRef.CompareLibName( ref_unit ) != 0 )
|
||||
if( lockedRef.CompareLibName( ref_unit ) != 0 )
|
||||
continue;
|
||||
|
||||
// Find the matching symbol
|
||||
for( unsigned jj = ii + 1; jj < flatList.size(); jj++ )
|
||||
{
|
||||
if( ! thisRef.IsSameInstance( flatList[jj] ) )
|
||||
if( !lockedRef.IsSameInstance( flatList[jj] ) )
|
||||
continue;
|
||||
|
||||
wxString ref_candidate = buildFullReference( ref_unit, thisRef.m_unit );
|
||||
wxString ref_candidate = buildFullReference( ref_unit, lockedRef.m_unit );
|
||||
|
||||
// propagate the new reference and unit selection to the "old" symbol,
|
||||
// if this new full reference is not already used (can happens when initial
|
||||
@@ -518,56 +577,16 @@ void SCH_REFERENCE_LIST::Annotate( bool aUseSheetNum, int aSheetIntervalId, int
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
else if( ref_unit.m_isNew )
|
||||
{
|
||||
/* search for others units of this symbol.
|
||||
* we search for others parts that have the same value and the same
|
||||
* reference prefix (ref without ref number)
|
||||
*/
|
||||
for( Unit = 1; Unit <= NumberOfUnits; Unit++ )
|
||||
{
|
||||
if( ref_unit.m_unit == Unit )
|
||||
continue;
|
||||
|
||||
int found = FindUnit( ii, Unit );
|
||||
|
||||
if( found >= 0 )
|
||||
continue; // this unit exists for this reference (unit already annotated)
|
||||
|
||||
// Search a symbol to annotate ( same prefix, same value, not annotated)
|
||||
for( unsigned jj = ii + 1; jj < flatList.size(); jj++ )
|
||||
{
|
||||
auto& cmp_unit = flatList[jj];
|
||||
|
||||
if( cmp_unit.m_flag ) // already tested
|
||||
continue;
|
||||
|
||||
if( cmp_unit.CompareRef( ref_unit ) != 0 )
|
||||
continue;
|
||||
|
||||
if( cmp_unit.CompareValue( ref_unit ) != 0 )
|
||||
continue;
|
||||
|
||||
if( cmp_unit.CompareLibName( ref_unit ) != 0 )
|
||||
continue;
|
||||
|
||||
if( aUseSheetNum &&
|
||||
cmp_unit.GetSheetPath().Cmp( ref_unit.GetSheetPath() ) != 0 )
|
||||
continue;
|
||||
|
||||
if( !cmp_unit.m_isNew )
|
||||
continue;
|
||||
|
||||
// Symbol without reference number found, annotate it if possible.
|
||||
if( cmp_unit.m_unit == Unit )
|
||||
{
|
||||
cmp_unit.m_numRef = ref_unit.m_numRef;
|
||||
cmp_unit.m_flag = 1;
|
||||
cmp_unit.m_isNew = false;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
// Reference belonging to multi-unit symbol that has not yet been annotated. We don't
|
||||
// know what group this might belong to, so just find the first unused reference for
|
||||
// this specific unit. The other units will be annotated in the following passes.
|
||||
std::vector<int> units = { ref_unit.GetUnit() };
|
||||
LastReferenceNumber = FindFirstUnusedReference( ref_unit, minRefId, units );
|
||||
ref_unit.m_numRef = LastReferenceNumber;
|
||||
ref_unit.m_isNew = false;
|
||||
ref_unit.m_flag = 1;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -824,6 +843,16 @@ void SCH_REFERENCE::Split()
|
||||
}
|
||||
|
||||
|
||||
bool SCH_REFERENCE::IsSplitNeeded()
|
||||
{
|
||||
std::string refText = GetRefStr();
|
||||
|
||||
int ll = refText.length() - 1;
|
||||
|
||||
return ( refText[ll] == '?' ) || isdigit( refText[ll] );
|
||||
}
|
||||
|
||||
|
||||
wxString SCH_REFERENCE_LIST::Shorthand( std::vector<SCH_REFERENCE> aList )
|
||||
{
|
||||
wxString retVal;
|
||||
|
||||
@@ -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() )
|
||||
{
|
||||
|
||||
@@ -1,145 +0,0 @@
|
||||
// Do not edit this file, it is autogenerated by CMake from the .md file
|
||||
_HKI( "# 1 - Full documentation\n"
|
||||
"\n"
|
||||
"The Eeschema documentation (*eeschema.html*) describes this intermediate netlist and gives examples(chapter ***creating customized netlists and bom files***).\n"
|
||||
"\n"
|
||||
"# 2 - The intermediate Netlist File\n"
|
||||
"\n"
|
||||
"BOM files (and netlist files) can be created from an *Intermediate netlist file* created by Eeschema.\n"
|
||||
"\n"
|
||||
"This file uses XML syntax and is called the intermediate netlist. The intermediate netlist includes a large amount of data about your board and because of this, it can be used with post-processing to create a BOM or other reports.\n"
|
||||
"\n"
|
||||
"Depending on the output (BOM or netlist), different subsets of the complete Intermediate Netlist file will be used in the post-processing.\n"
|
||||
"\n"
|
||||
"# 3 - Conversion to a new format\n"
|
||||
"\n"
|
||||
"By applying a post-processing filter to the Intermediate netlist file you can generate foreign netlist files as well as BOM files. Because this conversion is a text to text transformation, this post-processing filter can be written using *Python*, *XSLT*, or any other tool capable of taking XML as input.\n"
|
||||
"\n"
|
||||
"XSLT itself is a XML language suitable for XML transformations. There is a free program called `xsltproc` that you can download and install. The `xsltproc` program can be used to read the Intermediate XML netlist input file, apply a style-sheet to transform the input, and save the results in an output file. Use of `xsltproc` requires a style-sheet file using XSLT conventions. The full conversion process is handled by Eeschema, after it is configured once to run `xsltproc` in a specific way.\n"
|
||||
"\n"
|
||||
"A Python script is somewhat more easy to create.\n"
|
||||
"\n"
|
||||
"# 4 - Initialization of the dialog window\n"
|
||||
"\n"
|
||||
"You should add a new plugin (a script) in the plugin list by clicking on the Add Plugin button.\n"
|
||||
"\n"
|
||||
"## 4.1 - Plugin Configuration Parameters\n"
|
||||
"\n"
|
||||
"The Eeschema plug-in configuration dialog requires the following information:\n"
|
||||
"\n"
|
||||
" * The title: for instance, the name of the netlist format.\n"
|
||||
" * The command line to launch the converter (usually a script).\n"
|
||||
"\n"
|
||||
"***Note (Windows only):***\n"
|
||||
"*By default, the command line runs with hidden console window and output is redirected to \"Plugin info\" field. To show the window of the running command, set the checkbox \"Show console window\".*\n"
|
||||
"\n"
|
||||
"Once you click on the generate button the following will happen:\n"
|
||||
"\n"
|
||||
"1. Eeschema creates an intermediate netlist file \\*.xml, for instance `test.xml`.\n"
|
||||
"2. Eeschema runs the script from the command line to create the final output file.\n"
|
||||
"\n"
|
||||
"## 4.2 - Generate netlist files with the command line\n"
|
||||
"\n"
|
||||
"Assuming we are using the program `xsltproc.exe` to apply the sheet style to the intermediate file, `xsltproc.exe` is executed with the following command.\n"
|
||||
"\n"
|
||||
"```\n"
|
||||
"xsltproc.exe -o <output filename> <style-sheet filename> <input XML file to convert>\n"
|
||||
"```\n"
|
||||
"\n"
|
||||
"On Windows the command line is the following.\n"
|
||||
"\n"
|
||||
"```\n"
|
||||
"f:/kicad/bin/xsltproc.exe -o \"%O\" f:/kicad/bin/plugins/myconverter.xsl \"%I\"\n"
|
||||
"```\n"
|
||||
"\n"
|
||||
"On Linux the command becomes as following.\n"
|
||||
"\n"
|
||||
"```\n"
|
||||
"xsltproc -o \"%O\" /usr/local/kicad/bin/plugins/myconverter .xsl \"%I\"\n"
|
||||
"```\n"
|
||||
"where `myconverter.xsl` is the style-sheet that you are applying.\n"
|
||||
"\n"
|
||||
"Do not forget the double quotes around the file names, this allows them to have spaces after the substitution by Eeschema.\n"
|
||||
"\n"
|
||||
"If a Python script is used, the command line is something like (depending on the Python script):\n"
|
||||
"\n"
|
||||
"```\n"
|
||||
"python f:/kicad/bin/plugins/bom-in-python/myconverter.py \"%I\" \"%O\"\n"
|
||||
"```\n"
|
||||
"\n"
|
||||
"or\n"
|
||||
"\n"
|
||||
"```\n"
|
||||
"python /usr/local/kicad/bin/plugins/bom-in-python/myconverter .xsl \"%I\" \"%O\"\n"
|
||||
"```\n"
|
||||
"\n"
|
||||
"The command line format accepts parameters for filenames. The supported formatting parameters are:\n"
|
||||
"\n"
|
||||
" * `%B`: base filename of selected output file, minus path and extension.\n"
|
||||
" * `%P`: project directory, without name and without trailing '/'.\n"
|
||||
" * `%I`: complete filename and path of the temporary input file\n"
|
||||
"(the intermediate net file).\n"
|
||||
" * `%O`: complete filename and path (but without extension) of the user\n"
|
||||
"chosen output file.\n"
|
||||
"\n"
|
||||
"`%I` will be replaced by the actual intermediate file name (usually the full root sheet filename with extension \".xml\").\n"
|
||||
"`%O` will be replaced by the actual output file name (the full root sheet filename minus extension).\n"
|
||||
"`%B` will be replaced by the actual output short file name (the short root sheet filename minus extension).\n"
|
||||
"`%P` will be replaced by the actual current project path.\n"
|
||||
"\n"
|
||||
"## 4.3 - Command line format:\n"
|
||||
"\n"
|
||||
"### 4.3.1 - Remark:\n"
|
||||
"\n"
|
||||
"Most of time, the created file must have an extension, depending on its type.\n"
|
||||
"Therefore you have to add to the option ***%O*** the right file extension.\n"
|
||||
"\n"
|
||||
"For instance:\n"
|
||||
"\n"
|
||||
" * **%O.csv** to create a .csv file (comma separated value file).\n"
|
||||
" * **%O.htm** to create a .html file.\n"
|
||||
" * **%O.bom** to create a .bom file.\n"
|
||||
"\n"
|
||||
"### 4.3.2 Example for xsltproc:\n"
|
||||
"\n"
|
||||
"The command line format for xsltproc is the following:\n"
|
||||
"\n"
|
||||
"```\n"
|
||||
"<path of xsltproc> xsltproc <xsltproc parameters>\n"
|
||||
"```\n"
|
||||
"\n"
|
||||
"On Windows:\n"
|
||||
"```\n"
|
||||
"f:/kicad/bin/xsltproc.exe -o \"%O.bom\" f:/kicad/bin/plugins/netlist_form_pads-pcb.xsl \"%I\"\n"
|
||||
"```\n"
|
||||
"\n"
|
||||
"On Linux:\n"
|
||||
"```\n"
|
||||
"xsltproc -o \"%O.bom\" /usr/local/kicad/bin/plugins/netlist_form_pads-pcb.xsl \"%I\"\n"
|
||||
"```\n"
|
||||
"\n"
|
||||
"The above examples assume `xsltproc` is installed on your PC under Windows and xsl files located in `<path_to_kicad>/kicad/bin/plugins/`.\n"
|
||||
"\n"
|
||||
"\n"
|
||||
"### 4.3.3 Example for Python scripts:\n"
|
||||
"\n"
|
||||
"Assuming python is installed on your PC, and python scripts are located in\n"
|
||||
"\n"
|
||||
" `<path_to_kicad>/kicad/bin/plugins/bom-in-python/`,\n"
|
||||
"\n"
|
||||
"the command line format for python is something like:\n"
|
||||
"\n"
|
||||
"```\n"
|
||||
"python <script file name> <input filename> <output filename>\n"
|
||||
"```\n"
|
||||
"\n"
|
||||
"On Windows:\n"
|
||||
"```\n"
|
||||
"python.exe f:/kicad/bin/plugins/bom-in-python/my_python_script.py \"%I\" \"%O.html\"\n"
|
||||
"```\n"
|
||||
"\n"
|
||||
"On Linux:\n"
|
||||
"```\n"
|
||||
"python /usr/local/kicad/bin/plugins/bom-in-python/my_python_script.py \"%I\" \"%O.csv\"\n"
|
||||
"```\n"
|
||||
"" );
|
||||
@@ -49,6 +49,10 @@
|
||||
#include <string_utils.h>
|
||||
#include <kiplatform/ui.h>
|
||||
|
||||
static SCHEMATIC* g_lastERCSchematic = nullptr;
|
||||
static bool g_lastERCRun = false;
|
||||
|
||||
|
||||
DIALOG_ERC::DIALOG_ERC( SCH_EDIT_FRAME* parent ) :
|
||||
DIALOG_ERC_BASE( parent ),
|
||||
PROGRESS_REPORTER_BASE( 1 ),
|
||||
@@ -57,6 +61,8 @@ DIALOG_ERC::DIALOG_ERC( SCH_EDIT_FRAME* parent ) :
|
||||
m_ercRun( false ),
|
||||
m_severities( RPT_SEVERITY_ERROR | RPT_SEVERITY_WARNING )
|
||||
{
|
||||
m_currentSchematic = &parent->Schematic();
|
||||
|
||||
SetName( DIALOG_ERC_WINDOW_NAME ); // Set a window name to be able to find it
|
||||
|
||||
EESCHEMA_SETTINGS* settings = dynamic_cast<EESCHEMA_SETTINGS*>( Kiface().KifaceSettings() );
|
||||
@@ -70,8 +76,9 @@ DIALOG_ERC::DIALOG_ERC( SCH_EDIT_FRAME* parent ) :
|
||||
|
||||
m_markerTreeModel->SetSeverities( m_severities );
|
||||
m_markerTreeModel->SetProvider( m_markerProvider );
|
||||
syncCheckboxes();
|
||||
updateDisplayedCounts();
|
||||
|
||||
if( m_currentSchematic == g_lastERCSchematic )
|
||||
m_ercRun = g_lastERCRun;
|
||||
|
||||
// We use a sdbSizer to get platform-dependent ordering of the action buttons, but
|
||||
// that requires us to correct the button labels here.
|
||||
@@ -81,12 +88,24 @@ DIALOG_ERC::DIALOG_ERC( SCH_EDIT_FRAME* parent ) :
|
||||
|
||||
m_sdbSizer1OK->SetDefault();
|
||||
|
||||
m_violationsTitleTemplate = m_notebook->GetPageText( 1 );
|
||||
|
||||
// Hack to keep from changing translated string in 6.0.x
|
||||
m_violationsTitleTemplate.Append( wxT( " (%s)" ) );
|
||||
|
||||
m_errorsBadge->SetMaximumNumber( 999 );
|
||||
m_warningsBadge->SetMaximumNumber( 999 );
|
||||
m_exclusionsBadge->SetMaximumNumber( 999 );
|
||||
|
||||
UpdateAnnotationWarning();
|
||||
|
||||
Layout();
|
||||
|
||||
SetFocus();
|
||||
|
||||
syncCheckboxes();
|
||||
updateDisplayedCounts();
|
||||
|
||||
// Now all widgets have the size fixed, call FinishDialogSettings
|
||||
finishDialogSettings();
|
||||
}
|
||||
@@ -94,6 +113,9 @@ DIALOG_ERC::DIALOG_ERC( SCH_EDIT_FRAME* parent ) :
|
||||
|
||||
DIALOG_ERC::~DIALOG_ERC()
|
||||
{
|
||||
g_lastERCSchematic = m_currentSchematic;
|
||||
g_lastERCRun = m_ercRun;
|
||||
|
||||
EESCHEMA_SETTINGS* settings = dynamic_cast<EESCHEMA_SETTINGS*>( Kiface().KifaceSettings() );
|
||||
wxASSERT( settings );
|
||||
|
||||
@@ -176,18 +198,41 @@ void DIALOG_ERC::updateDisplayedCounts()
|
||||
int numWarnings = 0;
|
||||
int numExcluded = 0;
|
||||
|
||||
int numMarkers = 0;
|
||||
|
||||
if( m_markerProvider )
|
||||
{
|
||||
numMarkers += m_markerProvider->GetCount();
|
||||
numErrors += m_markerProvider->GetCount( RPT_SEVERITY_ERROR );
|
||||
numWarnings += m_markerProvider->GetCount( RPT_SEVERITY_WARNING );
|
||||
numExcluded += m_markerProvider->GetCount( RPT_SEVERITY_EXCLUSION );
|
||||
}
|
||||
|
||||
if( !m_ercRun )
|
||||
bool markersOverflowed = false;
|
||||
|
||||
// We don't currently have a limit on ERC violations, so the above is always false.
|
||||
|
||||
wxString num;
|
||||
wxString msg;
|
||||
|
||||
if( m_ercRun )
|
||||
{
|
||||
numErrors = -1;
|
||||
numWarnings = -1;
|
||||
num.Printf( markersOverflowed ? wxT( "%d+" ) : wxT( "%d" ), numMarkers );
|
||||
msg.Printf( m_violationsTitleTemplate, num );
|
||||
}
|
||||
else
|
||||
{
|
||||
msg = m_violationsTitleTemplate;
|
||||
msg.Replace( wxT( "(%s)" ), wxEmptyString );
|
||||
}
|
||||
|
||||
m_notebook->SetPageText( 1, msg );
|
||||
|
||||
if( !m_ercRun && numErrors == 0 )
|
||||
numErrors = -1;
|
||||
|
||||
if( !m_ercRun && numWarnings == 0 )
|
||||
numWarnings = -1;
|
||||
|
||||
m_errorsBadge->UpdateNumber( numErrors, RPT_SEVERITY_ERROR );
|
||||
m_warningsBadge->UpdateNumber( numWarnings, RPT_SEVERITY_WARNING );
|
||||
@@ -221,9 +266,9 @@ void DIALOG_ERC::OnEraseDrcMarkersClick( wxCommandEvent& event )
|
||||
|
||||
deleteAllMarkers( includeExclusions );
|
||||
|
||||
m_ercRun = false;
|
||||
// redraw the schematic
|
||||
redrawDrawPanel();
|
||||
updateDisplayedCounts();
|
||||
m_parent->GetCanvas()->Refresh();
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -91,6 +91,9 @@ private:
|
||||
|
||||
private:
|
||||
SCH_EDIT_FRAME* m_parent;
|
||||
SCHEMATIC* m_currentSchematic;
|
||||
|
||||
wxString m_violationsTitleTemplate;
|
||||
|
||||
RC_ITEMS_PROVIDER* m_markerProvider;
|
||||
RC_TREE_MODEL* m_markerTreeModel;
|
||||
|
||||
@@ -309,7 +309,7 @@
|
||||
</object>
|
||||
<object class="notebookpage" expanded="1">
|
||||
<property name="bitmap"></property>
|
||||
<property name="label">Violations</property>
|
||||
<property name="label">Violations (%d)</property>
|
||||
<property name="select">0</property>
|
||||
<object class="wxPanel" expanded="1">
|
||||
<property name="BottomDockable">1</property>
|
||||
|
||||
@@ -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>
|
||||
|
||||
@@ -132,7 +132,7 @@ public:
|
||||
val = StringFromValue( aUserUnits, pin->GetPosition().x, true );
|
||||
break;
|
||||
case COL_POSY:
|
||||
val = StringFromValue( aUserUnits, pin->GetPosition().y, true );
|
||||
val = StringFromValue( aUserUnits, -pin->GetPosition().y, true );
|
||||
break;
|
||||
case COL_VISIBLE:
|
||||
val = StringFromBool( pin->IsVisible() );
|
||||
@@ -216,7 +216,7 @@ public:
|
||||
|
||||
case COL_POSY:
|
||||
pin->SetPosition( wxPoint( pin->GetPosition().x,
|
||||
ValueFromString( m_frame->GetUserUnits(), aValue ) ) );
|
||||
-ValueFromString( m_frame->GetUserUnits(), aValue ) ) );
|
||||
break;
|
||||
|
||||
case COL_VISIBLE:
|
||||
|
||||
@@ -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();
|
||||
|
||||
@@ -28,7 +28,7 @@
|
||||
#include <dialog_lib_text_properties.h>
|
||||
#include <symbol_editor/symbol_editor_settings.h>
|
||||
#include <tools/symbol_editor_drawing_tools.h>
|
||||
|
||||
#include "confirm.h"
|
||||
|
||||
DIALOG_LIB_TEXT_PROPERTIES::DIALOG_LIB_TEXT_PROPERTIES( SYMBOL_EDIT_FRAME* aParent,
|
||||
LIB_TEXT* aText ) :
|
||||
@@ -116,9 +116,15 @@ bool DIALOG_LIB_TEXT_PROPERTIES::TransferDataFromWindow()
|
||||
if( m_graphicText )
|
||||
{
|
||||
if( m_TextCtrl->GetValue().IsEmpty() )
|
||||
m_graphicText->SetText( wxT( "[null]" ) );
|
||||
{
|
||||
// Other text items do not have defined extents, and so will disappear if empty
|
||||
DisplayError( this, _( "Value may not be empty." ) );
|
||||
return false;
|
||||
}
|
||||
else
|
||||
{
|
||||
m_graphicText->SetText( m_TextCtrl->GetValue() );
|
||||
}
|
||||
|
||||
m_graphicText->SetPosition( wxPoint( m_posX.GetValue(), m_posY.GetValue() ) );
|
||||
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
* Copyright (C) 1992-2018 Jean-Pierre Charras jp.charras at wanadoo.fr
|
||||
* Copyright (C) 1992-2010 Lorenzo Marcantonio
|
||||
* Copyright (C) 2011 Wayne Stambaugh <stambaughw@gmail.com>
|
||||
* Copyright (C) 1992-2021 KiCad Developers, see AUTHORS.txt for contributors.
|
||||
* Copyright (C) 1992-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
|
||||
@@ -38,6 +38,7 @@
|
||||
#include <trace_helpers.h>
|
||||
#include <settings/settings_manager.h>
|
||||
#include <drawing_sheet/ds_painter.h>
|
||||
#include <wx_filename.h>
|
||||
|
||||
#include <sch_edit_frame.h>
|
||||
#include <sch_painter.h>
|
||||
@@ -802,7 +803,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;
|
||||
@@ -1283,7 +1284,7 @@ wxString DIALOG_PLOT_SCHEMATIC::getOutputPath()
|
||||
fn.SetName( wxEmptyString );
|
||||
fn.SetExt( wxEmptyString );
|
||||
|
||||
if( fn.Normalize() )
|
||||
if( fn.Normalize( FN_NORMALIZE_FLAGS | wxPATH_NORM_ENV_VARS ) )
|
||||
{
|
||||
path = fn.GetPath();
|
||||
}
|
||||
@@ -1318,7 +1319,7 @@ wxString DIALOG_PLOT_SCHEMATIC::getOutputPath()
|
||||
// Build the absolute path of current output directory and the project path.
|
||||
fn.SetPath( Prj().GetProjectPath() + path );
|
||||
|
||||
if( fn.Normalize() )
|
||||
if( fn.Normalize( FN_NORMALIZE_FLAGS | wxPATH_NORM_ENV_VARS ) )
|
||||
{
|
||||
path = fn.GetPath();
|
||||
}
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -29,6 +29,7 @@
|
||||
#include <wx/tooltip.h>
|
||||
#include <confirm.h>
|
||||
#include <validators.h>
|
||||
#include <wx_filename.h>
|
||||
#include <wildcards_and_files_ext.h>
|
||||
#include <widgets/tab_traversal.h>
|
||||
#include <sch_edit_frame.h>
|
||||
@@ -425,7 +426,8 @@ bool DIALOG_SHEET_PROPERTIES::onSheetFilenameChanged( const wxString& aNewFilena
|
||||
// SCH_SCREEN file names are always absolute.
|
||||
wxFileName currentScreenFileName = currentScreen->GetFileName();
|
||||
|
||||
if( !screenFileName.Normalize( wxPATH_NORM_ALL, currentScreenFileName.GetPath() ) )
|
||||
if( !screenFileName.Normalize( FN_NORMALIZE_FLAGS | wxPATH_NORM_ENV_VARS,
|
||||
currentScreenFileName.GetPath() ) )
|
||||
{
|
||||
msg = wxString::Format( _( "Cannot normalize new sheet schematic file path:\n"
|
||||
"'%s'\n"
|
||||
|
||||
@@ -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();
|
||||
}
|
||||
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
/*
|
||||
* This program source code file is part of KiCad, a free EDA CAD application.
|
||||
*
|
||||
* 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
|
||||
@@ -89,6 +89,14 @@ public:
|
||||
|
||||
void BuildAttrs()
|
||||
{
|
||||
for( wxGridCellAttr* attr : m_nameAttrs )
|
||||
attr->DecRef();
|
||||
|
||||
m_nameAttrs.clear();
|
||||
|
||||
if( m_readOnlyAttr )
|
||||
m_readOnlyAttr->DecRef();
|
||||
|
||||
m_readOnlyAttr = new wxGridCellAttr;
|
||||
m_readOnlyAttr->SetReadOnly( true );
|
||||
|
||||
@@ -117,11 +125,17 @@ public:
|
||||
m_nameAttrs.push_back( attr );
|
||||
}
|
||||
|
||||
if( m_typeAttr )
|
||||
m_typeAttr->DecRef();
|
||||
|
||||
m_typeAttr = new wxGridCellAttr;
|
||||
m_typeAttr->SetRenderer( new GRID_CELL_ICON_TEXT_RENDERER( PinTypeIcons(),
|
||||
PinTypeNames() ) );
|
||||
m_typeAttr->SetReadOnly( true );
|
||||
|
||||
if( m_shapeAttr )
|
||||
m_shapeAttr->DecRef();
|
||||
|
||||
m_shapeAttr = new wxGridCellAttr;
|
||||
m_shapeAttr->SetRenderer( new GRID_CELL_ICON_TEXT_RENDERER( PinShapeIcons(),
|
||||
PinShapeNames() ) );
|
||||
@@ -635,7 +649,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;
|
||||
}
|
||||
@@ -1024,6 +1038,7 @@ void DIALOG_SYMBOL_PROPERTIES::OnPinTableColSort( wxGridEvent& aEvent )
|
||||
ascending = true;
|
||||
|
||||
m_dataModel->SortRows( sortCol, ascending );
|
||||
m_dataModel->BuildAttrs();
|
||||
}
|
||||
|
||||
|
||||
@@ -1139,3 +1154,16 @@ void DIALOG_SYMBOL_PROPERTIES::OnChoice( wxCommandEvent& event )
|
||||
{
|
||||
OnModify();
|
||||
}
|
||||
|
||||
|
||||
void DIALOG_SYMBOL_PROPERTIES::onUpdateEditSymbol( wxUpdateUIEvent& event )
|
||||
{
|
||||
event.Enable( m_symbol && m_symbol->GetLibSymbolRef() );
|
||||
}
|
||||
|
||||
|
||||
void DIALOG_SYMBOL_PROPERTIES::onUpdateEditLibrarySymbol( wxUpdateUIEvent& event )
|
||||
{
|
||||
event.Enable( m_symbol && m_symbol->GetLibSymbolRef() );
|
||||
}
|
||||
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
/*
|
||||
* This program source code file is part of KiCad, a free EDA CAD application.
|
||||
*
|
||||
* Copyright (C) 1992-2021 KiCad Developers, see AUTHORS.txt for contributors.
|
||||
* Copyright (C) 1992-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
|
||||
@@ -88,6 +88,9 @@ private:
|
||||
void OnUpdateSymbol( wxCommandEvent& ) override;
|
||||
void OnExchangeSymbol( wxCommandEvent& ) override;
|
||||
|
||||
virtual void onUpdateEditSymbol( wxUpdateUIEvent& event ) override;
|
||||
virtual void onUpdateEditLibrarySymbol( wxUpdateUIEvent& event ) override;
|
||||
|
||||
void AdjustGridColumns( int aWidth );
|
||||
|
||||
private:
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
///////////////////////////////////////////////////////////////////////////
|
||||
// C++ code generated with wxFormBuilder (version Oct 26 2018)
|
||||
// C++ code generated with wxFormBuilder (version 3.10.0-4761b0c5)
|
||||
// http://www.wxformbuilder.org/
|
||||
//
|
||||
// PLEASE DO *NOT* EDIT THIS FILE!
|
||||
@@ -49,7 +49,6 @@ DIALOG_SYMBOL_PROPERTIES_BASE::DIALOG_SYMBOL_PROPERTIES_BASE( wxWindow* parent,
|
||||
m_fieldsGrid->SetColSize( 10, 84 );
|
||||
m_fieldsGrid->EnableDragColMove( false );
|
||||
m_fieldsGrid->EnableDragColSize( true );
|
||||
m_fieldsGrid->SetColLabelSize( 22 );
|
||||
m_fieldsGrid->SetColLabelValue( 0, _("Name") );
|
||||
m_fieldsGrid->SetColLabelValue( 1, _("Value") );
|
||||
m_fieldsGrid->SetColLabelValue( 2, _("Show") );
|
||||
@@ -61,6 +60,7 @@ DIALOG_SYMBOL_PROPERTIES_BASE::DIALOG_SYMBOL_PROPERTIES_BASE( wxWindow* parent,
|
||||
m_fieldsGrid->SetColLabelValue( 8, _("Orientation") );
|
||||
m_fieldsGrid->SetColLabelValue( 9, _("X Position") );
|
||||
m_fieldsGrid->SetColLabelValue( 10, _("Y Position") );
|
||||
m_fieldsGrid->SetColLabelSize( 22 );
|
||||
m_fieldsGrid->SetColLabelAlignment( wxALIGN_CENTER, wxALIGN_CENTER );
|
||||
|
||||
// Rows
|
||||
@@ -260,12 +260,12 @@ DIALOG_SYMBOL_PROPERTIES_BASE::DIALOG_SYMBOL_PROPERTIES_BASE( wxWindow* parent,
|
||||
m_pinGrid->SetColSize( 4, 140 );
|
||||
m_pinGrid->EnableDragColMove( false );
|
||||
m_pinGrid->EnableDragColSize( true );
|
||||
m_pinGrid->SetColLabelSize( 24 );
|
||||
m_pinGrid->SetColLabelValue( 0, _("Pin Number") );
|
||||
m_pinGrid->SetColLabelValue( 1, _("Base Pin Name") );
|
||||
m_pinGrid->SetColLabelValue( 2, _("Alternate Assignment") );
|
||||
m_pinGrid->SetColLabelValue( 3, _("Electrical Type") );
|
||||
m_pinGrid->SetColLabelValue( 4, _("Graphic Style") );
|
||||
m_pinGrid->SetColLabelSize( 24 );
|
||||
m_pinGrid->SetColLabelAlignment( wxALIGN_CENTER, wxALIGN_CENTER );
|
||||
|
||||
// Rows
|
||||
@@ -353,7 +353,9 @@ DIALOG_SYMBOL_PROPERTIES_BASE::DIALOG_SYMBOL_PROPERTIES_BASE( wxWindow* parent,
|
||||
m_updateSymbolBtn->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_SYMBOL_PROPERTIES_BASE::OnUpdateSymbol ), NULL, this );
|
||||
m_changeSymbolBtn->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_SYMBOL_PROPERTIES_BASE::OnExchangeSymbol ), NULL, this );
|
||||
m_editSchematicSymbolBtn->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_SYMBOL_PROPERTIES_BASE::OnEditSymbol ), NULL, this );
|
||||
m_editSchematicSymbolBtn->Connect( wxEVT_UPDATE_UI, wxUpdateUIEventHandler( DIALOG_SYMBOL_PROPERTIES_BASE::onUpdateEditSymbol ), NULL, this );
|
||||
m_editLibrarySymbolBtn->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_SYMBOL_PROPERTIES_BASE::OnEditLibrarySymbol ), NULL, this );
|
||||
m_editLibrarySymbolBtn->Connect( wxEVT_UPDATE_UI, wxUpdateUIEventHandler( DIALOG_SYMBOL_PROPERTIES_BASE::onUpdateEditLibrarySymbol ), NULL, this );
|
||||
m_pinGrid->Connect( wxEVT_GRID_CELL_CHANGED, wxGridEventHandler( DIALOG_SYMBOL_PROPERTIES_BASE::OnPinTableCellEdited ), NULL, this );
|
||||
m_spiceFieldsButton->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_SYMBOL_PROPERTIES_BASE::OnEditSpiceModel ), NULL, this );
|
||||
m_stdDialogButtonSizerCancel->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_SYMBOL_PROPERTIES_BASE::OnCancelButtonClick ), NULL, this );
|
||||
@@ -381,7 +383,9 @@ DIALOG_SYMBOL_PROPERTIES_BASE::~DIALOG_SYMBOL_PROPERTIES_BASE()
|
||||
m_updateSymbolBtn->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_SYMBOL_PROPERTIES_BASE::OnUpdateSymbol ), NULL, this );
|
||||
m_changeSymbolBtn->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_SYMBOL_PROPERTIES_BASE::OnExchangeSymbol ), NULL, this );
|
||||
m_editSchematicSymbolBtn->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_SYMBOL_PROPERTIES_BASE::OnEditSymbol ), NULL, this );
|
||||
m_editSchematicSymbolBtn->Disconnect( wxEVT_UPDATE_UI, wxUpdateUIEventHandler( DIALOG_SYMBOL_PROPERTIES_BASE::onUpdateEditSymbol ), NULL, this );
|
||||
m_editLibrarySymbolBtn->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_SYMBOL_PROPERTIES_BASE::OnEditLibrarySymbol ), NULL, this );
|
||||
m_editLibrarySymbolBtn->Disconnect( wxEVT_UPDATE_UI, wxUpdateUIEventHandler( DIALOG_SYMBOL_PROPERTIES_BASE::onUpdateEditLibrarySymbol ), NULL, this );
|
||||
m_pinGrid->Disconnect( wxEVT_GRID_CELL_CHANGED, wxGridEventHandler( DIALOG_SYMBOL_PROPERTIES_BASE::OnPinTableCellEdited ), NULL, this );
|
||||
m_spiceFieldsButton->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_SYMBOL_PROPERTIES_BASE::OnEditSpiceModel ), NULL, this );
|
||||
m_stdDialogButtonSizerCancel->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_SYMBOL_PROPERTIES_BASE::OnCancelButtonClick ), NULL, this );
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
|
||||
<wxFormBuilder_Project>
|
||||
<FileVersion major="1" minor="15" />
|
||||
<FileVersion major="1" minor="16" />
|
||||
<object class="Project" expanded="1">
|
||||
<property name="class_decoration">; </property>
|
||||
<property name="code_generation">C++</property>
|
||||
@@ -14,6 +14,7 @@
|
||||
<property name="file">dialog_symbol_properties_base</property>
|
||||
<property name="first_id">1000</property>
|
||||
<property name="help_provider">none</property>
|
||||
<property name="image_path_wrapper_function_name"></property>
|
||||
<property name="indent_with_spaces"></property>
|
||||
<property name="internationalize">1</property>
|
||||
<property name="name">dialog_edit_component_in_schematic_base</property>
|
||||
@@ -25,6 +26,7 @@
|
||||
<property name="skip_php_events">1</property>
|
||||
<property name="skip_python_events">1</property>
|
||||
<property name="ui_table">UI</property>
|
||||
<property name="use_array_enum">0</property>
|
||||
<property name="use_enum">0</property>
|
||||
<property name="use_microsoft_bom">0</property>
|
||||
<object class="Dialog" expanded="1">
|
||||
@@ -50,6 +52,7 @@
|
||||
<property name="subclass">DIALOG_SHIM; dialog_shim.h</property>
|
||||
<property name="title">Symbol Properties</property>
|
||||
<property name="tooltip"></property>
|
||||
<property name="two_step_creation">0</property>
|
||||
<property name="window_extra_style"></property>
|
||||
<property name="window_name"></property>
|
||||
<property name="window_style"></property>
|
||||
@@ -301,6 +304,7 @@
|
||||
<property name="aui_name"></property>
|
||||
<property name="aui_position"></property>
|
||||
<property name="aui_row"></property>
|
||||
<property name="auth_needed">0</property>
|
||||
<property name="best_size"></property>
|
||||
<property name="bg"></property>
|
||||
<property name="bitmap"></property>
|
||||
@@ -374,6 +378,7 @@
|
||||
<property name="aui_name"></property>
|
||||
<property name="aui_position"></property>
|
||||
<property name="aui_row"></property>
|
||||
<property name="auth_needed">0</property>
|
||||
<property name="best_size"></property>
|
||||
<property name="bg"></property>
|
||||
<property name="bitmap"></property>
|
||||
@@ -447,6 +452,7 @@
|
||||
<property name="aui_name"></property>
|
||||
<property name="aui_position"></property>
|
||||
<property name="aui_row"></property>
|
||||
<property name="auth_needed">0</property>
|
||||
<property name="best_size"></property>
|
||||
<property name="bg"></property>
|
||||
<property name="bitmap"></property>
|
||||
@@ -530,6 +536,7 @@
|
||||
<property name="aui_name"></property>
|
||||
<property name="aui_position"></property>
|
||||
<property name="aui_row"></property>
|
||||
<property name="auth_needed">0</property>
|
||||
<property name="best_size"></property>
|
||||
<property name="bg"></property>
|
||||
<property name="bitmap"></property>
|
||||
@@ -1429,6 +1436,7 @@
|
||||
<property name="aui_name"></property>
|
||||
<property name="aui_position"></property>
|
||||
<property name="aui_row"></property>
|
||||
<property name="auth_needed">0</property>
|
||||
<property name="best_size"></property>
|
||||
<property name="bg"></property>
|
||||
<property name="bitmap"></property>
|
||||
@@ -1502,6 +1510,7 @@
|
||||
<property name="aui_name"></property>
|
||||
<property name="aui_position"></property>
|
||||
<property name="aui_row"></property>
|
||||
<property name="auth_needed">0</property>
|
||||
<property name="best_size"></property>
|
||||
<property name="bg"></property>
|
||||
<property name="bitmap"></property>
|
||||
@@ -1575,6 +1584,7 @@
|
||||
<property name="aui_name"></property>
|
||||
<property name="aui_position"></property>
|
||||
<property name="aui_row"></property>
|
||||
<property name="auth_needed">0</property>
|
||||
<property name="best_size"></property>
|
||||
<property name="bg"></property>
|
||||
<property name="bitmap"></property>
|
||||
@@ -1633,6 +1643,7 @@
|
||||
<property name="window_name"></property>
|
||||
<property name="window_style"></property>
|
||||
<event name="OnButtonClick">OnEditSymbol</event>
|
||||
<event name="OnUpdateUI">onUpdateEditSymbol</event>
|
||||
</object>
|
||||
</object>
|
||||
<object class="sizeritem" expanded="1">
|
||||
@@ -1658,6 +1669,7 @@
|
||||
<property name="aui_name"></property>
|
||||
<property name="aui_position"></property>
|
||||
<property name="aui_row"></property>
|
||||
<property name="auth_needed">0</property>
|
||||
<property name="best_size"></property>
|
||||
<property name="bg"></property>
|
||||
<property name="bitmap"></property>
|
||||
@@ -1716,6 +1728,7 @@
|
||||
<property name="window_name"></property>
|
||||
<property name="window_style"></property>
|
||||
<event name="OnButtonClick">OnEditLibrarySymbol</event>
|
||||
<event name="OnUpdateUI">onUpdateEditLibrarySymbol</event>
|
||||
</object>
|
||||
</object>
|
||||
</object>
|
||||
@@ -2058,6 +2071,7 @@
|
||||
<property name="aui_name"></property>
|
||||
<property name="aui_position"></property>
|
||||
<property name="aui_row"></property>
|
||||
<property name="auth_needed">0</property>
|
||||
<property name="best_size"></property>
|
||||
<property name="bg"></property>
|
||||
<property name="bitmap"></property>
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
///////////////////////////////////////////////////////////////////////////
|
||||
// C++ code generated with wxFormBuilder (version Oct 26 2018)
|
||||
// C++ code generated with wxFormBuilder (version 3.10.0-4761b0c5)
|
||||
// http://www.wxformbuilder.org/
|
||||
//
|
||||
// PLEASE DO *NOT* EDIT THIS FILE!
|
||||
@@ -77,7 +77,7 @@ class DIALOG_SYMBOL_PROPERTIES_BASE : public DIALOG_SHIM
|
||||
wxButton* m_stdDialogButtonSizerOK;
|
||||
wxButton* m_stdDialogButtonSizerCancel;
|
||||
|
||||
// Virtual event handlers, overide them in your derived class
|
||||
// Virtual event handlers, override them in your derived class
|
||||
virtual void OnInitDlg( wxInitDialogEvent& event ) { event.Skip(); }
|
||||
virtual void OnUpdateUI( wxUpdateUIEvent& event ) { event.Skip(); }
|
||||
virtual void OnGridEditorShown( wxGridEvent& event ) { event.Skip(); }
|
||||
@@ -91,7 +91,9 @@ class DIALOG_SYMBOL_PROPERTIES_BASE : public DIALOG_SHIM
|
||||
virtual void OnUpdateSymbol( wxCommandEvent& event ) { event.Skip(); }
|
||||
virtual void OnExchangeSymbol( wxCommandEvent& event ) { event.Skip(); }
|
||||
virtual void OnEditSymbol( wxCommandEvent& event ) { event.Skip(); }
|
||||
virtual void onUpdateEditSymbol( wxUpdateUIEvent& event ) { event.Skip(); }
|
||||
virtual void OnEditLibrarySymbol( wxCommandEvent& event ) { event.Skip(); }
|
||||
virtual void onUpdateEditLibrarySymbol( wxUpdateUIEvent& event ) { event.Skip(); }
|
||||
virtual void OnPinTableCellEdited( wxGridEvent& event ) { event.Skip(); }
|
||||
virtual void OnEditSpiceModel( wxCommandEvent& event ) { event.Skip(); }
|
||||
virtual void OnCancelButtonClick( wxCommandEvent& event ) { event.Skip(); }
|
||||
@@ -100,6 +102,7 @@ class DIALOG_SYMBOL_PROPERTIES_BASE : public DIALOG_SHIM
|
||||
public:
|
||||
|
||||
DIALOG_SYMBOL_PROPERTIES_BASE( wxWindow* parent, wxWindowID id = wxID_ANY, const wxString& title = _("Symbol Properties"), const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxSize( -1,-1 ), long style = wxCAPTION|wxCLOSE_BOX|wxDEFAULT_DIALOG_STYLE|wxMAXIMIZE_BOX|wxMINIMIZE_BOX|wxRESIZE_BORDER|wxSYSTEM_MENU );
|
||||
|
||||
~DIALOG_SYMBOL_PROPERTIES_BASE();
|
||||
|
||||
};
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
* This program source code file is part of KiCad, a free EDA CAD application.
|
||||
*
|
||||
* Copyright (C) 2017 Wayne Stambaugh <stambaughw@gmail.com>
|
||||
* 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
|
||||
@@ -29,6 +29,7 @@
|
||||
#include <confirm.h>
|
||||
#include <reporter.h>
|
||||
#include <wildcards_and_files_ext.h>
|
||||
#include <wx_filename.h>
|
||||
#include <wx_html_report_panel.h>
|
||||
|
||||
#include <symbol_library.h>
|
||||
@@ -201,7 +202,7 @@ void DIALOG_SYMBOL_REMAP::createProjectSymbolLibTable( REPORTER& aReporter )
|
||||
wxFileName tmpFn = fullFileName;
|
||||
|
||||
// Don't add symbol libraries that do not exist.
|
||||
if( tmpFn.Normalize() && tmpFn.FileExists() )
|
||||
if( tmpFn.Normalize( FN_NORMALIZE_FLAGS | wxPATH_NORM_ENV_VARS ) && tmpFn.FileExists() )
|
||||
{
|
||||
msg.Printf( _( "Adding library '%s', file '%s' to project symbol library table." ),
|
||||
libName,
|
||||
|
||||
@@ -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
|
||||
{
|
||||
|
||||
@@ -456,6 +456,7 @@ bool SCH_EDIT_FRAME::OpenProjectFiles( const std::vector<wxString>& aFileSet, in
|
||||
// Legacy schematic can have duplicate time stamps so fix that before converting
|
||||
// to the s-expression format.
|
||||
schematic.ReplaceDuplicateTimeStamps();
|
||||
schematic.SetLegacySymbolInstanceData();
|
||||
|
||||
// Allow the schematic to be saved to new file format without making any edits.
|
||||
OnModify();
|
||||
@@ -516,6 +517,8 @@ bool SCH_EDIT_FRAME::OpenProjectFiles( const std::vector<wxString>& aFileSet, in
|
||||
SyncView();
|
||||
GetScreen()->ClearDrawingState();
|
||||
|
||||
TestDanglingEnds();
|
||||
|
||||
UpdateHierarchyNavigator();
|
||||
UpdateTitle();
|
||||
|
||||
|
||||
+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();
|
||||
}
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user