KiCad PCB EDA Suite
DIALOG_PLOT_SCHEMATIC Class Reference

#include <dialog_plot_schematic.h>

Inheritance diagram for DIALOG_PLOT_SCHEMATIC:
DIALOG_PLOT_SCHEMATIC_BASE DIALOG_SHIM KIWAY_HOLDER

Public Types

enum  HOLDER_TYPE { DIALOG, FRAME, PANEL }
 

Public Member Functions

 DIALOG_PLOT_SCHEMATIC (SCH_EDIT_FRAME *parent)
 
bool PrjConfigChanged ()
 Return true if the project configuration was modified. More...
 
void SetInitialFocus (wxWindow *aWindow)
 Sets the window (usually a wxTextCtrl) that should be focused when the dialog is shown. More...
 
int ShowQuasiModal ()
 
void EndQuasiModal (int retCode)
 
bool IsQuasiModal () const
 
bool Show (bool show) override
 
bool Enable (bool enable) override
 
void OnPaint (wxPaintEvent &event)
 
void SetPosition (const wxPoint &aNewPosition)
 Force the position of the dialog to a new position. More...
 
EDA_UNITS GetUserUnits () const
 
HOLDER_TYPE GetType () const
 
KIWAYKiway () const
 Return a reference to the KIWAY that this object has an opportunity to participate in. More...
 
PROJECTPrj () const
 Return a reference to the PROJECT associated with this KIWAY. More...
 
void SetKiway (wxWindow *aDest, KIWAY *aKiway)
 It is only used for debugging, since "this" is not a wxWindow*. More...
 

Static Public Member Functions

static bool IsCtrl (int aChar, const wxKeyEvent &e)
 
static bool IsShiftCtrl (int aChar, const wxKeyEvent &e)
 

Protected Member Functions

virtual void OnCloseWindow (wxCloseEvent &event)
 
virtual void OnPlotFormatSelection (wxCommandEvent &event)
 
void finishDialogSettings ()
 In all dialogs, we must call the same functions to fix minimal dlg size, the default position and perhaps some others to fix a few issues depending on Windows Managers this helper function does these calls. More...
 
void setSizeInDU (int x, int y)
 Set the dialog to the given dimensions in "dialog units". More...
 
int horizPixelsFromDU (int x) const
 Convert an integer number of dialog units to pixels, horizontally. More...
 
int vertPixelsFromDU (int y) const
 Convert an integer number of dialog units to pixels, vertically. More...
 
void resetSize ()
 Clear the existing dialog size and position. More...
 
virtual void OnCharHook (wxKeyEvent &aEvt)
 

Protected Attributes

wxStaticText * m_staticTextOutputDirectory
 
wxTextCtrl * m_outputDirectoryName
 
wxBitmapButton * m_browseButton
 
wxBoxSizer * m_optionsSizer
 
wxRadioBox * m_plotFormatOpt
 
wxStaticText * m_staticText4
 
wxChoice * m_paperSizeOption
 
wxCheckBox * m_plotDrawingSheet
 
wxChoice * m_ModeColorOption
 
wxCheckBox * m_plotBackgroundColor
 
wxStaticText * m_staticText9
 
wxChoice * m_colorTheme
 
wxStaticText * m_lineWidthLabel
 
wxTextCtrl * m_lineWidthCtrl
 
wxStaticText * m_lineWidthUnits
 
wxStaticBoxSizer * m_HPGLOptionsSizer
 
wxStaticText * m_plotOriginTitle
 
wxChoice * m_plotOriginOpt
 
wxStaticText * m_penWidthLabel
 
wxTextCtrl * m_penWidthCtrl
 
wxStaticText * m_penWidthUnits
 
WX_HTML_REPORT_PANELm_MessagesBox
 
wxStdDialogButtonSizer * m_sdbSizer1
 
wxButton * m_sdbSizer1OK
 
wxButton * m_sdbSizer1Apply
 
wxButton * m_sdbSizer1Cancel
 
EDA_UNITS m_units
 
std::string m_hash_key
 
bool m_useCalculatedSize
 
bool m_firstPaintEvent
 
wxWindow * m_initialFocusTarget
 
WX_EVENT_LOOPm_qmodal_loop
 
bool m_qmodal_showing
 
WDO_ENABLE_DISABLEm_qmodal_parent_disabler
 
EDA_BASE_FRAMEm_parentFrame
 
std::vector< wxWindow * > m_tabOrder
 
wxSize m_initialSize
 

Private Member Functions

void OnPageSizeSelected (wxCommandEvent &event) override
 
void OnPlotCurrent (wxCommandEvent &event) override
 
void OnPlotAll (wxCommandEvent &event) override
 
void OnUpdateUI (wxUpdateUIEvent &event) override
 
void initDlg ()
 
void getPlotOptions (RENDER_SETTINGS *aSettings)
 
bool getModeColor ()
 
void setModeColor (bool aColor)
 
COLOR_SETTINGSgetColorSettings ()
 
void OnOutputDirectoryBrowseClicked (wxCommandEvent &event) override
 Set the m_outputDirectoryName variable to the selected directory from directory dialog. More...
 
PLOT_FORMAT GetPlotFileFormat ()
 
bool getPlotDrawingSheet ()
 
void setPlotDrawingSheet (bool aPlot)
 
void plotSchematic (bool aPlotAll)
 
void createPDFFile (bool aPlotAll, bool aPlotDrawingSheet, RENDER_SETTINGS *aRenderSettings)
 
void plotOneSheetPDF (PLOTTER *aPlotter, SCH_SCREEN *aScreen, bool aPlotDrawingSheet)
 
void setupPlotPagePDF (PLOTTER *aPlotter, SCH_SCREEN *aScreen)
 
void restoreEnvironment (PDF_PLOTTER *aPlotter, SCH_SHEET_PATH &aOldsheetpath)
 Everything done, close the plot and restore the environment. More...
 
void createDXFFiles (bool aPlotAll, bool aPlotDrawingSheet, RENDER_SETTINGS *aRenderSettings)
 
bool plotOneSheetDXF (const wxString &aFileName, SCH_SCREEN *aScreen, RENDER_SETTINGS *aRenderSettings, const wxPoint &aPlotOffset, double aScale, bool aPlotFrameRef)
 
HPGL_PLOT_ORIGIN_AND_UNITS getPlotOriginAndUnits ()
 
void setPlotOriginAndUnits (HPGL_PLOT_ORIGIN_AND_UNITS aOriginAndUnits)
 
void createHPGLFiles (bool aPlotAll, bool aPlotFrameRef, RENDER_SETTINGS *aRenderSettings)
 
void setHpglPenWidth ()
 
bool plotOneSheetHpgl (const wxString &aFileName, SCH_SCREEN *aScreen, const PAGE_INFO &aPageInfo, RENDER_SETTINGS *aRenderSettings, const wxPoint &aPlot0ffset, double aScale, bool aPlotFrameRef, HPGL_PLOT_ORIGIN_AND_UNITS aOriginAndUnits)
 
void createPSFiles (bool aPlotAll, bool aPlotFrameRef, RENDER_SETTINGS *aSettings)
 
bool plotOneSheetPS (const wxString &aFileName, SCH_SCREEN *aScreen, RENDER_SETTINGS *aRenderSettings, const PAGE_INFO &aPageInfo, const wxPoint &aPlot0ffset, double aScale, bool aPlotFrameRef)
 
void createSVGFiles (bool aPrintAll, bool aPrintFrameRef, RENDER_SETTINGS *aRenderSettings)
 
bool plotOneSheetSVG (const wxString &aFileName, SCH_SCREEN *aScreen, RENDER_SETTINGS *aRenderSettings, bool aPlotBlackAndWhite, bool aPlotFrameRef)
 
wxFileName createPlotFileName (const wxString &aPlotFileName, const wxString &aExtension, REPORTER *aReporter=nullptr)
 Create a file name with an absolute path name. More...
 
wxString getOutputPath ()
 Determine the best absolute path to plot files given the contents of the path edit control. More...
 

Private Attributes

SCH_EDIT_FRAMEm_parent
 
bool m_configChanged
 
PLOT_FORMAT m_plotFormat
 
double m_HPGLPenSize
 
UNIT_BINDER m_defaultLineWidth
 
UNIT_BINDER m_penWidth
 

Static Private Attributes

static int m_pageSizeSelect = PAGE_SIZE_AUTO
 
static int m_HPGLPaperSizeSelect = PAGE_SIZE_AUTO
 

Detailed Description

Definition at line 60 of file dialog_plot_schematic.h.

Member Enumeration Documentation

◆ HOLDER_TYPE

enum KIWAY_HOLDER::HOLDER_TYPE
inherited
Enumerator
DIALOG 
FRAME 
PANEL 

Definition at line 39 of file kiway_holder.h.

Constructor & Destructor Documentation

◆ DIALOG_PLOT_SCHEMATIC()

DIALOG_PLOT_SCHEMATIC::DIALOG_PLOT_SCHEMATIC ( SCH_EDIT_FRAME parent)

Definition at line 95 of file dialog_plot_schematic.cpp.

96  : DIALOG_PLOT_SCHEMATIC_BASE( parent ),
97  m_parent( parent ),
99  m_HPGLPenSize( 1.0 ),
102 {
103  m_configChanged = false;
104 
106 
107  m_MessagesBox->SetFileName( Prj().GetProjectPath() + wxT( "report.txt" ) );
108 
109  // We use a sdbSizer to get platform-dependent ordering of the action buttons, but
110  // that requires us to correct the button labels here.
111  m_sdbSizer1OK->SetLabel( _( "Plot All Pages" ) );
112  m_sdbSizer1Apply->SetLabel( _( "Plot Current Page" ) );
113  m_sdbSizer1Cancel->SetLabel( _( "Close" ) );
114  m_sdbSizer1->Layout();
115 
116  m_sdbSizer1OK->SetDefault();
117  initDlg();
118 
119  // Now all widgets have the size fixed, call FinishDialogSettings
121 }
wxStdDialogButtonSizer * m_sdbSizer1
DIALOG_PLOT_SCHEMATIC_BASE(wxWindow *parent, wxWindowID id=wxID_ANY, const wxString &title=_("Plot Schematic Options"), const wxPoint &pos=wxDefaultPosition, const wxSize &size=wxSize(-1,-1), long style=wxDEFAULT_DIALOG_STYLE|wxRESIZE_BORDER)
PROJECT & Prj() const
Return a reference to the PROJECT associated with this KIWAY.
#define _(s)
wxBitmap KiBitmap(BITMAPS aBitmap, int aHeightTag)
Construct a wxBitmap from an image identifier Returns the image from the active theme if the image ha...
Definition: bitmap.cpp:105
void finishDialogSettings()
In all dialogs, we must call the same functions to fix minimal dlg size, the default position and per...
WX_HTML_REPORT_PANEL * m_MessagesBox
void SetFileName(const wxString &aReportFileName)

References _, DIALOG_SHIM::finishDialogSettings(), initDlg(), KiBitmap(), DIALOG_PLOT_SCHEMATIC_BASE::m_browseButton, m_configChanged, DIALOG_PLOT_SCHEMATIC_BASE::m_MessagesBox, DIALOG_PLOT_SCHEMATIC_BASE::m_sdbSizer1, DIALOG_PLOT_SCHEMATIC_BASE::m_sdbSizer1Apply, DIALOG_PLOT_SCHEMATIC_BASE::m_sdbSizer1Cancel, DIALOG_PLOT_SCHEMATIC_BASE::m_sdbSizer1OK, KIWAY_HOLDER::Prj(), WX_HTML_REPORT_PANEL::SetFileName(), small_folder, and UNDEFINED.

Member Function Documentation

◆ createDXFFiles()

void DIALOG_PLOT_SCHEMATIC::createDXFFiles ( bool  aPlotAll,
bool  aPlotDrawingSheet,
RENDER_SETTINGS aRenderSettings 
)
private

Definition at line 459 of file dialog_plot_schematic.cpp.

461 {
462  SCH_EDIT_FRAME* schframe = m_parent;
463  SCH_SHEET_PATH oldsheetpath = schframe->GetCurrentSheet();
464 
465  /* When printing all pages, the printed page is not the current page. In complex hierarchies,
466  * we must update symbol references and other parameters in the given printed SCH_SCREEN,
467  * according to the sheet path because in complex hierarchies a SCH_SCREEN (a drawing ) is
468  * shared between many sheets and symbol references depend on the actual sheet path used.
469  */
470  SCH_SHEET_LIST sheetList;
471 
472  if( aPlotAll )
473  {
474  sheetList.BuildSheetList( &schframe->Schematic().Root(), true );
475  sheetList.SortByPageNumbers();
476  }
477  else
478  {
479  sheetList.push_back( schframe->GetCurrentSheet() );
480  }
481 
482  REPORTER& reporter = m_MessagesBox->Reporter();
483 
484  for( unsigned i = 0; i < sheetList.size(); i++ )
485  {
486  schframe->SetCurrentSheet( sheetList[i] );
488  schframe->SetSheetNumberAndCount();
489 
490  SCH_SCREEN* screen = schframe->GetCurrentSheet().LastScreen();
491  wxPoint plot_offset;
492  wxString msg;
493 
494  try
495  {
496  wxString fname = schframe->GetUniqueFilenameForCurrentSheet();
497 
498  // The sub sheet can be in a sub_hierarchy, but we plot the file in the
499  // main project folder (or the folder specified by the caller),
500  // so replace separators to create a unique filename:
501  fname.Replace( "/", "_" );
502  fname.Replace( "\\", "_" );
503  wxString ext = DXF_PLOTTER::GetDefaultFileExtension();
504  wxFileName plotFileName = createPlotFileName( fname, ext, &reporter );
505 
506  if( !plotFileName.IsOk() )
507  return;
508 
509  if( plotOneSheetDXF( plotFileName.GetFullPath(), screen, aRenderSettings,
510  plot_offset, 1.0, aPlotDrawingSheet ) )
511  {
512  msg.Printf( _( "Plotted to '%s'." ), plotFileName.GetFullPath() );
513  reporter.Report( msg, RPT_SEVERITY_ACTION );
514  }
515  else // Error
516  {
517  msg.Printf( _( "Failed to create file '%s'." ), plotFileName.GetFullPath() );
518  reporter.Report( msg, RPT_SEVERITY_ERROR );
519  }
520  }
521  catch( IO_ERROR& e )
522  {
523  msg.Printf( wxT( "DXF Plotter exception: %s"), e.What() );
524  reporter.Report( msg, RPT_SEVERITY_ERROR );
525  schframe->SetCurrentSheet( oldsheetpath );
527  schframe->SetSheetNumberAndCount();
528  return;
529  }
530  }
531 
532  reporter.ReportTail( _( "Done." ), RPT_SEVERITY_INFO );
533 
534  schframe->SetCurrentSheet( oldsheetpath );
536  schframe->SetSheetNumberAndCount();
537 }
void SetCurrentSheet(const SCH_SHEET_PATH &aSheet)
A container for handling SCH_SHEET_PATH objects in a flattened hierarchy.
virtual REPORTER & ReportTail(const wxString &aText, SEVERITY aSeverity=RPT_SEVERITY_UNDEFINED)
Places the report at the end of the list, for objects that support report ordering.
Definition: reporter.h:99
wxFileName createPlotFileName(const wxString &aPlotFileName, const wxString &aExtension, REPORTER *aReporter=nullptr)
Create a file name with an absolute path name.
Schematic editor (Eeschema) main window.
A pure virtual class used to derive REPORTER objects from.
Definition: reporter.h:70
bool plotOneSheetDXF(const wxString &aFileName, SCH_SCREEN *aScreen, RENDER_SETTINGS *aRenderSettings, const wxPoint &aPlotOffset, double aScale, bool aPlotFrameRef)
void UpdateAllScreenReferences()
Update all the symbol references for this sheet path.
virtual REPORTER & Report(const wxString &aText, SEVERITY aSeverity=RPT_SEVERITY_UNDEFINED)=0
Report a string with a given severity.
static wxString GetDefaultFileExtension()
Definition: plotter_dxf.h:47
virtual const wxString What() const
A composite of Problem() and Where()
Definition: exceptions.cpp:30
void BuildSheetList(SCH_SHEET *aSheet, bool aCheckIntegrity)
Build the list of sheets and their sheet path from aSheet.
SCHEMATIC & Schematic() const
#define _(s)
Handle access to a stack of flattened SCH_SHEET objects by way of a path for creating a flattened sch...
SCH_SHEET & Root() const
Definition: schematic.h:92
SCH_SCREEN * LastScreen()
void SetSheetNumberAndCount()
Set the m_ScreenNumber and m_NumberOfScreens members for screens.
void SortByPageNumbers(bool aUpdateVirtualPageNums=true)
Sort the list of sheets by page number.
wxString GetUniqueFilenameForCurrentSheet()
SCH_SHEET_PATH & GetCurrentSheet() const
WX_HTML_REPORT_PANEL * m_MessagesBox
Hold an error message and may be used when throwing exceptions containing meaningful error messages.
Definition: ki_exception.h:75

References _, SCH_SHEET_LIST::BuildSheetList(), createPlotFileName(), SCH_EDIT_FRAME::GetCurrentSheet(), DXF_PLOTTER::GetDefaultFileExtension(), SCH_EDIT_FRAME::GetUniqueFilenameForCurrentSheet(), SCH_SHEET_PATH::LastScreen(), DIALOG_PLOT_SCHEMATIC_BASE::m_MessagesBox, m_parent, plotOneSheetDXF(), REPORTER::Report(), WX_HTML_REPORT_PANEL::Reporter(), REPORTER::ReportTail(), SCHEMATIC::Root(), RPT_SEVERITY_ACTION, RPT_SEVERITY_ERROR, RPT_SEVERITY_INFO, SCH_EDIT_FRAME::Schematic(), SCH_EDIT_FRAME::SetCurrentSheet(), SCH_EDIT_FRAME::SetSheetNumberAndCount(), SCH_SHEET_LIST::SortByPageNumbers(), SCH_SHEET_PATH::UpdateAllScreenReferences(), and IO_ERROR::What().

Referenced by plotSchematic().

◆ createHPGLFiles()

void DIALOG_PLOT_SCHEMATIC::createHPGLFiles ( bool  aPlotAll,
bool  aPlotFrameRef,
RENDER_SETTINGS aRenderSettings 
)
private

Definition at line 605 of file dialog_plot_schematic.cpp.

607 {
608  SCH_SCREEN* screen = m_parent->GetScreen();
609  SCH_SHEET_PATH oldsheetpath = m_parent->GetCurrentSheet();
610 
611  /* When printing all pages, the printed page is not the current page. In complex hierarchies,
612  * we must update symbol references and other parameters in the given printed SCH_SCREEN,
613  * according to the sheet path because in complex hierarchies a SCH_SCREEN (a drawing ) is
614  * shared between many sheets and symbol references depend on the actual sheet path used.
615  */
616  SCH_SHEET_LIST sheetList;
617 
618  if( aPlotAll )
619  {
620  sheetList.BuildSheetList( &m_parent->Schematic().Root(), true );
621  sheetList.SortByPageNumbers();
622  }
623  else
624  {
625  sheetList.push_back( m_parent->GetCurrentSheet() );
626  }
627 
628  REPORTER& reporter = m_MessagesBox->Reporter();
629 
630  setHpglPenWidth();
631 
632  for( unsigned i = 0; i < sheetList.size(); i++ )
633  {
634  m_parent->SetCurrentSheet( sheetList[i] );
637 
638  screen = m_parent->GetCurrentSheet().LastScreen();
639 
640  if( !screen ) // LastScreen() may return NULL
641  screen = m_parent->GetScreen();
642 
643  const PAGE_INFO& curPage = screen->GetPageSettings();
644 
645  PAGE_INFO plotPage = curPage;
646 
647  // if plotting on a page size other than curPage
648  if( m_paperSizeOption->GetSelection() != PAGE_DEFAULT )
649  plotPage.SetType( plot_sheet_list( m_paperSizeOption->GetSelection() ) );
650 
651  // Calculation of conversion scales.
652  double plot_scale = (double) plotPage.GetWidthMils() / curPage.GetWidthMils();
653 
654  // Calculate offsets
655  wxPoint plotOffset;
656  wxString msg;
657 
659  {
660  plotOffset.x = plotPage.GetWidthIU() / 2;
661  plotOffset.y = -plotPage.GetHeightIU() / 2;
662  }
663 
664  try
665  {
666  wxString fname = m_parent->GetUniqueFilenameForCurrentSheet();
667  // The sub sheet can be in a sub_hierarchy, but we plot the file in the
668  // main project folder (or the folder specified by the caller),
669  // so replace separators to create a unique filename:
670  fname.Replace( "/", "_" );
671  fname.Replace( "\\", "_" );
672  wxString ext = HPGL_PLOTTER::GetDefaultFileExtension();
673  wxFileName plotFileName = createPlotFileName( fname, ext, &reporter );
674 
675  if( !plotFileName.IsOk() )
676  return;
677 
678  LOCALE_IO toggle;
679 
680  if( plotOneSheetHpgl( plotFileName.GetFullPath(), screen, plotPage, aRenderSettings,
681  plotOffset, plot_scale, aPlotFrameRef, getPlotOriginAndUnits() ) )
682  {
683  msg.Printf( _( "Plotted to '%s'." ), plotFileName.GetFullPath() );
684  reporter.Report( msg, RPT_SEVERITY_ACTION );
685  }
686  else
687  {
688  msg.Printf( _( "Failed to create file '%s'." ), plotFileName.GetFullPath() );
689  reporter.Report( msg, RPT_SEVERITY_ERROR );
690  }
691  }
692  catch( IO_ERROR& e )
693  {
694  msg.Printf( wxT( "HPGL Plotter exception: %s"), e.What() );
695  reporter.Report( msg, RPT_SEVERITY_ERROR );
696  }
697  }
698 
699  reporter.ReportTail( _( "Done." ), RPT_SEVERITY_INFO );
700 
701  m_parent->SetCurrentSheet( oldsheetpath );
704 }
void SetCurrentSheet(const SCH_SHEET_PATH &aSheet)
A container for handling SCH_SHEET_PATH objects in a flattened hierarchy.
Instantiate the current locale within a scope in which you are expecting exceptions to be thrown.
Definition: locale_io.h:40
virtual REPORTER & ReportTail(const wxString &aText, SEVERITY aSeverity=RPT_SEVERITY_UNDEFINED)
Places the report at the end of the list, for objects that support report ordering.
Definition: reporter.h:99
static const wxChar * plot_sheet_list(int aSize)
bool SetType(const wxString &aStandardPageDescriptionName, bool aIsPortrait=false)
Set the name of the page type and also the sizes and margins commonly associated with that type name.
Definition: page_info.cpp:119
wxFileName createPlotFileName(const wxString &aPlotFileName, const wxString &aExtension, REPORTER *aReporter=nullptr)
Create a file name with an absolute path name.
A pure virtual class used to derive REPORTER objects from.
Definition: reporter.h:70
void UpdateAllScreenReferences()
Update all the symbol references for this sheet path.
const PAGE_INFO & GetPageSettings() const
Definition: sch_screen.h:132
virtual REPORTER & Report(const wxString &aText, SEVERITY aSeverity=RPT_SEVERITY_UNDEFINED)=0
Report a string with a given severity.
SCH_SCREEN * GetScreen() const override
Return a pointer to a BASE_SCREEN or one of its derivatives.
virtual const wxString What() const
A composite of Problem() and Where()
Definition: exceptions.cpp:30
bool plotOneSheetHpgl(const wxString &aFileName, SCH_SCREEN *aScreen, const PAGE_INFO &aPageInfo, RENDER_SETTINGS *aRenderSettings, const wxPoint &aPlot0ffset, double aScale, bool aPlotFrameRef, HPGL_PLOT_ORIGIN_AND_UNITS aOriginAndUnits)
Describe the page size and margins of a paper page on which to eventually print or plot.
Definition: page_info.h:53
void BuildSheetList(SCH_SHEET *aSheet, bool aCheckIntegrity)
Build the list of sheets and their sheet path from aSheet.
SCHEMATIC & Schematic() const
#define _(s)
Handle access to a stack of flattened SCH_SHEET objects by way of a path for creating a flattened sch...
SCH_SHEET & Root() const
Definition: schematic.h:92
SCH_SCREEN * LastScreen()
void SetSheetNumberAndCount()
Set the m_ScreenNumber and m_NumberOfScreens members for screens.
HPGL_PLOT_ORIGIN_AND_UNITS getPlotOriginAndUnits()
void SortByPageNumbers(bool aUpdateVirtualPageNums=true)
Sort the list of sheets by page number.
static wxString GetDefaultFileExtension()
Definition: plotter_hpgl.h:43
wxString GetUniqueFilenameForCurrentSheet()
SCH_SHEET_PATH & GetCurrentSheet() const
WX_HTML_REPORT_PANEL * m_MessagesBox
Hold an error message and may be used when throwing exceptions containing meaningful error messages.
Definition: ki_exception.h:75
int GetWidthMils() const
Definition: page_info.h:130

