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 <sch_sheet.h>
36 #include <invoke_sch_dialog.h>
37 #include <lib_edit_frame.h>
38 #include <eeschema_config.h>
39 #include <ee_hotkeys.h>
41 #include <class_library.h>
42 #include <symbol_lib_table.h>
43 #include <dialog_erc.h>
45 #include <widgets/paged_dialog.h>
53 #include <sch_view.h>
54 #include <sch_painter.h>
55 #include "sch_junction.h"
56 
57 #define FR_HISTORY_LIST_CNT 10
58 
59 
61 
63 {
64  return s_defaultBusThickness;
65 }
66 
67 
68 void SetDefaultBusThickness( int aThickness)
69 {
70  if( aThickness >= 1 )
71  s_defaultBusThickness = aThickness;
72  else
74 }
75 
76 
79 
81 {
82  return s_defaultTextSize;
83 }
84 
85 
86 void SetDefaultTextSize( int aTextSize )
87 {
88  s_defaultTextSize = aTextSize;
89 }
90 
91 
92 /*
93  * Default line (in Eeschema units) thickness used to draw/plot items having a
94  * default thickness line value (i.e. = 0 ).
95  */
97 
98 
100 {
102 }
103 
104 
105 void SetDefaultLineThickness( int aThickness )
106 {
107  if( aThickness >=1 )
108  s_drawDefaultLineThickness = aThickness;
109  else
111 }
112 
113 
114 // Color to draw selected items
116 {
117  return COLOR4D( BROWN );
118 }
119 
120 
121 // Color to draw items flagged invisible, in libedit (they are invisible
122 // in Eeschema
124 {
125  return COLOR4D( DARKGRAY );
126 }
127 
128 
129 void LIB_EDIT_FRAME::Process_Config( wxCommandEvent& event )
130 {
131  int id = event.GetId();
132 
133  switch( id )
134  {
136  // Display current hotkey list for LibEdit.
138  break;
139 
140  default:
141  DisplayError( this, wxT( "LIB_EDIT_FRAME::Process_Config error" ) );
142  }
143 }
144 
145 
146 void SCH_EDIT_FRAME::Process_Config( wxCommandEvent& event )
147 {
148  int id = event.GetId();
149  wxFileName fn;
150 
151  switch( id )
152  {
153  case ID_CONFIG_SAVE:
154  SaveProjectSettings( true );
155  break;
156 
157  case ID_CONFIG_READ:
158  {
159  fn = g_RootSheet->GetScreen()->GetFileName();
160  fn.SetExt( ProjectFileExtension );
161 
162  wxFileDialog dlg( this, _( "Load Project File" ), fn.GetPath(), fn.GetFullName(),
163  ProjectFileWildcard(), 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_EDIT,
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_WriteFile" ),
253  &m_ercSettings.write_erc_file, false ) );
254 
255  m_projectFileParams.push_back( new PARAM_CFG_BOOL( wxT( "ERC_TestSimilarLabels" ),
257 
258  m_projectFileParams.push_back( new PARAM_CFG_BOOL( wxT( "ERC_CheckUniqueGlobalLabels" ),
260 
261  m_projectFileParams.push_back( new PARAM_CFG_BOOL( wxT( "ERC_CheckBusDriverConflicts" ),
263 
264  m_projectFileParams.push_back( new PARAM_CFG_BOOL( wxT( "ERC_CheckBusEntryConflicts" ),
266 
267  m_projectFileParams.push_back( new PARAM_CFG_BOOL( wxT( "ERC_CheckBusToBusConflicts" ),
269 
270  m_projectFileParams.push_back( new PARAM_CFG_BOOL( wxT( "ERC_CheckBusToNetConflicts" ),
272 
273  return m_projectFileParams;
274 }
275 
276 
278 {
279  // Read library list and library path list
280  bool ret = Prj().ConfigLoad( Kiface().KifaceSearch(), GROUP_SCH, GetProjectFileParameters() );
281 
282  // Read schematic editor setup
283  ret &= Prj().ConfigLoad( Kiface().KifaceSearch(), GROUP_SCH_EDIT, GetProjectFileParameters() );
284 
285  // Verify some values, because the config file can be edited by hand,
286  // and have bad values:
290 
291  // Load the page layout decr file, from the filename stored in
292  // BASE_SCREEN::m_PageLayoutDescrFileName, read in config project file
293  // If empty, or not existing, the default descr is loaded
295  wxString pg_fullfilename = WORKSHEET_LAYOUT::MakeFullFileName(
297  Prj().GetProjectPath() );
298 
299  pglayout.SetPageLayout( pg_fullfilename );
300 
301  return ret;
302 }
303 
304 
305 void SCH_EDIT_FRAME::SaveProjectSettings( bool aAskForSave )
306 {
307  PROJECT& prj = Prj();
308  wxFileName fn = g_RootSheet->GetScreen()->GetFileName(); //ConfigFileName
309 
310  fn.SetExt( ProjectFileExtension );
311 
312  if( !IsWritable( fn ) )
313  return;
314 
315  if( aAskForSave )
316  {
317  wxFileDialog dlg( this, _( "Save Project File" ), fn.GetPath(), fn.GetFullName(),
318  ProjectFileWildcard(), wxFD_SAVE );
319 
320  if( dlg.ShowModal() == wxID_CANCEL )
321  return;
322 
323  fn = dlg.GetPath();
324  }
325 
326  wxString path = fn.GetFullPath();
327 
328  prj.ConfigSave( Kiface().KifaceSearch(), GROUP_SCH_EDIT, GetProjectFileParameters(), path );
329 }
330 
333 
334 const wxChar RescueNeverShowEntry[] = wxT( "RescueNeverShow" );
335 const wxChar AutoplaceFieldsEntry[] = wxT( "AutoplaceFields" );
336 const wxChar AutoplaceJustifyEntry[] = wxT( "AutoplaceJustify" );
337 const wxChar AutoplaceAlignEntry[] = wxT( "AutoplaceAlign" );
338 static const wxChar FootprintPreviewEntry[] = wxT( "FootprintPreview" );
339 static const wxChar DefaultBusWidthEntry[] = wxT( "DefaultBusWidth" );
340 static const wxChar DefaultDrawLineWidthEntry[] = wxT( "DefaultDrawLineWidth" );
341 static const wxChar DefaultJctSizeEntry[] = wxT( "DefaultJunctionSize" );
342 static const wxChar ShowHiddenPinsEntry[] = wxT( "ShowHiddenPins" );
343 static const wxChar HorzVertLinesOnlyEntry[] = wxT( "HorizVertLinesOnly" );
344 static const wxChar FindReplaceFlagsEntry[] = wxT( "LastFindReplaceFlags" );
345 static const wxChar FindStringEntry[] = wxT( "LastFindString" );
346 static const wxChar ReplaceStringEntry[] = wxT( "LastReplaceString" );
347 static const wxChar FindStringHistoryEntry[] = wxT( "FindStringHistoryList%d" );
348 static const wxChar ReplaceStringHistoryEntry[] = wxT( "ReplaceStringHistoryList%d" );
349 static const wxChar FieldNamesEntry[] = wxT( "FieldNames" );
350 static const wxChar SimulatorCommandEntry[] = wxT( "SimCmdLine" );
351 static const wxString ShowPageLimitsEntry = "ShowPageLimits";
352 static const wxString UnitsEntry = "Units";
353 static const wxString PrintMonochromeEntry = "PrintMonochrome";
354 static const wxString PrintSheetRefEntry = "PrintSheetReferenceAndTitleBlock";
355 static const wxString RepeatStepXEntry = "RepeatStepX";
356 static const wxString RepeatStepYEntry = "RepeatStepY";
357 static const wxString RepeatLabelIncrementEntry = "RepeatLabelIncrement";
358 
359 // Library editor wxConfig entry names.
360 static const wxChar defaultLibWidthEntry[] = wxT( "LibeditLibWidth" );
361 static const wxChar defaultPinNumSizeEntry[] = wxT( "LibeditPinNumSize" );
362 static const wxChar defaultPinNameSizeEntry[] = wxT( "LibeditPinNameSize" );
363 static const wxChar DefaultPinLengthEntry[] = wxT( "DefaultPinLength" );
364 static const wxChar repeatLibLabelIncEntry[] = wxT( "LibeditRepeatLabelInc" );
365 static const wxChar pinRepeatStepEntry[] = wxT( "LibeditPinRepeatStep" );
366 static const wxChar repeatLibStepXEntry[] = wxT( "LibeditRepeatStepX" );
367 static const wxChar repeatLibStepYEntry[] = wxT( "LibeditRepeatStepY" );
368 static const wxChar showPinElectricalType[] = wxT( "LibeditShowPinElectricalType" );
369 
371 
373 {
374  if( !m_configSettings.empty() )
375  return m_configSettings;
376 
378  &m_showPageLimits, true ) );
379  m_configSettings.push_back( new PARAM_CFG_INT( true, UnitsEntry,
380  (int*)&m_UserUnits, MILLIMETRES ) );
381 
383  &m_printMonochrome, true ) );
384  m_configSettings.push_back( new PARAM_CFG_BOOL( true, PrintSheetRefEntry,
385  &m_printSheetReference, true ) );
386 
387  m_configSettings.push_back( new PARAM_CFG_INT( true, RepeatStepXEntry,
388  &m_repeatStep.x,
391  REPEAT_OFFSET_MAX ) );
392  m_configSettings.push_back( new PARAM_CFG_INT( true, RepeatStepYEntry,
393  &m_repeatStep.y,
396  REPEAT_OFFSET_MAX ) );
399  DEFAULT_REPEAT_LABEL_INC, -10, +10 ) );
400  return m_configSettings;
401 }
402 
403 
404 void SCH_EDIT_FRAME::LoadSettings( wxConfigBase* aCfg )
405 {
407 
408  long tmp;
409 
412 
416  aCfg->Read( ShowHiddenPinsEntry, &m_showAllPins, false );
417  aCfg->Read( HorzVertLinesOnlyEntry, &m_forceHVLines, true );
418  aCfg->Read( AutoplaceFieldsEntry, &m_autoplaceFields, true );
419  aCfg->Read( AutoplaceJustifyEntry, &m_autoplaceJustify, true );
420  aCfg->Read( AutoplaceAlignEntry, &m_autoplaceAlign, false );
421  aCfg->Read( FootprintPreviewEntry, &m_footprintPreview, false );
422 
423  // Load netlists options:
425 
426  wxASSERT_MSG( m_findReplaceData,
427  wxT( "Find dialog data settings object not created. Bad programmer!" ) );
428 
429  aCfg->Read( FindReplaceFlagsEntry, &tmp, (long) wxFR_DOWN );
430  m_findReplaceData->SetFlags( (wxUint32) tmp & ~FR_REPLACE_ITEM_FOUND );
431  m_findReplaceData->SetFindString( aCfg->Read( FindStringEntry, wxEmptyString ) );
432  m_findReplaceData->SetReplaceString( aCfg->Read( ReplaceStringEntry, wxEmptyString ) );
433 
434  // Load the find and replace string history list.
435  for( int i = 0; i < FR_HISTORY_LIST_CNT; ++i )
436  {
437  wxString tmpHistory;
438  wxString entry;
439  entry.Printf( FindStringHistoryEntry, i );
440  tmpHistory = aCfg->Read( entry, wxEmptyString );
441 
442  if( !tmpHistory.IsEmpty() )
443  m_findStringHistoryList.Add( tmpHistory );
444 
445  entry.Printf( ReplaceStringHistoryEntry, i );
446  tmpHistory = aCfg->Read( entry, wxEmptyString );
447 
448  if( !tmpHistory.IsEmpty() )
449  m_replaceStringHistoryList.Add( tmpHistory );
450  }
451 
452  wxString templateFieldNames = aCfg->Read( FieldNamesEntry, wxEmptyString );
453 
454  if( !templateFieldNames.IsEmpty() )
455  {
456  TEMPLATE_FIELDNAMES_LEXER lexer( TO_UTF8( templateFieldNames ) );
457 
458  try
459  {
460  m_templateFieldNames.Parse( &lexer );
461  }
462  catch( const IO_ERROR& DBG( e ) )
463  {
464  // @todo show error msg
465  DBG( printf( "templatefieldnames parsing error: '%s'\n", TO_UTF8( e.What() ) ); )
466  }
467  }
468 
469  auto painter = static_cast<KIGFX::SCH_PAINTER*>( GetCanvas()->GetView()->GetPainter() );
470  KIGFX::SCH_RENDER_SETTINGS* settings = painter->GetSettings();
471  settings->m_ShowPinsElectricalType = false;
472  settings->m_ShowHiddenText = false;
473  settings->m_ShowHiddenPins = m_showAllPins;
474  settings->SetShowPageLimits( m_showPageLimits );
475  settings->m_ShowUmbilicals = true;
476 }
477 
478 
479 void SCH_EDIT_FRAME::SaveSettings( wxConfigBase* aCfg )
480 {
482 
484 
485  aCfg->Write( DefaultBusWidthEntry, (long) GetDefaultBusThickness() );
486  aCfg->Write( DefaultDrawLineWidthEntry, (long) GetDefaultLineThickness() );
487  aCfg->Write( DefaultJctSizeEntry, (long) SCH_JUNCTION::GetSymbolSize() );
488  aCfg->Write( ShowHiddenPinsEntry, m_showAllPins );
489  aCfg->Write( HorzVertLinesOnlyEntry, GetForceHVLines() );
490  aCfg->Write( AutoplaceFieldsEntry, m_autoplaceFields );
492  aCfg->Write( AutoplaceAlignEntry, m_autoplaceAlign );
494 
495  // Save netlists options:
497 
498  // Save find dialog session setting.
499  wxASSERT_MSG( m_findReplaceData,
500  wxT( "Find dialog data settings object not created. Bad programmer!" ) );
501  aCfg->Write( FindReplaceFlagsEntry,
502  (long) m_findReplaceData->GetFlags() & ~FR_REPLACE_ITEM_FOUND );
503  aCfg->Write( FindStringEntry, m_findReplaceData->GetFindString() );
504  aCfg->Write( ReplaceStringEntry, m_findReplaceData->GetReplaceString() );
505 
506  // Save the find and replace string history list.
507  unsigned i;
508  wxString tmpHistory;
509  wxString entry; // invoke constructor outside of any loops
510 
511  for( i = 0; i < m_findStringHistoryList.GetCount() && i < FR_HISTORY_LIST_CNT; i++ )
512  {
513  entry.Printf( FindStringHistoryEntry, i );
514  aCfg->Write( entry, m_findStringHistoryList[ i ] );
515  }
516 
517  for( i = 0; i < m_replaceStringHistoryList.GetCount() && i < FR_HISTORY_LIST_CNT; i++ )
518  {
519  entry.Printf( ReplaceStringHistoryEntry, i );
520  aCfg->Write( entry, m_replaceStringHistoryList[ i ] );
521  }
522 
523  // Save template fieldnames
524  STRING_FORMATTER sf;
525  m_templateFieldNames.Format( &sf, 0 );
526 
527  wxString record = FROM_UTF8( sf.GetString().c_str() );
528  record.Replace( wxT("\n"), wxT(""), true ); // strip all newlines
529  record.Replace( wxT(" "), wxT(" "), true ); // double space to single
530 
531  aCfg->Write( FieldNamesEntry, record );
532 }
533 
534 
535 void LIB_EDIT_FRAME::LoadSettings( wxConfigBase* aCfg )
536 {
538 
540 
547 
548  wxPoint step;
549  aCfg->Read( repeatLibStepXEntry, &step.x, DEFAULT_REPEAT_OFFSET_X );
550  aCfg->Read( repeatLibStepYEntry, &step.y, DEFAULT_REPEAT_OFFSET_Y );
551  SetRepeatStep( step );
552  m_showPinElectricalTypeName = aCfg->ReadBool( showPinElectricalType, true );
554 
555  wxString templateFieldNames = aCfg->Read( FieldNamesEntry, wxEmptyString );
556 
557  if( !templateFieldNames.IsEmpty() )
558  {
559  TEMPLATE_FIELDNAMES_LEXER lexer( TO_UTF8( templateFieldNames ) );
560 
561  try
562  {
563  m_templateFieldNames.Parse( &lexer );
564  }
565  catch( const IO_ERROR& DBG( e ) )
566  {
567  // @todo show error msg
568  DBG( printf( "templatefieldnames parsing error: '%s'\n", TO_UTF8( e.What() ) ); )
569  }
570  }
571 
572  auto painter = static_cast<KIGFX::SCH_PAINTER*>( GetCanvas()->GetView()->GetPainter() );
573  KIGFX::SCH_RENDER_SETTINGS* settings = painter->GetSettings();
575 
576  // Hidden elements must be editable
577  settings->m_ShowHiddenText = true;
578  settings->m_ShowHiddenPins = true;
579  settings->m_ShowUmbilicals = false;
580 }
581 
582 
583 void LIB_EDIT_FRAME::SaveSettings( wxConfigBase* aCfg )
584 {
586 
587  aCfg->Write( DefaultPinLengthEntry, GetDefaultPinLength() );
591  aCfg->Write( pinRepeatStepEntry, GetRepeatPinStep() );
592  aCfg->Write( repeatLibStepXEntry, GetRepeatStep().x );
593  aCfg->Write( repeatLibStepYEntry, GetRepeatStep().y );
595  aCfg->Write( defaultLibWidthEntry, m_treePane->GetSize().x );
596 }
597 
598 
599 void LIB_EDIT_FRAME::OnPreferencesOptions( wxCommandEvent& event )
600 {
602  {
603  SaveSettings( config() ); // save values shared by eeschema applications.
604  m_canvas->Refresh( true );
605  }
606 }
607 
608 
610 {
611  wxTreebook* book = aParent->GetTreebook();
612 
613  book->AddPage( new PANEL_LIBEDIT_SETTINGS( this, book ), _( "Symbol Editor" ) );
614  book->AddSubPage( new PANEL_LIBEDIT_DISPLAY_OPTIONS( this, aParent ), _( "Display Options" ) );
615 }
616 
617 
618 SYMBOL_LIB_TABLE* PROJECT::SchSymbolLibTable()
619 {
620  // This is a lazy loading function, it loads the project specific table when
621  // that table is asked for, not before.
623 
624  // its gotta be NULL or a SYMBOL_LIB_TABLE, or a bug.
625  wxASSERT( !tbl || tbl->Type() == SYMBOL_LIB_TABLE_T );
626 
627  if( !tbl )
628  {
629  // Stack the project specific SYMBOL_LIB_TABLE overlay on top of the global table.
630  // ~SYMBOL_LIB_TABLE() will not touch the fallback table, so multiple projects may
631  // stack this way, all using the same global fallback table.
633 
635 
636  wxString prjPath;
637 
638  wxGetEnv( PROJECT_VAR_NAME, &prjPath );
639 
640  if( !prjPath.IsEmpty() )
641  {
642  wxFileName fn( prjPath, SYMBOL_LIB_TABLE::GetSymbolLibTableFileName() );
643 
644  try
645  {
646  tbl->Load( fn.GetFullPath() );
647  }
648  catch( const IO_ERROR& ioe )
649  {
650  wxString msg;
651  msg.Printf( _( "An error occurred loading the symbol library table \"%s\"." ),
652  fn.GetFullPath() );
653  DisplayErrorMessage( NULL, msg, ioe.What() );
654  }
655  }
656  }
657 
658  return tbl;
659 }
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:64
VTBL_ENTRY void ConfigSave(const SEARCH_STACK &aSList, const wxString &aGroupName, const PARAM_CFG_ARRAY &aParams, const wxString &aFileName=wxEmptyString)
Function ConfigSave saves the current "project" parameters into the wxConfigBase* derivative.
Definition: project.cpp:323
static const wxString RepeatLabelIncrementEntry
const wxString & GetFileName() const
Definition: sch_screen.h:124
void Process_Config(wxCommandEvent &event)
static const wxChar ReplaceStringHistoryEntry[]
#define LIB_EDIT_FRAME_NAME
Definition: draw_frame.h:50
#define DEFAULT_SIZE_TEXT
This is the "default-of-the-default" hardcoded text size; individual application define their own def...
Definition: eda_text.h:88
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:61
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:258
This file is part of the common library TODO brief description.
bool check_unique_global_labels
If true, check to ensure that each global label apperas more than once.
Definition: erc_settings.h:67
PARAM_CFG_ARRAY m_projectFileParams
void 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:51
void SetRepeatDeltaLabel(int aDelta)
Sets the repeat delta label value for repeat command.
static const wxString ShowPageLimitsEntry
static const wxString RepeatStepYEntry
void SetRepeatPinStep(int aStep)
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()
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.
bool write_erc_file
If true, write ERC results to a file.
Definition: erc_settings.h:61
void SaveSettings(wxConfigBase *aCfg) override
Saves common frame parameters to a configuration data file.
static const wxString PrintSheetRefEntry
PARAM_CFG_ARRAY & GetProjectFileParameters()
Return the project file parameter list for Eeschema.
const wxChar RescueNeverShowEntry[]
static int s_defaultBusThickness
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()
Return the wxConfigBase used in SaveSettings().
#define DEFAULT_REPEAT_OFFSET_PIN
the default value (overwritten by the eeschema config)
Definition: general.h:52
VTBL_ENTRY _ELEM * GetElem(ELEM_T aIndex)
Typically wrapped somewhere else in a more meaningful function wrapper.
Definition: project.cpp:205
bool IsWritable(const wxFileName &aFileName)
Checks if aFileName can be written.
bool check_bus_to_bus_conflicts
If true, check that bus-to-bus connections share at least one member.
Definition: erc_settings.h:76
static const wxString UnitsEntry
bool m_autoplaceAlign
align autoplaced fields to the grid
void InstallPreferences(PAGED_DIALOG *aParent) override
Allows Libedit to install its preferences panel into the preferences dialog.
SCH_SCREEN * GetScreen()
Definition: sch_sheet.h:268
static const wxChar repeatLibLabelIncEntry[]
COLOR4D GetInvisibleItemColor()
void SaveSettings(wxConfigBase *aCfg) override
Saves common frame parameters to a configuration data file.
KIFACE_I & Kiface()
Global KIFACE_I "get" accessor.
Definition: kicad.cpp: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:50
static const wxChar FootprintPreviewEntry[]
void SetDefaultLineThickness(int aThickness)
#define SCH_EDIT_FRAME_NAME
Definition: draw_frame.h:51
VTBL_ENTRY void SetElem(ELEM_T aIndex, _ELEM *aElem)
Definition: project.cpp:217
static const wxChar FindReplaceFlagsEntry[]
struct EDA_HOTKEY_CONFIG g_Eeschema_Hotkeys_Descr[]
Definition: ee_hotkeys.cpp:388
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
Load 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
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
void InstallPreferences(PAGED_DIALOG *aParent) override
Allows Eeschema to install its preferences panels into the preferences dialog.
ERC_SETTINGS m_ercSettings
static const wxChar DefaultBusWidthEntry[]
Definition of file extensions used in Kicad.
const wxPoint GetRepeatStep() const
#define GROUP_SCH
Definition: config_params.h:44
#define GROUP_SCH_EDIT
Definition: config_params.h:45
static int m_textPinNumDefaultSize
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:49
const std::string & GetString()
Definition: richio.h:475
bool m_printMonochrome
Print monochrome instead of grey scale.
#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.
PARAM_CFG_ARRAY m_configSettings
bool m_autoplaceFields
automatically place component fields
void LoadSettings(wxConfigBase *aCfg) override
Load common frame parameters from a configuration file.
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:48
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:128
static const wxChar ShowHiddenPinsEntry[]
struct EDA_HOTKEY_CONFIG g_Libedit_Hotkeys_Descr[]
Definition: ee_hotkeys.cpp:407
void wxConfigSaveSetups(wxConfigBase *aCfg, const PARAM_CFG_ARRAY &aList)
Function wxConfigSaveSetups writes aList of PARAM_CFG_ARRAY elements to save configuration values to ...
#define REPEAT_OFFSET_MAX
the max value of repeat offset value
Definition: general.h:50
see class PGM_BASE
#define DEFAULTLIBWIDTH
Definition: general.h:73
static int GetPinNameDefaultSize()
struct EDA_HOTKEY_CONFIG g_Schematic_Hotkeys_Descr[]
Definition: ee_hotkeys.cpp:398
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:49
static const wxString MakeFullFileName(const wxString &aShortFileName, const wxString &aProjectPath)
Static function.
size_t i
Definition: json11.cpp:597
static const wxChar repeatLibStepXEntry[]
int GetRepeatDeltaLabel() const
bool check_bus_entry_conflicts
If true, check that wires connecting to buses actually exist in the bus.
Definition: erc_settings.h:73
static int * SubpartIdSeparatorPtr()
return a reference to m_subpartIdSeparator, only for read/save setting functions
static const wxChar defaultPinNameSizeEntry[]
static const wxChar DefaultJctSizeEntry[]
static const wxChar showPinElectricalType[]
bool m_showPageLimits
true to display the page limits
Definition: draw_frame.h:116
#define DEFAULTPINNAMESIZE
The default library pane width.
Definition: general.h:70
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:70
void SetRepeatStep(const wxPoint &aStep)
Sets the repeat step value for repeat command.
wxString m_netListFormat
The name of the format to use when generating a net list.
bool check_similar_labels
If true, check each sheet for labels that differ only by letter case.
Definition: erc_settings.h:64
COLOR4D GetItemSelectedColor()
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:67
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:125
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:244
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[]
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
bool GetShowElectricalType()
Allow some frames to show/hide pin electrical type names.
Class COLOR4D is the color representation with 4 components: red, green, blue, alpha.
Definition: color4d.h:39
static const wxChar SimulatorCommandEntry[]
Definition: colors.h:62