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 
55 
57 {
58  return s_defaultBusThickness;
59 }
60 
61 
62 void SetDefaultBusThickness( int aThickness)
63 {
64  s_defaultBusThickness = std::max( 1, aThickness );
65 }
66 
67 
69 {
71 }
72 
73 
74 void SetDefaultWireThickness( int aThickness )
75 {
76  s_defaultWireThickness = std::max( 1, aThickness );
77 }
78 
79 
81 {
82  return s_defaultTextSize;
83 }
84 
85 
86 void SetDefaultTextSize( int aTextSize )
87 {
88  s_defaultTextSize = aTextSize;
89 }
90 
91 
93 {
95 }
96 
97 
98 void SetDefaultLineThickness( int aThickness )
99 {
100  s_drawDefaultLineThickness = std::max( 1, aThickness );
101 }
102 
103 
104 // Color to draw selected items
106 {
107  return COLOR4D( BROWN );
108 }
109 
110 
111 // Color to draw items flagged invisible, in libedit (they are invisible in Eeschema)
113 {
114  return COLOR4D( DARKGRAY );
115 }
116 
117 
119  PANEL_HOTKEYS_EDITOR* aHotkeysPanel )
120 {
121  wxTreebook* book = aParent->GetTreebook();
122 
123  book->AddPage( new wxPanel( book ), _( "Eeschema" ) );
124  book->AddSubPage( new PANEL_EESCHEMA_DISPLAY_OPTIONS( this, book ), _( "Display Options" ) );
125  book->AddSubPage( new PANEL_EESCHEMA_SETTINGS( this, book ), _( "Editing Options" ) );
126  book->AddSubPage( new PANEL_EESCHEMA_COLOR_CONFIG( this, book ), _( "Colors" ) );
127  book->AddSubPage( new PANEL_EESCHEMA_TEMPLATE_FIELDNAMES( this, book ),
128  _( "Field Name Templates" ) );
129 
130  aHotkeysPanel->AddHotKeys( GetToolManager() );
131 }
132 
133 
135 
136 {
137  if( !m_projectFileParams.empty() )
138  return m_projectFileParams;
139 
140  m_projectFileParams.push_back( new PARAM_CFG_FILENAME( wxT( "PageLayoutDescrFile" ),
142 
143  m_projectFileParams.push_back( new PARAM_CFG_FILENAME( wxT( "PlotDirectoryName" ),
144  &m_plotDirectoryName ) );
145 
146  m_projectFileParams.push_back( new PARAM_CFG_INT( wxT( "SubpartIdSeparator" ),
147  LIB_PART::SubpartIdSeparatorPtr(), 0, 0, 126 ) );
148  m_projectFileParams.push_back( new PARAM_CFG_INT( wxT( "SubpartFirstId" ),
149  LIB_PART::SubpartFirstIdPtr(), 'A', '1', 'z' ) );
150 
151  m_projectFileParams.push_back( new PARAM_CFG_WXSTRING( wxT( "NetFmtName" ),
152  &m_netListFormat) );
153  m_projectFileParams.push_back( new PARAM_CFG_BOOL( wxT( "SpiceAjustPassiveValues" ),
154  &m_spiceAjustPassiveValues, false ) );
155 
156  m_projectFileParams.push_back( new PARAM_CFG_INT( wxT( "LabSize" ),
157  &s_defaultTextSize, DEFAULT_SIZE_TEXT, 5, 1000 ) );
158 
159  m_projectFileParams.push_back( new PARAM_CFG_BOOL( wxT( "ERC_WriteFile" ),
160  &m_ercSettings.write_erc_file, false ) );
161 
162  m_projectFileParams.push_back( new PARAM_CFG_BOOL( wxT( "ERC_TestSimilarLabels" ),
164 
165  m_projectFileParams.push_back( new PARAM_CFG_BOOL( wxT( "ERC_CheckUniqueGlobalLabels" ),
167 
168  m_projectFileParams.push_back( new PARAM_CFG_BOOL( wxT( "ERC_CheckBusDriverConflicts" ),
170 
171  m_projectFileParams.push_back( new PARAM_CFG_BOOL( wxT( "ERC_CheckBusEntryConflicts" ),
173 
174  m_projectFileParams.push_back( new PARAM_CFG_BOOL( wxT( "ERC_CheckBusToBusConflicts" ),
176 
177  m_projectFileParams.push_back( new PARAM_CFG_BOOL( wxT( "ERC_CheckBusToNetConflicts" ),
179 
180  return m_projectFileParams;
181 }
182 
183 
185 {
186  // Read library list and library path list
187  bool ret = Prj().ConfigLoad( Kiface().KifaceSearch(), GROUP_SCH, GetProjectFileParameters() );
188 
189  // Read schematic editor setup
190  ret &= Prj().ConfigLoad( Kiface().KifaceSearch(), GROUP_SCH_EDIT, GetProjectFileParameters() );
191 
192  // Verify some values, because the config file can be edited by hand,
193  // and have bad values:
196 
197  // Load the page layout decr file, from the filename stored in
198  // BASE_SCREEN::m_PageLayoutDescrFileName, read in config project file
199  // If empty, or not existing, the default descr is loaded
202  Prj().GetProjectPath() );
203 
204  pglayout.SetPageLayout( filename );
205 
206  return ret;
207 }
208 
209 
210 void SCH_EDIT_FRAME::SaveProjectSettings( bool aAskForSave )
211 {
212  PROJECT& prj = Prj();
213  wxFileName fn = g_RootSheet->GetScreen()->GetFileName(); //ConfigFileName
214 
215  fn.SetExt( ProjectFileExtension );
216 
217  if( !IsWritable( fn ) )
218  return;
219 
220  if( aAskForSave )
221  {
222  wxFileDialog dlg( this, _( "Save Project File" ), fn.GetPath(), fn.GetFullName(),
223  ProjectFileWildcard(), wxFD_SAVE );
224 
225  if( dlg.ShowModal() == wxID_CANCEL )
226  return;
227 
228  fn = dlg.GetPath();
229  }
230 
231  wxString path = fn.GetFullPath();
232 
233  prj.ConfigSave( Kiface().KifaceSearch(), GROUP_SCH_EDIT, GetProjectFileParameters(), path );
234 }
235 
238 
239 const wxChar RescueNeverShowEntry[] = wxT( "RescueNeverShow" );
240 const wxChar AutoplaceFieldsEntry[] = wxT( "AutoplaceFields" );
241 const wxChar AutoplaceJustifyEntry[] = wxT( "AutoplaceJustify" );
242 const wxChar AutoplaceAlignEntry[] = wxT( "AutoplaceAlign" );
243 static const wxChar DragActionIsMoveEntry[] = wxT( "DragActionIsMove" );
244 static const wxChar FootprintPreviewEntry[] = wxT( "FootprintPreview" );
245 static const wxChar DefaultBusWidthEntry[] = wxT( "DefaultBusWidth" );
246 static const wxChar DefaultWireWidthEntry[] = wxT( "DefaultWireWidth" );
247 static const wxChar DefaultDrawLineWidthEntry[] = wxT( "DefaultDrawLineWidth" );
248 static const wxChar DefaultJctSizeEntry[] = wxT( "DefaultJunctionSize" );
249 static const wxChar ShowHiddenPinsEntry[] = wxT( "ShowHiddenPins" );
250 static const wxChar HorzVertLinesOnlyEntry[] = wxT( "HorizVertLinesOnly" );
251 static const wxChar FieldNamesEntry[] = wxT( "FieldNames" );
252 static const wxString ShowPageLimitsEntry = "ShowPageLimits";
253 static const wxString UnitsEntry = "Units";
254 static const wxString PrintMonochromeEntry = "PrintMonochrome";
255 static const wxString PrintSheetRefEntry = "PrintSheetReferenceAndTitleBlock";
256 static const wxString RepeatStepXEntry = "RepeatStepX";
257 static const wxString RepeatStepYEntry = "RepeatStepY";
258 static const wxString RepeatLabelIncrementEntry = "RepeatLabelIncrement";
259 static const wxString ShowIllegalSymboLibDialog = "ShowIllegalSymbolLibDialog";
260 
261 // Library editor wxConfig entry names.
262 static const wxChar defaultLibWidthEntry[] = wxT( "LibeditLibWidth" );
263 static const wxChar defaultPinNumSizeEntry[] = wxT( "LibeditPinNumSize" );
264 static const wxChar defaultPinNameSizeEntry[] = wxT( "LibeditPinNameSize" );
265 static const wxChar DefaultPinLengthEntry[] = wxT( "DefaultPinLength" );
266 static const wxChar repeatLibLabelIncEntry[] = wxT( "LibeditRepeatLabelInc" );
267 static const wxChar pinRepeatStepEntry[] = wxT( "LibeditPinRepeatStep" );
268 static const wxChar repeatLibStepXEntry[] = wxT( "LibeditRepeatStepX" );
269 static const wxChar repeatLibStepYEntry[] = wxT( "LibeditRepeatStepY" );
270 static const wxChar showPinElectricalType[] = wxT( "LibeditShowPinElectricalType" );
271 
273 
275 {
276  if( !m_configSettings.empty() )
277  return m_configSettings;
278 
280  &m_showPageLimits, true ) );
281  m_configSettings.push_back( new PARAM_CFG_INT( true, UnitsEntry,
282  (int*)&m_userUnits, MILLIMETRES ) );
283 
285  &m_printMonochrome, true ) );
286  m_configSettings.push_back( new PARAM_CFG_BOOL( true, PrintSheetRefEntry,
287  &m_printSheetReference, true ) );
288 
289  m_configSettings.push_back( new PARAM_CFG_INT( true, RepeatStepXEntry,
292  m_configSettings.push_back( new PARAM_CFG_INT( true, RepeatStepYEntry,
297  -10, +10 ) );
299  &m_showIllegalSymbolLibDialog, true ) );
300 
301  return m_configSettings;
302 }
303 
304 
305 void SCH_EDIT_FRAME::LoadSettings( wxConfigBase* aCfg )
306 {
308 
309  long tmp;
310 
312 
313  // LibEdit owns this one, but we must read it in if LibEdit hasn't set it yet
314  if( GetDefaultLineThickness() < 0 )
315  {
318  }
319 
321 
322  // Property introduced in 6.0; use DefaultLineWidth for earlier projects
323  if( !aCfg->Read( DefaultWireWidthEntry, &tmp ) )
325 
326  SetDefaultWireThickness( (int) tmp );
327 
328  if( aCfg->Read( DefaultJctSizeEntry, &tmp ) )
329  SCH_JUNCTION::SetSymbolSize( (int) tmp );
330 
331  aCfg->Read( DragActionIsMoveEntry, &m_dragActionIsMove, true );
332  aCfg->Read( ShowHiddenPinsEntry, &m_showAllPins, false );
333  aCfg->Read( HorzVertLinesOnlyEntry, &m_forceHVLines, true );
334  aCfg->Read( AutoplaceFieldsEntry, &m_autoplaceFields, true );
335  aCfg->Read( AutoplaceJustifyEntry, &m_autoplaceJustify, true );
336  aCfg->Read( AutoplaceAlignEntry, &m_autoplaceAlign, false );
337  aCfg->Read( FootprintPreviewEntry, &m_footprintPreview, false );
338 
339  wxString templateFieldNames = aCfg->Read( FieldNamesEntry, wxEmptyString );
340 
341  if( !templateFieldNames.IsEmpty() )
342  {
343  TEMPLATE_FIELDNAMES_LEXER lexer( TO_UTF8( templateFieldNames ) );
344 
345  try
346  {
347  m_templateFieldNames.Parse( &lexer );
348  }
349  catch( const IO_ERROR& DBG( e ) )
350  {
351  // @todo show error msg
352  DBG( printf( "templatefieldnames parsing error: '%s'\n", TO_UTF8( e.What() ) ); )
353  }
354  }
355 
356  auto painter = static_cast<KIGFX::SCH_PAINTER*>( GetCanvas()->GetView()->GetPainter() );
357  KIGFX::SCH_RENDER_SETTINGS* settings = painter->GetSettings();
358  settings->m_ShowPinsElectricalType = false;
359  settings->m_ShowHiddenText = false;
360  settings->m_ShowHiddenPins = m_showAllPins;
361  settings->SetShowPageLimits( m_showPageLimits );
362  settings->m_ShowUmbilicals = true;
363 }
364 
365 
366 void SCH_EDIT_FRAME::SaveSettings( wxConfigBase* aCfg )
367 {
369 
371 
373  aCfg->Write( DefaultBusWidthEntry, (long) GetDefaultBusThickness() );
374  aCfg->Write( DefaultWireWidthEntry, (long) GetDefaultWireThickness() );
375  aCfg->Write( DefaultJctSizeEntry, (long) SCH_JUNCTION::GetSymbolSize() );
376  aCfg->Write( ShowHiddenPinsEntry, m_showAllPins );
377  aCfg->Write( HorzVertLinesOnlyEntry, GetForceHVLines() );
378  aCfg->Write( AutoplaceFieldsEntry, m_autoplaceFields );
380  aCfg->Write( AutoplaceAlignEntry, m_autoplaceAlign );
382 
383  // Save template fieldnames
384  STRING_FORMATTER sf;
385  m_templateFieldNames.Format( &sf, 0 );
386 
387  wxString record = FROM_UTF8( sf.GetString().c_str() );
388  record.Replace( wxT("\n"), wxT(""), true ); // strip all newlines
389  record.Replace( wxT(" "), wxT(" "), true ); // double space to single
390 
391  aCfg->Write( FieldNamesEntry, record );
392 }
393 
394 
395 void LIB_EDIT_FRAME::LoadSettings( wxConfigBase* aCfg )
396 {
398 
406 
407  wxPoint step;
408  aCfg->Read( repeatLibStepXEntry, &step.x, DEFAULT_REPEAT_OFFSET_X );
409  aCfg->Read( repeatLibStepYEntry, &step.y, DEFAULT_REPEAT_OFFSET_Y );
410  SetRepeatStep( step );
411  m_showPinElectricalTypeName = aCfg->ReadBool( showPinElectricalType, true );
413 
414  wxString templateFieldNames = aCfg->Read( FieldNamesEntry, wxEmptyString );
415 
416  if( !templateFieldNames.IsEmpty() )
417  {
418  TEMPLATE_FIELDNAMES_LEXER lexer( TO_UTF8( templateFieldNames ) );
419 
420  try
421  {
422  m_templateFieldNames.Parse( &lexer );
423  }
424  catch( const IO_ERROR& DBG( e ) )
425  {
426  // @todo show error msg
427  DBG( printf( "templatefieldnames parsing error: '%s'\n", TO_UTF8( e.What() ) ); )
428  }
429  }
430 
431  auto painter = static_cast<KIGFX::SCH_PAINTER*>( GetCanvas()->GetView()->GetPainter() );
432  KIGFX::SCH_RENDER_SETTINGS* settings = painter->GetSettings();
434 
435  // Hidden elements must be editable
436  settings->m_ShowHiddenText = true;
437  settings->m_ShowHiddenPins = true;
438  settings->m_ShowUmbilicals = false;
439 }
440 
441 
442 void LIB_EDIT_FRAME::SaveSettings( wxConfigBase* aCfg )
443 {
445 
447  aCfg->Write( DefaultPinLengthEntry, GetDefaultPinLength() );
451  aCfg->Write( pinRepeatStepEntry, GetRepeatPinStep() );
452  aCfg->Write( repeatLibStepXEntry, GetRepeatStep().x );
453  aCfg->Write( repeatLibStepYEntry, GetRepeatStep().y );
455  aCfg->Write( defaultLibWidthEntry, m_treePane->GetSize().x );
456 }
457 
458 
460  PANEL_HOTKEYS_EDITOR* aHotkeysPanel )
461 {
462  wxTreebook* book = aParent->GetTreebook();
463 
464  book->AddPage( new wxPanel( book ), _( "Symbol Editor" ) );
465  book->AddSubPage( new PANEL_DISPLAY_OPTIONS( this, aParent ), _( "Display Options" ) );
466  book->AddSubPage( new PANEL_LIBEDIT_SETTINGS( this, book ), _( "Defaults" ) );
467 
468  aHotkeysPanel->AddHotKeys( GetToolManager() );
469 }
470 
471 
472 SYMBOL_LIB_TABLE* PROJECT::SchSymbolLibTable()
473 {
474  // This is a lazy loading function, it loads the project specific table when
475  // that table is asked for, not before.
477 
478  // its gotta be NULL or a SYMBOL_LIB_TABLE, or a bug.
479  wxASSERT( !tbl || tbl->Type() == SYMBOL_LIB_TABLE_T );
480 
481  if( !tbl )
482  {
483  // Stack the project specific SYMBOL_LIB_TABLE overlay on top of the global table.
484  // ~SYMBOL_LIB_TABLE() will not touch the fallback table, so multiple projects may
485  // stack this way, all using the same global fallback table.
487 
489 
490  wxString prjPath;
491 
492  wxGetEnv( PROJECT_VAR_NAME, &prjPath );
493 
494  if( !prjPath.IsEmpty() )
495  {
496  wxFileName fn( prjPath, SYMBOL_LIB_TABLE::GetSymbolLibTableFileName() );
497 
498  try
499  {
500  tbl->Load( fn.GetFullPath() );
501  }
502  catch( const IO_ERROR& ioe )
503  {
504  wxString msg;
505  msg.Printf( _( "An error occurred loading the symbol library table \"%s\"." ),
506  fn.GetFullPath() );
507  DisplayErrorMessage( NULL, msg, ioe.What() );
508  }
509  }
510  }
511 
512  return tbl;
513 }
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.
#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
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.
#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[]
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