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>
52 #include <sch_view.h>
53 #include <sch_painter.h>
54 #include "sch_junction.h"
55 
56 #define FR_HISTORY_LIST_CNT 10
57 
58 
60 
62 {
63  return s_defaultBusThickness;
64 }
65 
66 
67 void SetDefaultBusThickness( int aThickness)
68 {
69  if( aThickness >= 1 )
70  s_defaultBusThickness = aThickness;
71  else
73 }
74 
75 
78 
80 {
81  return s_defaultTextSize;
82 }
83 
84 
85 void SetDefaultTextSize( int aTextSize )
86 {
87  s_defaultTextSize = aTextSize;
88 }
89 
90 
91 /*
92  * Default line (in Eeschema units) thickness used to draw/plot items having a
93  * default thickness line value (i.e. = 0 ).
94  */
96 
97 
99 {
101 }
102 
103 
104 void SetDefaultLineThickness( int aThickness )
105 {
106  if( aThickness >=1 )
107  s_drawDefaultLineThickness = aThickness;
108  else
110 }
111 
112 
113 // Color to draw selected items
115 {
116  return COLOR4D( BROWN );
117 }
118 
119 
120 // Color to draw items flagged invisible, in libedit (they are invisible
121 // in Eeschema
123 {
124  return COLOR4D( DARKGRAY );
125 }
126 
127 
128 void LIB_EDIT_FRAME::Process_Config( wxCommandEvent& event )
129 {
130  int id = event.GetId();
131 
132  switch( id )
133  {
135  // Display current hotkey list for LibEdit.
137  break;
138 
139  default:
140  DisplayError( this, wxT( "LIB_EDIT_FRAME::Process_Config error" ) );
141  }
142 }
143 
144 
145 void SCH_EDIT_FRAME::Process_Config( wxCommandEvent& event )
146 {
147  int id = event.GetId();
148  wxFileName fn;
149 
150  switch( id )
151  {
152  case ID_CONFIG_SAVE:
153  SaveProjectSettings( true );
154  break;
155 
156  case ID_CONFIG_READ:
157  {
158  fn = g_RootSheet->GetScreen()->GetFileName();
159  fn.SetExt( ProjectFileExtension );
160 
161  wxFileDialog dlg( this, _( "Load Project File" ), fn.GetPath(),
162  fn.GetFullName(), ProjectFileWildcard(),
163  wxFD_OPEN | wxFD_FILE_MUST_EXIST );
164 
165  if( dlg.ShowModal() == wxID_CANCEL )
166  break;
167 
168  wxString chosen = dlg.GetPath();
169 
170  if( chosen == Prj().GetProjectFullName() )
171  LoadProjectFile();
172  else
173  {
174  // Read library list and library path list
175  Prj().ConfigLoad( Kiface().KifaceSearch(), GROUP_SCH,
177  // Read schematic editor setup
178  Prj().ConfigLoad( Kiface().KifaceSearch(), GROUP_SCH_EDITOR,
180  }
181  }
182  break;
183 
185  // Display current hotkey list for eeschema.
187  break;
188 
189  default:
190  DisplayError( this, wxT( "SCH_EDIT_FRAME::Process_Config error" ) );
191  }
192 }
193 
194 
195 void SCH_EDIT_FRAME::OnPreferencesOptions( wxCommandEvent& event )
196 {
198  {
199  SaveSettings( config() ); // save values shared by eeschema applications.
200  m_canvas->Refresh( true );
201  }
202 }
203 
204 
206 {
207  wxTreebook* book = aParent->GetTreebook();
208 
209  book->AddPage( new PANEL_EESCHEMA_SETTINGS( this, book ), _( "Eeschema" ) );
210  book->AddSubPage( new PANEL_EESCHEMA_DISPLAY_OPTIONS( this, book ), _( "Display Options" ) );
211  book->AddSubPage( new PANEL_EESCHEMA_COLOR_CONFIG( this, book ), _( "Colors" ) );
212  book->AddSubPage( new PANEL_EESCHEMA_TEMPLATE_FIELDNAMES( this, book ), _( "Field Name Templates" ) );
213 }
214 
215 
217 
218 {
219  if( !m_projectFileParams.empty() )
220  return m_projectFileParams;
221 
222  m_projectFileParams.push_back( new PARAM_CFG_FILENAME( wxT( "PageLayoutDescrFile" ),
224 
225  m_projectFileParams.push_back( new PARAM_CFG_FILENAME( wxT( "PlotDirectoryName" ),
226  &m_plotDirectoryName ) );
227 
228  m_projectFileParams.push_back( new PARAM_CFG_INT( wxT( "SubpartIdSeparator" ),
230  0, 0, 126 ) );
231  m_projectFileParams.push_back( new PARAM_CFG_INT( wxT( "SubpartFirstId" ),
233  'A', '1', 'z' ) );
234 
235  /* moved to library load/save specific code, in a specific section in .pro file
236  m_projectFileParams.push_back( new PARAM_CFG_FILENAME( wxT( "LibDir" ),
237  &m_userLibraryPath ) );
238  m_projectFileParams.push_back( new PARAM_CFG_LIBNAME_LIST( wxT( "LibName" ),
239  &m_componentLibFiles,
240  GROUP_SCH_LIBS ) );
241  */
242 
243  m_projectFileParams.push_back( new PARAM_CFG_WXSTRING( wxT( "NetFmtName" ),
244  &m_netListFormat) );
245  m_projectFileParams.push_back( new PARAM_CFG_BOOL( wxT( "SpiceAjustPassiveValues" ),
246  &m_spiceAjustPassiveValues, false ) );
247 
248  m_projectFileParams.push_back( new PARAM_CFG_INT( wxT( "LabSize" ),
250  DEFAULT_SIZE_TEXT, 5, 1000 ) );
251 
252  m_projectFileParams.push_back( new PARAM_CFG_BOOL( wxT( "ERC_TestSimilarLabels" ),
254 
255  return m_projectFileParams;
256 }
257 
258 
260 {
261  // Read library list and library path list
262  bool isRead = Prj().ConfigLoad( Kiface().KifaceSearch(),
264 
265  // Read schematic editor setup
266  isRead = isRead && Prj().ConfigLoad( Kiface().KifaceSearch(),
268 
269  // Verify some values, because the config file can be edited by hand,
270  // and have bad values:
274 
275  // Load the page layout decr file, from the filename stored in
276  // BASE_SCREEN::m_PageLayoutDescrFileName, read in config project file
277  // If empty, or not existing, the default descr is loaded
279  wxString pg_fullfilename = WORKSHEET_LAYOUT::MakeFullFileName(
281  Prj().GetProjectPath() );
282 
283  pglayout.SetPageLayout( pg_fullfilename );
284 
285  return isRead;
286 }
287 
288 
289 void SCH_EDIT_FRAME::SaveProjectSettings( bool aAskForSave )
290 {
291  PROJECT& prj = Prj();
292  wxFileName fn = g_RootSheet->GetScreen()->GetFileName(); //ConfigFileName
293 
294  fn.SetExt( ProjectFileExtension );
295 
296  if( !IsWritable( fn ) )
297  return;
298 
299  if( aAskForSave )
300  {
301  wxFileDialog dlg( this, _( "Save Project File" ),
302  fn.GetPath(), fn.GetFullName(),
303  ProjectFileWildcard(), wxFD_SAVE );
304 
305  if( dlg.ShowModal() == wxID_CANCEL )
306  return;
307 
308  fn = dlg.GetPath();
309  }
310 
312 }
313 
316 
317 const wxChar RescueNeverShowEntry[] = wxT( "RescueNeverShow" );
318 const wxChar AutoplaceFieldsEntry[] = wxT( "AutoplaceFields" );
319 const wxChar AutoplaceJustifyEntry[] = wxT( "AutoplaceJustify" );
320 const wxChar AutoplaceAlignEntry[] = wxT( "AutoplaceAlign" );
321 static const wxChar FootprintPreviewEntry[] = wxT( "FootprintPreview" );
322 static const wxChar DefaultBusWidthEntry[] = wxT( "DefaultBusWidth" );
323 static const wxChar DefaultDrawLineWidthEntry[] = wxT( "DefaultDrawLineWidth" );
324 static const wxChar DefaultJctSizeEntry[] = wxT( "DefaultJunctionSize" );
325 static const wxChar ShowHiddenPinsEntry[] = wxT( "ShowHiddenPins" );
326 static const wxChar HorzVertLinesOnlyEntry[] = wxT( "HorizVertLinesOnly" );
327 static const wxChar FindReplaceFlagsEntry[] = wxT( "LastFindReplaceFlags" );
328 static const wxChar FindStringEntry[] = wxT( "LastFindString" );
329 static const wxChar ReplaceStringEntry[] = wxT( "LastReplaceString" );
330 static const wxChar FindStringHistoryEntry[] = wxT( "FindStringHistoryList%d" );
331 static const wxChar ReplaceStringHistoryEntry[] = wxT( "ReplaceStringHistoryList%d" );
332 static const wxChar FieldNamesEntry[] = wxT( "FieldNames" );
333 static const wxChar SimulatorCommandEntry[] = wxT( "SimCmdLine" );
334 static const wxString ShowPageLimitsEntry = "ShowPageLimits";
335 static const wxString UnitsEntry = "Units";
336 static const wxString PrintMonochromeEntry = "PrintMonochrome";
337 static const wxString PrintSheetRefEntry = "PrintSheetReferenceAndTitleBlock";
338 static const wxString RepeatStepXEntry = "RepeatStepX";
339 static const wxString RepeatStepYEntry = "RepeatStepY";
340 static const wxString RepeatLabelIncrementEntry = "RepeatLabelIncrement";
341 
342 // Library editor wxConfig entry names.
343 static const wxChar defaultLibWidthEntry[] = wxT( "LibeditLibWidth" );
344 static const wxChar defaultPinNumSizeEntry[] = wxT( "LibeditPinNumSize" );
345 static const wxChar defaultPinNameSizeEntry[] = wxT( "LibeditPinNameSize" );
346 static const wxChar DefaultPinLengthEntry[] = wxT( "DefaultPinLength" );
347 static const wxChar repeatLibLabelIncEntry[] = wxT( "LibeditRepeatLabelInc" );
348 static const wxChar pinRepeatStepEntry[] = wxT( "LibeditPinRepeatStep" );
349 static const wxChar repeatLibStepXEntry[] = wxT( "LibeditRepeatStepX" );
350 static const wxChar repeatLibStepYEntry[] = wxT( "LibeditRepeatStepY" );
351 static const wxChar showPinElectricalType[] = wxT( "LibeditShowPinElectricalType" );
352 
354 
356 {
357  if( !m_configSettings.empty() )
358  return m_configSettings;
359 
361  &m_showPageLimits, true ) );
362  m_configSettings.push_back( new PARAM_CFG_INT( true, UnitsEntry,
363  (int*)&m_UserUnits, MILLIMETRES ) );
364 
366  &m_printMonochrome, true ) );
367  m_configSettings.push_back( new PARAM_CFG_BOOL( true, PrintSheetRefEntry,
368  &m_printSheetReference, true ) );
369 
370  m_configSettings.push_back( new PARAM_CFG_INT( true, RepeatStepXEntry,
371  &m_repeatStep.x,
374  REPEAT_OFFSET_MAX ) );
375  m_configSettings.push_back( new PARAM_CFG_INT( true, RepeatStepYEntry,
376  &m_repeatStep.y,
379  REPEAT_OFFSET_MAX ) );
382  DEFAULT_REPEAT_LABEL_INC, -10, +10 ) );
383  return m_configSettings;
384 }
385 
386 
387 void SCH_EDIT_FRAME::LoadSettings( wxConfigBase* aCfg )
388 {
390 
391  long tmp;
392 
395 
399  aCfg->Read( ShowHiddenPinsEntry, &m_showAllPins, false );
400  aCfg->Read( HorzVertLinesOnlyEntry, &m_forceHVLines, true );
401  aCfg->Read( AutoplaceFieldsEntry, &m_autoplaceFields, true );
402  aCfg->Read( AutoplaceJustifyEntry, &m_autoplaceJustify, true );
403  aCfg->Read( AutoplaceAlignEntry, &m_autoplaceAlign, false );
404  aCfg->Read( FootprintPreviewEntry, &m_footprintPreview, false );
405 
406  // Load netlists options:
408 
409  wxASSERT_MSG( m_findReplaceData,
410  wxT( "Find dialog data settings object not created. Bad programmer!" ) );
411 
412  aCfg->Read( FindReplaceFlagsEntry, &tmp, (long) wxFR_DOWN );
413  m_findReplaceData->SetFlags( (wxUint32) tmp & ~FR_REPLACE_ITEM_FOUND );
414  m_findReplaceData->SetFindString( aCfg->Read( FindStringEntry, wxEmptyString ) );
415  m_findReplaceData->SetReplaceString( aCfg->Read( ReplaceStringEntry, wxEmptyString ) );
416 
417  // Load the find and replace string history list.
418  for( int i = 0; i < FR_HISTORY_LIST_CNT; ++i )
419  {
420  wxString tmpHistory;
421  wxString entry;
422  entry.Printf( FindStringHistoryEntry, i );
423  tmpHistory = aCfg->Read( entry, wxEmptyString );
424 
425  if( !tmpHistory.IsEmpty() )
426  m_findStringHistoryList.Add( tmpHistory );
427 
428  entry.Printf( ReplaceStringHistoryEntry, i );
429  tmpHistory = aCfg->Read( entry, wxEmptyString );
430 
431  if( !tmpHistory.IsEmpty() )
432  m_replaceStringHistoryList.Add( tmpHistory );
433  }
434 
435  wxString templateFieldNames = aCfg->Read( FieldNamesEntry, wxEmptyString );
436 
437  if( !templateFieldNames.IsEmpty() )
438  {
439  TEMPLATE_FIELDNAMES_LEXER lexer( TO_UTF8( templateFieldNames ) );
440 
441  try
442  {
443  m_templateFieldNames.Parse( &lexer );
444  }
445  catch( const IO_ERROR& DBG( e ) )
446  {
447  // @todo show error msg
448  DBG( printf( "templatefieldnames parsing error: '%s'\n", TO_UTF8( e.What() ) ); )
449  }
450  }
451 
452  auto painter = static_cast<KIGFX::SCH_PAINTER*>( GetCanvas()->GetView()->GetPainter() );
453  KIGFX::SCH_RENDER_SETTINGS* settings = painter->GetSettings();
454  settings->m_ShowPinsElectricalType = false;
455  settings->m_ShowHiddenText = false;
456  settings->m_ShowHiddenPins = m_showAllPins;
457  settings->SetShowPageLimits( m_showPageLimits );
458  settings->m_ShowUmbilicals = true;
459 }
460 
461 
462 void SCH_EDIT_FRAME::SaveSettings( wxConfigBase* aCfg )
463 {
465 
467 
468  aCfg->Write( DefaultBusWidthEntry, (long) GetDefaultBusThickness() );
469  aCfg->Write( DefaultDrawLineWidthEntry, (long) GetDefaultLineThickness() );
470  aCfg->Write( DefaultJctSizeEntry, (long) SCH_JUNCTION::GetSymbolSize() );
471  aCfg->Write( ShowHiddenPinsEntry, m_showAllPins );
472  aCfg->Write( HorzVertLinesOnlyEntry, GetForceHVLines() );
473  aCfg->Write( AutoplaceFieldsEntry, m_autoplaceFields );
475  aCfg->Write( AutoplaceAlignEntry, m_autoplaceAlign );
477 
478  // Save netlists options:
480 
481  // Save find dialog session setting.
482  wxASSERT_MSG( m_findReplaceData,
483  wxT( "Find dialog data settings object not created. Bad programmer!" ) );
484  aCfg->Write( FindReplaceFlagsEntry,
485  (long) m_findReplaceData->GetFlags() & ~FR_REPLACE_ITEM_FOUND );
486  aCfg->Write( FindStringEntry, m_findReplaceData->GetFindString() );
487  aCfg->Write( ReplaceStringEntry, m_findReplaceData->GetReplaceString() );
488 
489  // Save the find and replace string history list.
490  unsigned i;
491  wxString tmpHistory;
492  wxString entry; // invoke constructor outside of any loops
493 
494  for( i = 0; i < m_findStringHistoryList.GetCount() && i < FR_HISTORY_LIST_CNT; i++ )
495  {
496  entry.Printf( FindStringHistoryEntry, i );
497  aCfg->Write( entry, m_findStringHistoryList[ i ] );
498  }
499 
500  for( i = 0; i < m_replaceStringHistoryList.GetCount() && i < FR_HISTORY_LIST_CNT; i++ )
501  {
502  entry.Printf( ReplaceStringHistoryEntry, i );
503  aCfg->Write( entry, m_replaceStringHistoryList[ i ] );
504  }
505 
506  // Save template fieldnames
507  STRING_FORMATTER sf;
508  m_templateFieldNames.Format( &sf, 0 );
509 
510  wxString record = FROM_UTF8( sf.GetString().c_str() );
511  record.Replace( wxT("\n"), wxT(""), true ); // strip all newlines
512  record.Replace( wxT(" "), wxT(" "), true ); // double space to single
513 
514  aCfg->Write( FieldNamesEntry, record );
515 }
516 
517 
518 void LIB_EDIT_FRAME::LoadSettings( wxConfigBase* aCfg )
519 {
521 
523 
530 
531  wxPoint step;
532  aCfg->Read( repeatLibStepXEntry, &step.x, DEFAULT_REPEAT_OFFSET_X );
533  aCfg->Read( repeatLibStepYEntry, &step.y, DEFAULT_REPEAT_OFFSET_Y );
534  SetRepeatStep( step );
535  m_showPinElectricalTypeName = aCfg->ReadBool( showPinElectricalType, true );
537 
538  wxString templateFieldNames = aCfg->Read( FieldNamesEntry, wxEmptyString );
539 
540  if( !templateFieldNames.IsEmpty() )
541  {
542  TEMPLATE_FIELDNAMES_LEXER lexer( TO_UTF8( templateFieldNames ) );
543 
544  try
545  {
546  m_templateFieldNames.Parse( &lexer );
547  }
548  catch( const IO_ERROR& DBG( e ) )
549  {
550  // @todo show error msg
551  DBG( printf( "templatefieldnames parsing error: '%s'\n", TO_UTF8( e.What() ) ); )
552  }
553  }
554 
555  auto painter = static_cast<KIGFX::SCH_PAINTER*>( GetCanvas()->GetView()->GetPainter() );
556  KIGFX::SCH_RENDER_SETTINGS* settings = painter->GetSettings();
558 
559  // Hidden elements must be editable
560  settings->m_ShowHiddenText = true;
561  settings->m_ShowHiddenPins = true;
562  settings->m_ShowUmbilicals = false;
563 }
564 
565 
566 void LIB_EDIT_FRAME::SaveSettings( wxConfigBase* aCfg )
567 {
569 
570  aCfg->Write( DefaultPinLengthEntry, GetDefaultPinLength() );
574  aCfg->Write( pinRepeatStepEntry, GetRepeatPinStep() );
575  aCfg->Write( repeatLibStepXEntry, GetRepeatStep().x );
576  aCfg->Write( repeatLibStepYEntry, GetRepeatStep().y );
578  aCfg->Write( defaultLibWidthEntry, m_treePane->GetSize().x );
579 }
580 
581 
582 void LIB_EDIT_FRAME::OnPreferencesOptions( wxCommandEvent& event )
583 {
585  {
586  SaveSettings( config() ); // save values shared by eeschema applications.
587  m_canvas->Refresh( true );
588  }
589 }
590 
591 
593 {
594  wxTreebook* book = aParent->GetTreebook();
595 
596  book->AddPage( new PANEL_LIBEDIT_SETTINGS( this, book ), _( "Symbol Editor" ) );
597  book->AddSubPage( new PANEL_LIBEDIT_DISPLAY_OPTIONS( this, aParent ), _( "Display Options" ) );
598 }
599 
600 
601 SYMBOL_LIB_TABLE* PROJECT::SchSymbolLibTable()
602 {
603  // This is a lazy loading function, it loads the project specific table when
604  // that table is asked for, not before.
606 
607  // its gotta be NULL or a SYMBOL_LIB_TABLE, or a bug.
608  wxASSERT( !tbl || tbl->Type() == SYMBOL_LIB_TABLE_T );
609 
610  if( !tbl )
611  {
612  // Stack the project specific SYMBOL_LIB_TABLE overlay on top of the global table.
613  // ~SYMBOL_LIB_TABLE() will not touch the fallback table, so multiple projects may
614  // stack this way, all using the same global fallback table.
616 
618 
619  wxString prjPath;
620 
621  wxGetEnv( PROJECT_VAR_NAME, &prjPath );
622 
623  if( !prjPath.IsEmpty() )
624  {
625  wxFileName fn( prjPath, SYMBOL_LIB_TABLE::GetSymbolLibTableFileName() );
626 
627  try
628  {
629  tbl->Load( fn.GetFullPath() );
630  }
631  catch( const IO_ERROR& ioe )
632  {
633  wxString msg;
634  msg.Printf( _( "An error occurred loading the symbol library table \"%s\"." ),
635  fn.GetFullPath() );
636  DisplayErrorMessage( NULL, msg, ioe.What() );
637  }
638  }
639  }
640 
641  return tbl;
642 }
static const wxChar defaultLibWidthEntry[]
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:323
static const wxString RepeatLabelIncrementEntry
const wxString & GetFileName() const
Definition: sch_screen.h:131
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
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:257
This file is part of the common library TODO brief description.
PARAM_CFG_ARRAY m_projectFileParams
void OnPreferencesOptions(wxCommandEvent &event)
void SetDefaultBusThickness(int aThickness)
wxArrayString m_findStringHistoryList
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: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.
#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()
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
wxFindReplaceData * m_findReplaceData
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
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)
Function IsWritable checks if aFileName can be written.
static const wxString UnitsEntry
bool m_autoplaceAlign
align autoplaced fields to the grid
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
VTBL_ENTRY void SetElem(ELEM_T aIndex, _ELEM *aElem)
Definition: project.cpp:217
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
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()
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:56
static const wxString RepeatStepXEntry
static const wxChar FindStringHistoryEntry[]
void LoadSettings(wxConfigBase *aCfg) override
Function LoadSettings loads common frame parameters from a configuration file.
virtual const wxString What() const
A composite of Problem() and Where()
Definition: exceptions.cpp:33
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
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[]
Definition of file extensions used in Kicad.
const wxPoint GetRepeatStep() const
#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.
wxArrayString m_replaceStringHistoryList
#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
bool m_printMonochrome
Print monochrome instead of grey scale.
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.
#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.
PARAM_CFG_ARRAY m_configSettings
bool m_autoplaceFields
automatically place component fields
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.
wxString ProjectFileWildcard()
static int m_textPinNameDefaultSize
The default pin name text size setting.
static const wxChar pinRepeatStepEntry[]
static const wxChar DefaultPinLengthEntry[]
bool m_showAllPins
Flag to indicate show hidden pins.
#define FR_HISTORY_LIST_CNT
Maximum number of find and replace strings.
bool m_printSheetReference
EDA_DRAW_PANEL * m_canvas
The area to draw on.
Definition: draw_frame.h:126
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:48
see class PGM_BASE
#define DEFAULTLIBWIDTH
Definition: general.h:71
static int GetPinNameDefaultSize()
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: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[]
int GetRepeatDeltaLabel() const
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:114
#define DEFAULTPINNAMESIZE
The default library pane width.
Definition: general.h:68
wxString m_simulatorCommand
Command line used to call the circuit simulator (gnucap, spice, ...)
Class SCH_RENDER_SETTINGS Stores schematic-specific render settings.
Definition: sch_painter.h:67
Definition of class LIB_EDIT_FRAME.
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.
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:358
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
int GetRepeatPinStep() const
static void SetDefaultPinLength(int aLength)
Set the default pin len.
SYMBOL_TREE_PANE * m_treePane
component search tree widget
EDA_UNITS_T m_UserUnits
Definition: draw_frame.h:123
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:243
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[]
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.
void SetShowPageLimits(bool aDraw)
Definition: painter.h:186
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[]