Date:2010-12-31 21:53:11 (13 years 2 months ago)
Author:Wolfgang Spraul
Commit:b29edbbdc1dee2249311d911171f73f5266a350f
Message:more patch restructuring for easier maintenance and upstream

Files: kicad-patches/scripted-common.patch (1 diff)
kicad-patches/scripted-eeschema.patch (1 diff)
kicad-patches/scripted-pcbnew.patch (1 diff)
kicad-patches/scripted.patch (1 diff)
kicad-patches/series (1 diff)

Change Details

kicad-patches/scripted-common.patch
1diff -ruN kicad.orig/common/confirm.cpp kicad/common/confirm.cpp
2--- kicad.orig/common/confirm.cpp 2010-10-19 08:48:07.000000000 +0000
3@@ -66,6 +66,7 @@
4                              * See not above as to why this doesn't work. */
5 }
6
7+bool g_IsScripted = false;
8
9 /* Display an error or warning message.
10  * If display time > 0 the dialog disappears after displayTime 0.1 seconds
11@@ -75,6 +76,12 @@
12 {
13     wxMessageDialog* dialog;
14
15+ if (g_IsScripted)
16+ {
17+ wxFprintf( stderr, text + _("\n") );
18+ return;
19+ }
20+
21     if( displaytime > 0 )
22         dialog = new WinEDA_MessageDialog( parent, text, _( "Warning" ),
23                                            wxOK | wxICON_INFORMATION,
24@@ -95,6 +102,11 @@
25 {
26     wxMessageDialog* dialog;
27
28+ if (g_IsScripted)
29+ {
30+ wxPrintf( text + _("\n") );
31+ return;
32+ }
33     dialog = new WinEDA_MessageDialog( parent, text, _( "Info:" ),
34                                        wxOK | wxICON_INFORMATION, displaytime );
35
36diff -ruN kicad.orig/common/edaappl.cpp kicad/common/edaappl.cpp
37--- kicad.orig/common/edaappl.cpp 2010-10-19 08:48:07.000000000 +0000
38@@ -272,6 +272,7 @@
39     wxString EnvLang;
40
41     m_Id = aId;
42+if (!g_IsScripted)
43     m_Checker = new wxSingleInstanceChecker( aName.Lower() + wxT( "-" ) +
44                                             wxGetUserId() );
45
46diff -ruN kicad.orig/include/common.h kicad/include/common.h
47--- kicad.orig/include/common.h 2010-10-19 08:48:07.000000000 +0000
48@@ -6,6 +6,8 @@
49 #ifndef __INCLUDE__COMMON_H__
50 #define __INCLUDE__COMMON_H__ 1
51
52+extern bool g_IsScripted;
53+
54 #include "wx/confbase.h"
55 #include "wx/fileconf.h"
56
57diff -ruN kicad.orig/include/wxPcbStruct.h kicad/include/wxPcbStruct.h
58--- kicad.orig/include/wxPcbStruct.h 2010-10-19 08:48:07.000000000 +0000
59@@ -50,6 +50,7 @@
60 class WinEDA_PcbFrame : public WinEDA_BasePcbFrame
61 {
62     friend class PCB_LAYER_WIDGET;
63+ friend bool Pcbnew_Scripted();
64
65 protected:
66
kicad-patches/scripted-eeschema.patch
1diff -ruN kicad.orig/eeschema/CMakeLists.txt kicad/eeschema/CMakeLists.txt
2--- kicad.orig/eeschema/CMakeLists.txt 2010-10-19 08:48:07.000000000 +0000
3@@ -83,6 +83,7 @@
4     eeredraw.cpp
5     eeschema.cpp
6     eeschema_config.cpp
7+ eeschema_scripted.cpp
8     erc.cpp
9     events_called_functions_for_edit.cpp
10     files-io.cpp
11diff -ruN kicad.orig/eeschema/dialog_build_BOM.h kicad/eeschema/dialog_build_BOM.h
12--- kicad.orig/eeschema/dialog_build_BOM.h 2010-10-19 08:48:07.000000000 +0000
13@@ -12,6 +12,7 @@
14
15 class DIALOG_BUILD_BOM : public DIALOG_BUILD_BOM_BASE
16 {
17+friend class EESCHEMA_SCRIPTED;
18 private:
19     WinEDA_DrawFrame * m_Parent;
20     wxConfig* m_Config;
21diff -ruN kicad.orig/eeschema/dialog_erc.h kicad/eeschema/dialog_erc.h
22--- kicad.orig/eeschema/dialog_erc.h 2010-10-19 08:48:07.000000000 +0000
23@@ -30,6 +30,7 @@
24
25 class DIALOG_ERC : public DIALOG_ERC_BASE
26 {
27+friend class EESCHEMA_SCRIPTED;
28     DECLARE_EVENT_TABLE()
29
30 private:
31diff -ruN kicad.orig/eeschema/dialog_SVG_print.cpp kicad/eeschema/dialog_SVG_print.cpp
32--- kicad.orig/eeschema/dialog_SVG_print.cpp 2010-10-19 08:48:07.000000000 +0000
33@@ -33,6 +33,7 @@
34
35 class DIALOG_SVG_PRINT : public DIALOG_SVG_PRINT_base
36 {
37+friend void ScriptedPrintSVGDoc( WinEDA_DrawFrame* frame, bool aPrintAll, bool aPrint_Sheet_Ref, bool aPrintBlackAndWhite );
38 private:
39     WinEDA_DrawFrame * m_Parent;
40     wxConfig* m_Config;
41@@ -57,6 +58,19 @@
42                    bool aPrint_Sheet_Ref = false);
43 };
44
45+void ScriptedPrintSVGDoc( WinEDA_DrawFrame* frame, bool aPrintAll, bool aPrint_Sheet_Ref, bool aPrintBlackAndWhite )
46+{
47+ // TBD: It would be better to iterate over the pages ourselves and use
48+ // DrawSVGPage() directly, bypassing the GUI dialog...
49+ class DIALOG_SVG_PRINT* dlg = new DIALOG_SVG_PRINT( frame );
50+ dlg->m_DialogPenWidth->SetValue(
51+ ReturnStringFromValue(g_UserUnit, g_DrawDefaultLineThickness,
52+ dlg->m_Parent->m_InternalUnits ) );
53+ dlg->m_ModeColorOption->SetSelection( aPrintBlackAndWhite );
54+ dlg->PrintSVGDoc( aPrintAll, aPrint_Sheet_Ref );
55+ delete dlg;
56+}
57+
58
59 /* Prepare the data structures of print management and display the dialog
60  * window for printing sheets.
61diff -ruN kicad.orig/eeschema/eeschema.cpp kicad/eeschema/eeschema.cpp
62--- kicad.orig/eeschema/eeschema.cpp 2010-12-28 15:30:43.309392002 +0000
63@@ -15,6 +15,7 @@
64 #include "program.h"
65 #include "general.h"
66 #include "protos.h"
67+#include "eeschema_scripted.h"
68
69 #include <wx/snglinst.h>
70
71@@ -128,6 +129,9 @@
72
73     g_DebugLevel = 0; // Debug level */
74
75+ if ( g_EESchemaScripted.Run() )
76+ return false;
77+
78     InitEDA_Appl( wxT( "EESchema" ), APP_TYPE_EESCHEMA );
79
80     if( m_Checker && m_Checker->IsAnotherRunning() )
81diff -ruN kicad.orig/eeschema/erc.cpp kicad/eeschema/erc.cpp
82--- kicad.orig/eeschema/erc.cpp 2010-12-31 18:11:47.751823001 +0000
83@@ -557,6 +557,7 @@
84         fn = g_RootSheet->m_AssociatedScreen->m_FileName;
85         fn.SetExt( wxT( "erc" ) );
86
87+if (!g_IsScripted) {
88         wxFileDialog dlg( this, _( "ERC File" ), fn.GetPath(), fn.GetFullName(),
89                           _( "Electronic rule check file (.erc)|*.erc" ),
90                           wxFD_SAVE | wxFD_OVERWRITE_PROMPT );
91@@ -570,6 +570,8 @@
92             ExecuteFile( this, wxGetApp().GetEditorName(),
93                          QuoteFullPath( fn ) );
94         }
95+} else
96+ WriteDiagnosticERC( fn.GetFullPath() );
97     }
98 }
99
kicad-patches/scripted-pcbnew.patch
1diff -ruN kicad.orig/pcbnew/build_BOM_from_board.cpp kicad/pcbnew/build_BOM_from_board.cpp
2--- kicad.orig/pcbnew/build_BOM_from_board.cpp 2010-10-19 08:48:07.000000000 +0000
3@@ -64,6 +64,7 @@
4     fn = GetScreen()->m_FileName;
5     fn.SetExt( CsvFileExtension );
6
7+ if (!g_IsScripted) {
8     wxFileDialog dlg( this, _( "Save Bill of Materials" ), wxGetCwd(),
9                       fn.GetFullName(), CsvFileWildcard,
10                       wxFD_SAVE | wxFD_OVERWRITE_PROMPT );
11@@ -72,6 +73,7 @@
12         return;
13
14     fn = dlg.GetPath();
15+ }
16
17     FichBom = wxFopen( fn.GetFullPath(), wxT( "wt" ) );
18
19diff -ruN kicad.orig/pcbnew/CMakeLists.txt kicad/pcbnew/CMakeLists.txt
20--- kicad.orig/pcbnew/CMakeLists.txt 2010-10-19 08:48:07.000000000 +0000
21@@ -142,6 +142,7 @@
22     onrightclick.cpp
23     pcbnew.cpp
24     pcbnew_config.cpp
25+ pcbnew_scripted.cpp
26     pcbplot.cpp
27     plotgerb.cpp
28     plothpgl.cpp
29diff -ruN kicad.orig/pcbnew/dialog_gendrill.h kicad/pcbnew/dialog_gendrill.h
30--- kicad.orig/pcbnew/dialog_gendrill.h 2010-10-19 08:48:07.000000000 +0000
31@@ -12,6 +12,7 @@
32
33 class DIALOG_GENDRILL: public DIALOG_GENDRILL_BASE
34 {
35+friend bool Pcbnew_Scripted();
36
37 private:
38     WinEDA_PcbFrame* m_Parent;
39diff -ruN kicad.orig/pcbnew/drc_stuff.h kicad/pcbnew/drc_stuff.h
40--- kicad.orig/pcbnew/drc_stuff.h 2010-10-19 08:48:07.000000000 +0000
41@@ -136,6 +136,7 @@
42 class DRC
43 {
44     friend class DIALOG_DRC_CONTROL;
45+ friend bool Pcbnew_Scripted();
46
47 private:
48
49diff -ruN kicad.orig/pcbnew/gendrill.cpp kicad/pcbnew/gendrill.cpp
50--- kicad.orig/pcbnew/gendrill.cpp 2010-10-19 08:48:07.000000000 +0000
51@@ -307,6 +307,43 @@
52             fn.SetName( fn.GetName() + layer_extend );
53             fn.SetExt( DrillFileExtension );
54
55+ if (g_IsScripted)
56+ {
57+ FILE* excellon_dest = wxFopen( fn.GetFullPath(), wxT( "w" ) );
58+ if( excellon_dest == 0 )
59+ {
60+ printf("Unable to create %ls.\n", fn.GetFullPath().c_str());
61+ exit(0);
62+ }
63+ Create_Drill_File_EXCELLON( excellon_dest, s_HoleListBuffer,
64+ s_ToolListBuffer );
65+
66+ switch( m_Choice_Drill_Map->GetSelection() )
67+ {
68+ case 0:
69+ break;
70+
71+ case 1:
72+ GenDrillMap( fn.GetPath(), s_HoleListBuffer, s_ToolListBuffer,
73+ PLOT_FORMAT_HPGL );
74+ break;
75+
76+ case 2:
77+ GenDrillMap( fn.GetPath(), s_HoleListBuffer, s_ToolListBuffer,
78+ PLOT_FORMAT_POST );
79+ break;
80+
81+ case 3:
82+ GenDrillMap( fn.GetPath(), s_HoleListBuffer, s_ToolListBuffer,
83+ PLOT_FORMAT_GERBER );
84+ break;
85+
86+ case 4:
87+ GenDrillMap( fn.GetPath(), s_HoleListBuffer, s_ToolListBuffer,
88+ PLOT_FORMAT_DXF );
89+ break;
90+ }
91+ } else {
92             wxFileDialog dlg( this, _( "Save Drill File" ), fn.GetPath(),
93                               fn.GetFullName(), DrillFileWildcard,
94                               wxFD_SAVE | wxFD_OVERWRITE_PROMPT );
95@@ -352,6 +389,7 @@
96                              PLOT_FORMAT_DXF );
97                 break;
98             }
99+ } // !g_IsScripted
100
101             if( !ExistsBuriedVias )
102                 break;
103diff -ruN kicad.orig/pcbnew/pcbnew.cpp kicad/pcbnew/pcbnew.cpp
104--- kicad.orig/pcbnew/pcbnew.cpp 2010-10-19 08:48:07.000000000 +0000
105@@ -29,6 +29,7 @@
106 #include "build_version.h"
107
108 #include "protos.h"
109+#include "pcbnew_scripted.h"
110
111 // Colors for layers and items
112 COLORS_DESIGN_SETTINGS g_ColorsSettings;
113@@ -103,6 +104,9 @@
114     wxFileName fn;
115     WinEDA_PcbFrame* frame = NULL;
116
117+ if( Pcbnew_Scripted() )
118+ return false;
119+
120     InitEDA_Appl( wxT( "PCBnew" ), APP_TYPE_PCBNEW );
121
122     if( m_Checker && m_Checker->IsAnotherRunning() )
123diff -ruN kicad.orig/pcbnew/xchgmod.cpp kicad/pcbnew/xchgmod.cpp
124--- kicad.orig/pcbnew/xchgmod.cpp 2010-10-19 08:48:07.000000000 +0000
125@@ -577,6 +577,7 @@
126     wildcard = _( "Component files (." ) + NetCmpExtBuffer + wxT( ")|*." ) +
127                NetCmpExtBuffer;
128
129+ if (!g_IsScripted) {
130     wxFileDialog dlg( this, _( "Save Component Files" ), wxGetCwd(),
131                       fn.GetFullName(), wildcard,
132                       wxFD_SAVE | wxFD_OVERWRITE_PROMPT );
133@@ -585,6 +586,7 @@
134         return;
135
136     fn = dlg.GetPath();
137+ }
138
139     FichCmp = wxFopen( fn.GetFullPath(), wxT( "wt" ) );
140     if( FichCmp == NULL )
kicad-patches/scripted.patch
1diff -ruN kicad.orig/common/confirm.cpp kicad/common/confirm.cpp
2+++ kicad/common/confirm.cpp 2010-12-28 13:58:14.765392001 +0000
3@@ -66,6 +66,7 @@
4                              * See not above as to why this doesn't work. */
5 }
6
7+bool g_IsScripted = false;
8
9 /* Display an error or warning message.
10  * If display time > 0 the dialog disappears after displayTime 0.1 seconds
11@@ -75,6 +76,12 @@
12 {
13     wxMessageDialog* dialog;
14
15+ if (g_IsScripted)
16+ {
17+ wxFprintf( stderr, text + _("\n") );
18+ return;
19+ }
20+
21     if( displaytime > 0 )
22         dialog = new WinEDA_MessageDialog( parent, text, _( "Warning" ),
23                                            wxOK | wxICON_INFORMATION,
24@@ -95,6 +102,11 @@
25 {
26     wxMessageDialog* dialog;
27
28+ if (g_IsScripted)
29+ {
30+ wxPrintf( text + _("\n") );
31+ return;
32+ }
33     dialog = new WinEDA_MessageDialog( parent, text, _( "Info:" ),
34                                        wxOK | wxICON_INFORMATION, displaytime );
35
36diff -ruN kicad.orig/common/edaappl.cpp kicad/common/edaappl.cpp
37+++ kicad/common/edaappl.cpp 2010-12-28 13:58:28.045392001 +0000
38@@ -272,6 +272,7 @@
39     wxString EnvLang;
40
41     m_Id = aId;
42+if (!g_IsScripted)
43     m_Checker = new wxSingleInstanceChecker( aName.Lower() + wxT( "-" ) +
44                                             wxGetUserId() );
45
46diff -ruN kicad.orig/eeschema/CMakeLists.txt kicad/eeschema/CMakeLists.txt
47+++ kicad/eeschema/CMakeLists.txt 2010-12-28 13:43:28.365392001 +0000
48@@ -83,6 +83,7 @@
49     eeredraw.cpp
50     eeschema.cpp
51     eeschema_config.cpp
52+ eeschema_scripted.cpp
53     erc.cpp
54     events_called_functions_for_edit.cpp
55     files-io.cpp
56diff -ruN kicad.orig/eeschema/dialog_build_BOM.h kicad/eeschema/dialog_build_BOM.h
57+++ kicad/eeschema/dialog_build_BOM.h 2010-12-29 14:53:53.210259002 +0000
58@@ -12,6 +12,7 @@
59
60 class DIALOG_BUILD_BOM : public DIALOG_BUILD_BOM_BASE
61 {
62+friend class EESCHEMA_SCRIPTED;
63 private:
64     WinEDA_DrawFrame * m_Parent;
65     wxConfig* m_Config;
66diff -ruN kicad.orig/eeschema/dialog_erc.h kicad/eeschema/dialog_erc.h
67+++ kicad/eeschema/dialog_erc.h 2010-12-29 15:45:04.002259005 +0000
68@@ -30,6 +30,7 @@
69
70 class DIALOG_ERC : public DIALOG_ERC_BASE
71 {
72+friend class EESCHEMA_SCRIPTED;
73     DECLARE_EVENT_TABLE()
74
75 private:
76diff -ruN kicad.orig/eeschema/dialog_SVG_print.cpp kicad/eeschema/dialog_SVG_print.cpp
77+++ kicad/eeschema/dialog_SVG_print.cpp 2010-12-31 14:59:18.871823000 +0000
78@@ -33,6 +33,7 @@
79
80 class DIALOG_SVG_PRINT : public DIALOG_SVG_PRINT_base
81 {
82+friend void ScriptedPrintSVGDoc( WinEDA_DrawFrame* frame, bool aPrintAll, bool aPrint_Sheet_Ref, bool aPrintBlackAndWhite );
83 private:
84     WinEDA_DrawFrame * m_Parent;
85     wxConfig* m_Config;
86@@ -57,6 +58,19 @@
87                    bool aPrint_Sheet_Ref = false);
88 };
89
90+void ScriptedPrintSVGDoc( WinEDA_DrawFrame* frame, bool aPrintAll, bool aPrint_Sheet_Ref, bool aPrintBlackAndWhite )
91+{
92+ // TBD: It would be better to iterate over the pages ourselves and use
93+ // DrawSVGPage() directly, bypassing the GUI dialog...
94+ class DIALOG_SVG_PRINT* dlg = new DIALOG_SVG_PRINT( frame );
95+ dlg->m_DialogPenWidth->SetValue(
96+ ReturnStringFromValue(g_UserUnit, g_DrawDefaultLineThickness,
97+ dlg->m_Parent->m_InternalUnits ) );
98+ dlg->m_ModeColorOption->SetSelection( aPrintBlackAndWhite );
99+ dlg->PrintSVGDoc( aPrintAll, aPrint_Sheet_Ref );
100+ delete dlg;
101+}
102+
103
104 /* Prepare the data structures of print management and display the dialog
105  * window for printing sheets.
106diff -ruN kicad.orig/eeschema/eeschema.cpp kicad/eeschema/eeschema.cpp
107+++ kicad/eeschema/eeschema.cpp 2010-12-28 15:38:23.073392001 +0000
108@@ -15,6 +15,7 @@
109 #include "program.h"
110 #include "general.h"
111 #include "protos.h"
112+#include "eeschema_scripted.h"
113
114 #include <wx/snglinst.h>
115
116@@ -128,6 +129,9 @@
117
118     g_DebugLevel = 0; // Debug level */
119
120+ if ( g_EESchemaScripted.Run() )
121+ return false;
122+
123     InitEDA_Appl( wxT( "EESchema" ), APP_TYPE_EESCHEMA );
124
125     if( m_Checker && m_Checker->IsAnotherRunning() )
126diff -ruN kicad.orig/eeschema/erc.cpp kicad/eeschema/erc.cpp
127+++ kicad/eeschema/erc.cpp 2010-12-29 15:43:01.970259008 +0000
128@@ -557,6 +557,7 @@
129         fn = g_RootSheet->m_AssociatedScreen->m_FileName;
130         fn.SetExt( wxT( "erc" ) );
131
132+if (!g_IsScripted) {
133         wxFileDialog dlg( this, _( "ERC File" ), fn.GetPath(), fn.GetFullName(),
134                           _( "Electronic rule check file (.erc)|*.erc" ),
135                           wxFD_SAVE | wxFD_OVERWRITE_PROMPT );
136@@ -570,6 +570,8 @@
137             ExecuteFile( this, wxGetApp().GetEditorName(),
138                          QuoteFullPath( fn ) );
139         }
140+} else
141+ WriteDiagnosticERC( fn.GetFullPath() );
142     }
143 }
144
145diff -ruN kicad.orig/include/common.h kicad/include/common.h
146+++ kicad/include/common.h 2010-12-28 13:58:57.861392001 +0000
147@@ -6,6 +6,8 @@
148 #ifndef __INCLUDE__COMMON_H__
149 #define __INCLUDE__COMMON_H__ 1
150
151+extern bool g_IsScripted;
152+
153 #include "wx/confbase.h"
154 #include "wx/fileconf.h"
155
156diff -ruN kicad.orig/include/wxPcbStruct.h kicad/include/wxPcbStruct.h
157+++ kicad/include/wxPcbStruct.h 2010-12-24 11:03:20.674781923 +0000
158@@ -50,6 +50,7 @@
159 class WinEDA_PcbFrame : public WinEDA_BasePcbFrame
160 {
161     friend class PCB_LAYER_WIDGET;
162+ friend bool Pcbnew_Scripted();
163
164 protected:
165
166diff -ruN kicad.orig/pcbnew/build_BOM_from_board.cpp kicad/pcbnew/build_BOM_from_board.cpp
167+++ kicad/pcbnew/build_BOM_from_board.cpp 2010-12-28 13:59:39.089392001 +0000
168@@ -64,6 +64,7 @@
169     fn = GetScreen()->m_FileName;
170     fn.SetExt( CsvFileExtension );
171
172+ if (!g_IsScripted) {
173     wxFileDialog dlg( this, _( "Save Bill of Materials" ), wxGetCwd(),
174                       fn.GetFullName(), CsvFileWildcard,
175                       wxFD_SAVE | wxFD_OVERWRITE_PROMPT );
176@@ -72,6 +73,7 @@
177         return;
178
179     fn = dlg.GetPath();
180+ }
181
182     FichBom = wxFopen( fn.GetFullPath(), wxT( "wt" ) );
183
184diff -ruN kicad.orig/pcbnew/CMakeLists.txt kicad/pcbnew/CMakeLists.txt
185+++ kicad/pcbnew/CMakeLists.txt 2010-12-22 02:19:48.597291239 +0000
186@@ -142,6 +142,7 @@
187     onrightclick.cpp
188     pcbnew.cpp
189     pcbnew_config.cpp
190+ pcbnew_scripted.cpp
191     pcbplot.cpp
192     plotgerb.cpp
193     plothpgl.cpp
194diff -ruN kicad.orig/pcbnew/dialog_gendrill.h kicad/pcbnew/dialog_gendrill.h
195+++ kicad/pcbnew/dialog_gendrill.h 2010-12-22 18:23:00.054932711 +0000
196@@ -12,6 +12,7 @@
197
198 class DIALOG_GENDRILL: public DIALOG_GENDRILL_BASE
199 {
200+friend bool Pcbnew_Scripted();
201
202 private:
203     WinEDA_PcbFrame* m_Parent;
204diff -ruN kicad.orig/pcbnew/drc_stuff.h kicad/pcbnew/drc_stuff.h
205+++ kicad/pcbnew/drc_stuff.h 2010-12-24 10:01:41.438781921 +0000
206@@ -136,6 +136,7 @@
207 class DRC
208 {
209     friend class DIALOG_DRC_CONTROL;
210+ friend bool Pcbnew_Scripted();
211
212 private:
213
214diff -ruN kicad.orig/pcbnew/gendrill.cpp kicad/pcbnew/gendrill.cpp
215+++ kicad/pcbnew/gendrill.cpp 2010-12-28 13:59:29.321392003 +0000
216@@ -307,6 +307,43 @@
217             fn.SetName( fn.GetName() + layer_extend );
218             fn.SetExt( DrillFileExtension );
219
220+ if (g_IsScripted)
221+ {
222+ FILE* excellon_dest = wxFopen( fn.GetFullPath(), wxT( "w" ) );
223+ if( excellon_dest == 0 )
224+ {
225+ printf("Unable to create %ls.\n", fn.GetFullPath().c_str());
226+ exit(0);
227+ }
228+ Create_Drill_File_EXCELLON( excellon_dest, s_HoleListBuffer,
229+ s_ToolListBuffer );
230+
231+ switch( m_Choice_Drill_Map->GetSelection() )
232+ {
233+ case 0:
234+ break;
235+
236+ case 1:
237+ GenDrillMap( fn.GetPath(), s_HoleListBuffer, s_ToolListBuffer,
238+ PLOT_FORMAT_HPGL );
239+ break;
240+
241+ case 2:
242+ GenDrillMap( fn.GetPath(), s_HoleListBuffer, s_ToolListBuffer,
243+ PLOT_FORMAT_POST );
244+ break;
245+
246+ case 3:
247+ GenDrillMap( fn.GetPath(), s_HoleListBuffer, s_ToolListBuffer,
248+ PLOT_FORMAT_GERBER );
249+ break;
250+
251+ case 4:
252+ GenDrillMap( fn.GetPath(), s_HoleListBuffer, s_ToolListBuffer,
253+ PLOT_FORMAT_DXF );
254+ break;
255+ }
256+ } else {
257             wxFileDialog dlg( this, _( "Save Drill File" ), fn.GetPath(),
258                               fn.GetFullName(), DrillFileWildcard,
259                               wxFD_SAVE | wxFD_OVERWRITE_PROMPT );
260@@ -352,6 +389,7 @@
261                              PLOT_FORMAT_DXF );
262                 break;
263             }
264+ } // !g_IsScripted
265
266             if( !ExistsBuriedVias )
267                 break;
268diff -ruN kicad.orig/pcbnew/pcbnew.cpp kicad/pcbnew/pcbnew.cpp
269+++ kicad/pcbnew/pcbnew.cpp 2010-12-28 09:18:32.577470003 +0000
270@@ -29,6 +29,7 @@
271 #include "build_version.h"
272
273 #include "protos.h"
274+#include "pcbnew_scripted.h"
275
276 // Colors for layers and items
277 COLORS_DESIGN_SETTINGS g_ColorsSettings;
278@@ -103,6 +104,9 @@
279     wxFileName fn;
280     WinEDA_PcbFrame* frame = NULL;
281
282+ if( Pcbnew_Scripted() )
283+ return false;
284+
285     InitEDA_Appl( wxT( "PCBnew" ), APP_TYPE_PCBNEW );
286
287     if( m_Checker && m_Checker->IsAnotherRunning() )
288diff -ruN kicad.orig/pcbnew/xchgmod.cpp kicad/pcbnew/xchgmod.cpp
289+++ kicad/pcbnew/xchgmod.cpp 2010-12-28 13:59:06.985392003 +0000
290@@ -577,6 +577,7 @@
291     wildcard = _( "Component files (." ) + NetCmpExtBuffer + wxT( ")|*." ) +
292                NetCmpExtBuffer;
293
294+ if (!g_IsScripted) {
295     wxFileDialog dlg( this, _( "Save Component Files" ), wxGetCwd(),
296                       fn.GetFullName(), wildcard,
297                       wxFD_SAVE | wxFD_OVERWRITE_PROMPT );
298@@ -585,6 +586,7 @@
299         return;
300
301     fn = dlg.GetPath();
302+ }
303
304     FichCmp = wxFopen( fn.GetFullPath(), wxT( "wt" ) );
305     if( FichCmp == NULL )
kicad-patches/series
1313
1414# cmdline options for eeschema and pcbnew
1515scripted-new.patch
16scripted.patch
16scripted-common.patch
17scripted-eeschema.patch
18scripted-pcbnew.patch

Archive Download the corresponding diff file

Branches:
master



interactive