References _, SCH_SHEET_LIST::BuildSheetList(), createPlotFileName(), SCH_EDIT_FRAME::GetCurrentSheet(), HPGL_PLOTTER::GetDefaultFileExtension(), SCH_SCREEN::GetPageSettings(), getPlotOriginAndUnits(), SCH_EDIT_FRAME::GetScreen(), SCH_EDIT_FRAME::GetUniqueFilenameForCurrentSheet(), PAGE_INFO::GetWidthMils(), SCH_SHEET_PATH::LastScreen(), DIALOG_PLOT_SCHEMATIC_BASE::m_MessagesBox, DIALOG_PLOT_SCHEMATIC_BASE::m_paperSizeOption, m_parent, PAGE_DEFAULT, plot_sheet_list(), plotOneSheetHpgl(), PLOTTER_CENTER, REPORTER::Report(), WX_HTML_REPORT_PANEL::Reporter(), REPORTER::ReportTail(), SCHEMATIC::Root(), RPT_SEVERITY_ACTION, RPT_SEVERITY_ERROR, RPT_SEVERITY_INFO, SCH_EDIT_FRAME::Schematic(), SCH_EDIT_FRAME::SetCurrentSheet(), setHpglPenWidth(), SCH_EDIT_FRAME::SetSheetNumberAndCount(), PAGE_INFO::SetType(), SCH_SHEET_LIST::SortByPageNumbers(), SCH_SHEET_PATH::UpdateAllScreenReferences(), and IO_ERROR::What().

Referenced by plotSchematic().

◆ createPDFFile()

void DIALOG_PLOT_SCHEMATIC::createPDFFile ( bool  aPlotAll,
bool  aPlotDrawingSheet,
RENDER_SETTINGS aRenderSettings 
)
private

Definition at line 778 of file dialog_plot_schematic.cpp.

780 {
781  SCH_SHEET_PATH oldsheetpath = m_parent->GetCurrentSheet(); // sheetpath is saved here
782 
783  /* When printing all pages, the printed page is not the current page. In complex hierarchies,
784  * we must update symbol references and other parameters in the given printed SCH_SCREEN,
785  * according to the sheet path because in complex hierarchies a SCH_SCREEN (a drawing ) is
786  * shared between many sheets and symbol references depend on the actual sheet path used.
787  */
788  SCH_SHEET_LIST sheetList;
789 
790  if( aPlotAll )
791  {
792  sheetList.BuildSheetList( &m_parent->Schematic().Root(), true );
793  sheetList.SortByPageNumbers();
794  }
795  else
796  {
797  sheetList.push_back( m_parent->GetCurrentSheet() );
798  }
799 
800  // Allocate the plotter and set the job level parameter
801  PDF_PLOTTER* plotter = new PDF_PLOTTER();
802  plotter->SetRenderSettings( aRenderSettings );
803  plotter->SetColorMode( getModeColor() );
804  plotter->SetCreator( wxT( "Eeschema-PDF" ) );
805  plotter->SetTitle( m_parent->GetTitleBlock().GetTitle() );
806 
807  wxString msg;
808  wxFileName plotFileName;
809  REPORTER& reporter = m_MessagesBox->Reporter();
810  LOCALE_IO toggle; // Switch the locale to standard C
811 
812  for( unsigned i = 0; i < sheetList.size(); i++ )
813  {
814  m_parent->SetCurrentSheet( sheetList[i] );
818 
819  if( i == 0 )
820  {
821  try
822  {
823  wxString fname = m_parent->GetUniqueFilenameForCurrentSheet();
824 
825  // The sub sheet can be in a sub_hierarchy, but we plot the file in the main
826  // project folder (or the folder specified by the caller), so replace separators
827  // to create a unique filename:
828  fname.Replace( "/", "_" );
829  fname.Replace( "\\", "_" );
830  wxString ext = PDF_PLOTTER::GetDefaultFileExtension();
831  plotFileName = createPlotFileName( fname, ext, &reporter );
832 
833  if( !plotFileName.IsOk() )
834  return;
835 
836  if( !plotter->OpenFile( plotFileName.GetFullPath() ) )
837  {
838  msg.Printf( _( "Failed to create file '%s'." ), plotFileName.GetFullPath() );
839  reporter.Report( msg, RPT_SEVERITY_ERROR );
840  delete plotter;
841  return;
842  }
843 
844  // Open the plotter and do the first page
845  setupPlotPagePDF( plotter, screen );
846  plotter->StartPlot();
847  }
848  catch( const IO_ERROR& e )
849  {
850  // Cannot plot PDF file
851  msg.Printf( wxT( "PDF Plotter exception: %s" ), e.What() );
852  reporter.Report( msg, RPT_SEVERITY_ERROR );
853 
854  restoreEnvironment( plotter, oldsheetpath );
855  return;
856  }
857 
858  }
859  else
860  {
861  /* For the following pages you need to close the (finished) page,
862  * reconfigure, and then start a new one */
863  plotter->ClosePage();
864  setupPlotPagePDF( plotter, screen );
865  plotter->StartPage();
866  }
867 
868  plotOneSheetPDF( plotter, screen, aPlotDrawingSheet );
869  }
870 
871  // Everything done, close the plot and restore the environment
872  msg.Printf( _( "Plotted to '%s'.\n" ), plotFileName.GetFullPath() );
873  reporter.Report( msg, RPT_SEVERITY_ACTION );
874  reporter.ReportTail( _( "Done." ), RPT_SEVERITY_INFO );
875 
876  restoreEnvironment( plotter, oldsheetpath );
877 }
static wxString GetDefaultFileExtension()
void SetCurrentSheet(const SCH_SHEET_PATH &aSheet)
A container for handling SCH_SHEET_PATH objects in a flattened hierarchy.
virtual void SetCreator(const wxString &aCreator)
Definition: plotter.h:174
void plotOneSheetPDF(PLOTTER *aPlotter, SCH_SCREEN *aScreen, bool aPlotDrawingSheet)
Instantiate the current locale within a scope in which you are expecting exceptions to be thrown.
Definition: locale_io.h:40
virtual void StartPage()
Start a new page in the PDF document.
virtual void SetTitle(const wxString &aTitle)
Definition: plotter.h:176
virtual void SetColorMode(bool aColorMode)
Plot in B/W or color.
Definition: plotter.h:152
virtual REPORTER & ReportTail(const wxString &aText, SEVERITY aSeverity=RPT_SEVERITY_UNDEFINED)
Places the report at the end of the list, for objects that support report ordering.
Definition: reporter.h:99
void SetRenderSettings(RENDER_SETTINGS *aSettings)
Definition: plotter.h:155
wxFileName createPlotFileName(const wxString &aPlotFileName, const wxString &aExtension, REPORTER *aReporter=nullptr)
Create a file name with an absolute path name.
A pure virtual class used to derive REPORTER objects from.
Definition: reporter.h:70
void UpdateAllScreenReferences()
Update all the symbol references for this sheet path.
virtual REPORTER & Report(const wxString &aText, SEVERITY aSeverity=RPT_SEVERITY_UNDEFINED)=0
Report a string with a given severity.
void restoreEnvironment(PDF_PLOTTER *aPlotter, SCH_SHEET_PATH &aOldsheetpath)
Everything done, close the plot and restore the environment.
void setupPlotPagePDF(PLOTTER *aPlotter, SCH_SCREEN *aScreen)
virtual void ClosePage()
Close the current page in the PDF document (and emit its compressed stream).
virtual const wxString What() const
A composite of Problem() and Where()
Definition: exceptions.cpp:30
void BuildSheetList(SCH_SHEET *aSheet, bool aCheckIntegrity)
Build the list of sheets and their sheet path from aSheet.
SCHEMATIC & Schematic() const
#define _(s)
Handle access to a stack of flattened SCH_SHEET objects by way of a path for creating a flattened sch...
SCH_SHEET & Root() const
Definition: schematic.h:92
SCH_SCREEN * LastScreen()
void SetSheetNumberAndCount()
Set the m_ScreenNumber and m_NumberOfScreens members for screens.
const TITLE_BLOCK & GetTitleBlock() const override
void SortByPageNumbers(bool aUpdateVirtualPageNums=true)
Sort the list of sheets by page number.
wxString GetUniqueFilenameForCurrentSheet()
virtual bool OpenFile(const wxString &aFullFilename) override
Open or create the plot file aFullFilename.
SCH_SHEET_PATH & GetCurrentSheet() const
const wxString & GetTitle() const
Definition: title_block.h:63
WX_HTML_REPORT_PANEL * m_MessagesBox
virtual bool StartPlot() override
The PDF engine supports multiple pages; the first one is opened 'for free' the following are to be cl...
Hold an error message and may be used when throwing exceptions containing meaningful error messages.
Definition: ki_exception.h:75

References _, SCH_SHEET_LIST::BuildSheetList(), PDF_PLOTTER::ClosePage(), createPlotFileName(), SCH_EDIT_FRAME::GetCurrentSheet(), PDF_PLOTTER::GetDefaultFileExtension(), getModeColor(), TITLE_BLOCK::GetTitle(), SCH_BASE_FRAME::GetTitleBlock(), SCH_EDIT_FRAME::GetUniqueFilenameForCurrentSheet(), SCH_SHEET_PATH::LastScreen(), DIALOG_PLOT_SCHEMATIC_BASE::m_MessagesBox, m_parent, PDF_PLOTTER::OpenFile(), plotOneSheetPDF(), REPORTER::Report(), WX_HTML_REPORT_PANEL::Reporter(), REPORTER::ReportTail(), restoreEnvironment(), SCHEMATIC::Root(), RPT_SEVERITY_ACTION, RPT_SEVERITY_ERROR, RPT_SEVERITY_INFO, SCH_EDIT_FRAME::Schematic(), PLOTTER::SetColorMode(), PLOTTER::SetCreator(), SCH_EDIT_FRAME::SetCurrentSheet(), PLOTTER::SetRenderSettings(), SCH_EDIT_FRAME::SetSheetNumberAndCount(), PLOTTER::SetTitle(), setupPlotPagePDF(), SCH_SHEET_LIST::SortByPageNumbers(), PDF_PLOTTER::StartPage(), PDF_PLOTTER::StartPlot(), SCH_SHEET_PATH::UpdateAllScreenReferences(), and IO_ERROR::What().

Referenced by plotSchematic().

◆ createPlotFileName()

wxFileName DIALOG_PLOT_SCHEMATIC::createPlotFileName ( const wxString &  aPlotFileName,
const wxString &  aExtension,
REPORTER aReporter = nullptr 
)
private

Create a file name with an absolute path name.

Parameters
aPlotFileNamethe name for the file to plot without a path.
aExtensionthe extension for the file to plot.
aReportera point to a REPORTER object use to show messages (can be NULL).
Returns
the created file name.
Exceptions
IO_ERRORon file I/O errors.

Definition at line 419 of file dialog_plot_schematic.cpp.

422 {
423  wxFileName retv;
424  wxFileName tmp;
425 
426  tmp.SetPath( getOutputPath() );
427  retv.SetPath( tmp.GetPath() );
428 
429  if( !aPlotFileName.IsEmpty() )
430  retv.SetName( aPlotFileName );
431  else
432  retv.SetName( _( "Schematic" ) );
433 
434  retv.SetExt( aExtension );
435 
436  if( !EnsureFileDirectoryExists( &tmp, retv.GetFullName(), aReporter ) || !tmp.IsDirWritable() )
437  {
438  wxString msg = wxString::Format( _( "Failed to write plot files to folder '%s'." ),
439  tmp.GetPath() );
440  aReporter->Report( msg, RPT_SEVERITY_ERROR );
441  retv.Clear();
442 
444  settings.m_PlotDirectoryName.Clear();
445 
446  m_configChanged = true;
447  }
448  else
449  {
450  retv.SetPath( tmp.GetPath() );
451  }
452 
453  wxLogTrace( tracePathsAndFiles, "Writing plot file '%s'.", retv.GetFullPath() );
454 
455  return retv;
456 }
SCHEMATIC_SETTINGS & Settings() const
Definition: schematic.cpp:167
const wxChar *const tracePathsAndFiles
Flag to enable path and file name debug output.
virtual REPORTER & Report(const wxString &aText, SEVERITY aSeverity=RPT_SEVERITY_UNDEFINED)=0
Report a string with a given severity.
bool EnsureFileDirectoryExists(wxFileName *aTargetFullFileName, const wxString &aBaseFilename, REPORTER *aReporter)
Make aTargetFullFileName absolute and create the path of this file if it doesn't yet exist.
Definition: common.cpp:295
SCHEMATIC & Schematic() const
#define _(s)
void Format(OUTPUTFORMATTER *out, int aNestLevel, int aCtl, const CPTREE &aTree)
Output a PTREE into s-expression format via an OUTPUTFORMATTER derivative.
Definition: ptree.cpp:200
These settings were stored in SCH_BASE_FRAME previously.
wxString getOutputPath()
Determine the best absolute path to plot files given the contents of the path edit control.

References _, EnsureFileDirectoryExists(), Format(), getOutputPath(), m_configChanged, m_parent, SCHEMATIC_SETTINGS::m_PlotDirectoryName, REPORTER::Report(), RPT_SEVERITY_ERROR, SCH_EDIT_FRAME::Schematic(), SCHEMATIC::Settings(), and tracePathsAndFiles.

Referenced by createDXFFiles(), createHPGLFiles(), createPDFFile(), createPSFiles(), and createSVGFiles().

◆ createPSFiles()

void DIALOG_PLOT_SCHEMATIC::createPSFiles ( bool  aPlotAll,
bool  aPlotFrameRef,
RENDER_SETTINGS aSettings 
)
private

Definition at line 956 of file dialog_plot_schematic.cpp.

958 {
959  SCH_SHEET_PATH oldsheetpath = m_parent->GetCurrentSheet(); // sheetpath is saved here
960  PAGE_INFO plotPage; // page size selected to plot
961  wxString msg;
962  REPORTER& reporter = m_MessagesBox->Reporter();
963 
964  /* When printing all pages, the printed page is not the current page.
965  * In complex hierarchies, we must update symbol references and other parameters in the
966  * given printed SCH_SCREEN, accordant to the sheet path because in complex hierarchies
967  * a SCH_SCREEN (a drawing ) is shared between many sheets and symbol references
968  * depend on the actual sheet path used.
969  */
970  SCH_SHEET_LIST sheetList;
971 
972  if( aPlotAll )
973  {
974  sheetList.BuildSheetList( &m_parent->Schematic().Root(), true );
975  sheetList.SortByPageNumbers();
976  }
977  else
978  {
979  sheetList.push_back( m_parent->GetCurrentSheet() );
980  }
981 
982  for( unsigned i = 0; i < sheetList.size(); i++ )
983  {
984  m_parent->SetCurrentSheet( sheetList[i] );
987 
989  PAGE_INFO actualPage = screen->GetPageSettings();
990 
991  switch( m_pageSizeSelect )
992  {
993  case PAGE_SIZE_A:
994  plotPage.SetType( wxT( "A" ) );
995  plotPage.SetPortrait( actualPage.IsPortrait() );
996  break;
997 
998  case PAGE_SIZE_A4:
999  plotPage.SetType( wxT( "A4" ) );
1000  plotPage.SetPortrait( actualPage.IsPortrait() );
1001  break;
1002 
1003  case PAGE_SIZE_AUTO:
1004  default:
1005  plotPage = actualPage;
1006  break;
1007  }
1008 
1009  double scalex = (double) plotPage.GetWidthMils() / actualPage.GetWidthMils();
1010  double scaley = (double) plotPage.GetHeightMils() / actualPage.GetHeightMils();
1011  double scale = std::min( scalex, scaley );
1012  wxPoint plot_offset;
1013 
1014  try
1015  {
1016  wxString fname = m_parent->GetUniqueFilenameForCurrentSheet();
1017 
1018  // The sub sheet can be in a sub_hierarchy, but we plot the file in the
1019  // main project folder (or the folder specified by the caller),
1020  // so replace separators to create a unique filename:
1021  fname.Replace( "/", "_" );
1022  fname.Replace ("\\", "_" );
1023  wxString ext = PS_PLOTTER::GetDefaultFileExtension();
1024  wxFileName plotFileName = createPlotFileName( fname, ext, &reporter );
1025 
1026  if( !plotFileName.IsOk() )
1027  return;
1028 
1029  if( plotOneSheetPS( plotFileName.GetFullPath(), screen, aRenderSettings, plotPage,
1030  plot_offset, scale, aPlotFrameRef ) )
1031  {
1032  msg.Printf( _( "Plotted to '%s'." ), plotFileName.GetFullPath() );
1033  reporter.Report( msg, RPT_SEVERITY_ACTION );
1034  }
1035  else
1036  {
1037  // Error
1038  msg.Printf( _( "Failed to create file '%s'." ), plotFileName.GetFullPath() );
1039  reporter.Report( msg, RPT_SEVERITY_ERROR );
1040  }
1041 
1042  }
1043  catch( IO_ERROR& e )
1044  {
1045  msg.Printf( wxT( "PS Plotter exception: %s"), e.What() );
1046  reporter.Report( msg, RPT_SEVERITY_ERROR );
1047  }
1048  }
1049 
1050  reporter.ReportTail( _( "Done." ), RPT_SEVERITY_INFO );
1051 
1052  m_parent->SetCurrentSheet( oldsheetpath );
1055 }
void SetCurrentSheet(const SCH_SHEET_PATH &aSheet)
A container for handling SCH_SHEET_PATH objects in a flattened hierarchy.
static wxString GetDefaultFileExtension()
int GetHeightMils() const
Definition: page_info.h:133
virtual REPORTER & ReportTail(const wxString &aText, SEVERITY aSeverity=RPT_SEVERITY_UNDEFINED)
Places the report at the end of the list, for objects that support report ordering.
Definition: reporter.h:99
bool SetType(const wxString &aStandardPageDescriptionName, bool aIsPortrait=false)
Set the name of the page type and also the sizes and margins commonly associated with that type name.
Definition: page_info.cpp:119
bool plotOneSheetPS(const wxString &aFileName, SCH_SCREEN *aScreen, RENDER_SETTINGS *aRenderSettings, const PAGE_INFO &aPageInfo, const wxPoint &aPlot0ffset, double aScale, bool aPlotFrameRef)
wxFileName createPlotFileName(const wxString &aPlotFileName, const wxString &aExtension, REPORTER *aReporter=nullptr)
Create a file name with an absolute path name.
A pure virtual class used to derive REPORTER objects from.
Definition: reporter.h:70
void UpdateAllScreenReferences()
Update all the symbol references for this sheet path.
const PAGE_INFO & GetPageSettings() const
Definition: sch_screen.h:132
virtual REPORTER & Report(const wxString &aText, SEVERITY aSeverity=RPT_SEVERITY_UNDEFINED)=0
Report a string with a given severity.
virtual const wxString What() const
A composite of Problem() and Where()
Definition: exceptions.cpp:30
Describe the page size and margins of a paper page on which to eventually print or plot.
Definition: page_info.h:53
void BuildSheetList(SCH_SHEET *aSheet, bool aCheckIntegrity)
Build the list of sheets and their sheet path from aSheet.
SCHEMATIC & Schematic() const
#define _(s)
Handle access to a stack of flattened SCH_SHEET objects by way of a path for creating a flattened sch...
SCH_SHEET & Root() const
Definition: schematic.h:92
const int scale
SCH_SCREEN * LastScreen()
void SetSheetNumberAndCount()
Set the m_ScreenNumber and m_NumberOfScreens members for screens.
bool IsPortrait() const
Definition: page_info.h:117
void SortByPageNumbers(bool aUpdateVirtualPageNums=true)
Sort the list of sheets by page number.
wxString GetUniqueFilenameForCurrentSheet()
SCH_SHEET_PATH & GetCurrentSheet() const
WX_HTML_REPORT_PANEL * m_MessagesBox
void SetPortrait(bool aIsPortrait)
Rotate the paper page 90 degrees.
Definition: page_info.cpp:186
Hold an error message and may be used when throwing exceptions containing meaningful error messages.
Definition: ki_exception.h:75
int GetWidthMils() const
Definition: page_info.h:130

