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
This commit is contained in:
Dick Hollenbeck 2011-12-05 11:22:19 -06:00
parent 680a4407f4
commit fafd74ca6f
6 changed files with 25 additions and 8 deletions

View File

@ -126,9 +126,9 @@ set(PCBNEW_SRCS
hotkeys_board_editor.cpp
hotkeys_module_editor.cpp
initpcb.cpp
# io_mgr.cpp
io_mgr.cpp
ioascii.cpp
# kicad_plugin.cpp
kicad_plugin.cpp
layer_widget.cpp
librairi.cpp
loadcmp.cpp

View File

@ -49,6 +49,7 @@
#include "class_board.h"
#include "build_version.h" // BOARD_FILE_VERSION
static const wxString pcbBackupFileExtension( wxT( "000" ) );
@ -200,6 +201,7 @@ the changes?" ) ) )
GetScreen()->SetFileName( fileName.GetFullPath() );
#if 1
// Start read PCB file
FILE* source = wxFopen( GetScreen()->GetFileName(), wxT( "rt" ) );

View File

@ -39,7 +39,7 @@
// plugins coexisting.
static KICAD_PLUGIN kicad_plugin; // a secret
// static KICAD_PLUGIN kicad_plugin; // a secret
//static EAGLE_PLUGIN eagle_plugin;
PLUGIN* IO_MGR::PluginFind( PCB_FILE_T aFileType )
@ -49,9 +49,14 @@ PLUGIN* IO_MGR::PluginFind( PCB_FILE_T 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;
@ -63,6 +68,8 @@ void IO_MGR::PluginRelease( PLUGIN* aPlugin )
// 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
// unload the DLL/DSO when count goes to zero.
delete aPlugin;
}

View File

@ -225,6 +225,14 @@ public:
//-----</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() {}
/**

View File

@ -277,7 +277,7 @@ int PCB_BASE_FRAME::ReadGeneralDescrPcb( LINE_READER* aReader )
data = strtok( NULL, delims );
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 );

View File

@ -406,7 +406,7 @@ void KICAD_PLUGIN::loadGENERAL()
BIU x2 = biuParse( data, &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 );
}
@ -1339,8 +1339,8 @@ void KICAD_PLUGIN::loadTEXTE_MODULE( TEXTE_MODULE* aText )
int type = intParse( line+1, &data );
BIU pos0_x = 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_y = biuParse( data, &data );
double orient = degParse( data, &data );
BIU thickn = biuParse( data, &data );