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-2018 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 
28 #include <fctsys.h>
29 #include <pgm_base.h>
30 #include <kiface_i.h>
31 #include <sch_draw_panel.h>
32 #include <confirm.h>
33 #include <gestfich.h>
34 #include <sch_edit_frame.h>
35 #include <invoke_sch_dialog.h>
36 #include <lib_edit_frame.h>
37 #include <eeschema_config.h>
38 #include <hotkeys.h>
40 #include <class_library.h>
41 #include <symbol_lib_table.h>
42 #include <dialog_erc.h>
44 #include <widgets/paged_dialog.h>
51 #include <sch_view.h>
52 #include <sch_painter.h>
53 #include "sch_junction.h"
54 
55 #define FR_HISTORY_LIST_CNT 10
56 
57 
59 
61 {
62  return s_defaultBusThickness;
63 }
64 
65 
66 void SetDefaultBusThickness( int aThickness)
67 {
68  if( aThickness >= 1 )
69  s_defaultBusThickness = aThickness;
70  else
72 }
73 
74 
77 
79 {
80  return s_defaultTextSize;
81 }
82 
83 
84 void SetDefaultTextSize( int aTextSize )
85 {
86  s_defaultTextSize = aTextSize;
87 }
88 
89 
90 /*
91  * Default line (in Eeschema units) thickness used to draw/plot items having a
92  * default thickness line value (i.e. = 0 ).
93  */
95 
96 
98 {
100 }
101 
102 
103 void SetDefaultLineThickness( int aThickness )
104 {
105  if( aThickness >=1 )
106  s_drawDefaultLineThickness = aThickness;
107  else
109 }
110 
111 
112 // Color to draw selected items
114 {
115  return COLOR4D( BROWN );
116 }
117 
118 
119 // Color to draw items flagged invisible, in libedit (they are invisible
120 // in Eeschema
122 {
123  return COLOR4D( DARKGRAY );
124 }
125 
126 
127 void LIB_EDIT_FRAME::Process_Config( wxCommandEvent& event )
128 {
129  int id = event.GetId();
130 
131  switch( id )
132  {
134  // Display current hotkey list for LibEdit.
136  break;
137 
138  default:
139  DisplayError( this, wxT( "LIB_EDIT_FRAME::Process_Config error" ) );
140  }
141 }
142 
143 
144 void SCH_EDIT_FRAME::Process_Config( wxCommandEvent& event )
145 {
146  int id = event.GetId();
147  wxFileName fn;
148 
149  switch( id )
150  {
151  case ID_CONFIG_SAVE:
152  SaveProjectSettings( true );
153  break;
154 
155  case ID_CONFIG_READ:
156  {
157  fn = g_RootSheet->GetScreen()->GetFileName();
158  fn.SetExt( ProjectFileExtension );
159 
160  wxFileDialog dlg( this, _( "Load Project File" ), fn.GetPath(),
161  fn.GetFullName(), ProjectFileWildcard(),
162  wxFD_OPEN | wxFD_FILE_MUST_EXIST );
163 
164  if( dlg.ShowModal() == wxID_CANCEL )
165  break;
166 
167  wxString chosen = dlg.GetPath();
168 
169  if( chosen == Prj().GetProjectFullName() )
170  LoadProjectFile();
171  else
172  {
173  // Read library list and library path list
174  Prj().ConfigLoad( Kiface().KifaceSearch(), GROUP_SCH,
175  GetProjectFileParametersList() );
176  // Read schematic editor setup
177  Prj().ConfigLoad( Kiface().KifaceSearch(), GROUP_SCH_EDITOR,
178  GetProjectFileParametersList() );
179  }
180  }
181  break;
182 
184  // Display current hotkey list for eeschema.
186  break;
187 
188  default:
189  DisplayError( this, wxT( "SCH_EDIT_FRAME::Process_Config error" ) );
190  }
191 }
192 
193 
194 void SCH_EDIT_FRAME::OnPreferencesOptions( wxCommandEvent& event )
195 {
197  {
198  SaveSettings( config() ); // save values shared by eeschema applications.
199  m_canvas->Refresh( true );
200  }
201 }
202 
203 
205 {
206  wxTreebook* book = aParent->GetTreebook();
207 
208  book->AddPage( new PANEL_EESCHEMA_SETTINGS( this, book ), _( "Eeschema" ) );
209  book->AddSubPage( new PANEL_EESCHEMA_DISPLAY_OPTIONS( this, book ), _( "Display Options" ) );
210  book->AddSubPage( new PANEL_EESCHEMA_COLOR_CONFIG( this, book ), _( "Colors" ) );
211  book->AddSubPage( new PANEL_EESCHEMA_TEMPLATE_FIELDNAMES( this, book ), _( "Field Name Templates" ) );
212 }
213 
214 
216 
217 {
218  if( !m_projectFileParams.empty() )
219  return m_projectFileParams;
220 
221  m_projectFileParams.push_back( new PARAM_CFG_FILENAME( wxT( "PageLayoutDescrFile" ),
223 
224  m_projectFileParams.push_back( new PARAM_CFG_FILENAME( wxT( "PlotDirectoryName" ),
225  &m_plotDirectoryName ) );
226 
227  m_projectFileParams.push_back( new PARAM_CFG_INT( wxT( "SubpartIdSeparator" ),
229  0, 0, 126 ) );
230  m_projectFileParams.push_back( new PARAM_CFG_INT( wxT( "SubpartFirstId" ),
232  'A', '1', 'z' ) );
233 
234  /* moved to library load/save specific code, in a specific section in .pro file
235  m_projectFileParams.push_back( new PARAM_CFG_FILENAME( wxT( "LibDir" ),
236  &m_userLibraryPath ) );
237  m_projectFileParams.push_back( new PARAM_CFG_LIBNAME_LIST( wxT( "LibName" ),
238  &m_componentLibFiles,
239  GROUP_SCH_LIBS ) );
240  */
241 
242  m_projectFileParams.push_back( new PARAM_CFG_WXSTRING( wxT( "NetFmtName" ),
243  &m_netListFormat) );
244  m_projectFileParams.push_back( new PARAM_CFG_BOOL( wxT( "SpiceAjustPassiveValues" ),
245  &m_spiceAjustPassiveValues, false ) );
246 
247  m_projectFileParams.push_back( new PARAM_CFG_INT( wxT( "LabSize" ),
249  DEFAULT_SIZE_TEXT, 5, 1000 ) );
250 
251  m_projectFileParams.push_back( new PARAM_CFG_BOOL( wxT( "ERC_TestSimilarLabels" ),
253 
254  return m_projectFileParams;
255 }
256 
257 
259 {
260  // Read library list and library path list
261  bool isRead = Prj().ConfigLoad( Kiface().KifaceSearch(),
262  GROUP_SCH, GetProjectFileParametersList() );
263 
264  // Read schematic editor setup
265  isRead = isRead && Prj().ConfigLoad( Kiface().KifaceSearch(),
266  GROUP_SCH_EDITOR, GetProjectFileParametersList() );
267 
268  // Verify some values, because the config file can be edited by hand,
269  // and have bad values:
273 
274  // Load the page layout decr file, from the filename stored in
275  // BASE_SCREEN::m_PageLayoutDescrFileName, read in config project file
276  // If empty, or not existing, the default descr is loaded
278  wxString pg_fullfilename = WORKSHEET_LAYOUT::MakeFullFileName(
280  Prj().GetProjectPath() );
281 
282  pglayout.SetPageLayout( pg_fullfilename );
283 
284  return isRead;
285 }
286 
287 
288 void SCH_EDIT_FRAME::SaveProjectSettings( bool aAskForSave )
289 {
290  PROJECT& prj = Prj();
291  wxFileName fn = g_RootSheet->GetScreen()->GetFileName(); //ConfigFileName
292 
293  fn.SetExt( ProjectFileExtension );
294 
295  if( !IsWritable( fn ) )
296  return;
297 
298  if( aAskForSave )
299  {
300  wxFileDialog dlg( this, _( "Save Project File" ),
301  fn.GetPath(), fn.GetFullName(),
302  ProjectFileWildcard(), wxFD_SAVE );
303 
304  if( dlg.ShowModal() == wxID_CANCEL )
305  return;
306 
307  fn = dlg.GetPath();
308  }
309 
310  prj.ConfigSave( Kiface().KifaceSearch(), GROUP_SCH_EDITOR, GetProjectFileParametersList() );
311 }
312 
315 
316 const wxChar RescueNeverShowEntry[] = wxT( "RescueNeverShow" );
317 const wxChar AutoplaceFieldsEntry[] = wxT( "AutoplaceFields" );
318 const wxChar AutoplaceJustifyEntry[] = wxT( "AutoplaceJustify" );
319 const wxChar AutoplaceAlignEntry[] = wxT( "AutoplaceAlign" );
320 static const wxChar FootprintPreviewEntry[] = wxT( "FootprintPreview" );
321 static const wxChar DefaultBusWidthEntry[] = wxT( "DefaultBusWidth" );
322 static const wxChar DefaultDrawLineWidthEntry[] = wxT( "DefaultDrawLineWidth" );
323 static const wxChar DefaultJctSizeEntry[] = wxT( "DefaultJunctionSize" );
324 static const wxChar ShowHiddenPinsEntry[] = wxT( "ShowHiddenPins" );
325 static const wxChar HorzVertLinesOnlyEntry[] = wxT( "HorizVertLinesOnly" );
326 static const wxChar FindReplaceFlagsEntry[] = wxT( "LastFindReplaceFlags" );
327 static const wxChar FindStringEntry[] = wxT( "LastFindString" );
328 static const wxChar ReplaceStringEntry[] = wxT( "LastReplaceString" );
329 static const wxChar FindStringHistoryEntry[] = wxT( "FindStringHistoryList%d" );
330 static const wxChar ReplaceStringHistoryEntry[] = wxT( "ReplaceStringHistoryList%d" );
331 static const wxChar FieldNamesEntry[] = wxT( "FieldNames" );
332 static const wxChar SimulatorCommandEntry[] = wxT( "SimCmdLine" );
333 static const wxString ShowPageLimitsEntry = "ShowPageLimits";
334 static const wxString UnitsEntry = "Units";
335 static const wxString PrintMonochromeEntry = "PrintMonochrome";
336 static const wxString PrintSheetRefEntry = "PrintSheetReferenceAndTitleBlock";
337 static const wxString RepeatStepXEntry = "RepeatStepX";
338 static const wxString RepeatStepYEntry = "RepeatStepY";
339 static const wxString RepeatLabelIncrementEntry = "RepeatLabelIncrement";
340 
341 // Library editor wxConfig entry names.
342 static const wxChar defaultPinNumSizeEntry[] = wxT( "LibeditPinNumSize" );
343 static const wxChar defaultPinNameSizeEntry[] = wxT( "LibeditPinNameSize" );
344 static const wxChar DefaultPinLengthEntry[] = wxT( "DefaultPinLength" );
345 static const wxChar repeatLibLabelIncEntry[] = wxT( "LibeditRepeatLabelInc" );
346 static const wxChar pinRepeatStepEntry[] = wxT( "LibeditPinRepeatStep" );
347 static const wxChar repeatLibStepXEntry[] = wxT( "LibeditRepeatStepX" );
348 static const wxChar repeatLibStepYEntry[] = wxT( "LibeditRepeatStepY" );
349 static const wxChar showPinElectricalType[] = wxT( "LibeditShowPinElectricalType" );
350 
352 
354 {
355  if( !m_configSettings.empty() )
356  return m_configSettings;
357 
358  m_configSettings.push_back( new PARAM_CFG_BOOL( true, ShowPageLimitsEntry,
359  &m_showPageLimits, true ) );
360  m_configSettings.push_back( new PARAM_CFG_INT( true, UnitsEntry,
361  (int*)&m_UserUnits, MILLIMETRES ) );
362 
363  m_configSettings.push_back( new PARAM_CFG_BOOL( true, PrintMonochromeEntry,
364  &m_printMonochrome, true ) );
365  m_configSettings.push_back( new PARAM_CFG_BOOL( true, PrintSheetRefEntry,
366  &m_printSheetReference, true ) );
367 
368  m_configSettings.push_back( new PARAM_CFG_INT( true, RepeatStepXEntry,
369  &m_repeatStep.x,
372  REPEAT_OFFSET_MAX ) );
373  m_configSettings.push_back( new PARAM_CFG_INT( true, RepeatStepYEntry,
374  &m_repeatStep.y,
377  REPEAT_OFFSET_MAX ) );
378  m_configSettings.push_back( new PARAM_CFG_INT( true, RepeatLabelIncrementEntry,
380  DEFAULT_REPEAT_LABEL_INC, -10, +10 ) );
381  return m_configSettings;
382 }
383 
384 
385 void SCH_EDIT_FRAME::LoadSettings( wxConfigBase* aCfg )
386 {
388 
389  long tmp;
390 
392  wxConfigLoadSetups( aCfg, GetConfigurationSettings() );
393 
397  aCfg->Read( ShowHiddenPinsEntry, &m_showAllPins, false );
398  aCfg->Read( HorzVertLinesOnlyEntry, &m_forceHVLines, true );
399  aCfg->Read( AutoplaceFieldsEntry, &m_autoplaceFields, true );
400  aCfg->Read( AutoplaceJustifyEntry, &m_autoplaceJustify, true );
401  aCfg->Read( AutoplaceAlignEntry, &m_autoplaceAlign, false );
402  aCfg->Read( FootprintPreviewEntry, &m_footprintPreview, false );
403 
404  // Load netlists options:
405  aCfg->Read( SimulatorCommandEntry, &m_simulatorCommand );
406 
407  wxASSERT_MSG( m_findReplaceData,
408  wxT( "Find dialog data settings object not created. Bad programmer!" ) );
409 
410  aCfg->Read( FindReplaceFlagsEntry, &tmp, (long) wxFR_DOWN );
411  m_findReplaceData->SetFlags( (wxUint32) tmp & ~FR_REPLACE_ITEM_FOUND );
412  m_findReplaceData->SetFindString( aCfg->Read( FindStringEntry, wxEmptyString ) );
413  m_findReplaceData->SetReplaceString( aCfg->Read( ReplaceStringEntry, wxEmptyString ) );
414 
415  // Load the find and replace string history list.
416  for( int i = 0; i < FR_HISTORY_LIST_CNT; ++i )
417  {
418  wxString tmpHistory;
419  wxString entry;
420  entry.Printf( FindStringHistoryEntry, i );
421  tmpHistory = aCfg->Read( entry, wxEmptyString );
422 
423  if( !tmpHistory.IsEmpty() )
424  m_findStringHistoryList.Add( tmpHistory );
425 
426  entry.Printf( ReplaceStringHistoryEntry, i );
427  tmpHistory = aCfg->Read( entry, wxEmptyString );
428 
429  if( !tmpHistory.IsEmpty() )
430  m_replaceStringHistoryList.Add( tmpHistory );
431  }
432 
433  wxString templateFieldNames = aCfg->Read( FieldNamesEntry, wxEmptyString );
434 
435  if( !templateFieldNames.IsEmpty() )
436  {
437  TEMPLATE_FIELDNAMES_LEXER lexer( TO_UTF8( templateFieldNames ) );
438 
439  try
440  {
441  m_templateFieldNames.Parse( &lexer );
442  }
443  catch( const IO_ERROR& DBG( e ) )
444  {
445  // @todo show error msg
446  DBG( printf( "templatefieldnames parsing error: '%s'\n", TO_UTF8( e.What() ) ); )
447  }
448  }
449 
450  auto painter = dynamic_cast<KIGFX::SCH_PAINTER*>( GetCanvas()->GetView()->GetPainter() );
451  KIGFX::SCH_RENDER_SETTINGS* settings = painter->GetSettings();
452  settings->m_ShowPinsElectricalType = false;
453  settings->m_ShowHiddenText = false;
454  settings->m_ShowHiddenPins = m_showAllPins;
455  settings->SetShowPageLimits( m_showPageLimits );
456  settings->m_ShowUmbilicals = true;
457 }
458 
459 
460 void SCH_EDIT_FRAME::SaveSettings( wxConfigBase* aCfg )
461 {
463 
464  wxConfigSaveSetups( aCfg, GetConfigurationSettings() );
465 
466  aCfg->Write( DefaultBusWidthEntry, (long) GetDefaultBusThickness() );
467  aCfg->Write( DefaultDrawLineWidthEntry, (long) GetDefaultLineThickness() );
468  aCfg->Write( DefaultJctSizeEntry, (long) SCH_JUNCTION::GetSymbolSize() );
469  aCfg->Write( ShowHiddenPinsEntry, m_showAllPins );
470  aCfg->Write( HorzVertLinesOnlyEntry, GetForceHVLines() );
471  aCfg->Write( AutoplaceFieldsEntry, m_autoplaceFields );
472  aCfg->Write( AutoplaceJustifyEntry, m_autoplaceJustify );
473  aCfg->Write( AutoplaceAlignEntry, m_autoplaceAlign );
474  aCfg->Write( FootprintPreviewEntry, m_footprintPreview );
475 
476  // Save netlists options:
477  aCfg->Write( SimulatorCommandEntry, m_simulatorCommand );
478 
479  // Save find dialog session setting.
480  wxASSERT_MSG( m_findReplaceData,
481  wxT( "Find dialog data settings object not created. Bad programmer!" ) );
482  aCfg->Write( FindReplaceFlagsEntry,
483  (long) m_findReplaceData->GetFlags() & ~FR_REPLACE_ITEM_FOUND );
484  aCfg->Write( FindStringEntry, m_findReplaceData->GetFindString() );
485  aCfg->Write( ReplaceStringEntry, m_findReplaceData->GetReplaceString() );
486 
487  // Save the find and replace string history list.
488  unsigned i;
489  wxString tmpHistory;
490  wxString entry; // invoke constructor outside of any loops
491 
492  for( i = 0; i < m_findStringHistoryList.GetCount() && i < FR_HISTORY_LIST_CNT; i++ )
493  {
494  entry.Printf( FindStringHistoryEntry, i );
495  aCfg->Write( entry, m_findStringHistoryList[ i ] );
496  }
497 
498  for( i = 0; i < m_replaceStringHistoryList.GetCount() && i < FR_HISTORY_LIST_CNT; i++ )
499  {
500  entry.Printf( ReplaceStringHistoryEntry, i );
501  aCfg->Write( entry, m_replaceStringHistoryList[ i ] );
502  }
503 
504  // Save template fieldnames
505  STRING_FORMATTER sf;
506  m_templateFieldNames.Format( &sf, 0 );
507 
508  wxString record = FROM_UTF8( sf.GetString().c_str() );
509  record.Replace( wxT("\n"), wxT(""), true ); // strip all newlines
510  record.Replace( wxT(" "), wxT(" "), true ); // double space to single
511 
512  aCfg->Write( FieldNamesEntry, record );
513 }
514 
515 
516 void LIB_EDIT_FRAME::LoadSettings( wxConfigBase* aCfg )
517 {
519 
521 
528  wxPoint step;
529  step.x = (int) aCfg->Read( repeatLibStepXEntry, (long) DEFAULT_REPEAT_OFFSET_X );
530  step.y = (int) aCfg->Read( repeatLibStepYEntry, (long) DEFAULT_REPEAT_OFFSET_Y );
531  SetRepeatStep( step );
532  m_showPinElectricalTypeName = aCfg->ReadBool( showPinElectricalType, true );
533 
534  wxString templateFieldNames = aCfg->Read( FieldNamesEntry, wxEmptyString );
535 
536  if( !templateFieldNames.IsEmpty() )
537  {
538  TEMPLATE_FIELDNAMES_LEXER lexer( TO_UTF8( templateFieldNames ) );
539 
540  try
541  {
542  m_templateFieldNames.Parse( &lexer );
543  }
544  catch( const IO_ERROR& DBG( e ) )
545  {
546  // @todo show error msg
547  DBG( printf( "templatefieldnames parsing error: '%s'\n", TO_UTF8( e.What() ) ); )
548  }
549  }
550 
551  auto painter = static_cast<KIGFX::SCH_PAINTER*>( GetCanvas()->GetView()->GetPainter() );
552  KIGFX::SCH_RENDER_SETTINGS* settings = painter->GetSettings();
554 
555  // Hidden elements must be editable
556  settings->m_ShowHiddenText = true;
557  settings->m_ShowHiddenPins = true;
558  settings->m_ShowUmbilicals = false;
559 }
560 
561 
562 void LIB_EDIT_FRAME::SaveSettings( wxConfigBase* aCfg )
563 {
565 
566  aCfg->Write( DefaultPinLengthEntry, (long) GetDefaultPinLength() );
567  aCfg->Write( defaultPinNumSizeEntry, (long) GetPinNumDefaultSize() );
568  aCfg->Write( defaultPinNameSizeEntry, (long) GetPinNameDefaultSize() );
569  aCfg->Write( repeatLibLabelIncEntry, (long) GetRepeatDeltaLabel() );
570  aCfg->Write( pinRepeatStepEntry, (long) GetRepeatPinStep() );
571  aCfg->Write( repeatLibStepXEntry, (long) GetRepeatStep().x );
572  aCfg->Write( repeatLibStepYEntry, (long) GetRepeatStep().y );
574 }
575 
576 
577 void LIB_EDIT_FRAME::OnPreferencesOptions( wxCommandEvent& event )
578 {
580  {
581  SaveSettings( config() ); // save values shared by eeschema applications.
582  m_canvas->Refresh( true );
583  }
584 }
585 
586 
588 {
589  wxTreebook* book = aParent->GetTreebook();
590 
591  book->AddPage( new PANEL_LIBEDIT_SETTINGS( this, book ), _( "Symbol Editor" ) );
592  book->AddSubPage( new PANEL_LIBEDIT_DISPLAY_OPTIONS( this, aParent ), _( "Display Options" ) );
593 }
594 
595 
596 SYMBOL_LIB_TABLE* PROJECT::SchSymbolLibTable()
597 {
598  // This is a lazy loading function, it loads the project specific table when
599  // that table is asked for, not before.
600  SYMBOL_LIB_TABLE* tbl = (SYMBOL_LIB_TABLE*) GetElem( ELEM_SYMBOL_LIB_TABLE );
601 
602  // its gotta be NULL or a SYMBOL_LIB_TABLE, or a bug.
603  wxASSERT( !tbl || tbl->Type() == SYMBOL_LIB_TABLE_T );
604 
605  if( !tbl )
606  {
607  // Stack the project specific SYMBOL_LIB_TABLE overlay on top of the global table.
608  // ~SYMBOL_LIB_TABLE() will not touch the fallback table, so multiple projects may
609  // stack this way, all using the same global fallback table.
611 
612  SetElem( ELEM_SYMBOL_LIB_TABLE, tbl );
613 
614  wxString prjPath;
615 
616  wxGetEnv( PROJECT_VAR_NAME, &prjPath );
617 
618  if( !prjPath.IsEmpty() )
619  {
620  wxFileName fn( prjPath, SYMBOL_LIB_TABLE::GetSymbolLibTableFileName() );
621 
622  try
623  {
624  tbl->Load( fn.GetFullPath() );
625  }
626  catch( const IO_ERROR& ioe )
627  {
628  wxString msg;
629  msg.Printf( _( "An error occurred loading the symbol library table \"%s\"." ),
630  fn.GetFullPath() );
631  DisplayErrorMessage( NULL, msg, ioe.What() );
632  }
633  }
634  }
635 
636  return tbl;
637 }
static int s_defaultTextSize
Default size for text (not only labels)
static const wxString & GetSymbolLibTableFileName()
int m_repeatDeltaLabel
the increment value of labels like bus members when they are repeated
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:62
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:318
static const wxString RepeatLabelIncrementEntry
static bool m_TestSimilarLabels
Definition: dialog_erc.h:51
void Process_Config(wxCommandEvent &event)
static const wxChar ReplaceStringHistoryEntry[]
#define LIB_EDIT_FRAME_NAME
Definition: draw_frame.h:49
#define DEFAULT_SIZE_TEXT
This is the "default-of-the-default" hardcoded text size; individual application define their own def...
Definition: eda_text.h:87
static const wxChar HorzVertLinesOnlyEntry[]
static int * SubpartFirstIdPtr()
return a reference to m_subpartFirstId, only for read/save setting functions
int GetRepeatPinStep() const
Class PROJECT holds project specific data.
Definition: project.h:57
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:53
static const wxChar ReplaceStringEntry[]
const wxChar AutoplaceFieldsEntry[]
void DisplayErrorMessage(wxWindow *aParent, const wxString &aText, const wxString &aExtraInfo)
Function DisplayErrorMessage displays an error message with aMessage.
Definition: confirm.cpp:259
This file is part of the common library TODO brief description.
void OnPreferencesOptions(wxCommandEvent &event)
void SetDefaultBusThickness(int aThickness)
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:49
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)
Sets the repeat step value for pins repeat command.
const wxPoint GetRepeatStep() const
#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...
const wxString & GetFileName() const
Definition: sch_screen.h:131
static int GetDefaultPinLength()
struct EDA_HOTKEY_CONFIG g_Libedit_Hokeys_Descr[]
static const wxChar defaultPinNumSizeEntry[]
TEMPLATES m_templateFieldNames
wxPoint m_repeatStep
the increment value of the position of an item when it is repeated
PARAM_CFG_ARRAY & GetConfigurationSettings()
Return the Eeschema applications settings.
void SaveSettings(wxConfigBase *aCfg) override
Function SaveSettings saves common frame parameters to a configuration data file. ...
static const wxString PrintSheetRefEntry
const wxChar RescueNeverShowEntry[]
static int s_defaultBusThickness
void Process_Config(wxCommandEvent &event)
Used by the search event handler to let the dialog know that a replaceable item has been found...
virtual wxConfigBase * config()
Function config returns the wxConfigBase used in SaveSettings(), and is overloaded in KICAD_MANAGER_F...
#define DEFAULT_REPEAT_OFFSET_PIN
the default value (overwritten by the eeschema config)
Definition: general.h:50
int GetRepeatDeltaLabel() const
bool IsWritable(const wxFileName &aFileName)
Function IsWritable checks if aFileName can be written.
static const wxString UnitsEntry
void InstallPreferences(PAGED_DIALOG *aParent) override
Allows Libedit to install its preferences panel into the preferences dialog.
SCH_SCREEN * GetScreen()
Definition: sch_sheet.h:279
static const wxChar repeatLibLabelIncEntry[]
COLOR4D GetInvisibleItemColor()
void SaveSettings(wxConfigBase *aCfg) override
Function SaveSettings saves common frame parameters to a configuration data file. ...
KIFACE_I & Kiface()
Global KIFACE_I "get" accessor.
Definition: kicad.cpp:52
Configuration parameter - PARAM_CFG_FILENAME Class Same as PARAM_CFG_WXSTRING, but stores "\" as "/"...
static WORKSHEET_LAYOUT & GetTheInstance()
static function: returns the instance of WORKSHEET_LAYOUT used in the application ...
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:54
static const wxChar FootprintPreviewEntry[]
void SetDefaultLineThickness(int aThickness)
#define SCH_EDIT_FRAME_NAME
Definition: draw_frame.h:50
static const wxChar FindReplaceFlagsEntry[]
PARAM_CFG_ARRAY & GetProjectFileParametersList()
Return the project file parameter list for Eeschema.
static wxString m_PageLayoutDescrFileName
the name of the page layout descr file, or emty to used the default pagelayout
Definition: base_screen.h:180
wxTreebook * GetTreebook()
Definition: paged_dialog.h:43
void OnPreferencesOptions(wxCommandEvent &event)
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:47
PROJECT & Prj() const
Function Prj returns a reference to the PROJECT "associated with" this KIWAY.
static int GetPinNumDefaultSize()
void SetDefaultTextSize(int aTextSize)
void DisplayHotkeyList(EDA_BASE_FRAME *aFrame, struct EDA_HOTKEY_CONFIG *aDescList)
Function DisplayHotkeyList Displays the current hotkey list.
static int GetSubpartIdSeparator()
static const wxString PrintMonochromeEntry
static int s_drawDefaultLineThickness
SCH_SHEET * g_RootSheet
Definition: eeschema.cpp:56
static const wxString RepeatStepXEntry
static const wxChar FindStringHistoryEntry[]
void LoadSettings(wxConfigBase *aCfg) override
Function LoadSettings loads common frame parameters from a configuration file.
KICAD_T Type() override
const wxChar AutoplaceAlignEntry[]
static int GetSubpartFirstId()
SCH_DRAW_PANEL * GetCanvas() const override
Configuration parameter - Integer Class.
struct EDA_HOTKEY_CONFIG g_Eeschema_Hokeys_Descr[]
void InstallPreferences(PAGED_DIALOG *aParent) override
Allows Eeschema to install its preferences panels into the preferences dialog.
static const wxChar DefaultBusWidthEntry[]
The common library.
#define GROUP_SCH
Definition: config_params.h:44
static int m_textPinNumDefaultSize
The default pin num text size setting.
Configuration parameter - Boolean Class.
bool LoadProjectFile()
Loads the KiCad project file (*.pro) settings specific to Eeschema.
void Format(OUTPUTFORMATTER *out, int nestLevel) const
Function Format serializes this object out as text into the given OUTPUTFORMATTER.
#define DEFAULT_REPEAT_OFFSET_Y
the default Y value (overwritten by the eeschema config)
Definition: general.h:47
const std::string & GetString()
Definition: richio.h:475
PAINTER * GetPainter() const
Function GetPainter() Returns the painter object used by the view for drawing VIEW_ITEMS.
Definition: view.h:199
bool m_showPinElectricalTypeName
the option to show the pin electrical name in the component editor
#define DEFAULTDRAWLINETHICKNESS
The default pin len value when creating pins(can be changed in preference menu)
Definition: general.h:59
void Load(const wxString &aFileName)
Load the library table using the path defined by aFileName aFallBackTable.
KIGFX::SCH_VIEW * GetView() const
#define DEFAULTBUSTHICKNESS
The thickness to draw lines that thickness is set to 0 (default thickness) (can be changed in prefere...
Definition: general.h:55
Configuration parameter - wxString Class.
void SaveSettings(wxConfigBase *aCfg) override
Function SaveSettings 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
Function LoadSettings loads common frame parameters from a configuration file.
void LoadSettings(wxConfigBase *aCfg) override
Function LoadSettings loads common frame parameters from a configuration file.
WORKSHEET_LAYOUT handles the graphic items list to draw/plot the title block and other items (page re...
#define DEFAULT_REPEAT_OFFSET_X
the default X value (overwritten by the eeschema config)
Definition: general.h:46
int ReadHotkeyConfig(const wxString &aAppname, struct EDA_HOTKEY_CONFIG *aDescList)
Function ReadHotkeyConfig Read configuration data and fill the current hotkey list with hotkeys...
virtual void SaveProjectSettings(bool aAskForSave)
Function SaveProjectSettings saves changes to the project settings to the project (...
wxString ProjectFileWildcard()
static int m_textPinNameDefaultSize
The default pin name text size setting.
static const wxChar pinRepeatStepEntry[]
static const wxChar DefaultPinLengthEntry[]
#define FR_HISTORY_LIST_CNT
Maximum number of find and replace strings.
EDA_DRAW_PANEL * m_canvas
The area to draw on.
Definition: draw_frame.h:123
static const wxChar ShowHiddenPinsEntry[]
virtual const wxString What() const
A composite of Problem() and Where()
Definition: exceptions.cpp:33
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:48
see class PGM_BASE
static int GetPinNameDefaultSize()
static void SetSubpartIdNotation(int aSep, int aFirstId)
Set the separator char between the subpart id and the reference 0 (no separator) or &#39;...
static int GetSymbolSize()
Definition: sch_junction.h:53
static const wxString MakeFullFileName(const wxString &aShortFileName, const wxString &aProjectPath)
Static function.
#define GROUP_SCH_EDITOR
Definition: config_params.h:45
size_t i
Definition: json11.cpp:597
static const wxChar repeatLibStepXEntry[]
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[]
bool m_showPageLimits
true to display the page limits
Definition: draw_frame.h:111
#define DEFAULTPINNAMESIZE
Definition: general.h:68
Class SCH_RENDER_SETTINGS Stores schematic-specific render settings.
Definition: sch_painter.h:66
Definition of class LIB_EDIT_FRAME.
void SetRepeatStep(const wxPoint &aStep)
Sets the repeat step value for repeat command.
COLOR4D GetItemSelectedColor()
classes and function to generate graphics to plt or draw titles blocks and frame references ...
#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:353
bool ShowPreferences(EDA_HOTKEY_CONFIG *aHotkeys, EDA_HOTKEY_CONFIG *aShowHotkeys, const wxString &aHotkeysNickname)
Definition for part library class.
virtual void Refresh(bool eraseBackground=true, const wxRect *rect=NULL)
#define DEFAULTPINNUMSIZE
The default pin name size when creating pins(can be changed in preference menu)
Definition: general.h:65
static void SetDefaultPinLength(int aLength)
Set the default pin len.
EDA_UNITS_T m_UserUnits
Definition: draw_frame.h:120
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 ...
void DisplayError(wxWindow *parent, const wxString &text, int displaytime)
Function DisplayError displays an error or warning message box with aMessage.
Definition: confirm.cpp:245
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[]
static const wxChar FindStringEntry[]
bool GetShowElectricalType()
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 GetDefaultTextSize()
Default size for text in general.
Class COLOR4D is the color representation with 4 components: red, green, blue, alpha.
Definition: color4d.h:39
static const wxChar SimulatorCommandEntry[]
Definition: colors.h:62
struct EDA_HOTKEY_CONFIG g_Schematic_Hokeys_Descr[]