Commit fafd74ca authored by Dick Hollenbeck's avatar Dick Hollenbeck

Fix problem with BOARD bounding box in saved *.brd files,

and TEXTE_MODULE size in kicad_plugin.
Link in io_mgr and kicad_plugin but do not call them yet
parent 680a4407
...@@ -126,9 +126,9 @@ set(PCBNEW_SRCS ...@@ -126,9 +126,9 @@ set(PCBNEW_SRCS
hotkeys_board_editor.cpp hotkeys_board_editor.cpp
hotkeys_module_editor.cpp hotkeys_module_editor.cpp
initpcb.cpp initpcb.cpp
# io_mgr.cpp io_mgr.cpp
ioascii.cpp ioascii.cpp
# kicad_plugin.cpp kicad_plugin.cpp
layer_widget.cpp layer_widget.cpp
librairi.cpp librairi.cpp
loadcmp.cpp loadcmp.cpp
......
...@@ -49,6 +49,7 @@ ...@@ -49,6 +49,7 @@
#include "class_board.h" #include "class_board.h"
#include "build_version.h" // BOARD_FILE_VERSION #include "build_version.h" // BOARD_FILE_VERSION
static const wxString pcbBackupFileExtension( wxT( "000" ) ); static const wxString pcbBackupFileExtension( wxT( "000" ) );
...@@ -200,6 +201,7 @@ the changes?" ) ) ) ...@@ -200,6 +201,7 @@ the changes?" ) ) )
GetScreen()->SetFileName( fileName.GetFullPath() ); GetScreen()->SetFileName( fileName.GetFullPath() );
#if 1 #if 1
// Start read PCB file // Start read PCB file
FILE* source = wxFopen( GetScreen()->GetFileName(), wxT( "rt" ) ); FILE* source = wxFopen( GetScreen()->GetFileName(), wxT( "rt" ) );
......
...@@ -39,7 +39,7 @@ ...@@ -39,7 +39,7 @@
// plugins coexisting. // plugins coexisting.
static KICAD_PLUGIN kicad_plugin; // a secret // static KICAD_PLUGIN kicad_plugin; // a secret
//static EAGLE_PLUGIN eagle_plugin; //static EAGLE_PLUGIN eagle_plugin;
PLUGIN* IO_MGR::PluginFind( PCB_FILE_T aFileType ) PLUGIN* IO_MGR::PluginFind( PCB_FILE_T aFileType )
...@@ -49,9 +49,14 @@ PLUGIN* IO_MGR::PluginFind( PCB_FILE_T aFileType ) ...@@ -49,9 +49,14 @@ PLUGIN* IO_MGR::PluginFind( PCB_FILE_T aFileType )
switch( aFileType ) switch( aFileType )
{ {
case KICAD: return &kicad_plugin; case KICAD:
return new KICAD_PLUGIN();
// case EAGLE: return &eagle_plugin; /*
case EAGLE:
return &eagle_plugin;
*/
} }
return NULL; return NULL;
...@@ -63,6 +68,8 @@ void IO_MGR::PluginRelease( PLUGIN* aPlugin ) ...@@ -63,6 +68,8 @@ void IO_MGR::PluginRelease( PLUGIN* aPlugin )
// This function is a place holder for a future point in time where // This function is a place holder for a future point in time where
// the plugin is a DLL/DSO. It could do reference counting, and then // the plugin is a DLL/DSO. It could do reference counting, and then
// unload the DLL/DSO when count goes to zero. // unload the DLL/DSO when count goes to zero.
delete aPlugin;
} }
......
...@@ -225,6 +225,14 @@ public: ...@@ -225,6 +225,14 @@ public:
//-----</PUBLIC PLUGIN API>------------------------------------------------ //-----</PUBLIC PLUGIN API>------------------------------------------------
/* The compiler writes the "zero argument" constructor for a PLUGIN
automatically if you do not provide one. If you decide you need to
provide a zero argument constructor of your own design, that is allowed,
but there can only be one constructor and it must be a "zero argument"
version. Normally you can do your initialization in a function like
KICAD_PLUGIN::init( PROPERTIES* aProperties ) instead.
*/
virtual ~PLUGIN() {} virtual ~PLUGIN() {}
/** /**
......
...@@ -277,7 +277,7 @@ int PCB_BASE_FRAME::ReadGeneralDescrPcb( LINE_READER* aReader ) ...@@ -277,7 +277,7 @@ int PCB_BASE_FRAME::ReadGeneralDescrPcb( LINE_READER* aReader )
data = strtok( NULL, delims ); data = strtok( NULL, delims );
int y2 = atoi( data ); int y2 = atoi( data );
EDA_RECT bbbox( wxPoint( x1, x2 ), wxSize( x2-x1, y2-y1 ) ); EDA_RECT bbbox( wxPoint( x1, y1 ), wxSize( x2-x1, y2-y1 ) );
GetBoard()->SetBoundingBox( bbbox ); GetBoard()->SetBoundingBox( bbbox );
......
...@@ -406,7 +406,7 @@ void KICAD_PLUGIN::loadGENERAL() ...@@ -406,7 +406,7 @@ void KICAD_PLUGIN::loadGENERAL()
BIU x2 = biuParse( data, &data ); BIU x2 = biuParse( data, &data );
BIU y2 = biuParse( data ); BIU y2 = biuParse( data );
EDA_RECT bbbox( wxPoint( x1, x2 ), wxSize( x2-x1, y2-y1 ) ); EDA_RECT bbbox( wxPoint( x1, y1 ), wxSize( x2-x1, y2-y1 ) );
m_board->SetBoundingBox( bbbox ); m_board->SetBoundingBox( bbbox );
} }
...@@ -1339,8 +1339,8 @@ void KICAD_PLUGIN::loadTEXTE_MODULE( TEXTE_MODULE* aText ) ...@@ -1339,8 +1339,8 @@ void KICAD_PLUGIN::loadTEXTE_MODULE( TEXTE_MODULE* aText )
int type = intParse( line+1, &data ); int type = intParse( line+1, &data );
BIU pos0_x = biuParse( data, &data ); BIU pos0_x = biuParse( data, &data );
BIU pos0_y = biuParse( data, &data ); BIU pos0_y = biuParse( data, &data );
BIU size0_y = biuParse( data, &data ); // why y?
BIU size0_x = biuParse( data, &data ); BIU size0_x = biuParse( data, &data );
BIU size0_y = biuParse( data, &data );
double orient = degParse( data, &data ); double orient = degParse( data, &data );
BIU thickn = biuParse( data, &data ); BIU thickn = biuParse( data, &data );
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment