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.

111 lines
4.4 KiB

  1. /*
  2. * This program source code file is part of KiCad, a free EDA CAD application.
  3. *
  4. * Copyright (C) 1992-2023 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 OnRightClickLayers( wxMouseEvent& event );
  44. void OnRightClickAllLayers( wxMouseEvent& event );
  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. void onDNPCheckbox( wxCommandEvent& event ) override;
  55. void onSketchPads( wxCommandEvent& event ) override;
  56. // other functions
  57. void init_Dialog(); // main initialization
  58. void reInitDialog(); // initialization after calling drill dialog
  59. void applyPlotSettings();
  60. PLOT_FORMAT getPlotFormat();
  61. void setPlotModeChoiceSelection( OUTLINE_MODE aPlotMode )
  62. {
  63. m_plotModeOpt->SetSelection( aPlotMode == SKETCH ? 1 : 0 );
  64. }
  65. void arrangeAllLayersList( const LSEQ& aSeq );
  66. private:
  67. PCB_EDIT_FRAME* m_parent;
  68. LSEQ m_layerList; // List to hold CheckListBox layer numbers
  69. double m_XScaleAdjust; // X scale factor adjust to compensate
  70. // plotter X scaling error
  71. double m_YScaleAdjust; // X scale factor adjust to compensate
  72. // plotter Y scaling error
  73. int m_PSWidthAdjust; // Global width correction for exact line width
  74. // in postscript output.
  75. // this is a correction factor for tracks width
  76. // when plotted
  77. int m_widthAdjustMinValue; // Global track width limits
  78. int m_widthAdjustMaxValue; // tracks width will be "clipped" whenever the
  79. // m_PSWidthAdjust to these limits.
  80. UNIT_BINDER m_defaultPenSize;
  81. UNIT_BINDER m_trackWidthCorrection;
  82. wxString m_DRCWarningTemplate;
  83. PCB_PLOT_PARAMS m_plotOpts;
  84. wxRearrangeList* m_plotAllLayersList;
  85. STD_BITMAP_BUTTON* m_bpMoveUp;
  86. STD_BITMAP_BUTTON* m_bpMoveDown;
  87. /// The plot layer set that last time the dialog was opened.
  88. static LSET s_lastLayerSet;
  89. static LSET s_lastAllLayersSet;
  90. /// The plot on all layers ordering the last time the dialog was opened.
  91. static LSEQ s_lastAllLayersOrder;
  92. };