Date:2012-01-11 11:50:47 (12 years 2 months ago)
Author:Wolfgang Spraul
Commit:724ca1e3ec1808eaad9a55c1d2783cbd52c2e37a
Message:patch cleanup

Files: kicad-patches/cmdline-common.patch (2 diffs)
kicad-patches/cmdline-eeschema.patch (1 diff)
kicad-patches/cmdline-new.patch (5 diffs)
kicad-patches/cmdline-pcbnew.patch (1 diff)
kicad-patches/kicad_diff.sh (1 diff)
kicad-patches/series (1 diff)

Change Details

kicad-patches/cmdline-common.patch
1diff -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.
20diff -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,
30diff -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 );
41diff -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();
151diff -ru kicad.orig/common/confirm.cpp kicad/common/confirm.cpp
252--- kicad.orig/common/confirm.cpp 2012-01-02 15:12:29.461843000 +0100
353+++ kicad/common/confirm.cpp 2012-01-04 00:59:04.412020890 +0100
...... 
57111     m_Checker = new wxSingleInstanceChecker( aName.Lower() + wxT( "-" ) + wxGetUserId() );
58112
59113     /* Init KiCad environment
60diff -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.
79diff -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 );
90diff -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-eeschema.patch
122122--- kicad.orig/eeschema/dialogs/dialog_SVG_print.h 2012-01-02 15:12:29.461843000 +0100
123123+++ kicad/eeschema/dialogs/dialog_SVG_print.h 2012-01-04 01:03:17.627432139 +0100
124124@@ -12,6 +12,7 @@
125
126 class DIALOG_SVG_PRINT : public DIALOG_SVG_PRINT_base
127 {
128+friend void CmdLinePrintSVGDoc( EDA_DRAW_FRAME* frame, bool aPrintAll, bool aPrint_Sheet_Ref, bool aPrintBlackAndWhite );
129 private:
130     EDA_DRAW_FRAME* m_Parent;
131     wxConfig* m_Config;
132@@ -37,5 +38,4 @@
133                              bool aPrint_Sheet_Ref = false );
134 };
135
136-
137 #endif // _DIALOG_SVG_PRINT_H_
125
126 class DIALOG_SVG_PRINT : public DIALOG_SVG_PRINT_base
127 {
128+friend void CmdLinePrintSVGDoc( EDA_DRAW_FRAME* frame, bool aPrintAll, bool aPrint_Sheet_Ref, bool aPrintBlackAndWhite );
129 private:
130     EDA_DRAW_FRAME* m_Parent;
131     wxConfig* m_Config;
138132diff -ru kicad.orig/eeschema/eeschema.cpp kicad/eeschema/eeschema.cpp
139133--- kicad.orig/eeschema/eeschema.cpp 2012-01-02 15:12:29.461843000 +0100
140134+++ kicad/eeschema/eeschema.cpp 2012-01-04 01:05:55.083907033 +0100
kicad-patches/cmdline-new.patch
262262+
263263+bool Pcbnew_CmdLine();
264264--- /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 @@
267266+/////////////////////////////////////////////////////////////////////////////
268267+// Name: pcbnew_cmdline.cpp
269268+// Copyright: Wolfgang Spraul
...... 
323323+
324324+ { wxCMD_LINE_SWITCH, 0, wxT("drill"),
325325+ wxT("File -> Fabrication -> Drill File (.drl)") },
326+ { wxCMD_LINE_SWITCH, 0, wxT("drill-origin-aux"),
326+ { wxCMD_LINE_SWITCH, 0, wxT("drill-aux-origin"),
327327+ wxT(" Use aux axis as origin (def: abs)\n") },
328328+
329329+ { wxCMD_LINE_OPTION, 0, wxT("plot"),
330330+ wxT("File -> Plot [gerber|ps|dxf]"),
331331+ wxCMD_LINE_VAL_STRING },
332332+ { 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)") },
334334+ { wxCMD_LINE_OPTION, 0, wxT("plot-drill-marks"),
335335+ wxT(" Drill marks [none|small|actual] (def: small)"),
336336+ wxCMD_LINE_VAL_STRING },
337337+ { 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"),
340340+ 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") },
345345+
346346+ { wxCMD_LINE_OPTION, 0, wxT("svg"),
347347+ wxT("File -> Print SVG [selected|board]"),
...... 
448448+ {
449449+ DIALOG_GENDRILL drill_frame( frame );
450450+ drill_frame.m_Choice_Drill_Offset->SetSelection(
451+ parser.Found( wxT("drill-origin-aux") ) );
451+ parser.Found( wxT("drill-aux-origin") ) );
452452+ wxSafeYield();
453453+ drill_frame.GenDrillAndReportFiles();
454454+ }
...... 
506506+ // --plot-mirror
507507+ g_PcbPlotOptions.m_PlotMirror = parser.Found( wxT("plot-mirror") );
508508+
509+ // --plot-gb-ex-pcb-edge
509+ // --plot-exclude-edge
510510+ g_PcbPlotOptions.m_ExcludeEdgeLayer =
511+ parser.Found( wxT("plot-gb-ex-pcb-edge") );
511+ parser.Found( wxT("plot-exclude-edge") );
512512+
513513+ parser.Found( wxT("layers"), &layers_str );
514514+ wxStringTokenizer tokenizer( layers_str, _(",") );
...... 
637637+ case PLOT_FORMAT_POST:
638638+ success = frame->ExportToPostScriptFile( fn.GetFullPath(),
639639+ layer_i,
640+ parser.Found( wxT("plot-ps-force-a4") ),
640+ parser.Found( wxT("plot-force-a4") ),
641641+ FILLED /* trace_mode */ );
642642+ break;
643643+
644644+ case PLOT_FORMAT_GERBER:
645645+ success = frame->ExportToGerberFile( fn.GetFullPath(), layer_i,
646+ parser.Found( wxT("plot-gb-aux-origin") ),
646+ parser.Found( wxT("plot-aux-origin") ),
647647+ FILLED /* trace_mode */ );
648648+ break;
649649+
650650+ case PLOT_FORMAT_DXF:
651651+ success = frame->ExportToDxfFile( fn.GetFullPath(), layer_i,
652+ parser.Found( wxT("plot-aux-origin") ),
652653+ FILLED /* trace_mode */ );
653654+ break;
654655+ }
kicad-patches/cmdline-pcbnew.patch
162162 extern bool Drc_On;
163163 extern bool g_AutoDeleteOldTrack;
164164 extern bool g_Drag_Pistes_On;
165diff -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             }
175diff -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 );
165211diff -ru kicad.orig/pcbnew/xchgmod.cpp kicad/pcbnew/xchgmod.cpp
166212--- kicad.orig/pcbnew/xchgmod.cpp 2012-01-02 15:12:29.461843000 +0100
167213+++ kicad/pcbnew/xchgmod.cpp 2012-01-05 21:47:50.531456715 +0100
kicad-patches/kicad_diff.sh
1#!/bin/bash
2diff -u /dev/null kicad/eeschema/eeschema_cmdline.h > cmdline-new.patch
3diff -u /dev/null kicad/eeschema/eeschema_cmdline.cpp >> cmdline-new.patch
4diff -u /dev/null kicad/pcbnew/pcbnew_cmdline.h >> cmdline-new.patch
5diff -u /dev/null kicad/pcbnew/pcbnew_cmdline.cpp >> cmdline-new.patch
6diff -ru kicad.orig/include kicad/include > cmdline-common.patch
7diff -ru kicad.orig/common kicad/common >> cmdline-common.patch
8diff -ru kicad.orig/eeschema kicad/eeschema > cmdline-eeschema.patch
9diff -ru kicad.orig/pcbnew kicad/pcbnew > cmdline-pcbnew.patch
kicad-patches/series
11# Based on BZR revision 2448
22
33# under discussion
4fix-pinedit-collision.patch
4# fix-pinedit-collision.patch
55
66# cmdline options for eeschema and pcbnew
77cmdline-new.patch

Archive Download the corresponding diff file

Branches:
master



interactive