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 <gr_text.h>
48 #include "sch_junction.h"
49 
52 static int s_defaultTextSize = Mils2iu( DEFAULT_SIZE_TEXT );
54 static bool s_selectTextAsBox = false;
55 static bool s_selectDrawChildren = true;
56 static bool s_selectFillShapes = false;
58 
60 {
61  return s_defaultBusThickness;
62 }
63 
64 
65 void SetDefaultBusThickness( int aThickness )
66 {
67  s_defaultBusThickness = std::max( 1, aThickness );
68 }
69 
70 
72 {
74 }
75 
76 
77 void SetDefaultWireThickness( int aThickness )
78 {
79  s_defaultWireThickness = std::max( 1, aThickness );
80 }
81 
82 
84 {
85  return s_defaultTextSize;
86 }
87 
88 
89 void SetDefaultTextSize( int aTextSize )
90 {
91  s_defaultTextSize = aTextSize;
92 }
93 
94 
96 {
98 }
99 
100 
101 void SetDefaultLineThickness( int aThickness )
102 {
103  s_drawDefaultLineThickness = std::max( 1, aThickness );
104 }
105 
106 
108 {
109  return s_selectTextAsBox;
110 }
111 
112 
113 void SetSelectionTextAsBox( bool aBool )
114 {
115  s_selectTextAsBox = aBool;
116 }
117 
118 
120 {
121  return s_selectDrawChildren;
122 }
123 
124 
125 void SetSelectionDrawChildItems( bool aBool )
126 {
127  s_selectDrawChildren = aBool;
128 }
129 
130 
132 {
133  return s_selectFillShapes;
134 }
135 
136 
137 void SetSelectionFillShapes( bool aBool )
138 {
139  s_selectFillShapes = aBool;
140 }
141 
142 
144 {
145  return s_selectThickness;
146 }
147 
148 
149 void SetSelectionThickness( int aThickness )
150 {
151  s_selectThickness = aThickness;
152 }
153 
154 // Color to draw selected items
156 {
157  return COLOR4D( BROWN );
158 }
159 
160 
161 // Color to draw items flagged invisible, in libedit (they are invisible in Eeschema)
163 {
164  return COLOR4D( DARKGRAY );
165 }
166 
167 
169  PANEL_HOTKEYS_EDITOR* aHotkeysPanel )
170 {
171  wxTreebook* book = aParent->GetTreebook();
172 
173  book->AddPage( new wxPanel( book ), _( "Eeschema" ) );
174  book->AddSubPage( new PANEL_EESCHEMA_DISPLAY_OPTIONS( this, book ), _( "Display Options" ) );
175  book->AddSubPage( new PANEL_EESCHEMA_SETTINGS( this, book ), _( "Editing Options" ) );
176  book->AddSubPage( new PANEL_EESCHEMA_COLOR_CONFIG( this, book ), _( "Colors" ) );
177  book->AddSubPage( new PANEL_EESCHEMA_TEMPLATE_FIELDNAMES( this, book ),
178  _( "Field Name Templates" ) );
179 
180  aHotkeysPanel->AddHotKeys( GetToolManager() );
181 }
182 
183 
185 
186 {
187  if( !m_projectFileParams.empty() )
188  return m_projectFileParams;
189 
190  std::vector<PARAM_CFG*>& params = m_projectFileParams;
191 
192  params.push_back( new PARAM_CFG_FILENAME( wxT( "PageLayoutDescrFile" ),
194 
195  params.push_back( new PARAM_CFG_FILENAME( wxT( "PlotDirectoryName" ),
196  &m_plotDirectoryName ) );
197 
198  params.push_back( new PARAM_CFG_INT( wxT( "SubpartIdSeparator" ),
199  LIB_PART::SubpartIdSeparatorPtr(), 0, 0, 126 ) );
200  params.push_back( new PARAM_CFG_INT( wxT( "SubpartFirstId" ),
201  LIB_PART::SubpartFirstIdPtr(), 'A', '1', 'z' ) );
202 
203  params.push_back( new PARAM_CFG_WXSTRING( wxT( "NetFmtName" ),
204  &m_netListFormat) );
205  params.push_back( new PARAM_CFG_BOOL( wxT( "SpiceAjustPassiveValues" ),
206  &m_spiceAjustPassiveValues, false ) );
207 
208  params.push_back( new PARAM_CFG_INT( wxT( "LabSize" ),
209  &s_defaultTextSize, DEFAULT_SIZE_TEXT, 5, 1000 ) );
210 
211  params.push_back( new PARAM_CFG_BOOL( wxT( "ERC_WriteFile" ),
212  &m_ercSettings.write_erc_file, false ) );
213 
214  params.push_back( new PARAM_CFG_BOOL( wxT( "ERC_TestSimilarLabels" ),
216 
217  params.push_back( new PARAM_CFG_BOOL( wxT( "ERC_CheckUniqueGlobalLabels" ),
219 
220  params.push_back( new PARAM_CFG_BOOL( wxT( "ERC_CheckBusDriverConflicts" ),
222 
223  params.push_back( new PARAM_CFG_BOOL( wxT( "ERC_CheckBusEntryConflicts" ),
225 
226  params.push_back( new PARAM_CFG_BOOL( wxT( "ERC_CheckBusToBusConflicts" ),
228 
229  params.push_back( new PARAM_CFG_BOOL( wxT( "ERC_CheckBusToNetConflicts" ),
231 
232  return params;
233 }
234 
235 
237 {
238  // Read library list and library path list
239  bool ret = Prj().ConfigLoad( Kiface().KifaceSearch(), GROUP_SCH, GetProjectFileParameters() );
240 
241  // Read schematic editor setup
242  ret &= Prj().ConfigLoad( Kiface().KifaceSearch(), GROUP_SCH_EDIT, GetProjectFileParameters() );
243 
244  // Convert default text size to internal units.
245  SetDefaultTextSize( Mils2iu( GetDefaultTextSize() ) );
246 
247  // Verify some values, because the config file can be edited by hand,
248  // and have bad values:
251 
252  // Load the page layout decr file, from the filename stored in
253  // BASE_SCREEN::m_PageLayoutDescrFileName, read in config project file
254  // If empty, or not existing, the default descr is loaded
257  Prj().GetProjectPath() );
258 
259  pglayout.SetPageLayout( filename );
260 
261  return ret;
262 }
263 
264 
265 void SCH_EDIT_FRAME::SaveProjectSettings( bool aAskForSave )
266 {
267  PROJECT& prj = Prj();
268  wxFileName fn = g_RootSheet->GetScreen()->GetFileName(); //ConfigFileName
269 
270  fn.SetExt( ProjectFileExtension );
271 
272  if( !IsWritable( fn ) )
273  return;
274 
275  if( aAskForSave )
276  {
277  wxFileDialog dlg( this, _( "Save Project File" ), fn.GetPath(), fn.GetFullName(),
278  ProjectFileWildcard(), wxFD_SAVE );
279 
280  if( dlg.ShowModal() == wxID_CANCEL )
281  return;
282 
283  fn = dlg.GetPath();
284  }
285 
286  wxString path = fn.GetFullPath();
287 
288  // Convert default text size from internal units temporarily.
289  SetDefaultTextSize( Iu2Mils( GetDefaultTextSize() ) );
290 
291  prj.ConfigSave( Kiface().KifaceSearch(), GROUP_SCH_EDIT, GetProjectFileParameters(), path );
292 
293  SetDefaultTextSize( Mils2iu( GetDefaultTextSize() ) );
294 }
295 
298 
299 const wxChar RescueNeverShowEntry[] = wxT( "RescueNeverShow" );
300 const wxChar AutoplaceFieldsEntry[] = wxT( "AutoplaceFields" );
301 const wxChar AutoplaceJustifyEntry[] = wxT( "AutoplaceJustify" );
302 const wxChar AutoplaceAlignEntry[] = wxT( "AutoplaceAlign" );
303 static const wxChar DragActionIsMoveEntry[] = wxT( "DragActionIsMove" );
304 static const wxChar FootprintPreviewEntry[] = wxT( "FootprintPreview" );
305 static const wxChar NavigatorStaysOpenEntry[] = wxT( "NavigatorStaysOpen" );
306 static const wxChar DefaultBusWidthEntry[] = wxT( "DefaultBusWidth" );
307 static const wxChar DefaultWireWidthEntry[] = wxT( "DefaultWireWidth" );
308 static const wxChar DefaultDrawLineWidthEntry[] = wxT( "DefaultDrawLineWidth" );
309 static const wxChar DefaultJctSizeEntry[] = wxT( "DefaultJunctionSize" );
310 static const wxChar ShowHiddenPinsEntry[] = wxT( "ShowHiddenPins" );
311 static const wxChar HorzVertLinesOnlyEntry[] = wxT( "HorizVertLinesOnly" );
312 static const wxChar FieldNamesEntry[] = wxT( "FieldNames" );
313 static const wxString TextMarkupFlagsEntry = "TextMarkupFlags";
314 static const wxString ShowPageLimitsEntry = "ShowPageLimits";
315 static const wxString UnitsEntry = "Units";
316 static const wxString PrintMonochromeEntry = "PrintMonochrome";
317 static const wxString PrintSheetRefEntry = "PrintSheetReferenceAndTitleBlock";
318 static const wxString RepeatStepXEntry = "RepeatStepX";
319 static const wxString RepeatStepYEntry = "RepeatStepY";
320 static const wxString RepeatLabelIncrementEntry = "RepeatLabelIncrement";
321 static const wxString ShowIllegalSymboLibDialog = "ShowIllegalSymbolLibDialog";
322 static const wxString showSheetFileNameCaseSensitivityDlg = "ShowSheetFileNameCaseSensitivityDlg";
323 static const wxString SelectPinSelectSymbolEntry = "SelectPinSelectSymbolOpt";
324 
325 // Library editor wxConfig entry names.
326 static const wxChar defaultLibWidthEntry[] = wxT( "LibeditLibWidth" );
327 static const wxChar defaultPinNumSizeEntry[] = wxT( "LibeditPinNumSize" );
328 static const wxChar defaultPinNameSizeEntry[] = wxT( "LibeditPinNameSize" );
329 static const wxChar DefaultPinLengthEntry[] = wxT( "DefaultPinLength" );
330 static const wxChar repeatLibLabelIncEntry[] = wxT( "LibeditRepeatLabelInc" );
331 static const wxChar pinRepeatStepEntry[] = wxT( "LibeditPinRepeatStep" );
332 static const wxChar repeatLibStepXEntry[] = wxT( "LibeditRepeatStepX" );
333 static const wxChar repeatLibStepYEntry[] = wxT( "LibeditRepeatStepY" );
334 static const wxChar showPinElectricalType[] = wxT( "LibeditShowPinElectricalType" );
335 
336 static const wxChar boxedSelectedText[] = wxT( "SelectionTextAsBox" );
337 static const wxChar drawSelectedChildren[] = wxT( "SelectionDrawChildItems" );
338 static const wxChar selectionFillShapes[] = wxT( "SelectionFillShapes" );
339 static const wxChar selectionThickness[] = wxT( "SelectionThickness" );
340 
342 
344 {
345  if( !m_configSettings.empty() )
346  return m_configSettings;
347 
349  &m_showPageLimits, true ) );
350  m_configSettings.push_back( new PARAM_CFG_INT( true, UnitsEntry,
351  (int*) &m_userUnits,
352  (int) EDA_UNITS::MILLIMETRES ) );
353 
355  &m_printMonochrome, true ) );
356  m_configSettings.push_back( new PARAM_CFG_BOOL( true, PrintSheetRefEntry,
357  &m_printSheetReference, true ) );
358 
361  -10, +10 ) );
363  &m_showIllegalSymbolLibDialog, true ) );
366  true ) );
367 
368  return m_configSettings;
369 }
370 
371 
372 void SCH_EDIT_FRAME::LoadSettings( wxConfigBase* aCfg )
373 {
375 
376  long tmp;
377 
379 
380  aCfg->Read( RepeatStepXEntry, &tmp, DEFAULT_REPEAT_OFFSET_X );
381  m_repeatStep.x = Mils2iu( static_cast< int >( tmp ) );
382  aCfg->Read( RepeatStepYEntry, &tmp, DEFAULT_REPEAT_OFFSET_Y );
383  m_repeatStep.y = Mils2iu( static_cast< int >( tmp ) );
384 
385  // LibEdit owns this one, but we must read it in if LibEdit hasn't set it yet
386  if( GetDefaultLineThickness() < 0 )
387  {
388  SetDefaultLineThickness( Mils2iu( (int) aCfg->Read( DefaultDrawLineWidthEntry,
390  }
391 
392  SetDefaultBusThickness( Mils2iu( (int) aCfg->Read( DefaultBusWidthEntry,
393  DEFAULTBUSTHICKNESS ) ) );
394 
395  // Property introduced in 6.0; use DefaultLineWidth for earlier projects
396  if( !aCfg->Read( DefaultWireWidthEntry, &tmp ) )
398 
399  SetDefaultWireThickness( Mils2iu( (int) tmp ) );
400 
401  SetSelectionTextAsBox( aCfg->ReadBool( boxedSelectedText, false ) );
402  SetSelectionDrawChildItems( aCfg->ReadBool( drawSelectedChildren, true ) );
403  SetSelectionFillShapes( aCfg->ReadBool( selectionFillShapes, false ) );
405  Mils2iu( static_cast<int>( aCfg->Read( selectionThickness,
407 
408  SetTextMarkupFlags( (int) aCfg->Read( TextMarkupFlagsEntry, 0L ) );
409 
410  if( aCfg->Read( DefaultJctSizeEntry, &tmp ) )
411  SCH_JUNCTION::SetSymbolSize( Mils2iu( (int) tmp ) );
412 
413  aCfg->Read( DragActionIsMoveEntry, &m_dragActionIsMove, true );
414  aCfg->Read( ShowHiddenPinsEntry, &m_showAllPins, false );
416  aCfg->Read( HorzVertLinesOnlyEntry, &m_forceHVLines, true );
417  aCfg->Read( AutoplaceFieldsEntry, &m_autoplaceFields, true );
418  aCfg->Read( AutoplaceJustifyEntry, &m_autoplaceJustify, true );
419  aCfg->Read( AutoplaceAlignEntry, &m_autoplaceAlign, false );
420  aCfg->Read( FootprintPreviewEntry, &m_footprintPreview, false );
421  aCfg->Read( NavigatorStaysOpenEntry, &m_navigatorStaysOpen, false );
422 
423  wxString templateFieldNames = aCfg->Read( FieldNamesEntry, wxEmptyString );
424 
425  if( !templateFieldNames.IsEmpty() )
426  {
427  TEMPLATE_FIELDNAMES_LEXER lexer( TO_UTF8( templateFieldNames ) );
428 
429  try
430  {
431  m_templateFieldNames.Parse( &lexer );
432  }
433  catch( const IO_ERROR& DBG( e ) )
434  {
435  // @todo show error msg
436  DBG( printf( "templatefieldnames parsing error: '%s'\n", TO_UTF8( e.What() ) ); )
437  }
438  }
439 
441  settings->m_ShowPinsElectricalType = false;
442  settings->m_ShowHiddenText = false;
443  settings->m_ShowHiddenPins = m_showAllPins;
444  settings->SetShowPageLimits( m_showPageLimits );
445  settings->m_ShowUmbilicals = true;
446 }
447 
448 
449 void SCH_EDIT_FRAME::SaveSettings( wxConfigBase* aCfg )
450 {
452 
454 
455  aCfg->Write( RepeatStepXEntry, static_cast< long >( Iu2Mils( m_repeatStep.x ) ) );
456  aCfg->Write( RepeatStepYEntry, static_cast< long >( Iu2Mils( m_repeatStep.y ) ) );
458  aCfg->Write( DefaultBusWidthEntry, (long) Iu2Mils( GetDefaultBusThickness() ) );
459  aCfg->Write( DefaultWireWidthEntry, (long) Iu2Mils( GetDefaultWireThickness() ) );
460  aCfg->Write( DefaultJctSizeEntry, (long) Iu2Mils( SCH_JUNCTION::GetSymbolSize() ) );
461  aCfg->Write( ShowHiddenPinsEntry, m_showAllPins );
463  aCfg->Write( HorzVertLinesOnlyEntry, GetForceHVLines() );
464  aCfg->Write( AutoplaceFieldsEntry, m_autoplaceFields );
466  aCfg->Write( AutoplaceAlignEntry, m_autoplaceAlign );
468  aCfg->Write( boxedSelectedText, GetSelectionTextAsBox() );
471  aCfg->Write( selectionThickness, Iu2Mils( GetSelectionThickness() ) );
473 
474  // Save template fieldnames
475  STRING_FORMATTER sf;
476  m_templateFieldNames.Format( &sf, 0 );
477 
478  wxString record = FROM_UTF8( sf.GetString().c_str() );
479  record.Replace( wxT("\n"), wxT(""), true ); // strip all newlines
480  record.Replace( wxT(" "), wxT(" "), true ); // double space to single
481 
482  aCfg->Write( FieldNamesEntry, record );
483 
484  aCfg->Write( TextMarkupFlagsEntry, GetTextMarkupFlags() );
486 }
487 
488 
489 void LIB_EDIT_FRAME::LoadSettings( wxConfigBase* aCfg )
490 {
492 
493  SetDefaultLineThickness( Mils2iu( (int) aCfg->Read( DefaultDrawLineWidthEntry,
495  SetDefaultPinLength( Mils2iu( (int) aCfg->Read( DefaultPinLengthEntry, DEFAULTPINLENGTH ) ) );
496  m_textPinNumDefaultSize = Mils2iu( (int) aCfg->Read( defaultPinNumSizeEntry,
497  DEFAULTPINNUMSIZE ) );
498  m_textPinNameDefaultSize = Mils2iu( (int) aCfg->Read( defaultPinNameSizeEntry,
499  DEFAULTPINNAMESIZE ) );
501  SetRepeatPinStep( Mils2iu( (int) aCfg->Read( pinRepeatStepEntry,
503 
504  wxPoint step;
505  step.x = Mils2iu( static_cast< int >( aCfg->Read( repeatLibStepXEntry,
506  static_cast< long >( DEFAULT_REPEAT_OFFSET_X ) ) ) );
507  step.y = Mils2iu( static_cast< int >( aCfg->Read( repeatLibStepYEntry,
508  static_cast< long >( DEFAULT_REPEAT_OFFSET_Y ) ) ) );
509 
510  SetRepeatStep( step );
511  m_showPinElectricalTypeName = aCfg->ReadBool( showPinElectricalType, true );
513 
514  wxString templateFieldNames = aCfg->Read( FieldNamesEntry, wxEmptyString );
515 
516  if( !templateFieldNames.IsEmpty() )
517  {
518  TEMPLATE_FIELDNAMES_LEXER lexer( TO_UTF8( templateFieldNames ) );
519 
520  try
521  {
522  m_templateFieldNames.Parse( &lexer );
523  }
524  catch( const IO_ERROR& DBG( e ) )
525  {
526  // @todo show error msg
527  DBG( printf( "templatefieldnames parsing error: '%s'\n", TO_UTF8( e.What() ) ); )
528  }
529  }
530 
531  auto painter = static_cast<KIGFX::SCH_PAINTER*>( GetCanvas()->GetView()->GetPainter() );
532  KIGFX::SCH_RENDER_SETTINGS* settings = painter->GetSettings();
534 
535  // Hidden elements must be editable
536  settings->m_ShowHiddenText = true;
537  settings->m_ShowHiddenPins = true;
538  settings->m_ShowUmbilicals = false;
539 }
540 
541 
542 void LIB_EDIT_FRAME::SaveSettings( wxConfigBase* aCfg )
543 {
545 
546  aCfg->Write( DefaultDrawLineWidthEntry, Iu2Mils( GetDefaultLineThickness() ) );
547  aCfg->Write( DefaultPinLengthEntry, Iu2Mils( GetDefaultPinLength() ) );
548  aCfg->Write( defaultPinNumSizeEntry, Iu2Mils( GetPinNumDefaultSize() ) );
549  aCfg->Write( defaultPinNameSizeEntry, Iu2Mils( GetPinNameDefaultSize() ) );
551  aCfg->Write( pinRepeatStepEntry, Iu2Mils( GetRepeatPinStep() ) );
552  aCfg->Write( repeatLibStepXEntry, Iu2Mils( GetRepeatStep().x ) );
553  aCfg->Write( repeatLibStepYEntry, Iu2Mils( GetRepeatStep().y ) );
555  aCfg->Write( defaultLibWidthEntry, m_treePane->GetSize().x );
556 }
557 
558 
560  PANEL_HOTKEYS_EDITOR* aHotkeysPanel )
561 {
562  wxTreebook* book = aParent->GetTreebook();
563 
564  book->AddPage( new wxPanel( book ), _( "Symbol Editor" ) );
565  book->AddSubPage( new PANEL_DISPLAY_OPTIONS( this, aParent ), _( "Display Options" ) );
566  book->AddSubPage( new PANEL_LIBEDIT_SETTINGS( this, book ), _( "Defaults" ) );
567 
568  aHotkeysPanel->AddHotKeys( GetToolManager() );
569 }
570 
571 
572 SYMBOL_LIB_TABLE* PROJECT::SchSymbolLibTable()
573 {
574  // This is a lazy loading function, it loads the project specific table when
575  // that table is asked for, not before.
577 
578  // its gotta be NULL or a SYMBOL_LIB_TABLE, or a bug.
579  wxASSERT( !tbl || tbl->Type() == SYMBOL_LIB_TABLE_T );
580 
581  if( !tbl )
582  {
583  // Stack the project specific SYMBOL_LIB_TABLE overlay on top of the global table.
584  // ~SYMBOL_LIB_TABLE() will not touch the fallback table, so multiple projects may
585  // stack this way, all using the same global fallback table.
587 
589 
590  wxString prjPath;
591 
592  wxGetEnv( PROJECT_VAR_NAME, &prjPath );
593 
594  if( !prjPath.IsEmpty() )
595  {
596  wxFileName fn( prjPath, SYMBOL_LIB_TABLE::GetSymbolLibTableFileName() );
597 
598  try
599  {
600  tbl->Load( fn.GetFullPath() );
601  }
602  catch( const IO_ERROR& ioe )
603  {
604  wxString msg;
605  msg.Printf( _( "An error occurred loading the symbol library table \"%s\"." ),
606  fn.GetFullPath() );
607  DisplayErrorMessage( NULL, msg, ioe.What() );
608  }
609  }
610  }
611 
612  return tbl;
613 }
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()
bool GetSelectionTextAsBox()
Draw selected text items as box.
#define DEFAULTPINLENGTH
The default pin number size when creating pins(can be changed in preference menu)
Definition: general.h:64
static const wxString RepeatLabelIncrementEntry
const wxString & GetFileName() const
Definition: sch_screen.h:157
#define DEFAULT_SIZE_TEXT
This is the "default-of-the-default" hardcoded text size; individual application define their own def...
Definition: eda_text.h:70
static const wxChar HorzVertLinesOnlyEntry[]
TOOL_MANAGER * GetToolManager() const
Return the MVC controller.
int GetDefaultWireThickness()
Default line thickness used to draw/plot wires.
void SetSelectionDrawChildItems(bool aBool)
static int * SubpartFirstIdPtr()
return a reference to m_subpartFirstId, only for read/save setting functions
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
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
void wxConfigLoadSetups(wxConfigBase *aCfg, const std::vector< PARAM_CFG * > &aList)
Function wxConfigLoadSetups uses aList of PARAM_CFG to load configuration values from aCfg.
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 bool s_selectDrawChildren
void SetSelectionTextAsBox(bool aBool)
static const wxChar defaultPinNumSizeEntry[]
TEMPLATES m_templateFieldNames
wxPoint m_repeatStep
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
const wxChar RescueNeverShowEntry[]
static int s_defaultBusThickness
std::vector< PARAM_CFG * > m_projectFileParams
static const wxString ShowIllegalSymboLibDialog
KIGFX::SCH_RENDER_SETTINGS * GetRenderSettings()
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
static bool s_selectFillShapes
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
std::vector< PARAM_CFG * > & GetProjectFileParameters()
Return the project file parameter list for Eeschema.
SCH_SCREEN * GetScreen()
Definition: sch_sheet.h:278
static const wxChar repeatLibLabelIncEntry[]
static const wxString TextMarkupFlagsEntry
COLOR4D GetInvisibleItemColor()
void SaveSettings(wxConfigBase *aCfg) override
Saves common frame parameters to a configuration data file.
bool m_selectPinSelectSymbol
bool m_showSheetFileNameCaseSensitivityDlg
Configuration parameter - PARAM_CFG_FILENAME Class Same as PARAM_CFG_WXSTRING, but stores "\" as "/".
void wxConfigSaveSetups(wxConfigBase *aCfg, const std::vector< PARAM_CFG * > &aList)
Function wxConfigSaveSetups writes aList of PARAM_CFG to save configuration values to aCfg.
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 const wxChar selectionThickness[]
VTBL_ENTRY bool ConfigLoad(const SEARCH_STACK &aSearchS, const wxString &aGroupName, const std::vector< PARAM_CFG * > &aParams, const wxString &aForeignConfigFileName=wxEmptyString)
Function ConfigLoad reads a subset of parameters from the "project" file.
Definition: project.cpp:358
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()
int GetTextMarkupFlags()
Definition: gr_text.cpp:55
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
static const wxString RepeatStepXEntry
std::vector< PARAM_CFG * > & GetConfigurationSettings()
Return the Eeschema applications settings.
static const wxChar selectionFillShapes[]
#define NULL
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()
static const wxString showSheetFileNameCaseSensitivityDlg
std::vector< PARAM_CFG * > m_configSettings
bool GetForceHVLines() const
void SetSelectionFillShapes(bool aBool)
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.
KIFACE_I & Kiface()
Global KIFACE_I "get" accessor.
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
int GetSelectionThickness()
Selection highlight thickness.
#define DEFAULTSELECTIONTHICKNESS
Definition: general.h:76
ERC_SETTINGS m_ercSettings
static const wxString SelectPinSelectSymbolEntry
static const wxChar DefaultBusWidthEntry[]
Definition of file extensions used in Kicad.
const wxPoint GetRepeatStep() const
VTBL_ENTRY void ConfigSave(const SEARCH_STACK &aSList, const wxString &aGroupName, const std::vector< PARAM_CFG * > &aParams, const wxString &aFileName=wxEmptyString)
Function ConfigSave saves the current "project" parameters into the wxConfigBase* derivative.
Definition: project.cpp:323
#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
static const wxChar boxedSelectedText[]
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
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.
void SetSelectionThickness(int aThickness)
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
bool GetSelectionFillShapes()
Draw selected shapes as filled or not.
wxString ProjectFileWildcard()
static int m_textPinNameDefaultSize
static const wxChar pinRepeatStepEntry[]
static const wxChar DefaultPinLengthEntry[]
bool m_printSheetReference
static const wxChar ShowHiddenPinsEntry[]
bool m_navigatorStaysOpen
whether to keep Navigator open
see class PGM_BASE
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
The default selection highlight thickness.
Definition: general.h:73
static int GetPinNameDefaultSize()
wxString m_plotDirectoryName
#define _(s)
Definition: 3d_actions.cpp:31
bool GetSelectionDrawChildItems()
Draw selected child items or not.
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
EDA_UNITS m_userUnits
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
SCH_RENDER_SETTINGS Stores schematic-specific render settings.
Definition: sch_painter.h:69
void SetRepeatStep(const wxPoint &aStep)
Sets the repeat step value for repeat command.
wxString m_netListFormat
bool check_similar_labels
If true, check each sheet for labels that differ only by letter case.
Definition: erc_settings.h:64
COLOR4D GetItemSelectedColor()
static const wxChar NavigatorStaysOpenEntry[]
static int s_selectThickness
#define DBG(x)
Definition: fctsys.h:33
SCH_SHEET * g_RootSheet
bool GetSelectPinSelectSymbol() const override
Allow some frames to select the parent symbol when trying to select a pin.
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)
static bool s_selectTextAsBox
SYMBOL_TREE_PANE * m_treePane
void SetTextMarkupFlags(int aMarkupFlags)
Definition: gr_text.cpp:49
STRING_FORMATTER implements OUTPUTFORMATTER to a memory buffer.
Definition: richio.h:445
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.
static const wxChar drawSelectedChildren[]
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.
COLOR4D is the color representation with 4 components: red, green, blue, alpha.
Definition: color4d.h:39
Definition: colors.h:62