You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

103 lines
4.3 KiB

  1. /*
  2. * This program source code file is part of KiCad, a free EDA CAD application.
  3. *
  4. * Copyright (C) 1992-2022 KiCad Developers, see AUTHORS.txt for contributors.
  5. *
  6. * This program is free software; you can redistribute it and/or
  7. * modify it under the terms of the GNU General Public License
  8. * as published by the Free Software Foundation; either version 2
  9. * of the License, or (at your option) any later version.
  10. *
  11. * This program is distributed in the hope that it will be useful,
  12. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  13. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  14. * GNU General Public License for more details.
  15. *
  16. * You should have received a copy of the GNU General Public License
  17. * along with this program; if not, you may find one here:
  18. * http://www.gnu.org/licenses/old-licenses/gpl-2.0.html
  19. * or you may search the http://www.gnu.org website for the version 2 license,
  20. * or you may write to the Free Software Foundation, Inc.,
  21. * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
  22. */
  23. #include <board.h>
  24. #include <dialog_plot_base.h>
  25. #include <pcb_plot_params.h>
  26. #include <widgets/unit_binder.h>
  27. // the plot dialog window name, used by wxWidgets
  28. #define DLG_WINDOW_NAME wxT( "plot_dialog-window" )
  29. class wxRearrangeList;
  30. class wxBitmapButton;
  31. /**
  32. * A dialog to set the plot options and create plot files in various formats.
  33. */
  34. class DIALOG_PLOT : public DIALOG_PLOT_BASE
  35. {
  36. public:
  37. DIALOG_PLOT( PCB_EDIT_FRAME* parent );
  38. virtual ~DIALOG_PLOT();
  39. private:
  40. // Event called functions
  41. void Plot( wxCommandEvent& event ) override;
  42. void OnOutputDirectoryBrowseClicked( wxCommandEvent& event ) override;
  43. void OnRightClick( wxMouseEvent& event ) override;
  44. void OnPopUpLayers( wxCommandEvent& event ) override;
  45. void SetPlotFormat( wxCommandEvent& event ) override;
  46. void OnChangeDXFPlotMode( wxCommandEvent& event ) override;
  47. void OnSetScaleOpt( wxCommandEvent& event ) override;
  48. void CreateDrillFile( wxCommandEvent& event ) override;
  49. void OnGerberX2Checked( wxCommandEvent& event ) override;
  50. void onRunDRC( wxCommandEvent& event ) override;
  51. void onBoardSetup( wxHyperlinkEvent& aEvent ) override;
  52. void onPlotAllListMoveUp( wxCommandEvent& aEvent );
  53. void onPlotAllListMoveDown( wxCommandEvent& aEvent );
  54. // other functions
  55. void init_Dialog(); // main initialization
  56. void reInitDialog(); // initialization after calling drill dialog
  57. void applyPlotSettings();
  58. PLOT_FORMAT getPlotFormat();
  59. void setPlotModeChoiceSelection( OUTLINE_MODE aPlotMode )
  60. {
  61. m_plotModeOpt->SetSelection( aPlotMode == SKETCH ? 1 : 0 );
  62. }
  63. PCB_EDIT_FRAME* m_parent;
  64. LSEQ m_layerList; // List to hold CheckListBox layer numbers
  65. double m_XScaleAdjust; // X scale factor adjust to compensate
  66. // plotter X scaling error
  67. double m_YScaleAdjust; // X scale factor adjust to compensate
  68. // plotter Y scaling error
  69. int m_PSWidthAdjust; // Global width correction for exact line width
  70. // in postscript output.
  71. // this is a correction factor for tracks width
  72. // when plotted
  73. int m_widthAdjustMinValue; // Global track width limits
  74. int m_widthAdjustMaxValue; // tracks width will be "clipped" whenever the
  75. // m_PSWidthAdjust to these limits.
  76. UNIT_BINDER m_defaultPenSize;
  77. UNIT_BINDER m_trackWidthCorrection;
  78. wxString m_DRCWarningTemplate;
  79. PCB_PLOT_PARAMS m_plotOpts;
  80. wxRearrangeList* m_plotAllLayersList;
  81. wxBitmapButton* m_bpMoveUp;
  82. wxBitmapButton* m_bpMoveDown;
  83. /// The plot layer set that last time the dialog was opened.
  84. static LSET m_lastLayerSet;
  85. /// The plot on all layers ordering the last time the dialog was opened.
  86. static LSEQ m_lastPlotOnAllLayersOrder;
  87. };