Compare commits
276 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 3adec39b0c | |||
| a0ad6add34 | |||
| 80079c16e8 | |||
| 632ae136d8 | |||
| 88b11ef065 | |||
| 63b89688df | |||
| ab9a4295a0 | |||
| e6ce4eb73e | |||
| 86f122416b | |||
| be91576758 | |||
| 784c2cda5a | |||
| 836de8d233 | |||
| ac01d1986f | |||
| 8a0693d328 | |||
| 2a62ffe32d | |||
| cb895c9710 | |||
| 52a73986bc | |||
| 15582773bd | |||
| fc3435113d | |||
| 801492b708 | |||
| 8c25e5b68e | |||
| 1525da154f | |||
| f2199eebf5 | |||
| 1a761bf6ce | |||
| 21f8b23ade | |||
| 4fc82b97cf | |||
| 721e7359b3 | |||
| 7e0c822451 | |||
| 6d9160ea31 | |||
| 31cc51fe42 | |||
| c85ef81e6b | |||
| ddb29d6ab8 | |||
| d666021572 | |||
| 360d6d87a4 | |||
| 97d3b369d5 | |||
| 7936df3e1e | |||
| eca370792a | |||
| af68514acd | |||
| a0e0f05977 | |||
| 78c09b1e2f | |||
| a2051132b5 | |||
| a67bf40def | |||
| 9b47650b4a | |||
| 748dd4f02c | |||
| 530167cf69 | |||
| 7d6e8853db | |||
| 9f3631f0e9 | |||
| c8253a5018 | |||
| 3aaae7405d | |||
| f2e012119a | |||
| 48b9027842 | |||
| 0511926a4c | |||
| 1ac1a5bb3b | |||
| 6cfe4482f7 | |||
| 61680eacd4 | |||
| 3aef3818cd | |||
| 355805756e | |||
| 96acf00e81 | |||
| 1ad4fb2eea | |||
| 1dcd65ec71 | |||
| 1109878da0 | |||
| 7a0803f384 | |||
| 8f56d0b38e | |||
| 9309f612ef | |||
| d2b13060fe | |||
| 393a72216e | |||
| 76e50881fb | |||
| 9779ee0fd3 | |||
| 9fdd825681 | |||
| f4f9513f80 | |||
| d35431c888 | |||
| bcb7acf5c2 | |||
| 1e82ed302d | |||
| 1fde8ea6f5 | |||
| dab3a38815 | |||
| c9db8f6bfc | |||
| 3c655836df | |||
| 544b235910 | |||
| bf34bf24ab | |||
| 6b199c52a1 | |||
| 94f667d87f | |||
| 464c3815b9 | |||
| 53732e2276 | |||
| bd554a5808 | |||
| b48051d52f | |||
| 03079a4f4f | |||
| 6daa857c2d | |||
| 5a1f60a7c6 | |||
| e8553dcdf7 | |||
| dc3012933a | |||
| 291ff615bc | |||
| 26d1080e52 | |||
| c1452a24d2 | |||
| 34c833966f | |||
| f0e1bc3562 | |||
| 6da9034322 | |||
| 6887e8cbe3 | |||
| 89ef5986e7 | |||
| 5572a72bb3 | |||
| b40e446149 | |||
| 757bfd7b32 | |||
| c5e1c3db62 | |||
| b25ff44ff7 | |||
| cad7a18fa0 | |||
| 1c3637cb33 | |||
| 3a5f84d1ec | |||
| 44f8df592b | |||
| 17e19f8652 | |||
| 34fe104431 | |||
| 2bdb155838 | |||
| 22ebade907 | |||
| 9d594214fe | |||
| 2c89717c0a | |||
| 7574a46a19 | |||
| e5c4d75ce1 | |||
| f038ee3083 | |||
| e1ab2a0836 | |||
| 9070d9ff22 | |||
| 606c19780d | |||
| 8fecebb209 | |||
| da8e1be1c8 | |||
| e14a3caf18 | |||
| 5afb3ad5cc | |||
| b29ca47f25 | |||
| 5d1737d654 | |||
| bdc371f057 | |||
| dc2dd20ec7 | |||
| 057174caa0 | |||
| 4b035d5b5c | |||
| b22948988f | |||
| 7a05d58b3e | |||
| 695ab290e6 | |||
| 54a373a7e2 | |||
| 637f331724 | |||
| 931a9697ca | |||
| 5ffc58844f | |||
| 3ea2c6f1ff | |||
| 2cba724659 | |||
| 254260a616 | |||
| 45b13d513b | |||
| ba86c3ac75 | |||
| 19d4c31fcc | |||
| 160f69d720 | |||
| 4fa42960e9 | |||
| 9c4ca6da14 | |||
| c113385016 | |||
| 68e37a93ec | |||
| 9b158e70f5 | |||
| ab536192c3 | |||
| bc87b0db60 | |||
| 981f82db93 | |||
| b6f5aeba1e | |||
| 4fa34677ea | |||
| c67346991f | |||
| 811de6a462 | |||
| cfe7992723 | |||
| 8c84f2ac23 | |||
| fb23d62b6b | |||
| 84f182ef03 | |||
| 987d151977 | |||
| c622da5fbf | |||
| 19f163b724 | |||
| 3fcf207443 | |||
| 4814f29fbd | |||
| 39f4ea5ffa | |||
| 5d08531ecb | |||
| 4a0fdfd2ab | |||
| c88aab3a4f | |||
| bf4aebff4d | |||
| 39627bfcfa | |||
| 55fafe3401 | |||
| dd870deec5 | |||
| 7ecf18ba80 | |||
| 68e4ccf196 | |||
| 0a28398944 | |||
| 27002f568b | |||
| 9b5840b7ee | |||
| 5a3f8b4235 | |||
| 7be78d50a4 | |||
| b1f861137e | |||
| 3e3a958d4f | |||
| cc5a3eb61f | |||
| eabf2f57aa | |||
| 1667b1312e | |||
| 1123a25f04 | |||
| ef757ffd28 | |||
| f63d018f1c | |||
| 83de056de9 | |||
| 015906d862 | |||
| c288c469fb | |||
| 7a8efc1d27 | |||
| aaaa8a8835 | |||
| 2891c580b1 | |||
| 97d75ae844 | |||
| 7ccc89196b | |||
| 7774145a8f | |||
| 0bf2d2ca32 | |||
| 6338a69f17 | |||
| 5f8ba6f9a1 | |||
| a53bbd92f5 | |||
| aa71423d5f | |||
| f3ae7afec2 | |||
| 29194761e5 | |||
| f56c05ac3e | |||
| 15256b379c | |||
| b4113decc5 | |||
| b249932888 | |||
| 6b6057b194 | |||
| b9623e9359 | |||
| 735b05ba30 | |||
| 62724f9cb6 | |||
| 2e4dd4bc3f | |||
| 87139ce571 | |||
| 582d2e7bdb | |||
| 5c89937870 | |||
| 412e244d48 | |||
| 0940565025 | |||
| c5b2e859c1 | |||
| e06a8131c5 | |||
| 16dee8608b | |||
| 396e531e7c | |||
| 24c234fd93 | |||
| fdbe35e20c | |||
| cc3e3ee34c | |||
| d0da1725ca | |||
| 7e115249af | |||
| 07e8edfcdf | |||
| cbb2c187bd | |||
| 011018b002 | |||
| d3a44607e6 | |||
| 1ad3532740 | |||
| 26caad8b35 | |||
| f1da2e90d7 | |||
| 59492bd947 | |||
| 7b96cc3d0c | |||
| df873158bc | |||
| f88e1aa279 | |||
| a02f12c68a | |||
| cc141e346d | |||
| f5954b0d7d | |||
| 6bb1e59e10 | |||
| ced6b1cbb7 | |||
| d1d7d0eb05 | |||
| e1e196f1b1 | |||
| b55d760cd5 | |||
| b0a0408528 | |||
| d238a149a6 | |||
| 57d2f7209a | |||
| 8d08992c24 | |||
| 9938e7f723 | |||
| 17ad578675 | |||
| 044dd59c5c | |||
| 6ef90cfa18 | |||
| 7abf4c2d91 | |||
| 896ff72019 | |||
| 9c2eeb54fc | |||
| 69f583660f | |||
| 6334c733e1 | |||
| a50144f889 | |||
| 1ed85d521d | |||
| 793790b359 | |||
| 154112d4cc | |||
| 97d8ddeb4f | |||
| 4809b00206 | |||
| 5bc1040a8b | |||
| f6c8dbe81e | |||
| 0280989920 | |||
| 0b762fb804 | |||
| b71eb1186f | |||
| c78273cb99 | |||
| 26b8978b3e | |||
| 618bbfda8d | |||
| ee573a1480 | |||
| 20efc3b6e6 | |||
| 8632e74c5c | |||
| 6f35fd7058 |
@@ -381,7 +381,13 @@ bool S3D_CACHE::getSHA1( const wxString& aFileName, unsigned char* aSHA1Sum )
|
||||
|
||||
fclose( fp );
|
||||
unsigned int digest[5];
|
||||
dblock.get_digest( digest );
|
||||
// V8 only
|
||||
// Boost 1.86 and later changed digest_type from uchar[20] from int[5]
|
||||
// But KiCad 8.99 and later use MurmurHash3 here, so just do a fairly ugly cast to keep
|
||||
// this going for another few months.
|
||||
static_assert( sizeof( digest ) == sizeof( boost::uuids::detail::sha1::digest_type& ),
|
||||
"SHA1 digest size mismatch" );
|
||||
dblock.get_digest( reinterpret_cast<boost::uuids::detail::sha1::digest_type&>( digest ) );
|
||||
|
||||
// ensure MSB order
|
||||
for( int i = 0; i < 5; ++i )
|
||||
|
||||
@@ -374,6 +374,13 @@ void BOARD_ADAPTER::createPadWithMargin( const PAD* aPad, CONTAINER_2D_BASE* aCo
|
||||
// Remove group membership from dummy item before deleting
|
||||
dummy.SetParentGroup( nullptr );
|
||||
}
|
||||
else if( aPad->GetShape() == PAD_SHAPE::CUSTOM )
|
||||
{
|
||||
// A custom pad can have many complex subshape items. To avoid issues, use its
|
||||
// final polygon shape, not its basic shape set. One cannot apply the clearance
|
||||
// to each subshape: it does no work
|
||||
aPad->TransformShapeToPolygon( poly, aLayer, 0, maxError );
|
||||
}
|
||||
else
|
||||
{
|
||||
auto padShapes = std::static_pointer_cast<SHAPE_COMPOUND>( aPad->GetEffectiveShape() );
|
||||
@@ -422,7 +429,7 @@ void BOARD_ADAPTER::createPadWithMargin( const PAD* aPad, CONTAINER_2D_BASE* aCo
|
||||
break;
|
||||
|
||||
case SH_POLY_SET:
|
||||
poly = *(SHAPE_POLY_SET*) shape;
|
||||
poly.Append( *static_cast<const SHAPE_POLY_SET*>( shape ) );
|
||||
break;
|
||||
|
||||
case SH_ARC:
|
||||
|
||||
@@ -185,8 +185,12 @@ void BOARD_ADAPTER::createLayers( REPORTER* aStatusReporter )
|
||||
|
||||
for( PCB_TRACK* track : m_board->Tracks() )
|
||||
{
|
||||
if( !Is3dLayerEnabled( track->GetLayer(), visibilityFlags ) ) // Skip non enabled layers
|
||||
// Skip tracks (not vias that are on more than one layer ) on disabled layers
|
||||
if( track->Type() != PCB_VIA_T
|
||||
&& !Is3dLayerEnabled( track->GetLayer(), visibilityFlags ) )
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
// Note: a PCB_TRACK holds normal segment tracks and also vias circles (that have also
|
||||
// drill values)
|
||||
|
||||
@@ -55,7 +55,7 @@
|
||||
# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
||||
# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
|
||||
find_program(SWIG_EXECUTABLE NAMES swig4.0 swig3.0 swig2.0 swig)
|
||||
find_program(SWIG_EXECUTABLE NAMES swig4.2 swig4.1 swig4.0 swig3.0 swig2.0 swig)
|
||||
|
||||
if(SWIG_EXECUTABLE)
|
||||
execute_process(COMMAND ${SWIG_EXECUTABLE} -swiglib
|
||||
|
||||
@@ -37,7 +37,7 @@
|
||||
# KiCad.
|
||||
#
|
||||
# Note: This version string should follow the semantic versioning system
|
||||
set( KICAD_SEMANTIC_VERSION "8.0.4" )
|
||||
set( KICAD_SEMANTIC_VERSION "8.0.6" )
|
||||
|
||||
# Default the version to the semantic version.
|
||||
# This is overridden by the git repository tag though (if using git)
|
||||
|
||||
@@ -209,7 +209,7 @@ void BACKGROUND_JOB_REPORTER::AdvancePhase()
|
||||
}
|
||||
|
||||
|
||||
BACKGROUND_JOBS_MONITOR::BACKGROUND_JOBS_MONITOR() : m_jobListDialog( nullptr )
|
||||
BACKGROUND_JOBS_MONITOR::BACKGROUND_JOBS_MONITOR()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
+80
-18
@@ -524,9 +524,17 @@ void BuildBitmapInfo( std::unordered_map<BITMAPS, std::vector<BITMAP_INFO>>& aBi
|
||||
aBitmapInfoCache[BITMAPS::hole_to_hole_clearance].emplace_back( BITMAPS::hole_to_hole_clearance, wxT( "hole_to_hole_clearance_24.png" ), 24, wxT( "light" ) );
|
||||
aBitmapInfoCache[BITMAPS::hole_to_copper_clearance].emplace_back( BITMAPS::hole_to_copper_clearance, wxT( "hole_to_copper_clearance_24.png" ), 24, wxT( "light" ) );
|
||||
aBitmapInfoCache[BITMAPS::hv45mode].emplace_back( BITMAPS::hv45mode, wxT( "hv45mode_24.png" ), 24, wxT( "light" ) );
|
||||
aBitmapInfoCache[BITMAPS::icon_bitmap2component_24].emplace_back( BITMAPS::icon_bitmap2component_24, wxT( "icon_bitmap2component_24_24.png" ), 24, wxT( "light" ) );
|
||||
aBitmapInfoCache[BITMAPS::icon_cvpcb_24].emplace_back( BITMAPS::icon_cvpcb_24, wxT( "icon_cvpcb_24_24.png" ), 24, wxT( "light" ) );
|
||||
aBitmapInfoCache[BITMAPS::icon_eeschema_24].emplace_back( BITMAPS::icon_eeschema_24, wxT( "icon_eeschema_24_24.png" ), 24, wxT( "light" ) );
|
||||
aBitmapInfoCache[BITMAPS::icon_footprint_browser].emplace_back( BITMAPS::icon_footprint_browser, wxT( "icon_footprint_browser_24.png" ), 24, wxT( "light" ) );
|
||||
aBitmapInfoCache[BITMAPS::icon_gerbview_24].emplace_back( BITMAPS::icon_gerbview_24, wxT( "icon_gerbview_24_24.png" ), 24, wxT( "light" ) );
|
||||
aBitmapInfoCache[BITMAPS::icon_kicad_24].emplace_back( BITMAPS::icon_kicad_24, wxT( "icon_kicad_24_24.png" ), 24, wxT( "light" ) );
|
||||
aBitmapInfoCache[BITMAPS::icon_libedit_24].emplace_back( BITMAPS::icon_libedit_24, wxT( "icon_libedit_24_24.png" ), 24, wxT( "light" ) );
|
||||
aBitmapInfoCache[BITMAPS::icon_modedit_24].emplace_back( BITMAPS::icon_modedit_24, wxT( "icon_modedit_24_24.png" ), 24, wxT( "light" ) );
|
||||
aBitmapInfoCache[BITMAPS::icon_pagelayout_editor_24].emplace_back( BITMAPS::icon_pagelayout_editor_24, wxT( "icon_pagelayout_editor_24_24.png" ), 24, wxT( "light" ) );
|
||||
aBitmapInfoCache[BITMAPS::icon_pcbcalculator_24].emplace_back( BITMAPS::icon_pcbcalculator_24, wxT( "icon_pcbcalculator_24_24.png" ), 24, wxT( "light" ) );
|
||||
aBitmapInfoCache[BITMAPS::icon_pcbnew_24].emplace_back( BITMAPS::icon_pcbnew_24, wxT( "icon_pcbnew_24_24.png" ), 24, wxT( "light" ) );
|
||||
aBitmapInfoCache[BITMAPS::icon_pcm_24].emplace_back( BITMAPS::icon_pcm_24, wxT( "icon_pcm_24_24.png" ), 24, wxT( "light" ) );
|
||||
aBitmapInfoCache[BITMAPS::import3d].emplace_back( BITMAPS::import3d, wxT( "import3d_24.png" ), 24, wxT( "light" ) );
|
||||
aBitmapInfoCache[BITMAPS::image].emplace_back( BITMAPS::image, wxT( "image_24.png" ), 24, wxT( "light" ) );
|
||||
@@ -926,9 +934,17 @@ void BuildBitmapInfo( std::unordered_map<BITMAPS, std::vector<BITMAP_INFO>>& aBi
|
||||
aBitmapInfoCache[BITMAPS::hole_to_hole_clearance].emplace_back( BITMAPS::hole_to_hole_clearance, wxT( "hole_to_hole_clearance_dark_24.png" ), 24, wxT( "dark" ) );
|
||||
aBitmapInfoCache[BITMAPS::hole_to_copper_clearance].emplace_back( BITMAPS::hole_to_copper_clearance, wxT( "hole_to_copper_clearance_dark_24.png" ), 24, wxT( "dark" ) );
|
||||
aBitmapInfoCache[BITMAPS::hv45mode].emplace_back( BITMAPS::hv45mode, wxT( "hv45mode_dark_24.png" ), 24, wxT( "dark" ) );
|
||||
aBitmapInfoCache[BITMAPS::icon_bitmap2component_24].emplace_back( BITMAPS::icon_bitmap2component_24, wxT( "icon_bitmap2component_24_dark_24.png" ), 24, wxT( "dark" ) );
|
||||
aBitmapInfoCache[BITMAPS::icon_cvpcb_24].emplace_back( BITMAPS::icon_cvpcb_24, wxT( "icon_cvpcb_24_dark_24.png" ), 24, wxT( "dark" ) );
|
||||
aBitmapInfoCache[BITMAPS::icon_eeschema_24].emplace_back( BITMAPS::icon_eeschema_24, wxT( "icon_eeschema_24_dark_24.png" ), 24, wxT( "dark" ) );
|
||||
aBitmapInfoCache[BITMAPS::icon_footprint_browser].emplace_back( BITMAPS::icon_footprint_browser, wxT( "icon_footprint_browser_dark_24.png" ), 24, wxT( "dark" ) );
|
||||
aBitmapInfoCache[BITMAPS::icon_gerbview_24].emplace_back( BITMAPS::icon_gerbview_24, wxT( "icon_gerbview_24_dark_24.png" ), 24, wxT( "dark" ) );
|
||||
aBitmapInfoCache[BITMAPS::icon_kicad_24].emplace_back( BITMAPS::icon_kicad_24, wxT( "icon_kicad_24_dark_24.png" ), 24, wxT( "dark" ) );
|
||||
aBitmapInfoCache[BITMAPS::icon_libedit_24].emplace_back( BITMAPS::icon_libedit_24, wxT( "icon_libedit_24_dark_24.png" ), 24, wxT( "dark" ) );
|
||||
aBitmapInfoCache[BITMAPS::icon_modedit_24].emplace_back( BITMAPS::icon_modedit_24, wxT( "icon_modedit_24_dark_24.png" ), 24, wxT( "dark" ) );
|
||||
aBitmapInfoCache[BITMAPS::icon_pagelayout_editor_24].emplace_back( BITMAPS::icon_pagelayout_editor_24, wxT( "icon_pagelayout_editor_24_dark_24.png" ), 24, wxT( "dark" ) );
|
||||
aBitmapInfoCache[BITMAPS::icon_pcbcalculator_24].emplace_back( BITMAPS::icon_pcbcalculator_24, wxT( "icon_pcbcalculator_24_dark_24.png" ), 24, wxT( "dark" ) );
|
||||
aBitmapInfoCache[BITMAPS::icon_pcbnew_24].emplace_back( BITMAPS::icon_pcbnew_24, wxT( "icon_pcbnew_24_dark_24.png" ), 24, wxT( "dark" ) );
|
||||
aBitmapInfoCache[BITMAPS::icon_pcm_24].emplace_back( BITMAPS::icon_pcm_24, wxT( "icon_pcm_24_dark_24.png" ), 24, wxT( "dark" ) );
|
||||
aBitmapInfoCache[BITMAPS::import3d].emplace_back( BITMAPS::import3d, wxT( "import3d_dark_24.png" ), 24, wxT( "dark" ) );
|
||||
aBitmapInfoCache[BITMAPS::image].emplace_back( BITMAPS::image, wxT( "image_dark_24.png" ), 24, wxT( "dark" ) );
|
||||
@@ -1328,9 +1344,17 @@ void BuildBitmapInfo( std::unordered_map<BITMAPS, std::vector<BITMAP_INFO>>& aBi
|
||||
aBitmapInfoCache[BITMAPS::hole_to_hole_clearance].emplace_back( BITMAPS::hole_to_hole_clearance, wxT( "hole_to_hole_clearance_16.png" ), 16, wxT( "light" ) );
|
||||
aBitmapInfoCache[BITMAPS::hole_to_copper_clearance].emplace_back( BITMAPS::hole_to_copper_clearance, wxT( "hole_to_copper_clearance_16.png" ), 16, wxT( "light" ) );
|
||||
aBitmapInfoCache[BITMAPS::hv45mode].emplace_back( BITMAPS::hv45mode, wxT( "hv45mode_16.png" ), 16, wxT( "light" ) );
|
||||
aBitmapInfoCache[BITMAPS::icon_bitmap2component_24].emplace_back( BITMAPS::icon_bitmap2component_24, wxT( "icon_bitmap2component_24_16.png" ), 16, wxT( "light" ) );
|
||||
aBitmapInfoCache[BITMAPS::icon_cvpcb_24].emplace_back( BITMAPS::icon_cvpcb_24, wxT( "icon_cvpcb_24_16.png" ), 16, wxT( "light" ) );
|
||||
aBitmapInfoCache[BITMAPS::icon_eeschema_24].emplace_back( BITMAPS::icon_eeschema_24, wxT( "icon_eeschema_24_16.png" ), 16, wxT( "light" ) );
|
||||
aBitmapInfoCache[BITMAPS::icon_footprint_browser].emplace_back( BITMAPS::icon_footprint_browser, wxT( "icon_footprint_browser_16.png" ), 16, wxT( "light" ) );
|
||||
aBitmapInfoCache[BITMAPS::icon_gerbview_24].emplace_back( BITMAPS::icon_gerbview_24, wxT( "icon_gerbview_24_16.png" ), 16, wxT( "light" ) );
|
||||
aBitmapInfoCache[BITMAPS::icon_kicad_24].emplace_back( BITMAPS::icon_kicad_24, wxT( "icon_kicad_24_16.png" ), 16, wxT( "light" ) );
|
||||
aBitmapInfoCache[BITMAPS::icon_libedit_24].emplace_back( BITMAPS::icon_libedit_24, wxT( "icon_libedit_24_16.png" ), 16, wxT( "light" ) );
|
||||
aBitmapInfoCache[BITMAPS::icon_modedit_24].emplace_back( BITMAPS::icon_modedit_24, wxT( "icon_modedit_24_16.png" ), 16, wxT( "light" ) );
|
||||
aBitmapInfoCache[BITMAPS::icon_pagelayout_editor_24].emplace_back( BITMAPS::icon_pagelayout_editor_24, wxT( "icon_pagelayout_editor_24_16.png" ), 16, wxT( "light" ) );
|
||||
aBitmapInfoCache[BITMAPS::icon_pcbcalculator_24].emplace_back( BITMAPS::icon_pcbcalculator_24, wxT( "icon_pcbcalculator_24_16.png" ), 16, wxT( "light" ) );
|
||||
aBitmapInfoCache[BITMAPS::icon_pcbnew_24].emplace_back( BITMAPS::icon_pcbnew_24, wxT( "icon_pcbnew_24_16.png" ), 16, wxT( "light" ) );
|
||||
aBitmapInfoCache[BITMAPS::icon_pcm_24].emplace_back( BITMAPS::icon_pcm_24, wxT( "icon_pcm_24_16.png" ), 16, wxT( "light" ) );
|
||||
aBitmapInfoCache[BITMAPS::import3d].emplace_back( BITMAPS::import3d, wxT( "import3d_16.png" ), 16, wxT( "light" ) );
|
||||
aBitmapInfoCache[BITMAPS::image].emplace_back( BITMAPS::image, wxT( "image_16.png" ), 16, wxT( "light" ) );
|
||||
@@ -1730,9 +1754,17 @@ void BuildBitmapInfo( std::unordered_map<BITMAPS, std::vector<BITMAP_INFO>>& aBi
|
||||
aBitmapInfoCache[BITMAPS::hole_to_hole_clearance].emplace_back( BITMAPS::hole_to_hole_clearance, wxT( "hole_to_hole_clearance_dark_16.png" ), 16, wxT( "dark" ) );
|
||||
aBitmapInfoCache[BITMAPS::hole_to_copper_clearance].emplace_back( BITMAPS::hole_to_copper_clearance, wxT( "hole_to_copper_clearance_dark_16.png" ), 16, wxT( "dark" ) );
|
||||
aBitmapInfoCache[BITMAPS::hv45mode].emplace_back( BITMAPS::hv45mode, wxT( "hv45mode_dark_16.png" ), 16, wxT( "dark" ) );
|
||||
aBitmapInfoCache[BITMAPS::icon_bitmap2component_24].emplace_back( BITMAPS::icon_bitmap2component_24, wxT( "icon_bitmap2component_24_dark_16.png" ), 16, wxT( "dark" ) );
|
||||
aBitmapInfoCache[BITMAPS::icon_cvpcb_24].emplace_back( BITMAPS::icon_cvpcb_24, wxT( "icon_cvpcb_24_dark_16.png" ), 16, wxT( "dark" ) );
|
||||
aBitmapInfoCache[BITMAPS::icon_eeschema_24].emplace_back( BITMAPS::icon_eeschema_24, wxT( "icon_eeschema_24_dark_16.png" ), 16, wxT( "dark" ) );
|
||||
aBitmapInfoCache[BITMAPS::icon_footprint_browser].emplace_back( BITMAPS::icon_footprint_browser, wxT( "icon_footprint_browser_dark_16.png" ), 16, wxT( "dark" ) );
|
||||
aBitmapInfoCache[BITMAPS::icon_gerbview_24].emplace_back( BITMAPS::icon_gerbview_24, wxT( "icon_gerbview_24_dark_16.png" ), 16, wxT( "dark" ) );
|
||||
aBitmapInfoCache[BITMAPS::icon_kicad_24].emplace_back( BITMAPS::icon_kicad_24, wxT( "icon_kicad_24_dark_16.png" ), 16, wxT( "dark" ) );
|
||||
aBitmapInfoCache[BITMAPS::icon_libedit_24].emplace_back( BITMAPS::icon_libedit_24, wxT( "icon_libedit_24_dark_16.png" ), 16, wxT( "dark" ) );
|
||||
aBitmapInfoCache[BITMAPS::icon_modedit_24].emplace_back( BITMAPS::icon_modedit_24, wxT( "icon_modedit_24_dark_16.png" ), 16, wxT( "dark" ) );
|
||||
aBitmapInfoCache[BITMAPS::icon_pagelayout_editor_24].emplace_back( BITMAPS::icon_pagelayout_editor_24, wxT( "icon_pagelayout_editor_24_dark_16.png" ), 16, wxT( "dark" ) );
|
||||
aBitmapInfoCache[BITMAPS::icon_pcbcalculator_24].emplace_back( BITMAPS::icon_pcbcalculator_24, wxT( "icon_pcbcalculator_24_dark_16.png" ), 16, wxT( "dark" ) );
|
||||
aBitmapInfoCache[BITMAPS::icon_pcbnew_24].emplace_back( BITMAPS::icon_pcbnew_24, wxT( "icon_pcbnew_24_dark_16.png" ), 16, wxT( "dark" ) );
|
||||
aBitmapInfoCache[BITMAPS::icon_pcm_24].emplace_back( BITMAPS::icon_pcm_24, wxT( "icon_pcm_24_dark_16.png" ), 16, wxT( "dark" ) );
|
||||
aBitmapInfoCache[BITMAPS::import3d].emplace_back( BITMAPS::import3d, wxT( "import3d_dark_16.png" ), 16, wxT( "dark" ) );
|
||||
aBitmapInfoCache[BITMAPS::image].emplace_back( BITMAPS::image, wxT( "image_dark_16.png" ), 16, wxT( "dark" ) );
|
||||
@@ -2132,9 +2164,17 @@ void BuildBitmapInfo( std::unordered_map<BITMAPS, std::vector<BITMAP_INFO>>& aBi
|
||||
aBitmapInfoCache[BITMAPS::hole_to_hole_clearance].emplace_back( BITMAPS::hole_to_hole_clearance, wxT( "hole_to_hole_clearance_32.png" ), 32, wxT( "light" ) );
|
||||
aBitmapInfoCache[BITMAPS::hole_to_copper_clearance].emplace_back( BITMAPS::hole_to_copper_clearance, wxT( "hole_to_copper_clearance_32.png" ), 32, wxT( "light" ) );
|
||||
aBitmapInfoCache[BITMAPS::hv45mode].emplace_back( BITMAPS::hv45mode, wxT( "hv45mode_32.png" ), 32, wxT( "light" ) );
|
||||
aBitmapInfoCache[BITMAPS::icon_bitmap2component_24].emplace_back( BITMAPS::icon_bitmap2component_24, wxT( "icon_bitmap2component_24_32.png" ), 32, wxT( "light" ) );
|
||||
aBitmapInfoCache[BITMAPS::icon_cvpcb_24].emplace_back( BITMAPS::icon_cvpcb_24, wxT( "icon_cvpcb_24_32.png" ), 32, wxT( "light" ) );
|
||||
aBitmapInfoCache[BITMAPS::icon_eeschema_24].emplace_back( BITMAPS::icon_eeschema_24, wxT( "icon_eeschema_24_32.png" ), 32, wxT( "light" ) );
|
||||
aBitmapInfoCache[BITMAPS::icon_footprint_browser].emplace_back( BITMAPS::icon_footprint_browser, wxT( "icon_footprint_browser_32.png" ), 32, wxT( "light" ) );
|
||||
aBitmapInfoCache[BITMAPS::icon_gerbview_24].emplace_back( BITMAPS::icon_gerbview_24, wxT( "icon_gerbview_24_32.png" ), 32, wxT( "light" ) );
|
||||
aBitmapInfoCache[BITMAPS::icon_kicad_24].emplace_back( BITMAPS::icon_kicad_24, wxT( "icon_kicad_24_32.png" ), 32, wxT( "light" ) );
|
||||
aBitmapInfoCache[BITMAPS::icon_libedit_24].emplace_back( BITMAPS::icon_libedit_24, wxT( "icon_libedit_24_32.png" ), 32, wxT( "light" ) );
|
||||
aBitmapInfoCache[BITMAPS::icon_modedit_24].emplace_back( BITMAPS::icon_modedit_24, wxT( "icon_modedit_24_32.png" ), 32, wxT( "light" ) );
|
||||
aBitmapInfoCache[BITMAPS::icon_pagelayout_editor_24].emplace_back( BITMAPS::icon_pagelayout_editor_24, wxT( "icon_pagelayout_editor_24_32.png" ), 32, wxT( "light" ) );
|
||||
aBitmapInfoCache[BITMAPS::icon_pcbcalculator_24].emplace_back( BITMAPS::icon_pcbcalculator_24, wxT( "icon_pcbcalculator_24_32.png" ), 32, wxT( "light" ) );
|
||||
aBitmapInfoCache[BITMAPS::icon_pcbnew_24].emplace_back( BITMAPS::icon_pcbnew_24, wxT( "icon_pcbnew_24_32.png" ), 32, wxT( "light" ) );
|
||||
aBitmapInfoCache[BITMAPS::icon_pcm_24].emplace_back( BITMAPS::icon_pcm_24, wxT( "icon_pcm_24_32.png" ), 32, wxT( "light" ) );
|
||||
aBitmapInfoCache[BITMAPS::import3d].emplace_back( BITMAPS::import3d, wxT( "import3d_32.png" ), 32, wxT( "light" ) );
|
||||
aBitmapInfoCache[BITMAPS::image].emplace_back( BITMAPS::image, wxT( "image_32.png" ), 32, wxT( "light" ) );
|
||||
@@ -2534,9 +2574,17 @@ void BuildBitmapInfo( std::unordered_map<BITMAPS, std::vector<BITMAP_INFO>>& aBi
|
||||
aBitmapInfoCache[BITMAPS::hole_to_hole_clearance].emplace_back( BITMAPS::hole_to_hole_clearance, wxT( "hole_to_hole_clearance_dark_32.png" ), 32, wxT( "dark" ) );
|
||||
aBitmapInfoCache[BITMAPS::hole_to_copper_clearance].emplace_back( BITMAPS::hole_to_copper_clearance, wxT( "hole_to_copper_clearance_dark_32.png" ), 32, wxT( "dark" ) );
|
||||
aBitmapInfoCache[BITMAPS::hv45mode].emplace_back( BITMAPS::hv45mode, wxT( "hv45mode_dark_32.png" ), 32, wxT( "dark" ) );
|
||||
aBitmapInfoCache[BITMAPS::icon_bitmap2component_24].emplace_back( BITMAPS::icon_bitmap2component_24, wxT( "icon_bitmap2component_24_dark_32.png" ), 32, wxT( "dark" ) );
|
||||
aBitmapInfoCache[BITMAPS::icon_cvpcb_24].emplace_back( BITMAPS::icon_cvpcb_24, wxT( "icon_cvpcb_24_dark_32.png" ), 32, wxT( "dark" ) );
|
||||
aBitmapInfoCache[BITMAPS::icon_eeschema_24].emplace_back( BITMAPS::icon_eeschema_24, wxT( "icon_eeschema_24_dark_32.png" ), 32, wxT( "dark" ) );
|
||||
aBitmapInfoCache[BITMAPS::icon_footprint_browser].emplace_back( BITMAPS::icon_footprint_browser, wxT( "icon_footprint_browser_dark_32.png" ), 32, wxT( "dark" ) );
|
||||
aBitmapInfoCache[BITMAPS::icon_gerbview_24].emplace_back( BITMAPS::icon_gerbview_24, wxT( "icon_gerbview_24_dark_32.png" ), 32, wxT( "dark" ) );
|
||||
aBitmapInfoCache[BITMAPS::icon_kicad_24].emplace_back( BITMAPS::icon_kicad_24, wxT( "icon_kicad_24_dark_32.png" ), 32, wxT( "dark" ) );
|
||||
aBitmapInfoCache[BITMAPS::icon_libedit_24].emplace_back( BITMAPS::icon_libedit_24, wxT( "icon_libedit_24_dark_32.png" ), 32, wxT( "dark" ) );
|
||||
aBitmapInfoCache[BITMAPS::icon_modedit_24].emplace_back( BITMAPS::icon_modedit_24, wxT( "icon_modedit_24_dark_32.png" ), 32, wxT( "dark" ) );
|
||||
aBitmapInfoCache[BITMAPS::icon_pagelayout_editor_24].emplace_back( BITMAPS::icon_pagelayout_editor_24, wxT( "icon_pagelayout_editor_24_dark_32.png" ), 32, wxT( "dark" ) );
|
||||
aBitmapInfoCache[BITMAPS::icon_pcbcalculator_24].emplace_back( BITMAPS::icon_pcbcalculator_24, wxT( "icon_pcbcalculator_24_dark_32.png" ), 32, wxT( "dark" ) );
|
||||
aBitmapInfoCache[BITMAPS::icon_pcbnew_24].emplace_back( BITMAPS::icon_pcbnew_24, wxT( "icon_pcbnew_24_dark_32.png" ), 32, wxT( "dark" ) );
|
||||
aBitmapInfoCache[BITMAPS::icon_pcm_24].emplace_back( BITMAPS::icon_pcm_24, wxT( "icon_pcm_24_dark_32.png" ), 32, wxT( "dark" ) );
|
||||
aBitmapInfoCache[BITMAPS::import3d].emplace_back( BITMAPS::import3d, wxT( "import3d_dark_32.png" ), 32, wxT( "dark" ) );
|
||||
aBitmapInfoCache[BITMAPS::image].emplace_back( BITMAPS::image, wxT( "image_dark_32.png" ), 32, wxT( "dark" ) );
|
||||
@@ -2936,9 +2984,17 @@ void BuildBitmapInfo( std::unordered_map<BITMAPS, std::vector<BITMAP_INFO>>& aBi
|
||||
aBitmapInfoCache[BITMAPS::hole_to_hole_clearance].emplace_back( BITMAPS::hole_to_hole_clearance, wxT( "hole_to_hole_clearance_48.png" ), 48, wxT( "light" ) );
|
||||
aBitmapInfoCache[BITMAPS::hole_to_copper_clearance].emplace_back( BITMAPS::hole_to_copper_clearance, wxT( "hole_to_copper_clearance_48.png" ), 48, wxT( "light" ) );
|
||||
aBitmapInfoCache[BITMAPS::hv45mode].emplace_back( BITMAPS::hv45mode, wxT( "hv45mode_48.png" ), 48, wxT( "light" ) );
|
||||
aBitmapInfoCache[BITMAPS::icon_bitmap2component_24].emplace_back( BITMAPS::icon_bitmap2component_24, wxT( "icon_bitmap2component_24_48.png" ), 48, wxT( "light" ) );
|
||||
aBitmapInfoCache[BITMAPS::icon_cvpcb_24].emplace_back( BITMAPS::icon_cvpcb_24, wxT( "icon_cvpcb_24_48.png" ), 48, wxT( "light" ) );
|
||||
aBitmapInfoCache[BITMAPS::icon_eeschema_24].emplace_back( BITMAPS::icon_eeschema_24, wxT( "icon_eeschema_24_48.png" ), 48, wxT( "light" ) );
|
||||
aBitmapInfoCache[BITMAPS::icon_footprint_browser].emplace_back( BITMAPS::icon_footprint_browser, wxT( "icon_footprint_browser_48.png" ), 48, wxT( "light" ) );
|
||||
aBitmapInfoCache[BITMAPS::icon_gerbview_24].emplace_back( BITMAPS::icon_gerbview_24, wxT( "icon_gerbview_24_48.png" ), 48, wxT( "light" ) );
|
||||
aBitmapInfoCache[BITMAPS::icon_kicad_24].emplace_back( BITMAPS::icon_kicad_24, wxT( "icon_kicad_24_48.png" ), 48, wxT( "light" ) );
|
||||
aBitmapInfoCache[BITMAPS::icon_libedit_24].emplace_back( BITMAPS::icon_libedit_24, wxT( "icon_libedit_24_48.png" ), 48, wxT( "light" ) );
|
||||
aBitmapInfoCache[BITMAPS::icon_modedit_24].emplace_back( BITMAPS::icon_modedit_24, wxT( "icon_modedit_24_48.png" ), 48, wxT( "light" ) );
|
||||
aBitmapInfoCache[BITMAPS::icon_pagelayout_editor_24].emplace_back( BITMAPS::icon_pagelayout_editor_24, wxT( "icon_pagelayout_editor_24_48.png" ), 48, wxT( "light" ) );
|
||||
aBitmapInfoCache[BITMAPS::icon_pcbcalculator_24].emplace_back( BITMAPS::icon_pcbcalculator_24, wxT( "icon_pcbcalculator_24_48.png" ), 48, wxT( "light" ) );
|
||||
aBitmapInfoCache[BITMAPS::icon_pcbnew_24].emplace_back( BITMAPS::icon_pcbnew_24, wxT( "icon_pcbnew_24_48.png" ), 48, wxT( "light" ) );
|
||||
aBitmapInfoCache[BITMAPS::icon_pcm_24].emplace_back( BITMAPS::icon_pcm_24, wxT( "icon_pcm_24_48.png" ), 48, wxT( "light" ) );
|
||||
aBitmapInfoCache[BITMAPS::import3d].emplace_back( BITMAPS::import3d, wxT( "import3d_48.png" ), 48, wxT( "light" ) );
|
||||
aBitmapInfoCache[BITMAPS::image].emplace_back( BITMAPS::image, wxT( "image_48.png" ), 48, wxT( "light" ) );
|
||||
@@ -3338,9 +3394,17 @@ void BuildBitmapInfo( std::unordered_map<BITMAPS, std::vector<BITMAP_INFO>>& aBi
|
||||
aBitmapInfoCache[BITMAPS::hole_to_hole_clearance].emplace_back( BITMAPS::hole_to_hole_clearance, wxT( "hole_to_hole_clearance_dark_48.png" ), 48, wxT( "dark" ) );
|
||||
aBitmapInfoCache[BITMAPS::hole_to_copper_clearance].emplace_back( BITMAPS::hole_to_copper_clearance, wxT( "hole_to_copper_clearance_dark_48.png" ), 48, wxT( "dark" ) );
|
||||
aBitmapInfoCache[BITMAPS::hv45mode].emplace_back( BITMAPS::hv45mode, wxT( "hv45mode_dark_48.png" ), 48, wxT( "dark" ) );
|
||||
aBitmapInfoCache[BITMAPS::icon_bitmap2component_24].emplace_back( BITMAPS::icon_bitmap2component_24, wxT( "icon_bitmap2component_24_dark_48.png" ), 48, wxT( "dark" ) );
|
||||
aBitmapInfoCache[BITMAPS::icon_cvpcb_24].emplace_back( BITMAPS::icon_cvpcb_24, wxT( "icon_cvpcb_24_dark_48.png" ), 48, wxT( "dark" ) );
|
||||
aBitmapInfoCache[BITMAPS::icon_eeschema_24].emplace_back( BITMAPS::icon_eeschema_24, wxT( "icon_eeschema_24_dark_48.png" ), 48, wxT( "dark" ) );
|
||||
aBitmapInfoCache[BITMAPS::icon_footprint_browser].emplace_back( BITMAPS::icon_footprint_browser, wxT( "icon_footprint_browser_dark_48.png" ), 48, wxT( "dark" ) );
|
||||
aBitmapInfoCache[BITMAPS::icon_gerbview_24].emplace_back( BITMAPS::icon_gerbview_24, wxT( "icon_gerbview_24_dark_48.png" ), 48, wxT( "dark" ) );
|
||||
aBitmapInfoCache[BITMAPS::icon_kicad_24].emplace_back( BITMAPS::icon_kicad_24, wxT( "icon_kicad_24_dark_48.png" ), 48, wxT( "dark" ) );
|
||||
aBitmapInfoCache[BITMAPS::icon_libedit_24].emplace_back( BITMAPS::icon_libedit_24, wxT( "icon_libedit_24_dark_48.png" ), 48, wxT( "dark" ) );
|
||||
aBitmapInfoCache[BITMAPS::icon_modedit_24].emplace_back( BITMAPS::icon_modedit_24, wxT( "icon_modedit_24_dark_48.png" ), 48, wxT( "dark" ) );
|
||||
aBitmapInfoCache[BITMAPS::icon_pagelayout_editor_24].emplace_back( BITMAPS::icon_pagelayout_editor_24, wxT( "icon_pagelayout_editor_24_dark_48.png" ), 48, wxT( "dark" ) );
|
||||
aBitmapInfoCache[BITMAPS::icon_pcbcalculator_24].emplace_back( BITMAPS::icon_pcbcalculator_24, wxT( "icon_pcbcalculator_24_dark_48.png" ), 48, wxT( "dark" ) );
|
||||
aBitmapInfoCache[BITMAPS::icon_pcbnew_24].emplace_back( BITMAPS::icon_pcbnew_24, wxT( "icon_pcbnew_24_dark_48.png" ), 48, wxT( "dark" ) );
|
||||
aBitmapInfoCache[BITMAPS::icon_pcm_24].emplace_back( BITMAPS::icon_pcm_24, wxT( "icon_pcm_24_dark_48.png" ), 48, wxT( "dark" ) );
|
||||
aBitmapInfoCache[BITMAPS::import3d].emplace_back( BITMAPS::import3d, wxT( "import3d_dark_48.png" ), 48, wxT( "dark" ) );
|
||||
aBitmapInfoCache[BITMAPS::image].emplace_back( BITMAPS::image, wxT( "image_dark_48.png" ), 48, wxT( "dark" ) );
|
||||
@@ -3740,9 +3804,17 @@ void BuildBitmapInfo( std::unordered_map<BITMAPS, std::vector<BITMAP_INFO>>& aBi
|
||||
aBitmapInfoCache[BITMAPS::hole_to_hole_clearance].emplace_back( BITMAPS::hole_to_hole_clearance, wxT( "hole_to_hole_clearance_64.png" ), 64, wxT( "light" ) );
|
||||
aBitmapInfoCache[BITMAPS::hole_to_copper_clearance].emplace_back( BITMAPS::hole_to_copper_clearance, wxT( "hole_to_copper_clearance_64.png" ), 64, wxT( "light" ) );
|
||||
aBitmapInfoCache[BITMAPS::hv45mode].emplace_back( BITMAPS::hv45mode, wxT( "hv45mode_64.png" ), 64, wxT( "light" ) );
|
||||
aBitmapInfoCache[BITMAPS::icon_bitmap2component_24].emplace_back( BITMAPS::icon_bitmap2component_24, wxT( "icon_bitmap2component_24_64.png" ), 64, wxT( "light" ) );
|
||||
aBitmapInfoCache[BITMAPS::icon_cvpcb_24].emplace_back( BITMAPS::icon_cvpcb_24, wxT( "icon_cvpcb_24_64.png" ), 64, wxT( "light" ) );
|
||||
aBitmapInfoCache[BITMAPS::icon_eeschema_24].emplace_back( BITMAPS::icon_eeschema_24, wxT( "icon_eeschema_24_64.png" ), 64, wxT( "light" ) );
|
||||
aBitmapInfoCache[BITMAPS::icon_footprint_browser].emplace_back( BITMAPS::icon_footprint_browser, wxT( "icon_footprint_browser_64.png" ), 64, wxT( "light" ) );
|
||||
aBitmapInfoCache[BITMAPS::icon_gerbview_24].emplace_back( BITMAPS::icon_gerbview_24, wxT( "icon_gerbview_24_64.png" ), 64, wxT( "light" ) );
|
||||
aBitmapInfoCache[BITMAPS::icon_kicad_24].emplace_back( BITMAPS::icon_kicad_24, wxT( "icon_kicad_24_64.png" ), 64, wxT( "light" ) );
|
||||
aBitmapInfoCache[BITMAPS::icon_libedit_24].emplace_back( BITMAPS::icon_libedit_24, wxT( "icon_libedit_24_64.png" ), 64, wxT( "light" ) );
|
||||
aBitmapInfoCache[BITMAPS::icon_modedit_24].emplace_back( BITMAPS::icon_modedit_24, wxT( "icon_modedit_24_64.png" ), 64, wxT( "light" ) );
|
||||
aBitmapInfoCache[BITMAPS::icon_pagelayout_editor_24].emplace_back( BITMAPS::icon_pagelayout_editor_24, wxT( "icon_pagelayout_editor_24_64.png" ), 64, wxT( "light" ) );
|
||||
aBitmapInfoCache[BITMAPS::icon_pcbcalculator_24].emplace_back( BITMAPS::icon_pcbcalculator_24, wxT( "icon_pcbcalculator_24_64.png" ), 64, wxT( "light" ) );
|
||||
aBitmapInfoCache[BITMAPS::icon_pcbnew_24].emplace_back( BITMAPS::icon_pcbnew_24, wxT( "icon_pcbnew_24_64.png" ), 64, wxT( "light" ) );
|
||||
aBitmapInfoCache[BITMAPS::icon_pcm_24].emplace_back( BITMAPS::icon_pcm_24, wxT( "icon_pcm_24_64.png" ), 64, wxT( "light" ) );
|
||||
aBitmapInfoCache[BITMAPS::import3d].emplace_back( BITMAPS::import3d, wxT( "import3d_64.png" ), 64, wxT( "light" ) );
|
||||
aBitmapInfoCache[BITMAPS::image].emplace_back( BITMAPS::image, wxT( "image_64.png" ), 64, wxT( "light" ) );
|
||||
@@ -4142,9 +4214,17 @@ void BuildBitmapInfo( std::unordered_map<BITMAPS, std::vector<BITMAP_INFO>>& aBi
|
||||
aBitmapInfoCache[BITMAPS::hole_to_hole_clearance].emplace_back( BITMAPS::hole_to_hole_clearance, wxT( "hole_to_hole_clearance_dark_64.png" ), 64, wxT( "dark" ) );
|
||||
aBitmapInfoCache[BITMAPS::hole_to_copper_clearance].emplace_back( BITMAPS::hole_to_copper_clearance, wxT( "hole_to_copper_clearance_dark_64.png" ), 64, wxT( "dark" ) );
|
||||
aBitmapInfoCache[BITMAPS::hv45mode].emplace_back( BITMAPS::hv45mode, wxT( "hv45mode_dark_64.png" ), 64, wxT( "dark" ) );
|
||||
aBitmapInfoCache[BITMAPS::icon_bitmap2component_24].emplace_back( BITMAPS::icon_bitmap2component_24, wxT( "icon_bitmap2component_24_dark_64.png" ), 64, wxT( "dark" ) );
|
||||
aBitmapInfoCache[BITMAPS::icon_cvpcb_24].emplace_back( BITMAPS::icon_cvpcb_24, wxT( "icon_cvpcb_24_dark_64.png" ), 64, wxT( "dark" ) );
|
||||
aBitmapInfoCache[BITMAPS::icon_eeschema_24].emplace_back( BITMAPS::icon_eeschema_24, wxT( "icon_eeschema_24_dark_64.png" ), 64, wxT( "dark" ) );
|
||||
aBitmapInfoCache[BITMAPS::icon_footprint_browser].emplace_back( BITMAPS::icon_footprint_browser, wxT( "icon_footprint_browser_dark_64.png" ), 64, wxT( "dark" ) );
|
||||
aBitmapInfoCache[BITMAPS::icon_gerbview_24].emplace_back( BITMAPS::icon_gerbview_24, wxT( "icon_gerbview_24_dark_64.png" ), 64, wxT( "dark" ) );
|
||||
aBitmapInfoCache[BITMAPS::icon_kicad_24].emplace_back( BITMAPS::icon_kicad_24, wxT( "icon_kicad_24_dark_64.png" ), 64, wxT( "dark" ) );
|
||||
aBitmapInfoCache[BITMAPS::icon_libedit_24].emplace_back( BITMAPS::icon_libedit_24, wxT( "icon_libedit_24_dark_64.png" ), 64, wxT( "dark" ) );
|
||||
aBitmapInfoCache[BITMAPS::icon_modedit_24].emplace_back( BITMAPS::icon_modedit_24, wxT( "icon_modedit_24_dark_64.png" ), 64, wxT( "dark" ) );
|
||||
aBitmapInfoCache[BITMAPS::icon_pagelayout_editor_24].emplace_back( BITMAPS::icon_pagelayout_editor_24, wxT( "icon_pagelayout_editor_24_dark_64.png" ), 64, wxT( "dark" ) );
|
||||
aBitmapInfoCache[BITMAPS::icon_pcbcalculator_24].emplace_back( BITMAPS::icon_pcbcalculator_24, wxT( "icon_pcbcalculator_24_dark_64.png" ), 64, wxT( "dark" ) );
|
||||
aBitmapInfoCache[BITMAPS::icon_pcbnew_24].emplace_back( BITMAPS::icon_pcbnew_24, wxT( "icon_pcbnew_24_dark_64.png" ), 64, wxT( "dark" ) );
|
||||
aBitmapInfoCache[BITMAPS::icon_pcm_24].emplace_back( BITMAPS::icon_pcm_24, wxT( "icon_pcm_24_dark_64.png" ), 64, wxT( "dark" ) );
|
||||
aBitmapInfoCache[BITMAPS::import3d].emplace_back( BITMAPS::import3d, wxT( "import3d_dark_64.png" ), 64, wxT( "dark" ) );
|
||||
aBitmapInfoCache[BITMAPS::image].emplace_back( BITMAPS::image, wxT( "image_dark_64.png" ), 64, wxT( "dark" ) );
|
||||
@@ -4394,24 +4474,6 @@ void BuildBitmapInfo( std::unordered_map<BITMAPS, std::vector<BITMAP_INFO>>& aBi
|
||||
aBitmapInfoCache[BITMAPS::icon_pagelayout_editor_32].emplace_back( BITMAPS::icon_pagelayout_editor_32, wxT( "icon_pagelayout_editor_32_dark_32.png" ), 32, wxT( "dark" ) );
|
||||
aBitmapInfoCache[BITMAPS::icon_pcbcalculator_32].emplace_back( BITMAPS::icon_pcbcalculator_32, wxT( "icon_pcbcalculator_32_dark_32.png" ), 32, wxT( "dark" ) );
|
||||
aBitmapInfoCache[BITMAPS::icon_pcbnew_32].emplace_back( BITMAPS::icon_pcbnew_32, wxT( "icon_pcbnew_32_dark_32.png" ), 32, wxT( "dark" ) );
|
||||
aBitmapInfoCache[BITMAPS::icon_bitmap2component_24].emplace_back( BITMAPS::icon_bitmap2component_24, wxT( "icon_bitmap2component_24_24.png" ), 24, wxT( "light" ) );
|
||||
aBitmapInfoCache[BITMAPS::icon_eeschema_24].emplace_back( BITMAPS::icon_eeschema_24, wxT( "icon_eeschema_24_24.png" ), 24, wxT( "light" ) );
|
||||
aBitmapInfoCache[BITMAPS::icon_gerbview_24].emplace_back( BITMAPS::icon_gerbview_24, wxT( "icon_gerbview_24_24.png" ), 24, wxT( "light" ) );
|
||||
aBitmapInfoCache[BITMAPS::icon_kicad_24].emplace_back( BITMAPS::icon_kicad_24, wxT( "icon_kicad_24_24.png" ), 24, wxT( "light" ) );
|
||||
aBitmapInfoCache[BITMAPS::icon_libedit_24].emplace_back( BITMAPS::icon_libedit_24, wxT( "icon_libedit_24_24.png" ), 24, wxT( "light" ) );
|
||||
aBitmapInfoCache[BITMAPS::icon_modedit_24].emplace_back( BITMAPS::icon_modedit_24, wxT( "icon_modedit_24_24.png" ), 24, wxT( "light" ) );
|
||||
aBitmapInfoCache[BITMAPS::icon_pagelayout_editor_24].emplace_back( BITMAPS::icon_pagelayout_editor_24, wxT( "icon_pagelayout_editor_24_24.png" ), 24, wxT( "light" ) );
|
||||
aBitmapInfoCache[BITMAPS::icon_pcbcalculator_24].emplace_back( BITMAPS::icon_pcbcalculator_24, wxT( "icon_pcbcalculator_24_24.png" ), 24, wxT( "light" ) );
|
||||
aBitmapInfoCache[BITMAPS::icon_pcbnew_24].emplace_back( BITMAPS::icon_pcbnew_24, wxT( "icon_pcbnew_24_24.png" ), 24, wxT( "light" ) );
|
||||
aBitmapInfoCache[BITMAPS::icon_bitmap2component_24].emplace_back( BITMAPS::icon_bitmap2component_24, wxT( "icon_bitmap2component_24_dark_24.png" ), 24, wxT( "dark" ) );
|
||||
aBitmapInfoCache[BITMAPS::icon_eeschema_24].emplace_back( BITMAPS::icon_eeschema_24, wxT( "icon_eeschema_24_dark_24.png" ), 24, wxT( "dark" ) );
|
||||
aBitmapInfoCache[BITMAPS::icon_gerbview_24].emplace_back( BITMAPS::icon_gerbview_24, wxT( "icon_gerbview_24_dark_24.png" ), 24, wxT( "dark" ) );
|
||||
aBitmapInfoCache[BITMAPS::icon_kicad_24].emplace_back( BITMAPS::icon_kicad_24, wxT( "icon_kicad_24_dark_24.png" ), 24, wxT( "dark" ) );
|
||||
aBitmapInfoCache[BITMAPS::icon_libedit_24].emplace_back( BITMAPS::icon_libedit_24, wxT( "icon_libedit_24_dark_24.png" ), 24, wxT( "dark" ) );
|
||||
aBitmapInfoCache[BITMAPS::icon_modedit_24].emplace_back( BITMAPS::icon_modedit_24, wxT( "icon_modedit_24_dark_24.png" ), 24, wxT( "dark" ) );
|
||||
aBitmapInfoCache[BITMAPS::icon_pagelayout_editor_24].emplace_back( BITMAPS::icon_pagelayout_editor_24, wxT( "icon_pagelayout_editor_24_dark_24.png" ), 24, wxT( "dark" ) );
|
||||
aBitmapInfoCache[BITMAPS::icon_pcbcalculator_24].emplace_back( BITMAPS::icon_pcbcalculator_24, wxT( "icon_pcbcalculator_24_dark_24.png" ), 24, wxT( "dark" ) );
|
||||
aBitmapInfoCache[BITMAPS::icon_pcbnew_24].emplace_back( BITMAPS::icon_pcbnew_24, wxT( "icon_pcbnew_24_dark_24.png" ), 24, wxT( "dark" ) );
|
||||
aBitmapInfoCache[BITMAPS::icon_cvpcb].emplace_back( BITMAPS::icon_cvpcb, wxT( "icon_cvpcb_64.png" ), 64, wxT( "light" ) );
|
||||
aBitmapInfoCache[BITMAPS::icon_eeschema].emplace_back( BITMAPS::icon_eeschema, wxT( "icon_eeschema_64.png" ), 64, wxT( "light" ) );
|
||||
aBitmapInfoCache[BITMAPS::icon_gerbview].emplace_back( BITMAPS::icon_gerbview, wxT( "icon_gerbview_64.png" ), 64, wxT( "light" ) );
|
||||
|
||||
+5
-2
@@ -147,7 +147,8 @@ wxString KIwxExpandEnvVars( const wxString& str, const PROJECT* aProject, std::s
|
||||
wxString strResult;
|
||||
strResult.Alloc( strlen ); // best guess (improves performance)
|
||||
|
||||
auto getVersionedEnvVar = []( const wxString& aMatch, wxString& aResult ) -> bool
|
||||
auto getVersionedEnvVar =
|
||||
[]( const wxString& aMatch, wxString& aResult ) -> bool
|
||||
{
|
||||
for ( const wxString& var : ENV_VAR::GetPredefinedEnvVars() )
|
||||
{
|
||||
@@ -180,7 +181,9 @@ wxString KIwxExpandEnvVars( const wxString& str, const PROJECT* aProject, std::s
|
||||
Bracket bracket;
|
||||
#ifdef __WINDOWS__
|
||||
if( str_n == wxT( '%' ) )
|
||||
bracket = Bracket_Windows;
|
||||
{
|
||||
bracket = Bracket_Windows;
|
||||
}
|
||||
else
|
||||
#endif // __WINDOWS__
|
||||
if( n == strlen - 1 )
|
||||
|
||||
@@ -106,6 +106,9 @@ DATABASE_LIB_SETTINGS::DATABASE_LIB_SETTINGS( const std::string& aFilename ) :
|
||||
|
||||
table.properties.exclude_from_board =
|
||||
fetchOrDefault<std::string>( pj, "exclude_from_board" );
|
||||
|
||||
table.properties.exclude_from_sim =
|
||||
fetchOrDefault<std::string>( pj, "exclude_from_sim" );
|
||||
}
|
||||
|
||||
if( entry.contains( "fields" ) && entry["fields"].is_array() )
|
||||
|
||||
@@ -34,6 +34,7 @@
|
||||
#include <pgm_base.h>
|
||||
#include <widgets/wx_grid.h>
|
||||
#include <widgets/grid_text_button_helpers.h>
|
||||
#include <widgets/grid_text_helpers.h>
|
||||
#include <widgets/std_bitmap_button.h>
|
||||
|
||||
#include <algorithm>
|
||||
|
||||
@@ -49,7 +49,7 @@ DIALOG_CONFIGURE_PATHS_BASE::DIALOG_CONFIGURE_PATHS_BASE( wxWindow* parent, wxWi
|
||||
// Label Appearance
|
||||
|
||||
// Cell Defaults
|
||||
m_EnvVars->SetDefaultCellAlignment( wxALIGN_LEFT, wxALIGN_TOP );
|
||||
m_EnvVars->SetDefaultCellAlignment( wxALIGN_LEFT, wxALIGN_CENTER );
|
||||
m_EnvVars->SetMinSize( wxSize( 604,170 ) );
|
||||
|
||||
sbEnvVars->Add( m_EnvVars, 1, wxALL|wxEXPAND, 5 );
|
||||
@@ -70,7 +70,7 @@ DIALOG_CONFIGURE_PATHS_BASE::DIALOG_CONFIGURE_PATHS_BASE( wxWindow* parent, wxWi
|
||||
sbEnvVars->Add( bSizerEnvVarBtns, 0, wxEXPAND, 5 );
|
||||
|
||||
|
||||
bSizerMain->Add( sbEnvVars, 1, wxEXPAND|wxALL, 5 );
|
||||
bSizerMain->Add( sbEnvVars, 1, wxALL|wxEXPAND, 5 );
|
||||
|
||||
m_sdbSizer = new wxStdDialogButtonSizer();
|
||||
m_sdbSizerOK = new wxButton( this, wxID_OK );
|
||||
|
||||
@@ -62,109 +62,23 @@
|
||||
<property name="name">bSizerMain</property>
|
||||
<property name="orient">wxVERTICAL</property>
|
||||
<property name="permission">none</property>
|
||||
<object class="sizeritem" expanded="1">
|
||||
<property name="border">10</property>
|
||||
<property name="flag">wxEXPAND|wxTOP</property>
|
||||
<property name="proportion">1</property>
|
||||
<object class="wxGrid" expanded="1">
|
||||
<property name="BottomDockable">1</property>
|
||||
<property name="LeftDockable">1</property>
|
||||
<property name="RightDockable">1</property>
|
||||
<property name="TopDockable">1</property>
|
||||
<property name="aui_layer"></property>
|
||||
<property name="aui_name"></property>
|
||||
<property name="aui_position"></property>
|
||||
<property name="aui_row"></property>
|
||||
<property name="autosize_cols">0</property>
|
||||
<property name="autosize_rows">0</property>
|
||||
<property name="best_size"></property>
|
||||
<property name="bg"></property>
|
||||
<property name="caption"></property>
|
||||
<property name="caption_visible">1</property>
|
||||
<property name="cell_bg"></property>
|
||||
<property name="cell_font"></property>
|
||||
<property name="cell_horiz_alignment">wxALIGN_LEFT</property>
|
||||
<property name="cell_text"></property>
|
||||
<property name="cell_vert_alignment">wxALIGN_CENTER</property>
|
||||
<property name="center_pane">0</property>
|
||||
<property name="close_button">1</property>
|
||||
<property name="col_label_horiz_alignment">wxALIGN_CENTER</property>
|
||||
<property name="col_label_size">wxGRID_AUTOSIZE</property>
|
||||
<property name="col_label_values">"Environment Variables" "Path" ""</property>
|
||||
<property name="col_label_vert_alignment">wxALIGN_CENTER</property>
|
||||
<property name="cols">2</property>
|
||||
<property name="column_sizes">150,454</property>
|
||||
<property name="context_help"></property>
|
||||
<property name="context_menu">1</property>
|
||||
<property name="default_pane">0</property>
|
||||
<property name="dock">Dock</property>
|
||||
<property name="dock_fixed">0</property>
|
||||
<property name="docking">Left</property>
|
||||
<property name="drag_col_move">0</property>
|
||||
<property name="drag_col_size">1</property>
|
||||
<property name="drag_grid_size">0</property>
|
||||
<property name="drag_row_size">1</property>
|
||||
<property name="editing">1</property>
|
||||
<property name="enabled">1</property>
|
||||
<property name="fg"></property>
|
||||
<property name="floatable">1</property>
|
||||
<property name="font"></property>
|
||||
<property name="grid_line_color"></property>
|
||||
<property name="grid_lines">1</property>
|
||||
<property name="gripper">0</property>
|
||||
<property name="hidden">0</property>
|
||||
<property name="id">wxID_ANY</property>
|
||||
<property name="label_bg"></property>
|
||||
<property name="label_font"></property>
|
||||
<property name="label_text"></property>
|
||||
<property name="margin_height">0</property>
|
||||
<property name="margin_width">0</property>
|
||||
<property name="max_size"></property>
|
||||
<property name="maximize_button">0</property>
|
||||
<property name="maximum_size"></property>
|
||||
<property name="min_size"></property>
|
||||
<property name="minimize_button">0</property>
|
||||
<property name="minimum_size">604,170</property>
|
||||
<property name="moveable">1</property>
|
||||
<property name="name">m_EnvVars</property>
|
||||
<property name="pane_border">1</property>
|
||||
<property name="pane_position"></property>
|
||||
<property name="pane_size"></property>
|
||||
<property name="permission">protected</property>
|
||||
<property name="pin_button">1</property>
|
||||
<property name="pos"></property>
|
||||
<property name="resize">Resizable</property>
|
||||
<property name="row_label_horiz_alignment">wxALIGN_CENTER</property>
|
||||
<property name="row_label_size">0</property>
|
||||
<property name="row_label_values"></property>
|
||||
<property name="row_label_vert_alignment">wxALIGN_CENTER</property>
|
||||
<property name="row_sizes"></property>
|
||||
<property name="rows">1</property>
|
||||
<property name="show">1</property>
|
||||
<property name="size"></property>
|
||||
<property name="subclass">WX_GRID; widgets/wx_grid.h; forward_declare</property>
|
||||
<property name="toolbar_pane">0</property>
|
||||
<property name="tooltip"></property>
|
||||
<property name="window_extra_style"></property>
|
||||
<property name="window_name"></property>
|
||||
<property name="window_style"></property>
|
||||
<event name="OnSize">OnGridSize</event>
|
||||
</object>
|
||||
</object>
|
||||
<object class="sizeritem" expanded="1">
|
||||
<property name="border">5</property>
|
||||
<property name="flag">wxEXPAND|wxTOP</property>
|
||||
<property name="proportion">0</property>
|
||||
<object class="wxBoxSizer" expanded="1">
|
||||
<property name="flag">wxALL|wxEXPAND</property>
|
||||
<property name="proportion">1</property>
|
||||
<object class="wxStaticBoxSizer" expanded="1">
|
||||
<property name="id">wxID_ANY</property>
|
||||
<property name="label">Environment Variables</property>
|
||||
<property name="minimum_size"></property>
|
||||
<property name="name">bSizerEnvVarBtns</property>
|
||||
<property name="orient">wxHORIZONTAL</property>
|
||||
<property name="name">sbEnvVars</property>
|
||||
<property name="orient">wxVERTICAL</property>
|
||||
<property name="parent">1</property>
|
||||
<property name="permission">none</property>
|
||||
<object class="sizeritem" expanded="1">
|
||||
<property name="border">5</property>
|
||||
<property name="flag">wxBOTTOM|wxLEFT</property>
|
||||
<property name="proportion">0</property>
|
||||
<object class="wxBitmapButton" expanded="1">
|
||||
<property name="flag">wxALL|wxEXPAND</property>
|
||||
<property name="proportion">1</property>
|
||||
<object class="wxGrid" expanded="1">
|
||||
<property name="BottomDockable">1</property>
|
||||
<property name="LeftDockable">1</property>
|
||||
<property name="RightDockable">1</property>
|
||||
@@ -173,209 +87,251 @@
|
||||
<property name="aui_name"></property>
|
||||
<property name="aui_position"></property>
|
||||
<property name="aui_row"></property>
|
||||
<property name="auth_needed">0</property>
|
||||
<property name="autosize_cols">0</property>
|
||||
<property name="autosize_rows">0</property>
|
||||
<property name="best_size"></property>
|
||||
<property name="bg"></property>
|
||||
<property name="bitmap"></property>
|
||||
<property name="caption"></property>
|
||||
<property name="caption_visible">1</property>
|
||||
<property name="cell_bg"></property>
|
||||
<property name="cell_font"></property>
|
||||
<property name="cell_horiz_alignment">wxALIGN_LEFT</property>
|
||||
<property name="cell_text"></property>
|
||||
<property name="cell_vert_alignment">wxALIGN_CENTER</property>
|
||||
<property name="center_pane">0</property>
|
||||
<property name="close_button">1</property>
|
||||
<property name="col_label_horiz_alignment">wxALIGN_CENTER</property>
|
||||
<property name="col_label_size">wxGRID_AUTOSIZE</property>
|
||||
<property name="col_label_values">"Name" "Path"</property>
|
||||
<property name="col_label_vert_alignment">wxALIGN_CENTER</property>
|
||||
<property name="cols">2</property>
|
||||
<property name="column_sizes">150,454</property>
|
||||
<property name="context_help"></property>
|
||||
<property name="context_menu">1</property>
|
||||
<property name="current"></property>
|
||||
<property name="default">0</property>
|
||||
<property name="default_pane">0</property>
|
||||
<property name="disabled"></property>
|
||||
<property name="dock">Dock</property>
|
||||
<property name="dock_fixed">0</property>
|
||||
<property name="docking">Left</property>
|
||||
<property name="drag_col_move">0</property>
|
||||
<property name="drag_col_size">1</property>
|
||||
<property name="drag_grid_size">0</property>
|
||||
<property name="drag_row_size">1</property>
|
||||
<property name="editing">1</property>
|
||||
<property name="enabled">1</property>
|
||||
<property name="fg"></property>
|
||||
<property name="floatable">1</property>
|
||||
<property name="focus"></property>
|
||||
<property name="font"></property>
|
||||
<property name="grid_line_color"></property>
|
||||
<property name="grid_lines">1</property>
|
||||
<property name="gripper">0</property>
|
||||
<property name="hidden">0</property>
|
||||
<property name="id">wxID_ANY</property>
|
||||
<property name="label">Add Environment Variable</property>
|
||||
<property name="margins"></property>
|
||||
<property name="markup">0</property>
|
||||
<property name="label_bg"></property>
|
||||
<property name="label_font"></property>
|
||||
<property name="label_text"></property>
|
||||
<property name="margin_height">0</property>
|
||||
<property name="margin_width">0</property>
|
||||
<property name="max_size"></property>
|
||||
<property name="maximize_button">0</property>
|
||||
<property name="maximum_size"></property>
|
||||
<property name="min_size"></property>
|
||||
<property name="minimize_button">0</property>
|
||||
<property name="minimum_size">-1,-1</property>
|
||||
<property name="minimum_size">604,170</property>
|
||||
<property name="moveable">1</property>
|
||||
<property name="name">m_btnAddEnvVar</property>
|
||||
<property name="name">m_EnvVars</property>
|
||||
<property name="pane_border">1</property>
|
||||
<property name="pane_position"></property>
|
||||
<property name="pane_size"></property>
|
||||
<property name="permission">protected</property>
|
||||
<property name="pin_button">1</property>
|
||||
<property name="pos"></property>
|
||||
<property name="position"></property>
|
||||
<property name="pressed"></property>
|
||||
<property name="resize">Resizable</property>
|
||||
<property name="row_label_horiz_alignment">wxALIGN_CENTER</property>
|
||||
<property name="row_label_size">0</property>
|
||||
<property name="row_label_values"></property>
|
||||
<property name="row_label_vert_alignment">wxALIGN_CENTER</property>
|
||||
<property name="row_sizes"></property>
|
||||
<property name="rows">1</property>
|
||||
<property name="show">1</property>
|
||||
<property name="size"></property>
|
||||
<property name="style"></property>
|
||||
<property name="subclass">STD_BITMAP_BUTTON; widgets/std_bitmap_button.h; forward_declare</property>
|
||||
<property name="subclass">WX_GRID; widgets/wx_grid.h; forward_declare</property>
|
||||
<property name="toolbar_pane">0</property>
|
||||
<property name="tooltip"></property>
|
||||
<property name="validator_data_type"></property>
|
||||
<property name="validator_style">wxFILTER_NONE</property>
|
||||
<property name="validator_type">wxDefaultValidator</property>
|
||||
<property name="validator_variable"></property>
|
||||
<property name="window_extra_style"></property>
|
||||
<property name="window_name"></property>
|
||||
<property name="window_style"></property>
|
||||
<event name="OnButtonClick">OnAddEnvVar</event>
|
||||
<event name="OnSize">OnGridSize</event>
|
||||
</object>
|
||||
</object>
|
||||
<object class="sizeritem" expanded="1">
|
||||
<property name="border">5</property>
|
||||
<property name="flag">wxEXPAND|wxRIGHT|wxLEFT</property>
|
||||
<property name="flag">wxEXPAND</property>
|
||||
<property name="proportion">0</property>
|
||||
<object class="spacer" expanded="1">
|
||||
<property name="height">0</property>
|
||||
<property name="permission">protected</property>
|
||||
<property name="width">0</property>
|
||||
<object class="wxBoxSizer" expanded="1">
|
||||
<property name="minimum_size"></property>
|
||||
<property name="name">bSizerEnvVarBtns</property>
|
||||
<property name="orient">wxHORIZONTAL</property>
|
||||
<property name="permission">none</property>
|
||||
<object class="sizeritem" expanded="1">
|
||||
<property name="border">5</property>
|
||||
<property name="flag">wxBOTTOM|wxLEFT</property>
|
||||
<property name="proportion">0</property>
|
||||
<object class="wxBitmapButton" expanded="1">
|
||||
<property name="BottomDockable">1</property>
|
||||
<property name="LeftDockable">1</property>
|
||||
<property name="RightDockable">1</property>
|
||||
<property name="TopDockable">1</property>
|
||||
<property name="aui_layer"></property>
|
||||
<property name="aui_name"></property>
|
||||
<property name="aui_position"></property>
|
||||
<property name="aui_row"></property>
|
||||
<property name="auth_needed">0</property>
|
||||
<property name="best_size"></property>
|
||||
<property name="bg"></property>
|
||||
<property name="bitmap"></property>
|
||||
<property name="caption"></property>
|
||||
<property name="caption_visible">1</property>
|
||||
<property name="center_pane">0</property>
|
||||
<property name="close_button">1</property>
|
||||
<property name="context_help"></property>
|
||||
<property name="context_menu">1</property>
|
||||
<property name="current"></property>
|
||||
<property name="default">0</property>
|
||||
<property name="default_pane">0</property>
|
||||
<property name="disabled"></property>
|
||||
<property name="dock">Dock</property>
|
||||
<property name="dock_fixed">0</property>
|
||||
<property name="docking">Left</property>
|
||||
<property name="enabled">1</property>
|
||||
<property name="fg"></property>
|
||||
<property name="floatable">1</property>
|
||||
<property name="focus"></property>
|
||||
<property name="font"></property>
|
||||
<property name="gripper">0</property>
|
||||
<property name="hidden">0</property>
|
||||
<property name="id">wxID_ANY</property>
|
||||
<property name="label">Add Environment Variable</property>
|
||||
<property name="margins"></property>
|
||||
<property name="markup">0</property>
|
||||
<property name="max_size"></property>
|
||||
<property name="maximize_button">0</property>
|
||||
<property name="maximum_size"></property>
|
||||
<property name="min_size"></property>
|
||||
<property name="minimize_button">0</property>
|
||||
<property name="minimum_size">-1,-1</property>
|
||||
<property name="moveable">1</property>
|
||||
<property name="name">m_btnAddEnvVar</property>
|
||||
<property name="pane_border">1</property>
|
||||
<property name="pane_position"></property>
|
||||
<property name="pane_size"></property>
|
||||
<property name="permission">protected</property>
|
||||
<property name="pin_button">1</property>
|
||||
<property name="pos"></property>
|
||||
<property name="position"></property>
|
||||
<property name="pressed"></property>
|
||||
<property name="resize">Resizable</property>
|
||||
<property name="show">1</property>
|
||||
<property name="size"></property>
|
||||
<property name="style"></property>
|
||||
<property name="subclass">STD_BITMAP_BUTTON; widgets/std_bitmap_button.h; forward_declare</property>
|
||||
<property name="toolbar_pane">0</property>
|
||||
<property name="tooltip"></property>
|
||||
<property name="validator_data_type"></property>
|
||||
<property name="validator_style">wxFILTER_NONE</property>
|
||||
<property name="validator_type">wxDefaultValidator</property>
|
||||
<property name="validator_variable"></property>
|
||||
<property name="window_extra_style"></property>
|
||||
<property name="window_name"></property>
|
||||
<property name="window_style"></property>
|
||||
<event name="OnButtonClick">OnAddEnvVar</event>
|
||||
</object>
|
||||
</object>
|
||||
<object class="sizeritem" expanded="1">
|
||||
<property name="border">5</property>
|
||||
<property name="flag">wxEXPAND|wxRIGHT|wxLEFT</property>
|
||||
<property name="proportion">0</property>
|
||||
<object class="spacer" expanded="1">
|
||||
<property name="height">0</property>
|
||||
<property name="permission">protected</property>
|
||||
<property name="width">0</property>
|
||||
</object>
|
||||
</object>
|
||||
<object class="sizeritem" expanded="1">
|
||||
<property name="border">5</property>
|
||||
<property name="flag">wxBOTTOM</property>
|
||||
<property name="proportion">0</property>
|
||||
<object class="wxBitmapButton" expanded="1">
|
||||
<property name="BottomDockable">1</property>
|
||||
<property name="LeftDockable">1</property>
|
||||
<property name="RightDockable">1</property>
|
||||
<property name="TopDockable">1</property>
|
||||
<property name="aui_layer"></property>
|
||||
<property name="aui_name"></property>
|
||||
<property name="aui_position"></property>
|
||||
<property name="aui_row"></property>
|
||||
<property name="auth_needed">0</property>
|
||||
<property name="best_size"></property>
|
||||
<property name="bg"></property>
|
||||
<property name="bitmap"></property>
|
||||
<property name="caption"></property>
|
||||
<property name="caption_visible">1</property>
|
||||
<property name="center_pane">0</property>
|
||||
<property name="close_button">1</property>
|
||||
<property name="context_help"></property>
|
||||
<property name="context_menu">1</property>
|
||||
<property name="current"></property>
|
||||
<property name="default">0</property>
|
||||
<property name="default_pane">0</property>
|
||||
<property name="disabled"></property>
|
||||
<property name="dock">Dock</property>
|
||||
<property name="dock_fixed">0</property>
|
||||
<property name="docking">Left</property>
|
||||
<property name="enabled">1</property>
|
||||
<property name="fg"></property>
|
||||
<property name="floatable">1</property>
|
||||
<property name="focus"></property>
|
||||
<property name="font"></property>
|
||||
<property name="gripper">0</property>
|
||||
<property name="hidden">0</property>
|
||||
<property name="id">wxID_ANY</property>
|
||||
<property name="label">Delete Environment Variable</property>
|
||||
<property name="margins"></property>
|
||||
<property name="markup">0</property>
|
||||
<property name="max_size"></property>
|
||||
<property name="maximize_button">0</property>
|
||||
<property name="maximum_size"></property>
|
||||
<property name="min_size"></property>
|
||||
<property name="minimize_button">0</property>
|
||||
<property name="minimum_size">-1,-1</property>
|
||||
<property name="moveable">1</property>
|
||||
<property name="name">m_btnDeleteEnvVar</property>
|
||||
<property name="pane_border">1</property>
|
||||
<property name="pane_position"></property>
|
||||
<property name="pane_size"></property>
|
||||
<property name="permission">protected</property>
|
||||
<property name="pin_button">1</property>
|
||||
<property name="pos"></property>
|
||||
<property name="position"></property>
|
||||
<property name="pressed"></property>
|
||||
<property name="resize">Resizable</property>
|
||||
<property name="show">1</property>
|
||||
<property name="size"></property>
|
||||
<property name="style"></property>
|
||||
<property name="subclass">STD_BITMAP_BUTTON; widgets/std_bitmap_button.h; forward_declare</property>
|
||||
<property name="toolbar_pane">0</property>
|
||||
<property name="tooltip"></property>
|
||||
<property name="validator_data_type"></property>
|
||||
<property name="validator_style">wxFILTER_NONE</property>
|
||||
<property name="validator_type">wxDefaultValidator</property>
|
||||
<property name="validator_variable"></property>
|
||||
<property name="window_extra_style"></property>
|
||||
<property name="window_name"></property>
|
||||
<property name="window_style"></property>
|
||||
<event name="OnButtonClick">OnRemoveEnvVar</event>
|
||||
</object>
|
||||
</object>
|
||||
</object>
|
||||
</object>
|
||||
<object class="sizeritem" expanded="1">
|
||||
<property name="border">5</property>
|
||||
<property name="flag">wxBOTTOM</property>
|
||||
<property name="proportion">0</property>
|
||||
<object class="wxBitmapButton" expanded="1">
|
||||
<property name="BottomDockable">1</property>
|
||||
<property name="LeftDockable">1</property>
|
||||
<property name="RightDockable">1</property>
|
||||
<property name="TopDockable">1</property>
|
||||
<property name="aui_layer"></property>
|
||||
<property name="aui_name"></property>
|
||||
<property name="aui_position"></property>
|
||||
<property name="aui_row"></property>
|
||||
<property name="auth_needed">0</property>
|
||||
<property name="best_size"></property>
|
||||
<property name="bg"></property>
|
||||
<property name="bitmap"></property>
|
||||
<property name="caption"></property>
|
||||
<property name="caption_visible">1</property>
|
||||
<property name="center_pane">0</property>
|
||||
<property name="close_button">1</property>
|
||||
<property name="context_help"></property>
|
||||
<property name="context_menu">1</property>
|
||||
<property name="current"></property>
|
||||
<property name="default">0</property>
|
||||
<property name="default_pane">0</property>
|
||||
<property name="disabled"></property>
|
||||
<property name="dock">Dock</property>
|
||||
<property name="dock_fixed">0</property>
|
||||
<property name="docking">Left</property>
|
||||
<property name="enabled">1</property>
|
||||
<property name="fg"></property>
|
||||
<property name="floatable">1</property>
|
||||
<property name="focus"></property>
|
||||
<property name="font"></property>
|
||||
<property name="gripper">0</property>
|
||||
<property name="hidden">0</property>
|
||||
<property name="id">wxID_ANY</property>
|
||||
<property name="label">Delete Environment Variable</property>
|
||||
<property name="margins"></property>
|
||||
<property name="markup">0</property>
|
||||
<property name="max_size"></property>
|
||||
<property name="maximize_button">0</property>
|
||||
<property name="maximum_size"></property>
|
||||
<property name="min_size"></property>
|
||||
<property name="minimize_button">0</property>
|
||||
<property name="minimum_size">-1,-1</property>
|
||||
<property name="moveable">1</property>
|
||||
<property name="name">m_btnDeleteEnvVar</property>
|
||||
<property name="pane_border">1</property>
|
||||
<property name="pane_position"></property>
|
||||
<property name="pane_size"></property>
|
||||
<property name="permission">protected</property>
|
||||
<property name="pin_button">1</property>
|
||||
<property name="pos"></property>
|
||||
<property name="position"></property>
|
||||
<property name="pressed"></property>
|
||||
<property name="resize">Resizable</property>
|
||||
<property name="show">1</property>
|
||||
<property name="size"></property>
|
||||
<property name="style"></property>
|
||||
<property name="subclass">STD_BITMAP_BUTTON; widgets/std_bitmap_button.h; forward_declare</property>
|
||||
<property name="toolbar_pane">0</property>
|
||||
<property name="tooltip"></property>
|
||||
<property name="validator_data_type"></property>
|
||||
<property name="validator_style">wxFILTER_NONE</property>
|
||||
<property name="validator_type">wxDefaultValidator</property>
|
||||
<property name="validator_variable"></property>
|
||||
<property name="window_extra_style"></property>
|
||||
<property name="window_name"></property>
|
||||
<property name="window_style"></property>
|
||||
<event name="OnButtonClick">OnRemoveEnvVar</event>
|
||||
</object>
|
||||
</object>
|
||||
</object>
|
||||
</object>
|
||||
<object class="sizeritem" expanded="1">
|
||||
<property name="border">5</property>
|
||||
<property name="flag">wxEXPAND|wxTOP</property>
|
||||
<property name="proportion">0</property>
|
||||
<object class="wxStaticLine" expanded="1">
|
||||
<property name="BottomDockable">1</property>
|
||||
<property name="LeftDockable">1</property>
|
||||
<property name="RightDockable">1</property>
|
||||
<property name="TopDockable">1</property>
|
||||
<property name="aui_layer"></property>
|
||||
<property name="aui_name"></property>
|
||||
<property name="aui_position"></property>
|
||||
<property name="aui_row"></property>
|
||||
<property name="best_size"></property>
|
||||
<property name="bg"></property>
|
||||
<property name="caption"></property>
|
||||
<property name="caption_visible">1</property>
|
||||
<property name="center_pane">0</property>
|
||||
<property name="close_button">1</property>
|
||||
<property name="context_help"></property>
|
||||
<property name="context_menu">1</property>
|
||||
<property name="default_pane">0</property>
|
||||
<property name="dock">Dock</property>
|
||||
<property name="dock_fixed">0</property>
|
||||
<property name="docking">Left</property>
|
||||
<property name="enabled">1</property>
|
||||
<property name="fg"></property>
|
||||
<property name="floatable">1</property>
|
||||
<property name="font"></property>
|
||||
<property name="gripper">0</property>
|
||||
<property name="hidden">0</property>
|
||||
<property name="id">wxID_ANY</property>
|
||||
<property name="max_size"></property>
|
||||
<property name="maximize_button">0</property>
|
||||
<property name="maximum_size"></property>
|
||||
<property name="min_size"></property>
|
||||
<property name="minimize_button">0</property>
|
||||
<property name="minimum_size"></property>
|
||||
<property name="moveable">1</property>
|
||||
<property name="name">m_staticline1</property>
|
||||
<property name="pane_border">1</property>
|
||||
<property name="pane_position"></property>
|
||||
<property name="pane_size"></property>
|
||||
<property name="permission">protected</property>
|
||||
<property name="pin_button">1</property>
|
||||
<property name="pos"></property>
|
||||
<property name="resize">Resizable</property>
|
||||
<property name="show">1</property>
|
||||
<property name="size"></property>
|
||||
<property name="style">wxLI_HORIZONTAL</property>
|
||||
<property name="subclass">; ; forward_declare</property>
|
||||
<property name="toolbar_pane">0</property>
|
||||
<property name="tooltip"></property>
|
||||
<property name="window_extra_style"></property>
|
||||
<property name="window_name"></property>
|
||||
<property name="window_style"></property>
|
||||
</object>
|
||||
</object>
|
||||
<object class="sizeritem" expanded="1">
|
||||
|
||||
@@ -29,6 +29,7 @@
|
||||
#include <project.h>
|
||||
#include <grid_tricks.h>
|
||||
#include <widgets/std_bitmap_button.h>
|
||||
#include <widgets/grid_text_helpers.h>
|
||||
|
||||
#include <algorithm>
|
||||
|
||||
|
||||
@@ -279,7 +279,7 @@ void KIGFX::DS_PAINTER::draw( const DS_DRAW_ITEM_TEXT* aItem, int aLayer ) const
|
||||
if( !font )
|
||||
{
|
||||
font = KIFONT::FONT::GetFont( m_renderSettings.GetDefaultFont(), aItem->IsBold(),
|
||||
aItem->IsItalic() );
|
||||
aItem->IsItalic(), true );
|
||||
}
|
||||
|
||||
const COLOR4D& color = m_renderSettings.GetColor( aItem, aLayer );
|
||||
|
||||
@@ -265,6 +265,10 @@ void EDA_BASE_FRAME::windowClosing( wxCloseEvent& event )
|
||||
|
||||
EDA_BASE_FRAME::~EDA_BASE_FRAME()
|
||||
{
|
||||
Disconnect( ID_AUTO_SAVE_TIMER, wxEVT_TIMER,
|
||||
wxTimerEventHandler( EDA_BASE_FRAME::onAutoSaveTimer ) );
|
||||
Disconnect( wxEVT_CLOSE_WINDOW, wxCloseEventHandler( EDA_BASE_FRAME::windowClosing ) );
|
||||
|
||||
delete m_autoSaveTimer;
|
||||
delete m_fileHistory;
|
||||
|
||||
|
||||
@@ -401,8 +401,6 @@ void EDA_SHAPE::flip( const VECTOR2I& aCentre, bool aFlipLeftRight )
|
||||
m_start.y = aCentre.y - ( m_start.y - aCentre.y );
|
||||
m_end.y = aCentre.y - ( m_end.y - aCentre.y );
|
||||
}
|
||||
|
||||
std::swap( m_start, m_end );
|
||||
break;
|
||||
|
||||
case SHAPE_T::CIRCLE:
|
||||
|
||||
+19
-2
@@ -48,6 +48,7 @@
|
||||
#include <font/outline_font.h>
|
||||
#include <geometry/shape_poly_set.h>
|
||||
#include <properties/property_validators.h>
|
||||
#include <ctl_flags.h> // for CTL_OMIT_HIDE definition
|
||||
|
||||
#include <wx/debug.h> // for wxASSERT
|
||||
#include <wx/string.h>
|
||||
@@ -219,6 +220,22 @@ void EDA_TEXT::SetItalic( bool aItalic )
|
||||
|
||||
|
||||
void EDA_TEXT::SetBold( bool aBold )
|
||||
{
|
||||
if( m_attributes.m_Bold != aBold )
|
||||
{
|
||||
int size = std::min( m_attributes.m_Size.x, m_attributes.m_Size.y );
|
||||
|
||||
if( aBold )
|
||||
m_attributes.m_StrokeWidth = GetPenSizeForBold( size );
|
||||
else
|
||||
m_attributes.m_StrokeWidth = GetPenSizeForNormal( size );
|
||||
}
|
||||
|
||||
SetBoldFlag( aBold );
|
||||
}
|
||||
|
||||
|
||||
void EDA_TEXT::SetBoldFlag( bool aBold )
|
||||
{
|
||||
m_attributes.m_Bold = aBold;
|
||||
ClearRenderCache();
|
||||
@@ -918,7 +935,7 @@ void EDA_TEXT::Format( OUTPUTFORMATTER* aFormatter, int aNestLevel, int aControl
|
||||
if( IsItalic() )
|
||||
aFormatter->Print( 0, " (italic yes)" );
|
||||
|
||||
if( GetTextColor() != COLOR4D::UNSPECIFIED )
|
||||
if( !( aControlBits & CTL_OMIT_COLOR ) && GetTextColor() != COLOR4D::UNSPECIFIED )
|
||||
{
|
||||
aFormatter->Print( 0, " (color %d %d %d %s)",
|
||||
KiROUND( GetTextColor().r * 255.0 ),
|
||||
@@ -949,7 +966,7 @@ void EDA_TEXT::Format( OUTPUTFORMATTER* aFormatter, int aNestLevel, int aControl
|
||||
if( !( aControlBits & CTL_OMIT_HIDE ) && !IsVisible() )
|
||||
aFormatter->Print( 0, " (hide yes)" );
|
||||
|
||||
if( HasHyperlink() )
|
||||
if( !( aControlBits & CTL_OMIT_HYPERLINK ) && HasHyperlink() )
|
||||
{
|
||||
aFormatter->Print( 0, " (href %s)", aFormatter->Quotew( GetHyperlink() ).c_str() );
|
||||
}
|
||||
|
||||
@@ -57,7 +57,7 @@ const METRICS& METRICS::Default()
|
||||
|
||||
FONT* FONT::s_defaultFont = nullptr;
|
||||
|
||||
std::map< std::tuple<wxString, bool, bool>, FONT*> FONT::s_fontMap;
|
||||
std::map< std::tuple<wxString, bool, bool, bool>, FONT*> FONT::s_fontMap;
|
||||
|
||||
class MARKUP_CACHE
|
||||
{
|
||||
@@ -143,12 +143,13 @@ FONT* FONT::getDefaultFont()
|
||||
}
|
||||
|
||||
|
||||
FONT* FONT::GetFont( const wxString& aFontName, bool aBold, bool aItalic )
|
||||
FONT* FONT::GetFont( const wxString& aFontName, bool aBold, bool aItalic,
|
||||
bool aForDrawingSheet )
|
||||
{
|
||||
if( aFontName.empty() || aFontName.StartsWith( KICAD_FONT_NAME ) )
|
||||
return getDefaultFont();
|
||||
|
||||
std::tuple<wxString, bool, bool> key = { aFontName, aBold, aItalic };
|
||||
std::tuple<wxString, bool, bool, bool> key = { aFontName, aBold, aItalic, aForDrawingSheet };
|
||||
|
||||
FONT* font = nullptr;
|
||||
|
||||
@@ -156,7 +157,7 @@ FONT* FONT::GetFont( const wxString& aFontName, bool aBold, bool aItalic )
|
||||
font = s_fontMap[key];
|
||||
|
||||
if( !font )
|
||||
font = OUTLINE_FONT::LoadFont( aFontName, aBold, aItalic );
|
||||
font = OUTLINE_FONT::LoadFont( aFontName, aBold, aItalic, aForDrawingSheet );
|
||||
|
||||
if( !font )
|
||||
font = getDefaultFont();
|
||||
|
||||
@@ -204,6 +204,17 @@ FONTCONFIG::FF_RESULT FONTCONFIG::FindFont( const wxString &aFontName, wxString
|
||||
if( !g_fcInitSuccess )
|
||||
return retval;
|
||||
|
||||
// If the original font name contains any of these, then it is bold, regardless
|
||||
// of whether we are looking for bold or not
|
||||
if( aFontName.Lower().Contains( wxS( "bold" ) ) // also catches ultrabold
|
||||
|| aFontName.Lower().Contains( wxS( "heavy" ) )
|
||||
|| aFontName.Lower().Contains( wxS( "black" ) ) // also catches extrablack
|
||||
|| aFontName.Lower().Contains( wxS( "thick" ) )
|
||||
|| aFontName.Lower().Contains( wxS( "dark" ) ) )
|
||||
{
|
||||
aBold = true;
|
||||
}
|
||||
|
||||
wxString qualifiedFontName = aFontName;
|
||||
|
||||
wxScopedCharBuffer const fcBuffer = qualifiedFontName.ToUTF8();
|
||||
@@ -333,7 +344,10 @@ FONTCONFIG::FF_RESULT FONTCONFIG::FindFont( const wxString &aFontName, wxString
|
||||
{
|
||||
fontName.Replace( ':', ' ' );
|
||||
|
||||
if( s_reporter )
|
||||
// If we missed a case but the matching found the original font name, then we are not substituting
|
||||
if( fontName.CmpNoCase( qualifiedFontName ) == 0 )
|
||||
retval = FF_RESULT::FF_OK;
|
||||
else if( s_reporter )
|
||||
s_reporter->Report( wxString::Format( _( "Font '%s' not found; substituting '%s'." ), qualifiedFontName, fontName ) );
|
||||
}
|
||||
|
||||
|
||||
@@ -44,7 +44,8 @@ OUTLINE_FONT::OUTLINE_FONT() :
|
||||
m_face(NULL),
|
||||
m_faceSize( 16 ),
|
||||
m_fakeBold( false ),
|
||||
m_fakeItal( false )
|
||||
m_fakeItal( false ),
|
||||
m_forDrawingSheet( false )
|
||||
{
|
||||
std::lock_guard<std::mutex> guard( m_freeTypeMutex );
|
||||
|
||||
@@ -53,7 +54,8 @@ OUTLINE_FONT::OUTLINE_FONT() :
|
||||
}
|
||||
|
||||
|
||||
OUTLINE_FONT* OUTLINE_FONT::LoadFont( const wxString& aFontName, bool aBold, bool aItalic )
|
||||
OUTLINE_FONT* OUTLINE_FONT::LoadFont( const wxString& aFontName, bool aBold, bool aItalic,
|
||||
bool aForDrawingSheet )
|
||||
{
|
||||
std::unique_ptr<OUTLINE_FONT> font = std::make_unique<OUTLINE_FONT>();
|
||||
|
||||
@@ -77,6 +79,7 @@ OUTLINE_FONT* OUTLINE_FONT::LoadFont( const wxString& aFontName, bool aBold, boo
|
||||
|
||||
font->m_fontName = aFontName; // Keep asked-for name, even if we substituted.
|
||||
font->m_fontFileName = fontFile;
|
||||
font->m_forDrawingSheet = aForDrawingSheet;
|
||||
|
||||
return font.release();
|
||||
}
|
||||
@@ -260,6 +263,7 @@ struct GLYPH_CACHE_KEY {
|
||||
FT_Face face;
|
||||
hb_codepoint_t codepoint;
|
||||
double scaler;
|
||||
bool forDrawingSheet;
|
||||
bool fakeItalic;
|
||||
bool fakeBold;
|
||||
bool mirror;
|
||||
@@ -267,9 +271,14 @@ struct GLYPH_CACHE_KEY {
|
||||
|
||||
bool operator==(const GLYPH_CACHE_KEY& rhs ) const
|
||||
{
|
||||
return face == rhs.face && codepoint == rhs.codepoint && scaler == rhs.scaler
|
||||
&& fakeItalic == rhs.fakeItalic && fakeBold == rhs.fakeBold
|
||||
&& mirror == rhs.mirror && angle == rhs.angle;
|
||||
return face == rhs.face
|
||||
&& codepoint == rhs.codepoint
|
||||
&& scaler == rhs.scaler
|
||||
&& forDrawingSheet == rhs.forDrawingSheet
|
||||
&& fakeItalic == rhs.fakeItalic
|
||||
&& fakeBold == rhs.fakeBold
|
||||
&& mirror == rhs.mirror
|
||||
&& angle == rhs.angle;
|
||||
}
|
||||
};
|
||||
|
||||
@@ -280,10 +289,14 @@ namespace std
|
||||
{
|
||||
std::size_t operator()( const GLYPH_CACHE_KEY& k ) const
|
||||
{
|
||||
return hash<const void*>()( k.face ) ^ hash<unsigned>()( k.codepoint )
|
||||
return hash<const void*>()( k.face )
|
||||
^ hash<unsigned>()( k.codepoint )
|
||||
^ hash<double>()( k.scaler )
|
||||
^ hash<int>()( k.fakeItalic ) ^ hash<int>()( k.fakeBold )
|
||||
^ hash<int>()( k.mirror ) ^ hash<int>()( k.angle.AsTenthsOfADegree() );
|
||||
^ hash<double>()( k.forDrawingSheet )
|
||||
^ hash<int>()( k.fakeItalic )
|
||||
^ hash<int>()( k.fakeBold )
|
||||
^ hash<int>()( k.mirror )
|
||||
^ hash<int>()( k.angle.AsTenthsOfADegree() );
|
||||
}
|
||||
};
|
||||
}
|
||||
@@ -341,8 +354,8 @@ VECTOR2I OUTLINE_FONT::getTextAsGlyphsUnlocked( BOX2I* aBBox,
|
||||
|
||||
if( aGlyphs )
|
||||
{
|
||||
GLYPH_CACHE_KEY key = { face, glyphInfo[i].codepoint, scaler, m_fakeItal, m_fakeBold,
|
||||
aMirror, aAngle };
|
||||
GLYPH_CACHE_KEY key = { face, glyphInfo[i].codepoint, scaler, m_forDrawingSheet,
|
||||
m_fakeItal, m_fakeBold, aMirror, aAngle };
|
||||
GLYPH_DATA& glyphData = s_glyphCache[ key ];
|
||||
|
||||
if( glyphData.m_Contours.empty() )
|
||||
|
||||
@@ -1828,7 +1828,7 @@ void CAIRO_GAL_BASE::DrawGlyph( const KIFONT::GLYPH& aGlyph, int aNth, int aTota
|
||||
for( const std::vector<VECTOR2D>& pointList : glyph )
|
||||
drawPoly( pointList );
|
||||
}
|
||||
else if( aGlyph.IsOutline() )
|
||||
else if( aGlyph.IsOutline() )
|
||||
{
|
||||
const KIFONT::OUTLINE_GLYPH& glyph = static_cast<const KIFONT::OUTLINE_GLYPH&>( aGlyph );
|
||||
|
||||
@@ -1866,15 +1866,9 @@ void CAIRO_GAL_BASE::DrawGlyph( const KIFONT::GLYPH& aGlyph, int aNth, int aTota
|
||||
|
||||
if( aNth == aTotal - 1 )
|
||||
{
|
||||
/*
|
||||
cairo_close_path( currentContext );
|
||||
setSourceRgba( currentContext, fillColor );
|
||||
cairo_set_fill_rule( currentContext, CAIRO_FILL_RULE_EVEN_ODD );
|
||||
cairo_fill_preserve( currentContext );
|
||||
setSourceRgba( currentContext, strokeColor );
|
||||
cairo_stroke( currentContext );
|
||||
*/
|
||||
flushPath();
|
||||
SetIsFill( false );
|
||||
SetIsStroke( true );
|
||||
m_isElementAdded = true;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -140,7 +140,8 @@ EASYEDAPRO::ProjectToSelectorDialog( const nlohmann::json& aProject, bool aPcbOn
|
||||
}
|
||||
|
||||
|
||||
nlohmann::json EASYEDAPRO::ReadProjectOrDeviceFile( const wxString& aZipFileName )
|
||||
nlohmann::json EASYEDAPRO::FindJsonFile( const wxString& aZipFileName,
|
||||
const std::set<wxString>& aFileNames )
|
||||
{
|
||||
std::shared_ptr<wxZipEntry> entry;
|
||||
wxFFileInputStream in( aZipFileName );
|
||||
@@ -152,7 +153,7 @@ nlohmann::json EASYEDAPRO::ReadProjectOrDeviceFile( const wxString& aZipFileName
|
||||
|
||||
try
|
||||
{
|
||||
if( name == wxS( "project.json" ) || name == wxS( "device.json" ) )
|
||||
if( aFileNames.find( name ) != aFileNames.end() )
|
||||
{
|
||||
wxMemoryOutputStream memos;
|
||||
memos << zip;
|
||||
@@ -175,6 +176,20 @@ nlohmann::json EASYEDAPRO::ReadProjectOrDeviceFile( const wxString& aZipFileName
|
||||
}
|
||||
}
|
||||
|
||||
return nlohmann::json{};
|
||||
}
|
||||
|
||||
|
||||
nlohmann::json EASYEDAPRO::ReadProjectOrDeviceFile( const wxString& aZipFileName )
|
||||
{
|
||||
static const std::set<wxString> c_files = { wxS( "project.json" ), wxS( "device.json" ),
|
||||
wxS( "footprint.json" ), wxS( "symbol.json" ) };
|
||||
|
||||
nlohmann::json j = FindJsonFile( aZipFileName, c_files );
|
||||
|
||||
if( !j.is_null() )
|
||||
return j;
|
||||
|
||||
THROW_IO_ERROR( wxString::Format(
|
||||
_( "'%s' does not appear to be a valid EasyEDA (JLCEDA) Pro "
|
||||
"project or library file. Cannot find project.json or device.json." ),
|
||||
@@ -230,8 +245,17 @@ std::vector<nlohmann::json> EASYEDAPRO::ParseJsonLines( wxInputStream& aInput,
|
||||
{
|
||||
try
|
||||
{
|
||||
nlohmann::json js = nlohmann::json::parse( txt.ReadLine() );
|
||||
lines.emplace_back( js );
|
||||
wxString line = txt.ReadLine();
|
||||
|
||||
if( !line.IsEmpty() )
|
||||
{
|
||||
nlohmann::json js = nlohmann::json::parse( line );
|
||||
lines.emplace_back( js );
|
||||
}
|
||||
else
|
||||
{
|
||||
lines.emplace_back( nlohmann::json() );
|
||||
}
|
||||
}
|
||||
catch( nlohmann::json::exception& e )
|
||||
{
|
||||
@@ -244,3 +268,42 @@ std::vector<nlohmann::json> EASYEDAPRO::ParseJsonLines( wxInputStream& aInput,
|
||||
|
||||
return lines;
|
||||
}
|
||||
|
||||
|
||||
std::vector<std::vector<nlohmann::json>>
|
||||
EASYEDAPRO::ParseJsonLinesWithSeparation( wxInputStream& aInput, const wxString& aSource )
|
||||
{
|
||||
wxTextInputStream txt( aInput, wxS( " " ), wxConvUTF8 );
|
||||
|
||||
int currentLine = 1;
|
||||
|
||||
std::vector<std::vector<nlohmann::json>> lineBlocks;
|
||||
lineBlocks.emplace_back();
|
||||
|
||||
while( aInput.CanRead() )
|
||||
{
|
||||
try
|
||||
{
|
||||
wxString line = txt.ReadLine();
|
||||
|
||||
if( !line.IsEmpty() )
|
||||
{
|
||||
nlohmann::json js = nlohmann::json::parse( line );
|
||||
lineBlocks.back().emplace_back( js );
|
||||
}
|
||||
else
|
||||
{
|
||||
lineBlocks.emplace_back();
|
||||
}
|
||||
}
|
||||
catch( nlohmann::json::exception& e )
|
||||
{
|
||||
wxLogWarning( wxString::Format( _( "Cannot parse JSON line %d in '%s': %s" ),
|
||||
currentLine, aSource, e.what() ) );
|
||||
}
|
||||
|
||||
currentLine++;
|
||||
}
|
||||
|
||||
return lineBlocks;
|
||||
}
|
||||
|
||||
@@ -25,6 +25,7 @@
|
||||
#ifndef EASYEDAPRO_IMPORT_UTILS_H_
|
||||
#define EASYEDAPRO_IMPORT_UTILS_H_
|
||||
|
||||
#include <set>
|
||||
#include <wx/stream.h>
|
||||
#include <wx/string.h>
|
||||
#include <lib_id.h>
|
||||
@@ -46,6 +47,8 @@ std::vector<IMPORT_PROJECT_DESC> ProjectToSelectorDialog( const nlohmann::json&
|
||||
bool aPcbOnly = false,
|
||||
bool aSchOnly = false );
|
||||
|
||||
nlohmann::json FindJsonFile( const wxString& aZipFileName, const std::set<wxString>& aFileNames );
|
||||
|
||||
nlohmann::json ReadProjectOrDeviceFile( const wxString& aZipFileName );
|
||||
|
||||
void IterateZipFiles(
|
||||
@@ -54,6 +57,12 @@ void IterateZipFiles(
|
||||
|
||||
std::vector<nlohmann::json> ParseJsonLines( wxInputStream& aInput, const wxString& aSource );
|
||||
|
||||
/**
|
||||
* Multiple document types (e.g. footprint and PCB) can be put into a single file, separated by empty line.
|
||||
*/
|
||||
std::vector<std::vector<nlohmann::json>> ParseJsonLinesWithSeparation( wxInputStream& aInput,
|
||||
const wxString& aSource );
|
||||
|
||||
} // namespace EASYEDAPRO
|
||||
|
||||
|
||||
|
||||
@@ -36,7 +36,9 @@ void EASYEDAPRO::from_json( const nlohmann::json& j, EASYEDAPRO::SCH_ATTR& d )
|
||||
d.id = j.at( 1 ).get<wxString>();
|
||||
d.parentId = j.at( 2 ).get<wxString>();
|
||||
d.key = j.at( 3 ).get<wxString>();
|
||||
d.value = j.at( 4 ).get<wxString>();
|
||||
|
||||
if( j.at( 4 ).is_string() )
|
||||
d.value = j.at( 4 ).get<wxString>();
|
||||
|
||||
if( j.at( 5 ).is_number() )
|
||||
d.keyVisible = j.at( 5 ).get<int>();
|
||||
|
||||
@@ -41,7 +41,8 @@
|
||||
namespace EASYEDAPRO
|
||||
{
|
||||
|
||||
static const bool IMPORT_POURED = false;
|
||||
static const bool IMPORT_POURED = true;
|
||||
static const bool IMPORT_POURED_ECOP = false;
|
||||
|
||||
enum class SYMBOL_TYPE
|
||||
{
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
*
|
||||
* Copyright (C) 2015 Mark Roszko <mark.roszko@gmail.com>
|
||||
* Copyright (C) 2016 SoftPLC Corporation, Dick Hollenbeck <dick@softplc.com>
|
||||
* Copyright (C) 2015-2021 KiCad Developers, see AUTHORS.txt for contributors.
|
||||
* Copyright (C) 2015-2024 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
|
||||
@@ -27,11 +27,18 @@
|
||||
// conflicts for some defines, at least on Windows
|
||||
#include <kicad_curl/kicad_curl.h>
|
||||
|
||||
#include <mutex>
|
||||
#include <ki_exception.h> // THROW_IO_ERROR
|
||||
|
||||
|
||||
static std::shared_mutex s_curlMutex;
|
||||
static bool s_curlShuttingDown = false;
|
||||
|
||||
|
||||
void KICAD_CURL::Init()
|
||||
{
|
||||
s_curlShuttingDown = false;
|
||||
|
||||
if( curl_global_init( CURL_GLOBAL_ALL ) != CURLE_OK )
|
||||
{
|
||||
THROW_IO_ERROR( "curl_global_init() failed." );
|
||||
@@ -41,10 +48,26 @@ void KICAD_CURL::Init()
|
||||
|
||||
void KICAD_CURL::Cleanup()
|
||||
{
|
||||
s_curlShuttingDown = true;
|
||||
|
||||
std::unique_lock lock( s_curlMutex );
|
||||
|
||||
curl_global_cleanup();
|
||||
}
|
||||
|
||||
|
||||
std::shared_mutex& KICAD_CURL::Mutex()
|
||||
{
|
||||
return s_curlMutex;
|
||||
}
|
||||
|
||||
|
||||
bool KICAD_CURL::IsShuttingDown()
|
||||
{
|
||||
return s_curlShuttingDown;
|
||||
}
|
||||
|
||||
|
||||
std::string GetKicadCurlVersion()
|
||||
{
|
||||
return KICAD_CURL::GetVersion();
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
* This program source code file is part of KiCad, a free EDA CAD application.
|
||||
*
|
||||
* Copyright (C) 2015 Mark Roszko <mark.roszko@gmail.com>
|
||||
* Copyright (C) 2015-2023 KiCad Developers, see AUTHORS.txt for contributors.
|
||||
* Copyright (C) 2015-2024 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
|
||||
@@ -33,6 +33,7 @@
|
||||
#include <cstddef>
|
||||
#include <exception>
|
||||
#include <sstream>
|
||||
#include <shared_mutex>
|
||||
#include <wx/app.h>
|
||||
|
||||
#include <build_version.h>
|
||||
@@ -88,6 +89,9 @@ static size_t stream_write_callback( void* aContents, size_t aSize, size_t aNmem
|
||||
static int xferinfo( void* aProgress, curl_off_t aDLtotal, curl_off_t aDLnow, curl_off_t aULtotal,
|
||||
curl_off_t aULnow )
|
||||
{
|
||||
if( KICAD_CURL::IsShuttingDown() )
|
||||
return 1; // Should abort the operation
|
||||
|
||||
CURL_PROGRESS* progress = static_cast<CURL_PROGRESS*>( aProgress );
|
||||
curl_off_t curtime = 0;
|
||||
|
||||
@@ -190,6 +194,12 @@ KICAD_CURL_EASY::~KICAD_CURL_EASY()
|
||||
|
||||
int KICAD_CURL_EASY::Perform()
|
||||
{
|
||||
std::shared_lock lock( KICAD_CURL::Mutex(), std::try_to_lock );
|
||||
|
||||
// If can't lock, we should be in the process of tearing down.
|
||||
if( !lock )
|
||||
return CURLE_ABORTED_BY_CALLBACK;
|
||||
|
||||
if( m_headers )
|
||||
curl_easy_setopt( m_CURL, CURLOPT_HTTPHEADER, m_headers );
|
||||
|
||||
|
||||
+2
-10
@@ -25,9 +25,9 @@
|
||||
|
||||
#include <kiid.h>
|
||||
|
||||
#include <boost/random/mersenne_twister.hpp>
|
||||
#include <boost/uuid/uuid_generators.hpp>
|
||||
#include <boost/uuid/uuid_io.hpp>
|
||||
#include <boost/functional/hash.hpp>
|
||||
|
||||
#if BOOST_VERSION >= 106700
|
||||
#include <boost/uuid/entropy_error.hpp>
|
||||
@@ -235,15 +235,7 @@ timestamp_t KIID::AsLegacyTimestamp() const
|
||||
|
||||
size_t KIID::Hash() const
|
||||
{
|
||||
size_t hash = 0;
|
||||
|
||||
// Note: this is NOT little-endian/big-endian safe, but as long as it's just used
|
||||
// at runtime it won't matter.
|
||||
|
||||
for( int i = 0; i < 4; ++i )
|
||||
boost::hash_combine( hash, reinterpret_cast<const uint32_t*>( m_uuid.data )[i] );
|
||||
|
||||
return hash;
|
||||
return boost::uuids::hash_value( m_uuid );
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -199,16 +199,7 @@ LIB_TABLE_ROW* LIB_TABLE::findRow( const wxString& aNickName, bool aCheckIfEnabl
|
||||
|
||||
do
|
||||
{
|
||||
try
|
||||
{
|
||||
std::shared_lock<std::shared_mutex> lock( cur->m_mutex );
|
||||
}
|
||||
catch( std::system_error& e )
|
||||
{
|
||||
wxASSERT_MSG( false, wxString::Format( wxS( "Failed to lock lib table mutex: %s" ),
|
||||
e.what() ) );
|
||||
continue;
|
||||
}
|
||||
std::shared_lock<std::shared_mutex> lock( cur->m_mutex );
|
||||
|
||||
if( cur->m_rowsMap.count( aNickName ) )
|
||||
row = &*cur->m_rowsMap.at( aNickName );
|
||||
|
||||
@@ -178,6 +178,7 @@ public:
|
||||
m_contentSizer->Add( m_noNotificationsText, 1, wxALL | wxEXPAND, 5 );
|
||||
|
||||
Bind( wxEVT_KILL_FOCUS, &NOTIFICATIONS_LIST::onFocusLoss, this );
|
||||
m_scrolledWindow->Bind( wxEVT_KILL_FOCUS, &NOTIFICATIONS_LIST::onFocusLoss, this );
|
||||
|
||||
SetSizer( bSizer1 );
|
||||
Layout();
|
||||
|
||||
@@ -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) 2024 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
|
||||
@@ -55,9 +55,12 @@ RENDER_SETTINGS::~RENDER_SETTINGS()
|
||||
|
||||
|
||||
#if 0
|
||||
constexpr double correction = 0.8; // Looks best visually
|
||||
constexpr double correction = 0.8; // Looks best visually
|
||||
#else
|
||||
constexpr double correction = 1.0; // Matches ISO 128-2
|
||||
constexpr double correction = 1.0; // Matches ISO 128-2, but can creates issues on GTK and MSW:
|
||||
// "dots" are not always visible depending on the zoom level
|
||||
// because they create 0 lenght lines
|
||||
// So they will drawn as segments, even with correction = 1.0
|
||||
#endif
|
||||
|
||||
|
||||
@@ -69,7 +72,9 @@ double RENDER_SETTINGS::GetDashLength( int aLineWidth ) const
|
||||
|
||||
double RENDER_SETTINGS::GetDotLength( int aLineWidth ) const
|
||||
{
|
||||
return ( 1.0 - correction ) * aLineWidth;
|
||||
// The minimal length scale is arbitrary set to 0.2 after trials
|
||||
// 0 lenght can create drawing issues
|
||||
return std::max( ( 1.0 - correction ), 0.2 ) * aLineWidth;
|
||||
}
|
||||
|
||||
|
||||
|
||||
+37
-6
@@ -42,6 +42,13 @@ REPORTER& REPORTER::Report( const char* aText, SEVERITY aSeverity )
|
||||
}
|
||||
|
||||
|
||||
bool REPORTER::HasMessageOfSeverity( int aSeverityMask ) const
|
||||
{
|
||||
wxFAIL_MSG( "HasMessageOfSeverity is not implemented in this reporter" );
|
||||
return HasMessage();
|
||||
}
|
||||
|
||||
|
||||
REPORTER& WX_TEXT_CTRL_REPORTER::Report( const wxString& aText, SEVERITY aSeverity )
|
||||
{
|
||||
wxCHECK_MSG( m_textCtrl != nullptr, *this,
|
||||
@@ -60,17 +67,34 @@ bool WX_TEXT_CTRL_REPORTER::HasMessage() const
|
||||
|
||||
REPORTER& WX_STRING_REPORTER::Report( const wxString& aText, SEVERITY aSeverity )
|
||||
{
|
||||
wxCHECK_MSG( m_string != nullptr, *this,
|
||||
wxT( "No wxString object defined in WX_STRING_REPORTER." ) );
|
||||
|
||||
*m_string << aText << wxS( "\n" );
|
||||
m_severityMask |= aSeverity;
|
||||
m_string << aText << wxS( "\n" );
|
||||
return *this;
|
||||
}
|
||||
|
||||
|
||||
const wxString& WX_STRING_REPORTER::GetMessages() const
|
||||
{
|
||||
return m_string;
|
||||
}
|
||||
|
||||
|
||||
void WX_STRING_REPORTER::Clear()
|
||||
{
|
||||
m_severityMask = 0;
|
||||
m_string.clear();
|
||||
}
|
||||
|
||||
|
||||
bool WX_STRING_REPORTER::HasMessage() const
|
||||
{
|
||||
return !m_string->IsEmpty();
|
||||
return !m_string.IsEmpty();
|
||||
}
|
||||
|
||||
|
||||
bool WX_STRING_REPORTER::HasMessageOfSeverity( int aSeverityMask ) const
|
||||
{
|
||||
return ( m_severityMask & aSeverityMask ) != 0;
|
||||
}
|
||||
|
||||
|
||||
@@ -106,7 +130,14 @@ REPORTER& WX_HTML_PANEL_REPORTER::ReportHead( const wxString& aText, SEVERITY aS
|
||||
|
||||
bool WX_HTML_PANEL_REPORTER::HasMessage() const
|
||||
{
|
||||
return m_panel->Count( RPT_SEVERITY_ERROR | RPT_SEVERITY_WARNING ) > 0;
|
||||
// Check just for errors and warnings for compatibility
|
||||
return HasMessageOfSeverity( RPT_SEVERITY_ERROR | RPT_SEVERITY_WARNING );
|
||||
}
|
||||
|
||||
|
||||
bool WX_HTML_PANEL_REPORTER::HasMessageOfSeverity( int aSeverityMask ) const
|
||||
{
|
||||
return m_panel->Count( aSeverityMask ) > 0;
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
/*
|
||||
* This program source code file is part of KiCad, a free EDA CAD application.
|
||||
*
|
||||
* Copyright (C) 2004-2023 KiCad Developers, see AUTHORS.txt for contributors.
|
||||
* Copyright (C) 2004-2023, 2024 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
|
||||
@@ -42,7 +42,7 @@
|
||||
* platforms. This is the list of illegal file name characters for Windows which includes
|
||||
* the illegal file name characters for Linux and OSX.
|
||||
*/
|
||||
static const char illegalFileNameChars[] = "\\/:\"<>|";
|
||||
static const char illegalFileNameChars[] = "\\/:\"<>|*?";
|
||||
|
||||
|
||||
wxString ConvertToNewOverbarNotation( const wxString& aOldStr )
|
||||
|
||||
@@ -212,6 +212,21 @@ ACTION_TOOLBAR::ACTION_TOOLBAR( EDA_BASE_FRAME* parent, wxWindowID id, const wxP
|
||||
|
||||
ACTION_TOOLBAR::~ACTION_TOOLBAR()
|
||||
{
|
||||
Disconnect( wxEVT_COMMAND_TOOL_CLICKED, wxAuiToolBarEventHandler( ACTION_TOOLBAR::onToolEvent ),
|
||||
nullptr, this );
|
||||
Disconnect( wxEVT_AUITOOLBAR_RIGHT_CLICK,
|
||||
wxAuiToolBarEventHandler( ACTION_TOOLBAR::onToolRightClick ), nullptr, this );
|
||||
Disconnect( wxEVT_AUITOOLBAR_BEGIN_DRAG, wxAuiToolBarEventHandler( ACTION_TOOLBAR::onItemDrag ),
|
||||
nullptr, this );
|
||||
Disconnect( wxEVT_LEFT_DOWN, wxMouseEventHandler( ACTION_TOOLBAR::onMouseClick ), nullptr,
|
||||
this );
|
||||
Disconnect( wxEVT_LEFT_UP, wxMouseEventHandler( ACTION_TOOLBAR::onMouseClick ), nullptr, this );
|
||||
Disconnect( m_paletteTimer->GetId(), wxEVT_TIMER,
|
||||
wxTimerEventHandler( ACTION_TOOLBAR::onTimerDone ), nullptr, this );
|
||||
|
||||
Unbind( wxEVT_SYS_COLOUR_CHANGED,
|
||||
wxSysColourChangedEventHandler( ACTION_TOOLBAR::onThemeChanged ), this );
|
||||
|
||||
delete m_paletteTimer;
|
||||
|
||||
// Clear all the maps keeping track of our items on the toolbar
|
||||
|
||||
@@ -39,35 +39,6 @@
|
||||
#include <wx/log.h>
|
||||
#include <wx/combo.h>
|
||||
|
||||
GRID_CELL_TEXT_EDITOR::GRID_CELL_TEXT_EDITOR() : wxGridCellTextEditor()
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
void GRID_CELL_TEXT_EDITOR::SetValidator( const wxValidator& validator )
|
||||
{
|
||||
// keep our own copy because wxGridCellTextEditor's is annoyingly private
|
||||
m_validator.reset( static_cast<wxValidator*>( validator.Clone() ) );
|
||||
|
||||
wxGridCellTextEditor::SetValidator( *m_validator );
|
||||
}
|
||||
|
||||
|
||||
void GRID_CELL_TEXT_EDITOR::StartingKey( wxKeyEvent& event )
|
||||
{
|
||||
if( m_validator )
|
||||
{
|
||||
m_validator.get()->SetWindow( Text() );
|
||||
m_validator.get()->ProcessEvent( event );
|
||||
}
|
||||
|
||||
if( event.GetSkipped() )
|
||||
{
|
||||
wxGridCellTextEditor::StartingKey( event );
|
||||
event.Skip( false );
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
FOOTPRINT_NAME_VALIDATOR::FOOTPRINT_NAME_VALIDATOR( wxString* aValue ) :
|
||||
wxTextValidator( wxFILTER_EXCLUDE_CHAR_LIST, aValue )
|
||||
|
||||
@@ -92,6 +92,13 @@ void BITMAP_BUTTON::setupEvents()
|
||||
|
||||
BITMAP_BUTTON::~BITMAP_BUTTON()
|
||||
{
|
||||
Unbind( wxEVT_PAINT, &BITMAP_BUTTON::OnPaint, this );
|
||||
Unbind( wxEVT_LEFT_UP, &BITMAP_BUTTON::OnLeftButtonUp, this );
|
||||
Unbind( wxEVT_LEFT_DOWN, &BITMAP_BUTTON::OnLeftButtonDown, this );
|
||||
Unbind( wxEVT_LEAVE_WINDOW, &BITMAP_BUTTON::OnMouseLeave, this );
|
||||
Unbind( wxEVT_ENTER_WINDOW, &BITMAP_BUTTON::OnMouseEnter, this );
|
||||
Unbind( wxEVT_KILL_FOCUS, &BITMAP_BUTTON::OnKillFocus, this );
|
||||
Unbind( wxEVT_SET_FOCUS, &BITMAP_BUTTON::OnSetFocus, this );
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -105,13 +105,19 @@ bool FONT_CHOICE::HaveFontSelection() const
|
||||
}
|
||||
|
||||
|
||||
KIFONT::FONT* FONT_CHOICE::GetFontSelection( bool aBold, bool aItalic ) const
|
||||
KIFONT::FONT* FONT_CHOICE::GetFontSelection( bool aBold, bool aItalic, bool aForDrawingSheet ) const
|
||||
{
|
||||
if( GetSelection() <= 0 )
|
||||
{
|
||||
return nullptr;
|
||||
}
|
||||
else if( GetSelection() == 1 && m_systemFontCount == 2 )
|
||||
{
|
||||
return KIFONT::FONT::GetFont( KICAD_FONT_NAME, aBold, aItalic );
|
||||
}
|
||||
else
|
||||
return KIFONT::FONT::GetFont( GetStringSelection(), aBold, aItalic );
|
||||
{
|
||||
return KIFONT::FONT::GetFont( GetStringSelection(), aBold, aItalic, aForDrawingSheet );
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -60,20 +60,9 @@ wxString GRID_CELL_TEXT_BUTTON::GetValue() const
|
||||
void GRID_CELL_TEXT_BUTTON::SetSize( const wxRect& aRect )
|
||||
{
|
||||
wxRect rect( aRect );
|
||||
WX_GRID::CellEditorTransformSizeRect( rect );
|
||||
|
||||
#if defined( __WXMAC__ )
|
||||
rect.Inflate( 2 ); // ignore FOCUS_RING
|
||||
#elif defined( __WXGTK__ )
|
||||
rect.Inflate( -3 ); // The -3 is a very sad hack here. Some GTK themes overrun the
|
||||
// default -1, preventing display. Unfortunately, we don't appear to
|
||||
// have a good method of finding the current margin needed.
|
||||
// Some GTK resize events seem to update the cell size but not all and
|
||||
// not consistently.
|
||||
#else
|
||||
rect.Inflate( -1 );
|
||||
#endif
|
||||
|
||||
Combo()->SetSize( rect, wxSIZE_ALLOW_MINUS_ONE );
|
||||
wxGridCellEditor::SetSize( rect );
|
||||
}
|
||||
|
||||
|
||||
@@ -233,6 +222,7 @@ void GRID_CELL_SYMBOL_ID_EDITOR::Create( wxWindow* aParent, wxWindowID aId,
|
||||
wxEvtHandler* aEventHandler )
|
||||
{
|
||||
m_control = new TEXT_BUTTON_SYMBOL_CHOOSER( aParent, m_dlg, m_preselect );
|
||||
WX_GRID::CellEditorSetMargins( Combo() );
|
||||
|
||||
wxGridCellEditor::Create( aParent, aId, aEventHandler );
|
||||
}
|
||||
@@ -244,7 +234,7 @@ public:
|
||||
TEXT_BUTTON_FP_CHOOSER( wxWindow* aParent, DIALOG_SHIM* aParentDlg,
|
||||
const wxString& aSymbolNetlist, const wxString& aPreselect ) :
|
||||
wxComboCtrl( aParent, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize,
|
||||
wxTE_PROCESS_ENTER ),
|
||||
wxTE_PROCESS_ENTER | wxBORDER_NONE ),
|
||||
m_dlg( aParentDlg ),
|
||||
m_preselect( aPreselect ),
|
||||
m_symbolNetlist( aSymbolNetlist.ToStdString() )
|
||||
@@ -316,6 +306,7 @@ void GRID_CELL_FPID_EDITOR::Create( wxWindow* aParent, wxWindowID aId,
|
||||
wxEvtHandler* aEventHandler )
|
||||
{
|
||||
m_control = new TEXT_BUTTON_FP_CHOOSER( aParent, m_dlg, m_symbolNetlist, m_preselect );
|
||||
WX_GRID::CellEditorSetMargins( Combo() );
|
||||
|
||||
#if wxUSE_VALIDATORS
|
||||
// validate text in textctrl, if validator is set
|
||||
@@ -334,7 +325,7 @@ class TEXT_BUTTON_URL : public wxComboCtrl
|
||||
public:
|
||||
TEXT_BUTTON_URL( wxWindow* aParent, DIALOG_SHIM* aParentDlg, SEARCH_STACK* aSearchStack ) :
|
||||
wxComboCtrl( aParent, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize,
|
||||
wxTE_PROCESS_ENTER ),
|
||||
wxTE_PROCESS_ENTER | wxBORDER_NONE ),
|
||||
m_dlg( aParentDlg ),
|
||||
m_searchStack( aSearchStack )
|
||||
{
|
||||
@@ -367,6 +358,7 @@ void GRID_CELL_URL_EDITOR::Create( wxWindow* aParent, wxWindowID aId,
|
||||
wxEvtHandler* aEventHandler )
|
||||
{
|
||||
m_control = new TEXT_BUTTON_URL( aParent, m_dlg, m_searchStack );
|
||||
WX_GRID::CellEditorSetMargins( Combo() );
|
||||
|
||||
#if wxUSE_VALIDATORS
|
||||
// validate text in textctrl, if validator is set
|
||||
@@ -388,7 +380,7 @@ public:
|
||||
bool aNormalize = false,
|
||||
const wxString& aNormalizeBasePath = wxEmptyString ) :
|
||||
wxComboCtrl( aParent, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize,
|
||||
wxTE_PROCESS_ENTER ),
|
||||
wxTE_PROCESS_ENTER | wxBORDER_NONE ),
|
||||
m_dlg( aParentDlg ),
|
||||
m_grid( aGrid ),
|
||||
m_currentDir( aCurrentDir ),
|
||||
@@ -408,7 +400,7 @@ public:
|
||||
bool aNormalize = false,
|
||||
const wxString& aNormalizeBasePath = wxEmptyString ) :
|
||||
wxComboCtrl( aParent, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize,
|
||||
wxTE_PROCESS_ENTER ),
|
||||
wxTE_PROCESS_ENTER | wxBORDER_NONE ),
|
||||
m_dlg( aParentDlg ),
|
||||
m_grid( aGrid ),
|
||||
m_currentDir( aCurrentDir ),
|
||||
@@ -524,6 +516,8 @@ void GRID_CELL_PATH_EDITOR::Create( wxWindow* aParent, wxWindowID aId,
|
||||
m_control = new TEXT_BUTTON_FILE_BROWSER( aParent, m_dlg, m_grid, m_currentDir, m_fileFilter,
|
||||
m_normalize, m_normalizeBasePath );
|
||||
|
||||
WX_GRID::CellEditorSetMargins( Combo() );
|
||||
|
||||
#if wxUSE_VALIDATORS
|
||||
// validate text in textctrl, if validator is set
|
||||
if ( m_validator )
|
||||
|
||||
@@ -21,9 +21,56 @@
|
||||
#include <string_utils.h>
|
||||
#include <wx/stc/stc.h>
|
||||
#include <widgets/grid_text_helpers.h>
|
||||
#include <widgets/wx_grid.h>
|
||||
#include <scintilla_tricks.h>
|
||||
|
||||
|
||||
//-------- GRID_CELL_TEXT_EDITOR ------------------------------------------------------
|
||||
//
|
||||
|
||||
GRID_CELL_TEXT_EDITOR::GRID_CELL_TEXT_EDITOR() : wxGridCellTextEditor()
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
void GRID_CELL_TEXT_EDITOR::SetValidator( const wxValidator& validator )
|
||||
{
|
||||
// keep our own copy because wxGridCellTextEditor's is annoyingly private
|
||||
m_validator.reset( static_cast<wxValidator*>( validator.Clone() ) );
|
||||
|
||||
wxGridCellTextEditor::SetValidator( *m_validator );
|
||||
}
|
||||
|
||||
|
||||
void GRID_CELL_TEXT_EDITOR::StartingKey( wxKeyEvent& event )
|
||||
{
|
||||
if( m_validator )
|
||||
{
|
||||
m_validator.get()->SetWindow( Text() );
|
||||
m_validator.get()->ProcessEvent( event );
|
||||
}
|
||||
|
||||
if( event.GetSkipped() )
|
||||
{
|
||||
wxGridCellTextEditor::StartingKey( event );
|
||||
event.Skip( false );
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
void GRID_CELL_TEXT_EDITOR::SetSize( const wxRect& aRect )
|
||||
{
|
||||
wxRect rect( aRect );
|
||||
WX_GRID::CellEditorTransformSizeRect( rect );
|
||||
|
||||
#if defined( __WXMSW__ )
|
||||
rect.Offset( 0, 1 );
|
||||
#endif
|
||||
|
||||
wxGridCellEditor::SetSize( rect );
|
||||
}
|
||||
|
||||
|
||||
//-------- GRID_CELL_ESCAPED_TEXT_RENDERER ------------------------------------------------------
|
||||
//
|
||||
|
||||
@@ -69,9 +116,25 @@ GRID_CELL_STC_EDITOR::GRID_CELL_STC_EDITOR( bool aIgnoreCase,
|
||||
{ }
|
||||
|
||||
|
||||
void GRID_CELL_STC_EDITOR::SetSize( const wxRect& aRect )
|
||||
{
|
||||
wxRect rect( aRect );
|
||||
WX_GRID::CellEditorTransformSizeRect( rect );
|
||||
|
||||
#if defined( __WXMSW__ )
|
||||
rect.Offset( -1, 1 );
|
||||
#elif defined( __WXGTK__ )
|
||||
rect.Offset( -1, 3 );
|
||||
#endif
|
||||
|
||||
wxGridCellEditor::SetSize( rect );
|
||||
}
|
||||
|
||||
|
||||
void GRID_CELL_STC_EDITOR::Create( wxWindow* aParent, wxWindowID aId, wxEvtHandler* aEventHandler )
|
||||
{
|
||||
m_control = new wxStyledTextCtrl( aParent );
|
||||
m_control = new wxStyledTextCtrl( aParent, wxID_ANY, wxDefaultPosition, wxDefaultSize,
|
||||
wxBORDER_NONE );
|
||||
|
||||
stc_ctrl()->SetTabIndents( false );
|
||||
stc_ctrl()->SetBackSpaceUnIndents( false );
|
||||
|
||||
@@ -107,6 +107,15 @@ KISTATUSBAR::KISTATUSBAR( int aNumberFields, wxWindow* parent, wxWindowID id ) :
|
||||
}
|
||||
|
||||
|
||||
KISTATUSBAR::~KISTATUSBAR()
|
||||
{
|
||||
m_notificationsButton->Unbind( wxEVT_BUTTON, &KISTATUSBAR::onNotificationsIconClick, this );
|
||||
Unbind( wxEVT_SIZE, &KISTATUSBAR::onSize, this );
|
||||
m_backgroundProgressBar->Unbind( wxEVT_LEFT_DOWN, &KISTATUSBAR::onBackgroundProgressClick,
|
||||
this );
|
||||
}
|
||||
|
||||
|
||||
void KISTATUSBAR::onNotificationsIconClick( wxCommandEvent& aEvent )
|
||||
{
|
||||
wxPoint pos = m_notificationsButton->GetScreenPosition();
|
||||
|
||||
@@ -73,6 +73,15 @@ STD_BITMAP_BUTTON::STD_BITMAP_BUTTON( wxWindow* aParent, wxWindowID aId,
|
||||
|
||||
STD_BITMAP_BUTTON::~STD_BITMAP_BUTTON()
|
||||
{
|
||||
Unbind( wxEVT_PAINT, &STD_BITMAP_BUTTON::OnPaint, this );
|
||||
Unbind( wxEVT_LEFT_UP, &STD_BITMAP_BUTTON::OnLeftButtonUp, this );
|
||||
Unbind( wxEVT_LEFT_DOWN, &STD_BITMAP_BUTTON::OnLeftButtonDown, this );
|
||||
Unbind( wxEVT_KILL_FOCUS, &STD_BITMAP_BUTTON::OnKillFocus, this );
|
||||
Unbind( wxEVT_LEAVE_WINDOW, &STD_BITMAP_BUTTON::OnMouseLeave, this );
|
||||
Unbind( wxEVT_ENTER_WINDOW, &STD_BITMAP_BUTTON::OnMouseEnter, this );
|
||||
|
||||
Unbind( wxEVT_SYS_COLOUR_CHANGED,
|
||||
wxSysColourChangedEventHandler( STD_BITMAP_BUTTON::onThemeChanged ), this );
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -24,6 +24,8 @@
|
||||
#include <wx/tokenzr.h>
|
||||
#include <wx/dc.h>
|
||||
#include <wx/settings.h>
|
||||
#include <wx/event.h> // Needed for textentry.h on MSW
|
||||
#include <wx/textentry.h>
|
||||
|
||||
#include <widgets/wx_grid.h>
|
||||
#include <widgets/ui_common.h>
|
||||
@@ -34,6 +36,21 @@
|
||||
#define MIN_GRIDCELL_MARGIN FromDIP( 3 )
|
||||
|
||||
|
||||
void WX_GRID::CellEditorSetMargins( wxTextEntryBase* aEntry )
|
||||
{
|
||||
// This is consistent with wxGridCellTextEditor. But works differently across platforms or course.
|
||||
aEntry->SetMargins( 0, 0 );
|
||||
}
|
||||
|
||||
|
||||
void WX_GRID::CellEditorTransformSizeRect( wxRect& aRect )
|
||||
{
|
||||
#if defined( __WXMSW__ ) || defined( __WXGTK__ )
|
||||
aRect.Deflate( 2 );
|
||||
#endif
|
||||
}
|
||||
|
||||
|
||||
wxColour getBorderColour()
|
||||
{
|
||||
KIGFX::COLOR4D bg = wxSystemSettings::GetColour( wxSYS_COLOUR_FRAMEBK );
|
||||
|
||||
@@ -159,7 +159,10 @@ void WX_INFOBAR::ShowMessage( const wxString& aMessage, int aFlags )
|
||||
|
||||
m_updateLock = true;
|
||||
|
||||
wxInfoBarGeneric::ShowMessage( aMessage, aFlags );
|
||||
wxString msg = aMessage;
|
||||
msg.Trim();
|
||||
|
||||
wxInfoBarGeneric::ShowMessage( msg, aFlags );
|
||||
|
||||
if( m_auiManager )
|
||||
updateAuiLayout( true );
|
||||
|
||||
@@ -154,15 +154,15 @@ wxString BOM_GENERATOR_HANDLER::readHeader( const wxString& aEndSection )
|
||||
const wxString header( wxS( "@package" ) );
|
||||
|
||||
// Extract substring between @package and endsection
|
||||
int strstart = data.Find( header );
|
||||
size_t strstart = data.find( header );
|
||||
|
||||
if( strstart == wxNOT_FOUND )
|
||||
if( strstart == wxString::npos )
|
||||
return wxEmptyString;
|
||||
|
||||
strstart += header.Length();
|
||||
int strend = data.find( aEndSection, strstart );
|
||||
size_t strend = data.find( aEndSection, strstart );
|
||||
|
||||
if( strend == wxNOT_FOUND )
|
||||
if( strend == wxString::npos )
|
||||
return wxEmptyString;
|
||||
|
||||
// Remove empty line if any
|
||||
@@ -179,15 +179,15 @@ wxString BOM_GENERATOR_HANDLER::getOutputExtension( const wxString& aHeader )
|
||||
// looks for output argument of the form `"%O.extension"`
|
||||
const wxString outputarg( wxS( "\"%O" ) );
|
||||
|
||||
int strstart = aHeader.Find( outputarg );
|
||||
size_t strstart = aHeader.find( outputarg );
|
||||
|
||||
if( strstart == wxNOT_FOUND )
|
||||
if( strstart == wxString::npos )
|
||||
return wxEmptyString;
|
||||
|
||||
strstart += outputarg.Length();
|
||||
int strend = aHeader.find( wxS( "\"" ), strstart );
|
||||
size_t strend = aHeader.find( wxS( "\"" ), strstart );
|
||||
|
||||
if( strend == wxNOT_FOUND )
|
||||
if( strend == wxString::npos )
|
||||
return wxEmptyString;
|
||||
|
||||
return aHeader.SubString( strstart, strend - 1 );
|
||||
|
||||
@@ -2338,6 +2338,12 @@ void CONNECTION_GRAPH::buildConnectionGraph( std::function<void( SCH_ITEM* )>* a
|
||||
|
||||
netSettings->m_NetClassLabelAssignments.clear();
|
||||
|
||||
// Used to track where netclasses are assigned to a net from a bus netclass
|
||||
// definition. Without this tracking, depending on the order of testing for
|
||||
// netclasses, an already-assigned netclass on a bus member can be deleted
|
||||
// if an explicitly labelled member net does not have a netclass assigned.
|
||||
std::unordered_set<wxString> netclassAssignedFromBus;
|
||||
|
||||
auto dirtySubgraphs =
|
||||
[&]( const std::vector<CONNECTION_SUBGRAPH*>& subgraphs )
|
||||
{
|
||||
@@ -2381,40 +2387,83 @@ void CONNECTION_GRAPH::buildConnectionGraph( std::function<void( SCH_ITEM* )>* a
|
||||
|
||||
const wxString netname = driverSubgraph->GetNetName();
|
||||
|
||||
// Handle netclass assignments on buses
|
||||
if( driverSubgraph->m_driver_connection->IsBus() )
|
||||
{
|
||||
for( const auto& member : driverSubgraph->m_driver_connection->Members() )
|
||||
auto processBusMember = [&, this]( const SCH_CONNECTION* member )
|
||||
{
|
||||
if( netclass.IsEmpty() )
|
||||
netSettings->m_NetClassLabelAssignments.erase( member->Name() );
|
||||
else
|
||||
if( !netclass.IsEmpty() )
|
||||
{
|
||||
netSettings->m_NetClassLabelAssignments[member->Name()] = netclass;
|
||||
netclassAssignedFromBus.insert( member->Name() );
|
||||
}
|
||||
|
||||
auto ii = m_net_name_to_subgraphs_map.find( member->Name() );
|
||||
|
||||
if( ii != m_net_name_to_subgraphs_map.end() )
|
||||
dirtySubgraphs( ii->second );
|
||||
if( oldAssignments.count( member->Name() ) )
|
||||
{
|
||||
if( oldAssignments[member->Name()] != netclass )
|
||||
{
|
||||
affectedNetclassNetAssignments.insert( member->Name() );
|
||||
|
||||
if( ii != m_net_name_to_subgraphs_map.end() )
|
||||
dirtySubgraphs( ii->second );
|
||||
}
|
||||
}
|
||||
else if( !netclass.IsEmpty() )
|
||||
{
|
||||
affectedNetclassNetAssignments.insert( member->Name() );
|
||||
|
||||
if( ii != m_net_name_to_subgraphs_map.end() )
|
||||
dirtySubgraphs( ii->second );
|
||||
}
|
||||
};
|
||||
|
||||
for( const std::shared_ptr<SCH_CONNECTION>& member :
|
||||
driverSubgraph->m_driver_connection->Members() )
|
||||
{
|
||||
// Check if this member itself is a bus (which can be the case
|
||||
// for vector buses as members of a bus, see
|
||||
// https://gitlab.com/kicad/code/kicad/-/issues/16545
|
||||
if( member->IsBus() )
|
||||
{
|
||||
for( const std::shared_ptr<SCH_CONNECTION>& nestedMember :
|
||||
member->Members() )
|
||||
{
|
||||
processBusMember( nestedMember.get() );
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
processBusMember( member.get() );
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if( netclass.IsEmpty() )
|
||||
netSettings->m_NetClassLabelAssignments.erase( netname );
|
||||
else
|
||||
netSettings->m_NetClassLabelAssignments[netname] = netclass;
|
||||
|
||||
if( oldAssignments.count( netname ) )
|
||||
// Handle netclass assignments on nets / overarching bus definitions.
|
||||
// Note: currently a netclass definition on a bus will override any
|
||||
// on a net. This will be resolved with multiple netclasses.
|
||||
if( !netclassAssignedFromBus.count( netname ) )
|
||||
{
|
||||
if( oldAssignments[netname] != netclass )
|
||||
if( !netclass.IsEmpty() )
|
||||
{
|
||||
netSettings->m_NetClassLabelAssignments[netname] = netclass;
|
||||
}
|
||||
|
||||
if( oldAssignments.count( netname ) )
|
||||
{
|
||||
if( oldAssignments[netname] != netclass )
|
||||
{
|
||||
affectedNetclassNetAssignments.insert( netname );
|
||||
dirtySubgraphs( subgraphs );
|
||||
}
|
||||
}
|
||||
else if( !netclass.IsEmpty() )
|
||||
{
|
||||
affectedNetclassNetAssignments.insert( netname );
|
||||
dirtySubgraphs( subgraphs );
|
||||
}
|
||||
}
|
||||
else if( !netclass.IsEmpty() )
|
||||
{
|
||||
affectedNetclassNetAssignments.insert( netname );
|
||||
dirtySubgraphs( subgraphs );
|
||||
}
|
||||
};
|
||||
|
||||
for( const auto& [ netname, subgraphs ] : m_net_name_to_subgraphs_map )
|
||||
|
||||
@@ -230,7 +230,7 @@ void DIALOG_ANNOTATE::OnApplyClick( wxCommandEvent& event )
|
||||
m_sdbSizer1Cancel->SetDefault();
|
||||
|
||||
// Don't close dialog if there are things the user needs to address
|
||||
if( reporter.HasMessage() )
|
||||
if( reporter.HasMessageOfSeverity( RPT_SEVERITY_ERROR | RPT_SEVERITY_WARNING ) )
|
||||
return;
|
||||
|
||||
if( m_infoBar->IsShown() )
|
||||
|
||||
@@ -333,8 +333,7 @@ void DIALOG_BOM::OnRunGenerator( wxCommandEvent& event )
|
||||
wxString fullfilename = fn.GetFullPath();
|
||||
m_parent->ClearMsgPanel();
|
||||
|
||||
wxString reportmsg;
|
||||
WX_STRING_REPORTER reporter( &reportmsg );
|
||||
WX_STRING_REPORTER reporter;
|
||||
m_parent->SetNetListerCommand( m_textCtrlCommand->GetValue() );
|
||||
|
||||
#ifdef __WINDOWS__
|
||||
@@ -350,7 +349,7 @@ void DIALOG_BOM::OnRunGenerator( wxCommandEvent& event )
|
||||
if( !status )
|
||||
DisplayError( this, _( "Failed to create file." ) );
|
||||
|
||||
m_Messages->SetValue( reportmsg );
|
||||
m_Messages->SetValue( reporter.GetMessages() );
|
||||
|
||||
// Force focus back on the dialog
|
||||
SetFocus();
|
||||
|
||||
@@ -293,10 +293,11 @@ void DIALOG_GLOBAL_EDIT_TEXT_AND_GRAPHICS::processItem( SCH_COMMIT* aCommit,
|
||||
if( m_italic->Get3StateValue() != wxCHK_UNDETERMINED )
|
||||
eda_text->SetItalic( m_italic->GetValue() );
|
||||
|
||||
// Must come after SetTextSize()
|
||||
if( m_bold->Get3StateValue() != wxCHK_UNDETERMINED )
|
||||
eda_text->SetBold( m_bold->GetValue() );
|
||||
|
||||
// Must come after bold & italic
|
||||
// Must come after SetBold() & SetItalic()
|
||||
if( m_fontCtrl->GetStringSelection() != INDETERMINATE_ACTION )
|
||||
{
|
||||
eda_text->SetFont( m_fontCtrl->GetFontSelection( eda_text->IsBold(),
|
||||
|
||||
@@ -553,20 +553,8 @@ bool DIALOG_LABEL_PROPERTIES::TransferDataFromWindow()
|
||||
else if( m_currentLabel->GetTextWidth() != m_textSize.GetValue() )
|
||||
m_currentLabel->SetTextSize( VECTOR2I( m_textSize.GetValue(), m_textSize.GetValue() ) );
|
||||
|
||||
if( m_bold->IsChecked() != m_currentLabel->IsBold() )
|
||||
{
|
||||
if( m_bold->IsChecked() )
|
||||
{
|
||||
m_currentLabel->SetBold( true );
|
||||
m_currentLabel->SetTextThickness( GetPenSizeForBold( m_currentLabel->GetTextWidth() ) );
|
||||
}
|
||||
else
|
||||
{
|
||||
m_currentLabel->SetBold( false );
|
||||
m_currentLabel->SetTextThickness( 0 ); // Use default pen width
|
||||
}
|
||||
}
|
||||
|
||||
// Must come after SetTextSize()
|
||||
m_currentLabel->SetBold( m_bold->IsChecked() );
|
||||
m_currentLabel->SetItalic( m_italic->IsChecked() );
|
||||
|
||||
m_currentLabel->SetTextColor( m_textColorSwatch->GetSwatchColor() );
|
||||
|
||||
@@ -262,8 +262,9 @@ bool DIALOG_LIB_TEXT_PROPERTIES::TransferDataFromWindow()
|
||||
else
|
||||
m_graphicText->SetBodyStyle( 0 );
|
||||
|
||||
m_graphicText->SetItalic( m_italic->IsChecked() );
|
||||
// Must come after SetTextSize()
|
||||
m_graphicText->SetBold( m_bold->IsChecked() );
|
||||
m_graphicText->SetItalic( m_italic->IsChecked() );
|
||||
m_graphicText->SetTextColor( m_textColorSwatch->GetSwatchColor() );
|
||||
|
||||
if( m_hAlignLeft->IsChecked() )
|
||||
|
||||
@@ -279,21 +279,10 @@ bool DIALOG_LIB_TEXTBOX_PROPERTIES::TransferDataFromWindow()
|
||||
m_italic->IsChecked() ) );
|
||||
}
|
||||
|
||||
if( m_bold->IsChecked() != m_currentText->IsBold() )
|
||||
{
|
||||
if( m_bold->IsChecked() )
|
||||
{
|
||||
m_currentText->SetBold( true );
|
||||
m_currentText->SetTextThickness( GetPenSizeForBold( m_currentText->GetTextWidth() ) );
|
||||
}
|
||||
else
|
||||
{
|
||||
m_currentText->SetBold( false );
|
||||
m_currentText->SetTextThickness( 0 ); // Use default pen width
|
||||
}
|
||||
}
|
||||
|
||||
// Must come after SetTextSize()
|
||||
m_currentText->SetBold( m_italic->IsChecked() );
|
||||
m_currentText->SetItalic( m_italic->IsChecked() );
|
||||
|
||||
m_currentText->SetTextColor( m_textColorSwatch->GetSwatchColor() );
|
||||
|
||||
if( m_hAlignRight->IsChecked() )
|
||||
|
||||
@@ -147,26 +147,14 @@ bool DIALOG_SHEET_PIN_PROPERTIES::TransferDataFromWindow()
|
||||
m_italic->IsChecked() ) );
|
||||
}
|
||||
|
||||
if( m_bold->IsChecked() != m_sheetPin->IsBold() )
|
||||
{
|
||||
if( m_bold->IsChecked() )
|
||||
{
|
||||
m_sheetPin->SetBold( true );
|
||||
m_sheetPin->SetTextThickness( GetPenSizeForBold( m_sheetPin->GetTextWidth() ) );
|
||||
}
|
||||
else
|
||||
{
|
||||
m_sheetPin->SetBold( false );
|
||||
m_sheetPin->SetTextThickness( 0 ); // Use default pen width
|
||||
}
|
||||
}
|
||||
|
||||
m_sheetPin->SetItalic( m_italic->IsChecked() );
|
||||
|
||||
// Currently, eeschema uses only the text width as text size,
|
||||
// and expects text width = text height
|
||||
m_sheetPin->SetTextSize( VECTOR2I( m_textSize.GetIntValue(), m_textSize.GetIntValue() ) );
|
||||
|
||||
// Must come after SetTextSize()
|
||||
m_sheetPin->SetBold( m_bold->IsChecked() );
|
||||
m_sheetPin->SetItalic( m_italic->IsChecked() );
|
||||
|
||||
m_sheetPin->SetTextColor( m_textColorSwatch->GetSwatchColor() );
|
||||
|
||||
if( m_input->GetValue() ) m_sheetPin->SetShape( LABEL_FLAG_SHAPE::L_INPUT );
|
||||
|
||||
@@ -431,6 +431,9 @@ bool DIALOG_SHEET_PROPERTIES::TransferDataFromWindow()
|
||||
}
|
||||
else
|
||||
{
|
||||
if( m_updateHierarchyNavigator )
|
||||
*m_updateHierarchyNavigator = true;
|
||||
|
||||
// If we are renaming files, the undo/redo list becomes invalid and must be cleared.
|
||||
m_frame->ClearUndoRedoList();
|
||||
m_frame->OnModify();
|
||||
|
||||
@@ -46,6 +46,7 @@
|
||||
#include <sch_edit_frame.h>
|
||||
#include <sim/sim_model_l_mutual.h>
|
||||
#include <sim/spice_circuit_model.h>
|
||||
#include <wx/log.h>
|
||||
|
||||
using CATEGORY = SIM_MODEL::PARAM::CATEGORY;
|
||||
|
||||
@@ -77,8 +78,7 @@ DIALOG_SIM_MODEL<T_symbol, T_field>::DIALOG_SIM_MODEL( wxWindow* aParent, EDA_BA
|
||||
m_scintillaTricksSubckt( nullptr ),
|
||||
m_firstCategory( nullptr ),
|
||||
m_prevParamGridSelection( nullptr ),
|
||||
m_lastParamGridWidth( 0 ),
|
||||
m_inKillFocus( false )
|
||||
m_lastParamGridWidth( 0 )
|
||||
{
|
||||
m_browseButton->SetBitmap( KiBitmapBundle( BITMAPS::small_folder ) );
|
||||
|
||||
@@ -173,8 +173,7 @@ bool DIALOG_SIM_MODEL<T_symbol, T_field>::TransferDataToWindow()
|
||||
wxString pinMap;
|
||||
bool storeInValue = false;
|
||||
|
||||
wxString msg;
|
||||
WX_STRING_REPORTER reporter( &msg );
|
||||
WX_STRING_REPORTER reporter;
|
||||
|
||||
auto setFieldValue =
|
||||
[&]( const wxString& aFieldName, const wxString& aValue )
|
||||
@@ -219,12 +218,14 @@ bool DIALOG_SIM_MODEL<T_symbol, T_field>::TransferDataToWindow()
|
||||
// The model is sourced from a library, optionally with instance overrides.
|
||||
m_rbLibraryModel->SetValue( true );
|
||||
|
||||
if( !loadLibrary( libraryFilename ) )
|
||||
if( !loadLibrary( libraryFilename, reporter ) )
|
||||
{
|
||||
if( reporter.HasMessage() )
|
||||
m_infoBar->ShowMessage( reporter.GetMessages() );
|
||||
|
||||
m_libraryPathText->ChangeValue( libraryFilename );
|
||||
m_curModelType = SIM_MODEL::ReadTypeFromFields( m_fields, reporter );
|
||||
|
||||
// load library will mangle the set reporter
|
||||
m_libraryModelsMgr.CreateModel( nullptr, m_sortedPartPins, m_fields, reporter );
|
||||
|
||||
m_modelNameChoice->Append( _( "<unknown>" ) );
|
||||
@@ -237,14 +238,15 @@ bool DIALOG_SIM_MODEL<T_symbol, T_field>::TransferDataToWindow()
|
||||
|
||||
if( modelIdx == wxNOT_FOUND )
|
||||
{
|
||||
DisplayErrorMessage( this, wxString::Format( _( "No model named '%s' in library." ),
|
||||
modelName ) );
|
||||
m_infoBar->ShowMessage( wxString::Format( _( "No model named '%s' in library." ),
|
||||
modelName ) );
|
||||
|
||||
// Default to first item in library
|
||||
m_modelNameChoice->SetSelection( 0 );
|
||||
}
|
||||
else
|
||||
{
|
||||
m_infoBar->Hide();
|
||||
m_modelNameChoice->SetSelection( modelIdx );
|
||||
}
|
||||
|
||||
@@ -302,24 +304,24 @@ bool DIALOG_SIM_MODEL<T_symbol, T_field>::TransferDataToWindow()
|
||||
// The model is sourced from the instance.
|
||||
m_rbBuiltinModel->SetValue( true );
|
||||
|
||||
msg.clear();
|
||||
reporter.Clear();
|
||||
m_curModelType = SIM_MODEL::ReadTypeFromFields( m_fields, reporter );
|
||||
|
||||
if( reporter.HasMessage() )
|
||||
DisplayErrorMessage( this, msg );
|
||||
DisplayErrorMessage( this, reporter.GetMessages() );
|
||||
}
|
||||
|
||||
for( SIM_MODEL::TYPE type : SIM_MODEL::TYPE_ITERATOR() )
|
||||
{
|
||||
if( m_rbBuiltinModel->GetValue() && type == m_curModelType )
|
||||
{
|
||||
msg.clear();
|
||||
reporter.Clear();
|
||||
m_builtinModelsMgr.CreateModel( m_fields, m_sortedPartPins, false, reporter );
|
||||
|
||||
if( reporter.HasMessage() )
|
||||
{
|
||||
DisplayErrorMessage( this, _( "Failed to read simulation model from fields." )
|
||||
+ wxT( "\n\n" ) + msg );
|
||||
+ wxT( "\n\n" ) + reporter.GetMessages() );
|
||||
}
|
||||
}
|
||||
else
|
||||
@@ -807,37 +809,28 @@ void DIALOG_SIM_MODEL<T_symbol, T_field>::removeOrphanedPinAssignments( SIM_MODE
|
||||
|
||||
|
||||
template <typename T_symbol, typename T_field>
|
||||
bool DIALOG_SIM_MODEL<T_symbol, T_field>::loadLibrary( const wxString& aLibraryPath,
|
||||
bool aForceReload )
|
||||
bool DIALOG_SIM_MODEL<T_symbol, T_field>::loadLibrary( const wxString& aLibraryPath, REPORTER& aReporter,
|
||||
bool aForceReload )
|
||||
{
|
||||
if( m_prevLibrary == aLibraryPath && !aForceReload )
|
||||
return true;
|
||||
|
||||
wxString msg;
|
||||
WX_STRING_REPORTER reporter( &msg );
|
||||
|
||||
m_libraryModelsMgr.SetForceFullParse();
|
||||
m_libraryModelsMgr.SetLibrary( aLibraryPath, reporter );
|
||||
m_libraryModelsMgr.SetLibrary( aLibraryPath, aReporter );
|
||||
|
||||
if( reporter.HasMessage() )
|
||||
{
|
||||
DisplayErrorMessage( this, msg );
|
||||
if( aReporter.HasMessageOfSeverity( RPT_SEVERITY_UNDEFINED | RPT_SEVERITY_ERROR ) )
|
||||
return false;
|
||||
}
|
||||
|
||||
std::string modelName = SIM_MODEL::GetFieldValue( &m_fields, SIM_LIBRARY::NAME_FIELD );
|
||||
|
||||
for( const auto& [baseModelName, baseModel] : library()->GetModels() )
|
||||
{
|
||||
if( baseModelName == modelName )
|
||||
m_libraryModelsMgr.CreateModel( &baseModel, m_sortedPartPins, m_fields, reporter );
|
||||
m_libraryModelsMgr.CreateModel( &baseModel, m_sortedPartPins, m_fields, aReporter );
|
||||
else
|
||||
m_libraryModelsMgr.CreateModel( &baseModel, m_sortedPartPins, reporter );
|
||||
m_libraryModelsMgr.CreateModel( &baseModel, m_sortedPartPins, aReporter );
|
||||
}
|
||||
|
||||
if( reporter.HasMessage() )
|
||||
DisplayErrorMessage( this, msg );
|
||||
|
||||
m_rbLibraryModel->SetValue( true );
|
||||
m_libraryPathText->ChangeValue( aLibraryPath );
|
||||
|
||||
@@ -1088,16 +1081,16 @@ SIM_MODEL& DIALOG_SIM_MODEL<T_symbol, T_field>::curModel() const
|
||||
{
|
||||
int sel = m_modelNameChoice->GetSelection();
|
||||
|
||||
if( sel >= 0 && sel < (int) m_libraryModelsMgr.GetModels().size() )
|
||||
if( sel >= 0 && sel < static_cast<int>( m_libraryModelsMgr.GetModels().size() ) )
|
||||
return m_libraryModelsMgr.GetModels().at( sel ).get();
|
||||
}
|
||||
else
|
||||
{
|
||||
if( (int) m_curModelType < (int) m_builtinModelsMgr.GetModels().size() )
|
||||
return m_builtinModelsMgr.GetModels().at( (int) m_curModelType );
|
||||
if( static_cast<int>( m_curModelType ) < static_cast<int>( m_builtinModelsMgr.GetModels().size() ) )
|
||||
return m_builtinModelsMgr.GetModels().at( static_cast<int>( m_curModelType ) );
|
||||
}
|
||||
|
||||
return m_builtinModelsMgr.GetModels().at( (int) SIM_MODEL::TYPE::NONE );
|
||||
return m_builtinModelsMgr.GetModels().at( static_cast<int>( SIM_MODEL::TYPE::NONE ) );
|
||||
}
|
||||
|
||||
|
||||
@@ -1174,49 +1167,46 @@ void DIALOG_SIM_MODEL<T_symbol, T_field>::onRadioButton( wxCommandEvent& aEvent
|
||||
}
|
||||
|
||||
|
||||
|
||||
template <typename T_symbol, typename T_field>
|
||||
void DIALOG_SIM_MODEL<T_symbol, T_field>::onLibrarayPathText( wxCommandEvent& aEvent )
|
||||
void DIALOG_SIM_MODEL<T_symbol, T_field>::onLibraryPathText( wxCommandEvent& aEvent )
|
||||
{
|
||||
m_rbLibraryModel->SetValue( true );
|
||||
updateWidgets();
|
||||
}
|
||||
|
||||
|
||||
template <typename T_symbol, typename T_field>
|
||||
void DIALOG_SIM_MODEL<T_symbol, T_field>::onLibraryPathTextEnter( wxCommandEvent& aEvent )
|
||||
{
|
||||
if( m_rbLibraryModel->GetValue() )
|
||||
{
|
||||
wxString path = m_libraryPathText->GetValue();
|
||||
m_rbLibraryModel->SetValue( true );
|
||||
|
||||
if( !path.IsEmpty() )
|
||||
{
|
||||
try
|
||||
{
|
||||
loadLibrary( path );
|
||||
updateWidgets();
|
||||
}
|
||||
catch( const IO_ERROR& )
|
||||
{
|
||||
// TODO: Add an infobar to report the error?
|
||||
}
|
||||
}
|
||||
}
|
||||
WX_STRING_REPORTER reporter;
|
||||
wxString path = m_libraryPathText->GetValue();
|
||||
|
||||
if( loadLibrary( path, reporter, true ) )
|
||||
m_infoBar->Hide();
|
||||
else if( reporter.HasMessage() )
|
||||
m_infoBar->ShowMessage( reporter.GetMessages() );
|
||||
|
||||
updateWidgets();
|
||||
}
|
||||
|
||||
|
||||
template <typename T_symbol, typename T_field>
|
||||
void DIALOG_SIM_MODEL<T_symbol, T_field>::onLibraryPathTextKillFocus( wxFocusEvent& aEvent )
|
||||
{
|
||||
if( !m_inKillFocus )
|
||||
{
|
||||
m_inKillFocus = true;
|
||||
CallAfter(
|
||||
[this]()
|
||||
{
|
||||
// Disable logging -- otherwise we'll end up in an endless loop of show-log,
|
||||
// kill-focus, show-log, kill-focus, etc.
|
||||
wxLogNull doNotLog;
|
||||
|
||||
wxCommandEvent dummy;
|
||||
onLibraryPathTextEnter( dummy );
|
||||
wxCommandEvent dummy;
|
||||
onLibraryPathTextEnter( dummy );
|
||||
} );
|
||||
|
||||
m_inKillFocus = false;
|
||||
}
|
||||
aEvent.Skip(); // mandatory in wxFocusEvent events
|
||||
}
|
||||
|
||||
|
||||
@@ -1241,7 +1231,13 @@ void DIALOG_SIM_MODEL<T_symbol, T_field>::onBrowseButtonClick( wxCommandEvent& a
|
||||
if( fn.MakeRelativeTo( Prj().GetProjectPath() ) && !fn.GetFullPath().StartsWith( wxS( ".." ) ) )
|
||||
path = fn.GetFullPath();
|
||||
|
||||
loadLibrary( path, true );
|
||||
WX_STRING_REPORTER reporter;
|
||||
|
||||
if( loadLibrary( path, reporter, true ) )
|
||||
m_infoBar->Hide();
|
||||
else
|
||||
m_infoBar->ShowMessage( reporter.GetMessages() );
|
||||
|
||||
updateWidgets();
|
||||
}
|
||||
|
||||
|
||||
@@ -79,7 +79,8 @@ private:
|
||||
|
||||
void removeOrphanedPinAssignments( SIM_MODEL* aModel );
|
||||
|
||||
bool loadLibrary( const wxString& aLibraryPath, bool aForceReload = false );
|
||||
bool loadLibrary( const wxString& aLibraryPath, REPORTER& aReporter,
|
||||
bool aForceReload = false );
|
||||
|
||||
void addParamPropertyIfRelevant( SIM_MODEL* aModel, int aParamIndex );
|
||||
wxPGProperty* newParamProperty( SIM_MODEL* aModel, int aParamIndex ) const;
|
||||
@@ -94,7 +95,7 @@ private:
|
||||
int getModelPinIndex( const wxString& aModelPinString ) const;
|
||||
|
||||
void onRadioButton( wxCommandEvent& aEvent ) override;
|
||||
void onLibrarayPathText( wxCommandEvent& aEvent ) override;
|
||||
void onLibraryPathText( wxCommandEvent& aEvent ) override;
|
||||
void onLibraryPathTextEnter( wxCommandEvent& aEvent ) override;
|
||||
void onLibraryPathTextKillFocus( wxFocusEvent& aEvent ) override;
|
||||
void onBrowseButtonClick( wxCommandEvent& aEvent ) override;
|
||||
@@ -140,8 +141,7 @@ private:
|
||||
wxPGProperty* m_firstCategory; // Used to add principal parameters to root.
|
||||
wxPGProperty* m_prevParamGridSelection;
|
||||
|
||||
int m_lastParamGridWidth;
|
||||
bool m_inKillFocus;
|
||||
int m_lastParamGridWidth;
|
||||
};
|
||||
|
||||
#endif /* DIALOG_SIM_MODEL_H */
|
||||
|
||||
@@ -7,6 +7,7 @@
|
||||
|
||||
#include "widgets/std_bitmap_button.h"
|
||||
#include "widgets/wx_grid.h"
|
||||
#include "widgets/wx_infobar.h"
|
||||
|
||||
#include "dialog_sim_model_base.h"
|
||||
|
||||
@@ -19,6 +20,13 @@ DIALOG_SIM_MODEL_BASE::DIALOG_SIM_MODEL_BASE( wxWindow* parent, wxWindowID id, c
|
||||
wxBoxSizer* bSizer8;
|
||||
bSizer8 = new wxBoxSizer( wxVERTICAL );
|
||||
|
||||
m_infoBar = new WX_INFOBAR( this );
|
||||
m_infoBar->SetShowHideEffects( wxSHOW_EFFECT_NONE, wxSHOW_EFFECT_NONE );
|
||||
m_infoBar->SetEffectDuration( 500 );
|
||||
m_infoBar->Hide();
|
||||
|
||||
bSizer8->Add( m_infoBar, 0, wxEXPAND, 5 );
|
||||
|
||||
m_notebook = new wxNotebook( this, wxID_ANY, wxDefaultPosition, wxDefaultSize, 0 );
|
||||
m_modelPanel = new wxPanel( m_notebook, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxTAB_TRAVERSAL );
|
||||
wxBoxSizer* bSizerPanel;
|
||||
@@ -330,7 +338,7 @@ DIALOG_SIM_MODEL_BASE::DIALOG_SIM_MODEL_BASE( wxWindow* parent, wxWindowID id, c
|
||||
m_rbLibraryModel->Connect( wxEVT_COMMAND_RADIOBUTTON_SELECTED, wxCommandEventHandler( DIALOG_SIM_MODEL_BASE::onRadioButton ), NULL, this );
|
||||
m_pathLabel->Connect( wxEVT_UPDATE_UI, wxUpdateUIEventHandler( DIALOG_SIM_MODEL_BASE::onLibraryPathLabelUpdate ), NULL, this );
|
||||
m_libraryPathText->Connect( wxEVT_KILL_FOCUS, wxFocusEventHandler( DIALOG_SIM_MODEL_BASE::onLibraryPathTextKillFocus ), NULL, this );
|
||||
m_libraryPathText->Connect( wxEVT_COMMAND_TEXT_UPDATED, wxCommandEventHandler( DIALOG_SIM_MODEL_BASE::onLibrarayPathText ), NULL, this );
|
||||
m_libraryPathText->Connect( wxEVT_COMMAND_TEXT_UPDATED, wxCommandEventHandler( DIALOG_SIM_MODEL_BASE::onLibraryPathText ), NULL, this );
|
||||
m_libraryPathText->Connect( wxEVT_COMMAND_TEXT_ENTER, wxCommandEventHandler( DIALOG_SIM_MODEL_BASE::onLibraryPathTextEnter ), NULL, this );
|
||||
m_browseButton->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_SIM_MODEL_BASE::onBrowseButtonClick ), NULL, this );
|
||||
m_browseButton->Connect( wxEVT_UPDATE_UI, wxUpdateUIEventHandler( DIALOG_SIM_MODEL_BASE::onBrowseButtonUpdate ), NULL, this );
|
||||
@@ -367,7 +375,7 @@ DIALOG_SIM_MODEL_BASE::~DIALOG_SIM_MODEL_BASE()
|
||||
m_rbLibraryModel->Disconnect( wxEVT_COMMAND_RADIOBUTTON_SELECTED, wxCommandEventHandler( DIALOG_SIM_MODEL_BASE::onRadioButton ), NULL, this );
|
||||
m_pathLabel->Disconnect( wxEVT_UPDATE_UI, wxUpdateUIEventHandler( DIALOG_SIM_MODEL_BASE::onLibraryPathLabelUpdate ), NULL, this );
|
||||
m_libraryPathText->Disconnect( wxEVT_KILL_FOCUS, wxFocusEventHandler( DIALOG_SIM_MODEL_BASE::onLibraryPathTextKillFocus ), NULL, this );
|
||||
m_libraryPathText->Disconnect( wxEVT_COMMAND_TEXT_UPDATED, wxCommandEventHandler( DIALOG_SIM_MODEL_BASE::onLibrarayPathText ), NULL, this );
|
||||
m_libraryPathText->Disconnect( wxEVT_COMMAND_TEXT_UPDATED, wxCommandEventHandler( DIALOG_SIM_MODEL_BASE::onLibraryPathText ), NULL, this );
|
||||
m_libraryPathText->Disconnect( wxEVT_COMMAND_TEXT_ENTER, wxCommandEventHandler( DIALOG_SIM_MODEL_BASE::onLibraryPathTextEnter ), NULL, this );
|
||||
m_browseButton->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_SIM_MODEL_BASE::onBrowseButtonClick ), NULL, this );
|
||||
m_browseButton->Disconnect( wxEVT_UPDATE_UI, wxUpdateUIEventHandler( DIALOG_SIM_MODEL_BASE::onBrowseButtonUpdate ), NULL, this );
|
||||
|
||||
@@ -63,10 +63,10 @@
|
||||
<property name="orient">wxVERTICAL</property>
|
||||
<property name="permission">none</property>
|
||||
<object class="sizeritem" expanded="true">
|
||||
<property name="border">10</property>
|
||||
<property name="flag">wxEXPAND|wxTOP|wxRIGHT|wxLEFT</property>
|
||||
<property name="proportion">1</property>
|
||||
<object class="wxNotebook" expanded="true">
|
||||
<property name="border">5</property>
|
||||
<property name="flag">wxEXPAND</property>
|
||||
<property name="proportion">0</property>
|
||||
<object class="wxInfoBar" expanded="true">
|
||||
<property name="BottomDockable">1</property>
|
||||
<property name="LeftDockable">1</property>
|
||||
<property name="RightDockable">1</property>
|
||||
@@ -77,6 +77,67 @@
|
||||
<property name="aui_row"></property>
|
||||
<property name="best_size"></property>
|
||||
<property name="bg"></property>
|
||||
<property name="caption"></property>
|
||||
<property name="caption_visible">1</property>
|
||||
<property name="center_pane">0</property>
|
||||
<property name="close_button">1</property>
|
||||
<property name="context_help"></property>
|
||||
<property name="context_menu">1</property>
|
||||
<property name="default_pane">0</property>
|
||||
<property name="dock">Dock</property>
|
||||
<property name="dock_fixed">0</property>
|
||||
<property name="docking">Left</property>
|
||||
<property name="drag_accept_files">0</property>
|
||||
<property name="duration">500</property>
|
||||
<property name="enabled">1</property>
|
||||
<property name="fg"></property>
|
||||
<property name="floatable">1</property>
|
||||
<property name="font"></property>
|
||||
<property name="gripper">0</property>
|
||||
<property name="hidden">1</property>
|
||||
<property name="hide_effect">wxSHOW_EFFECT_NONE</property>
|
||||
<property name="id">wxID_ANY</property>
|
||||
<property name="max_size"></property>
|
||||
<property name="maximize_button">0</property>
|
||||
<property name="maximum_size"></property>
|
||||
<property name="min_size"></property>
|
||||
<property name="minimize_button">0</property>
|
||||
<property name="minimum_size"></property>
|
||||
<property name="moveable">1</property>
|
||||
<property name="name">m_infoBar</property>
|
||||
<property name="pane_border">1</property>
|
||||
<property name="pane_position"></property>
|
||||
<property name="pane_size"></property>
|
||||
<property name="permission">protected</property>
|
||||
<property name="pin_button">1</property>
|
||||
<property name="pos"></property>
|
||||
<property name="resize">Resizable</property>
|
||||
<property name="show">1</property>
|
||||
<property name="show_effect">wxSHOW_EFFECT_NONE</property>
|
||||
<property name="size"></property>
|
||||
<property name="subclass">WX_INFOBAR; widgets/wx_infobar.h; forward_declare</property>
|
||||
<property name="toolbar_pane">0</property>
|
||||
<property name="tooltip"></property>
|
||||
<property name="window_extra_style"></property>
|
||||
<property name="window_name"></property>
|
||||
<property name="window_style"></property>
|
||||
</object>
|
||||
</object>
|
||||
<object class="sizeritem" expanded="true">
|
||||
<property name="border">10</property>
|
||||
<property name="flag">wxEXPAND|wxTOP|wxRIGHT|wxLEFT</property>
|
||||
<property name="proportion">1</property>
|
||||
<object class="wxNotebook" expanded="true">
|
||||
<property name="BottomDockable">1</property>
|
||||
<property name="LeftDockable">1</property>
|
||||
<property name="RightDockable">1</property>
|
||||
<property name="TopDockable">1</property>
|
||||
<property name="aui_layer">0</property>
|
||||
<property name="aui_name"></property>
|
||||
<property name="aui_position">0</property>
|
||||
<property name="aui_row">0</property>
|
||||
<property name="best_size"></property>
|
||||
<property name="bg"></property>
|
||||
<property name="bitmapsize"></property>
|
||||
<property name="caption"></property>
|
||||
<property name="caption_visible">1</property>
|
||||
@@ -129,10 +190,10 @@
|
||||
<property name="LeftDockable">1</property>
|
||||
<property name="RightDockable">1</property>
|
||||
<property name="TopDockable">1</property>
|
||||
<property name="aui_layer"></property>
|
||||
<property name="aui_layer">0</property>
|
||||
<property name="aui_name"></property>
|
||||
<property name="aui_position"></property>
|
||||
<property name="aui_row"></property>
|
||||
<property name="aui_position">0</property>
|
||||
<property name="aui_row">0</property>
|
||||
<property name="best_size"></property>
|
||||
<property name="bg"></property>
|
||||
<property name="caption"></property>
|
||||
@@ -199,10 +260,10 @@
|
||||
<property name="LeftDockable">1</property>
|
||||
<property name="RightDockable">1</property>
|
||||
<property name="TopDockable">1</property>
|
||||
<property name="aui_layer"></property>
|
||||
<property name="aui_layer">0</property>
|
||||
<property name="aui_name"></property>
|
||||
<property name="aui_position"></property>
|
||||
<property name="aui_row"></property>
|
||||
<property name="aui_position">0</property>
|
||||
<property name="aui_row">0</property>
|
||||
<property name="best_size"></property>
|
||||
<property name="bg"></property>
|
||||
<property name="caption"></property>
|
||||
@@ -283,10 +344,10 @@
|
||||
<property name="LeftDockable">1</property>
|
||||
<property name="RightDockable">1</property>
|
||||
<property name="TopDockable">1</property>
|
||||
<property name="aui_layer"></property>
|
||||
<property name="aui_layer">0</property>
|
||||
<property name="aui_name"></property>
|
||||
<property name="aui_position"></property>
|
||||
<property name="aui_row"></property>
|
||||
<property name="aui_position">0</property>
|
||||
<property name="aui_row">0</property>
|
||||
<property name="best_size"></property>
|
||||
<property name="bg"></property>
|
||||
<property name="caption"></property>
|
||||
@@ -358,10 +419,10 @@
|
||||
<property name="LeftDockable">1</property>
|
||||
<property name="RightDockable">1</property>
|
||||
<property name="TopDockable">1</property>
|
||||
<property name="aui_layer"></property>
|
||||
<property name="aui_layer">0</property>
|
||||
<property name="aui_name"></property>
|
||||
<property name="aui_position"></property>
|
||||
<property name="aui_row"></property>
|
||||
<property name="aui_position">0</property>
|
||||
<property name="aui_row">0</property>
|
||||
<property name="best_size"></property>
|
||||
<property name="bg"></property>
|
||||
<property name="caption"></property>
|
||||
@@ -385,7 +446,7 @@
|
||||
<property name="max_size"></property>
|
||||
<property name="maximize_button">0</property>
|
||||
<property name="maximum_size"></property>
|
||||
<property name="maxlength"></property>
|
||||
<property name="maxlength">0</property>
|
||||
<property name="min_size"></property>
|
||||
<property name="minimize_button">0</property>
|
||||
<property name="minimum_size">-1,-1</property>
|
||||
@@ -413,7 +474,7 @@
|
||||
<property name="window_name"></property>
|
||||
<property name="window_style"></property>
|
||||
<event name="OnKillFocus">onLibraryPathTextKillFocus</event>
|
||||
<event name="OnText">onLibrarayPathText</event>
|
||||
<event name="OnText">onLibraryPathText</event>
|
||||
<event name="OnTextEnter">onLibraryPathTextEnter</event>
|
||||
</object>
|
||||
</object>
|
||||
@@ -426,10 +487,10 @@
|
||||
<property name="LeftDockable">1</property>
|
||||
<property name="RightDockable">1</property>
|
||||
<property name="TopDockable">1</property>
|
||||
<property name="aui_layer"></property>
|
||||
<property name="aui_layer">0</property>
|
||||
<property name="aui_name"></property>
|
||||
<property name="aui_position"></property>
|
||||
<property name="aui_row"></property>
|
||||
<property name="aui_position">0</property>
|
||||
<property name="aui_row">0</property>
|
||||
<property name="auth_needed">0</property>
|
||||
<property name="best_size"></property>
|
||||
<property name="bg"></property>
|
||||
@@ -507,10 +568,10 @@
|
||||
<property name="LeftDockable">1</property>
|
||||
<property name="RightDockable">1</property>
|
||||
<property name="TopDockable">1</property>
|
||||
<property name="aui_layer"></property>
|
||||
<property name="aui_layer">0</property>
|
||||
<property name="aui_name"></property>
|
||||
<property name="aui_position"></property>
|
||||
<property name="aui_row"></property>
|
||||
<property name="aui_position">0</property>
|
||||
<property name="aui_row">0</property>
|
||||
<property name="best_size"></property>
|
||||
<property name="bg"></property>
|
||||
<property name="caption"></property>
|
||||
@@ -573,10 +634,10 @@
|
||||
<property name="LeftDockable">1</property>
|
||||
<property name="RightDockable">1</property>
|
||||
<property name="TopDockable">1</property>
|
||||
<property name="aui_layer"></property>
|
||||
<property name="aui_layer">0</property>
|
||||
<property name="aui_name"></property>
|
||||
<property name="aui_position"></property>
|
||||
<property name="aui_row"></property>
|
||||
<property name="aui_position">0</property>
|
||||
<property name="aui_row">0</property>
|
||||
<property name="best_size"></property>
|
||||
<property name="bg"></property>
|
||||
<property name="caption"></property>
|
||||
@@ -655,10 +716,10 @@
|
||||
<property name="LeftDockable">1</property>
|
||||
<property name="RightDockable">1</property>
|
||||
<property name="TopDockable">1</property>
|
||||
<property name="aui_layer"></property>
|
||||
<property name="aui_layer">0</property>
|
||||
<property name="aui_name"></property>
|
||||
<property name="aui_position"></property>
|
||||
<property name="aui_row"></property>
|
||||
<property name="aui_position">0</property>
|
||||
<property name="aui_row">0</property>
|
||||
<property name="best_size"></property>
|
||||
<property name="bg"></property>
|
||||
<property name="caption"></property>
|
||||
@@ -721,10 +782,10 @@
|
||||
<property name="LeftDockable">1</property>
|
||||
<property name="RightDockable">1</property>
|
||||
<property name="TopDockable">1</property>
|
||||
<property name="aui_layer"></property>
|
||||
<property name="aui_layer">0</property>
|
||||
<property name="aui_name"></property>
|
||||
<property name="aui_position"></property>
|
||||
<property name="aui_row"></property>
|
||||
<property name="aui_position">0</property>
|
||||
<property name="aui_row">0</property>
|
||||
<property name="best_size"></property>
|
||||
<property name="bg"></property>
|
||||
<property name="caption"></property>
|
||||
@@ -794,10 +855,10 @@
|
||||
<property name="LeftDockable">1</property>
|
||||
<property name="RightDockable">1</property>
|
||||
<property name="TopDockable">1</property>
|
||||
<property name="aui_layer"></property>
|
||||
<property name="aui_layer">0</property>
|
||||
<property name="aui_name"></property>
|
||||
<property name="aui_position"></property>
|
||||
<property name="aui_row"></property>
|
||||
<property name="aui_position">0</property>
|
||||
<property name="aui_row">0</property>
|
||||
<property name="best_size"></property>
|
||||
<property name="bg"></property>
|
||||
<property name="caption"></property>
|
||||
@@ -864,10 +925,10 @@
|
||||
<property name="LeftDockable">1</property>
|
||||
<property name="RightDockable">1</property>
|
||||
<property name="TopDockable">1</property>
|
||||
<property name="aui_layer"></property>
|
||||
<property name="aui_layer">0</property>
|
||||
<property name="aui_name"></property>
|
||||
<property name="aui_position"></property>
|
||||
<property name="aui_row"></property>
|
||||
<property name="aui_position">0</property>
|
||||
<property name="aui_row">0</property>
|
||||
<property name="best_size"></property>
|
||||
<property name="bg"></property>
|
||||
<property name="caption"></property>
|
||||
@@ -930,10 +991,10 @@
|
||||
<property name="LeftDockable">1</property>
|
||||
<property name="RightDockable">1</property>
|
||||
<property name="TopDockable">1</property>
|
||||
<property name="aui_layer"></property>
|
||||
<property name="aui_layer">0</property>
|
||||
<property name="aui_name"></property>
|
||||
<property name="aui_position"></property>
|
||||
<property name="aui_row"></property>
|
||||
<property name="aui_position">0</property>
|
||||
<property name="aui_row">0</property>
|
||||
<property name="best_size"></property>
|
||||
<property name="bg"></property>
|
||||
<property name="caption"></property>
|
||||
@@ -1003,10 +1064,10 @@
|
||||
<property name="LeftDockable">1</property>
|
||||
<property name="RightDockable">1</property>
|
||||
<property name="TopDockable">1</property>
|
||||
<property name="aui_layer"></property>
|
||||
<property name="aui_layer">0</property>
|
||||
<property name="aui_name"></property>
|
||||
<property name="aui_position"></property>
|
||||
<property name="aui_row"></property>
|
||||
<property name="aui_position">0</property>
|
||||
<property name="aui_row">0</property>
|
||||
<property name="best_size"></property>
|
||||
<property name="bg"></property>
|
||||
<property name="caption"></property>
|
||||
@@ -1068,10 +1129,10 @@
|
||||
<property name="LeftDockable">1</property>
|
||||
<property name="RightDockable">1</property>
|
||||
<property name="TopDockable">1</property>
|
||||
<property name="aui_layer"></property>
|
||||
<property name="aui_layer">0</property>
|
||||
<property name="aui_name"></property>
|
||||
<property name="aui_position"></property>
|
||||
<property name="aui_row"></property>
|
||||
<property name="aui_position">0</property>
|
||||
<property name="aui_row">0</property>
|
||||
<property name="best_size"></property>
|
||||
<property name="bg"></property>
|
||||
<property name="caption"></property>
|
||||
@@ -1146,10 +1207,10 @@
|
||||
<property name="LeftDockable">1</property>
|
||||
<property name="RightDockable">1</property>
|
||||
<property name="TopDockable">1</property>
|
||||
<property name="aui_layer"></property>
|
||||
<property name="aui_layer">0</property>
|
||||
<property name="aui_name"></property>
|
||||
<property name="aui_position"></property>
|
||||
<property name="aui_row"></property>
|
||||
<property name="aui_position">0</property>
|
||||
<property name="aui_row">0</property>
|
||||
<property name="best_size"></property>
|
||||
<property name="bg"></property>
|
||||
<property name="caption"></property>
|
||||
@@ -1228,10 +1289,10 @@
|
||||
<property name="LeftDockable">1</property>
|
||||
<property name="RightDockable">1</property>
|
||||
<property name="TopDockable">1</property>
|
||||
<property name="aui_layer"></property>
|
||||
<property name="aui_layer">0</property>
|
||||
<property name="aui_name"></property>
|
||||
<property name="aui_position"></property>
|
||||
<property name="aui_row"></property>
|
||||
<property name="aui_position">0</property>
|
||||
<property name="aui_row">0</property>
|
||||
<property name="best_size"></property>
|
||||
<property name="bg"></property>
|
||||
<property name="caption"></property>
|
||||
@@ -1291,10 +1352,10 @@
|
||||
<property name="LeftDockable">1</property>
|
||||
<property name="RightDockable">1</property>
|
||||
<property name="TopDockable">1</property>
|
||||
<property name="aui_layer"></property>
|
||||
<property name="aui_layer">0</property>
|
||||
<property name="aui_name"></property>
|
||||
<property name="aui_position"></property>
|
||||
<property name="aui_row"></property>
|
||||
<property name="aui_position">0</property>
|
||||
<property name="aui_row">0</property>
|
||||
<property name="best_size"></property>
|
||||
<property name="bg"></property>
|
||||
<property name="caption"></property>
|
||||
@@ -1358,10 +1419,10 @@
|
||||
<property name="LeftDockable">1</property>
|
||||
<property name="RightDockable">1</property>
|
||||
<property name="TopDockable">1</property>
|
||||
<property name="aui_layer"></property>
|
||||
<property name="aui_layer">0</property>
|
||||
<property name="aui_name"></property>
|
||||
<property name="aui_position"></property>
|
||||
<property name="aui_row"></property>
|
||||
<property name="aui_position">0</property>
|
||||
<property name="aui_row">0</property>
|
||||
<property name="best_size"></property>
|
||||
<property name="bg"></property>
|
||||
<property name="caption"></property>
|
||||
@@ -1421,10 +1482,10 @@
|
||||
<property name="LeftDockable">1</property>
|
||||
<property name="RightDockable">1</property>
|
||||
<property name="TopDockable">1</property>
|
||||
<property name="aui_layer"></property>
|
||||
<property name="aui_layer">0</property>
|
||||
<property name="aui_name"></property>
|
||||
<property name="aui_position"></property>
|
||||
<property name="aui_row"></property>
|
||||
<property name="aui_position">0</property>
|
||||
<property name="aui_row">0</property>
|
||||
<property name="best_size"></property>
|
||||
<property name="bg"></property>
|
||||
<property name="caption"></property>
|
||||
@@ -1499,10 +1560,10 @@
|
||||
<property name="LeftDockable">1</property>
|
||||
<property name="RightDockable">1</property>
|
||||
<property name="TopDockable">1</property>
|
||||
<property name="aui_layer"></property>
|
||||
<property name="aui_layer">0</property>
|
||||
<property name="aui_name"></property>
|
||||
<property name="aui_position"></property>
|
||||
<property name="aui_row"></property>
|
||||
<property name="aui_position">0</property>
|
||||
<property name="aui_row">0</property>
|
||||
<property name="best_size"></property>
|
||||
<property name="bg"></property>
|
||||
<property name="bitmapsize"></property>
|
||||
@@ -1558,10 +1619,10 @@
|
||||
<property name="LeftDockable">1</property>
|
||||
<property name="RightDockable">1</property>
|
||||
<property name="TopDockable">1</property>
|
||||
<property name="aui_layer"></property>
|
||||
<property name="aui_layer">0</property>
|
||||
<property name="aui_name"></property>
|
||||
<property name="aui_position"></property>
|
||||
<property name="aui_row"></property>
|
||||
<property name="aui_position">0</property>
|
||||
<property name="aui_row">0</property>
|
||||
<property name="best_size"></property>
|
||||
<property name="bg"></property>
|
||||
<property name="caption"></property>
|
||||
@@ -1619,10 +1680,10 @@
|
||||
<property name="LeftDockable">1</property>
|
||||
<property name="RightDockable">1</property>
|
||||
<property name="TopDockable">1</property>
|
||||
<property name="aui_layer"></property>
|
||||
<property name="aui_layer">0</property>
|
||||
<property name="aui_name"></property>
|
||||
<property name="aui_position"></property>
|
||||
<property name="aui_row"></property>
|
||||
<property name="aui_position">0</property>
|
||||
<property name="aui_row">0</property>
|
||||
<property name="best_size"></property>
|
||||
<property name="bg"></property>
|
||||
<property name="caption"></property>
|
||||
@@ -1690,10 +1751,10 @@
|
||||
<property name="LeftDockable">1</property>
|
||||
<property name="RightDockable">1</property>
|
||||
<property name="TopDockable">1</property>
|
||||
<property name="aui_layer"></property>
|
||||
<property name="aui_layer">0</property>
|
||||
<property name="aui_name"></property>
|
||||
<property name="aui_position"></property>
|
||||
<property name="aui_row"></property>
|
||||
<property name="aui_position">0</property>
|
||||
<property name="aui_row">0</property>
|
||||
<property name="best_size"></property>
|
||||
<property name="bg"></property>
|
||||
<property name="caption"></property>
|
||||
@@ -1751,10 +1812,10 @@
|
||||
<property name="LeftDockable">1</property>
|
||||
<property name="RightDockable">1</property>
|
||||
<property name="TopDockable">1</property>
|
||||
<property name="aui_layer"></property>
|
||||
<property name="aui_layer">0</property>
|
||||
<property name="aui_name"></property>
|
||||
<property name="aui_position"></property>
|
||||
<property name="aui_row"></property>
|
||||
<property name="aui_position">0</property>
|
||||
<property name="aui_row">0</property>
|
||||
<property name="backspace_unindents">1</property>
|
||||
<property name="best_size"></property>
|
||||
<property name="bg"></property>
|
||||
@@ -1834,10 +1895,10 @@
|
||||
<property name="LeftDockable">1</property>
|
||||
<property name="RightDockable">1</property>
|
||||
<property name="TopDockable">1</property>
|
||||
<property name="aui_layer"></property>
|
||||
<property name="aui_layer">0</property>
|
||||
<property name="aui_name"></property>
|
||||
<property name="aui_position"></property>
|
||||
<property name="aui_row"></property>
|
||||
<property name="aui_position">0</property>
|
||||
<property name="aui_row">0</property>
|
||||
<property name="best_size"></property>
|
||||
<property name="bg"></property>
|
||||
<property name="caption"></property>
|
||||
@@ -1914,10 +1975,10 @@
|
||||
<property name="LeftDockable">1</property>
|
||||
<property name="RightDockable">1</property>
|
||||
<property name="TopDockable">1</property>
|
||||
<property name="aui_layer"></property>
|
||||
<property name="aui_layer">0</property>
|
||||
<property name="aui_name"></property>
|
||||
<property name="aui_position"></property>
|
||||
<property name="aui_row"></property>
|
||||
<property name="aui_position">0</property>
|
||||
<property name="aui_row">0</property>
|
||||
<property name="best_size"></property>
|
||||
<property name="bg"></property>
|
||||
<property name="caption"></property>
|
||||
@@ -1975,10 +2036,10 @@
|
||||
<property name="LeftDockable">1</property>
|
||||
<property name="RightDockable">1</property>
|
||||
<property name="TopDockable">1</property>
|
||||
<property name="aui_layer"></property>
|
||||
<property name="aui_layer">0</property>
|
||||
<property name="aui_name"></property>
|
||||
<property name="aui_position"></property>
|
||||
<property name="aui_row"></property>
|
||||
<property name="aui_position">0</property>
|
||||
<property name="aui_row">0</property>
|
||||
<property name="autosize_cols">0</property>
|
||||
<property name="autosize_rows">0</property>
|
||||
<property name="best_size"></property>
|
||||
@@ -2066,10 +2127,10 @@
|
||||
<property name="LeftDockable">1</property>
|
||||
<property name="RightDockable">1</property>
|
||||
<property name="TopDockable">1</property>
|
||||
<property name="aui_layer"></property>
|
||||
<property name="aui_layer">0</property>
|
||||
<property name="aui_name"></property>
|
||||
<property name="aui_position"></property>
|
||||
<property name="aui_row"></property>
|
||||
<property name="aui_position">0</property>
|
||||
<property name="aui_row">0</property>
|
||||
<property name="best_size"></property>
|
||||
<property name="bg"></property>
|
||||
<property name="caption"></property>
|
||||
@@ -2128,10 +2189,10 @@
|
||||
<property name="LeftDockable">1</property>
|
||||
<property name="RightDockable">1</property>
|
||||
<property name="TopDockable">1</property>
|
||||
<property name="aui_layer"></property>
|
||||
<property name="aui_layer">0</property>
|
||||
<property name="aui_name"></property>
|
||||
<property name="aui_position"></property>
|
||||
<property name="aui_row"></property>
|
||||
<property name="aui_position">0</property>
|
||||
<property name="aui_row">0</property>
|
||||
<property name="backspace_unindents">1</property>
|
||||
<property name="best_size"></property>
|
||||
<property name="bg"></property>
|
||||
|
||||
@@ -12,14 +12,16 @@
|
||||
#include <wx/intl.h>
|
||||
class STD_BITMAP_BUTTON;
|
||||
class WX_GRID;
|
||||
class WX_INFOBAR;
|
||||
|
||||
#include "dialog_shim.h"
|
||||
#include <wx/string.h>
|
||||
#include <wx/radiobut.h>
|
||||
#include <wx/infobar.h>
|
||||
#include <wx/gdicmn.h>
|
||||
#include <wx/font.h>
|
||||
#include <wx/colour.h>
|
||||
#include <wx/settings.h>
|
||||
#include <wx/string.h>
|
||||
#include <wx/radiobut.h>
|
||||
#include <wx/stattext.h>
|
||||
#include <wx/textctrl.h>
|
||||
#include <wx/bmpbuttn.h>
|
||||
@@ -52,6 +54,7 @@ class DIALOG_SIM_MODEL_BASE : public DIALOG_SHIM
|
||||
private:
|
||||
|
||||
protected:
|
||||
WX_INFOBAR* m_infoBar;
|
||||
wxNotebook* m_notebook;
|
||||
wxPanel* m_modelPanel;
|
||||
wxRadioButton* m_rbLibraryModel;
|
||||
@@ -91,7 +94,7 @@ class DIALOG_SIM_MODEL_BASE : public DIALOG_SHIM
|
||||
virtual void onRadioButton( wxCommandEvent& event ) { event.Skip(); }
|
||||
virtual void onLibraryPathLabelUpdate( wxUpdateUIEvent& event ) { event.Skip(); }
|
||||
virtual void onLibraryPathTextKillFocus( wxFocusEvent& event ) { event.Skip(); }
|
||||
virtual void onLibrarayPathText( wxCommandEvent& event ) { event.Skip(); }
|
||||
virtual void onLibraryPathText( wxCommandEvent& event ) { event.Skip(); }
|
||||
virtual void onLibraryPathTextEnter( wxCommandEvent& event ) { event.Skip(); }
|
||||
virtual void onBrowseButtonClick( wxCommandEvent& event ) { event.Skip(); }
|
||||
virtual void onBrowseButtonUpdate( wxUpdateUIEvent& event ) { event.Skip(); }
|
||||
|
||||
@@ -471,21 +471,10 @@ bool DIALOG_TEXT_PROPERTIES::TransferDataFromWindow()
|
||||
m_italic->IsChecked() ) );
|
||||
}
|
||||
|
||||
if( m_bold->IsChecked() != m_currentText->IsBold() )
|
||||
{
|
||||
if( m_bold->IsChecked() )
|
||||
{
|
||||
m_currentText->SetBold( true );
|
||||
m_currentText->SetTextThickness( GetPenSizeForBold( m_currentText->GetTextWidth() ) );
|
||||
}
|
||||
else
|
||||
{
|
||||
m_currentText->SetBold( false );
|
||||
m_currentText->SetTextThickness( 0 ); // Use default pen width
|
||||
}
|
||||
}
|
||||
|
||||
// Must come after SetTextSize()
|
||||
m_currentText->SetBold( m_bold->IsChecked() );
|
||||
m_currentText->SetItalic( m_italic->IsChecked() );
|
||||
|
||||
m_currentText->SetTextColor( m_textColorSwatch->GetSwatchColor() );
|
||||
|
||||
if( m_hAlignRight->IsChecked() )
|
||||
|
||||
+6
-4
@@ -449,6 +449,8 @@ int ERC_TESTER::TestMissingUnits()
|
||||
std::shared_ptr<ERC_ITEM> ercItem = ERC_ITEM::Create( aErrorCode );
|
||||
ercItem->SetErrorMessage( msg );
|
||||
ercItem->SetItems( unit );
|
||||
ercItem->SetSheetSpecificPath( base_ref.GetSheetPath() );
|
||||
ercItem->SetItemsSheetPaths( base_ref.GetSheetPath() );
|
||||
|
||||
SCH_MARKER* marker = new SCH_MARKER( ercItem, unit->GetPosition() );
|
||||
base_ref.GetSheetPath().LastScreen()->Append( marker );
|
||||
@@ -1081,8 +1083,7 @@ int ERC_TESTER::TestOffGridEndpoints()
|
||||
|
||||
int ERC_TESTER::TestSimModelIssues()
|
||||
{
|
||||
wxString msg;
|
||||
WX_STRING_REPORTER reporter( &msg );
|
||||
WX_STRING_REPORTER reporter;
|
||||
int err_count = 0;
|
||||
SIM_LIB_MGR libMgr( &m_schematic->Prj() );
|
||||
|
||||
@@ -1100,12 +1101,13 @@ int ERC_TESTER::TestSimModelIssues()
|
||||
continue;
|
||||
|
||||
// Reset for each symbol
|
||||
msg.Clear();
|
||||
reporter.Clear();
|
||||
|
||||
SIM_LIBRARY::MODEL model = libMgr.CreateModel( &sheet, *symbol, reporter );
|
||||
|
||||
if( !msg.IsEmpty() )
|
||||
if( reporter.HasMessage() )
|
||||
{
|
||||
wxString msg = reporter.GetMessages();
|
||||
std::shared_ptr<ERC_ITEM> ercItem = ERC_ITEM::Create( ERCE_SIMULATION_MODEL );
|
||||
|
||||
//Remove \n and \r at e.o.l if any:
|
||||
|
||||
@@ -84,9 +84,12 @@ void FIELDS_EDITOR_GRID_DATA_MODEL::RenameColumn( int aCol, const wxString& newN
|
||||
{
|
||||
SCH_SYMBOL* symbol = m_symbolsList[i].GetSymbol();
|
||||
|
||||
auto node = m_dataStore[symbol->m_Uuid].extract( m_cols[aCol].m_fieldName );
|
||||
node.key() = newName;
|
||||
m_dataStore[symbol->m_Uuid].insert( std::move( node ) );
|
||||
// Careful; field may have already been renamed from another sheet instance
|
||||
if( auto node = m_dataStore[symbol->m_Uuid].extract( m_cols[aCol].m_fieldName ) )
|
||||
{
|
||||
node.key() = newName;
|
||||
m_dataStore[symbol->m_Uuid].insert( std::move( node ) );
|
||||
}
|
||||
}
|
||||
|
||||
m_cols[aCol].m_fieldName = newName;
|
||||
|
||||
@@ -131,7 +131,6 @@ FIELDS_GRID_TABLE<T>::FIELDS_GRID_TABLE( DIALOG_SHIM* aDialog, SCH_BASE_FRAME* a
|
||||
WX_GRID* aGrid, LIB_SYMBOL* aSymbol ) :
|
||||
m_frame( aFrame ),
|
||||
m_dialog( aDialog ),
|
||||
m_grid( aGrid ),
|
||||
m_parentType( SCH_SYMBOL_T ),
|
||||
m_mandatoryFieldCount( MANDATORY_FIELDS ),
|
||||
m_part( aSymbol ),
|
||||
@@ -152,7 +151,6 @@ FIELDS_GRID_TABLE<T>::FIELDS_GRID_TABLE( DIALOG_SHIM* aDialog, SCH_EDIT_FRAME* a
|
||||
WX_GRID* aGrid, SCH_SYMBOL* aSymbol ) :
|
||||
m_frame( aFrame ),
|
||||
m_dialog( aDialog ),
|
||||
m_grid( aGrid ),
|
||||
m_parentType( SCH_SYMBOL_T ),
|
||||
m_mandatoryFieldCount( MANDATORY_FIELDS ),
|
||||
m_part( aSymbol->GetLibSymbolRef().get() ),
|
||||
@@ -173,7 +171,6 @@ FIELDS_GRID_TABLE<T>::FIELDS_GRID_TABLE( DIALOG_SHIM* aDialog, SCH_EDIT_FRAME* a
|
||||
WX_GRID* aGrid, SCH_SHEET* aSheet ) :
|
||||
m_frame( aFrame ),
|
||||
m_dialog( aDialog ),
|
||||
m_grid( aGrid ),
|
||||
m_parentType( SCH_SHEET_T ),
|
||||
m_mandatoryFieldCount( SHEET_MANDATORY_FIELDS ),
|
||||
m_part( nullptr ),
|
||||
@@ -193,7 +190,6 @@ FIELDS_GRID_TABLE<T>::FIELDS_GRID_TABLE( DIALOG_SHIM* aDialog, SCH_EDIT_FRAME* a
|
||||
WX_GRID* aGrid, SCH_LABEL_BASE* aLabel ) :
|
||||
m_frame( aFrame ),
|
||||
m_dialog( aDialog ),
|
||||
m_grid( aGrid ),
|
||||
m_parentType( SCH_LABEL_LOCATE_ANY_T ),
|
||||
m_mandatoryFieldCount( aLabel->GetMandatoryFieldCount() ),
|
||||
m_part( nullptr ),
|
||||
|
||||
@@ -118,7 +118,6 @@ protected:
|
||||
private:
|
||||
SCH_BASE_FRAME* m_frame;
|
||||
DIALOG_SHIM* m_dialog;
|
||||
WX_GRID* m_grid;
|
||||
KICAD_T m_parentType;
|
||||
int m_mandatoryFieldCount;
|
||||
LIB_SYMBOL* m_part;
|
||||
|
||||
+10
-7
@@ -181,7 +181,8 @@ bool SCH_EDIT_FRAME::OpenProjectFiles( const std::vector<wxString>& aFileSet, in
|
||||
CreateScreens();
|
||||
}
|
||||
|
||||
SCH_IO_MGR::SCH_FILE_T schFileType = SCH_IO_MGR::GuessPluginTypeFromSchPath( fullFileName, KICTL_KICAD_ONLY );
|
||||
SCH_IO_MGR::SCH_FILE_T schFileType = SCH_IO_MGR::GuessPluginTypeFromSchPath( fullFileName,
|
||||
KICTL_KICAD_ONLY );
|
||||
|
||||
if( schFileType == SCH_IO_MGR::SCH_LEGACY )
|
||||
{
|
||||
@@ -492,13 +493,14 @@ bool SCH_EDIT_FRAME::OpenProjectFiles( const std::vector<wxString>& aFileSet, in
|
||||
|
||||
// Restore all of the loaded symbol and sheet instances from the root sheet.
|
||||
if( Schematic().RootScreen()->GetFileFormatVersionAtLoad() < 20221002 )
|
||||
sheetList.UpdateSymbolInstanceData( Schematic().RootScreen()->GetSymbolInstances());
|
||||
sheetList.UpdateSymbolInstanceData( Schematic().RootScreen()->GetSymbolInstances() );
|
||||
|
||||
if( Schematic().RootScreen()->GetFileFormatVersionAtLoad() < 20221110 )
|
||||
sheetList.UpdateSheetInstanceData( Schematic().RootScreen()->GetSheetInstances());
|
||||
|
||||
if( Schematic().RootScreen()->GetFileFormatVersionAtLoad() < 20230221 )
|
||||
for( SCH_SCREEN* screen = schematic.GetFirst(); screen; screen = schematic.GetNext() )
|
||||
for( SCH_SCREEN* screen = schematic.GetFirst(); screen;
|
||||
screen = schematic.GetNext() )
|
||||
screen->FixLegacyPowerSymbolMismatches();
|
||||
|
||||
for( SCH_SCREEN* screen = schematic.GetFirst(); screen; screen = schematic.GetNext() )
|
||||
@@ -511,8 +513,9 @@ bool SCH_EDIT_FRAME::OpenProjectFiles( const std::vector<wxString>& aFileSet, in
|
||||
}
|
||||
}
|
||||
|
||||
schematic.PruneOrphanedSymbolInstances( Prj().GetProjectName(), Schematic().GetSheets() );
|
||||
schematic.PruneOrphanedSheetInstances( Prj().GetProjectName(), Schematic().GetSheets() );
|
||||
schematic.PruneOrphanedSymbolInstances( Prj().GetProjectName(), sheetList );
|
||||
schematic.PruneOrphanedSheetInstances( Prj().GetProjectName(), sheetList );
|
||||
sheetList.CheckForMissingSymbolInstances( Prj().GetProjectName() );
|
||||
|
||||
Schematic().ConnectionGraph()->Reset();
|
||||
|
||||
@@ -1273,10 +1276,10 @@ bool SCH_EDIT_FRAME::SaveProject( bool aSaveAs )
|
||||
|
||||
if( !Kiface().IsSingle() )
|
||||
{
|
||||
WX_STRING_REPORTER backupReporter( &msg );
|
||||
WX_STRING_REPORTER backupReporter;
|
||||
|
||||
if( !GetSettingsManager()->TriggerBackupIfNeeded( backupReporter ) )
|
||||
SetStatusText( msg, 0 );
|
||||
SetStatusText( backupReporter.GetMessages(), 0 );
|
||||
}
|
||||
|
||||
updateTitle();
|
||||
|
||||
@@ -40,6 +40,7 @@
|
||||
#include <sch_text.h>
|
||||
#include <sch_textbox.h>
|
||||
#include <string_utils.h>
|
||||
#include <ki_exception.h>
|
||||
|
||||
#include <dialogs/html_message_box.h>
|
||||
#include <fmt/core.h>
|
||||
@@ -210,31 +211,38 @@ bool NETLIST_EXPORTER_SPICE::ReadSchematicAndLibraries( unsigned aNetlistOptions
|
||||
if( !symbol || symbol->GetExcludedFromSim() )
|
||||
continue;
|
||||
|
||||
SPICE_ITEM spiceItem;
|
||||
std::vector<PIN_INFO> pins = CreatePinList( symbol, &sheet, true );
|
||||
|
||||
for( const SCH_FIELD& field : symbol->GetFields() )
|
||||
try
|
||||
{
|
||||
spiceItem.fields.emplace_back( VECTOR2I(), -1, symbol, field.GetName() );
|
||||
SPICE_ITEM spiceItem;
|
||||
std::vector<PIN_INFO> pins = CreatePinList( symbol, &sheet, true );
|
||||
|
||||
if( field.GetId() == REFERENCE_FIELD )
|
||||
spiceItem.fields.back().SetText( symbol->GetRef( &sheet ) );
|
||||
else
|
||||
spiceItem.fields.back().SetText( field.GetShownText( &sheet, false ) );
|
||||
for( const SCH_FIELD& field : symbol->GetFields() )
|
||||
{
|
||||
spiceItem.fields.emplace_back( VECTOR2I(), -1, symbol, field.GetName() );
|
||||
|
||||
if( field.GetId() == REFERENCE_FIELD )
|
||||
spiceItem.fields.back().SetText( symbol->GetRef( &sheet ) );
|
||||
else
|
||||
spiceItem.fields.back().SetText( field.GetShownText( &sheet, false ) );
|
||||
}
|
||||
|
||||
readRefName( sheet, *symbol, spiceItem, refNames );
|
||||
readModel( sheet, *symbol, spiceItem, aReporter );
|
||||
readPinNumbers( *symbol, spiceItem, pins );
|
||||
readPinNetNames( *symbol, spiceItem, pins, ncCounter );
|
||||
|
||||
// TODO: transmission line handling?
|
||||
|
||||
m_items.push_back( std::move( spiceItem ) );
|
||||
}
|
||||
catch( IO_ERROR& e )
|
||||
{
|
||||
aReporter.Report( e.What(), RPT_SEVERITY_ERROR );
|
||||
}
|
||||
|
||||
readRefName( sheet, *symbol, spiceItem, refNames );
|
||||
readModel( sheet, *symbol, spiceItem, aReporter );
|
||||
readPinNumbers( *symbol, spiceItem, pins );
|
||||
readPinNetNames( *symbol, spiceItem, pins, ncCounter );
|
||||
|
||||
// TODO: transmission line handling?
|
||||
|
||||
m_items.push_back( std::move( spiceItem ) );
|
||||
}
|
||||
}
|
||||
|
||||
return !aReporter.HasMessage();
|
||||
return !aReporter.HasMessageOfSeverity( RPT_SEVERITY_UNDEFINED | RPT_SEVERITY_ERROR );
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -33,6 +33,8 @@
|
||||
#include <gal/graphics_abstraction_layer.h>
|
||||
#include <gal/painter.h>
|
||||
#include <zoom_defines.h>
|
||||
#include <drawing_sheet/ds_proxy_view_item.h>
|
||||
#include <string_utils.h>
|
||||
|
||||
|
||||
SCH_PRINTOUT::SCH_PRINTOUT( SCH_EDIT_FRAME* aParent, const wxString& aTitle, bool aUseCairo ) :
|
||||
@@ -70,6 +72,7 @@ bool SCH_PRINTOUT::OnBeginDocument( int startPage, int endPage )
|
||||
bool SCH_PRINTOUT::OnPrintPage( int page )
|
||||
{
|
||||
SCH_SHEET_LIST sheetList = m_parent->Schematic().GetSheets();
|
||||
sheetList.SortByPageNumbers( false );
|
||||
|
||||
wxCHECK_MSG( page >= 1 && page <= (int)sheetList.size(), false,
|
||||
wxT( "Cannot print invalid page number." ) );
|
||||
@@ -81,17 +84,26 @@ bool SCH_PRINTOUT::OnPrintPage( int page )
|
||||
msg.Printf( _( "Print page %d" ), page );
|
||||
m_parent->SetMsgPanel( msg, wxEmptyString );
|
||||
|
||||
SCH_SCREEN* screen = m_parent->GetScreen();
|
||||
SCH_SHEET_PATH oldsheetpath = m_parent->GetCurrentSheet();
|
||||
|
||||
// Switch to the new current sheet
|
||||
m_parent->SetCurrentSheet( sheetList[ page - 1 ] );
|
||||
m_parent->GetCurrentSheet().UpdateAllScreenReferences();
|
||||
m_parent->SetSheetNumberAndCount();
|
||||
m_parent->RecomputeIntersheetRefs();
|
||||
screen = m_parent->GetCurrentSheet().LastScreen();
|
||||
SCH_SCREEN* screen = m_parent->GetCurrentSheet().LastScreen();
|
||||
// Ensure the displayed page number is updated:
|
||||
KIGFX::SCH_VIEW* sch_view = m_parent->GetCanvas()->GetView();
|
||||
sch_view->GetDrawingSheet()->SetPageNumber( TO_UTF8( screen->GetPageNumber() ) );
|
||||
|
||||
PrintPage( screen );
|
||||
|
||||
// Restore the initial current sheet
|
||||
m_parent->SetCurrentSheet( oldsheetpath );
|
||||
m_parent->GetCurrentSheet().UpdateAllScreenReferences();
|
||||
m_parent->SetSheetNumberAndCount();
|
||||
screen = m_parent->GetCurrentSheet().LastScreen();
|
||||
sch_view->GetDrawingSheet()->SetPageNumber( TO_UTF8( screen->GetPageNumber() ) );
|
||||
|
||||
return true;
|
||||
}
|
||||
@@ -102,6 +114,7 @@ int SCH_PRINTOUT::milsToIU( int aMils )
|
||||
return KiROUND( aMils * schIUScale.IU_PER_MILS );
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* This is the real print function: print the active screen
|
||||
*/
|
||||
|
||||
@@ -28,7 +28,7 @@ class SCH_SCREEN;
|
||||
namespace KIGFX
|
||||
{
|
||||
class GAL;
|
||||
class VIEW;
|
||||
class SCH_VIEW;
|
||||
class PAINTER;
|
||||
};
|
||||
|
||||
@@ -49,7 +49,7 @@ public:
|
||||
private:
|
||||
SCH_EDIT_FRAME* m_parent;
|
||||
///< Source VIEW object (note that actual printing only refers to this object)
|
||||
const KIGFX::VIEW* m_view;
|
||||
const KIGFX::SCH_VIEW* m_view;
|
||||
bool m_useCairo;
|
||||
|
||||
int milsToIU( int aMils );
|
||||
|
||||
@@ -184,6 +184,7 @@ void SCH_COMMIT::pushSchEdit( const wxString& aMessage, int aCommitFlags )
|
||||
bool itemsDeselected = false;
|
||||
bool selectedModified = false;
|
||||
bool dirtyConnectivity = false;
|
||||
bool refreshHierarchy = false;
|
||||
SCH_CLEANUP_FLAGS connectivityCleanUp = NO_CLEANUP;
|
||||
|
||||
if( Empty() )
|
||||
@@ -261,6 +262,9 @@ void SCH_COMMIT::pushSchEdit( const wxString& aMessage, int aCommitFlags )
|
||||
|
||||
bulkAddedItems.push_back( schItem );
|
||||
|
||||
if( schItem->Type() == SCH_SHEET_T )
|
||||
refreshHierarchy = true;
|
||||
|
||||
break;
|
||||
}
|
||||
|
||||
@@ -298,6 +302,9 @@ void SCH_COMMIT::pushSchEdit( const wxString& aMessage, int aCommitFlags )
|
||||
|
||||
bulkRemovedItems.push_back( schItem );
|
||||
|
||||
if( schItem->Type() == SCH_SHEET_T )
|
||||
refreshHierarchy = true;
|
||||
|
||||
break;
|
||||
}
|
||||
|
||||
@@ -321,6 +328,17 @@ void SCH_COMMIT::pushSchEdit( const wxString& aMessage, int aCommitFlags )
|
||||
if( itemCopy->HasConnectivityChanges( schItem, ¤tSheet ) )
|
||||
updateConnectivityFlag();
|
||||
|
||||
|
||||
if( schItem->Type() == SCH_SHEET_T )
|
||||
{
|
||||
const SCH_SHEET* modifiedSheet = static_cast<const SCH_SHEET*>( schItem );
|
||||
const SCH_SHEET* originalSheet = static_cast<const SCH_SHEET*>( itemCopy );
|
||||
wxCHECK2( modifiedSheet && originalSheet, continue );
|
||||
|
||||
if( originalSheet->HasPageNumberChanges( *modifiedSheet ) )
|
||||
refreshHierarchy = true;
|
||||
}
|
||||
|
||||
undoList.PushItem( itemWrapper );
|
||||
ent.m_copy = nullptr; // We've transferred ownership to the undo list
|
||||
}
|
||||
@@ -361,6 +379,9 @@ void SCH_COMMIT::pushSchEdit( const wxString& aMessage, int aCommitFlags )
|
||||
|
||||
if( itemsChanged.size() > 0 )
|
||||
schematic->OnItemsChanged( itemsChanged );
|
||||
|
||||
if( frame && refreshHierarchy )
|
||||
frame->UpdateHierarchyNavigator();
|
||||
}
|
||||
|
||||
if( !( aCommitFlags & SKIP_UNDO ) )
|
||||
|
||||
@@ -1487,9 +1487,11 @@ void SCH_IO_ALTIUM::ParseLabel( const std::map<wxString, wxString>& aProperties,
|
||||
if( m_altiumSheet && fontId > 0 && fontId <= m_altiumSheet->fonts.size() )
|
||||
{
|
||||
const ASCH_SHEET_FONT& font = m_altiumSheet->fonts.at( fontId - 1 );
|
||||
textItem->SetItalic( font.Italic );
|
||||
textItem->SetBold( font.Bold );
|
||||
textItem->SetTextSize( { font.Size / 2, font.Size / 2 } );
|
||||
|
||||
// Must come after SetTextSize()
|
||||
textItem->SetBold( font.Bold );
|
||||
textItem->SetItalic( font.Italic );
|
||||
}
|
||||
|
||||
textItem->SetFlags(IS_NEW );
|
||||
@@ -1541,9 +1543,11 @@ void SCH_IO_ALTIUM::ParseLabel( const std::map<wxString, wxString>& aProperties,
|
||||
if( m_altiumSheet && fontId > 0 && fontId <= m_altiumSheet->fonts.size() )
|
||||
{
|
||||
const ASCH_SHEET_FONT& font = m_altiumSheet->fonts.at( fontId - 1 );
|
||||
textItem->SetItalic( font.Italic );
|
||||
textItem->SetBold( font.Bold );
|
||||
textItem->SetTextSize( { font.Size / 2, font.Size / 2 } );
|
||||
|
||||
// Must come after SetTextSize()
|
||||
textItem->SetBold( font.Bold );
|
||||
textItem->SetItalic( font.Italic );
|
||||
}
|
||||
else if( fontId > 0 && fontId <= aFontSizes.size() )
|
||||
{
|
||||
@@ -1621,11 +1625,12 @@ void SCH_IO_ALTIUM::AddTextBox( const ASCH_TEXT_FRAME *aElem )
|
||||
if( m_altiumSheet && fontId > 0 && fontId <= m_altiumSheet->fonts.size() )
|
||||
{
|
||||
const ASCH_SHEET_FONT& font = m_altiumSheet->fonts.at( fontId - 1 );
|
||||
textBox->SetItalic( font.Italic );
|
||||
textBox->SetBold( font.Bold );
|
||||
textBox->SetTextSize( { font.Size / 2, font.Size / 2 } );
|
||||
|
||||
//textBox->SetFont( //how to set font, we have a font mane here: ( font.fontname );
|
||||
// Must come after SetTextSize()
|
||||
textBox->SetBold( font.Bold );
|
||||
textBox->SetItalic( font.Italic );
|
||||
//textBox->SetFont( //how to set font, we have a font name here: ( font.fontname );
|
||||
}
|
||||
|
||||
textBox->SetFlags( IS_NEW );
|
||||
@@ -3422,10 +3427,12 @@ void SCH_IO_ALTIUM::ParseHarnessPort( const ASCH_PORT& aElem )
|
||||
if( m_altiumSheet && fontId > 0 && fontId <= m_altiumSheet->fonts.size() )
|
||||
{
|
||||
const ASCH_SHEET_FONT& font = m_altiumSheet->fonts.at( fontId - 1 );
|
||||
textBox->SetItalic( font.Italic );
|
||||
textBox->SetBold( font.Bold );
|
||||
textBox->SetTextSize( { font.Size / 2, font.Size / 2 } );
|
||||
//textBox->SetFont( //how to set font, we have a font mane here: ( font.fontname );
|
||||
|
||||
// Must come after SetTextSize()
|
||||
textBox->SetBold( font.Bold );
|
||||
textBox->SetItalic( font.Italic );
|
||||
//textBox->SetFont( //how to set font, we have a font name here: ( font.fontname );
|
||||
}
|
||||
|
||||
textBox->SetFlags( IS_NEW );
|
||||
|
||||
@@ -58,6 +58,26 @@ const wxString PartVersionFieldName = "Part Version";
|
||||
const wxString PartAcceptanceFieldName = "Part Acceptance";
|
||||
|
||||
|
||||
wxString CADSTAR_SCH_ARCHIVE_LOADER::CreateLibName( const wxFileName& aFileName,
|
||||
const SCH_SHEET* aRootSheet )
|
||||
{
|
||||
wxString libName = aFileName.GetName();
|
||||
|
||||
if( libName.IsEmpty() && aRootSheet )
|
||||
{
|
||||
wxFileName fn( aRootSheet->GetFileName() );
|
||||
libName = fn.GetName();
|
||||
}
|
||||
|
||||
if( libName.IsEmpty() )
|
||||
libName = "noname";
|
||||
|
||||
libName = LIB_ID::FixIllegalChars( libName, true ).wx_str();
|
||||
|
||||
return libName;
|
||||
}
|
||||
|
||||
|
||||
std::vector<LIB_SYMBOL*> CADSTAR_SCH_ARCHIVE_LOADER::LoadPartsLib( const wxString& aFilename )
|
||||
{
|
||||
if( m_progressReporter )
|
||||
@@ -2078,8 +2098,11 @@ SCH_SYMBOL* CADSTAR_SCH_ARCHIVE_LOADER::loadSchematicSymbol( const SYMBOL& aCads
|
||||
const LIB_SYMBOL& aKiCadPart,
|
||||
EDA_ANGLE& aComponentOrientation )
|
||||
{
|
||||
wxString libName = CreateLibName( m_footprintLibName, m_rootSheet );
|
||||
|
||||
LIB_ID libId;
|
||||
libId.SetLibItemName( aKiCadPart.GetName() );
|
||||
libId.SetLibNickname( libName );
|
||||
|
||||
int unit = getKiCadUnitNumberFromGate( aCadstarSymbol.GateID );
|
||||
|
||||
@@ -2992,6 +3015,7 @@ void CADSTAR_SCH_ARCHIVE_LOADER::applyTextCodeIfExists( EDA_TEXT* aKiCa
|
||||
aKiCadTextItem->SetTextThickness( getKiCadLength( textCode.LineWidth ) );
|
||||
#endif
|
||||
|
||||
// Must come after SetTextSize()
|
||||
aKiCadTextItem->SetBold( textCode.Font.Modifier1 == FONT_BOLD );
|
||||
aKiCadTextItem->SetItalic( textCode.Font.Italic );
|
||||
}
|
||||
|
||||
@@ -72,6 +72,7 @@ public:
|
||||
m_designCenter.y = 0;
|
||||
m_reporter = aReporter;
|
||||
m_progressReporter = aProgressReporter;
|
||||
m_fileName = aFilename;
|
||||
|
||||
// Assume that the PCB footprint library name will be the same as the schematic filename
|
||||
wxFileName schFilename( Filename );
|
||||
@@ -97,6 +98,7 @@ public:
|
||||
*/
|
||||
void Load( SCHEMATIC* aSchematic, SCH_SHEET* aRootSheet );
|
||||
|
||||
static wxString CreateLibName( const wxFileName& aFileName, const SCH_SHEET* aRootSheet );
|
||||
|
||||
private:
|
||||
typedef std::pair<BLOCK_ID, TERMINAL_ID> BLOCK_PIN_ID;
|
||||
@@ -113,6 +115,7 @@ private:
|
||||
REPORTER* m_reporter;
|
||||
SCHEMATIC* m_schematic;
|
||||
SCH_SHEET* m_rootSheet;
|
||||
wxFileName m_fileName;
|
||||
wxString m_footprintLibName; ///< Name of the footprint library to prepend all footprints with
|
||||
|
||||
/**
|
||||
|
||||
@@ -102,19 +102,8 @@ SCH_SHEET* SCH_IO_CADSTAR_ARCHIVE::LoadSchematicFile( const wxString& aFi
|
||||
|
||||
wxCHECK_MSG( libTable, nullptr, "Could not load symbol lib table." );
|
||||
|
||||
// Lets come up with a nice library name
|
||||
wxString libName = aSchematic->Prj().GetProjectName();
|
||||
|
||||
if( libName.IsEmpty() )
|
||||
{
|
||||
wxFileName fn( rootSheet->GetFileName() );
|
||||
libName = fn.GetName();
|
||||
}
|
||||
|
||||
if( libName.IsEmpty() )
|
||||
libName = "noname";
|
||||
|
||||
libName = LIB_ID::FixIllegalChars( libName, true ).wx_str();
|
||||
wxFileName fn = aSchematic->Prj().GetProjectFullName();
|
||||
wxString libName = CADSTAR_SCH_ARCHIVE_LOADER::CreateLibName( fn, nullptr );
|
||||
|
||||
wxFileName libFileName( aSchematic->Prj().GetProjectPath(), libName,
|
||||
FILEEXT::KiCadSymbolLibFileExtension );
|
||||
|
||||
@@ -2773,14 +2773,9 @@ void SCH_IO_EAGLE::loadTextAttributes( EDA_TEXT* aText, const ETEXT& aAttribs )
|
||||
{
|
||||
aText->SetTextSize( aAttribs.ConvertSize() );
|
||||
|
||||
if( aAttribs.ratio )
|
||||
{
|
||||
if( aAttribs.ratio.CGet() > 12 )
|
||||
{
|
||||
aText->SetBold( true );
|
||||
aText->SetTextThickness( GetPenSizeForBold( aText->GetTextWidth() ) );
|
||||
}
|
||||
}
|
||||
// Must come after SetTextSize()
|
||||
if( aAttribs.ratio && aAttribs.ratio.CGet() > 12 )
|
||||
aText->SetBold( true );
|
||||
|
||||
int align = aAttribs.align ? *aAttribs.align : ETEXT::BOTTOM_LEFT;
|
||||
int degrees = aAttribs.rot ? aAttribs.rot->degrees : 0;
|
||||
@@ -2796,7 +2791,11 @@ void SCH_IO_EAGLE::loadFieldAttributes( LIB_FIELD* aField, const LIB_TEXT* aText
|
||||
aField->SetTextPos( aText->GetPosition() );
|
||||
aField->SetTextSize( aText->GetTextSize() );
|
||||
aField->SetTextAngle( aText->GetTextAngle() );
|
||||
|
||||
// Must come after SetTextSize()
|
||||
aField->SetBold( aText->IsBold() );
|
||||
aField->SetItalic( false );
|
||||
|
||||
aField->SetVertJustify( aText->GetVertJustify() );
|
||||
aField->SetHorizJustify( aText->GetHorizJustify() );
|
||||
}
|
||||
|
||||
@@ -144,8 +144,14 @@ static LIB_SYMBOL* loadSymbol( nlohmann::json project, const wxString& aLibraryP
|
||||
|| libFname.GetExt() == wxS( "zip" ) )
|
||||
{
|
||||
std::map<wxString, EASYEDAPRO::PRJ_SYMBOL> prjSymbols = project.at( "symbols" );
|
||||
std::map<wxString, EASYEDAPRO::PRJ_FOOTPRINT> prjFootprints = project.at( "footprints" );
|
||||
std::map<wxString, EASYEDAPRO::PRJ_DEVICE> prjDevices = project.at( "devices" );
|
||||
std::map<wxString, EASYEDAPRO::PRJ_FOOTPRINT> prjFootprints;
|
||||
std::map<wxString, EASYEDAPRO::PRJ_DEVICE> prjDevices;
|
||||
|
||||
if( project.contains( "footprints" ) )
|
||||
prjFootprints = project.at( "footprints" );
|
||||
|
||||
if( project.contains( "devices" ) )
|
||||
prjDevices = project.at( "devices" );
|
||||
|
||||
auto prjSymIt = std::find_if( prjSymbols.begin(), prjSymbols.end(),
|
||||
[&]( const auto& pair )
|
||||
|
||||
@@ -1086,7 +1086,7 @@ SCH_TEXT* SCH_IO_KICAD_LEGACY::loadText( LINE_READER& aReader )
|
||||
penWidth = parseInt( aReader, line, &line );
|
||||
}
|
||||
|
||||
text->SetBold( penWidth != 0 );
|
||||
text->SetBoldFlag( penWidth != 0 );
|
||||
text->SetTextThickness( penWidth != 0 ? GetPenSizeForBold( size ) : 0 );
|
||||
|
||||
// Read the text string for the text.
|
||||
@@ -1097,9 +1097,9 @@ SCH_TEXT* SCH_IO_KICAD_LEGACY::loadText( LINE_READER& aReader )
|
||||
|
||||
for( ; ; )
|
||||
{
|
||||
int i = val.find( wxT( "\\n" ) );
|
||||
size_t i = val.find( wxT( "\\n" ) );
|
||||
|
||||
if( i == wxNOT_FOUND )
|
||||
if( i == wxString::npos )
|
||||
break;
|
||||
|
||||
val.erase( i, 2 );
|
||||
@@ -1369,7 +1369,7 @@ SCH_SYMBOL* SCH_IO_KICAD_LEGACY::loadSymbol( LINE_READER& aReader )
|
||||
|
||||
if( textAttrs[2] == 'B' )
|
||||
{
|
||||
field.SetBold( true );
|
||||
field.SetBoldFlag( true );
|
||||
}
|
||||
else if( textAttrs[2] != 'N' )
|
||||
{
|
||||
|
||||
@@ -652,7 +652,7 @@ void SCH_IO_KICAD_LEGACY_LIB_CACHE::loadField( std::unique_ptr<LIB_SYMBOL>& aSym
|
||||
SCH_PARSE_ERROR( "invalid field text italic parameter", aReader, line );
|
||||
|
||||
if ( attr_2 == 'B' ) // Bold
|
||||
field->SetBold( true );
|
||||
field->SetBoldFlag( true );
|
||||
else if( attr_2 != 'N' ) // No bold is default, check for error.
|
||||
SCH_PARSE_ERROR( "invalid field text bold parameter", aReader, line );
|
||||
}
|
||||
@@ -1020,7 +1020,7 @@ LIB_TEXT* SCH_IO_KICAD_LEGACY_LIB_CACHE::loadText( std::unique_ptr<LIB_SYMBOL>&
|
||||
SCH_PARSE_ERROR( "invalid text stype, expected 'Normal' or 'Italic'", aReader, line );
|
||||
|
||||
if( parseInt( aReader, line, &line ) > 0 )
|
||||
text->SetBold( true );
|
||||
text->SetBoldFlag( true );
|
||||
|
||||
// Some old libaries version > 2.0 do not have these options for text justification:
|
||||
if( !is_eol( *line ) )
|
||||
|
||||
@@ -737,7 +737,7 @@ void SCH_IO_KICAD_SEXPR_PARSER::parseEDA_TEXT( EDA_TEXT* aText, bool aConvertOve
|
||||
case T_bold:
|
||||
{
|
||||
bool bold = parseMaybeAbsentBool( true );
|
||||
aText->SetBold( bold );
|
||||
aText->SetBoldFlag( bold );
|
||||
break;
|
||||
}
|
||||
|
||||
|
||||
@@ -1411,6 +1411,59 @@ void SCH_SHEET::setPageNumber( const KIID_PATH& aPath, const wxString& aPageNumb
|
||||
}
|
||||
|
||||
|
||||
bool SCH_SHEET::HasPageNumberChanges( const SCH_SHEET& aOther ) const
|
||||
{
|
||||
// Avoid self comparison.
|
||||
if( &aOther == this )
|
||||
return false;
|
||||
|
||||
// A difference in the instance data count implies a page numbering change.
|
||||
if( GetInstances().size() != aOther.GetInstances().size() )
|
||||
return true;
|
||||
|
||||
std::vector<SCH_SHEET_INSTANCE> instances = GetInstances();
|
||||
std::vector<SCH_SHEET_INSTANCE> otherInstances = aOther.GetInstances();
|
||||
|
||||
// Sorting may not be necessary but there is no guaratee that sheet
|
||||
// instance data will be in the correct KIID_PATH order. We should
|
||||
// probably use a std::map instead of a std::vector to store the sheet
|
||||
// instance data.
|
||||
std::sort( instances.begin(), instances.end(),
|
||||
[]( const SCH_SHEET_INSTANCE& aLhs, const SCH_SHEET_INSTANCE& aRhs )
|
||||
{
|
||||
if( aLhs.m_Path > aRhs.m_Path )
|
||||
return true;
|
||||
|
||||
return false;
|
||||
} );
|
||||
std::sort( otherInstances.begin(), otherInstances.end(),
|
||||
[]( const SCH_SHEET_INSTANCE& aLhs, const SCH_SHEET_INSTANCE& aRhs )
|
||||
{
|
||||
if( aLhs.m_Path > aRhs.m_Path )
|
||||
return true;
|
||||
|
||||
return false;
|
||||
} );
|
||||
|
||||
auto itThis = instances.begin();
|
||||
auto itOther = otherInstances.begin();
|
||||
|
||||
while( itThis != instances.end() )
|
||||
{
|
||||
if( ( itThis->m_Path == itOther->m_Path )
|
||||
&& ( itThis->m_PageNumber != itOther->m_PageNumber ) )
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
itThis++;
|
||||
itOther++;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
int SCH_SHEET::ComparePageNum( const wxString& aPageNumberA, const wxString& aPageNumberB )
|
||||
{
|
||||
if( aPageNumberA == aPageNumberB )
|
||||
|
||||
@@ -416,6 +416,14 @@ public:
|
||||
|
||||
void AddInstance( const SCH_SHEET_INSTANCE& aInstance );
|
||||
|
||||
/**
|
||||
* Check if the instance data of this sheet has any changes compared to \a aOther.
|
||||
*
|
||||
* @param aOther is the sheet to compare against.
|
||||
* @return true if there are page number changes with \a aOther otherwise false.
|
||||
*/
|
||||
bool HasPageNumberChanges( const SCH_SHEET& aOther ) const;
|
||||
|
||||
/**
|
||||
* Compares page numbers of schematic sheets.
|
||||
*
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
*
|
||||
* Copyright (C) 2017 Jean-Pierre Charras, jp.charras at wanadoo.fr
|
||||
* Copyright (C) 2011 Wayne Stambaugh <stambaughw@gmail.com>
|
||||
* Copyright (C) 1992-2023 KiCad Developers, see AUTHORS.txt for contributors.
|
||||
* Copyright (C) 1992-2023, 2024 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
|
||||
@@ -23,6 +23,7 @@
|
||||
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
|
||||
*/
|
||||
|
||||
#include <refdes_utils.h>
|
||||
#include <sch_screen.h>
|
||||
#include <sch_item.h>
|
||||
#include <sch_marker.h>
|
||||
@@ -630,6 +631,45 @@ void SCH_SHEET_PATH::RemoveSymbolInstances( const SCH_SHEET_PATH& aPrefixSheetPa
|
||||
}
|
||||
|
||||
|
||||
void SCH_SHEET_PATH::CheckForMissingSymbolInstances( const wxString& aProjectName )
|
||||
{
|
||||
wxCHECK( !aProjectName.IsEmpty() && LastScreen(), /* void */ );
|
||||
|
||||
for( SCH_ITEM* item : LastScreen()->Items().OfType( SCH_SYMBOL_T ) )
|
||||
{
|
||||
SCH_SYMBOL* symbol = static_cast<SCH_SYMBOL*>( item );
|
||||
|
||||
wxCHECK2( symbol, continue );
|
||||
|
||||
SCH_SYMBOL_INSTANCE symbolInstance;
|
||||
|
||||
if( !symbol->GetInstance( symbolInstance, Path() ) )
|
||||
{
|
||||
wxLogTrace( traceSchSheetPaths, "Adding missing symbol \"%s\" instance data for "
|
||||
"sheet path '%s'.",
|
||||
symbol->m_Uuid.AsString(), PathHumanReadable( false ) );
|
||||
|
||||
// Legacy schematics that are not shared do not contain separate instance data.
|
||||
// The symbol refrence and unit are saved in the reference field and unit entries.
|
||||
if( ( LastScreen()->GetRefCount() <= 1 ) &&
|
||||
( LastScreen()->GetFileFormatVersionAtLoad() <= 20200310 ) )
|
||||
{
|
||||
symbolInstance.m_Reference =
|
||||
symbol->GetField( REFERENCE_FIELD )->GetShownText( this, true );
|
||||
}
|
||||
else
|
||||
{
|
||||
symbolInstance.m_Reference = UTIL::GetRefDesUnannotated( symbol->GetPrefix() );
|
||||
}
|
||||
|
||||
symbolInstance.m_ProjectName = aProjectName;
|
||||
symbolInstance.m_Path = Path();
|
||||
symbol->AddHierarchicalReference( symbolInstance );
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
void SCH_SHEET_PATH::MakeFilePathRelativeToParentSheet()
|
||||
{
|
||||
wxCHECK( m_sheets.size() > 1, /* void */ );
|
||||
@@ -1338,6 +1378,13 @@ void SCH_SHEET_LIST::AddNewSheetInstances( const SCH_SHEET_PATH& aPrefixSheetPat
|
||||
}
|
||||
|
||||
|
||||
void SCH_SHEET_LIST::CheckForMissingSymbolInstances( const wxString& aProjectName )
|
||||
{
|
||||
for( SCH_SHEET_PATH& sheetPath : *this )
|
||||
sheetPath.CheckForMissingSymbolInstances( aProjectName );
|
||||
}
|
||||
|
||||
|
||||
int SCH_SHEET_LIST::GetLastVirtualPageNumber() const
|
||||
{
|
||||
int lastVirtualPageNumber = 1;
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
*
|
||||
* Copyright (C) 2017 Jean-Pierre Charras, jp.charras at wanadoo.fr
|
||||
* Copyright (C) 2011 Wayne Stambaugh <stambaughw@gmail.com>
|
||||
* Copyright (C) 1992-2023 KiCad Developers, see AUTHORS.txt for contributors.
|
||||
* Copyright (C) 1992-2023, 2024 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
|
||||
@@ -408,6 +408,8 @@ public:
|
||||
|
||||
void RemoveSymbolInstances( const SCH_SHEET_PATH& aPrefixSheetPath );
|
||||
|
||||
void CheckForMissingSymbolInstances( const wxString& aProjectName );
|
||||
|
||||
bool operator==( const SCH_SHEET_PATH& d1 ) const;
|
||||
|
||||
bool operator!=( const SCH_SHEET_PATH& d1 ) const { return !( *this == d1 ) ; }
|
||||
@@ -690,6 +692,8 @@ public:
|
||||
|
||||
void RemoveSymbolInstances( const SCH_SHEET_PATH& aPrefixSheetPath );
|
||||
|
||||
void CheckForMissingSymbolInstances( const wxString& aProjectName );
|
||||
|
||||
bool HasPath( const KIID_PATH& aPath ) const;
|
||||
|
||||
bool ContainsSheet( const SCH_SHEET* aSheet ) const;
|
||||
|
||||
@@ -400,7 +400,8 @@ void SCH_EDIT_FRAME::PutDataInPreviousState( PICKED_ITEMS_LIST* aList )
|
||||
wxCHECK2( origSheet && copySheet, continue );
|
||||
|
||||
if( ( origSheet->GetName() != copySheet->GetName() )
|
||||
|| ( origSheet->GetFileName() != copySheet->GetFileName() ) )
|
||||
|| ( origSheet->GetFileName() != copySheet->GetFileName() )
|
||||
|| origSheet->HasPageNumberChanges( *copySheet ) )
|
||||
{
|
||||
rebuildHierarchyNavigator = true;
|
||||
}
|
||||
@@ -466,15 +467,13 @@ void SCH_EDIT_FRAME::PutDataInPreviousState( PICKED_ITEMS_LIST* aList )
|
||||
|
||||
RecalculateConnections( &localCommit, connectivityCleanUp );
|
||||
|
||||
// Update the hierarchy navigator when there are sheet changes.
|
||||
if( connectivityCleanUp == GLOBAL_CLEANUP )
|
||||
{
|
||||
SetSheetNumberAndCount();
|
||||
|
||||
if( rebuildHierarchyNavigator )
|
||||
UpdateHierarchyNavigator();
|
||||
}
|
||||
}
|
||||
|
||||
// Update the hierarchy navigator when there are sheet changes.
|
||||
if( rebuildHierarchyNavigator )
|
||||
UpdateHierarchyNavigator();
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -44,7 +44,6 @@ void SIMULATOR_FRAME_UI::parseTraceParams( SIM_PLOT_TAB* aPlotTab, TRACE* aTrace
|
||||
CURSOR* cursor = new CURSOR( aTrace, aPlotTab );
|
||||
|
||||
cursor->SetName( aSignalName );
|
||||
cursor->SetPen( wxPen( aTrace->GetTraceColour() ) );
|
||||
cursor->SetCoordX( x );
|
||||
|
||||
aTrace->SetCursor( aCursorId, cursor );
|
||||
|
||||
@@ -303,14 +303,13 @@ bool NGSPICE::LoadNetlist( const std::string& aNetlist )
|
||||
std::vector<char*> lines;
|
||||
std::stringstream ss( aNetlist );
|
||||
|
||||
m_netlist = "";
|
||||
m_netlist.erase();
|
||||
|
||||
while( !ss.eof() )
|
||||
for( std::string line; std::getline( ss, line ); )
|
||||
{
|
||||
char line[1024];
|
||||
ss.getline( line, sizeof( line ) );
|
||||
lines.push_back( strdup( line ) );
|
||||
m_netlist += std::string( line ) + std::string( "\n" );
|
||||
lines.push_back( strdup( line.data() ) );
|
||||
m_netlist += line;
|
||||
m_netlist += '\n';
|
||||
}
|
||||
|
||||
lines.push_back( nullptr ); // sentinel, as requested in ngSpice_Circ description
|
||||
|
||||
@@ -53,7 +53,8 @@ void SIM_LIB_MGR::Clear()
|
||||
}
|
||||
|
||||
|
||||
wxString SIM_LIB_MGR::ResolveLibraryPath( const wxString& aLibraryPath, const PROJECT* aProject )
|
||||
wxString SIM_LIB_MGR::ResolveLibraryPath( const wxString& aLibraryPath, const PROJECT* aProject,
|
||||
REPORTER& aReporter )
|
||||
{
|
||||
wxString expandedPath = ExpandEnvVarSubstitutions( aLibraryPath, aProject );
|
||||
|
||||
@@ -80,20 +81,23 @@ wxString SIM_LIB_MGR::ResolveLibraryPath( const wxString& aLibraryPath, const PR
|
||||
|
||||
if( spiceLibDir.IsEmpty() || spiceLibFn.GetFullPath() == projectFn.GetFullPath() )
|
||||
{
|
||||
THROW_IO_ERROR( wxString::Format( _( "Simulation model library not found at '%s'" ),
|
||||
projectFn.GetFullPath() ) );
|
||||
aReporter.Report( wxString::Format( _( "Simulation model library not found at '%s'" ),
|
||||
projectFn.GetFullPath() ) );
|
||||
}
|
||||
else
|
||||
{
|
||||
THROW_IO_ERROR( wxString::Format( _( "Simulation model library not found at '%s' or '%s'" ),
|
||||
projectFn.GetFullPath(),
|
||||
spiceLibFn.GetFullPath() ) );
|
||||
aReporter.Report( wxString::Format( _( "Simulation model library not found at '%s' or '%s'" ),
|
||||
projectFn.GetFullPath(),
|
||||
spiceLibFn.GetFullPath() ) );
|
||||
}
|
||||
|
||||
return aLibraryPath;
|
||||
}
|
||||
|
||||
|
||||
wxString SIM_LIB_MGR::ResolveEmbeddedLibraryPath( const wxString& aLibPath,
|
||||
const wxString& aRelativeLib )
|
||||
const wxString& aRelativeLib,
|
||||
REPORTER& aReporter )
|
||||
{
|
||||
wxFileName testPath( aLibPath );
|
||||
wxString fullPath( aLibPath );
|
||||
@@ -102,12 +106,7 @@ wxString SIM_LIB_MGR::ResolveEmbeddedLibraryPath( const wxString& aLibPath,
|
||||
{
|
||||
wxString relLib( aRelativeLib );
|
||||
|
||||
try
|
||||
{
|
||||
relLib = ResolveLibraryPath( relLib, m_project );
|
||||
}
|
||||
catch( ... )
|
||||
{}
|
||||
relLib = ResolveLibraryPath( relLib, m_project, aReporter );
|
||||
|
||||
wxFileName fn( relLib );
|
||||
|
||||
@@ -115,17 +114,12 @@ wxString SIM_LIB_MGR::ResolveEmbeddedLibraryPath( const wxString& aLibPath,
|
||||
fullPath = testPath.GetFullPath();
|
||||
}
|
||||
|
||||
try
|
||||
{
|
||||
wxFileName fn( fullPath );
|
||||
wxFileName fn( fullPath );
|
||||
|
||||
if( !fn.Exists() )
|
||||
fullPath = aLibPath;
|
||||
if( !fn.Exists() )
|
||||
fullPath = aLibPath;
|
||||
|
||||
fullPath = ResolveLibraryPath( fullPath, m_project );
|
||||
}
|
||||
catch( ... )
|
||||
{}
|
||||
fullPath = ResolveLibraryPath( fullPath, m_project, aReporter );
|
||||
|
||||
return fullPath;
|
||||
}
|
||||
@@ -133,23 +127,26 @@ wxString SIM_LIB_MGR::ResolveEmbeddedLibraryPath( const wxString& aLibPath,
|
||||
|
||||
void SIM_LIB_MGR::SetLibrary( const wxString& aLibraryPath, REPORTER& aReporter )
|
||||
{
|
||||
try
|
||||
wxString path = ResolveLibraryPath( aLibraryPath, m_project, aReporter );
|
||||
|
||||
if( aReporter.HasMessageOfSeverity( RPT_SEVERITY_UNDEFINED | RPT_SEVERITY_ERROR ) )
|
||||
return;
|
||||
|
||||
if( !wxFileName::Exists( path ) )
|
||||
{
|
||||
wxString path = ResolveLibraryPath( aLibraryPath, m_project );
|
||||
|
||||
std::function<wxString(const wxString&, const wxString&)> f2 =
|
||||
std::bind( &SIM_LIB_MGR::ResolveEmbeddedLibraryPath, this, _1, _2 );
|
||||
|
||||
std::unique_ptr<SIM_LIBRARY> library = SIM_LIBRARY::Create( path, m_forceFullParse,
|
||||
aReporter, &f2 );
|
||||
|
||||
Clear();
|
||||
m_libraries[path] = std::move( library );
|
||||
}
|
||||
catch( const IO_ERROR& e )
|
||||
{
|
||||
aReporter.Report( e.What() );
|
||||
aReporter.Report( wxString::Format( _( "Simulation model library not found at '%s'" ),
|
||||
path ) );
|
||||
return;
|
||||
}
|
||||
|
||||
std::unique_ptr<SIM_LIBRARY> library = SIM_LIBRARY::Create( path, m_forceFullParse, aReporter,
|
||||
[&]( const wxString& libPath, const wxString& relativeLib ) -> wxString
|
||||
{
|
||||
return ResolveEmbeddedLibraryPath( libPath, relativeLib, aReporter );
|
||||
} );
|
||||
|
||||
Clear();
|
||||
m_libraries[path] = std::move( library );
|
||||
}
|
||||
|
||||
|
||||
@@ -299,37 +296,24 @@ SIM_LIBRARY::MODEL SIM_LIB_MGR::CreateModel( const wxString& aLibraryPath,
|
||||
const std::vector<LIB_PIN*>& aPins,
|
||||
REPORTER& aReporter )
|
||||
{
|
||||
wxString path;
|
||||
wxString msg;
|
||||
SIM_LIBRARY* library = nullptr;
|
||||
SIM_MODEL* baseModel = nullptr;
|
||||
std::string modelName;
|
||||
wxString path = ResolveLibraryPath( aLibraryPath, m_project, aReporter );
|
||||
|
||||
try
|
||||
auto it = m_libraries.find( path );
|
||||
|
||||
if( it == m_libraries.end() )
|
||||
{
|
||||
path = ResolveLibraryPath( aLibraryPath, m_project );
|
||||
|
||||
auto it = m_libraries.find( path );
|
||||
|
||||
if( it == m_libraries.end() )
|
||||
{
|
||||
std::function<wxString( const wxString&, const wxString& )> f2 =
|
||||
std::bind( &SIM_LIB_MGR::ResolveEmbeddedLibraryPath, this, _1, _2 );
|
||||
|
||||
it = m_libraries.emplace( path, SIM_LIBRARY::Create( path, m_forceFullParse,
|
||||
aReporter, &f2 ) ).first;
|
||||
}
|
||||
|
||||
library = &*it->second;
|
||||
it = m_libraries.emplace( path, SIM_LIBRARY::Create( path, m_forceFullParse, aReporter,
|
||||
[&]( const wxString& libPath, const wxString& relativeLib ) -> wxString
|
||||
{
|
||||
return ResolveEmbeddedLibraryPath( libPath, relativeLib, aReporter );
|
||||
} ) ).first;
|
||||
}
|
||||
catch( const IO_ERROR& e )
|
||||
{
|
||||
msg.Printf( _( "Error loading simulation model library '%s': %s" ),
|
||||
path,
|
||||
e.What() );
|
||||
|
||||
aReporter.Report( msg, RPT_SEVERITY_ERROR );
|
||||
}
|
||||
library = &*it->second;
|
||||
|
||||
if( aBaseModelName == "" )
|
||||
{
|
||||
|
||||
@@ -79,8 +79,10 @@ public:
|
||||
std::map<wxString, std::reference_wrapper<const SIM_LIBRARY>> GetLibraries() const;
|
||||
std::vector<std::reference_wrapper<SIM_MODEL>> GetModels() const;
|
||||
|
||||
static wxString ResolveLibraryPath( const wxString& aLibraryPath, const PROJECT* aProject );
|
||||
wxString ResolveEmbeddedLibraryPath( const wxString& aLibPath, const wxString& aRelativeLib );
|
||||
static wxString ResolveLibraryPath( const wxString& aLibraryPath, const PROJECT* aProject,
|
||||
REPORTER& aReporter );
|
||||
wxString ResolveEmbeddedLibraryPath( const wxString& aLibPath, const wxString& aRelativeLib,
|
||||
REPORTER& aReporter );
|
||||
|
||||
private:
|
||||
const PROJECT* m_project;
|
||||
|
||||
@@ -31,7 +31,7 @@
|
||||
|
||||
std::unique_ptr<SIM_LIBRARY>
|
||||
SIM_LIBRARY::Create( const wxString& aFilePath, bool aForceFullParse, REPORTER& aReporter,
|
||||
std::function<wxString( const wxString&, const wxString& )>* aResolver )
|
||||
const std::function<wxString( const wxString&, const wxString& )>& aResolver )
|
||||
{
|
||||
std::unique_ptr<SIM_LIBRARY> library;
|
||||
|
||||
|
||||
@@ -56,7 +56,7 @@ public:
|
||||
*/
|
||||
static std::unique_ptr<SIM_LIBRARY>
|
||||
Create( const wxString& aFilePath, bool aForceFullParse, REPORTER& aReporter,
|
||||
std::function<wxString( const wxString&, const wxString& )>* aResolver );
|
||||
const std::function<wxString( const wxString&, const wxString& )>& aResolver );
|
||||
|
||||
/**
|
||||
* Read library from a source file. Must be in the format appropriate to the subclass, e.g.
|
||||
@@ -77,7 +77,7 @@ protected:
|
||||
std::vector<std::string> m_modelNames;
|
||||
std::vector<std::unique_ptr<SIM_MODEL>> m_models;
|
||||
|
||||
std::function<wxString( const wxString&, const wxString& )>* m_pathResolver;
|
||||
std::function<wxString( const wxString&, const wxString& )> m_pathResolver;
|
||||
|
||||
std::string m_filePath;
|
||||
};
|
||||
|
||||
@@ -394,7 +394,7 @@ TYPE SIM_MODEL::ReadTypeFromFields( const std::vector<T>& aFields, REPORTER& aRe
|
||||
std::string deviceTypeFieldValue = GetFieldValue( &aFields, SIM_DEVICE_FIELD );
|
||||
std::string typeFieldValue = GetFieldValue( &aFields, SIM_DEVICE_SUBTYPE_FIELD );
|
||||
|
||||
if( deviceTypeFieldValue != "" )
|
||||
if( !deviceTypeFieldValue.empty() )
|
||||
{
|
||||
for( TYPE type : TYPE_ITERATOR() )
|
||||
{
|
||||
@@ -406,7 +406,7 @@ TYPE SIM_MODEL::ReadTypeFromFields( const std::vector<T>& aFields, REPORTER& aRe
|
||||
}
|
||||
}
|
||||
|
||||
if( typeFieldValue != "" )
|
||||
if( typeFieldValue.empty() )
|
||||
return TYPE::NONE;
|
||||
|
||||
if( aFields.size() > REFERENCE_FIELD )
|
||||
@@ -524,10 +524,15 @@ std::unique_ptr<SIM_MODEL> SIM_MODEL::Create( const SIM_MODEL* aBaseModel,
|
||||
{
|
||||
NULL_REPORTER devnull;
|
||||
TYPE type = aBaseModel->GetType();
|
||||
TYPE type_override = ReadTypeFromFields( aFields, devnull );
|
||||
|
||||
// No REPORTER here; we're just checking to see if we have an override
|
||||
if( ReadTypeFromFields( aFields, devnull ) != TYPE::NONE )
|
||||
type = ReadTypeFromFields( aFields, devnull );
|
||||
// Check for an override in the case of IBIS models.
|
||||
// The other models require type to be set from the base model.
|
||||
if( dynamic_cast<const SIM_MODEL_KIBIS*>( aBaseModel ) &&
|
||||
type_override != TYPE::NONE )
|
||||
{
|
||||
type = type_override;
|
||||
}
|
||||
|
||||
if( dynamic_cast<const SIM_MODEL_SPICE_FALLBACK*>( aBaseModel ) )
|
||||
model = std::make_unique<SIM_MODEL_SPICE_FALLBACK>( type );
|
||||
@@ -1804,8 +1809,7 @@ void SIM_MODEL::MigrateSimModel( T_symbol& aSymbol, const PROJECT* aProject )
|
||||
|
||||
if( !lib.IsEmpty() )
|
||||
{
|
||||
wxString msg;
|
||||
WX_STRING_REPORTER reporter( &msg );
|
||||
WX_STRING_REPORTER reporter;
|
||||
SIM_LIB_MGR libMgr( aProject );
|
||||
std::vector<T_field> emptyFields;
|
||||
|
||||
|
||||
@@ -68,7 +68,11 @@ std::string SPICE_GENERATOR_KIBIS::IbisDevice( const SPICE_ITEM& aItem, const PR
|
||||
std::string ibisModelName = SIM_MODEL::GetFieldValue( &aItem.fields, SIM_LIBRARY_KIBIS::MODEL_FIELD );
|
||||
bool diffMode = SIM_MODEL::GetFieldValue( &aItem.fields, SIM_LIBRARY_KIBIS::DIFF_FIELD ) == "1";
|
||||
|
||||
wxString path = SIM_LIB_MGR::ResolveLibraryPath( ibisLibFilename, &aProject );
|
||||
WX_STRING_REPORTER reporter;
|
||||
wxString path = SIM_LIB_MGR::ResolveLibraryPath( ibisLibFilename, &aProject, reporter );
|
||||
|
||||
if( reporter.HasMessage() )
|
||||
THROW_IO_ERROR( reporter.GetMessages() );
|
||||
|
||||
KIBIS kibis( std::string( path.c_str() ) );
|
||||
kibis.m_cacheDir = std::string( aCacheDir.c_str() );
|
||||
|
||||
@@ -365,9 +365,14 @@ void CURSOR::Plot( wxDC& aDC, mpWindow& aWindow )
|
||||
wxCoord bottomPx = aWindow.GetScrY() - aWindow.GetMarginBottom();
|
||||
|
||||
wxPen pen = GetPen();
|
||||
wxColour fg = GetPen().GetColour();
|
||||
wxColour fg = aWindow.GetForegroundColour();
|
||||
COLOR4D cursorColor = COLOR4D( m_trace->GetTraceColour() ).Mix( fg, 0.6 );
|
||||
COLOR4D textColor = fg;
|
||||
|
||||
pen.SetColour( COLOR4D( m_trace->GetTraceColour() ).Mix( fg, 0.6 ).ToColour() );
|
||||
if( cursorColor.Distance( textColor ) < 0.66 )
|
||||
textColor.Invert();
|
||||
|
||||
pen.SetColour( cursorColor.ToColour() );
|
||||
pen.SetStyle( m_continuous ? wxPENSTYLE_SOLID : wxPENSTYLE_LONG_DASH );
|
||||
aDC.SetPen( pen );
|
||||
|
||||
@@ -401,7 +406,7 @@ void CURSOR::Plot( wxDC& aDC, mpWindow& aWindow )
|
||||
aDC.SetBrush( brush );
|
||||
aDC.DrawPolygon( 3, poly );
|
||||
|
||||
aDC.SetTextForeground( fg );
|
||||
aDC.SetTextForeground( textColor.ToColour() );
|
||||
aDC.DrawLabel( id, textRect, wxALIGN_CENTER_HORIZONTAL | wxALIGN_CENTER_VERTICAL );
|
||||
}
|
||||
}
|
||||
|
||||
@@ -62,8 +62,7 @@
|
||||
|
||||
|
||||
// Reporter is stored by pointer in KIBIS, so keep this here to avoid crashes
|
||||
static wxString s_errors;
|
||||
static WX_STRING_REPORTER s_reporter( &s_errors );
|
||||
static WX_STRING_REPORTER s_reporter;
|
||||
|
||||
|
||||
class SIM_THREAD_REPORTER : public SIMULATOR_REPORTER
|
||||
@@ -343,9 +342,12 @@ void SIMULATOR_FRAME::UpdateTitle()
|
||||
// Don't let the dialog grow too tall: you may not be able to get to the OK button
|
||||
#define MAX_MESSAGES 20
|
||||
|
||||
void SIMULATOR_FRAME::showNetlistErrors( const wxString& aErrors )
|
||||
void SIMULATOR_FRAME::showNetlistErrors( const WX_STRING_REPORTER& aReporter )
|
||||
{
|
||||
wxArrayString lines = wxSplit( aErrors, '\n' );
|
||||
if( !aReporter.HasMessage() )
|
||||
return;
|
||||
|
||||
wxArrayString lines = wxSplit( aReporter.GetMessages(), '\n' );
|
||||
|
||||
if( lines.size() > MAX_MESSAGES )
|
||||
{
|
||||
@@ -353,13 +355,22 @@ void SIMULATOR_FRAME::showNetlistErrors( const wxString& aErrors )
|
||||
lines.Add( wxS( "..." ) );
|
||||
}
|
||||
|
||||
DisplayErrorMessage( this, _( "Errors during netlist generation." ), wxJoin( lines, '\n' ) );
|
||||
if( aReporter.HasMessageOfSeverity( RPT_SEVERITY_UNDEFINED | RPT_SEVERITY_ERROR ) )
|
||||
{
|
||||
DisplayErrorMessage( this, _( "Errors during netlist generation." ),
|
||||
wxJoin( lines, '\n' ) );
|
||||
}
|
||||
else if( aReporter.HasMessageOfSeverity( RPT_SEVERITY_WARNING ) )
|
||||
{
|
||||
DisplayInfoMessage( this, _( "Warnings during netlist generation." ),
|
||||
wxJoin( lines, '\n' ) );
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
bool SIMULATOR_FRAME::LoadSimulator( const wxString& aSimCommand, unsigned aSimOptions )
|
||||
{
|
||||
s_errors.clear();
|
||||
s_reporter.Clear();
|
||||
|
||||
if( !m_schematicFrame->ReadyToNetlist( _( "Simulator requires a fully annotated schematic." ) ) )
|
||||
return false;
|
||||
@@ -368,26 +379,23 @@ bool SIMULATOR_FRAME::LoadSimulator( const wxString& aSimCommand, unsigned aSimO
|
||||
if( ADVANCED_CFG::GetCfg().m_IncrementalConnectivity )
|
||||
m_schematicFrame->RecalculateConnections( nullptr, GLOBAL_CLEANUP );
|
||||
|
||||
if( !m_simulator->Attach( m_circuitModel, aSimCommand, aSimOptions, Prj().GetProjectPath(),
|
||||
s_reporter ) )
|
||||
{
|
||||
showNetlistErrors( s_errors );
|
||||
return false;
|
||||
}
|
||||
bool success = m_simulator->Attach( m_circuitModel, aSimCommand, aSimOptions,
|
||||
Prj().GetProjectPath(), s_reporter );
|
||||
|
||||
return true;
|
||||
showNetlistErrors( s_reporter );
|
||||
|
||||
return success;
|
||||
}
|
||||
|
||||
|
||||
void SIMULATOR_FRAME::ReloadSimulator( const wxString& aSimCommand, unsigned aSimOptions )
|
||||
{
|
||||
s_errors.clear();
|
||||
s_reporter.Clear();
|
||||
|
||||
if( !m_simulator->Attach( m_circuitModel, aSimCommand, aSimOptions, Prj().GetProjectPath(),
|
||||
s_reporter ) )
|
||||
{
|
||||
showNetlistErrors( s_errors );
|
||||
}
|
||||
m_simulator->Attach( m_circuitModel, aSimCommand, aSimOptions, Prj().GetProjectPath(),
|
||||
s_reporter );
|
||||
|
||||
showNetlistErrors( s_reporter );
|
||||
}
|
||||
|
||||
|
||||
@@ -457,6 +465,8 @@ void SIMULATOR_FRAME::StartSimulation()
|
||||
|
||||
if( simulatorLock.owns_lock() )
|
||||
{
|
||||
m_simFinished = false;
|
||||
|
||||
m_ui->OnSimUpdate();
|
||||
m_simulator->Run();
|
||||
|
||||
@@ -571,16 +581,15 @@ bool SIMULATOR_FRAME::EditAnalysis()
|
||||
SIM_TAB* simTab = m_ui->GetCurrentSimTab();
|
||||
DIALOG_SIM_COMMAND dlg( this, m_circuitModel, m_simulator->Settings() );
|
||||
|
||||
s_errors.clear();
|
||||
s_reporter.Clear();
|
||||
|
||||
if( !simTab )
|
||||
return false;
|
||||
|
||||
if( !m_circuitModel->ReadSchematicAndLibraries( NETLIST_EXPORTER_SPICE::OPTION_DEFAULT_FLAGS,
|
||||
s_reporter ) )
|
||||
{
|
||||
showNetlistErrors( s_errors );
|
||||
}
|
||||
m_circuitModel->ReadSchematicAndLibraries( NETLIST_EXPORTER_SPICE::OPTION_DEFAULT_FLAGS,
|
||||
s_reporter );
|
||||
|
||||
showNetlistErrors( s_reporter );
|
||||
|
||||
dlg.SetSimCommand( simTab->GetSimCommand() );
|
||||
dlg.SetSimOptions( simTab->GetSimOptions() );
|
||||
|
||||
@@ -194,7 +194,7 @@ private:
|
||||
|
||||
void setupUIConditions() override;
|
||||
|
||||
void showNetlistErrors( const wxString& aErrors );
|
||||
void showNetlistErrors( const WX_STRING_REPORTER& aReporter );
|
||||
|
||||
bool canCloseWindow( wxCloseEvent& aEvent ) override;
|
||||
void doCloseWindow() override;
|
||||
|
||||
@@ -813,12 +813,14 @@ void SIMULATOR_FRAME_UI::rebuildSignalsGrid( wxString aFilter )
|
||||
attr->SetReadOnly(); // not really; we delegate interactivity to GRID_TRICKS
|
||||
attr->SetAlignment( wxALIGN_CENTER, wxALIGN_CENTER );
|
||||
m_signalsGrid->SetAttr( row, COL_CURSOR_1, attr );
|
||||
m_signalsGrid->SetCellValue( row, COL_CURSOR_1, trace->GetCursor( 1 ) ? "1" : "0" );
|
||||
|
||||
attr = new wxGridCellAttr;
|
||||
attr->SetRenderer( new wxGridCellBoolRenderer() );
|
||||
attr->SetReadOnly(); // not really; we delegate interactivity to GRID_TRICKS
|
||||
attr->SetAlignment( wxALIGN_CENTER, wxALIGN_CENTER );
|
||||
m_signalsGrid->SetAttr( row, COL_CURSOR_2, attr );
|
||||
m_signalsGrid->SetCellValue( row, COL_CURSOR_2, trace->GetCursor( 2 ) ? "1" : "0" );
|
||||
}
|
||||
|
||||
row++;
|
||||
@@ -1214,6 +1216,7 @@ void SIMULATOR_FRAME_UI::onMeasurementsGridCellChanged( wxGridEvent& aEvent )
|
||||
if( col == COL_MEASUREMENT )
|
||||
{
|
||||
UpdateMeasurement( row );
|
||||
updateMeasurementsFromGrid();
|
||||
OnModify();
|
||||
}
|
||||
else
|
||||
@@ -1365,6 +1368,8 @@ void SIMULATOR_FRAME_UI::UpdateMeasurement( int aRow )
|
||||
|
||||
fmt.UpdateUnits( units );
|
||||
SetMeasureFormat( aRow, fmt );
|
||||
|
||||
updateMeasurementsFromGrid();
|
||||
}
|
||||
|
||||
if( m_simulatorFrame->SimFinished() )
|
||||
@@ -1493,9 +1498,9 @@ void SIMULATOR_FRAME_UI::AddMeasurement( const wxString& aCmd )
|
||||
}
|
||||
|
||||
m_measurementsGrid->SetCellValue( row, COL_MEASUREMENT, aCmd );
|
||||
SetMeasureFormat( row, { 2, wxS( "~V" ) } );
|
||||
|
||||
UpdateMeasurement( row );
|
||||
updateMeasurementsFromGrid();
|
||||
OnModify();
|
||||
|
||||
// Always leave at least one empty row for type-in:
|
||||
@@ -1831,8 +1836,7 @@ void SIMULATOR_FRAME_UI::applyUserDefinedSignals()
|
||||
|
||||
void SIMULATOR_FRAME_UI::applyTuners()
|
||||
{
|
||||
wxString errors;
|
||||
WX_STRING_REPORTER reporter( &errors );
|
||||
WX_STRING_REPORTER reporter;
|
||||
|
||||
for( const TUNER_SLIDER* tuner : m_tuners )
|
||||
{
|
||||
@@ -1862,7 +1866,8 @@ void SIMULATOR_FRAME_UI::applyTuners()
|
||||
}
|
||||
|
||||
if( reporter.HasMessage() )
|
||||
DisplayErrorMessage( this, _( "Could not apply tuned value(s):" ) + wxS( "\n" ) + errors );
|
||||
DisplayErrorMessage( this, _( "Could not apply tuned value(s):" ) + wxS( "\n" )
|
||||
+ reporter.GetMessages() );
|
||||
}
|
||||
|
||||
|
||||
@@ -2019,7 +2024,6 @@ bool SIMULATOR_FRAME_UI::loadJsonWorkbook( const wxString& aPath )
|
||||
CURSOR* cursor = new CURSOR( aTrace, aPlotTab );
|
||||
|
||||
cursor->SetName( aSignalName );
|
||||
cursor->SetPen( wxPen( aTrace->GetTraceColour() ) );
|
||||
cursor->SetCoordX( aCursor_js[ "position" ] );
|
||||
|
||||
aTrace->SetCursor( aCursorId, cursor );
|
||||
@@ -2397,7 +2401,7 @@ void SIMULATOR_FRAME_UI::updateMeasurementsFromGrid()
|
||||
|
||||
void SIMULATOR_FRAME_UI::onPlotChanging( wxAuiNotebookEvent& event )
|
||||
{
|
||||
updateMeasurementsFromGrid();
|
||||
m_measurementsGrid->ClearRows();
|
||||
|
||||
event.Skip();
|
||||
}
|
||||
|
||||
@@ -118,10 +118,7 @@ void SPICE_LIBRARY_PARSER::readFallbacks( const wxString& aFilePath, REPORTER& a
|
||||
}
|
||||
else if( token == wxS( ".inc" ) )
|
||||
{
|
||||
wxString lib = tokenizer.GetNextToken();
|
||||
|
||||
if( m_library.m_pathResolver )
|
||||
lib = ( *m_library.m_pathResolver )( lib, aFilePath );
|
||||
wxString lib = m_library.m_pathResolver( tokenizer.GetNextToken(), aFilePath );
|
||||
|
||||
parseFile( lib, aReporter );
|
||||
}
|
||||
@@ -170,13 +167,10 @@ void SPICE_LIBRARY_PARSER::parseFile( const wxString &aFilePath, REPORTER& aRepo
|
||||
}
|
||||
else if( node->is_type<SIM_LIBRARY_SPICE_PARSER::dotInclude>() )
|
||||
{
|
||||
wxString lib = node->children.at( 0 )->string();
|
||||
wxString lib = m_library.m_pathResolver( node->children.at( 0 )->string(), aFilePath );
|
||||
|
||||
try
|
||||
{
|
||||
if( m_library.m_pathResolver )
|
||||
lib = ( *m_library.m_pathResolver )( lib, aFilePath );
|
||||
|
||||
parseFile( lib, aReporter );
|
||||
}
|
||||
catch( const IO_ERROR& e )
|
||||
|
||||
@@ -40,10 +40,18 @@
|
||||
|
||||
void SPICE_VALUE_FORMAT::FromString( const wxString& aString )
|
||||
{
|
||||
long val;
|
||||
aString.Left( 1 ).ToLong( &val );
|
||||
Precision = (int) val;
|
||||
Range = aString.Right( aString.Length() - 1 );
|
||||
if( aString.IsEmpty() )
|
||||
{
|
||||
Precision = 3;
|
||||
Range = wxS( "~V" );
|
||||
}
|
||||
else
|
||||
{
|
||||
long val;
|
||||
aString.Left( 1 ).ToLong( &val );
|
||||
Precision = (int) val;
|
||||
Range = aString.Right( aString.Length() - 1 );
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -29,6 +29,7 @@
|
||||
#include <tool/tool_manager.h>
|
||||
#include <tools/ee_actions.h>
|
||||
#include <tools/ee_selection_tool.h>
|
||||
#include <tools/symbol_editor_drawing_tools.h>
|
||||
|
||||
|
||||
void SYMBOL_EDIT_FRAME::PushSymbolToUndoList( const wxString& aDescription, LIB_SYMBOL* aSymbolCopy,
|
||||
@@ -37,6 +38,8 @@ void SYMBOL_EDIT_FRAME::PushSymbolToUndoList( const wxString& aDescription, LIB_
|
||||
if( !aSymbolCopy )
|
||||
return;
|
||||
|
||||
auto* drawingTool = GetToolManager()->GetTool<SYMBOL_EDITOR_DRAWING_TOOLS>();
|
||||
|
||||
PICKED_ITEMS_LIST* lastcmd = new PICKED_ITEMS_LIST();
|
||||
|
||||
// Clear current flags (which can be temporary set by a current edit command).
|
||||
@@ -45,6 +48,7 @@ void SYMBOL_EDIT_FRAME::PushSymbolToUndoList( const wxString& aDescription, LIB_
|
||||
aSymbolCopy->SetFlags( UR_TRANSIENT );
|
||||
|
||||
ITEM_PICKER wrapper( GetScreen(), aSymbolCopy, aUndoType );
|
||||
wrapper.SetGroupId( drawingTool->GetLastPin() );
|
||||
lastcmd->PushItem( wrapper );
|
||||
lastcmd->SetDescription( aDescription );
|
||||
PushCommandToUndoList( lastcmd );
|
||||
@@ -67,6 +71,8 @@ void SYMBOL_EDIT_FRAME::GetSymbolFromRedoList()
|
||||
if( GetRedoCommandCount() <= 0 )
|
||||
return;
|
||||
|
||||
auto* drawingTool = GetToolManager()->GetTool<SYMBOL_EDITOR_DRAWING_TOOLS>();
|
||||
|
||||
// Load the last redo entry
|
||||
PICKED_ITEMS_LIST* redoCommand = PopCommandFromRedoList();
|
||||
ITEM_PICKER redoWrapper = redoCommand->PopItem();
|
||||
@@ -75,6 +81,7 @@ void SYMBOL_EDIT_FRAME::GetSymbolFromRedoList()
|
||||
delete redoCommand;
|
||||
|
||||
LIB_SYMBOL* symbol = (LIB_SYMBOL*) redoWrapper.GetItem();
|
||||
KIID lastPin = redoWrapper.GetGroupId();
|
||||
UNDO_REDO undoRedoType = redoWrapper.GetStatus();
|
||||
wxCHECK( symbol, /* void */ );
|
||||
symbol->ClearFlags( UR_TRANSIENT );
|
||||
@@ -85,6 +92,7 @@ void SYMBOL_EDIT_FRAME::GetSymbolFromRedoList()
|
||||
|
||||
oldSymbol->SetFlags( UR_TRANSIENT );
|
||||
ITEM_PICKER undoWrapper( GetScreen(), oldSymbol, undoRedoType );
|
||||
undoWrapper.SetGroupId( drawingTool->GetLastPin() );
|
||||
undoCommand->SetDescription( description );
|
||||
undoCommand->PushItem( undoWrapper );
|
||||
PushCommandToUndoList( undoCommand );
|
||||
@@ -94,6 +102,7 @@ void SYMBOL_EDIT_FRAME::GetSymbolFromRedoList()
|
||||
// <previous symbol> is now put in undo list and is owned by this list
|
||||
// Just set the current symbol to the symbol which come from the redo list
|
||||
m_symbol = symbol;
|
||||
drawingTool->SetLastPin( lastPin );
|
||||
|
||||
if( undoRedoType == UNDO_REDO::LIB_RENAME )
|
||||
{
|
||||
@@ -118,6 +127,8 @@ void SYMBOL_EDIT_FRAME::GetSymbolFromUndoList()
|
||||
if( GetUndoCommandCount() <= 0 )
|
||||
return;
|
||||
|
||||
auto* drawingTool = GetToolManager()->GetTool<SYMBOL_EDITOR_DRAWING_TOOLS>();
|
||||
|
||||
// Load the last undo entry
|
||||
PICKED_ITEMS_LIST* undoCommand = PopCommandFromUndoList();
|
||||
wxString description = undoCommand->GetDescription();
|
||||
@@ -126,6 +137,7 @@ void SYMBOL_EDIT_FRAME::GetSymbolFromUndoList()
|
||||
delete undoCommand;
|
||||
|
||||
LIB_SYMBOL* symbol = (LIB_SYMBOL*) undoWrapper.GetItem();
|
||||
KIID lastPin = undoWrapper.GetGroupId();
|
||||
UNDO_REDO undoRedoType = undoWrapper.GetStatus();
|
||||
wxCHECK( symbol, /* void */ );
|
||||
symbol->ClearFlags( UR_TRANSIENT );
|
||||
@@ -136,6 +148,7 @@ void SYMBOL_EDIT_FRAME::GetSymbolFromUndoList()
|
||||
|
||||
oldSymbol->SetFlags( UR_TRANSIENT );
|
||||
ITEM_PICKER redoWrapper( GetScreen(), oldSymbol, undoRedoType );
|
||||
redoWrapper.SetGroupId( drawingTool->GetLastPin() );
|
||||
redoCommand->PushItem( redoWrapper );
|
||||
redoCommand->SetDescription( description );
|
||||
PushCommandToRedoList( redoCommand );
|
||||
@@ -145,6 +158,7 @@ void SYMBOL_EDIT_FRAME::GetSymbolFromUndoList()
|
||||
// <previous symbol> is now put in redo list and is owned by this list.
|
||||
// Just set the current symbol to the symbol which come from the undo list
|
||||
m_symbol = symbol;
|
||||
drawingTool->SetLastPin( lastPin );
|
||||
|
||||
if( undoRedoType == UNDO_REDO::LIB_RENAME )
|
||||
{
|
||||
|
||||
@@ -480,7 +480,11 @@ bool SYMBOL_LIBRARY_MANAGER::UpdateSymbol( LIB_SYMBOL* aSymbol, const wxString&
|
||||
|
||||
wxCHECK( bufferedSymbol, false );
|
||||
|
||||
// If we are coming from a different library, the library ID needs to be preserved
|
||||
auto libId = bufferedSymbol->GetLibId();
|
||||
*bufferedSymbol = *aSymbol;
|
||||
bufferedSymbol->SetLibId( libId );
|
||||
|
||||
symbolBuf->GetScreen()->SetContentModified();
|
||||
}
|
||||
else // New symbol
|
||||
|
||||
@@ -185,13 +185,13 @@ void BACK_ANNOTATE::getPcbModulesFromString( const std::string& aPayload )
|
||||
continue;
|
||||
|
||||
// Fields are of the format "(field (name "name") "12345")
|
||||
const auto& fieldName = field.second.get_child_optional( "name" );
|
||||
const auto& fieldValue = field.second.back().first;
|
||||
const auto& fieldName = field.second.get_child_optional( "name" );
|
||||
const std::string& fieldValue = field.second.back().first;
|
||||
|
||||
if( !fieldName )
|
||||
continue;
|
||||
|
||||
fieldsMap[getStr( fieldName.get() )] = fieldValue;
|
||||
fieldsMap[getStr( fieldName.get() )] = wxString::FromUTF8( fieldValue );
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -662,29 +662,32 @@ int EE_SELECTION_TOOL::Main( const TOOL_EVENT& aEvent )
|
||||
static_cast<SCH_EDIT_FRAME*>( m_frame )->SetAltPinFunction( pin, alt );
|
||||
}
|
||||
else if( *evt->GetCommandId() >= ID_POPUP_SCH_PIN_TRICKS_START
|
||||
&& *evt->GetCommandId() <= ID_POPUP_SCH_PIN_TRICKS_END )
|
||||
&& *evt->GetCommandId() <= ID_POPUP_SCH_PIN_TRICKS_END
|
||||
&& !m_isSymbolEditor && !m_isSymbolViewer )
|
||||
{
|
||||
if( !m_selection.OnlyContains( { SCH_PIN_T, SCH_SHEET_PIN_T } )
|
||||
|| m_selection.Empty() )
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
SCH_EDIT_FRAME* sch_frame = static_cast<SCH_EDIT_FRAME*>( m_frame );
|
||||
|
||||
// Keep track of new items so we make them the new selection at the end
|
||||
EDA_ITEMS newItems;
|
||||
SCH_COMMIT commit( static_cast<SCH_EDIT_FRAME*>( m_frame ) );
|
||||
SCH_COMMIT commit( sch_frame );
|
||||
|
||||
if( *evt->GetCommandId() == ID_POPUP_SCH_PIN_TRICKS_NO_CONNECT )
|
||||
{
|
||||
for( EDA_ITEM* item : m_selection )
|
||||
{
|
||||
if( item->Type() != SCH_PIN_T && item->Type() != SCH_SHEET_PIN_T )
|
||||
continue;
|
||||
|
||||
SCH_NO_CONNECT* nc = new SCH_NO_CONNECT( item->GetPosition() );
|
||||
commit.Add( nc, m_frame->GetScreen() );
|
||||
commit.Add( nc, sch_frame->GetScreen() );
|
||||
newItems.push_back( nc );
|
||||
}
|
||||
|
||||
commit.Push( wxS( "No Connect Pins" ) );
|
||||
ClearSelection();
|
||||
if( !commit.Empty() )
|
||||
{
|
||||
commit.Push( wxS( "No Connect Pins" ) );
|
||||
ClearSelection();
|
||||
}
|
||||
}
|
||||
else if( *evt->GetCommandId() == ID_POPUP_SCH_PIN_TRICKS_WIRE )
|
||||
{
|
||||
@@ -692,6 +695,9 @@ int EE_SELECTION_TOOL::Main( const TOOL_EVENT& aEvent )
|
||||
|
||||
for( EDA_ITEM* item : m_selection )
|
||||
{
|
||||
if( item->Type() != SCH_PIN_T && item->Type() != SCH_SHEET_PIN_T )
|
||||
continue;
|
||||
|
||||
SCH_LINE* wire = new SCH_LINE( item->GetPosition(), LAYER_WIRE );
|
||||
|
||||
// Add some length to the wire as nothing in our code base handles
|
||||
@@ -716,29 +722,33 @@ int EE_SELECTION_TOOL::Main( const TOOL_EVENT& aEvent )
|
||||
|
||||
wire->SetEndPoint( item->GetPosition() + stub );
|
||||
|
||||
m_frame->AddToScreen( wire, m_frame->GetScreen() );
|
||||
commit.Added( wire, m_frame->GetScreen() );
|
||||
m_frame->AddToScreen( wire, sch_frame->GetScreen() );
|
||||
commit.Added( wire, sch_frame->GetScreen() );
|
||||
newItems.push_back( wire );
|
||||
}
|
||||
|
||||
ClearSelection();
|
||||
AddItemsToSel( &newItems );
|
||||
if( !commit.Empty() )
|
||||
{
|
||||
ClearSelection();
|
||||
AddItemsToSel( &newItems );
|
||||
|
||||
// Select only the ends so we can immediately start dragging them
|
||||
for( EDA_ITEM* item : newItems )
|
||||
static_cast<SCH_LINE*>( item )->SetFlags( ENDPOINT );
|
||||
// Select only the ends so we can immediately start dragging them
|
||||
for( EDA_ITEM* item : newItems )
|
||||
static_cast<SCH_LINE*>( item )->SetFlags( ENDPOINT );
|
||||
|
||||
// Put the mouse on the nearest point of the first wire
|
||||
SCH_LINE* first = static_cast<SCH_LINE*>( newItems[0] );
|
||||
getViewControls()->SetCrossHairCursorPosition( first->GetEndPoint(), false );
|
||||
getViewControls()->WarpMouseCursor( getViewControls()->GetCursorPosition(),
|
||||
true );
|
||||
KIGFX::VIEW_CONTROLS* vc = getViewControls();
|
||||
|
||||
// Start the drag tool, canceling will remove the wires
|
||||
if( m_toolMgr->RunSynchronousAction( EE_ACTIONS::drag, &commit, false ) )
|
||||
commit.Push( wxS( "Wire Pins" ) );
|
||||
else
|
||||
commit.Revert();
|
||||
// Put the mouse on the nearest point of the first wire
|
||||
SCH_LINE* first = static_cast<SCH_LINE*>( newItems[0] );
|
||||
vc->SetCrossHairCursorPosition( first->GetEndPoint(), false );
|
||||
vc->WarpMouseCursor( vc->GetCursorPosition(), true );
|
||||
|
||||
// Start the drag tool, canceling will remove the wires
|
||||
if( m_toolMgr->RunSynchronousAction( EE_ACTIONS::drag, &commit, false ) )
|
||||
commit.Push( wxS( "Wire Pins" ) );
|
||||
else
|
||||
commit.Revert();
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -748,15 +758,30 @@ int EE_SELECTION_TOOL::Main( const TOOL_EVENT& aEvent )
|
||||
{
|
||||
SCH_PIN* pin = dynamic_cast<SCH_PIN*>( item );
|
||||
SCH_SHEET_PIN* sheetPin = dynamic_cast<SCH_SHEET_PIN*>( item );
|
||||
SCH_EDIT_FRAME* sf = dynamic_cast<SCH_EDIT_FRAME*>( m_frame );
|
||||
SCH_LABEL_BASE* label = nullptr;
|
||||
SCH_SHEET_PATH& sheetPath = sch_frame->GetCurrentSheet();
|
||||
|
||||
wxString labelText;
|
||||
|
||||
if( pin )
|
||||
{
|
||||
labelText = pin->GetShownName();
|
||||
else if( sheetPin && sf )
|
||||
labelText = sheetPin->GetShownText( &sf->GetCurrentSheet(), false );
|
||||
|
||||
if( labelText.IsEmpty() )
|
||||
{
|
||||
labelText.Printf( "%s_%s",
|
||||
pin->GetParentSymbol()->GetRef( &sheetPath ),
|
||||
pin->GetNumber() );
|
||||
}
|
||||
}
|
||||
else if( sheetPin )
|
||||
{
|
||||
labelText = sheetPin->GetShownText( &sheetPath, false );
|
||||
}
|
||||
else
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
switch( *evt->GetCommandId() )
|
||||
{
|
||||
@@ -769,7 +794,8 @@ int EE_SELECTION_TOOL::Main( const TOOL_EVENT& aEvent )
|
||||
case ID_POPUP_SCH_PIN_TRICKS_GLOBAL_LABEL:
|
||||
label = new SCH_GLOBALLABEL( item->GetPosition(), labelText );
|
||||
break;
|
||||
default: continue;
|
||||
default:
|
||||
continue;
|
||||
}
|
||||
|
||||
switch( pinOrientation( item ) )
|
||||
@@ -827,16 +853,19 @@ int EE_SELECTION_TOOL::Main( const TOOL_EVENT& aEvent )
|
||||
label->SetShape( LABEL_FLAG_SHAPE::L_INPUT );
|
||||
}
|
||||
|
||||
commit.Add( label, m_frame->GetScreen() );
|
||||
commit.Add( label, sch_frame->GetScreen() );
|
||||
newItems.push_back( label );
|
||||
}
|
||||
|
||||
commit.Push( wxS( "Label Pins" ) );
|
||||
if( !commit.Empty() )
|
||||
{
|
||||
commit.Push( wxS( "Label Pins" ) );
|
||||
|
||||
// Many users will want to drag these items to wire off of the pins, so
|
||||
// pre-select them.
|
||||
ClearSelection();
|
||||
AddItemsToSel( &newItems );
|
||||
// Many users will want to drag these items to wire off of the pins, so
|
||||
// pre-select them.
|
||||
ClearSelection();
|
||||
AddItemsToSel( &newItems );
|
||||
}
|
||||
}
|
||||
}
|
||||
else if( *evt->GetCommandId() >= ID_POPUP_SCH_UNFOLD_BUS
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user