kicad-patches/cmdline-common.patch |
| 1 | diff -ru kicad.orig/include/appl_wxstruct.h kicad/include/appl_wxstruct.h |
| 2 | --- kicad.orig/include/appl_wxstruct.h 2012-01-02 15:12:29.461843000 +0100 |
| 3 | @@ -52,6 +52,7 @@ |
| 4 | class wxSingleInstanceChecker; |
| 5 | class wxHtmlHelpController; |
| 6 | |
| 7 | +extern bool g_CmdLineMode; |
| 8 | |
| 9 | /** |
| 10 | * Class EDA_APP |
| 11 | @@ -185,6 +186,8 @@ |
| 12 | */ |
| 13 | void InitEDA_Appl( const wxString& aName, EDA_APP_T aId = APP_UNKNOWN_T ); |
| 14 | |
| 15 | + virtual int OnRun() { return g_CmdLineMode ? 0 : wxApp::OnRun(); } |
| 16 | + |
| 17 | /** |
| 18 | * Function SetLanguage |
| 19 | * sets the dictionary file name for internationalization. |
| 20 | diff -ru kicad.orig/include/wxBasePcbFrame.h kicad/include/wxBasePcbFrame.h |
| 21 | --- kicad.orig/include/wxBasePcbFrame.h 2012-01-02 15:12:29.461843000 +0100 |
| 22 | @@ -520,6 +520,7 @@ |
| 23 | |
| 24 | bool ExportToDxfFile( const wxString& aFullFileName, |
| 25 | int aLayer, |
| 26 | + bool aPlotOriginIsAuxAxis, |
| 27 | GRTraceMode aTraceMode ); |
| 28 | |
| 29 | void Plot_Layer( PLOTTER* plotter, |
| 30 | diff -ru kicad.orig/include/wxEeschemaStruct.h kicad/include/wxEeschemaStruct.h |
| 31 | --- kicad.orig/include/wxEeschemaStruct.h 2012-01-02 15:12:29.461843000 +0100 |
| 32 | @@ -585,6 +585,8 @@ |
| 33 | void SVG_Print( wxCommandEvent& event ); |
| 34 | |
| 35 | // Plot functions: |
| 36 | + void CmdLineToPlot_PS( bool PlotBW, bool PlotSheetRef ); |
| 37 | + void CmdLineToPlot_DXF( bool PlotBW, bool PlotSheetRef ); |
| 38 | void ToPlot_PS( wxCommandEvent& event ); |
| 39 | void ToPlot_HPGL( wxCommandEvent& event ); |
| 40 | void ToPlot_DXF( wxCommandEvent& event ); |
| 41 | diff -ru kicad.orig/include/wxPcbStruct.h kicad/include/wxPcbStruct.h |
| 42 | --- kicad.orig/include/wxPcbStruct.h 2012-01-02 15:12:29.461843000 +0100 |
| 43 | @@ -75,6 +75,7 @@ |
| 44 | class PCB_EDIT_FRAME : public PCB_BASE_FRAME |
| 45 | { |
| 46 | friend class PCB_LAYER_WIDGET; |
| 47 | + friend bool Pcbnew_CmdLine(); |
| 48 | |
| 49 | void updateTraceWidthSelectBox(); |
| 50 | void updateViaSizeSelectBox(); |
1 | 51 | diff -ru kicad.orig/common/confirm.cpp kicad/common/confirm.cpp |
2 | 52 | --- kicad.orig/common/confirm.cpp 2012-01-02 15:12:29.461843000 +0100 |
3 | 53 | +++ kicad/common/confirm.cpp 2012-01-04 00:59:04.412020890 +0100 |
... | ... | |
57 | 111 | m_Checker = new wxSingleInstanceChecker( aName.Lower() + wxT( "-" ) + wxGetUserId() ); |
58 | 112 | |
59 | 113 | /* Init KiCad environment |
60 | | diff -ru kicad.orig/include/appl_wxstruct.h kicad/include/appl_wxstruct.h |
61 | | +++ kicad/include/appl_wxstruct.h 2012-01-04 00:58:00.447684901 +0100 |
62 | | @@ -52,6 +52,7 @@ |
63 | | class wxSingleInstanceChecker; |
64 | | class wxHtmlHelpController; |
65 | | |
66 | | +extern bool g_CmdLineMode; |
67 | | |
68 | | /** |
69 | | * Class EDA_APP |
70 | | @@ -185,6 +186,8 @@ |
71 | | */ |
72 | | void InitEDA_Appl( const wxString& aName, EDA_APP_T aId = APP_UNKNOWN_T ); |
73 | | |
74 | | + virtual int OnRun() { return g_CmdLineMode ? 0 : wxApp::OnRun(); } |
75 | | + |
76 | | /** |
77 | | * Function SetLanguage |
78 | | * sets the dictionary file name for internationalization. |
79 | | diff -ru kicad.orig/include/wxEeschemaStruct.h kicad/include/wxEeschemaStruct.h |
80 | | +++ kicad/include/wxEeschemaStruct.h 2012-01-04 02:04:17.560214904 +0100 |
81 | | @@ -585,6 +585,8 @@ |
82 | | void SVG_Print( wxCommandEvent& event ); |
83 | | |
84 | | // Plot functions: |
85 | | + void CmdLineToPlot_PS( bool PlotBW, bool PlotSheetRef ); |
86 | | + void CmdLineToPlot_DXF( bool PlotBW, bool PlotSheetRef ); |
87 | | void ToPlot_PS( wxCommandEvent& event ); |
88 | | void ToPlot_HPGL( wxCommandEvent& event ); |
89 | | void ToPlot_DXF( wxCommandEvent& event ); |
90 | | diff -ru kicad.orig/include/wxPcbStruct.h kicad/include/wxPcbStruct.h |
91 | | +++ kicad/include/wxPcbStruct.h 2012-01-10 17:49:51.848114042 +0100 |
92 | | @@ -75,6 +75,7 @@ |
93 | | class PCB_EDIT_FRAME : public PCB_BASE_FRAME |
94 | | { |
95 | | friend class PCB_LAYER_WIDGET; |
96 | | + friend bool Pcbnew_CmdLine(); |
97 | | |
98 | | void updateTraceWidthSelectBox(); |
99 | | void updateViaSizeSelectBox(); |
kicad-patches/cmdline-new.patch |
262 | 262 | + |
263 | 263 | +bool Pcbnew_CmdLine(); |
264 | 264 | --- /dev/null 2012-01-06 01:10:09.493787641 +0100 |
265 | | +++ kicad/pcbnew/pcbnew_cmdline.cpp 2012-01-10 22:52:01.869091302 +0100 |
266 | | @@ -0,0 +1,525 @@ |
| 265 | @@ -0,0 +1,526 @@ |
267 | 266 | +///////////////////////////////////////////////////////////////////////////// |
268 | 267 | +// Name: pcbnew_cmdline.cpp |
269 | 268 | +// Copyright: Wolfgang Spraul |
... | ... | |
323 | 323 | + |
324 | 324 | + { wxCMD_LINE_SWITCH, 0, wxT("drill"), |
325 | 325 | + wxT("File -> Fabrication -> Drill File (.drl)") }, |
326 | | + { wxCMD_LINE_SWITCH, 0, wxT("drill-origin-aux"), |
| 326 | + { wxCMD_LINE_SWITCH, 0, wxT("drill-aux-origin"), |
327 | 327 | + wxT(" Use aux axis as origin (def: abs)\n") }, |
328 | 328 | + |
329 | 329 | + { wxCMD_LINE_OPTION, 0, wxT("plot"), |
330 | 330 | + wxT("File -> Plot [gerber|ps|dxf]"), |
331 | 331 | + wxCMD_LINE_VAL_STRING }, |
332 | 332 | + { wxCMD_LINE_SWITCH, 0, wxT("plot-fill-all-zones"), |
333 | | + wxT(" fill zones before plotting (not in the dialog)") }, |
| 333 | + wxT(" Fill zones before plotting (not in the dialog)") }, |
334 | 334 | + { wxCMD_LINE_OPTION, 0, wxT("plot-drill-marks"), |
335 | 335 | + wxT(" Drill marks [none|small|actual] (def: small)"), |
336 | 336 | + wxCMD_LINE_VAL_STRING }, |
337 | 337 | + { wxCMD_LINE_SWITCH, 0, wxT("plot-mirror"), |
338 | | + wxT(" Mirrored plot (Postscript only)") }, |
339 | | + { wxCMD_LINE_SWITCH, 0, wxT("plot-ps-force-a4"), |
| 338 | + wxT(" Postscript: Mirrored plot") }, |
| 339 | + { wxCMD_LINE_SWITCH, 0, wxT("plot-force-a4"), |
340 | 340 | + wxT(" Postscript: Force A4 output") }, |
341 | | + { wxCMD_LINE_SWITCH, 0, wxT("plot-gb-ex-pcb-edge"), |
342 | | + wxT(" Gerber: exclude PCB edge") }, |
343 | | + { wxCMD_LINE_SWITCH, 0, wxT("plot-gb-aux-origin"), |
344 | | + wxT(" Gerber: Use aux axis as origin (def: abs)\n") }, |
| 341 | + { wxCMD_LINE_SWITCH, 0, wxT("plot-aux-origin"), |
| 342 | + wxT(" Gerber & DXF: Aux axis as origin (def: abs)") }, |
| 343 | + { wxCMD_LINE_SWITCH, 0, wxT("plot-exclude-edge"), |
| 344 | + wxT(" Gerber: Exclude PCB edge\n") }, |
345 | 345 | + |
346 | 346 | + { wxCMD_LINE_OPTION, 0, wxT("svg"), |
347 | 347 | + wxT("File -> Print SVG [selected|board]"), |
... | ... | |
448 | 448 | + { |
449 | 449 | + DIALOG_GENDRILL drill_frame( frame ); |
450 | 450 | + drill_frame.m_Choice_Drill_Offset->SetSelection( |
451 | | + parser.Found( wxT("drill-origin-aux") ) ); |
| 451 | + parser.Found( wxT("drill-aux-origin") ) ); |
452 | 452 | + wxSafeYield(); |
453 | 453 | + drill_frame.GenDrillAndReportFiles(); |
454 | 454 | + } |
... | ... | |
506 | 506 | + // --plot-mirror |
507 | 507 | + g_PcbPlotOptions.m_PlotMirror = parser.Found( wxT("plot-mirror") ); |
508 | 508 | + |
509 | | + // --plot-gb-ex-pcb-edge |
| 509 | + // --plot-exclude-edge |
510 | 510 | + g_PcbPlotOptions.m_ExcludeEdgeLayer = |
511 | | + parser.Found( wxT("plot-gb-ex-pcb-edge") ); |
| 511 | + parser.Found( wxT("plot-exclude-edge") ); |
512 | 512 | + |
513 | 513 | + parser.Found( wxT("layers"), &layers_str ); |
514 | 514 | + wxStringTokenizer tokenizer( layers_str, _(",") ); |
... | ... | |
637 | 637 | + case PLOT_FORMAT_POST: |
638 | 638 | + success = frame->ExportToPostScriptFile( fn.GetFullPath(), |
639 | 639 | + layer_i, |
640 | | + parser.Found( wxT("plot-ps-force-a4") ), |
| 640 | + parser.Found( wxT("plot-force-a4") ), |
641 | 641 | + FILLED /* trace_mode */ ); |
642 | 642 | + break; |
643 | 643 | + |
644 | 644 | + case PLOT_FORMAT_GERBER: |
645 | 645 | + success = frame->ExportToGerberFile( fn.GetFullPath(), layer_i, |
646 | | + parser.Found( wxT("plot-gb-aux-origin") ), |
| 646 | + parser.Found( wxT("plot-aux-origin") ), |
647 | 647 | + FILLED /* trace_mode */ ); |
648 | 648 | + break; |
649 | 649 | + |
650 | 650 | + case PLOT_FORMAT_DXF: |
651 | 651 | + success = frame->ExportToDxfFile( fn.GetFullPath(), layer_i, |
| 652 | + parser.Found( wxT("plot-aux-origin") ), |
652 | 653 | + FILLED /* trace_mode */ ); |
653 | 654 | + break; |
654 | 655 | + } |
kicad-patches/cmdline-pcbnew.patch |
162 | 162 | extern bool Drc_On; |
163 | 163 | extern bool g_AutoDeleteOldTrack; |
164 | 164 | extern bool g_Drag_Pistes_On; |
| 165 | diff -ru kicad.orig/pcbnew/pcbplot.cpp kicad/pcbnew/pcbplot.cpp |
| 166 | --- kicad.orig/pcbnew/pcbplot.cpp 2012-01-02 15:12:29.461843000 +0100 |
| 167 | @@ -774,6 +774,7 @@ |
| 168 | |
| 169 | case PLOT_FORMAT_DXF: |
| 170 | success = m_Parent->ExportToDxfFile( fn.GetFullPath(), layer, |
| 171 | + false, |
| 172 | g_PcbPlotOptions.m_PlotMode ); |
| 173 | break; |
| 174 | } |
| 175 | diff -ru kicad.orig/pcbnew/plotdxf.cpp kicad/pcbnew/plotdxf.cpp |
| 176 | --- kicad.orig/pcbnew/plotdxf.cpp 2012-01-02 15:12:29.461843000 +0100 |
| 177 | @@ -16,7 +16,7 @@ |
| 178 | |
| 179 | |
| 180 | bool PCB_BASE_FRAME::ExportToDxfFile( const wxString& aFullFileName, int aLayer, |
| 181 | - GRTraceMode aTraceMode ) |
| 182 | + bool aPlotOriginIsAuxAxis, GRTraceMode aTraceMode ) |
| 183 | { |
| 184 | Ki_PageDescr* currentsheet = GetScreen()->m_CurrentSheetDesc; |
| 185 | |
| 186 | @@ -27,11 +27,23 @@ |
| 187 | return false; |
| 188 | } |
| 189 | |
| 190 | + wxPoint offset; |
| 191 | + |
| 192 | + if( aPlotOriginIsAuxAxis ) |
| 193 | + { |
| 194 | + offset = m_originAxisPosition; |
| 195 | + } |
| 196 | + else |
| 197 | + { |
| 198 | + offset.x = 0; |
| 199 | + offset.y = 0; |
| 200 | + } |
| 201 | + |
| 202 | SetLocaleTo_C_standard(); |
| 203 | |
| 204 | DXF_PLOTTER* plotter = new DXF_PLOTTER(); |
| 205 | plotter->set_paper_size( currentsheet ); |
| 206 | - plotter->set_viewport( wxPoint( 0, 0 ), 1, 0 ); |
| 207 | + plotter->set_viewport( offset, 1, 0 ); |
| 208 | plotter->set_creator( wxT( "PCBNEW-DXF" ) ); |
| 209 | plotter->set_filename( aFullFileName ); |
| 210 | plotter->start_plot( output_file ); |
165 | 211 | diff -ru kicad.orig/pcbnew/xchgmod.cpp kicad/pcbnew/xchgmod.cpp |
166 | 212 | --- kicad.orig/pcbnew/xchgmod.cpp 2012-01-02 15:12:29.461843000 +0100 |
167 | 213 | +++ kicad/pcbnew/xchgmod.cpp 2012-01-05 21:47:50.531456715 +0100 |