1
0
mirror of git://projects.qi-hardware.com/eda-tools.git synced 2024-07-05 05:22:22 +03:00
eda-tools/kicad-patches/cmdline-pcbnew.patch
2012-01-25 13:20:03 +01:00

238 lines
8.1 KiB
Diff

diff -ru kicad.orig/pcbnew/build_BOM_from_board.cpp kicad/pcbnew/build_BOM_from_board.cpp
--- kicad.orig/pcbnew/build_BOM_from_board.cpp 2012-01-25 13:11:10.508078000 +0100
+++ kicad/pcbnew/build_BOM_from_board.cpp 2012-01-25 12:18:17.031808065 +0100
@@ -67,6 +67,7 @@
fn = GetScreen()->GetFileName();
fn.SetExt( CsvFileExtension );
+ if (!g_CmdLineMode) {
wxFileDialog dlg( this, _( "Save Bill of Materials" ), wxGetCwd(),
fn.GetFullName(), CsvFileWildcard,
wxFD_SAVE | wxFD_OVERWRITE_PROMPT );
@@ -75,6 +76,7 @@
return;
fn = dlg.GetPath();
+ }
FichBom = wxFopen( fn.GetFullPath(), wxT( "wt" ) );
diff -ru kicad.orig/pcbnew/CMakeLists.txt kicad/pcbnew/CMakeLists.txt
--- kicad.orig/pcbnew/CMakeLists.txt 2012-01-25 13:11:10.508078000 +0100
+++ kicad/pcbnew/CMakeLists.txt 2012-01-25 12:18:17.032808058 +0100
@@ -155,6 +155,7 @@
onrightclick.cpp
pcb_plot_params.cpp
pcbnew.cpp
+ pcbnew_cmdline.cpp
pcbnew_config.cpp
pcbplot.cpp
plotgerb.cpp
Only in kicad/pcbnew/dialogs: dialog_freeroute_exchange_help_html.h
diff -ru kicad.orig/pcbnew/dialogs/dialog_gendrill.h kicad/pcbnew/dialogs/dialog_gendrill.h
--- kicad.orig/pcbnew/dialogs/dialog_gendrill.h 2012-01-25 13:11:10.508078000 +0100
+++ kicad/pcbnew/dialogs/dialog_gendrill.h 2012-01-25 12:18:17.043807978 +0100
@@ -33,6 +33,7 @@
class DIALOG_GENDRILL : public DIALOG_GENDRILL_BASE
{
+friend bool Pcbnew_CmdLine();
public:
static int m_UnitDrillIsInch;
static int m_ZerosFormat;
diff -ru kicad.orig/pcbnew/dialogs/dialog_SVG_print.h kicad/pcbnew/dialogs/dialog_SVG_print.h
--- kicad.orig/pcbnew/dialogs/dialog_SVG_print.h 2012-01-25 13:11:10.508078000 +0100
+++ kicad/pcbnew/dialogs/dialog_SVG_print.h 2012-01-25 12:18:17.044807971 +0100
@@ -13,6 +13,7 @@
class DIALOG_SVG_PRINT : public DIALOG_SVG_PRINT_base
{
+friend bool Pcbnew_CmdLine();
private:
PCB_BASE_FRAME* m_Parent;
wxConfig* m_Config;
diff -ru kicad.orig/pcbnew/drc_stuff.h kicad/pcbnew/drc_stuff.h
--- kicad.orig/pcbnew/drc_stuff.h 2012-01-25 13:11:10.508078000 +0100
+++ kicad/pcbnew/drc_stuff.h 2012-01-25 12:18:17.045807964 +0100
@@ -146,6 +146,7 @@
*/
class DRC
{
+ friend bool Pcbnew_CmdLine();
friend class DIALOG_DRC_CONTROL;
private:
diff -ru kicad.orig/pcbnew/gendrill.cpp kicad/pcbnew/gendrill.cpp
--- kicad.orig/pcbnew/gendrill.cpp 2012-01-25 13:11:10.508078000 +0100
+++ kicad/pcbnew/gendrill.cpp 2012-01-25 12:18:17.046807957 +0100
@@ -159,8 +159,13 @@
fn.GetFullName(), wxGetTranslation( DrillFileWildcard ),
wxFD_SAVE | wxFD_CHANGE_DIR );
+ if ( g_CmdLineMode ) {
+ dlg.SetPath( fn.GetFullPath() );
+ wxTheApp->Yield();
+ } else {
if( dlg.ShowModal() == wxID_CANCEL )
break;
+ }
FILE* aFile = wxFopen( dlg.GetPath(), wxT( "w" ) );
@@ -619,8 +624,13 @@
fn.GetFullName(), wildcard,
wxFD_SAVE );
+ if ( g_CmdLineMode ) {
+ dlg.SetPath( fn.GetFullPath() );
+ wxTheApp->Yield();
+ } else {
if( dlg.ShowModal() == wxID_CANCEL )
return;
+ }
FILE* plotfile = wxFopen( dlg.GetPath(), wxT( "wt" ) );
@@ -659,8 +669,13 @@
fn.GetFullName(), wxGetTranslation( RptFileWildcard ),
wxFD_SAVE );
+ if ( g_CmdLineMode ) {
+ dlg.SetPath( fn.GetFullPath() );
+ wxTheApp->Yield();
+ } else {
if( dlg.ShowModal() == wxID_CANCEL )
return;
+ }
FILE* report_dest = wxFopen( dlg.GetPath(), wxT( "w" ) );
diff -ru kicad.orig/pcbnew/gen_modules_placefile.cpp kicad/pcbnew/gen_modules_placefile.cpp
--- kicad.orig/pcbnew/gen_modules_placefile.cpp 2012-01-25 13:11:10.508078000 +0100
+++ kicad/pcbnew/gen_modules_placefile.cpp 2012-01-25 12:18:17.047807949 +0100
@@ -138,10 +138,10 @@
return;
}
- wxString boardFilePath = ( (wxFileName) GetScreen()->GetFileName()).GetPath();
+ wxString boardFilePath = ( (wxFileName) GetScreen()->GetFileName()).GetFullPath();
wxDirDialog dirDialog( this, _( "Select Output Directory" ), boardFilePath );
- if( dirDialog.ShowModal() == wxID_CANCEL )
+ if( !g_CmdLineMode && dirDialog.ShowModal() == wxID_CANCEL )
return;
fnFront = GetScreen()->GetFileName();
@@ -298,6 +298,7 @@
msg.Append( fnBack.GetFullPath() );
}
+ if ( !g_CmdLineMode )
wxMessageBox( msg, _( "Module Position File" ), wxICON_INFORMATION );
exit: // the only safe way out of here, no returns please.
Only in kicad/pcbnew: Makefile
Only in kicad/pcbnew: pcbnew
Only in kicad/pcbnew: pcbnew_cmdline.cpp
Only in kicad/pcbnew: pcbnew_cmdline.h
diff -ru kicad.orig/pcbnew/pcbnew.cpp kicad/pcbnew/pcbnew.cpp
--- kicad.orig/pcbnew/pcbnew.cpp 2012-01-25 13:11:10.508078000 +0100
+++ kicad/pcbnew/pcbnew.cpp 2012-01-25 12:18:40.160638484 +0100
@@ -44,6 +44,7 @@
#include <pcbnew.h>
#include <protos.h>
#include <hotkeys.h>
+#include <pcbnew_cmdline.h>
// Colors for layers and items
@@ -111,6 +112,9 @@
wxFileName fn;
PCB_EDIT_FRAME* frame = NULL;
+ if ( argc >= 2 && argv[1][0] == '-' )
+ return Pcbnew_CmdLine();
+
InitEDA_Appl( wxT( "Pcbnew" ), APP_PCBNEW_T );
if( m_Checker && m_Checker->IsAnotherRunning() )
Only in kicad/pcbnew: pcbnew.cpp.rej
diff -ru kicad.orig/pcbnew/pcbnew.h kicad/pcbnew/pcbnew.h
--- kicad.orig/pcbnew/pcbnew.h 2012-01-25 13:11:10.508078000 +0100
+++ kicad/pcbnew/pcbnew.h 2012-01-25 12:18:17.049807933 +0100
@@ -41,6 +41,7 @@
#define FORCE_SKETCH ( IS_DRAGGED | IN_EDIT )
/* variables */
+extern bool g_CmdLineMode;
extern bool Drc_On;
extern bool g_AutoDeleteOldTrack;
extern bool g_Drag_Pistes_On;
diff -ru kicad.orig/pcbnew/pcbplot.cpp kicad/pcbnew/pcbplot.cpp
--- kicad.orig/pcbnew/pcbplot.cpp 2012-01-25 13:11:10.508078000 +0100
+++ kicad/pcbnew/pcbplot.cpp 2012-01-25 12:18:17.050807926 +0100
@@ -819,6 +819,7 @@
case PLOT_FORMAT_DXF:
success = m_Parent->ExportToDxfFile( fn.GetFullPath(), layer,
+ false,
g_PcbPlotOptions.m_PlotMode );
break;
}
diff -ru kicad.orig/pcbnew/plotdxf.cpp kicad/pcbnew/plotdxf.cpp
--- kicad.orig/pcbnew/plotdxf.cpp 2012-01-25 13:11:10.508078000 +0100
+++ kicad/pcbnew/plotdxf.cpp 2012-01-25 12:18:17.050807926 +0100
@@ -16,7 +16,7 @@
bool PCB_BASE_FRAME::ExportToDxfFile( const wxString& aFullFileName, int aLayer,
- EDA_DRAW_MODE_T aTraceMode )
+ bool aPlotOriginIsAuxAxis, EDA_DRAW_MODE_T aTraceMode )
{
LOCALE_IO toggle;
@@ -27,9 +27,21 @@
return false;
}
+ wxPoint offset;
+
+ if( aPlotOriginIsAuxAxis )
+ {
+ offset = GetOriginAxisPosition();
+ }
+ else
+ {
+ offset.x = 0;
+ offset.y = 0;
+ }
+
DXF_PLOTTER* plotter = new DXF_PLOTTER();
plotter->SetPageSettings( GetPageSettings() );
- plotter->set_viewport( wxPoint( 0, 0 ), 1, 0 );
+ plotter->set_viewport( offset, 1, 0 );
plotter->set_creator( wxT( "PCBNEW-DXF" ) );
plotter->set_filename( aFullFileName );
plotter->start_plot( output_file );
Only in kicad/pcbnew: specctra_keywords.cpp
Only in kicad/pcbnew: specctra_lexer.h
diff -ru kicad.orig/pcbnew/xchgmod.cpp kicad/pcbnew/xchgmod.cpp
--- kicad.orig/pcbnew/xchgmod.cpp 2012-01-25 13:11:10.508078000 +0100
+++ kicad/pcbnew/xchgmod.cpp 2012-01-25 12:18:17.051807919 +0100
@@ -601,6 +601,7 @@
fn.SetExt( NetCmpExtBuffer );
wildcard = _( "Component files (." ) + NetCmpExtBuffer + wxT( ")|*." ) + NetCmpExtBuffer;
+ if ( !g_CmdLineMode) {
wxFileDialog dlg( this, _( "Save Component Files" ), wxGetCwd(),
fn.GetFullName(), wildcard,
wxFD_SAVE | wxFD_OVERWRITE_PROMPT );
@@ -609,6 +610,7 @@
return;
fn = dlg.GetPath();
+ }
FichCmp = wxFopen( fn.GetFullPath(), wxT( "wt" ) );