Commit c5869705 authored by Dick Hollenbeck's avatar Dick Hollenbeck

EAGLE_PLUGIN add mechanical "hole" support for both MODULEs and BOARD

parent 808020b1
...@@ -50,7 +50,7 @@ TEXTE_MODULE::TEXTE_MODULE( MODULE* parent, int text_type ) : ...@@ -50,7 +50,7 @@ TEXTE_MODULE::TEXTE_MODULE( MODULE* parent, int text_type ) :
BOARD_ITEM( parent, PCB_MODULE_TEXT_T ), BOARD_ITEM( parent, PCB_MODULE_TEXT_T ),
EDA_TEXT() EDA_TEXT()
{ {
MODULE* Module = (MODULE*) m_Parent; MODULE* module = (MODULE*) m_Parent;
m_Type = text_type; /* Reference */ m_Type = text_type; /* Reference */
...@@ -63,11 +63,11 @@ TEXTE_MODULE::TEXTE_MODULE( MODULE* parent, int text_type ) : ...@@ -63,11 +63,11 @@ TEXTE_MODULE::TEXTE_MODULE( MODULE* parent, int text_type ) :
SetLayer( SILKSCREEN_N_FRONT ); SetLayer( SILKSCREEN_N_FRONT );
if( Module && ( Module->Type() == PCB_MODULE_T ) ) if( module && ( module->Type() == PCB_MODULE_T ) )
{ {
m_Pos = Module->m_Pos; m_Pos = module->m_Pos;
int moduleLayer = Module->GetLayer(); int moduleLayer = module->GetLayer();
if( moduleLayer == LAYER_N_BACK ) if( moduleLayer == LAYER_N_BACK )
SetLayer( SILKSCREEN_N_BACK ); SetLayer( SILKSCREEN_N_BACK );
...@@ -120,18 +120,18 @@ int TEXTE_MODULE::GetLength() const ...@@ -120,18 +120,18 @@ int TEXTE_MODULE::GetLength() const
// Update draw coordinates // Update draw coordinates
void TEXTE_MODULE::SetDrawCoord() void TEXTE_MODULE::SetDrawCoord()
{ {
MODULE* Module = (MODULE*) m_Parent; MODULE* module = (MODULE*) m_Parent;
m_Pos = m_Pos0; m_Pos = m_Pos0;
if( Module == NULL ) if( module == NULL )
return; return;
int angle = Module->m_Orient; double angle = module->GetOrientation();
NORMALIZE_ANGLE_POS( angle ); NORMALIZE_ANGLE_POS( angle );
RotatePoint( &m_Pos.x, &m_Pos.y, angle ); RotatePoint( &m_Pos.x, &m_Pos.y, angle );
m_Pos += Module->m_Pos; m_Pos += module->GetPosition();
} }
...@@ -139,17 +139,17 @@ void TEXTE_MODULE::SetDrawCoord() ...@@ -139,17 +139,17 @@ void TEXTE_MODULE::SetDrawCoord()
// anchor point) // anchor point)
void TEXTE_MODULE::SetLocalCoord() void TEXTE_MODULE::SetLocalCoord()
{ {
MODULE* Module = (MODULE*) m_Parent; MODULE* module = (MODULE*) m_Parent;
if( Module == NULL ) if( module == NULL )
{ {
m_Pos0 = m_Pos; m_Pos0 = m_Pos;
return; return;
} }
m_Pos0 = m_Pos - Module->m_Pos; m_Pos0 = m_Pos - module->m_Pos;
int angle = Module->m_Orient; int angle = module->m_Orient;
NORMALIZE_ANGLE_POS( angle ); NORMALIZE_ANGLE_POS( angle );
RotatePoint( &m_Pos0.x, &m_Pos0.y, -angle ); RotatePoint( &m_Pos0.x, &m_Pos0.y, -angle );
...@@ -242,7 +242,7 @@ void TEXTE_MODULE::Draw( EDA_DRAW_PANEL* panel, wxDC* DC, int draw_mode, const w ...@@ -242,7 +242,7 @@ void TEXTE_MODULE::Draw( EDA_DRAW_PANEL* panel, wxDC* DC, int draw_mode, const w
wxSize size; wxSize size;
wxPoint pos; // Center of text wxPoint pos; // Center of text
PCB_BASE_FRAME* frame; PCB_BASE_FRAME* frame;
MODULE* Module = (MODULE*) m_Parent; /* parent must *not* be null MODULE* module = (MODULE*) m_Parent; /* parent must *not* be null
* (a module text without a footprint * (a module text without a footprint
* parent has no sense) */ * parent has no sense) */
...@@ -282,16 +282,16 @@ void TEXTE_MODULE::Draw( EDA_DRAW_PANEL* panel, wxDC* DC, int draw_mode, const w ...@@ -282,16 +282,16 @@ void TEXTE_MODULE::Draw( EDA_DRAW_PANEL* panel, wxDC* DC, int draw_mode, const w
pos.x, pos.y + anchor_size, 0, color ); pos.x, pos.y + anchor_size, 0, color );
} }
color = brd->GetLayerColor(Module->GetLayer()); color = brd->GetLayerColor(module->GetLayer());
if( Module->GetLayer() == LAYER_N_BACK ) if( module->GetLayer() == LAYER_N_BACK )
{ {
if( brd->IsElementVisible( MOD_TEXT_BK_VISIBLE ) == false ) if( brd->IsElementVisible( MOD_TEXT_BK_VISIBLE ) == false )
return; return;
color = brd->GetVisibleElementColor(MOD_TEXT_BK_VISIBLE); color = brd->GetVisibleElementColor(MOD_TEXT_BK_VISIBLE);
} }
else if( Module->GetLayer() == LAYER_N_FRONT ) else if( module->GetLayer() == LAYER_N_FRONT )
{ {
if( brd->IsElementVisible( MOD_TEXT_FR_VISIBLE ) == false ) if( brd->IsElementVisible( MOD_TEXT_FR_VISIBLE ) == false )
return; return;
...@@ -336,12 +336,12 @@ void TEXTE_MODULE::DrawUmbilical( EDA_DRAW_PANEL* aPanel, ...@@ -336,12 +336,12 @@ void TEXTE_MODULE::DrawUmbilical( EDA_DRAW_PANEL* aPanel,
int TEXTE_MODULE::GetDrawRotation() const int TEXTE_MODULE::GetDrawRotation() const
{ {
int rotation; int rotation;
MODULE* Module = (MODULE*) m_Parent; MODULE* module = (MODULE*) m_Parent;
rotation = m_Orient; rotation = m_Orient;
if( Module ) if( module )
rotation += Module->m_Orient; rotation += module->m_Orient;
NORMALIZE_ANGLE_POS( rotation ); NORMALIZE_ANGLE_POS( rotation );
......
This diff is collapsed.
...@@ -117,6 +117,8 @@ public: ...@@ -117,6 +117,8 @@ public:
private: private:
int m_hole_count; ///< generates unique module names from eagle "hole"s.
NET_MAP m_pads_to_nets; NET_MAP m_pads_to_nets;
MODULE_MAP m_templates; ///< is part of a MODULE factory that operates MODULE_MAP m_templates; ///< is part of a MODULE factory that operates
......
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