References _, SCH_SHEET_LIST::BuildSheetList(), createPlotFileName(), SCH_EDIT_FRAME::GetCurrentSheet(), PS_PLOTTER::GetDefaultFileExtension(), PAGE_INFO::GetHeightMils(), SCH_SCREEN::GetPageSettings(), SCH_EDIT_FRAME::GetUniqueFilenameForCurrentSheet(), PAGE_INFO::GetWidthMils(), PAGE_INFO::IsPortrait(), SCH_SHEET_PATH::LastScreen(), DIALOG_PLOT_SCHEMATIC_BASE::m_MessagesBox, m_pageSizeSelect, m_parent, PAGE_SIZE_A, PAGE_SIZE_A4, PAGE_SIZE_AUTO, plotOneSheetPS(), REPORTER::Report(), WX_HTML_REPORT_PANEL::Reporter(), REPORTER::ReportTail(), SCHEMATIC::Root(), RPT_SEVERITY_ACTION, RPT_SEVERITY_ERROR, RPT_SEVERITY_INFO, scale, SCH_EDIT_FRAME::Schematic(), SCH_EDIT_FRAME::SetCurrentSheet(), PAGE_INFO::SetPortrait(), SCH_EDIT_FRAME::SetSheetNumberAndCount(), PAGE_INFO::SetType(), SCH_SHEET_LIST::SortByPageNumbers(), SCH_SHEET_PATH::UpdateAllScreenReferences(), and IO_ERROR::What().

Referenced by plotSchematic().

◆ createSVGFiles()

void DIALOG_PLOT_SCHEMATIC::createSVGFiles ( bool  aPrintAll,
bool  aPrintFrameRef,
RENDER_SETTINGS aRenderSettings 
)
private

Definition at line 1113 of file dialog_plot_schematic.cpp.

1115 {
1116  wxString msg;
1117  REPORTER& reporter = m_MessagesBox->Reporter();
1118  SCH_SHEET_PATH oldsheetpath = m_parent->GetCurrentSheet();
1119  SCH_SHEET_LIST sheetList;
1120 
1121  if( aPrintAll )
1122  {
1123  sheetList.BuildSheetList( &m_parent->Schematic().Root(), true );
1124  sheetList.SortByPageNumbers();
1125  }
1126  else
1127  {
1128  sheetList.push_back( m_parent->GetCurrentSheet() );
1129  }
1130 
1131  for( unsigned i = 0; i < sheetList.size(); i++ )
1132  {
1133  SCH_SCREEN* screen;
1134  m_parent->SetCurrentSheet( sheetList[i] );
1137  screen = m_parent->GetCurrentSheet().LastScreen();
1138 
1139  try
1140  {
1141  wxString fname = m_parent->GetUniqueFilenameForCurrentSheet();
1142 
1143  // The sub sheet can be in a sub_hierarchy, but we plot the file in the
1144  // main project folder (or the folder specified by the caller),
1145  // so replace separators to create a unique filename:
1146  fname.Replace( "/", "_" );
1147  fname.Replace( "\\", "_" );
1148  wxString ext = SVG_PLOTTER::GetDefaultFileExtension();
1149  wxFileName plotFileName = createPlotFileName( fname, ext, &reporter );
1150 
1151  if( !plotFileName.IsOk() )
1152  return;
1153 
1154  bool success = plotOneSheetSVG( plotFileName.GetFullPath(), screen, aRenderSettings,
1155  getModeColor() ? false : true, aPrintFrameRef );
1156 
1157  if( !success )
1158  {
1159  msg.Printf( _( "Failed to create file '%s'." ), plotFileName.GetFullPath() );
1160  reporter.Report( msg, RPT_SEVERITY_ERROR );
1161  }
1162  else
1163  {
1164  msg.Printf( _( "Plotted to '%s'." ), plotFileName.GetFullPath() );
1165  reporter.Report( msg, RPT_SEVERITY_ACTION );
1166  }
1167  }
1168  catch( const IO_ERROR& e )
1169  {
1170  // Cannot plot SVG file
1171  msg.Printf( wxT( "SVG Plotter exception: %s" ), e.What() );
1172  reporter.Report( msg, RPT_SEVERITY_ERROR );
1173  break;
1174  }
1175  }
1176 
1177  reporter.ReportTail( _( "Done" ), RPT_SEVERITY_INFO );
1178 
1179  m_parent->SetCurrentSheet( oldsheetpath );
1182 }
void SetCurrentSheet(const SCH_SHEET_PATH &aSheet)
A container for handling SCH_SHEET_PATH objects in a flattened hierarchy.
static wxString GetDefaultFileExtension()
virtual REPORTER & ReportTail(const wxString &aText, SEVERITY aSeverity=RPT_SEVERITY_UNDEFINED)
Places the report at the end of the list, for objects that support report ordering.
Definition: reporter.h:99
wxFileName createPlotFileName(const wxString &aPlotFileName, const wxString &aExtension, REPORTER *aReporter=nullptr)
Create a file name with an absolute path name.
bool plotOneSheetSVG(const wxString &aFileName, SCH_SCREEN *aScreen, RENDER_SETTINGS *aRenderSettings, bool aPlotBlackAndWhite, bool aPlotFrameRef)
A pure virtual class used to derive REPORTER objects from.
Definition: reporter.h:70
void UpdateAllScreenReferences()
Update all the symbol references for this sheet path.
virtual REPORTER & Report(const wxString &aText, SEVERITY aSeverity=RPT_SEVERITY_UNDEFINED)=0
Report a string with a given severity.
virtual const wxString What() const
A composite of Problem() and Where()
Definition: exceptions.cpp:30
void BuildSheetList(SCH_SHEET *aSheet, bool aCheckIntegrity)
Build the list of sheets and their sheet path from aSheet.
SCHEMATIC & Schematic() const
#define _(s)
Handle access to a stack of flattened SCH_SHEET objects by way of a path for creating a flattened sch...
SCH_SHEET & Root() const
Definition: schematic.h:92
SCH_SCREEN * LastScreen()
void SetSheetNumberAndCount()
Set the m_ScreenNumber and m_NumberOfScreens members for screens.
void SortByPageNumbers(bool aUpdateVirtualPageNums=true)
Sort the list of sheets by page number.
wxString GetUniqueFilenameForCurrentSheet()
SCH_SHEET_PATH & GetCurrentSheet() const
WX_HTML_REPORT_PANEL * m_MessagesBox
Hold an error message and may be used when throwing exceptions containing meaningful error messages.
Definition: ki_exception.h:75

References _, SCH_SHEET_LIST::BuildSheetList(), createPlotFileName(), SCH_EDIT_FRAME::GetCurrentSheet(), SVG_PLOTTER::GetDefaultFileExtension(), getModeColor(), SCH_EDIT_FRAME::GetUniqueFilenameForCurrentSheet(), SCH_SHEET_PATH::LastScreen(), DIALOG_PLOT_SCHEMATIC_BASE::m_MessagesBox, m_parent, plotOneSheetSVG(), REPORTER::Report(), WX_HTML_REPORT_PANEL::Reporter(), REPORTER::ReportTail(), SCHEMATIC::Root(), RPT_SEVERITY_ACTION, RPT_SEVERITY_ERROR, RPT_SEVERITY_INFO, SCH_EDIT_FRAME::Schematic(), SCH_EDIT_FRAME::SetCurrentSheet(), SCH_EDIT_FRAME::SetSheetNumberAndCount(), SCH_SHEET_LIST::SortByPageNumbers(), SCH_SHEET_PATH::UpdateAllScreenReferences(), and IO_ERROR::What().

Referenced by plotSchematic().

◆ Enable()

bool DIALOG_SHIM::Enable ( bool  enable)
overrideinherited

Definition at line 312 of file dialog_shim.cpp.

313 {
314  // so we can do logging of this state change:
315  return wxDialog::Enable( enable );
316 }

◆ EndQuasiModal()

void DIALOG_SHIM::EndQuasiModal ( int  retCode)
inherited

Definition at line 473 of file dialog_shim.cpp.

474 {
475  // Hook up validator and transfer data from controls handling so quasi-modal dialogs
476  // handle validation in the same way as other dialogs.
477  if( ( retCode == wxID_OK ) && ( !Validate() || !TransferDataFromWindow() ) )
478  return;
479 
480  SetReturnCode( retCode );
481 
482  if( !IsQuasiModal() )
483  {
484  wxFAIL_MSG( "either DIALOG_SHIM::EndQuasiModal called twice or ShowQuasiModal"
485  "wasn't called" );
486  return;
487  }
488 
489  if( m_qmodal_loop )
490  {
491  if( m_qmodal_loop->IsRunning() )
492  m_qmodal_loop->Exit( 0 );
493  else
494  m_qmodal_loop->ScheduleExit( 0 );
495 
496  m_qmodal_loop = nullptr;
497  }
498 
500  m_qmodal_parent_disabler = nullptr;
501 
502  Show( false );
503 }
bool IsQuasiModal() const
Definition: dialog_shim.h:106
WX_EVENT_LOOP * m_qmodal_loop
Definition: dialog_shim.h:211
bool Show(bool show) override
WDO_ENABLE_DISABLE * m_qmodal_parent_disabler
Definition: dialog_shim.h:214

References DIALOG_SHIM::IsQuasiModal(), DIALOG_SHIM::m_qmodal_loop, DIALOG_SHIM::m_qmodal_parent_disabler, and DIALOG_SHIM::Show().

Referenced by NETLIST_DIALOG::OnAddGenerator(), DIALOG_SHIM::OnButton(), DIALOG_EDIT_SYMBOLS_LIBID::onCancel(), DIALOG_LIB_SYMBOL_PROPERTIES::OnCancelButtonClick(), DIALOG_SYMBOL_PROPERTIES::OnCancelButtonClick(), DIALOG_LIB_EDIT_PIN_TABLE::OnClose(), DIALOG_CHOOSE_FOOTPRINT::OnCloseTimer(), DIALOG_SHIM::OnCloseWindow(), NETLIST_DIALOG::OnDelGenerator(), DIALOG_SYMBOL_PROPERTIES::OnEditLibrarySymbol(), DIALOG_SYMBOL_PROPERTIES::OnEditSymbol(), DIALOG_SYMBOL_PROPERTIES::OnExchangeSymbol(), PCB_ONE_LAYER_SELECTOR::OnLeftGridCellClick(), PCB_ONE_LAYER_SELECTOR::OnRightGridCellClick(), DIALOG_SYMBOL_PROPERTIES::OnUpdateSymbol(), DIALOG_CHOOSE_FOOTPRINT::OnUseBrowser(), DIALOG_PUSH_PAD_PROPERTIES::PadPropertiesAccept(), and DIALOG_SHIM::~DIALOG_SHIM().

◆ finishDialogSettings()

void DIALOG_SHIM::finishDialogSettings ( )
protectedinherited

In all dialogs, we must call the same functions to fix minimal dlg size, the default position and perhaps some others to fix a few issues depending on Windows Managers this helper function does these calls.

finishDialogSettings must be called from derived classes after all widgets have been initialized, and therefore their size fixed. If TransferDataToWindow() is used to initialize widgets, at the end of TransferDataToWindow, or better yet, at end of a wxInitDialogEvent handler.

Definition at line 151 of file dialog_shim.cpp.

152 {
153  // must be called from the constructor of derived classes,
154  // when all widgets are initialized, and therefore their size fixed
155 
156  // SetSizeHints fixes the minimal size of sizers in the dialog
157  // (SetSizeHints calls Fit(), so no need to call it)
158  GetSizer()->SetSizeHints( this );
159 }

Referenced by DIALOG_ANNOTATE::DIALOG_ANNOTATE(), DIALOG_BOARD_REANNOTATE::DIALOG_BOARD_REANNOTATE(), DIALOG_BOARD_SETUP::DIALOG_BOARD_SETUP(), DIALOG_BOM::DIALOG_BOM(), DIALOG_BUS_MANAGER::DIALOG_BUS_MANAGER(), DIALOG_CHANGE_SYMBOLS::DIALOG_CHANGE_SYMBOLS(), DIALOG_CLEANUP_TRACKS_AND_VIAS::DIALOG_CLEANUP_TRACKS_AND_VIAS(), DIALOG_DIMENSION_PROPERTIES::DIALOG_DIMENSION_PROPERTIES(), DIALOG_DRC::DIALOG_DRC(), DIALOG_EDIT_SYMBOLS_LIBID::DIALOG_EDIT_SYMBOLS_LIBID(), DIALOG_ENUM_PADS::DIALOG_ENUM_PADS(), DIALOG_ERC::DIALOG_ERC(), DIALOG_EXCHANGE_FOOTPRINTS::DIALOG_EXCHANGE_FOOTPRINTS(), DIALOG_EXPORT_3DFILE::DIALOG_EXPORT_3DFILE(), DIALOG_EXPORT_IDF3::DIALOG_EXPORT_IDF3(), DIALOG_EXPORT_STEP::DIALOG_EXPORT_STEP(), DIALOG_EXPORT_SVG::DIALOG_EXPORT_SVG(), DIALOG_FOOTPRINT_CHECKER::DIALOG_FOOTPRINT_CHECKER(), DIALOG_FOOTPRINT_PROPERTIES::DIALOG_FOOTPRINT_PROPERTIES(), DIALOG_FOOTPRINT_PROPERTIES_FP_EDITOR::DIALOG_FOOTPRINT_PROPERTIES_FP_EDITOR(), DIALOG_FOOTPRINT_WIZARD_LIST::DIALOG_FOOTPRINT_WIZARD_LIST(), DIALOG_GENCAD_EXPORT_OPTIONS::DIALOG_GENCAD_EXPORT_OPTIONS(), DIALOG_GLOBAL_EDIT_TEXT_AND_GRAPHICS::DIALOG_GLOBAL_EDIT_TEXT_AND_GRAPHICS(), DIALOG_GLOBAL_EDIT_TRACKS_AND_VIAS::DIALOG_GLOBAL_EDIT_TRACKS_AND_VIAS(), DIALOG_GLOBAL_LIB_TABLE_CONFIG::DIALOG_GLOBAL_LIB_TABLE_CONFIG(), DIALOG_GRID_SETTINGS::DIALOG_GRID_SETTINGS(), DIALOG_GROUP_PROPERTIES::DIALOG_GROUP_PROPERTIES(), DIALOG_IMAGE_EDITOR::DIALOG_IMAGE_EDITOR(), DIALOG_IMPORTED_LAYERS::DIALOG_IMPORTED_LAYERS(), DIALOG_INSPECTOR::DIALOG_INSPECTOR(), DIALOG_JUNCTION_PROPS::DIALOG_JUNCTION_PROPS(), DIALOG_LIB_NEW_SYMBOL::DIALOG_LIB_NEW_SYMBOL(), DIALOG_LIB_SHAPE_PROPERTIES::DIALOG_LIB_SHAPE_PROPERTIES(), DIALOG_LIB_SYMBOL_PROPERTIES::DIALOG_LIB_SYMBOL_PROPERTIES(), DIALOG_LIB_TEXT_PROPERTIES::DIALOG_LIB_TEXT_PROPERTIES(), DIALOG_LINE_WIRE_BUS_PROPERTIES::DIALOG_LINE_WIRE_BUS_PROPERTIES(), DIALOG_LIST_HOTKEYS::DIALOG_LIST_HOTKEYS(), DIALOG_LOCKED_ITEMS_QUERY::DIALOG_LOCKED_ITEMS_QUERY(), DIALOG_MOVE_EXACT::DIALOG_MOVE_EXACT(), DIALOG_NET_INSPECTOR::DIALOG_NET_INSPECTOR(), DIALOG_NETLIST::DIALOG_NETLIST(), DIALOG_NON_COPPER_ZONES_EDITOR::DIALOG_NON_COPPER_ZONES_EDITOR(), DIALOG_PAD_PRIMITIVE_POLY_PROPS::DIALOG_PAD_PRIMITIVE_POLY_PROPS(), DIALOG_PAD_PRIMITIVES_PROPERTIES::DIALOG_PAD_PRIMITIVES_PROPERTIES(), DIALOG_PAD_PROPERTIES::DIALOG_PAD_PROPERTIES(), DIALOG_PASTE_SPECIAL::DIALOG_PASTE_SPECIAL(), DIALOG_PIN_PROPERTIES::DIALOG_PIN_PROPERTIES(), DIALOG_PLOT_SCHEMATIC(), DIALOG_POSITION_RELATIVE::DIALOG_POSITION_RELATIVE(), DIALOG_PRINT_GENERIC::DIALOG_PRINT_GENERIC(), DIALOG_PRINT_USING_PRINTER::DIALOG_PRINT_USING_PRINTER(), DIALOG_PUSH_PAD_PROPERTIES::DIALOG_PUSH_PAD_PROPERTIES(), DIALOG_REGULATOR_FORM::DIALOG_REGULATOR_FORM(), DIALOG_RULE_AREA_PROPERTIES::DIALOG_RULE_AREA_PROPERTIES(), DIALOG_SCHEMATIC_SETUP::DIALOG_SCHEMATIC_SETUP(), DIALOG_SELECT_3DMODEL::DIALOG_SELECT_3DMODEL(), DIALOG_SHEET_PIN_PROPERTIES::DIALOG_SHEET_PIN_PROPERTIES(), DIALOG_SHEET_PROPERTIES::DIALOG_SHEET_PROPERTIES(), DIALOG_SWAP_LAYERS::DIALOG_SWAP_LAYERS(), DIALOG_SYMBOL_FIELDS_TABLE::DIALOG_SYMBOL_FIELDS_TABLE(), DIALOG_SYMBOL_PROPERTIES::DIALOG_SYMBOL_PROPERTIES(), DIALOG_TARGET_PROPERTIES::DIALOG_TARGET_PROPERTIES(), DIALOG_TEXT_AND_LABEL_PROPERTIES::DIALOG_TEXT_AND_LABEL_PROPERTIES(), DIALOG_TEXT_PROPERTIES::DIALOG_TEXT_PROPERTIES(), DIALOG_TRACK_VIA_PROPERTIES::DIALOG_TRACK_VIA_PROPERTIES(), DIALOG_TRACK_VIA_SIZE::DIALOG_TRACK_VIA_SIZE(), DIALOG_UNUSED_PAD_LAYERS::DIALOG_UNUSED_PAD_LAYERS(), DIALOG_UPDATE_FROM_PCB::DIALOG_UPDATE_FROM_PCB(), DIALOG_UPDATE_PCB::DIALOG_UPDATE_PCB(), DIALOG_UPDATE_SYMBOL_FIELDS::DIALOG_UPDATE_SYMBOL_FIELDS(), DIALOG_CONSTRAINTS_REPORTER::FinishInitialization(), PAGED_DIALOG::finishInitialization(), DIALOG_FIELD_PROPERTIES::init(), DIALOG_EDIT_LIBRARY_TABLES::InstallPanel(), NETLIST_DIALOG::NETLIST_DIALOG(), DIALOG_GRAPHIC_ITEM_PROPERTIES::OnInitDlg(), DIALOG_SHEET_PROPERTIES::OnInitDlg(), DIALOG_SYMBOL_PROPERTIES::OnInitDlg(), DIALOG_SPICE_MODEL::onInitDlg(), DIALOG_SIM_SETTINGS::onInitDlg(), DIALOG_SIGNAL_LIST::TransferDataToWindow(), DIALOG_BOARD_STATISTICS::TransferDataToWindow(), and DIALOG_COLOR_PICKER::TransferDataToWindow().

◆ getColorSettings()

COLOR_SETTINGS * DIALOG_PLOT_SCHEMATIC::getColorSettings ( )
private

Definition at line 368 of file dialog_plot_schematic.cpp.

369 {
370  int selection = m_colorTheme->GetSelection();
371 
372  if( selection < 0 )
373  return m_parent->GetSettingsManager()->GetColorSettings( "_builtin_default" );
374 
375  return static_cast<COLOR_SETTINGS*>( m_colorTheme->GetClientData( selection ) );
376 }
SETTINGS_MANAGER * GetSettingsManager() const
COLOR_SETTINGS * GetColorSettings(const wxString &aName="user")
Retrieves a color settings object that applications can read colors from.

References SETTINGS_MANAGER::GetColorSettings(), EDA_BASE_FRAME::GetSettingsManager(), DIALOG_PLOT_SCHEMATIC_BASE::m_colorTheme, and m_parent.

Referenced by getPlotOptions(), plotOneSheetDXF(), and plotOneSheetHpgl().

◆ getModeColor()

bool DIALOG_PLOT_SCHEMATIC::getModeColor ( )
inlineprivate

◆ getOutputPath()

wxString DIALOG_PLOT_SCHEMATIC::getOutputPath ( )
private

Determine the best absolute path to plot files given the contents of the path edit control.

  • If the path edit control results in an absolute path, use it as is.
  • If the path edit control is not an absolute path and the project file is valid, use the project root path to normalize the contents of the path edit control.
  • If the path edit control is not an absolute path and the project file does not exist and the screen file name is valid, use the screen file name path.
  • If the path edit control is not an absolute path and the project file does not exist and the screen file name is empty, user the user's documents folder.
  • Fall back to the user's document path if any of the above conditions do not result in a valid absolute path.
Returns
a valid path to write the plot files.

Definition at line 1243 of file dialog_plot_schematic.cpp.

