KiCad PCB EDA Suite
eeschema_config.cpp
Go to the documentation of this file.
1 /*
2  * This program source code file is part of KiCad, a free EDA CAD application.
3  *
4  * Copyright (C) 2014-2019 KiCad Developers, see AUTHORS.txt for contributors.
5  *
6  * This program is free software; you can redistribute it and/or
7  * modify it under the terms of the GNU General Public License
8  * as published by the Free Software Foundation; either version 2
9  * of the License, or (at your option) any later version.
10  *
11  * This program is distributed in the hope that it will be useful,
12  * but WITHOUT ANY WARRANTY; without even the implied warranty of
13  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14  * GNU General Public License for more details.
15  *
16  * You should have received a copy of the GNU General Public License
17  * along with this program; if not, you may find one here:
18  * http://www.gnu.org/licenses/old-licenses/gpl-2.0.html
19  * or you may search the http://www.gnu.org website for the version 2 license,
20  * or you may write to the Free Software Foundation, Inc.,
21  * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
22  */
23 
24 #include <fctsys.h>
25 #include <pgm_base.h>
26 #include <kiface_i.h>
27 #include <confirm.h>
28 #include <gestfich.h>
29 #include <sch_edit_frame.h>
30 #include <sch_sheet.h>
31 #include <lib_edit_frame.h>
32 #include <eeschema_config.h>
33 #include <ws_data_model.h>
34 #include <class_library.h>
35 #include <symbol_lib_table.h>
37 #include <widgets/paged_dialog.h>
41 #include <panel_display_options.h>
42 #include <panel_hotkeys_editor.h>
46 #include <sch_painter.h>
47 #include "sch_junction.h"
48 #include "eeschema_id.h"
49 
54 static int s_textMarkupFlags = 0;
55 
56 
58 {
59  return s_defaultBusThickness;
60 }
61 
62 
63 void SetDefaultBusThickness( int aThickness)
64 {
65  s_defaultBusThickness = std::max( 1, aThickness );
66 }
67 
68 
70 {
72 }
73 
74 
75 void SetDefaultWireThickness( int aThickness )
76 {
77  s_defaultWireThickness = std::max( 1, aThickness );
78 }
79 
80 
82 {
83  return s_defaultTextSize;
84 }
85 
86 
87 void SetDefaultTextSize( int aTextSize )
88 {
89  s_defaultTextSize = aTextSize;
90 }
91 
92 
94 {
96 }
97 
98 
99 void SetTextMarkupFlags( int aMarkupFlags )
100 {
101  s_textMarkupFlags = aMarkupFlags;
102 }
103 
104 
106 {
107  return s_textMarkupFlags;
108 }
109 
110 
111 void SetDefaultLineThickness( int aThickness )
112 {
113  s_drawDefaultLineThickness = std::max( 1, aThickness );
114 }
115 
116 
117 // Color to draw selected items
119 {
120  return COLOR4D( BROWN );
121 }
122 
123 
124 // Color to draw items flagged invisible, in libedit (they are invisible in Eeschema)
126 {
127  return COLOR4D( DARKGRAY );
128 }
129 
130 
132  PANEL_HOTKEYS_EDITOR* aHotkeysPanel )
133 {
134  wxTreebook* book = aParent->GetTreebook();
135 
136  book->AddPage( new wxPanel( book ), _( "Eeschema" ) );
137  book->AddSubPage( new PANEL_EESCHEMA_DISPLAY_OPTIONS( this, book ), _( "Display Options" ) );
138  book->AddSubPage( new PANEL_EESCHEMA_SETTINGS( this, book ), _( "Editing Options" ) );
139  book->AddSubPage( new PANEL_EESCHEMA_COLOR_CONFIG( this, book ), _( "Colors" ) );
140  book->AddSubPage( new PANEL_EESCHEMA_TEMPLATE_FIELDNAMES( this, book ),
141  _( "Field Name Templates" ) );
142 
143  aHotkeysPanel->AddHotKeys( GetToolManager() );
144 }
145 
146 
148 
149 {
150  if( !m_projectFileParams.empty() )
151  return m_projectFileParams;
152 
153  m_projectFileParams.push_back( new PARAM_CFG_FILENAME( wxT( "PageLayoutDescrFile" ),
155 
156  m_projectFileParams.push_back( new PARAM_CFG_FILENAME( wxT( "PlotDirectoryName" ),
157  &m_plotDirectoryName ) );
158 
159  m_projectFileParams.push_back( new PARAM_CFG_INT( wxT( "SubpartIdSeparator" ),
160  LIB_PART::SubpartIdSeparatorPtr(), 0, 0, 126 ) );
161  m_projectFileParams.push_back( new PARAM_CFG_INT( wxT( "SubpartFirstId" ),
162  LIB_PART::SubpartFirstIdPtr(), 'A', '1', 'z' ) );
163 
164  m_projectFileParams.push_back( new PARAM_CFG_WXSTRING( wxT( "NetFmtName" ),
165  &m_netListFormat) );
166  m_projectFileParams.push_back( new PARAM_CFG_BOOL( wxT( "SpiceAjustPassiveValues" ),
167  &m_spiceAjustPassiveValues, false ) );
168 
169  m_projectFileParams.push_back( new PARAM_CFG_INT( wxT( "LabSize" ),
170  &s_defaultTextSize, DEFAULT_SIZE_TEXT, 5, 1000 ) );
171 
172  m_projectFileParams.push_back( new PARAM_CFG_BOOL( wxT( "ERC_WriteFile" ),
173  &m_ercSettings.write_erc_file, false ) );
174 
175  m_projectFileParams.push_back( new PARAM_CFG_BOOL( wxT( "ERC_TestSimilarLabels" ),
177 
178  m_projectFileParams.push_back( new PARAM_CFG_BOOL( wxT( "ERC_CheckUniqueGlobalLabels" ),
180 
181  m_projectFileParams.push_back( new PARAM_CFG_BOOL( wxT( "ERC_CheckBusDriverConflicts" ),
183 
184  m_projectFileParams.push_back( new PARAM_CFG_BOOL( wxT( "ERC_CheckBusEntryConflicts" ),
186 
187  m_projectFileParams.push_back( new PARAM_CFG_BOOL( wxT( "ERC_CheckBusToBusConflicts" ),
189 
190  m_projectFileParams.push_back( new PARAM_CFG_BOOL( wxT( "ERC_CheckBusToNetConflicts" ),
192 
193  return m_projectFileParams;
194 }
195 
196 
198 {
199  // Read library list and library path list
200  bool ret = Prj().ConfigLoad( Kiface().KifaceSearch(), GROUP_SCH, GetProjectFileParameters() );
201 
202  // Read schematic editor setup
203  ret &= Prj().ConfigLoad( Kiface().KifaceSearch(), GROUP_SCH_EDIT, GetProjectFileParameters() );
204 
205  // Verify some values, because the config file can be edited by hand,
206  // and have bad values:
209 
210  // Load the page layout decr file, from the filename stored in
211  // BASE_SCREEN::m_PageLayoutDescrFileName, read in config project file
212  // If empty, or not existing, the default descr is loaded
215  Prj().GetProjectPath() );
216 
217  pglayout.SetPageLayout( filename );
218 
219  return ret;
220 }
221 
222 
223 void SCH_EDIT_FRAME::SaveProjectSettings( bool aAskForSave )
224 {
225  PROJECT& prj = Prj();
226  wxFileName fn = g_RootSheet->GetScreen()->GetFileName(); //ConfigFileName
227 
228  fn.SetExt( ProjectFileExtension );
229 
230  if( !IsWritable( fn ) )
231  return;
232 
233  if( aAskForSave )
234  {
235  wxFileDialog dlg( this, _( "Save Project File" ), fn.GetPath(), fn.GetFullName(),
236  ProjectFileWildcard(), wxFD_SAVE );
237 
238  if( dlg.ShowModal() == wxID_CANCEL )
239  return;
240 
241  fn = dlg.GetPath();
242  }
243 
244  wxString path = fn.GetFullPath();
245 
246  prj.ConfigSave( Kiface().KifaceSearch(), GROUP_SCH_EDIT, GetProjectFileParameters(), path );
247 }
248 
251 
252 const wxChar RescueNeverShowEntry[] = wxT( "RescueNeverShow" );
253 const wxChar AutoplaceFieldsEntry[] = wxT( "AutoplaceFields" );
254 const wxChar AutoplaceJustifyEntry[] = wxT( "AutoplaceJustify" );
255 const wxChar AutoplaceAlignEntry[] = wxT( "AutoplaceAlign" );
256 static const wxChar DragActionIsMoveEntry[] = wxT( "DragActionIsMove" );
257 static const wxChar FootprintPreviewEntry[] = wxT( "FootprintPreview" );
258 static const wxChar DefaultBusWidthEntry[] = wxT( "DefaultBusWidth" );
259 static const wxChar DefaultWireWidthEntry[] = wxT( "DefaultWireWidth" );
260 static const wxChar DefaultDrawLineWidthEntry[] = wxT( "DefaultDrawLineWidth" );
261 static const wxChar DefaultJctSizeEntry[] = wxT( "DefaultJunctionSize" );
262 static const wxChar ShowHiddenPinsEntry[] = wxT( "ShowHiddenPins" );
263 static const wxChar HorzVertLinesOnlyEntry[] = wxT( "HorizVertLinesOnly" );
264 static const wxChar FieldNamesEntry[] = wxT( "FieldNames" );
265 static const wxString TextMarkupFlagsEntry = "TextMarkupFlags";
266 static const wxString ShowPageLimitsEntry = "ShowPageLimits";
267 static const wxString UnitsEntry = "Units";
268 static const wxString PrintMonochromeEntry = "PrintMonochrome";
269 static const wxString PrintSheetRefEntry = "PrintSheetReferenceAndTitleBlock";
270 static const wxString RepeatStepXEntry = "RepeatStepX";
271 static const wxString RepeatStepYEntry = "RepeatStepY";
272 static const wxString RepeatLabelIncrementEntry = "RepeatLabelIncrement";
273 static const wxString ShowIllegalSymboLibDialog = "ShowIllegalSymbolLibDialog";
274 
275 // Library editor wxConfig entry names.
276 static const wxChar defaultLibWidthEntry[] = wxT( "LibeditLibWidth" );
277 static const wxChar defaultPinNumSizeEntry[] = wxT( "LibeditPinNumSize" );
278 static const wxChar defaultPinNameSizeEntry[] = wxT( "LibeditPinNameSize" );
279 static const wxChar DefaultPinLengthEntry[] = wxT( "DefaultPinLength" );
280 static const wxChar repeatLibLabelIncEntry[] = wxT( "LibeditRepeatLabelInc" );
281 static const wxChar pinRepeatStepEntry[] = wxT( "LibeditPinRepeatStep" );
282 static const wxChar repeatLibStepXEntry[] = wxT( "LibeditRepeatStepX" );
283 static const wxChar repeatLibStepYEntry[] = wxT( "LibeditRepeatStepY" );
284 static const wxChar showPinElectricalType[] = wxT( "LibeditShowPinElectricalType" );
285 
287 
289 {
290  if( !m_configSettings.empty() )
291  return m_configSettings;
292 
294  &m_showPageLimits, true ) );
295  m_configSettings.push_back( new PARAM_CFG_INT( true, UnitsEntry,
296  (int*)&m_userUnits, MILLIMETRES ) );
297 
299  &m_printMonochrome, true ) );
300  m_configSettings.push_back( new PARAM_CFG_BOOL( true, PrintSheetRefEntry,
301  &m_printSheetReference, true ) );
302 
303  m_configSettings.push_back( new PARAM_CFG_INT( true, RepeatStepXEntry,
306  m_configSettings.push_back( new PARAM_CFG_INT( true, RepeatStepYEntry,
311  -10, +10 ) );
313  &m_showIllegalSymbolLibDialog, true ) );
314 
315  return m_configSettings;
316 }
317 
318 
319 void SCH_EDIT_FRAME::LoadSettings( wxConfigBase* aCfg )
320 {
322 
323  long tmp;
324 
326 
327  // LibEdit owns this one, but we must read it in if LibEdit hasn't set it yet
328  if( GetDefaultLineThickness() < 0 )
329  {
332  }
333 
335 
336  // Property introduced in 6.0; use DefaultLineWidth for earlier projects
337  if( !aCfg->Read( DefaultWireWidthEntry, &tmp ) )
339 
340  SetDefaultWireThickness( (int) tmp );
341 
342  SetTextMarkupFlags( (int) aCfg->Read( TextMarkupFlagsEntry, 0L ) );
343 
344  if( aCfg->Read( DefaultJctSizeEntry, &tmp ) )
345  SCH_JUNCTION::SetSymbolSize( (int) tmp );
346 
347  aCfg->Read( DragActionIsMoveEntry, &m_dragActionIsMove, true );
348  aCfg->Read( ShowHiddenPinsEntry, &m_showAllPins, false );
349  aCfg->Read( HorzVertLinesOnlyEntry, &m_forceHVLines, true );
350  aCfg->Read( AutoplaceFieldsEntry, &m_autoplaceFields, true );
351  aCfg->Read( AutoplaceJustifyEntry, &m_autoplaceJustify, true );
352  aCfg->Read( AutoplaceAlignEntry, &m_autoplaceAlign, false );
353  aCfg->Read( FootprintPreviewEntry, &m_footprintPreview, false );
354 
355  wxString templateFieldNames = aCfg->Read( FieldNamesEntry, wxEmptyString );
356 
357  if( !templateFieldNames.IsEmpty() )
358  {
359  TEMPLATE_FIELDNAMES_LEXER lexer( TO_UTF8( templateFieldNames ) );
360 
361  try
362  {
363  m_templateFieldNames.Parse( &lexer );
364  }
365  catch( const IO_ERROR& DBG( e ) )
366  {
367  // @todo show error msg
368  DBG( printf( "templatefieldnames parsing error: '%s'\n", TO_UTF8( e.What() ) ); )
369  }
370  }
371 
372  auto painter = static_cast<KIGFX::SCH_PAINTER*>( GetCanvas()->GetView()->GetPainter() );
373  KIGFX::SCH_RENDER_SETTINGS* settings = painter->GetSettings();
374  settings->m_ShowPinsElectricalType = false;
375  settings->m_ShowHiddenText = false;
376  settings->m_ShowHiddenPins = m_showAllPins;
377  settings->SetShowPageLimits( m_showPageLimits );
378  settings->m_ShowUmbilicals = true;
379 }
380 
381 
382 void SCH_EDIT_FRAME::SaveSettings( wxConfigBase* aCfg )
383 {
385 
387 
389  aCfg->Write( DefaultBusWidthEntry, (long) GetDefaultBusThickness() );
390  aCfg->Write( DefaultWireWidthEntry, (long) GetDefaultWireThickness() );
391  aCfg->Write( DefaultJctSizeEntry, (long) SCH_JUNCTION::GetSymbolSize() );
392  aCfg->Write( ShowHiddenPinsEntry, m_showAllPins );
393  aCfg->Write( HorzVertLinesOnlyEntry, GetForceHVLines() );
394  aCfg->Write( AutoplaceFieldsEntry, m_autoplaceFields );
396  aCfg->Write( AutoplaceAlignEntry, m_autoplaceAlign );
398 
399  // Save template fieldnames
400  STRING_FORMATTER sf;
401  m_templateFieldNames.Format( &sf, 0 );
402 
403  wxString record = FROM_UTF8( sf.GetString().c_str() );
404  record.Replace( wxT("\n"), wxT(""), true ); // strip all newlines
405  record.Replace( wxT(" "), wxT(" "), true ); // double space to single
406 
407  aCfg->Write( FieldNamesEntry, record );
408 
409  aCfg->Write( TextMarkupFlagsEntry, GetTextMarkupFlags() );
410 }
411 
412 
413 void LIB_EDIT_FRAME::LoadSettings( wxConfigBase* aCfg )
414 {
416 
424 
425  wxPoint step;
426  aCfg->Read( repeatLibStepXEntry, &step.x, DEFAULT_REPEAT_OFFSET_X );
427  aCfg->Read( repeatLibStepYEntry, &step.y, DEFAULT_REPEAT_OFFSET_Y );
428  SetRepeatStep( step );
429  m_showPinElectricalTypeName = aCfg->ReadBool( showPinElectricalType, true );
431 
432  wxString templateFieldNames = aCfg->Read( FieldNamesEntry, wxEmptyString );
433 
434  if( !templateFieldNames.IsEmpty() )
435  {
436  TEMPLATE_FIELDNAMES_LEXER lexer( TO_UTF8( templateFieldNames ) );
437 
438  try
439  {
440  m_templateFieldNames.Parse( &lexer );
441  }
442  catch( const IO_ERROR& DBG( e ) )
443  {
444  // @todo show error msg
445  DBG( printf( "templatefieldnames parsing error: '%s'\n", TO_UTF8( e.What() ) ); )
446  }
447  }
448 
449  auto painter = static_cast<KIGFX::SCH_PAINTER*>( GetCanvas()->GetView()->GetPainter() );
450  KIGFX::SCH_RENDER_SETTINGS* settings = painter->GetSettings();
452 
453  // Hidden elements must be editable
454  settings->m_ShowHiddenText = true;
455  settings->m_ShowHiddenPins = true;
456  settings->m_ShowUmbilicals = false;
457 }
458 
459 
460 void LIB_EDIT_FRAME::SaveSettings( wxConfigBase* aCfg )
461 {
463 
465  aCfg->Write( DefaultPinLengthEntry, GetDefaultPinLength() );
469  aCfg->Write( pinRepeatStepEntry, GetRepeatPinStep() );
470  aCfg->Write( repeatLibStepXEntry, GetRepeatStep().x );
471  aCfg->Write( repeatLibStepYEntry, GetRepeatStep().y );
473  aCfg->Write( defaultLibWidthEntry, m_treePane->GetSize().x );
474 }
475 
476 
478  PANEL_HOTKEYS_EDITOR* aHotkeysPanel )
479 {
480  wxTreebook* book = aParent->GetTreebook();
481 
482  book->AddPage( new wxPanel( book ), _( "Symbol Editor" ) );
483  book->AddSubPage( new PANEL_DISPLAY_OPTIONS( this, aParent ), _( "Display Options" ) );
484  book->AddSubPage( new PANEL_LIBEDIT_SETTINGS( this, book ), _( "Defaults" ) );
485 
486  aHotkeysPanel->AddHotKeys( GetToolManager() );
487 }
488 
489 
490 SYMBOL_LIB_TABLE* PROJECT::SchSymbolLibTable()
491 {
492  // This is a lazy loading function, it loads the project specific table when
493  // that table is asked for, not before.
495 
496  // its gotta be NULL or a SYMBOL_LIB_TABLE, or a bug.
497  wxASSERT( !tbl || tbl->Type() == SYMBOL_LIB_TABLE_T );
498 
499  if( !tbl )
500  {
501  // Stack the project specific SYMBOL_LIB_TABLE overlay on top of the global table.
502  // ~SYMBOL_LIB_TABLE() will not touch the fallback table, so multiple projects may
503  // stack this way, all using the same global fallback table.
505 
507 
508  wxString prjPath;
509 
510  wxGetEnv( PROJECT_VAR_NAME, &prjPath );
511 
512  if( !prjPath.IsEmpty() )
513  {
514  wxFileName fn( prjPath, SYMBOL_LIB_TABLE::GetSymbolLibTableFileName() );
515 
516  try
517  {
518  tbl->Load( fn.GetFullPath() );
519  }
520  catch( const IO_ERROR& ioe )
521  {
522  wxString msg;
523  msg.Printf( _( "An error occurred loading the symbol library table \"%s\"." ),
524  fn.GetFullPath() );
525  DisplayErrorMessage( NULL, msg, ioe.What() );
526  }
527  }
528  }
529 
530  return tbl;
531 }
static const wxChar defaultLibWidthEntry[]
static int s_defaultTextSize
WS_DATA_MODEL handles the graphic items list to draw/plot the frame and title block.
Definition: ws_data_model.h:39
static const wxString & GetSymbolLibTableFileName()
static SYMBOL_LIB_TABLE & GetGlobalLibTable()
A list of parameters type.
void SetTextMarkupFlags(int aMarkupFlags)
#define DEFAULTPINLENGTH
The default pin number size when creating pins(can be changed in preference menu)
Definition: general.h:64
VTBL_ENTRY void ConfigSave(const SEARCH_STACK &aSList, const wxString &aGroupName, const PARAM_CFG_ARRAY &aParams, const wxString &aFileName=wxEmptyString)
Function ConfigSave saves the current "project" parameters into the wxConfigBase* derivative.
Definition: project.cpp:323
static const wxString RepeatLabelIncrementEntry
const wxString & GetFileName() const
Definition: sch_screen.h:123
#define DEFAULT_SIZE_TEXT
This is the "default-of-the-default" hardcoded text size; individual application define their own def...
Definition: eda_text.h:69
static const wxChar HorzVertLinesOnlyEntry[]
TOOL_MANAGER * GetToolManager() const
Return the MVC controller.
int GetDefaultWireThickness()
Default line thickness used to draw/plot wires.
static int * SubpartFirstIdPtr()
return a reference to m_subpartFirstId, only for read/save setting functions
static int s_textMarkupFlags
Class PROJECT holds project specific data.
Definition: project.h:58
static wxString FROM_UTF8(const char *cstring)
function FROM_UTF8 converts a UTF8 encoded C string to a wxString for all wxWidgets build modes.
Definition: macros.h:62
const wxChar AutoplaceFieldsEntry[]
void DisplayErrorMessage(wxWindow *aParent, const wxString &aText, const wxString &aExtraInfo)
Display an error message with aMessage.
Definition: confirm.cpp:249
void SetDefaultWireThickness(int aThickness)
This file is part of the common library TODO brief description.
bool check_unique_global_labels
If true, check to ensure that each global label apperas more than once.
Definition: erc_settings.h:67
PARAM_CFG_ARRAY m_projectFileParams
void InstallPreferences(PAGED_DIALOG *aParent, PANEL_HOTKEYS_EDITOR *aHotkeysPanel) override
Allows Libedit to install its preferences panel into the preferences dialog.
void SetDefaultBusThickness(int aThickness)
void Format(OUTPUTFORMATTER *out, int nestLevel) const
Function Format serializes this object out as text into the given OUTPUTFORMATTER.
This file is part of the common library.
static const wxChar repeatLibStepYEntry[]
const std::string ProjectFileExtension
#define DEFAULT_REPEAT_LABEL_INC
the default value (overwritten by the eeschema config)
Definition: general.h:51
void SetRepeatDeltaLabel(int aDelta)
Sets the repeat delta label value for repeat command.
static const wxString ShowPageLimitsEntry
static const wxString RepeatStepYEntry
void SetRepeatPinStep(int aStep)
#define PROJECT_VAR_NAME
A variable name whose value holds the current project directory.
Definition: project.h:37
int GetDefaultLineThickness()
Default line thickness used to draw/plot items having a default thickness line value (i....
static int GetDefaultPinLength()
static const wxChar defaultPinNumSizeEntry[]
TEMPLATES m_templateFieldNames
wxPoint m_repeatStep
PARAM_CFG_ARRAY & GetConfigurationSettings()
Return the Eeschema applications settings.
bool write_erc_file
If true, write ERC results to a file.
Definition: erc_settings.h:61
void SaveSettings(wxConfigBase *aCfg) override
Saves common frame parameters to a configuration data file.
static const wxString PrintSheetRefEntry
PARAM_CFG_ARRAY & GetProjectFileParameters()
Return the project file parameter list for Eeschema.
const wxChar RescueNeverShowEntry[]
static int s_defaultBusThickness
static const wxString ShowIllegalSymboLibDialog
void AddHotKeys(TOOL_MANAGER *aToolMgr)
void SetPageLayout(const wxString &aFullFileName=wxEmptyString, bool Append=false)
Populates the list with a custom layout, or the default layout, if no custom layout available.
int GetTextMarkupFlags()
#define DEFAULT_REPEAT_OFFSET_PIN
the default value (overwritten by the eeschema config)
Definition: general.h:52
VTBL_ENTRY _ELEM * GetElem(ELEM_T aIndex)
Typically wrapped somewhere else in a more meaningful function wrapper.
Definition: project.cpp:205
bool IsWritable(const wxFileName &aFileName)
Checks if aFileName can be written.
bool check_bus_to_bus_conflicts
If true, check that bus-to-bus connections share at least one member.
Definition: erc_settings.h:76
static const wxString UnitsEntry
bool m_autoplaceAlign
align autoplaced fields to the grid
SCH_SCREEN * GetScreen()
Definition: sch_sheet.h:281
static const wxChar repeatLibLabelIncEntry[]
static const wxString TextMarkupFlagsEntry
COLOR4D GetInvisibleItemColor()
void SaveSettings(wxConfigBase *aCfg) override
Saves common frame parameters to a configuration data file.
KIFACE_I & Kiface()
Global KIFACE_I "get" accessor.
Definition: kicad.cpp:51
Configuration parameter - PARAM_CFG_FILENAME Class Same as PARAM_CFG_WXSTRING, but stores "\" as "/".
void SaveProjectSettings(bool aAskForSave) override
Save changes to the project settings to the project (.pro) file.
static void SetSymbolSize(int aSize)
Definition: sch_junction.h:55
static const wxChar FootprintPreviewEntry[]
static WS_DATA_MODEL & GetTheInstance()
static function: returns the instance of WS_DATA_MODEL used in the application
void SetDefaultLineThickness(int aThickness)
VTBL_ENTRY void SetElem(ELEM_T aIndex, _ELEM *aElem)
Definition: project.cpp:217
static wxString m_PageLayoutDescrFileName
the name of the page layout descr file, or emty to used the default pagelayout
Definition: base_screen.h:109
wxTreebook * GetTreebook()
Definition: paged_dialog.h:43
static const wxChar DefaultDrawLineWidthEntry[]
#define TO_UTF8(wxstring)
Macro TO_UTF8 converts a wxString to a UTF8 encoded C string for all wxWidgets build modes.
Definition: macros.h:48
static int GetPinNumDefaultSize()
void SetDefaultTextSize(int aTextSize)
static int GetSubpartIdSeparator()
bool m_forceHVLines
force H or V directions for wires, bus, line
static const wxString PrintMonochromeEntry
bool m_footprintPreview
whether to show footprint previews
static int s_drawDefaultLineThickness
SCH_SHEET * g_RootSheet
Definition: eeschema.cpp:47
static const wxString RepeatStepXEntry
void LoadSettings(wxConfigBase *aCfg) override
Load common frame parameters from a configuration file.
virtual const wxString What() const
A composite of Problem() and Where()
Definition: exceptions.cpp:33
static const wxChar DragActionIsMoveEntry[]
KICAD_T Type() override
const wxChar AutoplaceAlignEntry[]
static int GetSubpartFirstId()
bool GetForceHVLines() const
PROJECT & Prj() const
Function Prj returns a reference to the PROJECT "associated with" this KIWAY.
SCH_DRAW_PANEL * GetCanvas() const override
Return a pointer to GAL-based canvas of given EDA draw frame.
bool check_bus_to_net_conflicts
If true, check that bus wires don't graphically connect to net objects (or vice versa)
Definition: erc_settings.h:79
Configuration parameter - Integer Class.
bool check_bus_driver_conflicts
If true, check that buses don't have conflicting drivers.
Definition: erc_settings.h:70
ERC_SETTINGS m_ercSettings
static const wxChar DefaultBusWidthEntry[]
Definition of file extensions used in Kicad.
const wxPoint GetRepeatStep() const
#define GROUP_SCH
Definition: config_params.h:44
#define GROUP_SCH_EDIT
Definition: config_params.h:45
static int m_textPinNumDefaultSize
Configuration parameter - Boolean Class.
bool LoadProjectFile()
Loads the KiCad project file (*.pro) settings specific to Eeschema.
#define DEFAULT_REPEAT_OFFSET_Y
the default Y value (overwritten by the eeschema config)
Definition: general.h:49
const std::string & GetString()
Definition: richio.h:475
bool m_printMonochrome
Print monochrome instead of grey scale.
static int s_defaultWireThickness
#define DEFAULTDRAWLINETHICKNESS
The default pin len value when creating pins(can be changed in preference menu)
Definition: general.h:61
void Load(const wxString &aFileName)
Load the library table using the path defined by aFileName aFallBackTable.
#define DEFAULTBUSTHICKNESS
The thickness to draw lines that thickness is set to 0 (default thickness) (can be changed in prefere...
Definition: general.h:57
bool m_showPinElectricalTypeName
#define _(s)
Configuration parameter - wxString Class.
void SaveSettings(wxConfigBase *aCfg) override
Saves common frame parameters to a configuration data file.
void Parse(TEMPLATE_FIELDNAMES_LEXER *in)
Function Parse fills this object from information in the input stream handled by TEMPLATE_FIELDNAMES_...
void LoadSettings(wxConfigBase *aCfg) override
Load common frame parameters from a configuration file.
PARAM_CFG_ARRAY m_configSettings
bool m_autoplaceFields
automatically place component fields
void LoadSettings(wxConfigBase *aCfg) override
Load common frame parameters from a configuration file.
#define DEFAULT_REPEAT_OFFSET_X
the default X value (overwritten by the eeschema config)
Definition: general.h:48
bool m_showIllegalSymbolLibDialog
wxString ProjectFileWildcard()
static int m_textPinNameDefaultSize
static const wxChar pinRepeatStepEntry[]
static const wxChar DefaultPinLengthEntry[]
bool m_showAllPins
Flag to indicate show hidden pins.
bool m_printSheetReference
static const wxChar ShowHiddenPinsEntry[]
void wxConfigSaveSetups(wxConfigBase *aCfg, const PARAM_CFG_ARRAY &aList)
Function wxConfigSaveSetups writes aList of PARAM_CFG_ARRAY elements to save configuration values to ...
#define REPEAT_OFFSET_MAX
the max value of repeat offset value
Definition: general.h:50
see class PGM_BASE
EDA_UNITS_T m_userUnits
void InstallPreferences(PAGED_DIALOG *aParent, PANEL_HOTKEYS_EDITOR *aHotkeysPanel) override
Allows Eeschema to install its preferences panels into the preferences dialog.
static const wxString MakeFullFileName(const wxString &aShortFileName, const wxString &aProjectPath)
Static function.
#define DEFAULTLIBWIDTH
Definition: general.h:73
static int GetPinNameDefaultSize()
#define max(a, b)
Definition: auxiliary.h:86
wxString m_plotDirectoryName
The name of the destination directory to use when generating plot files.
static void SetSubpartIdNotation(int aSep, int aFirstId)
Set the separator char between the subpart id and the reference 0 (no separator) or '.
bool m_autoplaceJustify
allow autoplace to change justification
static int GetSymbolSize()
Definition: sch_junction.h:54
static const wxChar DefaultWireWidthEntry[]
static const wxChar repeatLibStepXEntry[]
int GetRepeatDeltaLabel() const
bool check_bus_entry_conflicts
If true, check that wires connecting to buses actually exist in the bus.
Definition: erc_settings.h:73
static int * SubpartIdSeparatorPtr()
return a reference to m_subpartIdSeparator, only for read/save setting functions
static const wxChar defaultPinNameSizeEntry[]
static const wxChar DefaultJctSizeEntry[]
static const wxChar showPinElectricalType[]
#define DEFAULTPINNAMESIZE
The default library pane width.
Definition: general.h:70
Class SCH_RENDER_SETTINGS Stores schematic-specific render settings.
Definition: sch_painter.h:70
void SetRepeatStep(const wxPoint &aStep)
Sets the repeat step value for repeat command.
wxString m_netListFormat
The name of the format to use when generating a net list.
bool check_similar_labels
If true, check each sheet for labels that differ only by letter case.
Definition: erc_settings.h:64
COLOR4D GetItemSelectedColor()
#define DBG(x)
Definition: fctsys.h:33
VTBL_ENTRY bool ConfigLoad(const SEARCH_STACK &aSearchS, const wxString &aGroupName, const PARAM_CFG_ARRAY &aParams, const wxString &aForeignConfigFileName=wxEmptyString)
Function ConfigLoad reads a subset of parameters from the "project" file.
Definition: project.cpp:358
Definition for part library class.
#define DEFAULTPINNUMSIZE
The default pin name size when creating pins(can be changed in preference menu)
Definition: general.h:67
int GetRepeatPinStep() const
static void SetDefaultPinLength(int aLength)
SYMBOL_TREE_PANE * m_treePane
Class STRING_FORMATTER implements OUTPUTFORMATTER to a memory buffer.
Definition: richio.h:445
void wxConfigLoadSetups(wxConfigBase *aCfg, const PARAM_CFG_ARRAY &aList)
Function wxConfigLoadSetups uses aList of PARAM_CFG_ARRAY elements to load configuration values from ...
bool m_spiceAjustPassiveValues
Use netcodes (net number) as net names when generating spice net lists.
Struct IO_ERROR is a class used to hold an error message and may be used when throwing exceptions con...
Definition: ki_exception.h:76
int GetDefaultBusThickness()
Default line thickness used to draw/plot busses.
const wxChar AutoplaceJustifyEntry[]
static const wxChar FieldNamesEntry[]
int GetDefaultTextSize()
Default size for text in general.
void SetShowPageLimits(bool aDraw)
Definition: painter.h:188
bool GetShowElectricalType()
Allow some frames to show/hide pin electrical type names.
Class COLOR4D is the color representation with 4 components: red, green, blue, alpha.
Definition: color4d.h:39
Definition: colors.h:62