2012-02-16 20:03:33 +00:00
|
|
|
/*
|
|
|
|
* This program source code file is part of KiCad, a free EDA CAD application.
|
|
|
|
*
|
2023-01-15 19:09:19 +00:00
|
|
|
* Copyright (C) 2014-2023 KiCad Developers, see AUTHORS.txt for contributors.
|
2012-02-16 20:03:33 +00:00
|
|
|
*
|
2022-06-09 17:39:35 +00:00
|
|
|
* 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 3 of the License, or (at your
|
|
|
|
* option) any later version.
|
2012-02-16 20:03:33 +00:00
|
|
|
*
|
2022-06-09 17:39:35 +00:00
|
|
|
* 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.
|
2012-02-16 20:03:33 +00:00
|
|
|
*
|
2022-06-09 17:39:35 +00:00
|
|
|
* You should have received a copy of the GNU General Public License along
|
|
|
|
* with this program. If not, see <http://www.gnu.org/licenses/>.
|
2012-02-16 20:03:33 +00:00
|
|
|
*/
|
|
|
|
|
2021-04-18 17:39:46 +00:00
|
|
|
#include <mutex>
|
2022-08-31 09:35:27 +00:00
|
|
|
#include <wx/ffile.h>
|
2021-04-18 17:39:46 +00:00
|
|
|
|
2021-06-15 13:24:55 +00:00
|
|
|
#include <symbol_library.h>
|
2012-01-23 04:33:36 +00:00
|
|
|
#include <confirm.h>
|
2020-07-17 20:04:14 +00:00
|
|
|
#include <dialogs/dialog_schematic_setup.h>
|
|
|
|
#include <kiway.h>
|
2020-10-31 01:27:16 +00:00
|
|
|
#include <symbol_edit_frame.h>
|
2020-12-17 13:12:18 +00:00
|
|
|
#include <dialogs/panel_gal_display_options.h>
|
2020-01-13 01:44:19 +00:00
|
|
|
#include <pgm_base.h>
|
2020-06-08 02:19:46 +00:00
|
|
|
#include <project/project_file.h>
|
2020-07-07 10:17:30 +00:00
|
|
|
#include <project/net_settings.h>
|
2018-01-30 10:49:51 +00:00
|
|
|
#include <sch_edit_frame.h>
|
2020-01-13 01:44:19 +00:00
|
|
|
#include <sch_painter.h>
|
2020-05-13 02:00:37 +00:00
|
|
|
#include <schematic.h>
|
2022-12-12 11:46:20 +00:00
|
|
|
#include <widgets/hierarchy_pane.h>
|
2023-05-15 01:35:39 +00:00
|
|
|
#include <widgets/sch_search_pane.h>
|
2023-09-12 13:03:56 +00:00
|
|
|
#include <widgets/properties_panel.h>
|
2020-01-13 01:44:19 +00:00
|
|
|
#include <settings/app_settings.h>
|
2020-02-03 16:46:58 +00:00
|
|
|
#include <settings/settings_manager.h>
|
2020-01-13 01:44:19 +00:00
|
|
|
#include <wildcards_and_files_ext.h>
|
2021-02-22 23:47:17 +00:00
|
|
|
#include <drawing_sheet/ds_data_model.h>
|
2020-12-01 19:27:42 +00:00
|
|
|
#include <zoom_defines.h>
|
2023-03-04 19:25:07 +00:00
|
|
|
#include <sim/spice_settings.h>
|
2020-03-10 18:46:57 +00:00
|
|
|
|
2007-06-05 12:10:51 +00:00
|
|
|
|
2020-02-03 16:46:58 +00:00
|
|
|
/// Helper for all the old plotting/printing code while it still exists
|
|
|
|
COLOR4D GetLayerColor( SCH_LAYER_ID aLayer )
|
2012-09-28 17:47:41 +00:00
|
|
|
{
|
2020-02-03 16:46:58 +00:00
|
|
|
return Pgm().GetSettingsManager().GetColorSettings()->GetColor( aLayer );
|
2012-09-28 17:47:41 +00:00
|
|
|
}
|
|
|
|
|
2014-08-13 13:15:15 +00:00
|
|
|
|
2020-06-08 02:19:46 +00:00
|
|
|
bool SCH_EDIT_FRAME::LoadProjectSettings()
|
2009-04-29 17:09:00 +00:00
|
|
|
{
|
2021-09-02 11:40:45 +00:00
|
|
|
SCHEMATIC_SETTINGS& settings = Schematic().Settings();
|
|
|
|
settings.m_JunctionSize = GetSchematicJunctionSize();
|
|
|
|
|
|
|
|
GetRenderSettings()->SetDefaultPenWidth( settings.m_DefaultLineWidth );
|
2021-11-13 22:55:46 +00:00
|
|
|
GetRenderSettings()->m_LabelSizeRatio = settings.m_LabelSizeRatio;
|
|
|
|
GetRenderSettings()->m_TextOffsetRatio = settings.m_TextOffsetRatio;
|
|
|
|
GetRenderSettings()->m_PinSymbolSize = settings.m_PinSymbolSize;
|
2020-04-04 20:32:14 +00:00
|
|
|
|
2021-07-22 23:05:01 +00:00
|
|
|
GetRenderSettings()->SetDashLengthRatio( settings.m_DashedLineDashRatio );
|
|
|
|
GetRenderSettings()->SetGapLengthRatio( settings.m_DashedLineGapRatio );
|
|
|
|
|
2022-08-31 09:35:27 +00:00
|
|
|
BASE_SCREEN::m_DrawingSheetFileName = settings.m_SchDrawingSheetFileName;
|
|
|
|
|
2021-09-23 15:44:39 +00:00
|
|
|
// Load the drawing sheet from the filename stored in BASE_SCREEN::m_DrawingSheetFileName.
|
|
|
|
// If empty, or not existing, the default drawing sheet is loaded.
|
|
|
|
wxString filename = DS_DATA_MODEL::ResolvePath( BASE_SCREEN::m_DrawingSheetFileName,
|
|
|
|
Prj().GetProjectPath() );
|
2014-12-23 13:01:59 +00:00
|
|
|
|
2021-05-01 18:11:16 +00:00
|
|
|
if( !DS_DATA_MODEL::GetTheInstance().LoadDrawingSheet( filename ) )
|
2021-06-26 11:33:37 +00:00
|
|
|
ShowInfoBarError( _( "Error loading drawing sheet." ), true );
|
2008-02-26 19:19:54 +00:00
|
|
|
|
2020-06-08 02:19:46 +00:00
|
|
|
return true;
|
2007-06-05 12:10:51 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
2020-05-24 14:54:26 +00:00
|
|
|
void SCH_EDIT_FRAME::ShowSchematicSetupDialog( const wxString& aInitialPage )
|
2020-03-10 18:46:57 +00:00
|
|
|
{
|
2024-01-30 14:14:00 +00:00
|
|
|
SCH_SCREENS screens( Schematic().Root() );
|
|
|
|
std::vector<std::shared_ptr<BUS_ALIAS>> oldAliases;
|
|
|
|
|
|
|
|
for( SCH_SCREEN* screen = screens.GetFirst(); screen != nullptr; screen = screens.GetNext() )
|
|
|
|
{
|
|
|
|
for( const std::shared_ptr<BUS_ALIAS>& alias : screen->GetBusAliases() )
|
|
|
|
oldAliases.push_back( alias );
|
|
|
|
}
|
|
|
|
|
2020-03-10 18:46:57 +00:00
|
|
|
DIALOG_SCHEMATIC_SETUP dlg( this );
|
|
|
|
|
|
|
|
if( !aInitialPage.IsEmpty() )
|
2020-05-24 14:54:26 +00:00
|
|
|
dlg.SetInitialPage( aInitialPage, wxEmptyString );
|
2020-03-10 18:46:57 +00:00
|
|
|
|
|
|
|
if( dlg.ShowQuasiModal() == wxID_OK )
|
|
|
|
{
|
2023-03-04 19:25:07 +00:00
|
|
|
// Mark document as modified so that project settings can be saved as part of doc save
|
|
|
|
OnModify();
|
2020-03-10 18:46:57 +00:00
|
|
|
|
2020-07-17 20:04:14 +00:00
|
|
|
Kiway().CommonSettingsChanged( false, true );
|
2021-11-13 23:19:28 +00:00
|
|
|
|
2023-09-17 14:49:46 +00:00
|
|
|
Prj().IncrementTextVarsTicker();
|
|
|
|
Prj().IncrementNetclassesTicker();
|
|
|
|
|
2021-11-13 23:19:28 +00:00
|
|
|
GetRenderSettings()->SetDefaultPenWidth( Schematic().Settings().m_DefaultLineWidth );
|
|
|
|
GetRenderSettings()->m_LabelSizeRatio = Schematic().Settings().m_LabelSizeRatio;
|
|
|
|
GetRenderSettings()->m_TextOffsetRatio = Schematic().Settings().m_TextOffsetRatio;
|
|
|
|
GetRenderSettings()->m_PinSymbolSize = Schematic().Settings().m_PinSymbolSize;
|
|
|
|
|
2021-07-22 23:05:01 +00:00
|
|
|
GetRenderSettings()->SetDashLengthRatio( Schematic().Settings().m_DashedLineDashRatio );
|
|
|
|
GetRenderSettings()->SetGapLengthRatio( Schematic().Settings().m_DashedLineGapRatio );
|
|
|
|
|
2021-11-13 23:19:28 +00:00
|
|
|
GetCanvas()->GetView()->MarkDirty();
|
|
|
|
GetCanvas()->GetView()->UpdateAllItems( KIGFX::REPAINT );
|
2024-01-30 14:14:00 +00:00
|
|
|
|
|
|
|
std::vector<std::shared_ptr<BUS_ALIAS>> newAliases;
|
|
|
|
|
|
|
|
for( SCH_SCREEN* screen = screens.GetFirst(); screen != nullptr; screen = screens.GetNext() )
|
|
|
|
{
|
|
|
|
for( const std::shared_ptr<BUS_ALIAS>& alias : screen->GetBusAliases() )
|
|
|
|
newAliases.push_back( alias );
|
|
|
|
}
|
|
|
|
|
|
|
|
if( oldAliases != newAliases )
|
|
|
|
RecalculateConnections( nullptr, GLOBAL_CLEANUP );
|
|
|
|
|
2023-02-09 17:18:56 +00:00
|
|
|
RefreshOperatingPointDisplay();
|
2020-03-10 18:46:57 +00:00
|
|
|
GetCanvas()->Refresh();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2021-09-02 11:40:45 +00:00
|
|
|
int SCH_EDIT_FRAME::GetSchematicJunctionSize()
|
|
|
|
{
|
|
|
|
std::vector<double>& sizeMultipliers = eeconfig()->m_Drawing.junction_size_mult_list;
|
|
|
|
|
2022-08-14 11:03:18 +00:00
|
|
|
const std::shared_ptr<NET_SETTINGS>& netSettings = Prj().GetProjectFile().NetSettings();
|
|
|
|
int sizeChoice = Schematic().Settings().m_JunctionSizeChoice;
|
|
|
|
int dotSize = netSettings->m_DefaultNetClass->GetWireWidth() * sizeMultipliers[ sizeChoice ];
|
2021-09-02 11:40:45 +00:00
|
|
|
|
2022-08-14 11:03:18 +00:00
|
|
|
return std::max( dotSize, 1 );
|
2021-09-02 11:40:45 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
2023-03-04 19:25:07 +00:00
|
|
|
void SCH_EDIT_FRAME::saveProjectSettings()
|
2007-06-05 12:10:51 +00:00
|
|
|
{
|
2020-06-08 02:19:46 +00:00
|
|
|
wxFileName fn = Schematic().RootScreen()->GetFileName(); //ConfigFileName
|
2009-04-05 20:49:15 +00:00
|
|
|
|
2023-12-28 02:10:01 +00:00
|
|
|
fn.SetExt( FILEEXT::ProjectFileExtension );
|
2009-04-05 20:49:15 +00:00
|
|
|
|
2021-11-17 02:02:23 +00:00
|
|
|
if( !fn.HasName() || !IsWritable( fn, false ) )
|
2008-02-26 19:19:54 +00:00
|
|
|
return;
|
|
|
|
|
2023-08-13 23:50:05 +00:00
|
|
|
Schematic().RecordERCExclusions();
|
2020-11-18 22:55:38 +00:00
|
|
|
|
2023-03-04 19:25:07 +00:00
|
|
|
if( Kiway().Player( FRAME_SIMULATOR, false ) )
|
2023-07-14 09:21:58 +00:00
|
|
|
Prj().GetProjectFile().m_SchematicSettings->m_NgspiceSettings->SaveToFile();
|
2023-01-22 12:17:05 +00:00
|
|
|
|
|
|
|
// Save the page layout file if doesn't exist yet (e.g. if we opened a non-kicad schematic)
|
|
|
|
|
2022-08-31 09:35:27 +00:00
|
|
|
// TODO: We need to remove dependence on BASE_SCREEN
|
2023-01-22 12:17:05 +00:00
|
|
|
Prj().GetProjectFile().m_SchematicSettings->m_SchDrawingSheetFileName
|
|
|
|
= BASE_SCREEN::m_DrawingSheetFileName;
|
2022-08-31 09:35:27 +00:00
|
|
|
|
|
|
|
if( !BASE_SCREEN::m_DrawingSheetFileName.IsEmpty() )
|
|
|
|
{
|
2023-02-11 15:33:23 +00:00
|
|
|
wxFileName layoutfn( DS_DATA_MODEL::ResolvePath( BASE_SCREEN::m_DrawingSheetFileName,
|
|
|
|
Prj().GetProjectPath() ) );
|
2022-08-31 09:35:27 +00:00
|
|
|
|
2023-01-22 12:17:05 +00:00
|
|
|
bool success = true;
|
|
|
|
|
2022-08-31 09:35:27 +00:00
|
|
|
if( !layoutfn.IsAbsolute() )
|
2023-01-22 12:17:05 +00:00
|
|
|
success = layoutfn.MakeAbsolute( Prj().GetProjectPath() );
|
2022-08-31 09:35:27 +00:00
|
|
|
|
2023-01-22 12:17:05 +00:00
|
|
|
if( success && layoutfn.IsOk() && !layoutfn.FileExists() )
|
2023-01-15 19:09:19 +00:00
|
|
|
{
|
2023-01-22 12:17:05 +00:00
|
|
|
if( layoutfn.DirExists() && layoutfn.IsDirWritable() )
|
|
|
|
DS_DATA_MODEL::GetTheInstance().Save( layoutfn.GetFullPath() );
|
2023-01-15 19:09:19 +00:00
|
|
|
}
|
2022-08-31 09:35:27 +00:00
|
|
|
}
|
|
|
|
|
2020-06-08 02:19:46 +00:00
|
|
|
GetSettingsManager()->SaveProject( fn.GetFullPath() );
|
2009-04-29 17:09:00 +00:00
|
|
|
}
|
|
|
|
|
2009-04-05 20:49:15 +00:00
|
|
|
|
2023-03-04 19:25:07 +00:00
|
|
|
void SCH_EDIT_FRAME::SaveProjectLocalSettings()
|
|
|
|
{
|
2023-08-28 12:27:00 +00:00
|
|
|
if( m_schematic )
|
|
|
|
m_schematic->RecordERCExclusions();
|
2023-03-04 19:25:07 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
2020-01-13 01:44:19 +00:00
|
|
|
void SCH_EDIT_FRAME::LoadSettings( APP_SETTINGS_BASE* aCfg )
|
2009-04-05 20:49:15 +00:00
|
|
|
{
|
2021-07-16 20:13:26 +00:00
|
|
|
// For now, axes are forced off in Eeschema even if turned on in config
|
2023-05-15 01:35:39 +00:00
|
|
|
EESCHEMA_SETTINGS* cfg = eeconfig();
|
|
|
|
cfg->m_Window.grid.axes_enabled = false;
|
2020-06-19 21:22:25 +00:00
|
|
|
|
2023-05-15 01:35:39 +00:00
|
|
|
SCH_BASE_FRAME::LoadSettings( cfg );
|
2020-04-12 23:09:17 +00:00
|
|
|
|
2022-08-05 02:40:38 +00:00
|
|
|
SCH_SEARCH_DATA* searchData = dynamic_cast<SCH_SEARCH_DATA*>( m_findReplaceData.get() );
|
2022-08-25 18:21:00 +00:00
|
|
|
|
|
|
|
if( searchData )
|
|
|
|
{
|
2023-05-15 01:35:39 +00:00
|
|
|
searchData->replaceReferences = cfg->m_FindReplaceExtra.replace_references;
|
|
|
|
searchData->searchAllFields = cfg->m_FindReplaceExtra.search_all_fields;
|
|
|
|
searchData->searchAllPins = cfg->m_FindReplaceExtra.search_all_pins;
|
|
|
|
searchData->searchCurrentSheetOnly = cfg->m_FindReplaceExtra.search_current_sheet_only;
|
|
|
|
searchData->searchSelectedOnly = cfg->m_FindReplaceExtra.search_selected_only;
|
2022-08-25 18:21:00 +00:00
|
|
|
}
|
2022-08-05 02:40:38 +00:00
|
|
|
|
2023-05-15 01:35:39 +00:00
|
|
|
m_show_search = cfg->m_AuiPanels.show_search;
|
|
|
|
|
2020-04-23 11:44:56 +00:00
|
|
|
GetRenderSettings()->m_ShowPinsElectricalType = false;
|
2022-09-06 16:28:44 +00:00
|
|
|
GetRenderSettings()->m_ShowPinNumbers = false;
|
2023-05-15 01:35:39 +00:00
|
|
|
GetRenderSettings()->SetDefaultFont( cfg->m_Appearance.default_font );
|
2020-04-12 23:09:17 +00:00
|
|
|
}
|
2009-04-29 17:09:00 +00:00
|
|
|
|
|
|
|
|
2020-04-12 23:09:17 +00:00
|
|
|
void SCH_EDIT_FRAME::SaveSettings( APP_SETTINGS_BASE* aCfg )
|
|
|
|
{
|
2023-05-15 01:35:39 +00:00
|
|
|
EESCHEMA_SETTINGS* cfg = eeconfig();
|
|
|
|
SCH_BASE_FRAME::SaveSettings( cfg );
|
2022-06-09 17:39:35 +00:00
|
|
|
wxAuiPaneInfo& hierarchy_pane = m_auimgr.GetPane( SchematicHierarchyPaneName() );
|
2020-04-12 23:09:17 +00:00
|
|
|
|
2023-05-15 01:35:39 +00:00
|
|
|
if( cfg )
|
2022-06-02 21:56:17 +00:00
|
|
|
{
|
2023-05-15 01:35:39 +00:00
|
|
|
cfg->m_System.units = static_cast<int>( GetUserUnits() );
|
|
|
|
cfg->m_AuiPanels.show_schematic_hierarchy = hierarchy_pane.IsShown();
|
|
|
|
cfg->m_AuiPanels.schematic_hierarchy_float = hierarchy_pane.IsFloating();
|
2023-10-12 13:36:28 +00:00
|
|
|
|
2022-06-09 17:39:35 +00:00
|
|
|
// Other parameters (hierarchy_panel_float_width, hierarchy_panel_float_height,
|
|
|
|
// and hierarchy_panel_docked_width should have been updated when resizing the
|
|
|
|
// hierarchy panel
|
2022-08-05 02:40:38 +00:00
|
|
|
|
|
|
|
SCH_SEARCH_DATA* searchData = dynamic_cast<SCH_SEARCH_DATA*>( m_findReplaceData.get() );
|
2022-08-25 18:21:00 +00:00
|
|
|
|
|
|
|
if( searchData )
|
|
|
|
{
|
2023-05-15 01:35:39 +00:00
|
|
|
cfg->m_FindReplaceExtra.replace_references = searchData->replaceReferences;
|
|
|
|
cfg->m_FindReplaceExtra.search_all_fields = searchData->searchAllFields;
|
|
|
|
cfg->m_FindReplaceExtra.search_all_pins = searchData->searchAllPins;
|
|
|
|
cfg->m_FindReplaceExtra.search_current_sheet_only =
|
2022-08-25 18:21:00 +00:00
|
|
|
searchData->searchCurrentSheetOnly;
|
2023-05-15 01:35:39 +00:00
|
|
|
cfg->m_FindReplaceExtra.search_selected_only = searchData->searchSelectedOnly;
|
2022-08-25 18:21:00 +00:00
|
|
|
}
|
2023-05-15 01:35:39 +00:00
|
|
|
|
2023-05-19 20:51:57 +00:00
|
|
|
wxAuiPaneInfo& searchPaneInfo = m_auimgr.GetPane( SearchPaneName() );
|
|
|
|
m_show_search = searchPaneInfo.IsShown();
|
2023-05-15 01:35:39 +00:00
|
|
|
cfg->m_AuiPanels.show_search = m_show_search;
|
|
|
|
cfg->m_AuiPanels.search_panel_height = m_searchPane->GetSize().y;
|
2023-05-19 20:51:57 +00:00
|
|
|
cfg->m_AuiPanels.search_panel_width = m_searchPane->GetSize().x;
|
|
|
|
cfg->m_AuiPanels.search_panel_dock_direction = searchPaneInfo.dock_direction;
|
2023-06-24 06:44:34 +00:00
|
|
|
|
|
|
|
wxAuiPaneInfo& propertiesPane = m_auimgr.GetPane( PropertiesPaneName() );
|
|
|
|
cfg->m_AuiPanels.show_properties = propertiesPane.IsShown();
|
2023-09-25 11:35:31 +00:00
|
|
|
cfg->m_AuiPanels.properties_splitter = m_propertiesPanel->SplitterProportion();
|
2023-11-01 12:42:06 +00:00
|
|
|
cfg->m_AuiPanels.properties_panel_width = m_propertiesPanel->GetSize().x;
|
2024-02-01 11:53:33 +00:00
|
|
|
|
|
|
|
wxAuiPaneInfo& netNavigatorPane = m_auimgr.GetPane( NetNavigatorPaneName() );
|
|
|
|
cfg->m_AuiPanels.show_net_nav_panel = netNavigatorPane.IsShown();
|
|
|
|
cfg->m_AuiPanels.float_net_nav_panel = netNavigatorPane.IsFloating();
|
|
|
|
|
|
|
|
if( netNavigatorPane.IsDocked() )
|
|
|
|
cfg->m_AuiPanels.net_nav_panel_docked_size = m_netNavigator->GetSize();
|
|
|
|
else
|
|
|
|
{
|
|
|
|
cfg->m_AuiPanels.net_nav_panel_float_pos = netNavigatorPane.floating_pos;
|
|
|
|
cfg->m_AuiPanels.net_nav_panel_float_size = netNavigatorPane.floating_size;
|
|
|
|
}
|
2022-06-02 21:56:17 +00:00
|
|
|
}
|
2020-04-12 23:09:17 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
void SCH_BASE_FRAME::LoadSettings( APP_SETTINGS_BASE* aCfg )
|
|
|
|
{
|
2022-02-25 17:21:46 +00:00
|
|
|
wxCHECK_RET( aCfg, "Call to SCH_BASE_FRAME::LoadSettings with null settings" );
|
2020-05-10 22:02:58 +00:00
|
|
|
|
|
|
|
EDA_DRAW_FRAME::LoadSettings( aCfg );
|
2020-04-12 23:09:17 +00:00
|
|
|
|
2023-08-30 15:21:56 +00:00
|
|
|
if( aCfg->m_Window.grid.grids.empty() )
|
|
|
|
aCfg->m_Window.grid.grids = aCfg->DefaultGridSizeList();
|
2023-01-05 12:23:03 +00:00
|
|
|
|
2023-08-24 15:41:08 +00:00
|
|
|
// Move legacy user grids to grid list
|
|
|
|
if( !aCfg->m_Window.grid.user_grid_x.empty() )
|
|
|
|
{
|
2023-08-30 15:21:56 +00:00
|
|
|
aCfg->m_Window.grid.grids.emplace_back( GRID{ "User Grid", aCfg->m_Window.grid.user_grid_x,
|
|
|
|
aCfg->m_Window.grid.user_grid_y } );
|
2023-08-24 15:41:08 +00:00
|
|
|
aCfg->m_Window.grid.user_grid_x = wxEmptyString;
|
|
|
|
aCfg->m_Window.grid.user_grid_y = wxEmptyString;
|
|
|
|
}
|
|
|
|
|
2023-08-30 15:21:56 +00:00
|
|
|
if( aCfg->m_Window.grid.last_size_idx > (int) aCfg->m_Window.grid.grids.size() )
|
2023-01-05 12:23:03 +00:00
|
|
|
aCfg->m_Window.grid.last_size_idx = 1;
|
|
|
|
|
2023-08-30 15:21:56 +00:00
|
|
|
if( aCfg->m_Window.grid.fast_grid_1 > (int) aCfg->m_Window.grid.grids.size() )
|
2023-01-05 12:23:03 +00:00
|
|
|
aCfg->m_Window.grid.fast_grid_1 = 1;
|
|
|
|
|
2023-08-30 15:21:56 +00:00
|
|
|
if( aCfg->m_Window.grid.fast_grid_2 > (int) aCfg->m_Window.grid.grids.size() )
|
2023-01-05 12:23:03 +00:00
|
|
|
aCfg->m_Window.grid.fast_grid_2 = 2;
|
|
|
|
|
|
|
|
if( aCfg->m_Window.zoom_factors.empty() )
|
2020-06-13 21:09:02 +00:00
|
|
|
{
|
2020-12-02 14:34:05 +00:00
|
|
|
aCfg->m_Window.zoom_factors = { ZOOM_LIST_EESCHEMA };
|
2020-06-13 21:09:02 +00:00
|
|
|
}
|
2009-04-05 20:49:15 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
2020-04-12 23:09:17 +00:00
|
|
|
void SCH_BASE_FRAME::SaveSettings( APP_SETTINGS_BASE* aCfg )
|
2009-04-05 20:49:15 +00:00
|
|
|
{
|
2023-01-16 02:28:40 +00:00
|
|
|
wxCHECK_RET( aCfg, wxS( "Call to SCH_BASE_FRAME::SaveSettings with null settings" ) );
|
2020-05-10 22:02:58 +00:00
|
|
|
|
|
|
|
EDA_DRAW_FRAME::SaveSettings( aCfg );
|
2023-10-12 13:36:28 +00:00
|
|
|
}
|