1244 {
1245  wxString msg;
1246  wxString extMsg;
1247  wxFileName fn;
1248 
1249  extMsg.Printf( _( "Falling back to user path '%s'." ),
1250  wxStandardPaths::Get().GetDocumentsDir() );
1251 
1252  // Build the absolute path of current output directory to preselect it in the file browser.
1253  wxString path = ExpandEnvVarSubstitutions( m_outputDirectoryName->GetValue(), &Prj() );
1254 
1255  fn.SetPath( path );
1256 
1257  // If the contents of the path edit control results in an absolute path, return it as is.
1258  if( fn.IsAbsolute() )
1259  return path;
1260 
1261  // When editing a schematic that is not part of a project in the stand alone mode, the
1262  // project path is not defined.
1263  if( Prj().IsNullProject() )
1264  {
1265  SCH_SCREEN* screen = m_parent->Schematic().RootScreen();
1266 
1267  if( screen && !screen->GetFileName().IsEmpty() )
1268  {
1269  fn = screen->GetFileName();
1270  msg.Printf( _( "Cannot normalize path '%s%s'." ), fn.GetPathWithSep(), path );
1271  fn.SetPath( fn.GetPathWithSep() + path );
1272 
1273  // Normalize always returns true for a non-empty file name so clear the file name
1274  // and extension so that only the path is normalized.
1275  fn.SetName( wxEmptyString );
1276  fn.SetExt( wxEmptyString );
1277 
1278  if( fn.Normalize() )
1279  {
1280  path = fn.GetPath();
1281  }
1282  else
1283  {
1284  wxMessageDialog dlg( this, msg, _( "Warning" ), wxOK | wxCENTER | wxRESIZE_BORDER
1285  | wxICON_EXCLAMATION | wxSTAY_ON_TOP );
1286 
1287  dlg.SetExtendedMessage( extMsg );
1288  dlg.ShowModal();
1289 
1290  path = wxStandardPaths::Get().GetDocumentsDir();
1291  }
1292  }
1293  else
1294  {
1295  msg = _( "No project or path defined for the current schematic." );
1296 
1297  wxMessageDialog dlg( this, msg, _( "Warning" ), wxOK | wxCENTER | wxRESIZE_BORDER
1298  | wxICON_EXCLAMATION | wxSTAY_ON_TOP );
1299  dlg.SetExtendedMessage( extMsg );
1300  dlg.ShowModal();
1301 
1302  // Always fall back to user's document path if no other absolute path can be normalized.
1303  path = wxStandardPaths::Get().GetDocumentsDir();
1304  }
1305  }
1306  else
1307  {
1308  msg.Printf( _( "Cannot normalize path '%s%s'." ), Prj().GetProjectPath(), path );
1309 
1310  // Build the absolute path of current output directory and the project path.
1311  fn.SetPath( Prj().GetProjectPath() + path );
1312 
1313  if( fn.Normalize() )
1314  {
1315  path = fn.GetPath();
1316  }
1317  else
1318  {
1319  wxMessageDialog dlg( this, msg, _( "Warning" ),
1320  wxOK | wxCENTER | wxRESIZE_BORDER | wxICON_EXCLAMATION |
1321  wxSTAY_ON_TOP );
1322 
1323  dlg.SetExtendedMessage( extMsg );
1324  dlg.ShowModal();
1325 
1326  path = wxStandardPaths::Get().GetDocumentsDir();
1327  }
1328  }
1329 
1330  return path;
1331 }
const wxString & GetFileName() const
Definition: sch_screen.h:145
const wxString ExpandEnvVarSubstitutions(const wxString &aString, PROJECT *aProject)
Replace any environment variable & text variable references with their values.
Definition: common.cpp:267
PROJECT & Prj() const
Return a reference to the PROJECT associated with this KIWAY.
SCHEMATIC & Schematic() const
#define _(s)
virtual bool IsNullProject() const
Check if this project is a null project (i.e.
Definition: project.cpp:134
SCH_SCREEN * RootScreen() const
Helper to retrieve the screen of the root sheet.
Definition: schematic.cpp:117

References _, ExpandEnvVarSubstitutions(), SCH_SCREEN::GetFileName(), PROJECT::IsNullProject(), DIALOG_PLOT_SCHEMATIC_BASE::m_outputDirectoryName, m_parent, path, KIWAY_HOLDER::Prj(), SCHEMATIC::RootScreen(), and SCH_EDIT_FRAME::Schematic().

Referenced by createPlotFileName().

◆ getPlotDrawingSheet()

bool DIALOG_PLOT_SCHEMATIC::getPlotDrawingSheet ( )
inlineprivate

Definition at line 94 of file dialog_plot_schematic.h.

94 { return m_plotDrawingSheet->GetValue(); }

References DIALOG_PLOT_SCHEMATIC_BASE::m_plotDrawingSheet.

Referenced by getPlotOptions(), and plotSchematic().

◆ GetPlotFileFormat()

PLOT_FORMAT DIALOG_PLOT_SCHEMATIC::GetPlotFileFormat ( )
private

Definition at line 245 of file dialog_plot_schematic.cpp.

246 {
247  switch( m_plotFormatOpt->GetSelection() )
248  {
249  default:
250  case 0: return PLOT_FORMAT::POST;
251  case 1: return PLOT_FORMAT::PDF;
252  case 2: return PLOT_FORMAT::SVG;
253  case 3: return PLOT_FORMAT::DXF;
254  case 4: return PLOT_FORMAT::HPGL;
255  }
256 }

References DXF, HPGL, DIALOG_PLOT_SCHEMATIC_BASE::m_plotFormatOpt, PDF, POST, and SVG.

Referenced by getPlotOptions(), OnPageSizeSelected(), OnUpdateUI(), and plotSchematic().

◆ getPlotOptions()

void DIALOG_PLOT_SCHEMATIC::getPlotOptions ( RENDER_SETTINGS aSettings)
private

Definition at line 324 of file dialog_plot_schematic.cpp.

325 {
327 
328  EESCHEMA_SETTINGS* cfg = dynamic_cast<EESCHEMA_SETTINGS*>( Kiface().KifaceSettings() );
329  wxASSERT( cfg );
330 
331  COLOR_SETTINGS* colors = getColorSettings();
332 
333  if( cfg )
334  {
336  cfg->m_PlotPanel.color = getModeColor();
337  cfg->m_PlotPanel.color_theme = colors->GetFilename();
339  cfg->m_PlotPanel.format = static_cast<int>( GetPlotFileFormat() );
340  cfg->m_PlotPanel.hpgl_origin = m_plotOriginOpt->GetSelection();
342 
343  // HPGL Pen Size is stored in mm in config
345  }
346 
347  aSettings->LoadColors( colors );
348  aSettings->SetDefaultPenWidth( (int) m_defaultLineWidth.GetValue() );
349 
350  if( m_plotBackgroundColor->GetValue() )
351  aSettings->SetBackgroundColor( colors->GetColor( LAYER_SCHEMATIC_BACKGROUND ) );
352  else
353  aSettings->SetBackgroundColor( COLOR4D::UNSPECIFIED );
354 
355  // Plot directory
356  wxString path = m_outputDirectoryName->GetValue();
357  path.Replace( '\\', '/' );
358 
360 
361  if( settings.m_PlotDirectoryName != path )
362  m_configChanged = true;
363 
364  settings.m_PlotDirectoryName = path;
365 }
KIFACE_BASE & Kiface()
Global KIFACE_BASE "get" accessor.
static constexpr double IU_PER_MM
Mock up a conversion function.
wxString GetFilename() const
Definition: json_settings.h:72
SCHEMATIC_SETTINGS & Settings() const
Definition: schematic.cpp:167
COLOR_SETTINGS * getColorSettings()
SCHEMATIC & Schematic() const
COLOR4D GetColor(int aLayer) const
virtual void SetBackgroundColor(const COLOR4D &aColor)=0
Set the background color.
These settings were stored in SCH_BASE_FRAME previously.
virtual long long int GetValue()
Return the current value in Internal Units.
Color settings are a bit different than most of the settings objects in that there can be more than o...
void SetDefaultPenWidth(int aWidth)
virtual void LoadColors(const COLOR_SETTINGS *aSettings)

References EESCHEMA_SETTINGS::PANEL_PLOT::background_color, EESCHEMA_SETTINGS::PANEL_PLOT::color, EESCHEMA_SETTINGS::PANEL_PLOT::color_theme, EESCHEMA_SETTINGS::PANEL_PLOT::format, EESCHEMA_SETTINGS::PANEL_PLOT::frame_reference, COLOR_SETTINGS::GetColor(), getColorSettings(), JSON_SETTINGS::GetFilename(), getModeColor(), getPlotDrawingSheet(), GetPlotFileFormat(), UNIT_BINDER::GetValue(), EESCHEMA_SETTINGS::PANEL_PLOT::hpgl_origin, EESCHEMA_SETTINGS::PANEL_PLOT::hpgl_paper_size, EESCHEMA_SETTINGS::PANEL_PLOT::hpgl_pen_size, IU_PER_MM, Kiface(), LAYER_SCHEMATIC_BACKGROUND, KIGFX::RENDER_SETTINGS::LoadColors(), m_configChanged, m_defaultLineWidth, m_HPGLPaperSizeSelect, m_HPGLPenSize, DIALOG_PLOT_SCHEMATIC_BASE::m_outputDirectoryName, m_parent, m_penWidth, DIALOG_PLOT_SCHEMATIC_BASE::m_plotBackgroundColor, SCHEMATIC_SETTINGS::m_PlotDirectoryName, DIALOG_PLOT_SCHEMATIC_BASE::m_plotOriginOpt, EESCHEMA_SETTINGS::m_PlotPanel, path, SCH_EDIT_FRAME::Schematic(), KIGFX::RENDER_SETTINGS::SetBackgroundColor(), KIGFX::RENDER_SETTINGS::SetDefaultPenWidth(), and SCHEMATIC::Settings().

Referenced by plotSchematic().

◆ getPlotOriginAndUnits()

◆ GetType()

HOLDER_TYPE KIWAY_HOLDER::GetType ( ) const
inlineinherited

Definition at line 46 of file kiway_holder.h.

46 { return m_type; }
HOLDER_TYPE m_type
Definition: kiway_holder.h:76

References KIWAY_HOLDER::m_type.

Referenced by DIALOG_SHIM::DIALOG_SHIM().

◆ GetUserUnits()

◆ horizPixelsFromDU()

int DIALOG_SHIM::horizPixelsFromDU ( int  x) const
protectedinherited

Convert an integer number of dialog units to pixels, horizontally.

See SetSizeInDU or wxDialog documentation for more information.

Definition at line 169 of file dialog_shim.cpp.

170 {
171  wxSize sz( x, 0 );
172  return ConvertDialogToPixels( sz ).x;
173 }

Referenced by DIALOG_CHOOSE_FOOTPRINT::DIALOG_CHOOSE_FOOTPRINT(), and DIALOG_CHOOSE_SYMBOL::DIALOG_CHOOSE_SYMBOL().

◆ initDlg()

void DIALOG_PLOT_SCHEMATIC::initDlg ( )
private

Definition at line 124 of file dialog_plot_schematic.cpp.

125 {
126  auto cfg = dynamic_cast<EESCHEMA_SETTINGS*>( Kiface().KifaceSettings() );
127  wxASSERT( cfg );
128 
129  if( cfg )
130  {
132  {
133  int idx = m_colorTheme->Append( settings->GetName(), static_cast<void*>( settings ) );
134 
135  if( settings->GetFilename() == cfg->m_PlotPanel.color_theme )
136  m_colorTheme->SetSelection( idx );
137  }
138 
139  m_colorTheme->Enable( cfg->m_PlotPanel.color );
140 
141  m_plotBackgroundColor->Enable( cfg->m_PlotPanel.color );
142  m_plotBackgroundColor->SetValue( cfg->m_PlotPanel.background_color );
143 
144  // Set color or B&W plot option
145  setModeColor( cfg->m_PlotPanel.color );
146 
147  // Set plot or not frame reference option
148  setPlotDrawingSheet( cfg->m_PlotPanel.frame_reference );
149 
150  // HPGL plot origin and unit system configuration
151  m_plotOriginOpt->SetSelection( cfg->m_PlotPanel.hpgl_origin );
152 
153  m_HPGLPaperSizeSelect = cfg->m_PlotPanel.hpgl_paper_size;
154 
155  // HPGL Pen Size is stored in mm in config
156  m_HPGLPenSize = cfg->m_PlotPanel.hpgl_pen_size * IU_PER_MM;
157 
158  // Switch to the last save plot format
159  PLOT_FORMAT fmt = static_cast<PLOT_FORMAT>( cfg->m_PlotPanel.format );
160 
161  switch( fmt )
162  {
163  default:
164  case PLOT_FORMAT::POST: m_plotFormatOpt->SetSelection( 0 ); break;
165  case PLOT_FORMAT::PDF: m_plotFormatOpt->SetSelection( 1 ); break;
166  case PLOT_FORMAT::SVG: m_plotFormatOpt->SetSelection( 2 ); break;
167  case PLOT_FORMAT::DXF: m_plotFormatOpt->SetSelection( 3 ); break;
168  case PLOT_FORMAT::HPGL: m_plotFormatOpt->SetSelection( 4 ); break;
169  }
170 
171  if( fmt == PLOT_FORMAT::DXF || fmt == PLOT_FORMAT::HPGL )
172  m_plotBackgroundColor->Disable();
173 
174  // Set the default line width (pen width which should be used for
175  // items that do not have a pen size defined (like frame ref)
176  // the default line width is stored in mils in config
177  m_defaultLineWidth.SetValue( Mils2iu( cfg->m_Drawing.default_line_thickness ) );
178  }
179 
180  // Initialize HPGL specific widgets
182 
183  // Plot directory
185  wxString path = settings.m_PlotDirectoryName;
186 #ifdef __WINDOWS__
187  path.Replace( '/', '\\' );
188 #endif
189  m_outputDirectoryName->SetValue( path );
190 }
SETTINGS_MANAGER * GetSettingsManager() const
std::vector< COLOR_SETTINGS * > GetColorSettingsList()
KIFACE_BASE & Kiface()
Global KIFACE_BASE "get" accessor.
static constexpr double IU_PER_MM
Mock up a conversion function.
SCHEMATIC_SETTINGS & Settings() const
Definition: schematic.cpp:167
void setPlotDrawingSheet(bool aPlot)
PLOT_FORMAT
The set of supported output plot formats.
Definition: plotter.h:67
SCHEMATIC & Schematic() const
virtual void SetValue(int aValue)
Set new value (in Internal Units) for the text field, taking care of units conversion.
These settings were stored in SCH_BASE_FRAME previously.
Color settings are a bit different than most of the settings objects in that there can be more than o...
void setModeColor(bool aColor)

References DXF, SETTINGS_MANAGER::GetColorSettingsList(), EDA_BASE_FRAME::GetSettingsManager(), HPGL, IU_PER_MM, Kiface(), DIALOG_PLOT_SCHEMATIC_BASE::m_colorTheme, m_defaultLineWidth, m_HPGLPaperSizeSelect, m_HPGLPenSize, DIALOG_PLOT_SCHEMATIC_BASE::m_outputDirectoryName, m_parent, m_penWidth, DIALOG_PLOT_SCHEMATIC_BASE::m_plotBackgroundColor, SCHEMATIC_SETTINGS::m_PlotDirectoryName, DIALOG_PLOT_SCHEMATIC_BASE::m_plotFormatOpt, DIALOG_PLOT_SCHEMATIC_BASE::m_plotOriginOpt, path, PDF, POST, SCH_EDIT_FRAME::Schematic(), setModeColor(), setPlotDrawingSheet(), SCHEMATIC::Settings(), UNIT_BINDER::SetValue(), and SVG.

Referenced by DIALOG_PLOT_SCHEMATIC().

◆ IsCtrl()

static bool DIALOG_SHIM::IsCtrl ( int  aChar,
const wxKeyEvent &  e 
)
inlinestaticinherited

Definition at line 124 of file dialog_shim.h.

125  {
126  return e.GetKeyCode() == aChar && e.ControlDown() && !e.AltDown() &&
127  !e.ShiftDown() && !e.MetaDown();
128  }

◆ IsQuasiModal()

◆ IsShiftCtrl()

static bool DIALOG_SHIM::IsShiftCtrl ( int  aChar,
const wxKeyEvent &  e 
)
inlinestaticinherited

Definition at line 130 of file dialog_shim.h.

131  {
132  return e.GetKeyCode() == aChar && e.ControlDown() && !e.AltDown() &&
133  e.ShiftDown() && !e.MetaDown();
134  }

◆ Kiway()

KIWAY& KIWAY_HOLDER::Kiway ( ) const
inlineinherited

Return a reference to the KIWAY that this object has an opportunity to participate in.

A KIWAY_HOLDER is not necessarily a KIWAY_PLAYER.

Definition at line 53 of file kiway_holder.h.

54  {
55  wxASSERT( m_kiway ); // smoke out bugs in Debug build, then Release runs fine.
56  return *m_kiway;
57  }
KIWAY * m_kiway
Definition: kiway_holder.h:75

References KIWAY_HOLDER::m_kiway.

Referenced by PROJECT_TREE_ITEM::Activate(), FOOTPRINT_VIEWER_FRAME::AddFootprintToPCB(), PCB_BASE_EDIT_FRAME::AddLibrary(), SYMBOL_EDIT_FRAME::AddLibraryFile(), SYMBOL_EDITOR_CONTROL::AddSymbolToSchematic(), SYMBOL_EDIT_FRAME::canCloseWindow(), SCH_EDIT_FRAME::canCloseWindow(), KICAD_MANAGER_FRAME::CloseProject(), COMMON_CONTROL::ConfigurePaths(), DIALOG_CHOOSE_FOOTPRINT::ConstructRightPanel(), DIALOG_CHOOSE_SYMBOL::ConstructRightPanel(), PCB_BASE_FRAME::CreateAndShow3D_Frame(), FOOTPRINT_EDITOR_CONTROL::CreateFootprint(), CVPCB_MAINFRAME::CVPCB_MAINFRAME(), DIALOG_RESCUE_EACH::DIALOG_RESCUE_EACH(), DIALOG_SHIM::DIALOG_SHIM(), SCH_EDIT_FRAME::doCloseWindow(), FIELDS_GRID_TRICKS::doPopupSelection(), FIELDS_EDITOR_GRID_TRICKS::doPopupSelection(), BOARD_EDITOR_CONTROL::EditFpInFpEditor(), SCH_EDITOR_CONTROL::EditWithSymbolEditor(), BACK_ANNOTATE::FetchNetlistFromPCB(), KICAD_MANAGER_FRAME::ImportNonKiCadProject(), SCRIPTING_TOOL::Init(), EDA_DRAW_FRAME::IsScriptingConsoleVisible(), KICAD_MANAGER_FRAME::language_change(), KIWAY_PLAYER::language_change(), DIALOG_CHANGE_SYMBOLS::launchMatchIdSymbolBrowser(), DIALOG_CHANGE_SYMBOLS::launchNewIdSymbolBrowser(), LIB_TREE_MODEL_ADAPTER::LIB_TREE_MODEL_ADAPTER(), TEXT_BUTTON_SYMBOL_CHOOSER::OnButtonClick(), TEXT_BUTTON_FP_CHOOSER::OnButtonClick(), PL_EDITOR_FRAME::OnExit(), SCH_EDIT_FRAME::OnExit(), FOOTPRINT_EDIT_FRAME::OnExitKiCad(), FOOTPRINT_VIEWER_FRAME::OnExitKiCad(), SYMBOL_EDIT_FRAME::OnExitKiCad(), SAVE_AS_TRAVERSER::OnFile(), DIALOG_CHOOSE_SYMBOL::OnInitDialog(), SCH_EDIT_FRAME::OnOpenCvpcb(), SCH_EDIT_FRAME::OnOpenPcbnew(), EDA_BASE_FRAME::OnPreferences(), DIALOG_SYMBOL_REMAP::OnRemapSymbols(), DIALOG_FIELD_PROPERTIES::OnTextValueSelectButtonClick(), KICAD_MANAGER_FRAME::OnUnarchiveFiles(), FOOTPRINT_EDIT_FRAME::OnUpdateLoadFootprintFromBoard(), SCH_EDIT_FRAME::OnUpdatePCB(), FOOTPRINT_EDIT_FRAME::OnUpdateSaveFootprintToBoard(), PANEL_PCBNEW_COLOR_SETTINGS::PANEL_PCBNEW_COLOR_SETTINGS(), SCH_BASE_FRAME::PickSymbolFromLibBrowser(), KIWAY_HOLDER::Prj(), SCH_EDIT_TOOL::Properties(), BACK_ANNOTATE::PushNewLinksToPCB(), FOOTPRINT_WIZARD_FRAME::PythonPluginsReload(), FOOTPRINT_VIEWER_FRAME::ReCreateFootprintList(), SCH_EDITOR_CONTROL::rescueProject(), EE_INSPECTION_TOOL::RunSimulation(), SYMBOL_EDIT_FRAME::Save(), CVPCB_MAINFRAME::SaveFootprintAssociation(), FOOTPRINT_EDIT_FRAME::SaveFootprintToBoard(), LIB_TREE_MODEL_ADAPTER::SavePinnedItems(), EDA_DRAW_FRAME::ScriptingConsoleEnableDisable(), SCH_EDIT_FRAME::SendCrossProbeClearHighlight(), SCH_EDIT_FRAME::SendCrossProbeNetName(), PCB_EDIT_FRAME::SendCrossProbeNetName(), CVPCB_MAINFRAME::SendMessageToEESCHEMA(), PCB_EDIT_FRAME::SendMessageToEESCHEMA(), SCH_EDIT_FRAME::SendMessageToPCBNEW(), SCH_EDIT_FRAME::sendNetlistToCvpcb(), SCH_EDIT_FRAME::SetCrossProbeConnection(), SYMBOL_EDIT_FRAME::SetCurSymbol(), CVPCB_CONTROL::ShowFootprintViewer(), COMMON_CONTROL::ShowLibraryTable(), COMMON_CONTROL::ShowPlayer(), KICAD_MANAGER_CONTROL::ShowPlayer(), SCH_EDIT_FRAME::ShowSchematicSetupDialog(), SIM_PLOT_FRAME::SIM_PLOT_FRAME(), BOARD_EDITOR_CONTROL::UpdateSchematicFromPCB(), and DIALOG_EXCHANGE_FOOTPRINTS::ViewAndSelectFootprint().

◆ OnCharHook()

void DIALOG_SHIM::OnCharHook ( wxKeyEvent &  aEvt)
protectedvirtualinherited

Reimplemented in DIALOG_CHOOSE_SYMBOL, HK_PROMPT_DIALOG, and HTML_MESSAGE_BOX.

Definition at line 563 of file dialog_shim.cpp.

564 {
565  if( aEvt.GetKeyCode() == 'U' && aEvt.GetModifiers() == wxMOD_CONTROL )
566  {
567  if( m_parentFrame )
568  {
570  return;
571  }
572  }
573  // shift-return (Mac default) or Ctrl-Return (GTK) for OK
574  else if( aEvt.GetKeyCode() == WXK_RETURN && ( aEvt.ShiftDown() || aEvt.ControlDown() ) )
575  {
576  wxPostEvent( this, wxCommandEvent( wxEVT_COMMAND_BUTTON_CLICKED, wxID_OK ) );
577  return;
578  }
579  else if( aEvt.GetKeyCode() == WXK_TAB && !aEvt.ControlDown() )
580  {
581  wxWindow* currentWindow = wxWindow::FindFocus();
582  int currentIdx = -1;
583  int delta = aEvt.ShiftDown() ? -1 : 1;
584 
585  auto advance = [&]( int& idx )
586  {
587  // Wrap-around modulus
588  int size = m_tabOrder.size();
589  idx = ( ( idx + delta ) % size + size ) % size;
590  };
591 
592  for( size_t i = 0; i < m_tabOrder.size(); ++i )
593  {
594  if( m_tabOrder[i] == currentWindow )
595  {
596  currentIdx = (int) i;
597  break;
598  }
599  }
600 
601  if( currentIdx >= 0 )
602  {
603  advance( currentIdx );
604 
605  //todo: We don't currently have non-textentry dialog boxes but this will break if
606  // we add them.
607 #ifdef __APPLE__
608  while( dynamic_cast<wxTextEntry*>( m_tabOrder[ currentIdx ] ) == nullptr )
609  advance( currentIdx );
610 #endif
611 
612  m_tabOrder[ currentIdx ]->SetFocus();
613  return;
614  }
615  }
616 
617  aEvt.Skip();
618 }
std::vector< wxWindow * > m_tabOrder
Definition: dialog_shim.h:218
EDA_BASE_FRAME * m_parentFrame
Definition: dialog_shim.h:216
virtual void ToggleUserUnits()
constexpr int delta

References delta, DIALOG_SHIM::m_parentFrame, DIALOG_SHIM::m_tabOrder, and EDA_BASE_FRAME::ToggleUserUnits().

Referenced by DIALOG_TEXT_PROPERTIES::DIALOG_TEXT_PROPERTIES(), and DIALOG_TEXT_PROPERTIES::~DIALOG_TEXT_PROPERTIES().

◆ OnCloseWindow()

virtual void DIALOG_PLOT_SCHEMATIC_BASE::OnCloseWindow ( wxCloseEvent &  event)
inlineprotectedvirtualinherited

◆ OnOutputDirectoryBrowseClicked()

void DIALOG_PLOT_SCHEMATIC::OnOutputDirectoryBrowseClicked ( wxCommandEvent &  event)
overrideprivatevirtual

Set the m_outputDirectoryName variable to the selected directory from directory dialog.

Todo:
Copy of DIALOG_PLOT::OnOutputDirectoryBrowseClicked in dialog_plot.cpp, maybe merge to a common method.

Reimplemented from DIALOG_PLOT_SCHEMATIC_BASE.

Definition at line 197 of file dialog_plot_schematic.cpp.

198 {
199  // Build the absolute path of current output directory to preselect it in the file browser.
200  wxString path = ExpandEnvVarSubstitutions( m_outputDirectoryName->GetValue(), &Prj() );
201 
202  // When editing a schematic that is not part of a project in the stand alone mode, the
203  // project path is not defined so point to the users document path to save the plot files.
204  if( Prj().IsNullProject() )
205  {
206  path = wxStandardPaths::Get().GetDocumentsDir();
207  }
208  else
209  {
210  // Build the absolute path of current output directory to preselect it in the file browser.
212  path = Prj().AbsolutePath( path );
213  }
214 
215  wxDirDialog dirDialog( this, _( "Select Output Directory" ), path );
216 
217  if( dirDialog.ShowModal() == wxID_CANCEL )
218  return;
219 
220  wxFileName dirName = wxFileName::DirName( dirDialog.GetPath() );
221 
222  wxFileName fn( Prj().AbsolutePath( m_parent->Schematic().Root().GetFileName() ) );
223  wxString defaultPath = fn.GetPathWithSep();
224  wxString msg;
225  wxFileName relPathTest; // Used to test if we can make the path relative
226 
227  relPathTest.Assign( dirDialog.GetPath() );
228 
229  // Test if making the path relative is possible before asking the user if they want to do it
230  if( relPathTest.MakeRelativeTo( defaultPath ) )
231  {
232  msg.Printf( _( "Do you want to use a path relative to\n'%s'?" ), defaultPath );
233 
234  wxMessageDialog dialog( this, msg, _( "Plot Output Directory" ),
235  wxYES_NO | wxICON_QUESTION | wxYES_DEFAULT );
236 
237  if( dialog.ShowModal() == wxID_YES )
238  dirName.MakeRelativeTo( defaultPath );
239  }
240 
241  m_outputDirectoryName->SetValue( dirName.GetFullPath() );
242 }
const wxString ExpandEnvVarSubstitutions(const wxString &aString, PROJECT *aProject)
Replace any environment variable & text variable references with their values.
Definition: common.cpp:267
virtual const wxString AbsolutePath(const wxString &aFileName) const
Fix up aFileName if it is relative to the project's directory to be an absolute path and filename.
Definition: project.cpp:269
PROJECT & Prj() const
Return a reference to the PROJECT associated with this KIWAY.
SCHEMATIC & Schematic() const
#define _(s)
wxString GetFileName() const
Return the filename corresponding to this sheet.
Definition: sch_sheet.h:315
virtual bool IsNullProject() const
Check if this project is a null project (i.e.
Definition: project.cpp:134
SCH_SHEET & Root() const
Definition: schematic.h:92

References _, PROJECT::AbsolutePath(), ExpandEnvVarSubstitutions(), SCH_SHEET::GetFileName(), PROJECT::IsNullProject(), DIALOG_PLOT_SCHEMATIC_BASE::m_outputDirectoryName, m_parent, path, KIWAY_HOLDER::Prj(), SCHEMATIC::Root(), and SCH_EDIT_FRAME::Schematic().

◆ OnPageSizeSelected()

void DIALOG_PLOT_SCHEMATIC::OnPageSizeSelected ( wxCommandEvent &  event)
overrideprivatevirtual

◆ OnPaint()

void DIALOG_SHIM::OnPaint ( wxPaintEvent &  event)
inherited

Definition at line 380 of file dialog_shim.cpp.

381 {
382  if( m_firstPaintEvent )
383  {
385 
386  selectAllInTextCtrls( GetChildren() );
387 
390  else
391  KIPLATFORM::UI::ForceFocus( this ); // Focus the dialog itself
392 
393  m_firstPaintEvent = false;
394  }
395 
396  event.Skip();
397 }
wxWindow * m_initialFocusTarget
Definition: dialog_shim.h:209
bool m_firstPaintEvent
Definition: dialog_shim.h:208
void ForceFocus(wxWindow *aWindow)
Pass the current focus to the window.
Definition: gtk/ui.cpp:44
void FixupCancelButtonCmdKeyCollision(wxWindow *aWindow)
Definition: gtk/ui.cpp:71
static void selectAllInTextCtrls(wxWindowList &children)

References KIPLATFORM::UI::FixupCancelButtonCmdKeyCollision(), KIPLATFORM::UI::ForceFocus(), DIALOG_SHIM::m_firstPaintEvent, DIALOG_SHIM::m_initialFocusTarget, and selectAllInTextCtrls().

Referenced by DIALOG_SHIM::DIALOG_SHIM().

◆ OnPlotAll()

void DIALOG_PLOT_SCHEMATIC::OnPlotAll ( wxCommandEvent &  event)
overrideprivatevirtual

Reimplemented from DIALOG_PLOT_SCHEMATIC_BASE.

Definition at line 385 of file dialog_plot_schematic.cpp.

386 {
387  plotSchematic( true );
388 }
void plotSchematic(bool aPlotAll)

References plotSchematic().

◆ OnPlotCurrent()

void DIALOG_PLOT_SCHEMATIC::OnPlotCurrent ( wxCommandEvent &  event)
overrideprivatevirtual

Reimplemented from DIALOG_PLOT_SCHEMATIC_BASE.

Definition at line 379 of file dialog_plot_schematic.cpp.

380 {
381  plotSchematic( false );
382 }
void plotSchematic(bool aPlotAll)

References plotSchematic().

◆ OnPlotFormatSelection()

virtual void DIALOG_PLOT_SCHEMATIC_BASE::OnPlotFormatSelection ( wxCommandEvent &  event)
inlineprotectedvirtualinherited

◆ OnUpdateUI()

void DIALOG_PLOT_SCHEMATIC::OnUpdateUI ( wxUpdateUIEvent &  event)
overrideprivatevirtual

Reimplemented from DIALOG_PLOT_SCHEMATIC_BASE.

Definition at line 268 of file dialog_plot_schematic.cpp.

269 {
271 
272  if( fmt != m_plotFormat )
273  {
274  m_plotFormat = fmt;
275 
276  wxArrayString paperSizes;
277  paperSizes.push_back( _( "Schematic size" ) );
278 
279  int selection;
280 
281  if( fmt == PLOT_FORMAT::HPGL )
282  {
283  paperSizes.push_back( _( "A5" ) );
284  paperSizes.push_back( _( "A4" ) );
285  paperSizes.push_back( _( "A3" ) );
286  paperSizes.push_back( _( "A2" ) );
287  paperSizes.push_back( _( "A1" ) );
288  paperSizes.push_back( _( "A0" ) );
289  paperSizes.push_back( _( "A" ) );
290  paperSizes.push_back( _( "B" ) );
291  paperSizes.push_back( _( "C" ) );
292  paperSizes.push_back( _( "D" ) );
293  paperSizes.push_back( _( "E" ) );
294 
295  selection = m_HPGLPaperSizeSelect;
296  }
297  else
298  {
299  paperSizes.push_back( _( "A4" ) );
300  paperSizes.push_back( _( "A" ) );
301 
302  selection = m_pageSizeSelect;
303  }
304 
305  m_paperSizeOption->Set( paperSizes );
306  m_paperSizeOption->SetSelection( selection );
307 
309  fmt == PLOT_FORMAT::POST || fmt == PLOT_FORMAT::PDF || fmt == PLOT_FORMAT::SVG );
310 
311  m_plotOriginTitle->Enable( fmt == PLOT_FORMAT::HPGL );
312  m_plotOriginOpt->Enable( fmt == PLOT_FORMAT::HPGL );
314 
315  m_plotBackgroundColor->Enable(
316  fmt == PLOT_FORMAT::POST || fmt == PLOT_FORMAT::PDF || fmt == PLOT_FORMAT::SVG );
317 
318  m_colorTheme->Enable( fmt != PLOT_FORMAT::HPGL );
319  m_ModeColorOption->Enable( fmt != PLOT_FORMAT::HPGL );
320  }
321 }
PLOT_FORMAT
The set of supported output plot formats.
Definition: plotter.h:67
#define _(s)
void Enable(bool aEnable)
Enable/disable the label, widget and units label.

References _, UNIT_BINDER::Enable(), GetPlotFileFormat(), HPGL, DIALOG_PLOT_SCHEMATIC_BASE::m_colorTheme, m_defaultLineWidth, m_HPGLPaperSizeSelect, DIALOG_PLOT_SCHEMATIC_BASE::m_ModeColorOption, m_pageSizeSelect, DIALOG_PLOT_SCHEMATIC_BASE::m_paperSizeOption, m_penWidth, DIALOG_PLOT_SCHEMATIC_BASE::m_plotBackgroundColor, m_plotFormat, DIALOG_PLOT_SCHEMATIC_BASE::m_plotOriginOpt, DIALOG_PLOT_SCHEMATIC_BASE::m_plotOriginTitle, PDF, POST, and SVG.

◆ plotOneSheetDXF()

bool DIALOG_PLOT_SCHEMATIC::plotOneSheetDXF ( const wxString &  aFileName,
SCH_SCREEN aScreen,
RENDER_SETTINGS aRenderSettings,
const wxPoint &  aPlotOffset,
double  aScale,
bool  aPlotFrameRef 
)
private

Definition at line 540 of file dialog_plot_schematic.cpp.

546 {
547  aRenderSettings->LoadColors( getColorSettings() );
548  aRenderSettings->SetDefaultPenWidth( 0 );
549 
550  const PAGE_INFO& pageInfo = aScreen->GetPageSettings();
551  DXF_PLOTTER* plotter = new DXF_PLOTTER();
552 
553  plotter->SetRenderSettings( aRenderSettings );
554  plotter->SetPageSettings( pageInfo );
555  plotter->SetColorMode( getModeColor() );
556 
557  // Currently, plot units are in decimil
558  plotter->SetViewport( aPlotOffset, IU_PER_MILS/10, aScale, false );
559 
560  // Init :
561  plotter->SetCreator( wxT( "Eeschema-DXF" ) );
562 
563  if( ! plotter->OpenFile( aFileName ) )
564  {
565  delete plotter;
566  return false;
567  }
568 
569  LOCALE_IO toggle;
570 
571  plotter->StartPlot();
572 
573  if( aPlotFrameRef )
574  {
575  PlotDrawingSheet( plotter, &m_parent->Prj(), m_parent->GetTitleBlock(), pageInfo,
576  aScreen->GetPageNumber(), aScreen->GetPageCount(),
577  m_parent->GetScreenDesc(), aScreen->GetFileName(),
578  plotter->GetColorMode() ?
580  COLOR4D::BLACK, aScreen->GetVirtualPageNumber() == 1 );
581  }
582 
583  aScreen->Plot( plotter );
584 
585  // finish
586  plotter->EndPlot();
587  delete plotter;
588 
589  return true;
590 }
void Plot(PLOTTER *aPlotter) const
Plot all the schematic objects to aPlotter.
Definition: sch_screen.cpp:772
const wxString & GetFileName() const
Definition: sch_screen.h:145
virtual void SetCreator(const wxString &aCreator)
Definition: plotter.h:174
Instantiate the current locale within a scope in which you are expecting exceptions to be thrown.
Definition: locale_io.h:40
virtual void SetViewport(const wxPoint &aOffset, double aIusPerDecimil, double aScale, bool aMirror) override
Set the scale/position for the DXF plot.
virtual bool OpenFile(const wxString &aFullFilename)
Open or create the plot file aFullFilename.
Definition: plotter.cpp:76
virtual void SetColorMode(bool aColorMode)
Plot in B/W or color.
Definition: plotter.h:152
int GetVirtualPageNumber() const
Definition: base_screen.h:75
void SetRenderSettings(RENDER_SETTINGS *aSettings)
Definition: plotter.h:155
const COLOR4D & GetLayerColor(int aLayer) const
Return the color used to draw a layer.
COLOR_SETTINGS * getColorSettings()
int GetPageCount() const
Definition: base_screen.h:72
Definition: color4d.h:44
const PAGE_INFO & GetPageSettings() const
Definition: sch_screen.h:132
const wxString & GetPageNumber() const
Definition: base_screen.cpp:71
wxString GetScreenDesc() const override
Return a human-readable description of the current screen.
virtual bool StartPlot() override
Open the DXF plot with a skeleton header.
PROJECT & Prj() const
Return a reference to the PROJECT associated with this KIWAY.
Describe the page size and margins of a paper page on which to eventually print or plot.
Definition: page_info.h:53
virtual bool EndPlot() override
RENDER_SETTINGS * RenderSettings()
Definition: plotter.h:156
const TITLE_BLOCK & GetTitleBlock() const override
void PlotDrawingSheet(PLOTTER *plotter, const PROJECT *aProject, const TITLE_BLOCK &aTitleBlock, const PAGE_INFO &aPageInfo, const wxString &aSheetNumber, int aSheetCount, const wxString &aSheetDesc, const wxString &aFilename, COLOR4D aColor, bool aIsFirstPage)
#define IU_PER_MILS
Definition: plotter.cpp:136
void SetDefaultPenWidth(int aWidth)
virtual void LoadColors(const COLOR_SETTINGS *aSettings)
virtual void SetPageSettings(const PAGE_INFO &aPageSettings)
Definition: plotter.h:158
bool GetColorMode() const
Definition: plotter.h:153

References BLACK, DXF_PLOTTER::EndPlot(), PLOTTER::GetColorMode(), getColorSettings(), SCH_SCREEN::GetFileName(), KIGFX::RENDER_SETTINGS::GetLayerColor(), getModeColor(), BASE_SCREEN::GetPageCount(), BASE_SCREEN::GetPageNumber(), SCH_SCREEN::GetPageSettings(), SCH_EDIT_FRAME::GetScreenDesc(), SCH_BASE_FRAME::GetTitleBlock(), BASE_SCREEN::GetVirtualPageNumber(), IU_PER_MILS, LAYER_SCHEMATIC_DRAWINGSHEET, KIGFX::RENDER_SETTINGS::LoadColors(), m_parent, PLOTTER::OpenFile(), SCH_SCREEN::Plot(), PlotDrawingSheet(), KIWAY_HOLDER::Prj(), PLOTTER::RenderSettings(), PLOTTER::SetColorMode(), PLOTTER::SetCreator(), KIGFX::RENDER_SETTINGS::SetDefaultPenWidth(), PLOTTER::SetPageSettings(), PLOTTER::SetRenderSettings(), DXF_PLOTTER::SetViewport(), and DXF_PLOTTER::StartPlot().

Referenced by createDXFFiles().

◆ plotOneSheetHpgl()

bool DIALOG_PLOT_SCHEMATIC::plotOneSheetHpgl ( const wxString &  aFileName,
SCH_SCREEN aScreen,
const PAGE_INFO aPageInfo,
RENDER_SETTINGS aRenderSettings,
const wxPoint &  aPlot0ffset,
double  aScale,
bool  aPlotFrameRef,
HPGL_PLOT_ORIGIN_AND_UNITS  aOriginAndUnits 
)
private

Definition at line 707 of file dialog_plot_schematic.cpp.

715 {
716  HPGL_PLOTTER* plotter = new HPGL_PLOTTER();
717  // Currently, plot units are in decimil
718 
719  plotter->SetPageSettings( aPageInfo );
720  plotter->SetRenderSettings( aRenderSettings );
721  plotter->RenderSettings()->LoadColors( getColorSettings() );
722  plotter->SetColorMode( getModeColor() );
723  plotter->SetViewport( aPlot0ffset, IU_PER_MILS/10, aScale, false );
724 
725  // TODO this could be configurable
726  plotter->SetTargetChordLength( Millimeter2iu( 0.6 ) );
727 
728  switch( aOriginAndUnits )
729  {
732  default:
733  plotter->SetUserCoords( false );
734  break;
736  plotter->SetUserCoords( true );
737  plotter->SetUserCoordsFit( false );
738  break;
740  plotter->SetUserCoords( true );
741  plotter->SetUserCoordsFit( true );
742  break;
743  }
744 
745  // Init :
746  plotter->SetCreator( wxT( "Eeschema-HPGL" ) );
747 
748  if( !plotter->OpenFile( aFileName ) )
749  {
750  delete plotter;
751  return false;
752  }
753 
754  LOCALE_IO toggle;
755 
756  // Pen num and pen speed are not initialized here.
757  // Default HPGL driver values are used
758  plotter->SetPenDiameter( m_HPGLPenSize );
759  plotter->StartPlot();
760 
761  if( aPlotFrameRef )
762  {
763  PlotDrawingSheet( plotter, &m_parent->Prj(), m_parent->GetTitleBlock(), aPageInfo,
764  aScreen->GetPageNumber(), aScreen->GetPageCount(),
766  aScreen->GetVirtualPageNumber() == 1 );
767  }
768 
769  aScreen->Plot( plotter );
770 
771  plotter->EndPlot();
772  delete plotter;
773 
774  return true;
775 }
virtual bool EndPlot() override
HPGL end of plot: sort and emit graphics, pen return and release.
void Plot(PLOTTER *aPlotter) const
Plot all the schematic objects to aPlotter.
Definition: sch_screen.cpp:772
const wxString & GetFileName() const
Definition: sch_screen.h:145
virtual void SetCreator(const wxString &aCreator)
Definition: plotter.h:174
Instantiate the current locale within a scope in which you are expecting exceptions to be thrown.
Definition: locale_io.h:40
virtual bool OpenFile(const wxString &aFullFilename)
Open or create the plot file aFullFilename.
Definition: plotter.cpp:76
virtual void SetColorMode(bool aColorMode)
Plot in B/W or color.
Definition: plotter.h:152
int GetVirtualPageNumber() const
Definition: base_screen.h:75
void SetRenderSettings(RENDER_SETTINGS *aSettings)
Definition: plotter.h:155
virtual void SetPenDiameter(double diameter)
COLOR_SETTINGS * getColorSettings()
int GetPageCount() const
Definition: base_screen.h:72
Definition: color4d.h:44
virtual bool StartPlot() override
At the start of the HPGL plot pen speed and number are requested.
const wxString & GetPageNumber() const
Definition: base_screen.cpp:71
virtual void SetViewport(const wxPoint &aOffset, double aIusPerDecimil, double aScale, bool aMirror) override
Set the plot offset and scaling for the current plot.
void SetUserCoordsFit(bool user_coords_fit)
Set whether the user coordinate system is fit to content.
Definition: plotter_hpgl.h:59
wxString GetScreenDesc() const override
Return a human-readable description of the current screen.
PROJECT & Prj() const
Return a reference to the PROJECT associated with this KIWAY.
void SetTargetChordLength(double chord_len)
Set the target length of chords used to draw approximated circles and arcs.
RENDER_SETTINGS * RenderSettings()
Definition: plotter.h:156
void SetUserCoords(bool user_coords)
Switch to the user coordinate system.
Definition: plotter_hpgl.h:56
const TITLE_BLOCK & GetTitleBlock() const override
void PlotDrawingSheet(PLOTTER *plotter, const PROJECT *aProject, const TITLE_BLOCK &aTitleBlock, const PAGE_INFO &aPageInfo, const wxString &aSheetNumber, int aSheetCount, const wxString &aSheetDesc, const wxString &aFilename, COLOR4D aColor, bool aIsFirstPage)
#define IU_PER_MILS
Definition: plotter.cpp:136
virtual void LoadColors(const COLOR_SETTINGS *aSettings)
static constexpr int Millimeter2iu(double mm)
virtual void SetPageSettings(const PAGE_INFO &aPageSettings)
Definition: plotter.h:158

References BLACK, HPGL_PLOTTER::EndPlot(), getColorSettings(), SCH_SCREEN::GetFileName(), getModeColor(), BASE_SCREEN::GetPageCount(), BASE_SCREEN::GetPageNumber(), SCH_EDIT_FRAME::GetScreenDesc(), SCH_BASE_FRAME::GetTitleBlock(), BASE_SCREEN::GetVirtualPageNumber(), IU_PER_MILS, KIGFX::RENDER_SETTINGS::LoadColors(), m_HPGLPenSize, m_parent, Millimeter2iu(), PLOTTER::OpenFile(), SCH_SCREEN::Plot(), PlotDrawingSheet(), PLOTTER_BOT_LEFT, PLOTTER_CENTER, KIWAY_HOLDER::Prj(), PLOTTER::RenderSettings(), PLOTTER::SetColorMode(), PLOTTER::SetCreator(), PLOTTER::SetPageSettings(), HPGL_PLOTTER::SetPenDiameter(), PLOTTER::SetRenderSettings(), HPGL_PLOTTER::SetTargetChordLength(), HPGL_PLOTTER::SetUserCoords(), HPGL_PLOTTER::SetUserCoordsFit(), HPGL_PLOTTER::SetViewport(), HPGL_PLOTTER::StartPlot(), USER_FIT_CONTENT, and USER_FIT_PAGE.

Referenced by createHPGLFiles().

◆ plotOneSheetPDF()

void DIALOG_PLOT_SCHEMATIC::plotOneSheetPDF ( PLOTTER aPlotter,
SCH_SCREEN aScreen,
bool  aPlotDrawingSheet 
)
private

Definition at line 893 of file dialog_plot_schematic.cpp.

895 {
896  if( m_plotBackgroundColor->GetValue() )
897  {
898  aPlotter->SetColor( aPlotter->RenderSettings()->GetBackgroundColor() );
899  wxPoint end( aPlotter->PageSettings().GetWidthIU(),
900  aPlotter->PageSettings().GetHeightIU() );
901  aPlotter->Rect( wxPoint( 0, 0 ), end, FILL_T::FILLED_SHAPE, 1.0 );
902  }
903 
904  if( aPlotDrawingSheet )
905  {
907 
908  if( aPlotter->GetColorMode() )
910 
911  PlotDrawingSheet( aPlotter, &aScreen->Schematic()->Prj(), m_parent->GetTitleBlock(),
912  m_parent->GetPageSettings(), aScreen->GetPageNumber(),
913  aScreen->GetPageCount(), m_parent->GetScreenDesc(),
914  aScreen->GetFileName(), color, aScreen->GetVirtualPageNumber() == 1 );
915  }
916 
917  aScreen->Plot( aPlotter );
918 }
void Plot(PLOTTER *aPlotter) const
Plot all the schematic objects to aPlotter.
Definition: sch_screen.cpp:772
const wxString & GetFileName() const
Definition: sch_screen.h:145
virtual const COLOR4D & GetBackgroundColor()=0
Return current background color settings.
int color
Definition: DXF_plotter.cpp:57
int GetVirtualPageNumber() const
Definition: base_screen.h:75
const COLOR4D & GetLayerColor(int aLayer) const
Return the color used to draw a layer.
int GetPageCount() const
Definition: base_screen.h:72
Definition: color4d.h:44
const wxString & GetPageNumber() const
Definition: base_screen.cpp:71
wxString GetScreenDesc() const override
Return a human-readable description of the current screen.
virtual void SetColor(const COLOR4D &color)=0
PROJECT & Prj() const override
Return a reference to the project this schematic is part of.
Definition: schematic.h:75
const PAGE_INFO & GetPageSettings() const override
RENDER_SETTINGS * RenderSettings()
Definition: plotter.h:156
SCHEMATIC * Schematic() const
Definition: sch_screen.cpp:92
const TITLE_BLOCK & GetTitleBlock() const override
void PlotDrawingSheet(PLOTTER *plotter, const PROJECT *aProject, const TITLE_BLOCK &aTitleBlock, const PAGE_INFO &aPageInfo, const wxString &aSheetNumber, int aSheetCount, const wxString &aSheetDesc, const wxString &aFilename, COLOR4D aColor, bool aIsFirstPage)
virtual void Rect(const wxPoint &p1, const wxPoint &p2, FILL_T fill, int width=USE_DEFAULT_LINE_WIDTH)=0
PAGE_INFO & PageSettings()
Definition: plotter.h:159
A color representation with 4 components: red, green, blue, alpha.
Definition: color4d.h:103
bool GetColorMode() const
Definition: plotter.h:153

References BLACK, color, FILLED_SHAPE, KIGFX::RENDER_SETTINGS::GetBackgroundColor(), PLOTTER::GetColorMode(), SCH_SCREEN::GetFileName(), KIGFX::RENDER_SETTINGS::GetLayerColor(), BASE_SCREEN::GetPageCount(), BASE_SCREEN::GetPageNumber(), SCH_BASE_FRAME::GetPageSettings(), SCH_EDIT_FRAME::GetScreenDesc(), SCH_BASE_FRAME::GetTitleBlock(), BASE_SCREEN::GetVirtualPageNumber(), LAYER_SCHEMATIC_DRAWINGSHEET, m_parent, DIALOG_PLOT_SCHEMATIC_BASE::m_plotBackgroundColor, PLOTTER::PageSettings(), SCH_SCREEN::Plot(), PlotDrawingSheet(), SCHEMATIC::Prj(), PLOTTER::Rect(), PLOTTER::RenderSettings(), SCH_SCREEN::Schematic(), and PLOTTER::SetColor().

Referenced by createPDFFile().

◆ plotOneSheetPS()

bool DIALOG_PLOT_SCHEMATIC::plotOneSheetPS ( const wxString &  aFileName,
SCH_SCREEN aScreen,
RENDER_SETTINGS aRenderSettings,
const PAGE_INFO aPageInfo,
const wxPoint &  aPlot0ffset,
double  aScale,
bool  aPlotFrameRef 
)
private

Definition at line 1058 of file dialog_plot_schematic.cpp.

1065 {
1066  PS_PLOTTER* plotter = new PS_PLOTTER();
1067  plotter->SetRenderSettings( aRenderSettings );
1068  plotter->SetPageSettings( aPageInfo );
1069  plotter->SetColorMode( getModeColor() );
1070 
1071  // Currently, plot units are in decimil
1072  plotter->SetViewport( aPlot0ffset, IU_PER_MILS/10, aScale, false );
1073 
1074  // Init :
1075  plotter->SetCreator( wxT( "Eeschema-PS" ) );
1076 
1077  if( ! plotter->OpenFile( aFileName ) )
1078  {
1079  delete plotter;
1080  return false;
1081  }
1082 
1083  LOCALE_IO toggle; // Switch the locale to standard C
1084 
1085  plotter->StartPlot();
1086 
1087  if( m_plotBackgroundColor->GetValue() )
1088  {
1090  wxPoint end( plotter->PageSettings().GetWidthIU(), plotter->PageSettings().GetHeightIU() );
1091  plotter->Rect( wxPoint( 0, 0 ), end, FILL_T::FILLED_SHAPE, 1.0 );
1092  }
1093 
1094  if( aPlotFrameRef )
1095  {
1096  PlotDrawingSheet( plotter, &aScreen->Schematic()->Prj(), m_parent->GetTitleBlock(),
1097  aPageInfo, aScreen->GetPageNumber(), aScreen->GetPageCount(),
1098  m_parent->GetScreenDesc(), aScreen->GetFileName(),
1099  plotter->GetColorMode() ?
1101  COLOR4D::BLACK, aScreen->GetVirtualPageNumber() == 1 );
1102  }
1103 
1104  aScreen->Plot( plotter );
1105 
1106  plotter->EndPlot();
1107  delete plotter;
1108 
1109  return true;
1110 }
virtual void SetViewport(const wxPoint &aOffset, double aIusPerDecimil, double aScale, bool aMirror) override
Set the plot offset and scaling for the current plot.
Definition: PS_plotter.cpp:420
void Plot(PLOTTER *aPlotter) const
Plot all the schematic objects to aPlotter.
Definition: sch_screen.cpp:772
const wxString & GetFileName() const
Definition: sch_screen.h:145
virtual void SetCreator(const wxString &aCreator)
Definition: plotter.h:174
Instantiate the current locale within a scope in which you are expecting exceptions to be thrown.
Definition: locale_io.h:40
virtual bool OpenFile(const wxString &aFullFilename)
Open or create the plot file aFullFilename.
Definition: plotter.cpp:76
virtual void SetColorMode(bool aColorMode)
Plot in B/W or color.
Definition: plotter.h:152
int GetVirtualPageNumber() const
Definition: base_screen.h:75
virtual bool EndPlot() override
Definition: PS_plotter.cpp:960
void SetRenderSettings(RENDER_SETTINGS *aSettings)
Definition: plotter.h:155
const COLOR4D & GetLayerColor(int aLayer) const
Return the color used to draw a layer.
int GetPageCount() const
Definition: base_screen.h:72
Definition: color4d.h:44
const wxString & GetPageNumber() const
Definition: base_screen.cpp:71
wxString GetScreenDesc() const override
Return a human-readable description of the current screen.
virtual bool StartPlot() override
The code within this function (and the CloseFilePS function) creates postscript files whose contents ...
Definition: PS_plotter.cpp:803
virtual void SetColor(const COLOR4D &color) override
The SetColor implementation is split with the subclasses: The PSLIKE computes the rgb values,...
Definition: PS_plotter.cpp:62
PROJECT & Prj() const override
Return a reference to the project this schematic is part of.
Definition: schematic.h:75
RENDER_SETTINGS * RenderSettings()
Definition: plotter.h:156
virtual void Rect(const wxPoint &p1, const wxPoint &p2, FILL_T fill, int width=USE_DEFAULT_LINE_WIDTH) override
Definition: PS_plotter.cpp:580
SCHEMATIC * Schematic() const
Definition: sch_screen.cpp:92
const TITLE_BLOCK & GetTitleBlock() const override
void PlotDrawingSheet(PLOTTER *plotter, const PROJECT *aProject, const TITLE_BLOCK &aTitleBlock, const PAGE_INFO &aPageInfo, const wxString &aSheetNumber, int aSheetCount, const wxString &aSheetDesc, const wxString &aFilename, COLOR4D aColor, bool aIsFirstPage)
#define IU_PER_MILS
Definition: plotter.cpp:136
PAGE_INFO & PageSettings()
Definition: plotter.h:159
virtual void SetPageSettings(const PAGE_INFO &aPageSettings)
Definition: plotter.h:158
bool GetColorMode() const
Definition: plotter.h:153

References BLACK, PS_PLOTTER::EndPlot(), FILLED_SHAPE, PLOTTER::GetColorMode(), SCH_SCREEN::GetFileName(), KIGFX::RENDER_SETTINGS::GetLayerColor(), getModeColor(), BASE_SCREEN::GetPageCount(), BASE_SCREEN::GetPageNumber(), SCH_EDIT_FRAME::GetScreenDesc(), SCH_BASE_FRAME::GetTitleBlock(), BASE_SCREEN::GetVirtualPageNumber(), IU_PER_MILS, LAYER_SCHEMATIC_BACKGROUND, LAYER_SCHEMATIC_DRAWINGSHEET, m_parent, DIALOG_PLOT_SCHEMATIC_BASE::m_plotBackgroundColor, PLOTTER::OpenFile(), PLOTTER::PageSettings(), SCH_SCREEN::Plot(), PlotDrawingSheet(), SCHEMATIC::Prj(), PS_PLOTTER::Rect(), PLOTTER::RenderSettings(), SCH_SCREEN::Schematic(), PSLIKE_PLOTTER::SetColor(), PLOTTER::SetColorMode(), PLOTTER::SetCreator(), PLOTTER::SetPageSettings(), PLOTTER::SetRenderSettings(), PS_PLOTTER::SetViewport(), and PS_PLOTTER::StartPlot().

Referenced by createPSFiles().

◆ plotOneSheetSVG()

bool DIALOG_PLOT_SCHEMATIC::plotOneSheetSVG ( const wxString &  aFileName,
SCH_SCREEN aScreen,
RENDER_SETTINGS aRenderSettings,
bool  aPlotBlackAndWhite,
bool  aPlotFrameRef 
)
private

Definition at line 1185 of file dialog_plot_schematic.cpp.

1190 {
1191  const PAGE_INFO& pageInfo = aScreen->GetPageSettings();
1192 
1193  SVG_PLOTTER* plotter = new SVG_PLOTTER();
1194  plotter->SetRenderSettings( aRenderSettings );
1195  plotter->SetPageSettings( pageInfo );
1196  plotter->SetColorMode( aPlotBlackAndWhite ? false : true );
1197  wxPoint plot_offset;
1198  double scale = 1.0;
1199 
1200  // Currently, plot units are in decimil
1201  plotter->SetViewport( plot_offset, IU_PER_MILS/10, scale, false );
1202 
1203  // Init :
1204  plotter->SetCreator( wxT( "Eeschema-SVG" ) );
1205 
1206  if( ! plotter->OpenFile( aFileName ) )
1207  {
1208  delete plotter;
1209  return false;
1210  }
1211 
1212  LOCALE_IO toggle;
1213 
1214  plotter->StartPlot();
1215 
1216  if( m_plotBackgroundColor->GetValue() )
1217  {
1219  wxPoint end( plotter->PageSettings().GetWidthIU(),
1220  plotter->PageSettings().GetHeightIU() );
1221  plotter->Rect( wxPoint( 0, 0 ), end, FILL_T::FILLED_SHAPE, 1.0 );
1222  }
1223 
1224  if( aPlotFrameRef )
1225  {
1226  PlotDrawingSheet( plotter, &aScreen->Schematic()->Prj(), m_parent->GetTitleBlock(),
1227  pageInfo, aScreen->GetPageNumber(), aScreen->GetPageCount(),
1228  m_parent->GetScreenDesc(), aScreen->GetFileName(),
1229  plotter->GetColorMode() ?
1231  COLOR4D::BLACK, aScreen->GetVirtualPageNumber() == 1 );
1232  }
1233 
1234  aScreen->Plot( plotter );
1235 
1236  plotter->EndPlot();
1237  delete plotter;
1238 
1239  return true;
1240 }
void Plot(PLOTTER *aPlotter) const
Plot all the schematic objects to aPlotter.
Definition: sch_screen.cpp:772
const wxString & GetFileName() const
Definition: sch_screen.h:145
virtual void SetCreator(const wxString &aCreator)
Definition: plotter.h:174
Instantiate the current locale within a scope in which you are expecting exceptions to be thrown.
Definition: locale_io.h:40
virtual void SetViewport(const wxPoint &aOffset, double aIusPerDecimil, double aScale, bool aMirror) override
Set the plot offset and scaling for the current plot.
virtual bool OpenFile(const wxString &aFullFilename)
Open or create the plot file aFullFilename.
Definition: plotter.cpp:76
virtual void SetColorMode(bool aColorMode)
Plot in B/W or color.
Definition: plotter.h:152
int GetVirtualPageNumber() const
Definition: base_screen.h:75
void SetRenderSettings(RENDER_SETTINGS *aSettings)
Definition: plotter.h:155
const COLOR4D & GetLayerColor(int aLayer) const
Return the color used to draw a layer.
int GetPageCount() const
Definition: base_screen.h:72
Definition: color4d.h:44
virtual void SetColor(const COLOR4D &color) override
The SetColor implementation is split with the subclasses: The PSLIKE computes the rgb values,...
const PAGE_INFO & GetPageSettings() const
Definition: sch_screen.h:132
const wxString & GetPageNumber() const
Definition: base_screen.cpp:71
virtual void Rect(const wxPoint &p1, const wxPoint &p2, FILL_T fill, int width=USE_DEFAULT_LINE_WIDTH) override
wxString GetScreenDesc() const override
Return a human-readable description of the current screen.
virtual bool EndPlot() override
Describe the page size and margins of a paper page on which to eventually print or plot.
Definition: page_info.h:53
virtual bool StartPlot() override
Create SVG file header.
PROJECT & Prj() const override
Return a reference to the project this schematic is part of.
Definition: schematic.h:75
RENDER_SETTINGS * RenderSettings()
Definition: plotter.h:156
const int scale
SCHEMATIC * Schematic() const
Definition: sch_screen.cpp:92
const TITLE_BLOCK & GetTitleBlock() const override
void PlotDrawingSheet(PLOTTER *plotter, const PROJECT *aProject, const TITLE_BLOCK &aTitleBlock, const PAGE_INFO &aPageInfo, const wxString &aSheetNumber, int aSheetCount, const wxString &aSheetDesc, const wxString &aFilename, COLOR4D aColor, bool aIsFirstPage)
#define IU_PER_MILS
Definition: plotter.cpp:136
PAGE_INFO & PageSettings()
Definition: plotter.h:159
virtual void SetPageSettings(const PAGE_INFO &aPageSettings)
Definition: plotter.h:158
bool GetColorMode() const
Definition: plotter.h:153

References BLACK, SVG_PLOTTER::EndPlot(), FILLED_SHAPE, PLOTTER::GetColorMode(), SCH_SCREEN::GetFileName(), KIGFX::RENDER_SETTINGS::GetLayerColor(), BASE_SCREEN::GetPageCount(), BASE_SCREEN::GetPageNumber(), SCH_SCREEN::GetPageSettings(), SCH_EDIT_FRAME::GetScreenDesc(), SCH_BASE_FRAME::GetTitleBlock(), BASE_SCREEN::GetVirtualPageNumber(), IU_PER_MILS, LAYER_SCHEMATIC_BACKGROUND, LAYER_SCHEMATIC_DRAWINGSHEET, m_parent, DIALOG_PLOT_SCHEMATIC_BASE::m_plotBackgroundColor, PLOTTER::OpenFile(), PLOTTER::PageSettings(), SCH_SCREEN::Plot(), PlotDrawingSheet(), SCHEMATIC::Prj(), SVG_PLOTTER::Rect(), PLOTTER::RenderSettings(), scale, SCH_SCREEN::Schematic(), SVG_PLOTTER::SetColor(), PLOTTER::SetColorMode(), PLOTTER::SetCreator(), PLOTTER::SetPageSettings(), PLOTTER::SetRenderSettings(), SVG_PLOTTER::SetViewport(), and SVG_PLOTTER::StartPlot().

Referenced by createSVGFiles().

◆ plotSchematic()

void DIALOG_PLOT_SCHEMATIC::plotSchematic ( bool  aPlotAll)
private

Definition at line 391 of file dialog_plot_schematic.cpp.

392 {
394 
395  getPlotOptions( &renderSettings );
396 
397  switch( GetPlotFileFormat() )
398  {
399  default:
400  case PLOT_FORMAT::POST:
401  createPSFiles( aPlotAll, getPlotDrawingSheet(), &renderSettings );
402  break;
403  case PLOT_FORMAT::DXF:
404  createDXFFiles( aPlotAll, getPlotDrawingSheet(), &renderSettings );
405  break;
406  case PLOT_FORMAT::PDF:
407  createPDFFile( aPlotAll, getPlotDrawingSheet(), &renderSettings );
408  break;
409  case PLOT_FORMAT::SVG:
410  createSVGFiles( aPlotAll, getPlotDrawingSheet(), &renderSettings );
411  break;
412  case PLOT_FORMAT::HPGL:
413  createHPGLFiles( aPlotAll, getPlotDrawingSheet(), &renderSettings );
414  break;
415  }
416 }
KIGFX::SCH_RENDER_SETTINGS * GetRenderSettings()
void createPDFFile(bool aPlotAll, bool aPlotDrawingSheet, RENDER_SETTINGS *aRenderSettings)
void getPlotOptions(RENDER_SETTINGS *aSettings)
void createDXFFiles(bool aPlotAll, bool aPlotDrawingSheet, RENDER_SETTINGS *aRenderSettings)
void createHPGLFiles(bool aPlotAll, bool aPlotFrameRef, RENDER_SETTINGS *aRenderSettings)
void createPSFiles(bool aPlotAll, bool aPlotFrameRef, RENDER_SETTINGS *aSettings)
Store schematic specific render settings.
Definition: sch_painter.h:66
void createSVGFiles(bool aPrintAll, bool aPrintFrameRef, RENDER_SETTINGS *aRenderSettings)

References createDXFFiles(), createHPGLFiles(), createPDFFile(), createPSFiles(), createSVGFiles(), DXF, getPlotDrawingSheet(), GetPlotFileFormat(), getPlotOptions(), SCH_BASE_FRAME::GetRenderSettings(), HPGL, m_parent, PDF, POST, and SVG.

Referenced by OnPlotAll(), and OnPlotCurrent().

◆ Prj()

PROJECT & KIWAY_HOLDER::Prj ( ) const
inherited

Return a reference to the PROJECT associated with this KIWAY.

Definition at line 36 of file kiway_holder.cpp.

37 {
38  return Kiway().Prj();
39 }
KIWAY & Kiway() const
Return a reference to the KIWAY that this object has an opportunity to participate in.
Definition: kiway_holder.h:53
virtual PROJECT & Prj() const
Return the PROJECT associated with this KIWAY.
Definition: kiway.cpp:190

References KIWAY_HOLDER::Kiway(), and KIWAY::Prj().

Referenced by PCB_BASE_EDIT_FRAME::AddLibrary(), SYMBOL_LIBRARY_MANAGER::addLibrary(), SYMBOL_EDIT_FRAME::addLibTableEntry(), SCH_EDIT_FRAME::AppendSchematic(), AskSaveBoardFileName(), DIALOG_SYMBOL_REMAP::backupProject(), CVPCB_MAINFRAME::buildEquivalenceList(), CVPCB_MAINFRAME::BuildLibrariesListBox(), SIM_PLOT_FRAME::canCloseWindow(), PANEL_FP_PROPERTIES_3D_MODEL::Cfg3DPath(), KICAD_MANAGER_FRAME::CloseProject(), DIALOG_GEN_FOOTPRINT_POSITION::CreateAsciiFiles(), DIALOG_GEN_FOOTPRINT_POSITION::CreateGerberFiles(), PCB_BASE_EDIT_FRAME::createNewLibrary(), PCB_BASE_EDIT_FRAME::CreateNewProjectLibrary(), DIALOG_SYMBOL_REMAP::createProjectSymbolLibTable(), SCH_EDIT_FRAME::CreateScreens(), FOOTPRINT_EDIT_FRAME::DeleteFootprintFromLibrary(), DIALOG_ANNOTATE::DIALOG_ANNOTATE(), DIALOG_BOARD_REANNOTATE::DIALOG_BOARD_REANNOTATE(), DIALOG_BOARD_SETUP::DIALOG_BOARD_SETUP(), DIALOG_BOARD_STATISTICS::DIALOG_BOARD_STATISTICS(), DIALOG_CHANGE_SYMBOLS::DIALOG_CHANGE_SYMBOLS(), DIALOG_CHOOSE_FOOTPRINT::DIALOG_CHOOSE_FOOTPRINT(), DIALOG_CHOOSE_SYMBOL::DIALOG_CHOOSE_SYMBOL(), DIALOG_CONFIG_EQUFILES::DIALOG_CONFIG_EQUFILES(), DIALOG_EXCHANGE_FOOTPRINTS::DIALOG_EXCHANGE_FOOTPRINTS(), DIALOG_EXPORT_SVG::DIALOG_EXPORT_SVG(), DIALOG_GEN_FOOTPRINT_POSITION::DIALOG_GEN_FOOTPRINT_POSITION(), DIALOG_NETLIST::DIALOG_NETLIST(), DIALOG_PAGES_SETTINGS::DIALOG_PAGES_SETTINGS(), DIALOG_PLOT::DIALOG_PLOT(), DIALOG_PLOT_SCHEMATIC(), DIALOG_SCHEMATIC_SETUP::DIALOG_SCHEMATIC_SETUP(), DIALOG_SYMBOL_REMAP::DIALOG_SYMBOL_REMAP(), DIALOG_UPDATE_FROM_PCB::DIALOG_UPDATE_FROM_PCB(), DIALOG_UPDATE_PCB::DIALOG_UPDATE_PCB(), PL_DRAW_PANEL_GAL::DisplayDrawingSheet(), FOOTPRINT_PREVIEW_PANEL::DisplayFootprint(), SYMBOL_VIEWER_FRAME::DisplayLibInfos(), CVPCB_MAINFRAME::DisplayStatus(), PCB_EDIT_FRAME::doAutoSave(), SCH_EDIT_FRAME::doAutoSave(), PCB_BASE_EDIT_FRAME::doCloseWindow(), FOOTPRINT_EDIT_FRAME::doCloseWindow(), SCH_EDIT_FRAME::doCloseWindow(), FIELDS_GRID_TRICKS::doPopupSelection(), FIELDS_EDITOR_GRID_TRICKS::doPopupSelection(), KICAD_MANAGER_CONTROL::Execute(), PCB_EDIT_FRAME::Export_IDF3(), PCB_EDIT_FRAME::ExportFootprintsToLibrary(), BOARD_EDITOR_CONTROL::ExportNetlist(), DIALOG_EXPORT_SVG::ExportSVGFile(), SYMBOL_EDITOR_CONTROL::ExportSymbolAsSVG(), SYMBOL_EDITOR_CONTROL::ExportView(), PCB_EDIT_FRAME::ExportVRML_File(), BACK_ANNOTATE::FetchNetlistFromPCB(), PCB_EDIT_FRAME::Files_io_from_id(), PCB_EDIT_FRAME::GenD356File(), DIALOG_GENDRILL::GenDrillAndMapFiles(), FOOTPRINT_VIEWER_FRAME::getCurFootprintName(), SYMBOL_EDIT_FRAME::GetCurLib(), FOOTPRINT_VIEWER_FRAME::getCurNickname(), SIM_PLOT_FRAME::getDefaultFilename(), SIM_PLOT_FRAME::getDefaultPath(), PCB_BASE_EDIT_FRAME::GetDesignRulesPath(), DISPLAY_FOOTPRINTS_FRAME::GetFootprint(), DIALOG_SYMBOL_REMAP::getLibsNotInGlobalSymbolLibTable(), SCH_BASE_FRAME::GetLibSymbol(), getOutputPath(), KICAD_MANAGER_FRAME::GetProjectFileName(), SCH_EDIT_FRAME::GetSchematicJunctionSize(), SYMBOL_VIEWER_FRAME::GetSelectedSymbol(), SCH_EDIT_FRAME::importFile(), SCH_EDITOR_CONTROL::ImportFPAssignments(), DIALOG_CONFIG_EQUFILES::Init(), FOOTPRINT_EDIT_FRAME::initLibraryTree(), SCH_EDIT_FRAME::KiwayMailIn(), SYMBOL_EDIT_FRAME::KiwayMailIn(), EDA_DRAW_FRAME::LibraryFileBrowser(), CVPCB_MAINFRAME::LoadFootprintFiles(), DIALOG_SPICE_MODEL::loadLibrary(), KICAD_MANAGER_FRAME::LoadProject(), SCH_EDIT_FRAME::LoadProject(), SCH_EDIT_FRAME::LoadProjectSettings(), PCB_EDIT_FRAME::LoadProjectSettings(), SIM_PLOT_FRAME::LoadSettings(), SCH_EDIT_FRAME::LoadSheetFromFile(), SYMBOL_EDIT_FRAME::LoadSymbolFromCurrentLib(), EDA_BASE_FRAME::LoadWindowState(), SIM_PLOT_FRAME::loadWorkbook(), SIM_PLOT_FRAME::menuSaveWorkbook(), SIM_PLOT_FRAME::menuSaveWorkbookAs(), PANEL_FP_PROPERTIES_3D_MODEL::On3DModelCellChanged(), FOOTPRINT_VIEWER_FRAME::OnActivate(), PANEL_FP_PROPERTIES_3D_MODEL::OnAdd3DModel(), DIALOG_BOARD_SETUP::OnAuxiliaryAction(), KICAD_MANAGER_FRAME::OnBrowseInFileExplorer(), TEXT_BUTTON_URL::OnButtonClick(), TEXT_BUTTON_FILE_BROWSER::OnButtonClick(), DIALOG_EDIT_SYMBOLS_LIBID::onClickOrphansButton(), DIALOG_EXPORT_STEP::onExportButton(), DIALOG_GENDRILL::OnGenReportFile(), KICAD_MANAGER_FRAME::OnIdle(), SCH_EDIT_FRAME::OnImportProject(), DIALOG_CHOOSE_SYMBOL::OnInitDialog(), DIALOG_CONFIG_EQUFILES::OnOkClick(), SCH_EDIT_FRAME::OnOpenCvpcb(), KICAD_MANAGER_FRAME::OnOpenFileInTextEditor(), DIALOG_NETLIST::OnOpenNetlistClick(), SCH_EDIT_FRAME::OnOpenPcbnew(), DIALOG_PLOT::OnOutputDirectoryBrowseClicked(), DIALOG_EXPORT_SVG::OnOutputDirectoryBrowseClicked(), DIALOG_GEN_FOOTPRINT_POSITION::OnOutputDirectoryBrowseClicked(), DIALOG_GENDRILL::OnOutputDirectoryBrowseClicked(), OnOutputDirectoryBrowseClicked(), DIALOG_SCHEMATIC_SETUP::OnPageChange(), DIALOG_BOARD_SETUP::OnPageChange(), DIALOG_SYMBOL_REMAP::OnRemapSymbols(), FOOTPRINT_EDIT_FRAME::OnSaveFootprintAsPng(), DIALOG_ERC::OnSaveReport(), DIALOG_DRC::OnSaveReport(), DIALOG_TEXT_AND_LABEL_PROPERTIES::onScintillaCharAdded(), PROPERTIES_FRAME::onScintillaCharAdded(), DIALOG_SCH_FIELD_PROPERTIES::onScintillaCharAdded(), DIALOG_SPICE_MODEL::onSelectLibrary(), SYMBOL_VIEWER_FRAME::OnSelectSymbol(), KICAD_MANAGER_FRAME::OnUnarchiveFiles(), SCH_EDIT_FRAME::OnUpdatePCB(), PCB_EDIT_FRAME::OpenProjectFiles(), SCH_EDIT_FRAME::OpenProjectFiles(), PANEL_FP_PROPERTIES_3D_MODEL::PANEL_FP_PROPERTIES_3D_MODEL(), PANEL_PREVIEW_3D_MODEL::PANEL_PREVIEW_3D_MODEL(), SCH_EDITOR_CONTROL::Paste(), FOOTPRINT_EDITOR_CONTROL::PasteFootprint(), SCH_BASE_FRAME::PickSymbolFromLibTree(), DIALOG_PLOT::Plot(), plotOneSheetDXF(), plotOneSheetHpgl(), DIALOG_CHOOSE_SYMBOL::PopulateFootprintSelector(), SCH_EDITOR_CONTROL::Print(), EDA_DRAW_FRAME::PrintDrawingSheet(), SCH_EDIT_FRAME::PrintPage(), KICAD_MANAGER_FRAME::PrintPrjInfo(), CVPCB_MAINFRAME::ReadNetListAndFpFiles(), PCB_EDIT_FRAME::RecreateCmpFileFromBoard(), FOOTPRINT_VIEWER_FRAME::ReCreateFootprintList(), SYMBOL_VIEWER_FRAME::ReCreateLibList(), FOOTPRINT_VIEWER_FRAME::ReCreateLibraryList(), SYMBOL_VIEWER_FRAME::ReCreateSymbolList(), PANEL_FP_PROPERTIES_3D_MODEL::ReloadModelsFromFootprint(), EDA_3D_VIEWER_FRAME::ReloadRequest(), DIALOG_SYMBOL_REMAP::remapSymbolToLibTable(), SYMBOL_EDIT_FRAME::replaceLibTableEntry(), SCH_EDITOR_CONTROL::RescueLegacyProject(), SCH_EDITOR_CONTROL::RescueSymbolLibTableProject(), FOOTPRINT_EDIT_FRAME::restoreLastFootprint(), FOOTPRINT_EDIT_FRAME::retainLastFootprint(), FOOTPRINT_EDITOR_CONTROL::SaveAs(), FOOTPRINT_EDIT_FRAME::SaveFootprint(), FOOTPRINT_EDIT_FRAME::SaveFootprintAs(), FOOTPRINT_EDIT_FRAME::SaveFootprintInLibrary(), SYMBOL_EDIT_FRAME::saveLibrary(), PCB_EDIT_FRAME::SavePcbFile(), SCH_EDIT_FRAME::SaveProject(), PCB_EDIT_FRAME::SaveProjectSettings(), DIALOG_BOARD_STATISTICS::saveReportClicked(), SCH_EDIT_FRAME::saveSchematicFile(), SIM_PLOT_FRAME::SaveSettings(), EDA_BASE_FRAME::SaveSettings(), SYMBOL_EDIT_FRAME::saveSymbolAs(), SCH_BASE_FRAME::saveSymbolLibTables(), SIM_PLOT_FRAME::saveWorkbook(), FOOTPRINT_VIEWER_FRAME::SelectAndViewFootprint(), PCB_BASE_FRAME::SelectLibrary(), SYMBOL_EDIT_FRAME::SelectLibraryFromList(), PCB_BASE_EDIT_FRAME::selectLibTable(), SYMBOL_EDIT_FRAME::selectSymLibTable(), FOOTPRINT_VIEWER_FRAME::setCurFootprintName(), SYMBOL_EDIT_FRAME::SetCurLib(), FOOTPRINT_VIEWER_FRAME::setCurNickname(), SYMBOL_EDIT_FRAME::SetCurSymbol(), GERBVIEW_FRAME::SetPageSettings(), EE_INSPECTION_TOOL::ShowDatasheet(), DIALOG_CHOOSE_SYMBOL::ShowFootprintFor(), COMMON_CONTROL::ShowHelp(), SYMBOL_VIEWER_FRAME::ShowModal(), FOOTPRINT_VIEWER_FRAME::ShowModal(), SCH_EDIT_FRAME::ShowSchematicSetupDialog(), SYMBOL_LIBRARY_MANAGER::symTable(), SYMBOL_TREE_SYNCHRONIZING_ADAPTER::Sync(), FOOTPRINT_EDIT_FRAME::SyncLibraryTree(), EDA_3D_VIEWER_FRAME::takeScreenshot(), PANEL_SETUP_RULES::TransferDataFromWindow(), DIALOG_SHEET_PROPERTIES::TransferDataFromWindow(), NETLIST_DIALOG::TransferDataFromWindow(), DIALOG_EDIT_SYMBOLS_LIBID::TransferDataFromWindow(), PANEL_SETUP_RULES::TransferDataToWindow(), SCH_EDIT_FRAME::updateAutoSaveFile(), DIALOG_PAGES_SETTINGS::UpdateDrawingSheetExample(), FOOTPRINT_VIEWER_FRAME::UpdateTitle(), SIM_PLOT_FRAME::updateTitle(), FOOTPRINT_EDIT_FRAME::UpdateTitle(), SCH_EDIT_FRAME::UpdateTitle(), PANEL_FP_PROPERTIES_3D_MODEL::validateModelExists(), SCH_EDIT_FRAME::WriteNetListFile(), DIALOG_FOOTPRINT_PROPERTIES::~DIALOG_FOOTPRINT_PROPERTIES(), PANEL_FP_PROPERTIES_3D_MODEL::~PANEL_FP_PROPERTIES_3D_MODEL(), and SCH_EDIT_FRAME::~SCH_EDIT_FRAME().

◆ PrjConfigChanged()

bool DIALOG_PLOT_SCHEMATIC::PrjConfigChanged ( )
inline

Return true if the project configuration was modified.

Definition at line 68 of file dialog_plot_schematic.h.

References m_configChanged.

Referenced by SCH_EDITOR_CONTROL::Plot().

◆ resetSize()

void DIALOG_SHIM::resetSize ( )
protectedinherited

Clear the existing dialog size and position.

This will cause the dialog size to be clear so the next time the dialog is shown the sizers will layout the dialog accordingly. This useful when there are dialog windows that size changes due to layout dependency hidden controls.

Definition at line 287 of file dialog_shim.cpp.

288 {
289  const char* hash_key;
290 
291  if( m_hash_key.size() )
292  {
293  // a special case like EDA_LIST_DIALOG, which has multiple uses.
294  hash_key = m_hash_key.c_str();
295  }
296  else
297  {
298  hash_key = typeid(*this).name();
299  }
300 
301  std::unordered_map<std::string, wxRect>::iterator it = class_map.find( hash_key );
302 
303  if( it == class_map.end() )
304  return;
305 
306  wxRect rect = it->second;
307  rect.SetSize( wxSize( 0, 0 ) );
308  class_map[ hash_key ] = rect;
309 }
std::string m_hash_key
Definition: dialog_shim.h:199
static std::unordered_map< std::string, wxRect > class_map

References class_map, and DIALOG_SHIM::m_hash_key.

Referenced by DIALOG_LIB_SYMBOL_PROPERTIES::DIALOG_LIB_SYMBOL_PROPERTIES().

◆ restoreEnvironment()

void DIALOG_PLOT_SCHEMATIC::restoreEnvironment ( PDF_PLOTTER aPlotter,
SCH_SHEET_PATH aOldsheetpath 
)
private

Everything done, close the plot and restore the environment.

Parameters
aPlotterthe plotter to close and destroy
aOldsheetpaththe stored old sheet path for the current sheet before the plot started

Definition at line 880 of file dialog_plot_schematic.cpp.

882 {
883  aPlotter->EndPlot();
884  delete aPlotter;
885 
886  // Restore the previous sheet
887  m_parent->SetCurrentSheet( aOldsheetpath );
890 }
void SetCurrentSheet(const SCH_SHEET_PATH &aSheet)
virtual bool EndPlot() override
void UpdateAllScreenReferences()
Update all the symbol references for this sheet path.
void SetSheetNumberAndCount()
Set the m_ScreenNumber and m_NumberOfScreens members for screens.
SCH_SHEET_PATH & GetCurrentSheet() const

References PDF_PLOTTER::EndPlot(), SCH_EDIT_FRAME::GetCurrentSheet(), m_parent, SCH_EDIT_FRAME::SetCurrentSheet(), SCH_EDIT_FRAME::SetSheetNumberAndCount(), and SCH_SHEET_PATH::UpdateAllScreenReferences().

Referenced by createPDFFile().

◆ setHpglPenWidth()

void DIALOG_PLOT_SCHEMATIC::setHpglPenWidth ( )
private

Definition at line 593 of file dialog_plot_schematic.cpp.

594 {
596 
597  if( m_HPGLPenSize > Millimeter2iu( 2 ) )
599 
600  if( m_HPGLPenSize < Millimeter2iu( 0.01 ) )
601  m_HPGLPenSize = Millimeter2iu( 0.01 );
602 }
virtual long long int GetValue()
Return the current value in Internal Units.
static constexpr int Millimeter2iu(double mm)

References UNIT_BINDER::GetValue(), m_HPGLPenSize, m_penWidth, and Millimeter2iu().

Referenced by createHPGLFiles().

◆ SetInitialFocus()

void DIALOG_SHIM::SetInitialFocus ( wxWindow *  aWindow)
inlineinherited

Sets the window (usually a wxTextCtrl) that should be focused when the dialog is shown.

Definition at line 97 of file dialog_shim.h.

98  {
99  m_initialFocusTarget = aWindow;
100  }
wxWindow * m_initialFocusTarget
Definition: dialog_shim.h:209

References DIALOG_SHIM::m_initialFocusTarget.

Referenced by DIALOG_BOM::DIALOG_BOM(), DIALOG_CHOOSE_FOOTPRINT::DIALOG_CHOOSE_FOOTPRINT(), DIALOG_CHOOSE_SYMBOL::DIALOG_CHOOSE_SYMBOL(), DIALOG_CONFIGURE_PATHS::DIALOG_CONFIGURE_PATHS(), DIALOG_FIND::DIALOG_FIND(), DIALOG_FOOTPRINT_PROPERTIES::DIALOG_FOOTPRINT_PROPERTIES(), DIALOG_FOOTPRINT_PROPERTIES_FP_EDITOR::DIALOG_FOOTPRINT_PROPERTIES_FP_EDITOR(), DIALOG_FP_PLUGIN_OPTIONS::DIALOG_FP_PLUGIN_OPTIONS(), DIALOG_GRAPHIC_ITEM_PROPERTIES::DIALOG_GRAPHIC_ITEM_PROPERTIES(), DIALOG_GRID_SETTINGS::DIALOG_GRID_SETTINGS(), DIALOG_GROUP_PROPERTIES::DIALOG_GROUP_PROPERTIES(), DIALOG_IMPORT_GFX::DIALOG_IMPORT_GFX(), DIALOG_JUNCTION_PROPS::DIALOG_JUNCTION_PROPS(), DIALOG_LIB_SHAPE_PROPERTIES::DIALOG_LIB_SHAPE_PROPERTIES(), DIALOG_LIB_TEXT_PROPERTIES::DIALOG_LIB_TEXT_PROPERTIES(), DIALOG_LINE_WIRE_BUS_PROPERTIES::DIALOG_LINE_WIRE_BUS_PROPERTIES(), DIALOG_PAD_PRIMITIVES_PROPERTIES::DIALOG_PAD_PRIMITIVES_PROPERTIES(), DIALOG_PAD_PROPERTIES::DIALOG_PAD_PROPERTIES(), DIALOG_PIN_PROPERTIES::DIALOG_PIN_PROPERTIES(), DIALOG_POSITION_RELATIVE::DIALOG_POSITION_RELATIVE(), DIALOG_SCH_FIND::DIALOG_SCH_FIND(), DIALOG_SHEET_PIN_PROPERTIES::DIALOG_SHEET_PIN_PROPERTIES(), DIALOG_SYMBOL_FIELDS_TABLE::DIALOG_SYMBOL_FIELDS_TABLE(), DIALOG_TARGET_PROPERTIES::DIALOG_TARGET_PROPERTIES(), DIALOG_TEXT_AND_LABEL_PROPERTIES::DIALOG_TEXT_AND_LABEL_PROPERTIES(), DIALOG_TEXT_PROPERTIES::DIALOG_TEXT_PROPERTIES(), DIALOG_TRACK_VIA_PROPERTIES::DIALOG_TRACK_VIA_PROPERTIES(), EDA_VIEW_SWITCHER::EDA_VIEW_SWITCHER(), HK_PROMPT_DIALOG::HK_PROMPT_DIALOG(), DIALOG_FIELD_PROPERTIES::init(), DIALOG_EXCHANGE_FOOTPRINTS::OnMatchAllClicked(), DIALOG_EXCHANGE_FOOTPRINTS::OnMatchIDClicked(), DIALOG_EXCHANGE_FOOTPRINTS::OnMatchRefClicked(), DIALOG_EXCHANGE_FOOTPRINTS::OnMatchSelectedClicked(), DIALOG_EXCHANGE_FOOTPRINTS::OnMatchValueClicked(), PANEL_FP_LIB_TABLE::PANEL_FP_LIB_TABLE(), PANEL_SYM_LIB_TABLE::PANEL_SYM_LIB_TABLE(), FOOTPRINT_EDIT_FRAME::SaveFootprintAs(), SYMBOL_EDIT_FRAME::saveSymbolAs(), DIALOG_NON_COPPER_ZONES_EDITOR::TransferDataToWindow(), DIALOG_RULE_AREA_PROPERTIES::TransferDataToWindow(), DIALOG_COPPER_ZONE::TransferDataToWindow(), and WX_TEXT_ENTRY_DIALOG::WX_TEXT_ENTRY_DIALOG().

◆ SetKiway()

void KIWAY_HOLDER::SetKiway ( wxWindow *  aDest,
KIWAY aKiway 
)
inherited

It is only used for debugging, since "this" is not a wxWindow*.

"this" is a KIWAY_HOLDER mix-in.

Parameters
aDestis the recipient of aKiway pointer.
aKiwayis often from a parent window or from KIFACE::CreateWindow().

Definition at line 43 of file kiway_holder.cpp.

44 {
45 #if defined(DEBUG)
46  // offer a trap point for debugging most any window
47  wxASSERT( aDest );
48  if( !strcmp( typeid(aDest).name(), "DIALOG_EDIT_LIBENTRY_FIELDS_IN_LIB" ) )
49  {
50  int breakhere=1;
51  ignore_unused( breakhere );
52  }
53 #endif
54 
55  ignore_unused( aDest );
56 
57  m_kiway = aKiway;
58 }
KIWAY * m_kiway
Definition: kiway_holder.h:75
const char * name
Definition: DXF_plotter.cpp:56
void ignore_unused(const T &)
Definition: ignore.h:24

References ignore_unused(), KIWAY_HOLDER::m_kiway, and name.

Referenced by BM2CMP_FRAME::BM2CMP_FRAME(), PCB::IFACE::CreateWindow(), InvokePcbLibTableEditor(), InvokeSchEditSymbolLibTable(), PCB_CALCULATOR_FRAME::PCB_CALCULATOR_FRAME(), and SIM_PLOT_FRAME::SIM_PLOT_FRAME().

◆ setModeColor()

void DIALOG_PLOT_SCHEMATIC::setModeColor ( bool  aColor)
inlineprivate

Definition at line 83 of file dialog_plot_schematic.h.

83 { m_ModeColorOption->SetSelection( aColor ? 0 : 1 ); }

References DIALOG_PLOT_SCHEMATIC_BASE::m_ModeColorOption.

Referenced by initDlg().

◆ setPlotDrawingSheet()

void DIALOG_PLOT_SCHEMATIC::setPlotDrawingSheet ( bool  aPlot)
inlineprivate

Definition at line 95 of file dialog_plot_schematic.h.

95 { m_plotDrawingSheet->SetValue( aPlot ); }

References DIALOG_PLOT_SCHEMATIC_BASE::m_plotDrawingSheet.

Referenced by initDlg().

◆ setPlotOriginAndUnits()

void DIALOG_PLOT_SCHEMATIC::setPlotOriginAndUnits ( HPGL_PLOT_ORIGIN_AND_UNITS  aOriginAndUnits)
inlineprivate

Definition at line 131 of file dialog_plot_schematic.h.

132  {
133  switch( aOriginAndUnits )
134  {
136  default:
137  m_plotOriginOpt->SetSelection( 0 );
138  break;
139 
141  m_plotOriginOpt->SetSelection( 1 );
142  break;
143 
145  m_plotOriginOpt->SetSelection( 2 );
146  break;
147 
149  m_plotOriginOpt->SetSelection( 3 );
150  break;
151  }
152  }

References DIALOG_PLOT_SCHEMATIC_BASE::m_plotOriginOpt, PLOTTER_BOT_LEFT, PLOTTER_CENTER, USER_FIT_CONTENT, and USER_FIT_PAGE.

◆ SetPosition()

void DIALOG_SHIM::SetPosition ( const wxPoint &  aNewPosition)
inherited

Force the position of the dialog to a new position.

Parameters
aNewPositionis the new forced position

Definition at line 190 of file dialog_shim.cpp.

191 {
192  wxDialog::SetPosition( aNewPosition );
193 
194  // Now update the stored position:
195  const char* hash_key;
196 
197  if( m_hash_key.size() )
198  {
199  // a special case like EDA_LIST_DIALOG, which has multiple uses.
200  hash_key = m_hash_key.c_str();
201  }
202  else
203  {
204  hash_key = typeid(*this).name();
205  }
206 
207  std::unordered_map<std::string, wxRect>::iterator it = class_map.find( hash_key );
208 
209  if( it == class_map.end() )
210  return;
211 
212  wxRect rect = it->second;
213  rect.SetPosition( aNewPosition );
214 
215  class_map[ hash_key ] = rect;
216 }
std::string m_hash_key
Definition: dialog_shim.h:199
static std::unordered_map< std::string, wxRect > class_map
void SetPosition(const wxString &aStr, const wxString &aDefaultMeasurementUnit, int *aX, int *aY, const wxString &aActualConversion)

References class_map, DIALOG_SHIM::m_hash_key, and PCAD2KICAD::SetPosition().

Referenced by PCB_BASE_FRAME::SelectOneLayer().

◆ setSizeInDU()

void DIALOG_SHIM::setSizeInDU ( int  x,
int  y 
)
protectedinherited

Set the dialog to the given dimensions in "dialog units".

These are units equivalent to 4* the average character width and 8* the average character height, allowing a dialog to be sized in a way that scales it with the system font.

Definition at line 162 of file dialog_shim.cpp.

163 {
164  wxSize sz( x, y );
165  SetSize( ConvertDialogToPixels( sz ) );
166 }

Referenced by DIALOG_RESCUE_EACH::DIALOG_RESCUE_EACH(), HTML_MESSAGE_BOX::HTML_MESSAGE_BOX(), and HTML_MESSAGE_BOX::SetDialogSizeInDU().

◆ setupPlotPagePDF()

void DIALOG_PLOT_SCHEMATIC::setupPlotPagePDF ( PLOTTER aPlotter,
SCH_SCREEN aScreen 
)
private

Definition at line 921 of file dialog_plot_schematic.cpp.

922 {
923  PAGE_INFO plotPage; // page size selected to plot
924 
925  // Considerations on page size and scaling requests
926  const PAGE_INFO& actualPage = aScreen->GetPageSettings(); // page size selected in schematic
927 
928  switch( m_pageSizeSelect )
929  {
930  case PAGE_SIZE_A:
931  plotPage.SetType( wxT( "A" ) );
932  plotPage.SetPortrait( actualPage.IsPortrait() );
933  break;
934 
935  case PAGE_SIZE_A4:
936  plotPage.SetType( wxT( "A4" ) );
937  plotPage.SetPortrait( actualPage.IsPortrait() );
938  break;
939 
940  case PAGE_SIZE_AUTO:
941  default:
942  plotPage = actualPage;
943  break;
944  }
945 
946  double scalex = (double) plotPage.GetWidthMils() / actualPage.GetWidthMils();
947  double scaley = (double) plotPage.GetHeightMils() / actualPage.GetHeightMils();
948  double scale = std::min( scalex, scaley );
949  aPlotter->SetPageSettings( plotPage );
950 
951  // Currently, plot units are in decimil
952  aPlotter->SetViewport( wxPoint( 0, 0 ), IU_PER_MILS/10, scale, false );
953 }
int GetHeightMils() const
Definition: page_info.h:133
bool SetType(const wxString &aStandardPageDescriptionName, bool aIsPortrait=false)
Set the name of the page type and also the sizes and margins commonly associated with that type name.
Definition: page_info.cpp:119
const PAGE_INFO & GetPageSettings() const
Definition: sch_screen.h:132
Describe the page size and margins of a paper page on which to eventually print or plot.
Definition: page_info.h:53
virtual void SetViewport(const wxPoint &aOffset, double aIusPerDecimil, double aScale, bool aMirror)=0
Set the plot offset and scaling for the current plot.
const int scale
bool IsPortrait() const
Definition: page_info.h:117
#define IU_PER_MILS
Definition: plotter.cpp:136
void SetPortrait(bool aIsPortrait)
Rotate the paper page 90 degrees.
Definition: page_info.cpp:186
int GetWidthMils() const
Definition: page_info.h:130
virtual void SetPageSettings(const PAGE_INFO &aPageSettings)
Definition: plotter.h:158

References PAGE_INFO::GetHeightMils(), SCH_SCREEN::GetPageSettings(), PAGE_INFO::GetWidthMils(), PAGE_INFO::IsPortrait(), IU_PER_MILS, m_pageSizeSelect, PAGE_SIZE_A, PAGE_SIZE_A4, PAGE_SIZE_AUTO, scale, PLOTTER::SetPageSettings(), PAGE_INFO::SetPortrait(), PAGE_INFO::SetType(), and PLOTTER::SetViewport().

Referenced by createPDFFile().

◆ Show()

bool DIALOG_SHIM::Show ( bool  show)
overrideinherited

Definition at line 219 of file dialog_shim.cpp.

220 {
221  bool ret;
222  const char* hash_key;
223 
224  if( m_hash_key.size() )
225  {
226  // a special case like EDA_LIST_DIALOG, which has multiple uses.
227  hash_key = m_hash_key.c_str();
228  }
229  else
230  {
231  hash_key = typeid(*this).name();
232  }
233 
234  // Show or hide the window. If hiding, save current position and size.
235  // If showing, use previous position and size.
236  if( show )
237  {
238 #ifndef __WINDOWS__
239  wxDialog::Raise(); // Needed on OS X and some other window managers (i.e. Unity)
240 #endif
241  ret = wxDialog::Show( show );
242 
243  // classname is key, returns a zeroed out default EDA_RECT if none existed before.
244  wxRect savedDialogRect = class_map[ hash_key ];
245 
246  if( savedDialogRect.GetSize().x != 0 && savedDialogRect.GetSize().y != 0 )
247  {
248  if( m_useCalculatedSize )
249  {
250  SetSize( savedDialogRect.GetPosition().x, savedDialogRect.GetPosition().y,
251  wxDialog::GetSize().x, wxDialog::GetSize().y, 0 );
252  }
253  else
254  {
255  SetSize( savedDialogRect.GetPosition().x, savedDialogRect.GetPosition().y,
256  std::max( wxDialog::GetSize().x, savedDialogRect.GetSize().x ),
257  std::max( wxDialog::GetSize().y, savedDialogRect.GetSize().y ),
258  0 );
259  }
260  }
261  else if( m_initialSize != wxDefaultSize )
262  SetSize( m_initialSize );
263 
264  // Be sure that the dialog appears in a visible area
265  // (the dialog position might have been stored at the time when it was
266  // shown on another display)
267  if( wxDisplay::GetFromWindow( this ) == wxNOT_FOUND )
268  Centre();
269  }
270  else
271  {
272  // Save the dialog's position & size before hiding, using classname as key
273  class_map[ hash_key ] = wxRect( wxDialog::GetPosition(), wxDialog::GetSize() );
274 
275 #ifdef __WXMAC__
276  if ( m_eventLoop )
277  m_eventLoop->Exit( GetReturnCode() ); // Needed for APP-MODAL dlgs on OSX
278 #endif
279 
280  ret = wxDialog::Show( show );
281  }
282 
283  return ret;
284 }
std::string m_hash_key
Definition: dialog_shim.h:199
static std::unordered_map< std::string, wxRect > class_map
bool m_useCalculatedSize
Definition: dialog_shim.h:203
wxSize m_initialSize
Definition: dialog_shim.h:221

References class_map, DIALOG_SHIM::m_hash_key, DIALOG_SHIM::m_initialSize, and DIALOG_SHIM::m_useCalculatedSize.

Referenced by FOOTPRINT_EDITOR_CONTROL::CheckFootprint(), DRC_TOOL::CrossProbe(), DIALOG_SHIM::EndQuasiModal(), GROUP_TOOL::GroupProperties(), EE_INSPECTION_TOOL::NextMarker(), DRC_TOOL::NextMarker(), SCH_EDIT_FRAME::OnAnnotate(), DIALOG_DRC::OnDRCItemDClick(), DIALOG_ERC::OnERCItemDClick(), DIALOG_CLEANUP_GRAPHICS::OnLeftDClickItem(), DIALOG_CLEANUP_TRACKS_AND_VIAS::OnLeftDClickItem(), DIALOG_FOOTPRINT_CHECKER::OnLeftDClickItem(), GROUP_TOOL::PickNewMember(), POSITION_RELATIVE_TOOL::PositionRelative(), EE_INSPECTION_TOOL::PrevMarker(), DRC_TOOL::PrevMarker(), CVPCB_MAINFRAME::ReadNetListAndFpFiles(), EDA_VIEW_SWITCHER::Show(), DIALOG_PAD_PROPERTIES::Show(), DRC_TOOL::ShowDRCDialog(), EE_INSPECTION_TOOL::ShowERCDialog(), SCH_EDIT_FRAME::ShowFindReplaceDialog(), HTML_MESSAGE_BOX::ShowModeless(), DIALOG_SHIM::ShowQuasiModal(), DIALOG_POSITION_RELATIVE::UpdateAnchor(), and SCH_EDIT_FRAME::UpdateHierarchyNavigator().

◆ ShowQuasiModal()

int DIALOG_SHIM::ShowQuasiModal ( )
inherited

Definition at line 423 of file dialog_shim.cpp.

424 {
425  // This is an exception safe way to zero a pointer before returning.
426  // Yes, even though DismissModal() clears this first normally, this is
427  // here in case there's an exception before the dialog is dismissed.
428  struct NULLER
429  {
430  void*& m_what;
431  NULLER( void*& aPtr ) : m_what( aPtr ) {}
432  ~NULLER() { m_what = nullptr; } // indeed, set it to NULL on destruction
433  } clear_this( (void*&) m_qmodal_loop );
434 
435  // release the mouse if it's currently captured as the window having it
436  // will be disabled when this dialog is shown -- but will still keep the
437  // capture making it impossible to do anything in the modal dialog itself
438  wxWindow* win = wxWindow::GetCapture();
439  if( win )
440  win->ReleaseMouse();
441 
442  // Get the optimal parent
443  wxWindow* parent = GetParentForModalDialog( GetParent(), GetWindowStyle() );
444 
445  wxASSERT_MSG( !m_qmodal_parent_disabler,
446  wxT( "Caller using ShowQuasiModal() twice on same window?" ) );
447 
448  // quasi-modal: disable only my "optimal" parent
450 
451  // Apple in its infinite wisdom will raise a disabled window before even passing
452  // us the event, so we have no way to stop it. Instead, we must set an order on
453  // the windows so that the quasi-modal will be pushed in front of the disabled
454  // window when it is raised.
456 
457  Show( true );
458 
459  m_qmodal_showing = true;
460 
461  WX_EVENT_LOOP event_loop;
462 
463  m_qmodal_loop = &event_loop;
464 
465  event_loop.Run();
466 
467  m_qmodal_showing = false;
468 
469  return GetReturnCode();
470 }
bool m_qmodal_showing
Definition: dialog_shim.h:213
#define WX_EVENT_LOOP
Definition: kiway_player.h:41
WX_EVENT_LOOP * m_qmodal_loop
Definition: dialog_shim.h:211
bool Show(bool show) override
WDO_ENABLE_DISABLE * m_qmodal_parent_disabler
Definition: dialog_shim.h:214
Toggle a window's "enable" status to disabled, then enabled on destruction.
Definition: dialog_shim.cpp:44
void ReparentQuasiModal(wxNonOwnedWindow *aWindow)
Move a window's parent to be the top-level window and force the window to be on top.
Definition: gtk/ui.cpp:65

References DIALOG_SHIM::m_qmodal_loop, DIALOG_SHIM::m_qmodal_parent_disabler, DIALOG_SHIM::m_qmodal_showing, KIPLATFORM::UI::ReparentQuasiModal(), DIALOG_SHIM::Show(), and WX_EVENT_LOOP.

Referenced by SCH_EDIT_TOOL::ChangeSymbols(), S3D::Configure3DPaths(), COMMON_CONTROL::ConfigurePaths(), MICROWAVE_TOOL::createFootprint(), MICROWAVE_TOOL::createMicrowaveInductor(), SCH_DRAWING_TOOLS::createNewText(), SYMBOL_EDITOR_EDIT_TOOL::editFieldProperties(), SCH_EDIT_TOOL::editFieldText(), SCH_EDITOR_CONTROL::EditSymbolFields(), SYMBOL_EDITOR_EDIT_TOOL::editSymbolProperties(), GLOBAL_EDIT_TOOL::EditTracksAndVias(), GLOBAL_EDIT_TOOL::ExchangeFootprints(), InvokeCopperZonesEditor(), InvokeDialogCreateBOM(), InvokeDialogEditSymbolsLibId(), InvokeDialogRescueEach(), InvokeNonCopperZonesEditor(), SYMBOL_VIEWER_FRAME::OnSelectSymbol(), SCH_EDIT_FRAME::OpenProjectFiles(), SCH_EDIT_TOOL::Properties(), EDIT_TOOL::Properties(), SCH_EDITOR_CONTROL::RemapSymbols(), S3D::Select3DModel(), PCB_BASE_FRAME::SelectFootprintFromLibTree(), PCB_EDIT_FRAME::ShowBoardSetupDialog(), PCB_EDIT_FRAME::ShowDimensionPropertiesDialog(), PCB_EDIT_FRAME::ShowExchangeFootprintsDialog(), PCB_EDIT_FRAME::ShowFootprintPropertiesDialog(), PCB_BASE_EDIT_FRAME::ShowGraphicItemPropertiesDialog(), PCB_BASE_FRAME::ShowPadPropertiesDialog(), SCH_EDIT_FRAME::ShowSchematicSetupDialog(), and PCB_BASE_EDIT_FRAME::ShowTextPropertiesDialog().

◆ vertPixelsFromDU()

int DIALOG_SHIM::vertPixelsFromDU ( int  y) const
protectedinherited

Convert an integer number of dialog units to pixels, vertically.

See SetSizeInDU or wxDialog documentation for more information.

Definition at line 176 of file dialog_shim.cpp.

177 {
178  wxSize sz( 0, y );
179  return ConvertDialogToPixels( sz ).y;
180 }

Referenced by DIALOG_CHOOSE_SYMBOL::DIALOG_CHOOSE_SYMBOL().

Member Data Documentation

◆ m_browseButton

wxBitmapButton* DIALOG_PLOT_SCHEMATIC_BASE::m_browseButton
protectedinherited

◆ m_colorTheme

wxChoice* DIALOG_PLOT_SCHEMATIC_BASE::m_colorTheme
protectedinherited

◆ m_configChanged

bool DIALOG_PLOT_SCHEMATIC::m_configChanged
private

◆ m_defaultLineWidth

UNIT_BINDER DIALOG_PLOT_SCHEMATIC::m_defaultLineWidth
private

Definition at line 210 of file dialog_plot_schematic.h.

Referenced by getPlotOptions(), initDlg(), and OnUpdateUI().

◆ m_firstPaintEvent

bool DIALOG_SHIM::m_firstPaintEvent
protectedinherited

Definition at line 208 of file dialog_shim.h.

Referenced by DIALOG_SHIM::OnPaint().

◆ m_hash_key

◆ m_HPGLOptionsSizer

wxStaticBoxSizer* DIALOG_PLOT_SCHEMATIC_BASE::m_HPGLOptionsSizer
protectedinherited

◆ m_HPGLPaperSizeSelect

int DIALOG_PLOT_SCHEMATIC::m_HPGLPaperSizeSelect = PAGE_SIZE_AUTO
staticprivate

Definition at line 207 of file dialog_plot_schematic.h.

Referenced by getPlotOptions(), initDlg(), OnPageSizeSelected(), and OnUpdateUI().

◆ m_HPGLPenSize

double DIALOG_PLOT_SCHEMATIC::m_HPGLPenSize
private

◆ m_initialFocusTarget

wxWindow* DIALOG_SHIM::m_initialFocusTarget
protectedinherited

Definition at line 209 of file dialog_shim.h.

Referenced by DIALOG_SHIM::OnPaint(), and DIALOG_SHIM::SetInitialFocus().

◆ m_initialSize

wxSize DIALOG_SHIM::m_initialSize
protectedinherited

Definition at line 221 of file dialog_shim.h.

Referenced by DIALOG_SHIM::Show().

◆ m_lineWidthCtrl

wxTextCtrl* DIALOG_PLOT_SCHEMATIC_BASE::m_lineWidthCtrl
protectedinherited

◆ m_lineWidthLabel

wxStaticText* DIALOG_PLOT_SCHEMATIC_BASE::m_lineWidthLabel
protectedinherited

◆ m_lineWidthUnits

wxStaticText* DIALOG_PLOT_SCHEMATIC_BASE::m_lineWidthUnits
protectedinherited

◆ m_MessagesBox

◆ m_ModeColorOption

wxChoice* DIALOG_PLOT_SCHEMATIC_BASE::m_ModeColorOption
protectedinherited

◆ m_optionsSizer

wxBoxSizer* DIALOG_PLOT_SCHEMATIC_BASE::m_optionsSizer
protectedinherited

◆ m_outputDirectoryName

wxTextCtrl* DIALOG_PLOT_SCHEMATIC_BASE::m_outputDirectoryName
protectedinherited

◆ m_pageSizeSelect

int DIALOG_PLOT_SCHEMATIC::m_pageSizeSelect = PAGE_SIZE_AUTO
staticprivate

◆ m_paperSizeOption

wxChoice* DIALOG_PLOT_SCHEMATIC_BASE::m_paperSizeOption
protectedinherited

◆ m_parent

◆ m_parentFrame

EDA_BASE_FRAME* DIALOG_SHIM::m_parentFrame
protectedinherited

◆ m_penWidth

UNIT_BINDER DIALOG_PLOT_SCHEMATIC::m_penWidth
private

Definition at line 211 of file dialog_plot_schematic.h.

Referenced by getPlotOptions(), initDlg(), OnUpdateUI(), and setHpglPenWidth().

◆ m_penWidthCtrl

wxTextCtrl* DIALOG_PLOT_SCHEMATIC_BASE::m_penWidthCtrl
protectedinherited

◆ m_penWidthLabel

wxStaticText* DIALOG_PLOT_SCHEMATIC_BASE::m_penWidthLabel
protectedinherited

◆ m_penWidthUnits

wxStaticText* DIALOG_PLOT_SCHEMATIC_BASE::m_penWidthUnits
protectedinherited

◆ m_plotBackgroundColor

wxCheckBox* DIALOG_PLOT_SCHEMATIC_BASE::m_plotBackgroundColor
protectedinherited

◆ m_plotDrawingSheet

wxCheckBox* DIALOG_PLOT_SCHEMATIC_BASE::m_plotDrawingSheet
protectedinherited

◆ m_plotFormat

PLOT_FORMAT DIALOG_PLOT_SCHEMATIC::m_plotFormat
private

Definition at line 205 of file dialog_plot_schematic.h.

Referenced by OnUpdateUI().

◆ m_plotFormatOpt

wxRadioBox* DIALOG_PLOT_SCHEMATIC_BASE::m_plotFormatOpt
protectedinherited

◆ m_plotOriginOpt

wxChoice* DIALOG_PLOT_SCHEMATIC_BASE::m_plotOriginOpt
protectedinherited

◆ m_plotOriginTitle

wxStaticText* DIALOG_PLOT_SCHEMATIC_BASE::m_plotOriginTitle
protectedinherited

◆ m_qmodal_loop

WX_EVENT_LOOP* DIALOG_SHIM::m_qmodal_loop
protectedinherited

Definition at line 211 of file dialog_shim.h.

Referenced by DIALOG_SHIM::EndQuasiModal(), and DIALOG_SHIM::ShowQuasiModal().

◆ m_qmodal_parent_disabler

WDO_ENABLE_DISABLE* DIALOG_SHIM::m_qmodal_parent_disabler
protectedinherited

◆ m_qmodal_showing

bool DIALOG_SHIM::m_qmodal_showing
protectedinherited

Definition at line 213 of file dialog_shim.h.

Referenced by DIALOG_SHIM::IsQuasiModal(), and DIALOG_SHIM::ShowQuasiModal().

◆ m_sdbSizer1

wxStdDialogButtonSizer* DIALOG_PLOT_SCHEMATIC_BASE::m_sdbSizer1
protectedinherited

◆ m_sdbSizer1Apply

wxButton* DIALOG_PLOT_SCHEMATIC_BASE::m_sdbSizer1Apply
protectedinherited

◆ m_sdbSizer1Cancel

wxButton* DIALOG_PLOT_SCHEMATIC_BASE::m_sdbSizer1Cancel
protectedinherited

◆ m_sdbSizer1OK

wxButton* DIALOG_PLOT_SCHEMATIC_BASE::m_sdbSizer1OK
protectedinherited

◆ m_staticText4

wxStaticText* DIALOG_PLOT_SCHEMATIC_BASE::m_staticText4
protectedinherited

◆ m_staticText9

wxStaticText* DIALOG_PLOT_SCHEMATIC_BASE::m_staticText9
protectedinherited

◆ m_staticTextOutputDirectory

wxStaticText* DIALOG_PLOT_SCHEMATIC_BASE::m_staticTextOutputDirectory
protectedinherited

◆ m_tabOrder

◆ m_units

◆ m_useCalculatedSize

bool DIALOG_SHIM::m_useCalculatedSize
protectedinherited

The documentation for this class was generated from the following files: