Compare commits
193 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 19d3e041be | |||
| 9228a6cd09 | |||
| 582377e86f | |||
| f359ca38d0 | |||
| 0108e8f56c | |||
| f823a43c1c | |||
| a31302da9f | |||
| f51657632b | |||
| 78fb820a26 | |||
| 47fc6dede2 | |||
| 9c9a1b7895 | |||
| 3cc86898b1 | |||
| 16b7b9af89 | |||
| aedcae8092 | |||
| b32fd3521f | |||
| b9b5c14867 | |||
| 82084218d9 | |||
| a4a7160b45 | |||
| a30b99b794 | |||
| 1f0c58a524 | |||
| 6e8de14766 | |||
| cce2bf9086 | |||
| 1371a58259 | |||
| ab12223247 | |||
| 6a2c35dc42 | |||
| ad6a4e5621 | |||
| 99fc22adb5 | |||
| dfaae5e3ca | |||
| dfa8f2e0ec | |||
| 2704c30404 | |||
| 8a1072ce75 | |||
| e5cb28c7fe | |||
| ed7f0d3234 | |||
| 7be1c84be2 | |||
| c37358fd33 | |||
| c71db323fb | |||
| b8d09c9b42 | |||
| 29fe6c1446 | |||
| 9b3ee263c3 | |||
| c54f57b8e5 | |||
| 603a500bc0 | |||
| 7e68c57747 | |||
| 644c4f8c0a | |||
| 5ae377f41a | |||
| 1d534303d4 | |||
| 5d2b515f7b | |||
| 2f37efbd0f | |||
| f492c0152d | |||
| 13373d2c9b | |||
| e3d5176cad | |||
| ef712b2f1c | |||
| f34889ab02 | |||
| 8707640a0b | |||
| 85d4ce89e8 | |||
| 95a80bf9f6 | |||
| 25999c6b6a | |||
| 4b286644f4 | |||
| 65ac097c32 | |||
| e6417afb0e | |||
| 69e15f2ff5 | |||
| de6238e892 | |||
| a69b7f8802 | |||
| aa43ac592c | |||
| 445a92a275 | |||
| 4bfb59bcea | |||
| 31f5645811 | |||
| 14ace594e7 | |||
| 8f6edd4f9e | |||
| 9e39b3bbec | |||
| b68b3cce17 | |||
| 6e7934dc3e | |||
| ef435b256f | |||
| 020021e7f2 | |||
| a678c9b03a | |||
| dc88df7919 | |||
| 6effb20e8c | |||
| 1edd151dbe | |||
| 7c13df5aa5 | |||
| 241f4cae2a | |||
| 92a1f0dc1d | |||
| ccf3b0af35 | |||
| e2e95854c2 | |||
| d5fdcdcd98 | |||
| 67a1c70172 | |||
| 9ff380a137 | |||
| 049c555e7e | |||
| dc50f50128 | |||
| 4bc5ceb109 | |||
| 893deff3b5 | |||
| 9d36205ced | |||
| b2427efd85 | |||
| 800187c956 | |||
| c4bc337201 | |||
| a20d76c7f1 | |||
| 19c91a1308 | |||
| 8c68239fb1 | |||
| 496b19d6fb | |||
| 751f83e02f | |||
| 427175c465 | |||
| c56ef6224e | |||
| eb0ea9abb8 | |||
| 6c6f8e3de6 | |||
| 6d2ac23375 | |||
| 1593a7082e | |||
| 483349bd11 | |||
| 7288d71405 | |||
| 0dbac41569 | |||
| d501e1e5f2 | |||
| 99a177e307 | |||
| c1fdd09eee | |||
| 8417ca7836 | |||
| b02e0f61f9 | |||
| 098b1ae7c7 | |||
| fbddae9c08 | |||
| f172de5070 | |||
| 846a346d21 | |||
| 4d60893204 | |||
| a611c72c27 | |||
| d38bda4d53 | |||
| 8a09e5f3c3 | |||
| 337f3da7c9 | |||
| cf71e5707e | |||
| bbd2d75a62 | |||
| 162c7f7d8c | |||
| 4ef09d3da4 | |||
| 962bad981c | |||
| 8d44b9cf05 | |||
| 60c3ac7919 | |||
| fec4674470 | |||
| d47e884eb3 | |||
| f920882a17 | |||
| 98a5c1935e | |||
| c0feb6347f | |||
| 77f6cd5a88 | |||
| ed5068829f | |||
| ffa3e98c1f | |||
| 23619629bd | |||
| 726b242214 | |||
| 1c76f4c559 | |||
| 94124538da | |||
| 1c88c70985 | |||
| eba5f70b59 | |||
| 8873845e67 | |||
| f00ffe24b0 | |||
| 4578316e6f | |||
| ad23a19391 | |||
| 76d8662891 | |||
| 765e7ac02f | |||
| edf16e6fc6 | |||
| f06380f05f | |||
| f899755035 | |||
| 724feccdb8 | |||
| 96378dd5bc | |||
| 3a1b14a456 | |||
| 86bc517006 | |||
| 1ce594d689 | |||
| 1e8088a8cd | |||
| ad41288ec0 | |||
| 66b392cdca | |||
| c2918098c2 | |||
| f92b601a45 | |||
| 3c206df680 | |||
| 439b2c928a | |||
| 7df7aaab3c | |||
| 18b0144354 | |||
| 21dd46d379 | |||
| a272de67d2 | |||
| 2e023fcc99 | |||
| 80d01a5ddc | |||
| bcedb4540b | |||
| 0ec3720ee5 | |||
| fb486ff6b4 | |||
| 71dba8a064 | |||
| 82faab25fa | |||
| eb5229b8f3 | |||
| fa8a9843b1 | |||
| a7d81c6aaa | |||
| 6eaa40c644 | |||
| 9e1ff91cf1 | |||
| a2d94dbacc | |||
| ea7cde81eb | |||
| 6bbbc07998 | |||
| b01ed7171c | |||
| 0d3208e656 | |||
| 12098f4a3c | |||
| 9ce74a8807 | |||
| e94ea208ab | |||
| c1630ee0f1 | |||
| 4ceccf4c47 | |||
| 7888eb768e | |||
| 6a359eb433 | |||
| 5552d63f70 | |||
| ff084370d6 |
@@ -229,7 +229,7 @@ void BOARD_ADAPTER::ReloadColorSettings() noexcept
|
||||
|
||||
try
|
||||
{
|
||||
cfg = Pgm().GetSettingsManager().GetAppSettings<PCBNEW_SETTINGS>();
|
||||
cfg = Pgm().GetSettingsManager().GetAppSettings<PCBNEW_SETTINGS>( "pcbnew" );
|
||||
}
|
||||
catch( const std::runtime_error& e )
|
||||
{
|
||||
|
||||
@@ -98,6 +98,7 @@ void BOARD_ADAPTER::addText( const EDA_TEXT* aText, CONTAINER_2D_BASE* aContaine
|
||||
TEXT_ATTRIBUTES attrs = aText->GetAttributes();
|
||||
float penWidth_3DU = TO_3DU( aText->GetEffectiveTextPenWidth() );
|
||||
KIFONT::FONT* font = aText->GetFont();
|
||||
wxString shownText = aText->GetShownText( true );
|
||||
|
||||
if( !font )
|
||||
font = KIFONT::FONT::GetFont( wxEmptyString, aText->IsBold(), aText->IsItalic() );
|
||||
@@ -132,8 +133,15 @@ void BOARD_ADAPTER::addText( const EDA_TEXT* aText, CONTAINER_2D_BASE* aContaine
|
||||
|
||||
attrs.m_Angle = aText->GetDrawRotation();
|
||||
|
||||
font->Draw( &callback_gal, aText->GetShownText( true ), aText->GetDrawPos(), attrs,
|
||||
aOwner->GetFontMetrics() );
|
||||
if( auto* cache = aText->GetRenderCache( font, shownText ) )
|
||||
{
|
||||
callback_gal.DrawGlyphs( *cache );
|
||||
}
|
||||
else
|
||||
{
|
||||
font->Draw( &callback_gal, shownText, aText->GetDrawPos(), attrs,
|
||||
aOwner->GetFontMetrics() );
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -216,6 +216,8 @@ public:
|
||||
*/
|
||||
void DoRePaint();
|
||||
|
||||
void OnCloseWindow( wxCloseEvent& event );
|
||||
|
||||
private:
|
||||
// The wxPaintEvent event. mainly calls DoRePaint()
|
||||
void OnPaint( wxPaintEvent& aEvent );
|
||||
@@ -226,14 +228,13 @@ private:
|
||||
|
||||
void OnMouseWheel( wxMouseEvent& event );
|
||||
|
||||
void OnMagnify( wxMouseEvent& event );
|
||||
void OnMagnify( wxMouseEvent& event );
|
||||
void OnMouseMove( wxMouseEvent& event );
|
||||
void OnLeftDown( wxMouseEvent& event );
|
||||
void OnLeftUp( wxMouseEvent& event );
|
||||
void OnMiddleUp( wxMouseEvent& event );
|
||||
void OnMiddleDown( wxMouseEvent& event );
|
||||
void OnTimerTimeout_Editing( wxTimerEvent& event );
|
||||
void OnCloseWindow( wxCloseEvent& event );
|
||||
void OnResize( wxSizeEvent& event );
|
||||
void OnTimerTimeout_Redraw( wxTimerEvent& event );
|
||||
|
||||
|
||||
@@ -1243,8 +1243,6 @@ void RENDER_3D_RAYTRACE::load3DModels( CONTAINER_3D& aDstContainer, bool aSkipMa
|
||||
fpMatrix, SFVEC3F( modelunit_to_3d_units_factor, modelunit_to_3d_units_factor,
|
||||
modelunit_to_3d_units_factor ) );
|
||||
|
||||
BOARD_ITEM* boardItem = dynamic_cast<BOARD_ITEM*>( fp );
|
||||
|
||||
// Get the list of model files for this model
|
||||
S3D_CACHE* cacheMgr = m_boardAdapter.Get3dCacheManager();
|
||||
auto sM = fp->Models().begin();
|
||||
@@ -1304,7 +1302,7 @@ void RENDER_3D_RAYTRACE::load3DModels( CONTAINER_3D& aDstContainer, bool aSkipMa
|
||||
SFVEC3F( sM->m_Scale.x, sM->m_Scale.y, sM->m_Scale.z ) );
|
||||
|
||||
addModels( aDstContainer, modelPtr, modelMatrix, (float) sM->m_Opacity,
|
||||
aSkipMaterialInformation, boardItem );
|
||||
aSkipMaterialInformation, fp );
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -113,7 +113,7 @@ EDA_3D_VIEWER_FRAME::EDA_3D_VIEWER_FRAME( KIWAY* aKiway, PCB_BASE_FRAME* aParent
|
||||
SetStatusWidths( arrayDim( status_dims ), status_dims );
|
||||
|
||||
SETTINGS_MANAGER& mgr = Pgm().GetSettingsManager();
|
||||
EDA_3D_VIEWER_SETTINGS* cfg = mgr.GetAppSettings<EDA_3D_VIEWER_SETTINGS>();
|
||||
EDA_3D_VIEWER_SETTINGS* cfg = mgr.GetAppSettings<EDA_3D_VIEWER_SETTINGS>( "3d_viewer" );
|
||||
ANTIALIASING_MODE aaMode = static_cast<ANTIALIASING_MODE>( cfg->m_Render.opengl_AA_mode );
|
||||
|
||||
m_canvas = new EDA_3D_CANVAS( this, OGL_ATT_LIST::GetAttributesList( aaMode ), m_boardAdapter,
|
||||
@@ -479,7 +479,7 @@ void EDA_3D_VIEWER_FRAME::Process_Special_Functions( wxCommandEvent &event )
|
||||
|
||||
case ID_MENU3D_RESET_DEFAULTS:
|
||||
{
|
||||
auto cfg = Pgm().GetSettingsManager().GetAppSettings<EDA_3D_VIEWER_SETTINGS>();
|
||||
auto cfg = Pgm().GetSettingsManager().GetAppSettings<EDA_3D_VIEWER_SETTINGS>( "3d_viewer" );
|
||||
cfg->ResetToDefaults();
|
||||
LoadSettings( cfg );
|
||||
|
||||
@@ -561,8 +561,8 @@ void EDA_3D_VIEWER_FRAME::LoadSettings( APP_SETTINGS_BASE *aCfg )
|
||||
{
|
||||
EDA_BASE_FRAME::LoadSettings( aCfg );
|
||||
|
||||
EDA_3D_VIEWER_SETTINGS* cfg = dynamic_cast<EDA_3D_VIEWER_SETTINGS*>( aCfg );
|
||||
wxASSERT( cfg );
|
||||
// Dynamic_cast here will fail on Mac when called from CvPCB.
|
||||
EDA_3D_VIEWER_SETTINGS* cfg = static_cast<EDA_3D_VIEWER_SETTINGS*>( aCfg );
|
||||
|
||||
wxLogTrace( m_logTrace, wxT( "EDA_3D_VIEWER_FRAME::LoadSettings" ) );
|
||||
|
||||
@@ -606,7 +606,7 @@ void EDA_3D_VIEWER_FRAME::LoadSettings( APP_SETTINGS_BASE *aCfg )
|
||||
|
||||
void EDA_3D_VIEWER_FRAME::SaveSettings( APP_SETTINGS_BASE *aCfg )
|
||||
{
|
||||
auto cfg = Pgm().GetSettingsManager().GetAppSettings<EDA_3D_VIEWER_SETTINGS>();
|
||||
auto cfg = Pgm().GetSettingsManager().GetAppSettings<EDA_3D_VIEWER_SETTINGS>( "3d_viewer" );
|
||||
|
||||
EDA_BASE_FRAME::SaveSettings( cfg );
|
||||
|
||||
@@ -642,7 +642,7 @@ void EDA_3D_VIEWER_FRAME::CommonSettingsChanged( bool aEnvVarsChanged, bool aTex
|
||||
ReCreateMainToolbar();
|
||||
|
||||
loadCommonSettings();
|
||||
applySettings( Pgm().GetSettingsManager().GetAppSettings<EDA_3D_VIEWER_SETTINGS>() );
|
||||
applySettings( Pgm().GetSettingsManager().GetAppSettings<EDA_3D_VIEWER_SETTINGS>( "3d_viewer" ) );
|
||||
|
||||
m_appearancePanel->CommonSettingsChanged();
|
||||
|
||||
@@ -673,7 +673,7 @@ void EDA_3D_VIEWER_FRAME::ShowChangedLanguage()
|
||||
void EDA_3D_VIEWER_FRAME::ToggleAppearanceManager()
|
||||
{
|
||||
SETTINGS_MANAGER& mgr = Pgm().GetSettingsManager();
|
||||
EDA_3D_VIEWER_SETTINGS* cfg = mgr.GetAppSettings<EDA_3D_VIEWER_SETTINGS>();
|
||||
EDA_3D_VIEWER_SETTINGS* cfg = mgr.GetAppSettings<EDA_3D_VIEWER_SETTINGS>( "3d_viewer" );
|
||||
wxAuiPaneInfo& layersManager = m_auimgr.GetPane( "LayersManager" );
|
||||
|
||||
// show auxiliary Vertical layers and visibility manager toolbar
|
||||
|
||||
@@ -221,7 +221,7 @@ void PANEL_PREVIEW_3D_MODEL::loadSettings()
|
||||
// TODO(JE) use all control options
|
||||
m_boardAdapter.m_MousewheelPanning = settings->m_Input.scroll_modifier_zoom != 0;
|
||||
|
||||
EDA_3D_VIEWER_SETTINGS* cfg = Pgm().GetSettingsManager().GetAppSettings<EDA_3D_VIEWER_SETTINGS>();
|
||||
auto* cfg = Pgm().GetSettingsManager().GetAppSettings<EDA_3D_VIEWER_SETTINGS>( "3d_viewer" );
|
||||
|
||||
if( cfg )
|
||||
{
|
||||
|
||||
@@ -37,7 +37,7 @@
|
||||
# KiCad.
|
||||
#
|
||||
# Note: This version string should follow the semantic versioning system
|
||||
set( KICAD_SEMANTIC_VERSION "8.0.7" )
|
||||
set( KICAD_SEMANTIC_VERSION "8.0.8" )
|
||||
|
||||
# Default the version to the semantic version.
|
||||
# This is overridden by the git repository tag though (if using git)
|
||||
|
||||
@@ -18,6 +18,7 @@
|
||||
* with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#include <boost/algorithm/string.hpp>
|
||||
#include <boost/locale.hpp>
|
||||
#include <fmt/core.h>
|
||||
#include <nanodbc/nanodbc.h>
|
||||
@@ -236,7 +237,7 @@ bool DATABASE_CONNECTION::CacheTableInfo( const std::string& aTable,
|
||||
{
|
||||
std::string columnKey = toUTF8( columns.column_name() );
|
||||
|
||||
if( aColumns.count( columnKey ) )
|
||||
if( aColumns.count( boost::to_lower_copy( columnKey ) ) )
|
||||
m_columnCache[key][columnKey] = columns.data_type();
|
||||
}
|
||||
|
||||
@@ -627,7 +628,13 @@ bool DATABASE_CONNECTION::selectAllAndCache( const std::string& aTable, const st
|
||||
}
|
||||
}
|
||||
|
||||
wxASSERT( result.count( aKey ) );
|
||||
if( !result.count( aKey ) )
|
||||
{
|
||||
wxLogTrace( traceDatabase,
|
||||
wxT( "selectAllAndCache: warning: key %s not found in result set" ), aKey );
|
||||
continue;
|
||||
}
|
||||
|
||||
std::string keyStr = std::any_cast<std::string>( result.at( aKey ) );
|
||||
cacheEntry[keyStr] = result;
|
||||
}
|
||||
|
||||
+17
-2
@@ -3,7 +3,7 @@
|
||||
*
|
||||
* Copyright (C) 2012 SoftPLC Corporation, Dick Hollenbeck <dick@softplc.com>
|
||||
* Copyright (C) 2023 CERN
|
||||
* Copyright (C) 2012-2023 KiCad Developers, see AUTHORS.txt for contributors.
|
||||
* Copyright (C) 2012-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
|
||||
@@ -465,6 +465,19 @@ void DIALOG_SHIM::OnModify()
|
||||
}
|
||||
|
||||
|
||||
int DIALOG_SHIM::ShowModal()
|
||||
{
|
||||
// Apple in its infinite wisdom will raise a disabled window before even passing
|
||||
// us the event, so we have no way to stop it. Instead, we must set an order on
|
||||
// the windows so that the modal will be pushed in front of the disabled
|
||||
// window when it is raised.
|
||||
KIPLATFORM::UI::ReparentModal( this );
|
||||
|
||||
// Call the base class ShowModal() method
|
||||
return wxDialog::ShowModal();
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
Quasi-Modal Mode Explained:
|
||||
|
||||
@@ -520,7 +533,7 @@ int DIALOG_SHIM::ShowQuasiModal()
|
||||
// us the event, so we have no way to stop it. Instead, we must set an order on
|
||||
// the windows so that the quasi-modal will be pushed in front of the disabled
|
||||
// window when it is raised.
|
||||
KIPLATFORM::UI::ReparentQuasiModal( this );
|
||||
KIPLATFORM::UI::ReparentModal( this );
|
||||
|
||||
Show( true );
|
||||
|
||||
@@ -557,6 +570,8 @@ void DIALOG_SHIM::EndQuasiModal( int retCode )
|
||||
return;
|
||||
}
|
||||
|
||||
TearDownQuasiModal();
|
||||
|
||||
if( m_qmodal_loop )
|
||||
{
|
||||
if( m_qmodal_loop->IsRunning() )
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
* This program source code file is part of KiCad, a free EDA CAD application.
|
||||
*
|
||||
* Copyright (C) 2020 Jon Evans <jon@craftyjon.com>
|
||||
* Copyright (C) 2020-2022 KiCad Developers, see AUTHORS.txt for contributors.
|
||||
* Copyright (C) 2020-2022, 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 as published by the
|
||||
@@ -39,7 +39,8 @@ DIALOG_MIGRATE_SETTINGS::DIALOG_MIGRATE_SETTINGS( SETTINGS_MANAGER* aManager ) :
|
||||
|
||||
SetupStandardButtons();
|
||||
|
||||
GetSizer()->SetSizeHints( this );
|
||||
Layout();
|
||||
m_sizer->Fit( this );
|
||||
Centre();
|
||||
}
|
||||
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
///////////////////////////////////////////////////////////////////////////
|
||||
// C++ code generated with wxFormBuilder (version 4.0.0-0-g0efcecf)
|
||||
// C++ code generated with wxFormBuilder (version 4.2.1-0-g80c4cb6)
|
||||
// http://www.wxformbuilder.org/
|
||||
//
|
||||
// PLEASE DO *NOT* EDIT THIS FILE!
|
||||
|
||||
@@ -1,34 +1,36 @@
|
||||
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
|
||||
<wxFormBuilder_Project>
|
||||
<FileVersion major="1" minor="17"/>
|
||||
<FileVersion major="1" minor="18"/>
|
||||
<object class="Project" expanded="true">
|
||||
<property name="class_decoration">; </property>
|
||||
<property name="code_generation">C++</property>
|
||||
<property name="disconnect_events">1</property>
|
||||
<property name="disconnect_mode">source_name</property>
|
||||
<property name="disconnect_php_events">0</property>
|
||||
<property name="disconnect_python_events">0</property>
|
||||
<property name="cpp_class_decoration">; </property>
|
||||
<property name="cpp_disconnect_events">1</property>
|
||||
<property name="cpp_event_generation">connect</property>
|
||||
<property name="cpp_help_provider">none</property>
|
||||
<property name="cpp_namespace"></property>
|
||||
<property name="cpp_precompiled_header"></property>
|
||||
<property name="cpp_use_array_enum">0</property>
|
||||
<property name="cpp_use_enum">0</property>
|
||||
<property name="embedded_files_path">res</property>
|
||||
<property name="encoding">UTF-8</property>
|
||||
<property name="event_generation">connect</property>
|
||||
<property name="file">dialog_migrate_settings_base</property>
|
||||
<property name="first_id">1000</property>
|
||||
<property name="help_provider">none</property>
|
||||
<property name="image_path_wrapper_function_name"></property>
|
||||
<property name="indent_with_spaces"></property>
|
||||
<property name="internationalize">1</property>
|
||||
<property name="lua_skip_events">1</property>
|
||||
<property name="lua_ui_table">UI</property>
|
||||
<property name="name">DIALOG_MIGRATE_SETTINGS</property>
|
||||
<property name="namespace"></property>
|
||||
<property name="path">.</property>
|
||||
<property name="precompiled_header"></property>
|
||||
<property name="php_disconnect_events">0</property>
|
||||
<property name="php_disconnect_mode">source_name</property>
|
||||
<property name="php_skip_events">1</property>
|
||||
<property name="python_disconnect_events">0</property>
|
||||
<property name="python_disconnect_mode">source_name</property>
|
||||
<property name="python_image_path_wrapper_function_name"></property>
|
||||
<property name="python_indent_with_spaces"></property>
|
||||
<property name="python_skip_events">1</property>
|
||||
<property name="relative_path">1</property>
|
||||
<property name="skip_lua_events">1</property>
|
||||
<property name="skip_php_events">1</property>
|
||||
<property name="skip_python_events">1</property>
|
||||
<property name="ui_table">UI</property>
|
||||
<property name="use_array_enum">0</property>
|
||||
<property name="use_enum">0</property>
|
||||
<property name="use_microsoft_bom">0</property>
|
||||
<property name="use_native_eol">0</property>
|
||||
<object class="Dialog" expanded="true">
|
||||
<property name="aui_managed">0</property>
|
||||
<property name="aui_manager_style">wxAUI_MGR_DEFAULT</property>
|
||||
@@ -49,7 +51,7 @@
|
||||
<property name="name">DIALOG_MIGRATE_SETTINGS_BASE</property>
|
||||
<property name="pos"></property>
|
||||
<property name="size"></property>
|
||||
<property name="style">wxCAPTION</property>
|
||||
<property name="style">wxCAPTION|wxRESIZE_BORDER</property>
|
||||
<property name="subclass">DIALOG_SHIM; dialog_shim.h; forward_declare</property>
|
||||
<property name="title">Configure KiCad Settings Path</property>
|
||||
<property name="tooltip"></property>
|
||||
@@ -80,10 +82,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>
|
||||
@@ -152,10 +154,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>
|
||||
@@ -214,10 +216,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>
|
||||
@@ -299,10 +301,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>
|
||||
@@ -368,10 +370,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>
|
||||
@@ -445,10 +447,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>
|
||||
@@ -507,10 +509,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>
|
||||
@@ -572,10 +574,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>
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
///////////////////////////////////////////////////////////////////////////
|
||||
// C++ code generated with wxFormBuilder (version 4.0.0-0-g0efcecf)
|
||||
// C++ code generated with wxFormBuilder (version 4.2.1-0-g80c4cb6)
|
||||
// http://www.wxformbuilder.org/
|
||||
//
|
||||
// PLEASE DO *NOT* EDIT THIS FILE!
|
||||
@@ -32,7 +32,6 @@ class STD_BITMAP_BUTTON;
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////
|
||||
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
/// Class DIALOG_MIGRATE_SETTINGS_BASE
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
@@ -64,7 +63,7 @@ class DIALOG_MIGRATE_SETTINGS_BASE : public DIALOG_SHIM
|
||||
|
||||
public:
|
||||
|
||||
DIALOG_MIGRATE_SETTINGS_BASE( wxWindow* parent, wxWindowID id = wxID_ANY, const wxString& title = _("Configure KiCad Settings Path"), const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxDefaultSize, long style = wxCAPTION );
|
||||
DIALOG_MIGRATE_SETTINGS_BASE( wxWindow* parent, wxWindowID id = wxID_ANY, const wxString& title = _("Configure KiCad Settings Path"), const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxDefaultSize, long style = wxCAPTION|wxRESIZE_BORDER );
|
||||
|
||||
~DIALOG_MIGRATE_SETTINGS_BASE();
|
||||
|
||||
|
||||
+5
-2
@@ -34,7 +34,8 @@
|
||||
#include <wx/fdrepdlg.h>
|
||||
#include <eda_pattern_match.h>
|
||||
|
||||
EDA_ITEM::EDA_ITEM( EDA_ITEM* parent, KICAD_T idType ) :
|
||||
EDA_ITEM::EDA_ITEM( EDA_ITEM* parent, KICAD_T idType, bool isSCH_ITEM, bool isBOARD_ITEM ) :
|
||||
KIGFX::VIEW_ITEM( isSCH_ITEM, isBOARD_ITEM ),
|
||||
m_parent( parent ),
|
||||
m_forceVisible( false ),
|
||||
m_flags( 0 ),
|
||||
@@ -42,7 +43,8 @@ EDA_ITEM::EDA_ITEM( EDA_ITEM* parent, KICAD_T idType ) :
|
||||
{ }
|
||||
|
||||
|
||||
EDA_ITEM::EDA_ITEM( KICAD_T idType ) :
|
||||
EDA_ITEM::EDA_ITEM( KICAD_T idType, bool isSCH_ITEM, bool isBOARD_ITEM ) :
|
||||
KIGFX::VIEW_ITEM( isSCH_ITEM, isBOARD_ITEM ),
|
||||
m_parent( nullptr ),
|
||||
m_forceVisible( false ),
|
||||
m_flags( 0 ),
|
||||
@@ -51,6 +53,7 @@ EDA_ITEM::EDA_ITEM( KICAD_T idType ) :
|
||||
|
||||
|
||||
EDA_ITEM::EDA_ITEM( const EDA_ITEM& base ) :
|
||||
KIGFX::VIEW_ITEM( base.IsSCH_ITEM(), base.IsBOARD_ITEM() ),
|
||||
m_Uuid( base.m_Uuid ),
|
||||
m_parent( base.m_parent ),
|
||||
m_forceVisible( base.m_forceVisible ),
|
||||
|
||||
@@ -476,6 +476,12 @@ int EDA_COMBINED_MATCHER::ScoreTerms( std::vector<SEARCH_TERM>& aWeightedTerms )
|
||||
if( !term.Normalized )
|
||||
{
|
||||
term.Text = term.Text.MakeLower().Trim( false ).Trim( true );
|
||||
|
||||
// Don't cause KiCad to hang if someone accidentally pastes the PCB or schematic
|
||||
// into the search box.
|
||||
if( term.Text.Length() > 5000 )
|
||||
term.Text = term.Text.Left( 5000 );
|
||||
|
||||
term.Normalized = true;
|
||||
}
|
||||
|
||||
|
||||
@@ -182,6 +182,32 @@ void EDA_SHAPE::SetLength( const double& aLength )
|
||||
}
|
||||
}
|
||||
|
||||
void EDA_SHAPE::SetRectangleHeight( const int& aHeight )
|
||||
{
|
||||
switch ( m_shape )
|
||||
{
|
||||
case SHAPE_T::RECTANGLE:
|
||||
m_rectangleHeight = aHeight;
|
||||
SetEndY( GetStartY() + m_rectangleHeight );
|
||||
break;
|
||||
|
||||
default: UNIMPLEMENTED_FOR( SHAPE_T_asString() );
|
||||
}
|
||||
}
|
||||
|
||||
void EDA_SHAPE::SetRectangleWidth( const int& aWidth )
|
||||
{
|
||||
switch ( m_shape )
|
||||
{
|
||||
case SHAPE_T::RECTANGLE:
|
||||
m_rectangleWidth = aWidth;
|
||||
SetEndX( GetStartX() + m_rectangleWidth );
|
||||
break;
|
||||
|
||||
default: UNIMPLEMENTED_FOR( SHAPE_T_asString() );
|
||||
}
|
||||
}
|
||||
|
||||
void EDA_SHAPE::SetRectangle( const long long int& aHeight, const long long int& aWidth )
|
||||
{
|
||||
switch ( m_shape )
|
||||
@@ -1971,6 +1997,15 @@ static struct EDA_SHAPE_DESC
|
||||
return false;
|
||||
};
|
||||
|
||||
auto isRectangle = []( INSPECTABLE* aItem ) -> bool
|
||||
{
|
||||
// Polygons, unlike other shapes, have no meaningful start or end coordinates
|
||||
if( EDA_SHAPE* shape = dynamic_cast<EDA_SHAPE*>( aItem ) )
|
||||
return shape->GetShape() == SHAPE_T::RECTANGLE;
|
||||
|
||||
return false;
|
||||
};
|
||||
|
||||
const wxString shapeProps = _HKI( "Shape Properties" );
|
||||
|
||||
auto shape = new PROPERTY_ENUM<EDA_SHAPE, SHAPE_T>( _HKI( "Shape" ),
|
||||
@@ -2018,6 +2053,18 @@ static struct EDA_SHAPE_DESC
|
||||
shapeProps )
|
||||
.SetAvailableFunc( isNotPolygonOrCircle );
|
||||
|
||||
propMgr.AddProperty( new PROPERTY<EDA_SHAPE, int>( _HKI( "Width" ),
|
||||
&EDA_SHAPE::SetRectangleWidth, &EDA_SHAPE::GetRectangleWidth, PROPERTY_DISPLAY::PT_COORD,
|
||||
ORIGIN_TRANSFORMS::ABS_Y_COORD ),
|
||||
shapeProps )
|
||||
.SetAvailableFunc( isRectangle );
|
||||
|
||||
propMgr.AddProperty( new PROPERTY<EDA_SHAPE, int>( _HKI( "Height" ),
|
||||
&EDA_SHAPE::SetRectangleHeight, &EDA_SHAPE::GetRectangleHeight, PROPERTY_DISPLAY::PT_COORD,
|
||||
ORIGIN_TRANSFORMS::ABS_Y_COORD ),
|
||||
shapeProps )
|
||||
.SetAvailableFunc( isRectangle );
|
||||
|
||||
propMgr.AddProperty( new PROPERTY<EDA_SHAPE, int>( _HKI( "Line Width" ),
|
||||
&EDA_SHAPE::SetWidth, &EDA_SHAPE::GetWidth, PROPERTY_DISPLAY::PT_SIZE ),
|
||||
shapeProps );
|
||||
|
||||
@@ -275,25 +275,6 @@ bool OpenPDF( const wxString& file )
|
||||
}
|
||||
|
||||
|
||||
void OpenFile( const wxString& file )
|
||||
{
|
||||
wxFileName fileName( file );
|
||||
wxFileType* filetype = wxTheMimeTypesManager->GetFileTypeFromExtension( fileName.GetExt() );
|
||||
|
||||
if( !filetype )
|
||||
return;
|
||||
|
||||
wxString command;
|
||||
wxFileType::MessageParameters params( file );
|
||||
|
||||
filetype->GetOpenCommand( &command, params );
|
||||
delete filetype;
|
||||
|
||||
if( !command.IsEmpty() )
|
||||
wxExecute( command );
|
||||
}
|
||||
|
||||
|
||||
void KiCopyFile( const wxString& aSrcPath, const wxString& aDestPath, wxString& aErrors )
|
||||
{
|
||||
if( !wxCopyFile( aSrcPath, aDestPath ) )
|
||||
|
||||
@@ -117,7 +117,8 @@ std::map<wxString, wxString> ALTIUM_ASCII_PARSER::ReadProperties()
|
||||
if( canonicalKey == wxT( "DESIGNATOR" ) || canonicalKey == wxT( "NAME" )
|
||||
|| canonicalKey == wxT( "TEXT" ) )
|
||||
{
|
||||
value = AltiumPropertyToKiCadString( value );
|
||||
if( kv[ wxT( "RECORD" ) ] != wxT( "4" ) )
|
||||
value = AltiumPropertyToKiCadString( value );
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -493,7 +493,8 @@ std::map<wxString, wxString> ALTIUM_BINARY_PARSER::ReadProperties(
|
||||
|| canonicalKey == wxT( "NAME" )
|
||||
|| canonicalKey == wxT( "TEXT" ) )
|
||||
{
|
||||
value = AltiumPropertyToKiCadString( value.Trim() );
|
||||
if( kv[ wxT( "RECORD" ) ] != wxT( "4" ) )
|
||||
value = AltiumPropertyToKiCadString( value.Trim() );
|
||||
}
|
||||
|
||||
kv.insert( { canonicalKey, value.Trim() } );
|
||||
|
||||
@@ -45,40 +45,52 @@ LIB_ID AltiumToKiCadLibID( const wxString& aLibName, const wxString& aLibReferen
|
||||
|
||||
wxString AltiumPropertyToKiCadString( const wxString& aString )
|
||||
{
|
||||
wxString converted;
|
||||
bool inOverbar = false;
|
||||
wxString output;
|
||||
wxString tempString;
|
||||
bool hasPrev = false;
|
||||
wxUniChar prev;
|
||||
|
||||
for( wxString::const_iterator chIt = aString.begin(); chIt != aString.end(); ++chIt )
|
||||
for( wxString::const_iterator it = aString.begin(); it != aString.end(); ++it )
|
||||
{
|
||||
wxString::const_iterator lookahead = chIt + 1;
|
||||
char ch = 0;
|
||||
|
||||
if( lookahead != aString.end() && *lookahead == '\\' )
|
||||
if( (*it).GetAsChar( &ch ) )
|
||||
{
|
||||
if( !inOverbar )
|
||||
if( ch == '\\' )
|
||||
{
|
||||
converted += "~{";
|
||||
inOverbar = true;
|
||||
if( hasPrev )
|
||||
{
|
||||
tempString += prev;
|
||||
hasPrev = false;
|
||||
}
|
||||
|
||||
continue; // Backslash is ignored and not added to the output
|
||||
}
|
||||
}
|
||||
|
||||
if( hasPrev ) // Two letters in a row with no backslash
|
||||
{
|
||||
if( !tempString.empty() )
|
||||
{
|
||||
output += "~{" + tempString + "}";
|
||||
tempString.Clear();
|
||||
}
|
||||
|
||||
converted += *chIt;
|
||||
chIt = lookahead;
|
||||
output += prev;
|
||||
}
|
||||
else
|
||||
{
|
||||
if( inOverbar )
|
||||
{
|
||||
converted += "}";
|
||||
inOverbar = false;
|
||||
}
|
||||
|
||||
converted += *chIt;
|
||||
}
|
||||
prev = *it;
|
||||
hasPrev = true;
|
||||
}
|
||||
|
||||
if( inOverbar )
|
||||
converted += "}";
|
||||
// Append any leftover escaped string
|
||||
if( !tempString.IsEmpty() )
|
||||
output += "~{" + tempString + "}";
|
||||
|
||||
return converted;
|
||||
if( hasPrev )
|
||||
output += prev;
|
||||
|
||||
return output;
|
||||
}
|
||||
|
||||
|
||||
@@ -148,9 +160,7 @@ wxString AltiumPcbSpecialStringsToKiCadStrings( const wxString&
|
||||
const std::map<wxString, wxString>& aOverrides )
|
||||
{
|
||||
if( aString.IsEmpty() )
|
||||
{
|
||||
return aString;
|
||||
}
|
||||
|
||||
// special case: string starts with dot -> whole string is special string
|
||||
if( aString.at( 0 ) == '.' )
|
||||
@@ -174,57 +184,15 @@ wxString AltiumPcbSpecialStringsToKiCadStrings( const wxString&
|
||||
|
||||
wxString AltiumPinNamesToKiCad( wxString& aString )
|
||||
{
|
||||
wxString output;
|
||||
wxString tempString;
|
||||
bool hasPrev = false;
|
||||
wxUniChar prev;
|
||||
if( aString.IsEmpty() )
|
||||
return wxEmptyString;
|
||||
|
||||
wxString rest;
|
||||
|
||||
for( wxString::const_iterator it = aString.begin(); it != aString.end(); ++it )
|
||||
{
|
||||
char ch = 0;
|
||||
if( aString.StartsWith( '\\', &rest ) && !rest.Contains( '\\' ) )
|
||||
return "~{" + rest + "}";
|
||||
|
||||
if( (*it).GetAsChar( &ch ) )
|
||||
{
|
||||
if( ch == '\\' )
|
||||
{
|
||||
if( hasPrev )
|
||||
{
|
||||
tempString += prev;
|
||||
hasPrev = false;
|
||||
}
|
||||
|
||||
continue; // Backslash is ignored and not added to the output
|
||||
}
|
||||
}
|
||||
|
||||
if( hasPrev ) // Two letters in a row with no backslash
|
||||
{
|
||||
if( !tempString.empty() )
|
||||
{
|
||||
output += "~{" + tempString + "}";
|
||||
tempString.Clear();
|
||||
}
|
||||
|
||||
output += prev;
|
||||
}
|
||||
|
||||
prev = *it;
|
||||
hasPrev = true;
|
||||
}
|
||||
|
||||
// Append any leftover escaped string
|
||||
if( !tempString.IsEmpty() )
|
||||
{
|
||||
output += "~{" + tempString + "}";
|
||||
}
|
||||
|
||||
if( hasPrev )
|
||||
{
|
||||
output += prev;
|
||||
}
|
||||
|
||||
return output;
|
||||
return AltiumPropertyToKiCadString( aString );
|
||||
}
|
||||
|
||||
VECTOR2I AltiumGetEllipticalPos( double aMajor, double aMinor, double aAngleRadians )
|
||||
|
||||
@@ -815,11 +815,11 @@ EPAD::EPAD( wxXmlNode* aPad )
|
||||
>
|
||||
*/
|
||||
|
||||
// #REQUIRED says DTD, throw exception if not found
|
||||
drill = parseRequiredAttribute<ECOORD>( aPad, "drill" );
|
||||
// #REQUIRED says DTD, but DipTrace doesn't write it sometimes
|
||||
drill = parseOptionalAttribute<ECOORD>( aPad, "drill" );
|
||||
|
||||
// Optional attributes
|
||||
diameter = parseOptionalAttribute<ECOORD>( aPad, "diameter" );
|
||||
diameter = parseOptionalAttribute<ECOORD>( aPad, "diameter" );
|
||||
|
||||
opt_wxString s = parseOptionalAttribute<wxString>( aPad, "shape" );
|
||||
|
||||
|
||||
@@ -711,7 +711,7 @@ struct EPAD_COMMON
|
||||
/// Eagle thru hole pad
|
||||
struct EPAD : public EPAD_COMMON
|
||||
{
|
||||
ECOORD drill;
|
||||
opt_ecoord drill;
|
||||
opt_ecoord diameter;
|
||||
|
||||
// for shape: (square | round | octagon | long | offset)
|
||||
|
||||
+11
-3
@@ -37,6 +37,8 @@
|
||||
|
||||
#include <cctype>
|
||||
#include <mutex>
|
||||
#include <utility>
|
||||
#include <stdlib.h>
|
||||
|
||||
#include <wx/log.h>
|
||||
|
||||
@@ -113,7 +115,7 @@ KIID::KIID( const std::string& aString ) :
|
||||
m_uuid(),
|
||||
m_cached_timestamp( 0 )
|
||||
{
|
||||
if( aString.length() == 8
|
||||
if( !aString.empty() && aString.length() <= 8
|
||||
&& std::all_of( aString.begin(), aString.end(),
|
||||
[]( unsigned char c )
|
||||
{
|
||||
@@ -123,9 +125,15 @@ KIID::KIID( const std::string& aString ) :
|
||||
// A legacy-timestamp-based UUID has only the last 4 octets filled in.
|
||||
// Convert them individually to avoid stepping in the little-endian/big-endian
|
||||
// doo-doo.
|
||||
for( int i = 0; i < 4; ++i )
|
||||
for( int i = 0; i < 4; i++ )
|
||||
{
|
||||
std::string octet = aString.substr( i * 2, 2 );
|
||||
int start = static_cast<int>( aString.length() ) - 8 + i * 2;
|
||||
int end = start + 2;
|
||||
|
||||
start = std::max( 0, start );
|
||||
int len = std::max( 0, end - start );
|
||||
|
||||
std::string octet = aString.substr( start, len );
|
||||
m_uuid.data[i + 12] = strtol( octet.data(), nullptr, 16 );
|
||||
}
|
||||
|
||||
|
||||
@@ -33,6 +33,7 @@
|
||||
#include <lib_table_lexer.h>
|
||||
#include <macros.h>
|
||||
#include <string_utils.h>
|
||||
#include <build_version.h>
|
||||
|
||||
#define OPT_SEP '|' ///< options separator character
|
||||
|
||||
@@ -434,9 +435,17 @@ bool LIB_TABLE::migrate()
|
||||
wxString uri = row.GetFullURI( true );
|
||||
|
||||
// If the uri still has a variable in it, that means that the user does not have
|
||||
// these vars defined. We update the old vars to the KICAD7 versions on load
|
||||
row_updated |= ( uri.Replace( wxS( "${KICAD5_" ), wxS( "${KICAD7_" ), false ) > 0 );
|
||||
row_updated |= ( uri.Replace( wxS( "${KICAD6_" ), wxS( "${KICAD7_" ), false ) > 0 );
|
||||
// these vars defined. We update the old vars to the current versions on load
|
||||
|
||||
static wxString fmtStr = wxS( "${KICAD%d_" );
|
||||
int version = 0;
|
||||
std::tie(version, std::ignore, std::ignore) = GetMajorMinorPatchTuple();
|
||||
|
||||
for( int ii = 5; ii < version - 1; ++ii )
|
||||
{
|
||||
row_updated |= ( uri.Replace( wxString::Format( fmtStr, ii ),
|
||||
wxString::Format( fmtStr, version ), false ) > 0 );
|
||||
}
|
||||
|
||||
if( row_updated )
|
||||
{
|
||||
|
||||
@@ -107,6 +107,17 @@ bool MARKER_BASE::HitTestMarker( const VECTOR2I& aHitPosition, int aAccuracy ) c
|
||||
}
|
||||
|
||||
|
||||
bool MARKER_BASE::HitTestMarker( const BOX2I& aRect, bool aContained, int aAccuracy ) const
|
||||
{
|
||||
const BOX2I bbox = GetBoundingBoxMarker().Inflate( aAccuracy );
|
||||
|
||||
if( aContained )
|
||||
return aRect.Contains( bbox );
|
||||
|
||||
return aRect.Intersects( bbox );
|
||||
}
|
||||
|
||||
|
||||
void MARKER_BASE::ShapeToPolygon( SHAPE_LINE_CHAIN& aPolygon, int aScale ) const
|
||||
{
|
||||
if( aScale < 0 )
|
||||
|
||||
@@ -174,12 +174,12 @@ bool PROJECT_ARCHIVER::Archive( const wxString& aSrcDir, const wxString& aDestFi
|
||||
wxArrayString files;
|
||||
|
||||
for( unsigned ii = 0; ii < arrayDim( extensionList ); ii++ )
|
||||
wxDir::GetAllFiles( aSrcDir, &files, extensionList[ii] );
|
||||
wxDir::GetAllFiles( aSrcDir, &files, extensionList[ii], wxDIR_FILES | wxDIR_DIRS );
|
||||
|
||||
if( aIncludeExtraFiles )
|
||||
{
|
||||
for( unsigned ii = 0; ii < arrayDim( extraExtensionList ); ii++ )
|
||||
wxDir::GetAllFiles( aSrcDir, &files, extraExtensionList[ii] );
|
||||
wxDir::GetAllFiles( aSrcDir, &files, extraExtensionList[ii], wxDIR_FILES | wxDIR_DIRS );
|
||||
}
|
||||
|
||||
for( unsigned ii = 0; ii < files.GetCount(); ++ii )
|
||||
|
||||
@@ -46,6 +46,7 @@
|
||||
#include <settings/json_settings_internals.h>
|
||||
#include <settings/settings_manager.h>
|
||||
#include <wildcards_and_files_ext.h>
|
||||
#include <env_vars.h>
|
||||
|
||||
|
||||
SETTINGS_MANAGER::SETTINGS_MANAGER( bool aHeadless ) :
|
||||
@@ -343,7 +344,7 @@ void SETTINGS_MANAGER::loadAllColorSettings()
|
||||
|
||||
wxFileName third_party_path;
|
||||
const ENV_VAR_MAP& env = Pgm().GetLocalEnvVariables();
|
||||
auto it = env.find( wxS( "KICAD7_3RD_PARTY" ) );
|
||||
auto it = env.find( ENV_VAR::GetVersionedEnvVarName( wxS( "3RD_PARTY" ) ) );
|
||||
|
||||
if( it != env.end() && !it->second.GetValue().IsEmpty() )
|
||||
third_party_path.SetPath( it->second.GetValue() );
|
||||
|
||||
@@ -694,6 +694,8 @@ void VIEW::ReorderLayerData( std::unordered_map<int, int> aReorderMap )
|
||||
// Transfer reordered data (using the copy assignment operator ):
|
||||
m_layers = new_map;
|
||||
|
||||
sortLayers();
|
||||
|
||||
for( VIEW_ITEM* item : *m_allItems )
|
||||
{
|
||||
VIEW_ITEM_DATA* viewData = item->viewPrivData();
|
||||
|
||||
@@ -36,9 +36,6 @@ FOOTPRINT_PREVIEW_WIDGET::FOOTPRINT_PREVIEW_WIDGET( wxWindow* aParent, KIWAY& aK
|
||||
{
|
||||
m_prev_panel = FOOTPRINT_PREVIEW_PANEL_BASE::Create( this, aKiway );
|
||||
|
||||
if( !m_prev_panel )
|
||||
return;
|
||||
|
||||
m_statusPanel = new wxPanel( this );
|
||||
m_status = new wxStaticText( m_statusPanel, wxID_ANY, wxEmptyString );
|
||||
m_statusSizer = new wxBoxSizer( wxVERTICAL );
|
||||
@@ -47,19 +44,25 @@ FOOTPRINT_PREVIEW_WIDGET::FOOTPRINT_PREVIEW_WIDGET( wxWindow* aParent, KIWAY& aK
|
||||
m_statusSizer->Add( 0, 0, 1 ); // add a spacer
|
||||
m_statusPanel->SetSizer( m_statusSizer );
|
||||
|
||||
// Give the status panel the same color scheme as the canvas so it isn't jarring when
|
||||
// switched to
|
||||
m_statusPanel->SetBackgroundColour( m_prev_panel->GetBackgroundColor().ToColour() );
|
||||
m_statusPanel->SetForegroundColour( m_prev_panel->GetForegroundColor().ToColour() );
|
||||
m_status->SetForegroundColour( m_prev_panel->GetForegroundColor().ToColour() );
|
||||
if( m_prev_panel )
|
||||
{
|
||||
// Give the status panel the same color scheme as the canvas so it isn't jarring when
|
||||
// switched to
|
||||
m_statusPanel->SetBackgroundColour( m_prev_panel->GetBackgroundColor().ToColour() );
|
||||
m_statusPanel->SetForegroundColour( m_prev_panel->GetForegroundColor().ToColour() );
|
||||
m_status->SetForegroundColour( m_prev_panel->GetForegroundColor().ToColour() );
|
||||
|
||||
// Set our background so wx doesn't render a normal control background momentarily when
|
||||
// rapidly navigating with arrow keys
|
||||
SetBackgroundColour( m_prev_panel->GetBackgroundColor().ToColour() );
|
||||
SetForegroundColour( m_prev_panel->GetForegroundColor().ToColour() );
|
||||
// Set our background so wx doesn't render a normal control background momentarily when
|
||||
// rapidly navigating with arrow keys
|
||||
SetBackgroundColour( m_prev_panel->GetBackgroundColor().ToColour() );
|
||||
SetForegroundColour( m_prev_panel->GetForegroundColor().ToColour() );
|
||||
}
|
||||
|
||||
m_outerSizer = new wxBoxSizer( wxVERTICAL );
|
||||
m_outerSizer->Add( m_prev_panel->GetWindow(), 1, wxALL | wxEXPAND, 0 );
|
||||
|
||||
if( m_prev_panel )
|
||||
m_outerSizer->Add( m_prev_panel->GetWindow(), 1, wxALL | wxEXPAND, 0 );
|
||||
|
||||
m_outerSizer->Add( m_statusPanel, 1, wxALL | wxEXPAND, 0 );
|
||||
|
||||
SetSizer( m_outerSizer );
|
||||
@@ -72,7 +75,10 @@ void FOOTPRINT_PREVIEW_WIDGET::SetStatusText( wxString const& aText )
|
||||
{
|
||||
m_status->SetLabel( aText );
|
||||
m_statusPanel->Show();
|
||||
m_prev_panel->GetWindow()->Hide();
|
||||
|
||||
if( m_prev_panel )
|
||||
m_prev_panel->GetWindow()->Hide();
|
||||
|
||||
Layout();
|
||||
}
|
||||
|
||||
@@ -81,20 +87,25 @@ void FOOTPRINT_PREVIEW_WIDGET::ClearStatus()
|
||||
{
|
||||
m_status->SetLabel( wxEmptyString );
|
||||
m_statusPanel->Hide();
|
||||
m_prev_panel->GetWindow()->Show();
|
||||
|
||||
if( m_prev_panel )
|
||||
m_prev_panel->GetWindow()->Show();
|
||||
|
||||
Layout();
|
||||
}
|
||||
|
||||
|
||||
void FOOTPRINT_PREVIEW_WIDGET::SetUserUnits( EDA_UNITS aUnits )
|
||||
{
|
||||
m_prev_panel->SetUserUnits( aUnits );
|
||||
if( m_prev_panel )
|
||||
m_prev_panel->SetUserUnits( aUnits );
|
||||
}
|
||||
|
||||
|
||||
void FOOTPRINT_PREVIEW_WIDGET::SetPinFunctions( const std::map<wxString, wxString>& aPinFunctions )
|
||||
{
|
||||
m_prev_panel->SetPinFunctions( aPinFunctions );
|
||||
if( m_prev_panel )
|
||||
m_prev_panel->SetPinFunctions( aPinFunctions );
|
||||
}
|
||||
|
||||
|
||||
@@ -122,34 +133,32 @@ void FOOTPRINT_PREVIEW_WIDGET::DisplayFootprints( std::shared_ptr<FOOTPRINT> aFo
|
||||
std::shared_ptr<FOOTPRINT> aFootprintB )
|
||||
{
|
||||
ClearStatus();
|
||||
m_prev_panel->DisplayFootprints( aFootprintA, aFootprintB );
|
||||
|
||||
if( m_prev_panel )
|
||||
m_prev_panel->DisplayFootprints( aFootprintA, aFootprintB );
|
||||
}
|
||||
|
||||
|
||||
void FOOTPRINT_PREVIEW_WIDGET::RefreshAll()
|
||||
{
|
||||
m_prev_panel->RefreshAll();
|
||||
if( m_prev_panel )
|
||||
m_prev_panel->RefreshAll();
|
||||
}
|
||||
|
||||
|
||||
FOOTPRINT_PREVIEW_PANEL_BASE* FOOTPRINT_PREVIEW_PANEL_BASE::Create( wxWindow* aParent,
|
||||
KIWAY& aKiway )
|
||||
{
|
||||
FOOTPRINT_PREVIEW_PANEL_BASE* panel = nullptr;
|
||||
wxWindow* panel = nullptr;
|
||||
|
||||
try
|
||||
{
|
||||
KIFACE* kiface = aKiway.KiFACE( KIWAY::FACE_PCB );
|
||||
wxWindow* window = kiface->CreateKiWindow( aParent, FRAME_FOOTPRINT_PREVIEW, &aKiway );
|
||||
|
||||
panel = dynamic_cast<FOOTPRINT_PREVIEW_PANEL_BASE*>( window );
|
||||
|
||||
if( window && !panel )
|
||||
delete window;
|
||||
if( KIFACE* kiface = aKiway.KiFACE( KIWAY::FACE_PCB ) )
|
||||
panel = kiface->CreateKiWindow( aParent, FRAME_FOOTPRINT_PREVIEW, &aKiway );
|
||||
}
|
||||
catch( ... )
|
||||
{
|
||||
}
|
||||
|
||||
return panel;
|
||||
return dynamic_cast<FOOTPRINT_PREVIEW_PANEL_BASE*>( panel );
|
||||
}
|
||||
|
||||
@@ -300,18 +300,6 @@ WIDGET_HOTKEY_CLIENT_DATA* WIDGET_HOTKEY_LIST::getHKClientData( wxTreeListItem a
|
||||
}
|
||||
|
||||
|
||||
WIDGET_HOTKEY_CLIENT_DATA* WIDGET_HOTKEY_LIST::getExpectedHkClientData( wxTreeListItem aItem )
|
||||
{
|
||||
const auto hkdata = getHKClientData( aItem );
|
||||
|
||||
// This probably means a hotkey-only action is being attempted on
|
||||
// a row that is not a hotkey (like a section heading)
|
||||
wxASSERT_MSG( hkdata != nullptr, "No hotkey data found for list item" );
|
||||
|
||||
return hkdata;
|
||||
}
|
||||
|
||||
|
||||
void WIDGET_HOTKEY_LIST::updateFromClientData()
|
||||
{
|
||||
for( wxTreeListItem i = GetFirstItem(); i.IsOk(); i = GetNextItem( i ) )
|
||||
@@ -369,7 +357,7 @@ void WIDGET_HOTKEY_LIST::changeHotkey( HOTKEY& aHotkey, long aKey, bool alternat
|
||||
|
||||
void WIDGET_HOTKEY_LIST::editItem( wxTreeListItem aItem, int aEditId )
|
||||
{
|
||||
WIDGET_HOTKEY_CLIENT_DATA* hkdata = getExpectedHkClientData( aItem );
|
||||
WIDGET_HOTKEY_CLIENT_DATA* hkdata = getHKClientData( aItem );
|
||||
|
||||
if( !hkdata )
|
||||
return;
|
||||
@@ -403,7 +391,7 @@ void WIDGET_HOTKEY_LIST::editItem( wxTreeListItem aItem, int aEditId )
|
||||
|
||||
void WIDGET_HOTKEY_LIST::resetItem( wxTreeListItem aItem, int aResetId )
|
||||
{
|
||||
WIDGET_HOTKEY_CLIENT_DATA* hkdata = getExpectedHkClientData( aItem );
|
||||
WIDGET_HOTKEY_CLIENT_DATA* hkdata = getHKClientData( aItem );
|
||||
|
||||
if( !hkdata )
|
||||
return;
|
||||
|
||||
@@ -125,6 +125,7 @@ wxString AddFileExtListToFilter( const std::vector<std::string>& aExts )
|
||||
const std::string FILEEXT::BackupFileSuffix( "-bak" );
|
||||
const std::string FILEEXT::LockFilePrefix( "~" );
|
||||
const std::string FILEEXT::LockFileExtension( "lck" );
|
||||
const std::string FILEEXT::AutoSaveFilePrefix( "_autosave-" );
|
||||
|
||||
const std::string FILEEXT::KiCadSymbolLibFileExtension( "kicad_sym" );
|
||||
const std::string FILEEXT::SchematicSymbolFileExtension( "sym" );
|
||||
|
||||
@@ -371,20 +371,20 @@ void DISPLAY_FOOTPRINTS_FRAME::SaveSettings( APP_SETTINGS_BASE* aCfg )
|
||||
|
||||
WINDOW_SETTINGS* DISPLAY_FOOTPRINTS_FRAME::GetWindowSettings( APP_SETTINGS_BASE* aCfg )
|
||||
{
|
||||
CVPCB_SETTINGS* cfg = Pgm().GetSettingsManager().GetAppSettings<CVPCB_SETTINGS>();
|
||||
CVPCB_SETTINGS* cfg = Pgm().GetSettingsManager().GetAppSettings<CVPCB_SETTINGS>( "cvpcb" );
|
||||
return &cfg->m_FootprintViewer;
|
||||
}
|
||||
|
||||
|
||||
PCB_VIEWERS_SETTINGS_BASE* DISPLAY_FOOTPRINTS_FRAME::GetViewerSettingsBase() const
|
||||
{
|
||||
return Pgm().GetSettingsManager().GetAppSettings<CVPCB_SETTINGS>();
|
||||
return Pgm().GetSettingsManager().GetAppSettings<CVPCB_SETTINGS>( "cvpcb" );
|
||||
}
|
||||
|
||||
|
||||
MAGNETIC_SETTINGS* DISPLAY_FOOTPRINTS_FRAME::GetMagneticItemsSettings()
|
||||
{
|
||||
CVPCB_SETTINGS* cfg = Pgm().GetSettingsManager().GetAppSettings<CVPCB_SETTINGS>();
|
||||
CVPCB_SETTINGS* cfg = Pgm().GetSettingsManager().GetAppSettings<CVPCB_SETTINGS>( "cvpcb" );
|
||||
return &cfg->m_FootprintViewerMagneticSettings;
|
||||
}
|
||||
|
||||
@@ -525,6 +525,7 @@ void DISPLAY_FOOTPRINTS_FRAME::InitDisplay()
|
||||
}
|
||||
|
||||
GetBoard()->Add( footprint );
|
||||
GetCanvas()->GetView()->Update( footprint );
|
||||
m_currentFootprint = footprintName;
|
||||
m_currentComp = comp;
|
||||
setFPWatcher( footprint );
|
||||
@@ -579,10 +580,10 @@ void DISPLAY_FOOTPRINTS_FRAME::UpdateMsgPanel()
|
||||
|
||||
COLOR_SETTINGS* DISPLAY_FOOTPRINTS_FRAME::GetColorSettings( bool aForceRefresh ) const
|
||||
{
|
||||
auto* settings = Pgm().GetSettingsManager().GetAppSettings<FOOTPRINT_EDITOR_SETTINGS>();
|
||||
auto* cfg = Pgm().GetSettingsManager().GetAppSettings<FOOTPRINT_EDITOR_SETTINGS>( "fpedit" );
|
||||
|
||||
if( settings )
|
||||
return Pgm().GetSettingsManager().GetColorSettings( settings->m_ColorTheme );
|
||||
if( cfg )
|
||||
return Pgm().GetSettingsManager().GetColorSettings( cfg->m_ColorTheme );
|
||||
else
|
||||
return Pgm().GetSettingsManager().GetColorSettings();
|
||||
}
|
||||
|
||||
@@ -275,7 +275,9 @@ void CONNECTION_SUBGRAPH::getAllConnectedItems( std::set<std::pair<SCH_SHEET_PAT
|
||||
|
||||
while( sg->m_absorbed_by )
|
||||
{
|
||||
wxASSERT( sg->m_graph == sg->m_absorbed_by->m_graph );
|
||||
// Using wxCHECK2 with continue statement causes a crash later in the connection
|
||||
// graph rebuild. See https://gitlab.com/kicad/code/kicad/-/issues/18136.
|
||||
wxCHECK( sg->m_graph == sg->m_absorbed_by->m_graph, /* void */ );
|
||||
sg = sg->m_absorbed_by;
|
||||
}
|
||||
|
||||
@@ -453,7 +455,7 @@ const wxString CONNECTION_SUBGRAPH::GetNetclassForDriver( SCH_ITEM* aItem ) cons
|
||||
|
||||
void CONNECTION_SUBGRAPH::Absorb( CONNECTION_SUBGRAPH* aOther )
|
||||
{
|
||||
wxASSERT( m_sheet == aOther->m_sheet );
|
||||
wxCHECK( m_sheet == aOther->m_sheet, /* void */ );
|
||||
|
||||
for( SCH_ITEM* item : aOther->m_items )
|
||||
{
|
||||
@@ -752,9 +754,9 @@ void CONNECTION_GRAPH::Recalculate( const SCH_SHEET_LIST& aSheetList, bool aUnco
|
||||
}
|
||||
else if( item->Type() == SCH_SHEET_T )
|
||||
{
|
||||
SCH_SHEET* sheet = static_cast<SCH_SHEET*>( item );
|
||||
SCH_SHEET* sheetItem = static_cast<SCH_SHEET*>( item );
|
||||
|
||||
for( SCH_SHEET_PIN* pin : sheet->GetPins() )
|
||||
for( SCH_SHEET_PIN* pin : sheetItem->GetPins() )
|
||||
{
|
||||
if( pin->IsConnectivityDirty() )
|
||||
{
|
||||
@@ -827,14 +829,14 @@ std::set<std::pair<SCH_SHEET_PATH, SCH_ITEM*>> CONNECTION_GRAPH::ExtractAffected
|
||||
// Find the primary subgraph on this sheet
|
||||
while( aSubgraph->m_absorbed_by )
|
||||
{
|
||||
wxASSERT( aSubgraph->m_graph == aSubgraph->m_absorbed_by->m_graph );
|
||||
wxCHECK2( aSubgraph->m_graph == aSubgraph->m_absorbed_by->m_graph, continue );
|
||||
aSubgraph = aSubgraph->m_absorbed_by;
|
||||
}
|
||||
|
||||
// Find the top most connected subgraph on all sheets
|
||||
while( aSubgraph->m_hier_parent )
|
||||
{
|
||||
wxASSERT( aSubgraph->m_graph == aSubgraph->m_hier_parent->m_graph );
|
||||
wxCHECK2( aSubgraph->m_graph == aSubgraph->m_hier_parent->m_graph, continue );
|
||||
aSubgraph = aSubgraph->m_hier_parent;
|
||||
}
|
||||
|
||||
@@ -848,9 +850,11 @@ std::set<std::pair<SCH_SHEET_PATH, SCH_ITEM*>> CONNECTION_GRAPH::ExtractAffected
|
||||
|
||||
if( !item_sg )
|
||||
{
|
||||
wxLogTrace( ConnTrace, wxT( "Item %s not found in connection graph" ), aItem->GetTypeDesc() );
|
||||
wxLogTrace( ConnTrace, wxT( "Item %s not found in connection graph" ),
|
||||
aItem->GetTypeDesc() );
|
||||
return;
|
||||
}
|
||||
|
||||
if( !item_sg->ResolveDrivers( true ) )
|
||||
{
|
||||
wxLogTrace( ConnTrace, wxT( "Item %s in subgraph %ld (%p) has no driver" ),
|
||||
@@ -1333,12 +1337,12 @@ void CONNECTION_GRAPH::buildItemSubGraphs()
|
||||
// Recache all bus aliases for later use
|
||||
wxCHECK_RET( m_schematic, wxS( "Connection graph cannot be built without schematic pointer" ) );
|
||||
|
||||
SCH_SHEET_LIST all_sheets = m_schematic->GetSheets();
|
||||
SCH_SCREENS screens( m_schematic->Root() );
|
||||
|
||||
for( unsigned i = 0; i < all_sheets.size(); i++ )
|
||||
for( SCH_SCREEN* screen = screens.GetFirst(); screen; screen = screens.GetNext() )
|
||||
{
|
||||
for( const std::shared_ptr<BUS_ALIAS>& alias : all_sheets[i].LastScreen()->GetBusAliases() )
|
||||
m_bus_alias_cache[ alias->GetName() ] = alias;
|
||||
for( const std::shared_ptr<BUS_ALIAS>& alias : screen->GetBusAliases() )
|
||||
m_bus_alias_cache[alias->GetName()] = alias;
|
||||
}
|
||||
|
||||
// Build subgraphs from items (on a per-sheet basis)
|
||||
@@ -1386,7 +1390,7 @@ void CONNECTION_GRAPH::buildItemSubGraphs()
|
||||
|
||||
SCH_CONNECTION* connected_conn = connected_item->Connection( &sheet );
|
||||
|
||||
wxASSERT( connected_conn );
|
||||
wxCHECK2( connected_conn, continue );
|
||||
|
||||
if( connected_conn->SubgraphCode() == 0 )
|
||||
{
|
||||
@@ -1536,7 +1540,7 @@ void CONNECTION_GRAPH::collectAllDriverValues()
|
||||
case SCH_PIN_T:
|
||||
{
|
||||
SCH_PIN* pin = static_cast<SCH_PIN*>( driver );
|
||||
wxASSERT( pin->IsGlobalPower() );
|
||||
wxCHECK( pin->IsGlobalPower(), /* void */ );
|
||||
m_global_label_cache[name].push_back( subgraph );
|
||||
break;
|
||||
}
|
||||
@@ -1972,9 +1976,10 @@ void CONNECTION_GRAPH::processSubGraphs()
|
||||
}
|
||||
else
|
||||
{
|
||||
wxASSERT( driver->Type() == SCH_LABEL_T ||
|
||||
wxCHECK2( driver->Type() == SCH_LABEL_T ||
|
||||
driver->Type() == SCH_GLOBAL_LABEL_T ||
|
||||
driver->Type() == SCH_HIER_LABEL_T );
|
||||
driver->Type() == SCH_HIER_LABEL_T,
|
||||
continue );
|
||||
|
||||
if( subgraph->GetNameForDriver( driver ) == test_name )
|
||||
{
|
||||
@@ -1996,7 +2001,7 @@ void CONNECTION_GRAPH::processSubGraphs()
|
||||
subgraph->m_bus_neighbors[member].insert( candidate );
|
||||
candidate->m_bus_parents[member].insert( subgraph );
|
||||
}
|
||||
else if( connection->Type() == candidate->m_driver_connection->Type() )
|
||||
else if( !connection->IsBus() || connection->Type() == candidate->m_driver_connection->Type() )
|
||||
{
|
||||
wxLogTrace( ConnTrace, wxS( "%lu (%s) absorbs neighbor %lu (%s)" ),
|
||||
subgraph->m_code, connection->Name(),
|
||||
@@ -2051,12 +2056,12 @@ void CONNECTION_GRAPH::buildConnectionGraph( std::function<void( SCH_ITEM* )>* a
|
||||
// Recache all bus aliases for later use
|
||||
wxCHECK_RET( m_schematic, wxT( "Connection graph cannot be built without schematic pointer" ) );
|
||||
|
||||
SCH_SHEET_LIST all_sheets = m_schematic->GetSheets();
|
||||
SCH_SCREENS screens( m_schematic->Root() );
|
||||
|
||||
for( unsigned i = 0; i < all_sheets.size(); i++ )
|
||||
for( SCH_SCREEN* screen = screens.GetFirst(); screen; screen = screens.GetNext() )
|
||||
{
|
||||
for( const std::shared_ptr<BUS_ALIAS>& alias : all_sheets[i].LastScreen()->GetBusAliases() )
|
||||
m_bus_alias_cache[ alias->GetName() ] = alias;
|
||||
for( const std::shared_ptr<BUS_ALIAS>& alias : screen->GetBusAliases() )
|
||||
m_bus_alias_cache[alias->GetName()] = alias;
|
||||
}
|
||||
|
||||
PROF_TIMER sub_graph( "buildItemSubGraphs" );
|
||||
@@ -2154,18 +2159,19 @@ void CONNECTION_GRAPH::buildConnectionGraph( std::function<void( SCH_ITEM* )>* a
|
||||
if( !secondary_is_global && candidate->m_sheet != subgraph->m_sheet )
|
||||
continue;
|
||||
|
||||
SCH_CONNECTION* conn = candidate->m_driver_connection;
|
||||
|
||||
if( conn->Name() == secondary_name )
|
||||
for( SCH_ITEM* candidate_driver : candidate->m_drivers )
|
||||
{
|
||||
wxLogTrace( ConnTrace, wxS( "Global %lu (%s) promoted to %s" ),
|
||||
candidate->m_code, conn->Name(),
|
||||
subgraph->m_driver_connection->Name() );
|
||||
if( candidate->GetNameForDriver( candidate_driver ) == secondary_name )
|
||||
{
|
||||
wxLogTrace( ConnTrace, wxS( "Global %lu (%s) promoted to %s" ),
|
||||
candidate->m_code, candidate->m_driver_connection->Name(),
|
||||
subgraph->m_driver_connection->Name() );
|
||||
|
||||
conn->Clone( *subgraph->m_driver_connection );
|
||||
candidate->m_driver_connection->Clone( *subgraph->m_driver_connection );
|
||||
|
||||
candidate->m_dirty = false;
|
||||
propagateToNeighbors( candidate, false );
|
||||
candidate->m_dirty = false;
|
||||
propagateToNeighbors( candidate, false );
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -2197,7 +2203,7 @@ void CONNECTION_GRAPH::buildConnectionGraph( std::function<void( SCH_ITEM* )>* a
|
||||
for( CONNECTION_SUBGRAPH* subgraph : m_driver_subgraphs )
|
||||
{
|
||||
// All SGs should have been processed by propagateToNeighbors above
|
||||
wxASSERT_MSG( !subgraph->m_dirty,
|
||||
wxCHECK2_MSG( !subgraph->m_dirty, continue,
|
||||
wxS( "Subgraph not processed by propagateToNeighbors!" ) );
|
||||
|
||||
if( subgraph->m_bus_parents.size() < 2 )
|
||||
@@ -2208,7 +2214,7 @@ void CONNECTION_GRAPH::buildConnectionGraph( std::function<void( SCH_ITEM* )>* a
|
||||
wxLogTrace( ConnTrace, wxS( "%lu (%s) has multiple bus parents" ),
|
||||
subgraph->m_code, conn->Name() );
|
||||
|
||||
wxASSERT( conn->IsNet() );
|
||||
wxCHECK2( conn->IsNet(), continue );
|
||||
|
||||
for( const auto& ii : subgraph->m_bus_parents )
|
||||
{
|
||||
@@ -2574,7 +2580,7 @@ void CONNECTION_GRAPH::propagateToNeighbors( CONNECTION_SUBGRAPH* aSubgraph, boo
|
||||
candidate->m_hier_parent = aParent;
|
||||
aParent->m_hier_children.insert( candidate );
|
||||
|
||||
wxASSERT( candidate->m_graph == aParent->m_graph );
|
||||
wxCHECK2( candidate->m_graph == aParent->m_graph, continue );
|
||||
|
||||
search_list.push_back( candidate );
|
||||
break;
|
||||
@@ -2692,7 +2698,7 @@ void CONNECTION_GRAPH::propagateToNeighbors( CONNECTION_SUBGRAPH* aSubgraph, boo
|
||||
continue;
|
||||
|
||||
// Safety check against infinite recursion
|
||||
wxASSERT( neighbor_conn->IsNet() );
|
||||
wxCHECK2( neighbor_conn->IsNet(), continue );
|
||||
|
||||
wxLogTrace( ConnTrace, wxS( "%lu (%s) connected to bus member %s (local %s)" ),
|
||||
neighbor->m_code, neighbor_name, member->Name(), member->LocalName() );
|
||||
@@ -2902,7 +2908,7 @@ std::shared_ptr<SCH_CONNECTION> CONNECTION_GRAPH::getDefaultConnection( SCH_ITEM
|
||||
SCH_CONNECTION* CONNECTION_GRAPH::matchBusMember( SCH_CONNECTION* aBusConnection,
|
||||
SCH_CONNECTION* aSearch )
|
||||
{
|
||||
wxASSERT( aBusConnection->IsBus() );
|
||||
wxCHECK( aBusConnection->IsBus(), nullptr );
|
||||
|
||||
SCH_CONNECTION* match = nullptr;
|
||||
|
||||
@@ -2984,7 +2990,7 @@ std::vector<const CONNECTION_SUBGRAPH*> CONNECTION_GRAPH::GetBusesNeedingMigrati
|
||||
for( CONNECTION_SUBGRAPH* subgraph : m_subgraphs )
|
||||
{
|
||||
// Graph is supposed to be up-to-date before calling this
|
||||
wxASSERT( !subgraph->m_dirty );
|
||||
wxCHECK2( !subgraph->m_dirty, continue );
|
||||
|
||||
if( !subgraph->m_driver )
|
||||
continue;
|
||||
@@ -3062,7 +3068,7 @@ CONNECTION_SUBGRAPH* CONNECTION_GRAPH::FindSubgraphByName( const wxString& aNetN
|
||||
for( CONNECTION_SUBGRAPH* sg : it->second )
|
||||
{
|
||||
// Cache is supposed to be valid by now
|
||||
wxASSERT( sg && !sg->m_absorbed && sg->m_driver_connection );
|
||||
wxCHECK2( sg && !sg->m_absorbed && sg->m_driver_connection, continue );
|
||||
|
||||
if( sg->m_sheet == aPath && sg->m_driver_connection->Name() == aNetName )
|
||||
return sg;
|
||||
@@ -3079,7 +3085,7 @@ CONNECTION_SUBGRAPH* CONNECTION_GRAPH::FindFirstSubgraphByName( const wxString&
|
||||
if( it == m_net_name_to_subgraphs_map.end() )
|
||||
return nullptr;
|
||||
|
||||
wxASSERT( !it->second.empty() );
|
||||
wxCHECK( !it->second.empty(), nullptr );
|
||||
|
||||
return it->second[0];
|
||||
}
|
||||
@@ -3129,7 +3135,7 @@ int CONNECTION_GRAPH::RunERC()
|
||||
wxCHECK2( subgraph, continue );
|
||||
|
||||
// Graph is supposed to be up-to-date before calling RunERC()
|
||||
wxASSERT( !subgraph->m_dirty );
|
||||
wxCHECK2( !subgraph->m_dirty, continue );
|
||||
|
||||
if( subgraph->m_absorbed )
|
||||
continue;
|
||||
|
||||
@@ -466,6 +466,18 @@ public:
|
||||
*/
|
||||
void ExchangeItem( SCH_ITEM* aOldItem, SCH_ITEM* aNewItem );
|
||||
|
||||
/**
|
||||
* We modify how we handle the connectivity graph for small graphs vs large
|
||||
* graphs. Partially this is to avoid unneeded complexity for small graphs,
|
||||
* where the performance of the graph is not a concern. This is considered
|
||||
* a temporary solution until the connectivity graph is refactored with an
|
||||
* eye toward partial updates
|
||||
*/
|
||||
bool IsMinor() const
|
||||
{
|
||||
return m_items.size() < 10000;
|
||||
}
|
||||
|
||||
private:
|
||||
/**
|
||||
* Update the graphical connectivity between items (i.e. where they touch)
|
||||
|
||||
@@ -434,7 +434,7 @@ bool DIALOG_SHEET_PROPERTIES::TransferDataFromWindow()
|
||||
for( SCH_ITEM* item : m_frame->GetScreen()->Items().OfType( SCH_SHEET_T ) )
|
||||
m_frame->UpdateItem( item );
|
||||
|
||||
if( isUndoable )
|
||||
if( isUndoable && !m_sheet->IsNew() )
|
||||
{
|
||||
commit.Push( _( "Edit Sheet Properties" ) );
|
||||
}
|
||||
|
||||
@@ -461,7 +461,7 @@ void DIALOG_SIM_MODEL<T_symbol, T_field>::updateWidgets()
|
||||
updateBuiltinModelWidgets( model );
|
||||
updateModelParamsTab( model );
|
||||
updateModelCodeTab( model );
|
||||
updatePinAssignments( model, false );
|
||||
updatePinAssignments( model, model != m_prevModel );
|
||||
|
||||
std::string ref = SIM_MODEL::GetFieldValue( &m_fields, SIM_REFERENCE_FIELD );
|
||||
|
||||
|
||||
@@ -1255,7 +1255,9 @@ bool SCH_EDIT_FRAME::SaveProject( bool aSaveAs )
|
||||
|
||||
wxCHECK2( screen, continue );
|
||||
|
||||
sheets.emplace_back( std::make_pair( screen->GetUuid(), sheet->GetName() ) );
|
||||
// For the root sheet we use the canonical name ( "Root" ) because its name
|
||||
// cannot be modified by the user
|
||||
sheets.emplace_back( std::make_pair( screen->GetUuid(), wxT( "Root" ) ) );
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
@@ -139,5 +139,4 @@ private:
|
||||
const TRANSFORM& aTransform, bool aDimmed ) override;
|
||||
};
|
||||
|
||||
|
||||
#endif // LIB_SHAPE_H
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
*
|
||||
* Copyright (C) 1992-2018 jp.charras at wanadoo.fr
|
||||
* Copyright (C) 2013 SoftPLC Corporation, Dick Hollenbeck <dick@softplc.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,9 @@
|
||||
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
|
||||
*/
|
||||
|
||||
#include <algorithm>
|
||||
#include <vector>
|
||||
|
||||
#include <confirm.h>
|
||||
#include <refdes_utils.h>
|
||||
|
||||
@@ -68,8 +71,23 @@ bool NETLIST_EXPORTER_ORCADPCB2::WriteNetlist( const wxString& aOutFileName,
|
||||
{
|
||||
SCH_SHEET_PATH sheet = sheetList[i];
|
||||
|
||||
// Process symbol attributes
|
||||
// The rtree returns items in a non-deterministic order (platform-dependent)
|
||||
// Therefore we need to sort them before outputting to ensure file stability for version
|
||||
// control and QA comparisons
|
||||
std::vector<EDA_ITEM*> sheetItems;
|
||||
|
||||
for( EDA_ITEM* item : sheet.LastScreen()->Items().OfType( SCH_SYMBOL_T ) )
|
||||
sheetItems.push_back( item );
|
||||
|
||||
auto pred = []( const EDA_ITEM* item1, const EDA_ITEM* item2 )
|
||||
{
|
||||
return item1->m_Uuid < item2->m_Uuid;
|
||||
};
|
||||
|
||||
std::sort( sheetItems.begin(), sheetItems.end(), pred );
|
||||
|
||||
// Process symbol attributes
|
||||
for( EDA_ITEM* item : sheetItems )
|
||||
{
|
||||
SCH_SYMBOL* symbol = findNextSymbol( item, &sheet );
|
||||
|
||||
|
||||
@@ -1111,6 +1111,7 @@ void SCH_EDIT_FRAME::OnUpdatePCB( wxCommandEvent& event )
|
||||
}
|
||||
|
||||
KIWAY_PLAYER* frame = Kiway().Player( FRAME_PCB_EDITOR, false );
|
||||
wxEventBlocker blocker( this );
|
||||
|
||||
if( !frame )
|
||||
{
|
||||
@@ -1338,6 +1339,7 @@ void SCH_EDIT_FRAME::OnOpenPcbnew( wxCommandEvent& event )
|
||||
}
|
||||
else
|
||||
{
|
||||
wxEventBlocker blocker(this);
|
||||
KIWAY_PLAYER* frame = Kiway().Player( FRAME_PCB_EDITOR, false );
|
||||
|
||||
if( !frame )
|
||||
@@ -1679,9 +1681,7 @@ void SCH_EDIT_FRAME::RecalculateConnections( SCH_COMMIT* aCommit, SCH_CLEANUP_FL
|
||||
if( !aCommit )
|
||||
aCommit = &localCommit;
|
||||
|
||||
#ifdef PROFILE
|
||||
PROF_TIMER timer;
|
||||
#endif
|
||||
|
||||
// Ensure schematic graph is accurate
|
||||
if( aCleanupFlags == LOCAL_CLEANUP )
|
||||
@@ -1694,10 +1694,8 @@ void SCH_EDIT_FRAME::RecalculateConnections( SCH_COMMIT* aCommit, SCH_CLEANUP_FL
|
||||
SchematicCleanUp( aCommit, sheet.LastScreen() );
|
||||
}
|
||||
|
||||
#ifdef PROFILE
|
||||
timer.Stop();
|
||||
wxLogTrace( "CONN_PROFILE", "SchematicCleanUp() %0.4f ms", timer.msecs() );
|
||||
#endif
|
||||
|
||||
if( settings.m_IntersheetRefsShow )
|
||||
RecomputeIntersheetRefs();
|
||||
@@ -1714,7 +1712,7 @@ void SCH_EDIT_FRAME::RecalculateConnections( SCH_COMMIT* aCommit, SCH_CLEANUP_FL
|
||||
};
|
||||
|
||||
if( !ADVANCED_CFG::GetCfg().m_IncrementalConnectivity || aCleanupFlags == GLOBAL_CLEANUP
|
||||
|| m_undoList.m_CommandsList.empty() )
|
||||
|| m_undoList.m_CommandsList.empty()|| Schematic().ConnectionGraph()->IsMinor() )
|
||||
{
|
||||
Schematic().ConnectionGraph()->Recalculate( list, true, &changeHandler );
|
||||
}
|
||||
|
||||
@@ -92,6 +92,9 @@ SCH_SHEET* SCH_IO_CADSTAR_ARCHIVE::LoadSchematicFile( const wxString& aFi
|
||||
SCH_SCREEN* screen = new SCH_SCREEN( aSchematic );
|
||||
screen->SetFileName( aFileName );
|
||||
rootSheet->SetScreen( screen );
|
||||
|
||||
// Virtual root sheet UUID must be the same as the schematic file UUID.
|
||||
const_cast<KIID&>( rootSheet->m_Uuid ) = screen->GetUuid();
|
||||
}
|
||||
|
||||
CADSTAR_SCH_ARCHIVE_LOADER csaLoader( aFileName, m_reporter, m_progressReporter );
|
||||
|
||||
@@ -343,19 +343,19 @@ void SCH_IO_DATABASE::connect()
|
||||
{
|
||||
std::set<std::string> columns;
|
||||
|
||||
columns.insert( tableIter.key_col );
|
||||
columns.insert( tableIter.footprints_col );
|
||||
columns.insert( tableIter.symbols_col );
|
||||
columns.insert( boost::to_lower_copy( tableIter.key_col ) );
|
||||
columns.insert( boost::to_lower_copy( tableIter.footprints_col ) );
|
||||
columns.insert( boost::to_lower_copy( tableIter.symbols_col ) );
|
||||
|
||||
columns.insert( tableIter.properties.description );
|
||||
columns.insert( tableIter.properties.footprint_filters );
|
||||
columns.insert( tableIter.properties.keywords );
|
||||
columns.insert( tableIter.properties.exclude_from_sim );
|
||||
columns.insert( tableIter.properties.exclude_from_bom );
|
||||
columns.insert( tableIter.properties.exclude_from_board );
|
||||
columns.insert( boost::to_lower_copy( tableIter.properties.description ) );
|
||||
columns.insert( boost::to_lower_copy( tableIter.properties.footprint_filters ) );
|
||||
columns.insert( boost::to_lower_copy( tableIter.properties.keywords ) );
|
||||
columns.insert( boost::to_lower_copy( tableIter.properties.exclude_from_sim ) );
|
||||
columns.insert( boost::to_lower_copy( tableIter.properties.exclude_from_bom ) );
|
||||
columns.insert( boost::to_lower_copy( tableIter.properties.exclude_from_board ) );
|
||||
|
||||
for( const DATABASE_FIELD_MAPPING& field : tableIter.fields )
|
||||
columns.insert( field.column );
|
||||
columns.insert( boost::to_lower_copy( field.column ) );
|
||||
|
||||
m_conn->CacheTableInfo( tableIter.table, columns );
|
||||
}
|
||||
|
||||
@@ -2903,7 +2903,7 @@ bool SCH_IO_EAGLE::checkHeader( const wxString& aFileName ) const
|
||||
|
||||
wxTextInputStream text( input );
|
||||
|
||||
for( int i = 0; i < 4; i++ )
|
||||
for( int i = 0; i < 8; i++ )
|
||||
{
|
||||
if( input.Eof() )
|
||||
return false;
|
||||
|
||||
@@ -944,16 +944,16 @@ LIB_SYMBOL* SCH_EASYEDA_PARSER::ParseSymbol( const VECTOR2D& aOrigi
|
||||
std::optional<wxString> valOpt;
|
||||
wxString symbolName = wxS( "Unknown" );
|
||||
|
||||
if( valOpt = get_opt( aParams, wxS( "name" ) ) )
|
||||
if( ( valOpt = get_opt( aParams, wxS( "name" ) ) ) )
|
||||
symbolName = *valOpt;
|
||||
else if( valOpt = get_opt( aParams, wxS( "spiceSymbolName" ) ) )
|
||||
else if( ( valOpt = get_opt( aParams, wxS( "spiceSymbolName" ) ) ) )
|
||||
symbolName = *valOpt;
|
||||
|
||||
wxString symbolPrefix;
|
||||
|
||||
if( valOpt = get_opt( aParams, wxS( "pre" ) ) )
|
||||
if( ( valOpt = get_opt( aParams, wxS( "pre" ) ) ) )
|
||||
symbolPrefix = *valOpt;
|
||||
else if( valOpt = get_opt( aParams, wxS( "spicePre" ) ) )
|
||||
else if( ( valOpt = get_opt( aParams, wxS( "spicePre" ) ) ) )
|
||||
symbolPrefix = *valOpt;
|
||||
|
||||
LIB_ID libId = EasyEdaToKiCadLibID( wxEmptyString, symbolName );
|
||||
@@ -971,7 +971,7 @@ LIB_SYMBOL* SCH_EASYEDA_PARSER::ParseSymbol( const VECTOR2D& aOrigi
|
||||
if( srcName == wxS( "Datasheet" ) )
|
||||
srcName = wxS( "link" );
|
||||
|
||||
if( valOpt = get_opt( aParams, srcName ) )
|
||||
if( ( valOpt = get_opt( aParams, srcName ) ) )
|
||||
{
|
||||
if( valOpt->empty() )
|
||||
continue;
|
||||
|
||||
@@ -640,6 +640,9 @@ SCH_SHEET* SCH_IO_EASYEDA::LoadSchematicFile( const wxString& aFileName, SCHEMAT
|
||||
|
||||
screen->SetFileName( aFileName );
|
||||
rootSheet->SetScreen( screen );
|
||||
|
||||
// Virtual root sheet UUID must be the same as the schematic file UUID.
|
||||
const_cast<KIID&>( rootSheet->m_Uuid ) = screen->GetUuid();
|
||||
}
|
||||
|
||||
SYMBOL_LIB_TABLE* libTable = PROJECT_SCH::SchSymbolLibTable( &aSchematic->Prj() );
|
||||
|
||||
@@ -455,6 +455,9 @@ SCH_SHEET* SCH_IO_EASYEDAPRO::LoadSchematicFile( const wxString& aFileName,
|
||||
|
||||
screen->SetFileName( aFileName );
|
||||
rootSheet->SetScreen( screen );
|
||||
|
||||
// Virtual root sheet UUID must be the same as the schematic file UUID.
|
||||
const_cast<KIID&>( rootSheet->m_Uuid ) = screen->GetUuid();
|
||||
}
|
||||
|
||||
SYMBOL_LIB_TABLE* libTable = PROJECT_SCH::SchSymbolLibTable( &aSchematic->Prj() );
|
||||
|
||||
@@ -1159,11 +1159,16 @@ LIB_PIN* SCH_IO_KICAD_LEGACY_LIB_CACHE::loadPin( std::unique_ptr<LIB_SYMBOL>& aS
|
||||
|
||||
pos += tmp.size() + 1;
|
||||
|
||||
PIN_ORIENTATION orientation = PIN_ORIENTATION::PIN_RIGHT;
|
||||
std::optional<PIN_ORIENTATION> optVal = magic_enum::enum_cast<PIN_ORIENTATION>( tmp[0] );
|
||||
PIN_ORIENTATION orientation;
|
||||
|
||||
if( optVal.has_value() )
|
||||
orientation = optVal.value();
|
||||
switch( static_cast<char>( tmp[0] ) )
|
||||
{
|
||||
case 'U': orientation = PIN_ORIENTATION::PIN_UP; break;
|
||||
case 'D': orientation = PIN_ORIENTATION::PIN_DOWN; break;
|
||||
case 'L': orientation = PIN_ORIENTATION::PIN_LEFT; break;
|
||||
case 'R': /* fall-through */
|
||||
default: orientation = PIN_ORIENTATION::PIN_RIGHT; break;
|
||||
}
|
||||
|
||||
tmp = tokens.GetNextToken();
|
||||
|
||||
|
||||
@@ -1331,7 +1331,7 @@ void SCH_IO_KICAD_SEXPR::saveText( SCH_TEXT* aText, int aNestLevel )
|
||||
EDA_UNIT_UTILS::FormatAngle( angle ).c_str() );
|
||||
}
|
||||
|
||||
if( aText->GetFieldsAutoplaced() != FIELDS_AUTOPLACED_NO )
|
||||
if( label && !label->GetFields().empty() && label->GetFieldsAutoplaced() != FIELDS_AUTOPLACED_NO )
|
||||
m_out->Print( 0, " (fields_autoplaced yes)" );
|
||||
|
||||
m_out->Print( 0, "\n" );
|
||||
|
||||
@@ -309,29 +309,42 @@ void formatPoly( OUTPUTFORMATTER* aFormatter, int aNestLevel, EDA_SHAPE* aPolyLi
|
||||
{
|
||||
int newLine = 0;
|
||||
int lineCount = 1;
|
||||
|
||||
aFormatter->Print( aNestLevel, "(polyline%s\n",
|
||||
aIsPrivate ? " private" : "" );
|
||||
aFormatter->Print( aNestLevel + 1, "(pts" );
|
||||
|
||||
for( const VECTOR2I& pt : aPolyLine->GetPolyShape().Outline( 0 ).CPoints() )
|
||||
{
|
||||
if( newLine == 4 || !ADVANCED_CFG::GetCfg().m_CompactSave )
|
||||
{
|
||||
aFormatter->Print( 0, "\n" );
|
||||
aFormatter->Print( aNestLevel + 2, "(xy %s %s)",
|
||||
EDA_UNIT_UTILS::FormatInternalUnits( schIUScale, pt.x ).c_str(),
|
||||
EDA_UNIT_UTILS::FormatInternalUnits( schIUScale, pt.y ).c_str() );
|
||||
newLine = 0;
|
||||
lineCount += 1;
|
||||
}
|
||||
else
|
||||
{
|
||||
aFormatter->Print( 0, " (xy %s %s)",
|
||||
EDA_UNIT_UTILS::FormatInternalUnits( schIUScale, pt.x ).c_str(),
|
||||
EDA_UNIT_UTILS::FormatInternalUnits( schIUScale, pt.y ).c_str() );
|
||||
}
|
||||
const SHAPE_POLY_SET& polySet = aPolyLine->GetPolyShape();
|
||||
|
||||
newLine += 1;
|
||||
|
||||
if( polySet.OutlineCount() == 0 )
|
||||
{
|
||||
// If we've managed to get a polyline with no points, that's probably a bad thing,
|
||||
// but at least don't dereference it and crash.
|
||||
wxFAIL_MSG( "Polyline has no outline" );
|
||||
}
|
||||
else
|
||||
{
|
||||
for( const VECTOR2I& pt : polySet.Outline( 0 ).CPoints() )
|
||||
{
|
||||
if( newLine == 4 || !ADVANCED_CFG::GetCfg().m_CompactSave )
|
||||
{
|
||||
aFormatter->Print( 0, "\n" );
|
||||
aFormatter->Print( aNestLevel + 2, "(xy %s %s)",
|
||||
EDA_UNIT_UTILS::FormatInternalUnits( schIUScale, pt.x ).c_str(),
|
||||
EDA_UNIT_UTILS::FormatInternalUnits( schIUScale, pt.y ).c_str() );
|
||||
newLine = 0;
|
||||
lineCount += 1;
|
||||
}
|
||||
else
|
||||
{
|
||||
aFormatter->Print( 0, " (xy %s %s)",
|
||||
EDA_UNIT_UTILS::FormatInternalUnits( schIUScale, pt.x ).c_str(),
|
||||
EDA_UNIT_UTILS::FormatInternalUnits( schIUScale, pt.y ).c_str() );
|
||||
}
|
||||
|
||||
newLine += 1;
|
||||
}
|
||||
}
|
||||
|
||||
if( lineCount == 1 )
|
||||
|
||||
@@ -3578,6 +3578,16 @@ SCH_BUS_WIRE_ENTRY* SCH_IO_KICAD_SEXPR_PARSER::parseBusEntry()
|
||||
}
|
||||
|
||||
|
||||
void fixupSchFillMode( SCH_SHAPE* aShape )
|
||||
{
|
||||
if( aShape->GetFillMode() == FILL_T::FILLED_SHAPE )
|
||||
{
|
||||
aShape->SetFillColor( aShape->GetStroke().GetColor() );
|
||||
aShape->SetFillMode( FILL_T::FILLED_WITH_COLOR );
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
SCH_SHAPE* SCH_IO_KICAD_SEXPR_PARSER::parseSchPolyLine()
|
||||
{
|
||||
T token;
|
||||
@@ -3627,6 +3637,7 @@ SCH_SHAPE* SCH_IO_KICAD_SEXPR_PARSER::parseSchPolyLine()
|
||||
parseFill( fill );
|
||||
polyline->SetFillMode( fill.m_FillType );
|
||||
polyline->SetFillColor( fill.m_Color );
|
||||
fixupSchFillMode( polyline.get() );
|
||||
break;
|
||||
|
||||
case T_uuid:
|
||||
@@ -3759,6 +3770,7 @@ SCH_SHAPE* SCH_IO_KICAD_SEXPR_PARSER::parseSchArc()
|
||||
parseFill( fill );
|
||||
arc->SetFillMode( fill.m_FillType );
|
||||
arc->SetFillColor( fill.m_Color );
|
||||
fixupSchFillMode( arc.get() );
|
||||
break;
|
||||
|
||||
case T_uuid:
|
||||
@@ -3818,6 +3830,7 @@ SCH_SHAPE* SCH_IO_KICAD_SEXPR_PARSER::parseSchCircle()
|
||||
parseFill( fill );
|
||||
circle->SetFillMode( fill.m_FillType );
|
||||
circle->SetFillColor( fill.m_Color );
|
||||
fixupSchFillMode( circle.get() );
|
||||
break;
|
||||
|
||||
case T_uuid:
|
||||
@@ -3876,6 +3889,7 @@ SCH_SHAPE* SCH_IO_KICAD_SEXPR_PARSER::parseSchRectangle()
|
||||
parseFill( fill );
|
||||
rectangle->SetFillMode( fill.m_FillType );
|
||||
rectangle->SetFillColor( fill.m_Color );
|
||||
fixupSchFillMode( rectangle.get() );
|
||||
break;
|
||||
|
||||
case T_uuid:
|
||||
@@ -3949,6 +3963,7 @@ SCH_SHAPE* SCH_IO_KICAD_SEXPR_PARSER::parseSchBezier()
|
||||
parseFill( fill );
|
||||
bezier->SetFillMode( fill.m_FillType );
|
||||
bezier->SetFillColor( fill.m_Color );
|
||||
fixupSchFillMode( bezier.get() );
|
||||
break;
|
||||
|
||||
case T_uuid:
|
||||
@@ -4201,6 +4216,7 @@ SCH_TEXTBOX* SCH_IO_KICAD_SEXPR_PARSER::parseSchTextBox()
|
||||
parseFill( fill );
|
||||
textBox->SetFillMode( fill.m_FillType );
|
||||
textBox->SetFillColor( fill.m_Color );
|
||||
fixupSchFillMode( textBox.get() );
|
||||
break;
|
||||
|
||||
case T_effects:
|
||||
|
||||
@@ -65,6 +65,9 @@ SCH_SHEET* SCH_IO_LTSPICE::LoadSchematicFile( const wxString& aFileName, SCHEMAT
|
||||
|
||||
screen->SetFileName( aFileName );
|
||||
rootSheet->SetScreen( screen );
|
||||
|
||||
// Virtual root sheet UUID must be the same as the schematic file UUID.
|
||||
const_cast<KIID&>( rootSheet->m_Uuid ) = screen->GetUuid();
|
||||
}
|
||||
|
||||
SYMBOL_LIB_TABLE* libTable = PROJECT_SCH::SchSymbolLibTable( &aSchematic->Prj() );
|
||||
|
||||
@@ -52,7 +52,7 @@
|
||||
/* They are not inline because this creates problems with gcc at linking time in debug mode */
|
||||
|
||||
SCH_ITEM::SCH_ITEM( EDA_ITEM* aParent, KICAD_T aType ) :
|
||||
EDA_ITEM( aParent, aType )
|
||||
EDA_ITEM( aParent, aType, true, false )
|
||||
{
|
||||
m_layer = LAYER_WIRE; // It's only a default, in fact
|
||||
m_fieldsAutoplaced = FIELDS_AUTOPLACED_NO;
|
||||
@@ -123,6 +123,11 @@ SCH_ITEM* SCH_ITEM::Duplicate( bool doClone ) const
|
||||
|
||||
SCHEMATIC* SCH_ITEM::Schematic() const
|
||||
{
|
||||
if( !SCHEMATIC::m_IsSchematicExists )
|
||||
{
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
EDA_ITEM* parent = GetParent();
|
||||
|
||||
while( parent )
|
||||
|
||||
@@ -1313,9 +1313,10 @@ void SCH_LABEL_BASE::Plot( PLOTTER* aPlotter, bool aBackground,
|
||||
int layer = ( connection && connection->IsBus() ) ? LAYER_BUS : m_layer;
|
||||
COLOR4D color = settings->GetLayerColor( layer );
|
||||
int penWidth = GetEffectiveTextPenWidth( settings->GetDefaultPenWidth() );
|
||||
COLOR4D labelColor = GetLabelColor();
|
||||
|
||||
if( aPlotter->GetColorMode() && GetTextColor() != COLOR4D::UNSPECIFIED )
|
||||
color = GetTextColor();
|
||||
if( aPlotter->GetColorMode() && labelColor != COLOR4D::UNSPECIFIED )
|
||||
color = labelColor;
|
||||
|
||||
penWidth = std::max( penWidth, settings->GetMinPenWidth() );
|
||||
aPlotter->SetCurrentLineWidth( penWidth );
|
||||
@@ -1412,9 +1413,10 @@ void SCH_LABEL_BASE::Print( const RENDER_SETTINGS* aSettings, const VECTOR2I& aO
|
||||
bool blackAndWhiteMode = GetGRForceBlackPenState();
|
||||
int penWidth = std::max( GetPenWidth(), aSettings->GetDefaultPenWidth() );
|
||||
VECTOR2I text_offset = aOffset + GetSchematicTextOffset( aSettings );
|
||||
COLOR4D labelColor = GetLabelColor();
|
||||
|
||||
if( !blackAndWhiteMode && GetTextColor() != COLOR4D::UNSPECIFIED )
|
||||
color = GetTextColor();
|
||||
if( !blackAndWhiteMode && labelColor != COLOR4D::UNSPECIFIED )
|
||||
color = labelColor;
|
||||
|
||||
EDA_TEXT::Print( aSettings, text_offset, color );
|
||||
|
||||
|
||||
@@ -101,47 +101,6 @@ wxString SCH_LINE::GetFriendlyName() const
|
||||
}
|
||||
|
||||
|
||||
wxString SCH_LINE::GetNetname( const SCH_SHEET_PATH& aSheet )
|
||||
{
|
||||
std::list<const SCH_LINE *> checkedLines;
|
||||
checkedLines.push_back(this);
|
||||
return FindWireSegmentNetNameRecursive( this, checkedLines, aSheet );
|
||||
}
|
||||
|
||||
|
||||
wxString SCH_LINE::FindWireSegmentNetNameRecursive( SCH_LINE *line,
|
||||
std::list<const SCH_LINE *> &checkedLines,
|
||||
const SCH_SHEET_PATH& aSheet ) const
|
||||
{
|
||||
for ( auto connected : line->ConnectedItems( aSheet ) )
|
||||
{
|
||||
if( connected->Type() == SCH_LINE_T )
|
||||
{
|
||||
if( std::find(checkedLines.begin(), checkedLines.end(),
|
||||
connected ) == checkedLines.end() )
|
||||
{
|
||||
SCH_LINE* connectedLine = static_cast<SCH_LINE*>( connected );
|
||||
checkedLines.push_back( connectedLine );
|
||||
|
||||
wxString netName = FindWireSegmentNetNameRecursive( connectedLine, checkedLines,
|
||||
aSheet );
|
||||
|
||||
if( !netName.IsEmpty() )
|
||||
return netName;
|
||||
}
|
||||
}
|
||||
else if( connected->Type() == SCH_LABEL_T
|
||||
|| connected->Type() == SCH_GLOBAL_LABEL_T
|
||||
|| connected->Type() == SCH_DIRECTIVE_LABEL_T)
|
||||
{
|
||||
return static_cast<SCH_TEXT*>( connected )->GetText();
|
||||
}
|
||||
|
||||
}
|
||||
return "";
|
||||
}
|
||||
|
||||
|
||||
EDA_ITEM* SCH_LINE::Clone() const
|
||||
{
|
||||
return new SCH_LINE( *this );
|
||||
|
||||
@@ -63,14 +63,6 @@ public:
|
||||
|
||||
wxString GetFriendlyName() const override;
|
||||
|
||||
/**
|
||||
* @brief This function travel though all the connected wire segments
|
||||
* to look for connected labels.
|
||||
* @param aSheet - the sheet where the current wire segment is located
|
||||
* @return returns the name of the wire if connected labels found, otherwise empty string
|
||||
*/
|
||||
wxString GetNetname(const SCH_SHEET_PATH &aSheet);
|
||||
|
||||
bool IsType( const std::vector<KICAD_T>& aScanTypes ) const override
|
||||
{
|
||||
if( SCH_ITEM::IsType( aScanTypes ) )
|
||||
|
||||
+15
-8
@@ -126,7 +126,8 @@ wxString SCH_PIN::GetShownNumber() const
|
||||
|
||||
ELECTRICAL_PINTYPE SCH_PIN::GetType() const
|
||||
{
|
||||
wxCHECK( m_libPin, ELECTRICAL_PINTYPE::PT_NC );
|
||||
if( !m_libPin )
|
||||
return ELECTRICAL_PINTYPE::PT_NC;
|
||||
|
||||
if( !m_alt.IsEmpty() )
|
||||
return m_libPin->GetAlt( m_alt ).m_Type;
|
||||
@@ -137,7 +138,8 @@ ELECTRICAL_PINTYPE SCH_PIN::GetType() const
|
||||
|
||||
GRAPHIC_PINSHAPE SCH_PIN::GetShape() const
|
||||
{
|
||||
wxCHECK( m_libPin, GRAPHIC_PINSHAPE::LINE );
|
||||
if( !m_libPin )
|
||||
return GRAPHIC_PINSHAPE::LINE;
|
||||
|
||||
if( !m_alt.IsEmpty() )
|
||||
return m_libPin->GetAlt( m_alt ).m_Shape;
|
||||
@@ -148,7 +150,8 @@ GRAPHIC_PINSHAPE SCH_PIN::GetShape() const
|
||||
|
||||
PIN_ORIENTATION SCH_PIN::GetOrientation() const
|
||||
{
|
||||
wxCHECK( m_libPin, PIN_ORIENTATION::PIN_RIGHT );
|
||||
if( !m_libPin )
|
||||
return PIN_ORIENTATION::PIN_RIGHT;
|
||||
|
||||
return m_libPin->GetOrientation();
|
||||
}
|
||||
@@ -156,7 +159,8 @@ PIN_ORIENTATION SCH_PIN::GetOrientation() const
|
||||
|
||||
int SCH_PIN::GetLength() const
|
||||
{
|
||||
wxCHECK( m_libPin, 0 );
|
||||
if( !m_libPin )
|
||||
return 0;
|
||||
|
||||
return m_libPin->GetLength();
|
||||
}
|
||||
@@ -301,7 +305,8 @@ bool SCH_PIN::IsStacked( const SCH_PIN* aPin ) const
|
||||
|
||||
bool SCH_PIN::IsGlobalPower() const
|
||||
{
|
||||
wxCHECK( m_libPin, false );
|
||||
if( !m_libPin )
|
||||
return false;
|
||||
|
||||
return m_libPin->IsGlobalPower();
|
||||
}
|
||||
@@ -425,8 +430,6 @@ const BOX2I SCH_PIN::GetBoundingBox( bool aIncludeInvisiblePins, bool aIncludeNa
|
||||
if( m_libPin )
|
||||
r = m_libPin->GetBoundingBox( aIncludeInvisiblePins, aIncludeNameAndNumber,
|
||||
aIncludeElectricalType );
|
||||
else
|
||||
wxFAIL;
|
||||
|
||||
r.RevertYAxis();
|
||||
|
||||
@@ -491,7 +494,8 @@ bool SCH_PIN::HasConnectivityChanges( const SCH_ITEM* aItem,
|
||||
|
||||
bool SCH_PIN::ConnectionPropagatesTo( const EDA_ITEM* aItem ) const
|
||||
{
|
||||
wxCHECK( m_libPin, false );
|
||||
if( !m_libPin )
|
||||
return false;
|
||||
|
||||
// Reciprocal checking is done in CONNECTION_GRAPH anyway
|
||||
return !( m_libPin->GetType() == ELECTRICAL_PINTYPE::PT_NC );
|
||||
@@ -511,6 +515,9 @@ bool SCH_PIN::operator==( const SCH_ITEM& aOther ) const
|
||||
if( m_position != other.m_position )
|
||||
return false;
|
||||
|
||||
if( !m_libPin )
|
||||
return false;
|
||||
|
||||
return m_libPin == other.m_libPin;
|
||||
}
|
||||
|
||||
|
||||
@@ -34,6 +34,8 @@
|
||||
#include <sch_shape.h>
|
||||
#include "plotters/plotter.h"
|
||||
|
||||
// This is a horribly fix for a link issue
|
||||
extern template class wxAnyValueTypeImpl<FILL_T>;
|
||||
|
||||
SCH_SHAPE::SCH_SHAPE( SHAPE_T aShape, int aLineWidth, FILL_T aFillType, KICAD_T aType ) :
|
||||
SCH_ITEM( nullptr, aType ),
|
||||
@@ -66,6 +68,17 @@ void SCH_SHAPE::SetStroke( const STROKE_PARAMS& aStroke )
|
||||
}
|
||||
|
||||
|
||||
void SCH_SHAPE::SetFilled( bool aFilled )
|
||||
{
|
||||
if( !aFilled )
|
||||
m_fill = FILL_T::NO_FILL;
|
||||
else if( GetParent()->IsType( { SCH_SYMBOL_T, LIB_SYMBOL_T } ) )
|
||||
m_fill = FILL_T::FILLED_SHAPE;
|
||||
else
|
||||
m_fill = FILL_T::FILLED_WITH_COLOR;
|
||||
}
|
||||
|
||||
|
||||
void SCH_SHAPE::Move( const VECTOR2I& aOffset )
|
||||
{
|
||||
move( aOffset );
|
||||
@@ -550,9 +563,55 @@ static struct SCH_SHAPE_DESC
|
||||
return false;
|
||||
};
|
||||
|
||||
auto isSymbolItem =
|
||||
[]( INSPECTABLE* aItem ) -> bool
|
||||
{
|
||||
if( SCH_SHAPE* shape = dynamic_cast<SCH_SHAPE*>( aItem ) )
|
||||
return shape->GetLayer() == LAYER_DEVICE;
|
||||
|
||||
return false;
|
||||
};
|
||||
|
||||
auto isSchematicItem =
|
||||
[]( INSPECTABLE* aItem ) -> bool
|
||||
{
|
||||
if( SCH_SHAPE* shape = dynamic_cast<SCH_SHAPE*>( aItem ) )
|
||||
return shape->GetLayer() != LAYER_DEVICE;
|
||||
|
||||
return false;
|
||||
};
|
||||
|
||||
auto isFillColorEditable =
|
||||
[]( INSPECTABLE* aItem ) -> bool
|
||||
{
|
||||
if( SCH_SHAPE* shape = dynamic_cast<SCH_SHAPE*>( aItem ) )
|
||||
{
|
||||
if( shape->GetParent()->IsType( { SCH_SYMBOL_T, LIB_SYMBOL_T } ) )
|
||||
return shape->GetFillMode() == FILL_T::FILLED_WITH_COLOR;
|
||||
else
|
||||
return shape->IsFilled();
|
||||
}
|
||||
|
||||
return true;
|
||||
};
|
||||
|
||||
propMgr.OverrideAvailability( TYPE_HASH( SCH_SHAPE ), TYPE_HASH( SCH_ITEM ),
|
||||
_HKI( "Position X" ), isPolygon );
|
||||
propMgr.OverrideAvailability( TYPE_HASH( SCH_SHAPE ), TYPE_HASH( SCH_ITEM ),
|
||||
_HKI( "Position Y" ), isPolygon );
|
||||
|
||||
propMgr.OverrideAvailability( TYPE_HASH( SCH_SHAPE ), TYPE_HASH( EDA_SHAPE ),
|
||||
_HKI( "Filled" ), isSchematicItem );
|
||||
|
||||
propMgr.OverrideWriteability( TYPE_HASH( SCH_SHAPE ), TYPE_HASH( EDA_SHAPE ),
|
||||
_HKI( "Fill Color" ), isFillColorEditable );
|
||||
|
||||
void ( SCH_SHAPE::*fillModeSetter )( FILL_T ) = &SCH_SHAPE::SetFillMode;
|
||||
FILL_T ( SCH_SHAPE::*fillModeGetter )() const = &SCH_SHAPE::GetFillMode;
|
||||
|
||||
propMgr.AddProperty( new PROPERTY_ENUM<SCH_SHAPE, FILL_T>( _HKI( "Fill" ),
|
||||
fillModeSetter, fillModeGetter ),
|
||||
_HKI( "Shape Properties" ) )
|
||||
.SetAvailableFunc( isSymbolItem );
|
||||
}
|
||||
} _SCH_SHAPE_DESC;
|
||||
|
||||
@@ -72,6 +72,8 @@ public:
|
||||
return m_stroke.GetLineStyle();
|
||||
}
|
||||
|
||||
void SetFilled( bool aFilled ) override;
|
||||
|
||||
const BOX2I GetBoundingBox() const override { return getBoundingBox(); }
|
||||
|
||||
VECTOR2I GetPosition() const override { return getPosition(); }
|
||||
|
||||
@@ -656,9 +656,13 @@ void SCH_SHEET_PATH::CheckForMissingSymbolInstances( const wxString& aProjectNam
|
||||
{
|
||||
symbolInstance.m_Reference =
|
||||
symbol->GetField( REFERENCE_FIELD )->GetShownText( this, true );
|
||||
symbolInstance.m_Unit = symbol->GetUnit();
|
||||
}
|
||||
else
|
||||
{
|
||||
// When schematics are shared, we cannot know which instance the current symbol
|
||||
// reference field and unit belong to. In this case, we clear the reference
|
||||
// annotation and set the unit to 1.
|
||||
symbolInstance.m_Reference = UTIL::GetRefDesUnannotated( symbol->GetPrefix() );
|
||||
}
|
||||
|
||||
|
||||
@@ -2177,12 +2177,12 @@ bool SCH_SYMBOL::UpdateDanglingState( std::vector<DANGLING_END_ITEM>& aItemListB
|
||||
}
|
||||
|
||||
|
||||
VECTOR2I SCH_SYMBOL::GetPinPhysicalPosition( const LIB_PIN* Pin ) const
|
||||
VECTOR2I SCH_SYMBOL::GetPinPhysicalPosition( const LIB_PIN* aPin ) const
|
||||
{
|
||||
wxCHECK_MSG( Pin != nullptr && Pin->Type() == LIB_PIN_T, VECTOR2I( 0, 0 ),
|
||||
wxT( "Cannot get physical position of pin." ) );
|
||||
if( ( aPin == nullptr ) || ( aPin->Type() != LIB_PIN_T ) )
|
||||
return VECTOR2I( 0, 0 );
|
||||
|
||||
return m_transform.TransformCoordinate( Pin->GetPosition() ) + m_pos;
|
||||
return m_transform.TransformCoordinate( aPin->GetPosition() ) + m_pos;
|
||||
}
|
||||
|
||||
|
||||
@@ -2699,7 +2699,8 @@ bool SCH_SYMBOL::IsSymbolLikePowerGlobalLabel() const
|
||||
|
||||
bool SCH_SYMBOL::IsPower() const
|
||||
{
|
||||
wxCHECK( m_part, false );
|
||||
if( !m_part )
|
||||
return false;
|
||||
|
||||
return m_part->IsPower();
|
||||
}
|
||||
|
||||
@@ -113,16 +113,7 @@ std::string SPICE_GENERATOR_RAW_SPICE::ItemParams() const
|
||||
|
||||
std::string SPICE_GENERATOR_RAW_SPICE::Preview( const SPICE_ITEM& aItem ) const
|
||||
{
|
||||
SPICE_ITEM item = aItem;
|
||||
item.refName = "";
|
||||
|
||||
for( int i = 0; i < m_model.GetPinCount(); ++i )
|
||||
{
|
||||
item.pinNumbers.push_back( fmt::format( "{}", i + 1 ) );
|
||||
item.pinNetNames.push_back( fmt::format( "{}", i + 1 ) );
|
||||
}
|
||||
|
||||
return ItemLine( item );
|
||||
return ItemParams();
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -1759,26 +1759,35 @@ void SIMULATOR_FRAME_UI::updateSignalsGrid()
|
||||
{
|
||||
m_signalsGrid->SetCellValue( row, COL_SIGNAL_SHOW, wxS( "1" ) );
|
||||
|
||||
wxGridCellAttr* attr = new wxGridCellAttr;
|
||||
attr->SetRenderer( new GRID_CELL_COLOR_RENDERER( this ) );
|
||||
attr->SetEditor( new GRID_CELL_COLOR_SELECTOR( this, m_signalsGrid ) );
|
||||
wxGridCellAttrPtr attr = m_signalsGrid->GetOrCreateCellAttrPtr( row, COL_SIGNAL_COLOR );
|
||||
|
||||
if( !attr->HasRenderer() )
|
||||
attr->SetRenderer( new GRID_CELL_COLOR_RENDERER( this ) );
|
||||
|
||||
if( !attr->HasEditor() )
|
||||
attr->SetEditor( new GRID_CELL_COLOR_SELECTOR( this, m_signalsGrid ) );
|
||||
|
||||
attr->SetAlignment( wxALIGN_CENTER, wxALIGN_CENTER );
|
||||
m_signalsGrid->SetAttr( row, COL_SIGNAL_COLOR, attr );
|
||||
attr->SetReadOnly( false );
|
||||
|
||||
KIGFX::COLOR4D color( trace->GetPen().GetColour() );
|
||||
m_signalsGrid->SetCellValue( row, COL_SIGNAL_COLOR, color.ToCSSString() );
|
||||
|
||||
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_1, attr );
|
||||
attr = m_signalsGrid->GetOrCreateCellAttrPtr( row, COL_CURSOR_1 );
|
||||
|
||||
if( !attr->HasRenderer() )
|
||||
attr->SetRenderer( new wxGridCellBoolRenderer() );
|
||||
|
||||
attr->SetReadOnly(); // not really; we delegate interactivity to GRID_TRICKS
|
||||
attr->SetAlignment( wxALIGN_CENTER, wxALIGN_CENTER );
|
||||
|
||||
attr = m_signalsGrid->GetOrCreateCellAttrPtr( row, COL_CURSOR_2 );
|
||||
|
||||
if( !attr->HasRenderer() )
|
||||
attr->SetRenderer( new wxGridCellBoolRenderer() );
|
||||
|
||||
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 );
|
||||
|
||||
if( trace->HasCursor( 1 ) )
|
||||
m_signalsGrid->SetCellValue( row, COL_CURSOR_1, wxS( "1" ) );
|
||||
@@ -1794,19 +1803,22 @@ void SIMULATOR_FRAME_UI::updateSignalsGrid()
|
||||
{
|
||||
m_signalsGrid->SetCellValue( row, COL_SIGNAL_SHOW, wxEmptyString );
|
||||
|
||||
wxGridCellAttr* attr = new wxGridCellAttr;
|
||||
wxGridCellAttrPtr attr = m_signalsGrid->GetOrCreateCellAttrPtr( row, COL_SIGNAL_COLOR );
|
||||
attr->SetEditor( nullptr );
|
||||
attr->SetRenderer( nullptr );
|
||||
attr->SetReadOnly();
|
||||
m_signalsGrid->SetAttr( row, COL_SIGNAL_COLOR, attr );
|
||||
m_signalsGrid->SetCellValue( row, COL_SIGNAL_COLOR, wxEmptyString );
|
||||
|
||||
attr = new wxGridCellAttr;
|
||||
attr = m_signalsGrid->GetOrCreateCellAttrPtr( row, COL_CURSOR_1 );
|
||||
attr->SetEditor( nullptr );
|
||||
attr->SetRenderer( nullptr );
|
||||
attr->SetReadOnly();
|
||||
m_signalsGrid->SetAttr( row, COL_CURSOR_1, attr );
|
||||
m_signalsGrid->SetCellValue( row, COL_CURSOR_1, wxEmptyString );
|
||||
|
||||
attr = new wxGridCellAttr;
|
||||
attr = m_signalsGrid->GetOrCreateCellAttrPtr( row, COL_CURSOR_2 );
|
||||
attr->SetEditor( nullptr );
|
||||
attr->SetRenderer( nullptr );
|
||||
attr->SetReadOnly();
|
||||
m_signalsGrid->SetAttr( row, COL_CURSOR_2, attr );
|
||||
m_signalsGrid->SetCellValue( row, COL_CURSOR_2, wxEmptyString );
|
||||
}
|
||||
}
|
||||
|
||||
@@ -137,7 +137,9 @@ wxArrayString SYMBOL_LIBRARY_MANAGER::GetLibraryNames() const
|
||||
for( const wxString& libName : symTable()->GetLogicalLibs() )
|
||||
{
|
||||
// Database libraries are hidden from the symbol editor at the moment
|
||||
if( GetLibrary( libName )->SchLibType() == SCH_IO_MGR::SCH_DATABASE )
|
||||
SYMBOL_LIB_TABLE_ROW* row = GetLibrary( libName );
|
||||
|
||||
if( !row || row->SchLibType() == SCH_IO_MGR::SCH_DATABASE )
|
||||
continue;
|
||||
|
||||
res.Add( libName );
|
||||
|
||||
@@ -308,13 +308,8 @@ int SCH_DRAWING_TOOLS::PlaceSymbol( const TOOL_EVENT& aEvent )
|
||||
SYMBOL_LIB_TABLE* libs = PROJECT_SCH::SchSymbolLibTable( &m_frame->Prj() );
|
||||
SYMBOL_LIB* cache = PROJECT_SCH::SchLibs( &m_frame->Prj() )->GetCacheLibrary();
|
||||
|
||||
auto compareByLibID =
|
||||
[]( const LIB_SYMBOL* aFirst, const LIB_SYMBOL* aSecond ) -> bool
|
||||
{
|
||||
return aFirst->LibId().Format() < aSecond->LibId().Format();
|
||||
};
|
||||
|
||||
std::set<LIB_SYMBOL*, decltype( compareByLibID )> part_list( compareByLibID );
|
||||
std::set<UTF8> unique_libid;
|
||||
std::vector<PICKED_SYMBOL> alreadyPlaced;
|
||||
|
||||
for( SCH_SHEET_PATH& sheet : sheets )
|
||||
{
|
||||
@@ -324,22 +319,21 @@ int SCH_DRAWING_TOOLS::PlaceSymbol( const TOOL_EVENT& aEvent )
|
||||
continue;
|
||||
|
||||
SCH_SYMBOL* s = static_cast<SCH_SYMBOL*>( item );
|
||||
|
||||
if( !unique_libid.insert( s->GetLibId().Format() ).second )
|
||||
continue;
|
||||
|
||||
LIB_SYMBOL* libSymbol = SchGetLibSymbol( s->GetLibId(), libs, cache );
|
||||
|
||||
if( libSymbol )
|
||||
part_list.insert( libSymbol );
|
||||
{
|
||||
PICKED_SYMBOL pickedSymbol;
|
||||
pickedSymbol.LibId = libSymbol->GetLibId();
|
||||
alreadyPlaced.push_back( pickedSymbol );
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
std::vector<PICKED_SYMBOL> alreadyPlaced;
|
||||
|
||||
for( LIB_SYMBOL* libSymbol : part_list )
|
||||
{
|
||||
PICKED_SYMBOL pickedSymbol;
|
||||
pickedSymbol.LibId = libSymbol->GetLibId();
|
||||
alreadyPlaced.push_back( pickedSymbol );
|
||||
}
|
||||
|
||||
// Pick the symbol to be placed
|
||||
bool footprintPreviews = m_frame->eeconfig()->m_Appearance.footprint_preview;
|
||||
PICKED_SYMBOL sel = m_frame->PickSymbolFromLibrary( &filter, *historyList,
|
||||
@@ -1190,6 +1184,24 @@ SCH_LINE* SCH_DRAWING_TOOLS::findWire( const VECTOR2I& aPosition )
|
||||
}
|
||||
|
||||
|
||||
wxString SCH_DRAWING_TOOLS::findWireLabelDriverName( SCH_LINE* aWire )
|
||||
{
|
||||
wxASSERT( aWire->IsWire() );
|
||||
|
||||
SCH_SHEET_PATH sheetPath = m_frame->GetCurrentSheet();
|
||||
|
||||
if( SCH_CONNECTION* wireConnection = aWire->Connection( &sheetPath ) )
|
||||
{
|
||||
SCH_ITEM* wireDriver = wireConnection->Driver();
|
||||
|
||||
if( wireDriver && wireDriver->IsType( { SCH_LABEL_T, SCH_GLOBAL_LABEL_T } ) )
|
||||
return wireConnection->LocalName();
|
||||
}
|
||||
|
||||
return wxEmptyString;
|
||||
}
|
||||
|
||||
|
||||
SCH_TEXT* SCH_DRAWING_TOOLS::createNewText( const VECTOR2I& aPosition, int aType )
|
||||
{
|
||||
SCHEMATIC* schematic = getModel<SCHEMATIC>();
|
||||
@@ -1209,7 +1221,7 @@ SCH_TEXT* SCH_DRAWING_TOOLS::createNewText( const VECTOR2I& aPosition, int aType
|
||||
textItem = labelItem;
|
||||
|
||||
if( SCH_LINE* wire = findWire( aPosition ) )
|
||||
netName = wire->GetNetname( m_frame->GetCurrentSheet() );
|
||||
netName = findWireLabelDriverName( wire );
|
||||
|
||||
break;
|
||||
|
||||
@@ -1237,7 +1249,7 @@ SCH_TEXT* SCH_DRAWING_TOOLS::createNewText( const VECTOR2I& aPosition, int aType
|
||||
textItem = labelItem;
|
||||
|
||||
if( SCH_LINE* wire = findWire( aPosition ) )
|
||||
netName = wire->GetNetname( m_frame->GetCurrentSheet() );
|
||||
netName = findWireLabelDriverName( wire );
|
||||
|
||||
break;
|
||||
|
||||
@@ -2167,7 +2179,6 @@ int SCH_DRAWING_TOOLS::DrawSheet( const TOOL_EVENT& aEvent )
|
||||
SCH_SHEET_PATH newPath = m_frame->GetCurrentSheet();
|
||||
newPath.push_back( sheet );
|
||||
|
||||
m_frame->UpdateHierarchyNavigator();
|
||||
m_selectionTool->AddItemToSel( sheet );
|
||||
}
|
||||
else
|
||||
|
||||
@@ -60,6 +60,9 @@ public:
|
||||
private:
|
||||
SCH_LINE* findWire( const VECTOR2I& aPosition );
|
||||
|
||||
///< Gets the (global) label name driving this wire, if it is driven by a label
|
||||
wxString findWireLabelDriverName( SCH_LINE* aWire );
|
||||
|
||||
SCH_TEXT* createNewText( const VECTOR2I& aPosition, int aType );
|
||||
|
||||
SCH_HIERLABEL* importHierLabel( SCH_SHEET* aSheet );
|
||||
|
||||
@@ -298,6 +298,12 @@ int SCH_FIND_REPLACE_TOOL::FindNext( const TOOL_EVENT& aEvent )
|
||||
{
|
||||
m_afterItem = item;
|
||||
|
||||
if( !selectedOnly )
|
||||
{
|
||||
m_selectionTool->ClearSelection();
|
||||
m_selectionTool->AddItemToSel( item );
|
||||
}
|
||||
|
||||
if( !item->IsBrightened() )
|
||||
{
|
||||
// Clear any previous brightening
|
||||
@@ -309,12 +315,6 @@ int SCH_FIND_REPLACE_TOOL::FindNext( const TOOL_EVENT& aEvent )
|
||||
m_foundItemHighlighted = true;
|
||||
}
|
||||
|
||||
if( !selectedOnly )
|
||||
{
|
||||
m_selectionTool->ClearSelection();
|
||||
m_selectionTool->AddItemToSel( item );
|
||||
}
|
||||
|
||||
m_frame->FocusOnLocation( item->GetBoundingBox().GetCenter() );
|
||||
m_frame->GetCanvas()->Refresh();
|
||||
}
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
* This program source code file is part of KiCad, a free EDA CAD application.
|
||||
*
|
||||
* Copyright (C) 2019 CERN
|
||||
* 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
|
||||
@@ -42,8 +42,12 @@ void SCH_NAVIGATE_TOOL::ResetHistory()
|
||||
|
||||
void SCH_NAVIGATE_TOOL::CleanHistory()
|
||||
{
|
||||
wxCHECK( m_frame, /* void */ );
|
||||
|
||||
SCH_SHEET_LIST sheets = m_frame->Schematic().GetSheets();
|
||||
|
||||
wxCHECK( !sheets.empty(), /* void */ );
|
||||
|
||||
// Search through our history, and removing any entries
|
||||
// that the no longer point to a sheet on the schematic
|
||||
auto entry = m_navHistory.begin();
|
||||
@@ -51,10 +55,23 @@ void SCH_NAVIGATE_TOOL::CleanHistory()
|
||||
while( entry != m_navHistory.end() )
|
||||
{
|
||||
if( std::find( sheets.begin(), sheets.end(), *entry ) != sheets.end() )
|
||||
++entry;
|
||||
{
|
||||
// Don't allow multiple consecutive instances of the same history.
|
||||
if( ( entry != m_navHistory.begin() ) && ( *entry == *std::prev( entry ) ) )
|
||||
entry = m_navHistory.erase( entry );
|
||||
else
|
||||
++entry;
|
||||
}
|
||||
else
|
||||
{
|
||||
entry = m_navHistory.erase( entry );
|
||||
}
|
||||
}
|
||||
|
||||
if( m_navHistory.size() <= 1 )
|
||||
m_navIndex = m_navHistory.begin();
|
||||
else
|
||||
m_navIndex = --m_navHistory.end();
|
||||
}
|
||||
|
||||
|
||||
@@ -271,7 +288,9 @@ void SCH_NAVIGATE_TOOL::pushToHistory( SCH_SHEET_PATH aPath )
|
||||
if( CanGoForward() )
|
||||
m_navHistory.erase( std::next( m_navIndex ), m_navHistory.end() );
|
||||
|
||||
m_navHistory.push_back( aPath );
|
||||
if( m_navHistory.empty() || ( *(--m_navHistory.end()) != aPath ) )
|
||||
m_navHistory.push_back( aPath );
|
||||
|
||||
m_navIndex = --m_navHistory.end();
|
||||
}
|
||||
|
||||
|
||||
@@ -818,8 +818,16 @@ int SYMBOL_EDITOR_EDIT_TOOL::Paste( const TOOL_EVENT& aEvent )
|
||||
{
|
||||
// If it's not a symbol then paste as text
|
||||
newPart = new LIB_SYMBOL( "dummy_part" );
|
||||
|
||||
wxString pasteText( clipboardData );
|
||||
|
||||
// Limit of 5000 is totally arbitrary. Without a limit, pasting a bitmap image from
|
||||
// eeschema makes KiCad appear to hang.
|
||||
if( pasteText.Length() > 5000 )
|
||||
pasteText = pasteText.Left( 5000 ) + wxT( "..." );
|
||||
|
||||
LIB_TEXT* newText = new LIB_TEXT( newPart );
|
||||
newText->SetText( clipboardData );
|
||||
newText->SetText( pasteText );
|
||||
newPart->AddDrawItem( newText );
|
||||
}
|
||||
|
||||
|
||||
@@ -224,6 +224,7 @@ void HIERARCHY_PANE::UpdateHierarchyTree()
|
||||
m_events_bound = false;
|
||||
}
|
||||
|
||||
SCH_SHEET_LIST hierarchy = m_frame->Schematic().GetUnorderedSheets();
|
||||
std::set<SCH_SHEET_PATH> expandedNodes;
|
||||
|
||||
std::function<void( const wxTreeItemId& )> getExpandedNodes =
|
||||
@@ -233,7 +234,7 @@ void HIERARCHY_PANE::UpdateHierarchyTree()
|
||||
|
||||
TREE_ITEM_DATA* itemData = static_cast<TREE_ITEM_DATA*>( m_tree->GetItemData( id ) );
|
||||
|
||||
if( m_tree->IsExpanded( id ) )
|
||||
if( m_tree->IsExpanded( id ) && hierarchy.HasPath( itemData->m_SheetPath.Path() ) )
|
||||
expandedNodes.emplace( itemData->m_SheetPath );
|
||||
|
||||
wxTreeItemIdValue cookie;
|
||||
|
||||
@@ -147,9 +147,7 @@ target_link_libraries( gerbview_kiface_objects
|
||||
message( STATUS "Including 3Dconnexion SpaceMouse navigation support in gerbview" )
|
||||
add_subdirectory( navlib )
|
||||
|
||||
if( NOT MINGW )
|
||||
target_link_libraries( gerbview_kiface_objects PUBLIC gerbview_navlib)
|
||||
endif()
|
||||
target_link_libraries( gerbview_kiface_objects PUBLIC gerbview_navlib)
|
||||
|
||||
add_dependencies( gerbview_kiface_objects gerbview_navlib )
|
||||
|
||||
|
||||
@@ -77,7 +77,7 @@ class BOARD_ITEM : public EDA_ITEM
|
||||
{
|
||||
public:
|
||||
BOARD_ITEM( BOARD_ITEM* aParent, KICAD_T idtype, PCB_LAYER_ID aLayer = F_Cu ) :
|
||||
EDA_ITEM( aParent, idtype ),
|
||||
EDA_ITEM( aParent, idtype, false, true ),
|
||||
m_layer( aLayer ),
|
||||
m_isKnockout( false ),
|
||||
m_isLocked( false ),
|
||||
|
||||
+12
-1
@@ -2,7 +2,7 @@
|
||||
* This program source code file is part of KiCad, a free EDA CAD application.
|
||||
*
|
||||
* Copyright (C) 2012 SoftPLC Corporation, Dick Hollenbeck <dick@softplc.com>
|
||||
* Copyright (C) 2012-2019 KiCad Developers, see AUTHORS.txt for contributors.
|
||||
* Copyright (C) 2012-2019, 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
|
||||
@@ -99,6 +99,8 @@ public:
|
||||
m_initialFocusTarget = aWindow;
|
||||
}
|
||||
|
||||
int ShowModal() override;
|
||||
|
||||
int ShowQuasiModal(); // disable only the parent window, otherwise modal.
|
||||
|
||||
void EndQuasiModal( int retCode ); // End quasi-modal mode
|
||||
@@ -183,6 +185,15 @@ protected:
|
||||
|
||||
virtual void OnCharHook( wxKeyEvent& aEvt );
|
||||
|
||||
/**
|
||||
* Override this method to perform dialog tear down actions not suitable for object dtor.
|
||||
*
|
||||
* @warning This only gets called for dialogs that are shown in the quasimodal mode. If
|
||||
* you need to perform tear down actions in modal or modeless dialogs, create
|
||||
* a close window event handler.
|
||||
*/
|
||||
virtual void TearDownQuasiModal() {}
|
||||
|
||||
private:
|
||||
/**
|
||||
* Properly handle the wxCloseEvent when in the quasimodal mode when not calling
|
||||
|
||||
+2
-2
@@ -463,8 +463,8 @@ public:
|
||||
#endif
|
||||
|
||||
protected:
|
||||
EDA_ITEM( EDA_ITEM* parent, KICAD_T idType );
|
||||
EDA_ITEM( KICAD_T idType );
|
||||
EDA_ITEM( EDA_ITEM* parent, KICAD_T idType, bool isSCH_ITEM = false, bool isBOARD_ITEM = false );
|
||||
EDA_ITEM( KICAD_T idType, bool isSCH_ITEM = false, bool isBOARD_ITEM = false );
|
||||
EDA_ITEM( const EDA_ITEM& base );
|
||||
|
||||
/**
|
||||
|
||||
+5
-1
@@ -92,7 +92,7 @@ public:
|
||||
return GetFillMode() != FILL_T::NO_FILL;
|
||||
}
|
||||
|
||||
void SetFilled( bool aFlag )
|
||||
virtual void SetFilled( bool aFlag )
|
||||
{
|
||||
setFilled( aFlag );
|
||||
}
|
||||
@@ -323,6 +323,10 @@ public:
|
||||
|
||||
void SetLength( const double& aLength );
|
||||
|
||||
void SetRectangleHeight( const int& aHeight );
|
||||
|
||||
void SetRectangleWidth( const int& aWidth );
|
||||
|
||||
void SetRectangle( const long long int& aHeight, const long long int& aWidth );
|
||||
|
||||
void SetSegmentAngle( const EDA_ANGLE& aAngle );
|
||||
|
||||
@@ -46,7 +46,6 @@ class EDA_LIST_DIALOG;
|
||||
* @return true is success or false if no PDF viewer found.
|
||||
*/
|
||||
bool OpenPDF( const wxString& file );
|
||||
void OpenFile( const wxString& file );
|
||||
|
||||
/**
|
||||
* @param aSrcPath is the full filename of the source.
|
||||
|
||||
@@ -113,6 +113,11 @@ public:
|
||||
*/
|
||||
bool HitTestMarker( const VECTOR2I& aHitPosition, int aAccuracy ) const;
|
||||
|
||||
/**
|
||||
* Test if the given BOX2I intersects or contains the bounds of this object
|
||||
*/
|
||||
bool HitTestMarker( const BOX2I& aRect, bool aContained, int aAccuracy = 0 ) const;
|
||||
|
||||
/**
|
||||
* Return the orthogonal, bounding box of this object for display purposes.
|
||||
*
|
||||
|
||||
@@ -709,7 +709,7 @@ private:
|
||||
std::unordered_map<wxString, T> m_reverseMap;
|
||||
T m_undefined; // Returned if the string is not recognized
|
||||
|
||||
ENUM_MAP<T>()
|
||||
ENUM_MAP()
|
||||
{
|
||||
}
|
||||
};
|
||||
|
||||
@@ -102,7 +102,7 @@ public:
|
||||
size_t typeHash = typeid( T ).hash_code();
|
||||
|
||||
if( m_app_settings_cache.count( typeHash ) )
|
||||
ret = dynamic_cast<T*>( m_app_settings_cache.at( typeHash ) );
|
||||
ret = static_cast<T*>( m_app_settings_cache.at( typeHash ) );
|
||||
|
||||
if( ret )
|
||||
return ret;
|
||||
@@ -127,6 +127,42 @@ public:
|
||||
return ret;
|
||||
}
|
||||
|
||||
template<typename T>
|
||||
T* GetAppSettings( const wxString& aFilename )
|
||||
{
|
||||
#ifndef __WXMAC__
|
||||
return GetAppSettings<T>();
|
||||
#endif
|
||||
|
||||
T* ret = nullptr;
|
||||
size_t typeHash = typeid( T ).hash_code();
|
||||
|
||||
if( m_app_settings_cache.count( typeHash ) )
|
||||
ret = static_cast<T*>( m_app_settings_cache.at( typeHash ) );
|
||||
|
||||
if( ret )
|
||||
return ret;
|
||||
|
||||
auto it = std::find_if( m_settings.begin(), m_settings.end(),
|
||||
[&]( const std::unique_ptr<JSON_SETTINGS>& aSettings )
|
||||
{
|
||||
return aSettings->GetFilename() == aFilename;
|
||||
} );
|
||||
|
||||
if( it != m_settings.end() )
|
||||
{
|
||||
ret = static_cast<T*>( it->get() );
|
||||
}
|
||||
else
|
||||
{
|
||||
throw std::runtime_error( "Tried to GetAppSettings before registering" );
|
||||
}
|
||||
|
||||
m_app_settings_cache[typeHash] = ret;
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
/**
|
||||
* Retrieves a color settings object that applications can read colors from.
|
||||
* If the given settings file cannot be found, returns the default settings.
|
||||
|
||||
@@ -83,7 +83,9 @@ enum VIEW_VISIBILITY_FLAGS {
|
||||
class GAL_API VIEW_ITEM : public INSPECTABLE
|
||||
{
|
||||
public:
|
||||
VIEW_ITEM() :
|
||||
VIEW_ITEM( bool isSCH_ITEM = false, bool isBOARD_ITEM = false ) :
|
||||
m_isSCH_ITEM( isSCH_ITEM ),
|
||||
m_isBOARD_ITEM( isBOARD_ITEM ),
|
||||
m_viewPrivData( nullptr ),
|
||||
m_forcedTransparency( 0.0 )
|
||||
{
|
||||
@@ -94,6 +96,8 @@ public:
|
||||
VIEW_ITEM( const VIEW_ITEM& aOther ) = delete;
|
||||
VIEW_ITEM& operator=( const VIEW_ITEM& aOther ) = delete;
|
||||
|
||||
bool IsSCH_ITEM() const { return m_isSCH_ITEM; }
|
||||
bool IsBOARD_ITEM() const { return m_isBOARD_ITEM; }
|
||||
/**
|
||||
* Return the bounding box of the item covering all its layers.
|
||||
*
|
||||
@@ -162,6 +166,8 @@ public:
|
||||
private:
|
||||
friend class VIEW;
|
||||
|
||||
bool m_isSCH_ITEM;
|
||||
bool m_isBOARD_ITEM;
|
||||
VIEW_ITEM_DATA* m_viewPrivData;
|
||||
double m_forcedTransparency; ///< Additional transparency for diff'ing items.
|
||||
};
|
||||
|
||||
@@ -142,12 +142,6 @@ private:
|
||||
*/
|
||||
WIDGET_HOTKEY_CLIENT_DATA* getHKClientData( wxTreeListItem aItem );
|
||||
|
||||
/**
|
||||
* Get the WIDGET_HOTKEY_CLIENT_DATA form an item and assert if it isn't found. This is for
|
||||
* use when the data not being present indicates an error.
|
||||
*/
|
||||
WIDGET_HOTKEY_CLIENT_DATA* getExpectedHkClientData( wxTreeListItem aItem );
|
||||
|
||||
/**
|
||||
* Method updateFromClientData
|
||||
* Refresh the visible text on the widget from the rows' client data objects.
|
||||
|
||||
@@ -116,6 +116,7 @@ public:
|
||||
static const std::string BackupFileSuffix;
|
||||
static const std::string LockFilePrefix;
|
||||
static const std::string LockFileExtension;
|
||||
static const std::string AutoSaveFilePrefix;
|
||||
|
||||
static const std::string SchematicSymbolFileExtension;
|
||||
static const std::string LegacySymbolLibFileExtension;
|
||||
|
||||
@@ -222,19 +222,27 @@ void DIALOG_TEMPLATE_SELECTOR::buildPageContent( const wxString& aPath, int aPag
|
||||
}
|
||||
else
|
||||
{
|
||||
wxDir sub_dir;
|
||||
wxString sub_name;
|
||||
wxString sub_name;
|
||||
wxArrayString subdirs;
|
||||
|
||||
bool cont = dir.GetFirst( &sub_name, wxEmptyString, wxDIR_DIRS );
|
||||
|
||||
while( cont )
|
||||
{
|
||||
wxString sub_full = aPath + sub_name;
|
||||
subdirs.Add( wxString( sub_name ) );
|
||||
cont = dir.GetNext( &sub_name );
|
||||
}
|
||||
|
||||
if( !subdirs.IsEmpty() )
|
||||
subdirs.Sort();
|
||||
|
||||
for( const wxString& dir_name : subdirs )
|
||||
{
|
||||
wxDir sub_dir;
|
||||
wxString sub_full = aPath + dir_name;
|
||||
|
||||
if( sub_dir.Open( sub_full ) )
|
||||
AddTemplate( aPage, new PROJECT_TEMPLATE( sub_full ) );
|
||||
|
||||
cont = dir.GetNext( &sub_name );
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -109,7 +109,12 @@ void PANEL_KICAD_LAUNCHER::CreateLaunchers()
|
||||
|
||||
int row = m_toolsSizer->GetRows();
|
||||
|
||||
#if wxCHECK_VERSION( 3, 2, 6 )
|
||||
m_toolsSizer->Add( btn, wxGBPosition( row, 0 ), wxGBSpan( 2, 1 ) );
|
||||
#else
|
||||
// Work around the wxGridBagSizer gap bug in wx
|
||||
m_toolsSizer->Add( btn, wxGBPosition( row, 0 ), wxGBSpan( 2, 1 ), wxBOTTOM, 12 );
|
||||
#endif
|
||||
|
||||
// Due to https://trac.wxwidgets.org/ticket/16088?cversion=0&cnum_hist=7 GTK fails to
|
||||
// correctly set the BestSize of non-default-size or styled text so we need to make
|
||||
|
||||
@@ -1024,4 +1024,6 @@ void KICAD_MANAGER_FRAME::onToolbarSizeChanged()
|
||||
RecreateBaseHToolbar();
|
||||
m_auimgr.AddPane( m_mainToolBar, EDA_PANE().HToolbar().Name( "MainToolbar" ).Left()
|
||||
.Layer( 2 ) );
|
||||
|
||||
m_auimgr.Update();
|
||||
}
|
||||
|
||||
+18
-3
@@ -1094,6 +1094,22 @@ std::unordered_map<wxString, wxBitmap> PLUGIN_CONTENT_MANAGER::GetInstalledPacka
|
||||
}
|
||||
|
||||
|
||||
struct UPDATE_CANCELLER
|
||||
{
|
||||
UPDATE_CANCELLER( std::shared_ptr<BACKGROUND_JOB>& aJob ) : m_jobToCancel( aJob ) {};
|
||||
~UPDATE_CANCELLER()
|
||||
{
|
||||
if( m_jobToCancel )
|
||||
{
|
||||
Pgm().GetBackgroundJobMonitor().Remove( m_jobToCancel );
|
||||
m_jobToCancel.reset();
|
||||
}
|
||||
}
|
||||
|
||||
std::shared_ptr<BACKGROUND_JOB>& m_jobToCancel;
|
||||
};
|
||||
|
||||
|
||||
void PLUGIN_CONTENT_MANAGER::RunBackgroundUpdate()
|
||||
{
|
||||
// If the thread is already running don't create it again
|
||||
@@ -1106,6 +1122,8 @@ void PLUGIN_CONTENT_MANAGER::RunBackgroundUpdate()
|
||||
m_updateThread = std::thread(
|
||||
[this]()
|
||||
{
|
||||
UPDATE_CANCELLER canceller( m_updateBackgroundJob );
|
||||
|
||||
if( m_installed.size() == 0 )
|
||||
return;
|
||||
|
||||
@@ -1162,9 +1180,6 @@ void PLUGIN_CONTENT_MANAGER::RunBackgroundUpdate()
|
||||
return;
|
||||
}
|
||||
|
||||
Pgm().GetBackgroundJobMonitor().Remove( m_updateBackgroundJob );
|
||||
m_updateBackgroundJob = nullptr;
|
||||
|
||||
// Update the badge on PCM button
|
||||
m_availableUpdateCallback( availableUpdateCount );
|
||||
} );
|
||||
|
||||
@@ -273,7 +273,7 @@
|
||||
},
|
||||
"update_time_utc": {
|
||||
"type": "string",
|
||||
"description": "Human readabla update time in UTC YYYY-MM-DD HH:MM:SS format",
|
||||
"description": "Human readable update time in UTC YYYY-MM-DD HH:MM:SS format",
|
||||
"pattern": "^2\\d\\d\\d-\\d\\d-\\d\\d \\d\\d:\\d\\d:\\d\\d$"
|
||||
}
|
||||
},
|
||||
|
||||
+19
-12
@@ -85,7 +85,8 @@ public:
|
||||
wxString path( fn.GetPathWithSep() );
|
||||
|
||||
bool exclude = fn.GetName().Contains( "fp-info-cache" )
|
||||
|| fn.GetName().StartsWith( "_autosave-" ) || fn.GetExt().Contains( "lck" );
|
||||
|| fn.GetName().StartsWith( FILEEXT::AutoSaveFilePrefix )
|
||||
|| fn.GetName().StartsWith( FILEEXT::LockFilePrefix );
|
||||
|
||||
if( !exclude )
|
||||
m_files.emplace_back( wxFileName( filename ) );
|
||||
@@ -254,10 +255,10 @@ bool PROJECT_TEMPLATE::CreateProject( wxFileName& aNewProjectPath, wxString* aEr
|
||||
{
|
||||
currname.Replace( basename, aNewProjectPath.GetName() );
|
||||
}
|
||||
else if( destFile.GetExt() == "dcm"
|
||||
|| destFile.GetExt() == "lib"
|
||||
// Footprint libraries are directories not files, so GetExt() won't work
|
||||
|| destFile.GetPath().EndsWith( ".pretty" ) )
|
||||
else if( destFile.GetExt() == FILEEXT::LegacySymbolDocumentFileExtension
|
||||
|| destFile.GetExt() == FILEEXT::LegacySymbolLibFileExtension
|
||||
// Footprint libraries are directories not files, so GetExt() won't work
|
||||
|| destFile.GetPath().EndsWith( '.' + FILEEXT::KiCadFootprintLibPathExtension ) )
|
||||
{
|
||||
// Don't rename project-specific libraries. This will break the library tables and
|
||||
// cause broken links in the schematic/pcb.
|
||||
@@ -329,6 +330,7 @@ wxString* PROJECT_TEMPLATE::GetTitle()
|
||||
int start = 0;
|
||||
int finish = 0;
|
||||
bool done = false;
|
||||
bool hasStart = false;
|
||||
|
||||
while( input.IsOk() && !input.Eof() && !done )
|
||||
{
|
||||
@@ -345,27 +347,32 @@ wxString* PROJECT_TEMPLATE::GetTitle()
|
||||
if( finish != wxNOT_FOUND )
|
||||
{
|
||||
m_title = line( start + 7, length );
|
||||
done = true;
|
||||
}
|
||||
else
|
||||
{
|
||||
m_title = line.Mid( start + 7 );
|
||||
hasStart = true;
|
||||
}
|
||||
|
||||
done = true;
|
||||
}
|
||||
else
|
||||
{
|
||||
if( finish != wxNOT_FOUND )
|
||||
{
|
||||
m_title += line.SubString( 0, finish );
|
||||
m_title += line.SubString( 0, finish - 1 );
|
||||
done = true;
|
||||
}
|
||||
else if( hasStart )
|
||||
m_title += line;
|
||||
}
|
||||
|
||||
// Remove line endings
|
||||
m_title.Replace( wxT( "\r" ), wxT( " " ) );
|
||||
m_title.Replace( wxT( "\n" ), wxT( " " ) );
|
||||
}
|
||||
|
||||
// Remove line endings
|
||||
m_title.Replace( wxT( "\r" ), wxT( "" ) );
|
||||
m_title.Replace( wxT( "\n" ), wxT( "" ) );
|
||||
|
||||
m_title.Trim( false ); // Trim from left
|
||||
m_title.Trim(); // Trim from right
|
||||
}
|
||||
|
||||
return &m_title;
|
||||
|
||||
@@ -257,7 +257,7 @@ void PROJECT_TREE_ITEM::Activate( PROJECT_TREE_PANE* aTreePrjFrame )
|
||||
break;
|
||||
|
||||
default:
|
||||
OpenFile( fullFileName );
|
||||
wxLaunchDefaultApplication( fullFileName );
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -29,6 +29,7 @@ set( KIMATH_SRCS
|
||||
src/geometry/shape_rect.cpp
|
||||
src/geometry/shape_compound.cpp
|
||||
src/geometry/shape_segment.cpp
|
||||
src/geometry/shape_utils.cpp
|
||||
|
||||
|
||||
src/math/vector2.cpp
|
||||
|
||||
@@ -49,6 +49,7 @@
|
||||
#include <math/vector2d.h> // for VECTOR2I
|
||||
#include <md5_hash.h>
|
||||
|
||||
class CIRCLE;
|
||||
|
||||
/**
|
||||
* Represent a set of closed polygons. Polygons may be nonconvex, self-intersecting
|
||||
|
||||
@@ -0,0 +1,95 @@
|
||||
/*
|
||||
* This program source code file is part of KiCad, a free EDA CAD application.
|
||||
*
|
||||
* 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
|
||||
* as published by the Free Software Foundation; either version 2
|
||||
* of the License, or (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, you may find one here:
|
||||
* http://www.gnu.org/licenses/old-licenses/gpl-2.0.html
|
||||
* or you may search the http://www.gnu.org website for the version 2 license,
|
||||
* or you may write to the Free Software Foundation, Inc.,
|
||||
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
|
||||
*/
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <vector>
|
||||
|
||||
#include <math/vector2d.h>
|
||||
#include <geometry/eda_angle.h>
|
||||
|
||||
|
||||
/**
|
||||
* @file geometry/shape_utils.h
|
||||
*
|
||||
* @brief Utility functions for working with shapes.
|
||||
*
|
||||
* These are free functions to avoid bloating the shape classes with functions
|
||||
* that only need to be used in a few places and can just use the public
|
||||
* interfaces.
|
||||
*/
|
||||
|
||||
class CIRCLE;
|
||||
class SHAPE_LINE_CHAIN;
|
||||
class SHAPE_POLY_SET;
|
||||
class SEG;
|
||||
|
||||
|
||||
namespace KIGEOM
|
||||
{
|
||||
/**
|
||||
* Adds a hole to a polygon if it is valid (i.e. it has 3 or more points
|
||||
* and a non-zero area.)
|
||||
*
|
||||
* This is important if you are reading in a polygon from a file and
|
||||
* aren't sure if it will end up being valid. Leaving invalid holes in
|
||||
* a SHAP_POLY_SET will violate the invariant that holes are non-null.
|
||||
*
|
||||
* @param aOutline is the outline to add the hole to.
|
||||
* @param aHole is the hole to add.
|
||||
* @return true if the hole was added, false if it was not.
|
||||
*/
|
||||
bool AddHoleIfValid( SHAPE_POLY_SET& aOutline, SHAPE_LINE_CHAIN&& aHole );
|
||||
|
||||
|
||||
/**
|
||||
* Get the corners of a regular polygon from the centre, one point
|
||||
* and the number of sides.
|
||||
*/
|
||||
std::vector<VECTOR2I> MakeRegularPolygonPoints( const VECTOR2I& aCenter, size_t aN,
|
||||
const VECTOR2I& aPt0 );
|
||||
|
||||
/**
|
||||
* Make a regular polygon of the given size across the corners.
|
||||
*
|
||||
* @param aCenter the center of the polygon
|
||||
* @param aN polygon side count (e.g. 6 = hexagon)
|
||||
* @param aRadius the distance from the centre to a corner/flat
|
||||
* @param aAcrossCorners true if the radius is to the corners, false to the side midpoints
|
||||
* @param aAngle is the angle from the centre to one point. 0 is the point is to the right,
|
||||
* and CCW from there.
|
||||
*/
|
||||
std::vector<VECTOR2I> MakeRegularPolygonPoints( const VECTOR2I& aCenter, size_t aN, int aRadius,
|
||||
bool aAcrossCorners, EDA_ANGLE aAngle );
|
||||
|
||||
/**
|
||||
* Create the two segments for a cross
|
||||
*
|
||||
* @param aCenter is the center of the cross
|
||||
* @param aSize is the size of the cross (can be x != y)
|
||||
* @param aAngle is the angle of the cross (postive = rotate cross CCW)
|
||||
*/
|
||||
std::vector<SEG> MakeCrossSegments( const VECTOR2I& aCenter, const VECTOR2I& aSize,
|
||||
EDA_ANGLE aAngle );
|
||||
|
||||
} // namespace KIGEOM
|
||||
@@ -44,6 +44,7 @@
|
||||
|
||||
#include <clipper.hpp> // for Clipper, PolyNode, Clipp...
|
||||
#include <clipper2/clipper.h>
|
||||
#include <geometry/circle.h>
|
||||
#include <geometry/geometry_utils.h>
|
||||
#include <geometry/polygon_triangulation.h>
|
||||
#include <geometry/seg.h> // for SEG, OPT_VECTOR2I
|
||||
|
||||
@@ -0,0 +1,95 @@
|
||||
/*
|
||||
* This program source code file is part of KiCad, a free EDA CAD application.
|
||||
*
|
||||
* 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
|
||||
* as published by the Free Software Foundation; either version 2
|
||||
* of the License, or (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, you may find one here:
|
||||
* http://www.gnu.org/licenses/old-licenses/gpl-2.0.html
|
||||
* or you may search the http://www.gnu.org website for the version 2 license,
|
||||
* or you may write to the Free Software Foundation, Inc.,
|
||||
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
|
||||
*/
|
||||
|
||||
#include "geometry/shape_utils.h"
|
||||
|
||||
#include <geometry/seg.h>
|
||||
#include <geometry/shape_poly_set.h>
|
||||
|
||||
|
||||
bool KIGEOM::AddHoleIfValid( SHAPE_POLY_SET& aOutline, SHAPE_LINE_CHAIN&& aHole )
|
||||
{
|
||||
if( aHole.PointCount() < 3 || aHole.Area() == 0 )
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
aOutline.AddHole( std::move( aHole ) );
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
std::vector<VECTOR2I> KIGEOM::MakeRegularPolygonPoints( const VECTOR2I& aCenter, size_t aN,
|
||||
const VECTOR2I& aPt0 )
|
||||
{
|
||||
VECTOR2D pt0FromC = aPt0 - aCenter;
|
||||
std::vector<VECTOR2I> pts;
|
||||
|
||||
for( size_t i = 0; i < aN; i++ )
|
||||
{
|
||||
VECTOR2D pt = pt0FromC;
|
||||
RotatePoint( pt, ( FULL_CIRCLE / double( aN ) ) * i );
|
||||
pts.push_back( KiROUND( pt + aCenter ) );
|
||||
}
|
||||
|
||||
return pts;
|
||||
}
|
||||
|
||||
|
||||
std::vector<VECTOR2I> KIGEOM::MakeRegularPolygonPoints( const VECTOR2I& aCenter, size_t aN,
|
||||
int aRadius, bool aAcrossCorners,
|
||||
EDA_ANGLE aAngle )
|
||||
{
|
||||
if( !aAcrossCorners )
|
||||
{
|
||||
// if across flats, increase the radius
|
||||
aRadius = aRadius / ( FULL_CIRCLE / ( aN * 2 ) ).Cos();
|
||||
}
|
||||
|
||||
VECTOR2I pt = VECTOR2I{ aRadius, 0 };
|
||||
RotatePoint( pt, aAngle );
|
||||
|
||||
const VECTOR2I pt0 = aCenter + pt;
|
||||
return KIGEOM::MakeRegularPolygonPoints( aCenter, aN, pt0 );
|
||||
}
|
||||
|
||||
|
||||
std::vector<SEG> KIGEOM::MakeCrossSegments( const VECTOR2I& aCenter, const VECTOR2I& aSize,
|
||||
EDA_ANGLE aAngle )
|
||||
{
|
||||
std::vector<SEG> segs;
|
||||
|
||||
VECTOR2I pt = VECTOR2I{ aSize.x / 2, 0 };
|
||||
RotatePoint( pt, aAngle );
|
||||
|
||||
VECTOR2I pt0 = aCenter - pt;
|
||||
segs.emplace_back( pt0, aCenter - ( pt0 - aCenter ) );
|
||||
|
||||
pt = VECTOR2I{ 0, aSize.y / 2 };
|
||||
RotatePoint( pt, aAngle );
|
||||
|
||||
pt0 = aCenter - pt;
|
||||
segs.emplace_back( pt0, aCenter - ( pt0 - aCenter ) );
|
||||
|
||||
return segs;
|
||||
}
|
||||
@@ -66,3 +66,9 @@ bool KIPLATFORM::IO::IsFileHidden( const wxString& aFileName )
|
||||
|
||||
return fn.GetName().StartsWith( wxT( "." ) );
|
||||
}
|
||||
|
||||
|
||||
void KIPLATFORM::IO::LongPathAdjustment( wxFileName& aFilename )
|
||||
{
|
||||
// no-op
|
||||
}
|
||||
@@ -85,7 +85,7 @@ bool KIPLATFORM::UI::IsWindowActive( wxWindow* aWindow )
|
||||
}
|
||||
|
||||
|
||||
void KIPLATFORM::UI::ReparentQuasiModal( wxNonOwnedWindow* aWindow )
|
||||
void KIPLATFORM::UI::ReparentModal( wxNonOwnedWindow* aWindow )
|
||||
{
|
||||
// Not needed on this platform
|
||||
}
|
||||
@@ -301,6 +301,12 @@ bool KIPLATFORM::UI::WarpPointer( wxWindow* aWindow, int aX, int aY )
|
||||
aWindow->WarpPointer( aX, aY );
|
||||
gdk_window_set_cursor( win, cur_cursor );
|
||||
|
||||
if( cur_cursor )
|
||||
g_object_unref( cur_cursor );
|
||||
|
||||
if( blank_cursor )
|
||||
g_object_unref( blank_cursor );
|
||||
|
||||
return true;
|
||||
}
|
||||
#endif
|
||||
@@ -603,4 +609,4 @@ wxPoint KIPLATFORM::UI::GetMousePosition()
|
||||
}
|
||||
|
||||
|
||||
#endif
|
||||
#endif
|
||||
|
||||
@@ -23,6 +23,7 @@
|
||||
#include <stdio.h>
|
||||
|
||||
class wxString;
|
||||
class wxFileName;
|
||||
|
||||
namespace KIPLATFORM
|
||||
{
|
||||
@@ -50,6 +51,12 @@ namespace IO
|
||||
* @return true if the file attribut is set.
|
||||
*/
|
||||
bool IsFileHidden( const wxString& aFileName );
|
||||
|
||||
/**
|
||||
* Adjusts a filename to be a long path compatible.
|
||||
* This is a no-op on non-Windows platforms.
|
||||
*/
|
||||
void LongPathAdjustment( wxFileName& aFilename );
|
||||
} // namespace IO
|
||||
} // namespace KIPLATFORM
|
||||
|
||||
|
||||
@@ -69,7 +69,7 @@ namespace KIPLATFORM
|
||||
*
|
||||
* @param aWindow is the window to reparent
|
||||
*/
|
||||
void ReparentQuasiModal( wxNonOwnedWindow* aWindow );
|
||||
void ReparentModal( wxNonOwnedWindow* aWindow );
|
||||
|
||||
/*
|
||||
* An ugly hack to fix an issue on OSX: cmd+c closes the dialog instead of copying the
|
||||
|
||||
@@ -21,7 +21,7 @@
|
||||
|
||||
#include <wx/string.h>
|
||||
#include <wx/wxcrt.h>
|
||||
|
||||
#include <wx/filename.h>
|
||||
#include <windows.h>
|
||||
|
||||
// Define USE_MSYS2_FALlBACK if the code for _MSC_VER does not compile on msys2
|
||||
@@ -123,4 +123,36 @@ bool KIPLATFORM::IO::IsFileHidden( const wxString& aFileName )
|
||||
result = true;
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
|
||||
void KIPLATFORM::IO::LongPathAdjustment( wxFileName& aFilename )
|
||||
{
|
||||
// dont shortcut this for shorter lengths as there are uses like directory
|
||||
// paths that exceed the path length when you start traversing their subdirectories
|
||||
// so we want to start with the long path prefix all the time
|
||||
|
||||
if( aFilename.GetVolume().Length() == 1 )
|
||||
// assume single letter == drive volume
|
||||
aFilename.SetVolume( "\\\\?\\" + aFilename.GetVolume() + ":" );
|
||||
else if( aFilename.GetVolume().Length() > 1
|
||||
&& aFilename.GetVolume().StartsWith( wxT( "\\\\" ) )
|
||||
&& !aFilename.GetVolume().StartsWith( wxT( "\\\\?" ) ) )
|
||||
// unc path aka network share, wx returns with \\ already
|
||||
// so skip the first slash and combine with the prefix
|
||||
// which in the case of UNCs is actually \\?\UNC\<server>\<share>
|
||||
// where UNC is literally the text UNC
|
||||
aFilename.SetVolume( "\\\\?\\UNC" + aFilename.GetVolume().Mid( 1 ) );
|
||||
else if( aFilename.GetVolume().StartsWith( wxT( "\\\\?" ) )
|
||||
&& aFilename.GetDirs().size() >= 2
|
||||
&& aFilename.GetDirs()[0] == "UNC" )
|
||||
{
|
||||
// wxWidgets can parse \\?\UNC\<server> into a mess
|
||||
// UNC gets stored into a directory
|
||||
// volume gets reduced to just \\?
|
||||
// so we need to repair it
|
||||
aFilename.SetVolume( "\\\\?\\UNC\\" + aFilename.GetDirs()[1] );
|
||||
aFilename.RemoveDir( 0 );
|
||||
aFilename.RemoveDir( 0 );
|
||||
}
|
||||
}
|
||||
@@ -90,7 +90,7 @@ bool KIPLATFORM::UI::IsWindowActive( wxWindow* aWindow )
|
||||
}
|
||||
|
||||
|
||||
void KIPLATFORM::UI::ReparentQuasiModal( wxNonOwnedWindow* aWindow )
|
||||
void KIPLATFORM::UI::ReparentModal( wxNonOwnedWindow* aWindow )
|
||||
{
|
||||
// Not needed on this platform
|
||||
}
|
||||
|
||||
@@ -49,16 +49,16 @@ bool KIPLATFORM::IO::DuplicatePermissions(const wxString& sourceFilePath, const
|
||||
|
||||
NSNumber *permissions = sourceAttributes[NSFilePosixPermissions];
|
||||
|
||||
if (permissions == nil)
|
||||
if (permissions == nil)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
if ([fileManager setAttributes:@{NSFilePosixPermissions: permissions} ofItemAtPath:destPath error:&error])
|
||||
if ([fileManager setAttributes:@{NSFilePosixPermissions: permissions} ofItemAtPath:destPath error:&error])
|
||||
{
|
||||
return true;
|
||||
}
|
||||
else
|
||||
}
|
||||
else
|
||||
{
|
||||
NSLog(@"Error assigning permissions: %@", error);
|
||||
return false;
|
||||
@@ -71,3 +71,9 @@ bool KIPLATFORM::IO::IsFileHidden( const wxString& aFileName )
|
||||
|
||||
return fn.GetName().StartsWith( wxT( "." ) );
|
||||
}
|
||||
|
||||
|
||||
void KIPLATFORM::IO::LongPathAdjustment( wxFileName& aFilename )
|
||||
{
|
||||
// no-op
|
||||
}
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user