2007-08-04 20:05:54 +00:00
|
|
|
|
/****************************************************/
|
|
|
|
|
/* class_module.cpp : fonctions de la classe MODULE */
|
|
|
|
|
/****************************************************/
|
2007-06-05 12:10:51 +00:00
|
|
|
|
|
|
|
|
|
#include "fctsys.h"
|
|
|
|
|
#include "gr_basic.h"
|
|
|
|
|
|
|
|
|
|
#include "wxstruct.h"
|
|
|
|
|
#include "common.h"
|
|
|
|
|
#include "pcbnew.h"
|
|
|
|
|
#include "trigo.h"
|
|
|
|
|
|
|
|
|
|
#ifdef PCBNEW
|
|
|
|
|
#include "autorout.h"
|
|
|
|
|
#include "drag.h"
|
|
|
|
|
#endif
|
|
|
|
|
|
|
|
|
|
#ifdef CVPCB
|
|
|
|
|
#include "cvpcb.h"
|
|
|
|
|
|
|
|
|
|
#endif
|
|
|
|
|
|
|
|
|
|
#include "protos.h"
|
|
|
|
|
|
2007-08-04 20:05:54 +00:00
|
|
|
|
/************************************************************************/
|
|
|
|
|
/* Class TEXTE_MODULE classe de base des elements type Texte sur module */
|
|
|
|
|
/************************************************************************/
|
2007-06-05 12:10:51 +00:00
|
|
|
|
|
|
|
|
|
/* Constructeur de TEXTE_MODULE */
|
2007-08-04 20:05:54 +00:00
|
|
|
|
TEXTE_MODULE::TEXTE_MODULE( MODULE* parent, int text_type ) :
|
2007-08-23 04:28:46 +00:00
|
|
|
|
BOARD_ITEM( parent, TYPETEXTEMODULE )
|
2007-06-05 12:10:51 +00:00
|
|
|
|
{
|
2007-08-04 20:05:54 +00:00
|
|
|
|
MODULE* Module = (MODULE*) m_Parent;
|
|
|
|
|
|
|
|
|
|
m_NoShow = 0; /* visible */
|
|
|
|
|
m_Type = text_type; /* Reference */
|
|
|
|
|
if( (m_Type != TEXT_is_REFERENCE) && (m_Type != TEXT_is_VALUE) )
|
|
|
|
|
m_Type = TEXT_is_DIVERS;
|
|
|
|
|
|
|
|
|
|
m_Size.x = m_Size.y = 400; m_Width = 120; /* dimensions raisonnables par defaut */
|
|
|
|
|
m_Orient = 0; /* en 1/10 degre */
|
|
|
|
|
m_Miroir = 1; // Mode normal (pas de miroir)
|
|
|
|
|
m_Unused = 0;
|
2007-08-23 04:28:46 +00:00
|
|
|
|
|
|
|
|
|
SetLayer( SILKSCREEN_N_CMP );
|
2007-09-01 12:00:30 +00:00
|
|
|
|
if( Module && (Module->Type() == TYPEMODULE) )
|
2007-08-04 20:05:54 +00:00
|
|
|
|
{
|
|
|
|
|
m_Pos = Module->m_Pos;
|
2007-08-23 04:28:46 +00:00
|
|
|
|
|
|
|
|
|
int moduleLayer = Module->GetLayer();
|
|
|
|
|
|
2007-10-07 18:24:15 +00:00
|
|
|
|
if( moduleLayer == COPPER_LAYER_N )
|
2007-08-23 04:28:46 +00:00
|
|
|
|
SetLayer( SILKSCREEN_N_CU );
|
|
|
|
|
else if( moduleLayer == CMP_N )
|
|
|
|
|
SetLayer( SILKSCREEN_N_CMP );
|
|
|
|
|
else
|
|
|
|
|
SetLayer( moduleLayer );
|
|
|
|
|
|
|
|
|
|
if( moduleLayer == SILKSCREEN_N_CU
|
|
|
|
|
|| moduleLayer == ADHESIVE_N_CU
|
2007-10-07 18:24:15 +00:00
|
|
|
|
|| moduleLayer == COPPER_LAYER_N )
|
2007-08-23 04:28:46 +00:00
|
|
|
|
{
|
2007-08-04 20:05:54 +00:00
|
|
|
|
m_Miroir = 0;
|
2007-08-23 04:28:46 +00:00
|
|
|
|
}
|
2007-08-04 20:05:54 +00:00
|
|
|
|
}
|
2007-06-05 12:10:51 +00:00
|
|
|
|
}
|
|
|
|
|
|
2007-08-04 20:05:54 +00:00
|
|
|
|
|
2007-09-01 12:00:30 +00:00
|
|
|
|
TEXTE_MODULE::~TEXTE_MODULE()
|
2007-06-05 12:10:51 +00:00
|
|
|
|
{
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
2007-10-30 21:30:58 +00:00
|
|
|
|
bool TEXTE_MODULE::Save( FILE* aFile ) const
|
|
|
|
|
{
|
|
|
|
|
MODULE* parent = (MODULE*) GetParent();
|
|
|
|
|
int orient = m_Orient;
|
|
|
|
|
|
|
|
|
|
if( parent )
|
|
|
|
|
orient += parent->m_Orient;
|
|
|
|
|
|
|
|
|
|
int ret = fprintf( aFile, "T%d %d %d %d %d %d %d %c %c %d \"%.16s\"\n",
|
|
|
|
|
m_Type,
|
|
|
|
|
m_Pos0.x, m_Pos0.y,
|
|
|
|
|
m_Size.y, m_Size.x,
|
|
|
|
|
orient,
|
|
|
|
|
m_Width,
|
|
|
|
|
m_Miroir ? 'N' : 'M', m_NoShow ? 'I' : 'V',
|
|
|
|
|
GetLayer(),
|
|
|
|
|
CONV_TO_UTF8( m_Text ) );
|
|
|
|
|
|
|
|
|
|
return (ret > 20);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
2007-08-04 20:05:54 +00:00
|
|
|
|
void TEXTE_MODULE::Copy( TEXTE_MODULE* source ) // copy structure
|
2007-06-05 12:10:51 +00:00
|
|
|
|
{
|
2007-08-04 20:05:54 +00:00
|
|
|
|
if( source == NULL )
|
|
|
|
|
return;
|
2007-06-05 12:10:51 +00:00
|
|
|
|
|
2007-08-04 20:05:54 +00:00
|
|
|
|
m_Pos = source->m_Pos;
|
2007-08-23 04:28:46 +00:00
|
|
|
|
SetLayer( source->GetLayer() );
|
2007-06-05 12:10:51 +00:00
|
|
|
|
|
2007-08-04 20:05:54 +00:00
|
|
|
|
m_Miroir = source->m_Miroir; // vue normale / miroir
|
|
|
|
|
m_NoShow = source->m_NoShow; // 0: visible 1: invisible
|
|
|
|
|
m_Type = source->m_Type; // 0: ref,1: val, autre = 2..255
|
|
|
|
|
m_Orient = source->m_Orient; // orientation en 1/10 degre
|
|
|
|
|
m_Pos0 = source->m_Pos0; // coord du debut du texte /ancre, orient 0
|
2007-06-05 12:10:51 +00:00
|
|
|
|
|
2007-08-04 20:05:54 +00:00
|
|
|
|
m_Size = source->m_Size;
|
|
|
|
|
m_Width = source->m_Width;
|
2007-06-05 12:10:51 +00:00
|
|
|
|
|
2007-08-04 20:05:54 +00:00
|
|
|
|
m_Text = source->m_Text;
|
2007-06-05 12:10:51 +00:00
|
|
|
|
}
|
|
|
|
|
|
2007-08-04 20:05:54 +00:00
|
|
|
|
|
2007-06-05 12:10:51 +00:00
|
|
|
|
/* supprime du chainage la structure Struct
|
2007-08-04 20:05:54 +00:00
|
|
|
|
* les structures arrieres et avant sont chainees directement
|
2007-06-05 12:10:51 +00:00
|
|
|
|
*/
|
2007-09-01 12:00:30 +00:00
|
|
|
|
void TEXTE_MODULE::UnLink()
|
2007-06-05 12:10:51 +00:00
|
|
|
|
{
|
2007-08-04 20:05:54 +00:00
|
|
|
|
/* Modification du chainage arriere */
|
|
|
|
|
if( Pback )
|
|
|
|
|
{
|
2007-09-01 12:00:30 +00:00
|
|
|
|
if( Pback->Type() != TYPEMODULE )
|
2007-08-04 20:05:54 +00:00
|
|
|
|
{
|
|
|
|
|
Pback->Pnext = Pnext;
|
|
|
|
|
}
|
|
|
|
|
else /* Le chainage arriere pointe sur la structure "Pere" */
|
|
|
|
|
{
|
2007-08-23 04:28:46 +00:00
|
|
|
|
( (MODULE*) Pback )->m_Drawings = (BOARD_ITEM*) Pnext;
|
2007-08-04 20:05:54 +00:00
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/* Modification du chainage avant */
|
|
|
|
|
if( Pnext )
|
|
|
|
|
Pnext->Pback = Pback;
|
|
|
|
|
|
|
|
|
|
Pnext = Pback = NULL;
|
2007-06-05 12:10:51 +00:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/******************************************/
|
2007-09-01 12:00:30 +00:00
|
|
|
|
int TEXTE_MODULE:: GetLength()
|
2007-06-05 12:10:51 +00:00
|
|
|
|
/******************************************/
|
|
|
|
|
{
|
2007-08-04 20:05:54 +00:00
|
|
|
|
return m_Text.Len();
|
2007-06-05 12:10:51 +00:00
|
|
|
|
}
|
|
|
|
|
|
2007-08-04 20:05:54 +00:00
|
|
|
|
|
2007-06-05 12:10:51 +00:00
|
|
|
|
/******************************************/
|
2007-08-04 20:05:54 +00:00
|
|
|
|
void TEXTE_MODULE:: SetWidth( int new_width )
|
2007-06-05 12:10:51 +00:00
|
|
|
|
/******************************************/
|
|
|
|
|
{
|
2007-08-04 20:05:54 +00:00
|
|
|
|
m_Width = new_width;
|
2007-06-05 12:10:51 +00:00
|
|
|
|
}
|
|
|
|
|
|
2007-08-04 20:05:54 +00:00
|
|
|
|
|
|
|
|
|
// mise a jour des coordonn<6E>s absolues pour affichage
|
2007-09-01 12:00:30 +00:00
|
|
|
|
void TEXTE_MODULE:: SetDrawCoord()
|
2007-06-05 12:10:51 +00:00
|
|
|
|
{
|
2007-08-04 20:05:54 +00:00
|
|
|
|
MODULE* Module = (MODULE*) m_Parent;
|
2007-06-05 12:10:51 +00:00
|
|
|
|
|
2007-08-04 20:05:54 +00:00
|
|
|
|
m_Pos = m_Pos0;
|
2007-06-05 12:10:51 +00:00
|
|
|
|
|
2007-08-04 20:05:54 +00:00
|
|
|
|
if( Module == NULL )
|
|
|
|
|
return;
|
2007-06-05 12:10:51 +00:00
|
|
|
|
|
2007-08-04 20:05:54 +00:00
|
|
|
|
int angle = Module->m_Orient;
|
|
|
|
|
NORMALIZE_ANGLE_POS( angle );
|
2007-06-05 12:10:51 +00:00
|
|
|
|
|
2007-08-04 20:05:54 +00:00
|
|
|
|
RotatePoint( &m_Pos.x, &m_Pos.y, angle );
|
|
|
|
|
m_Pos.x += Module->m_Pos.x;
|
|
|
|
|
m_Pos.y += Module->m_Pos.y;
|
2007-06-05 12:10:51 +00:00
|
|
|
|
}
|
|
|
|
|
|
2007-08-04 20:05:54 +00:00
|
|
|
|
|
|
|
|
|
// mise a jour des coordonn<6E>s relatives au module
|
2007-09-01 12:00:30 +00:00
|
|
|
|
void TEXTE_MODULE:: SetLocalCoord()
|
2007-06-05 12:10:51 +00:00
|
|
|
|
{
|
2007-08-04 20:05:54 +00:00
|
|
|
|
MODULE* Module = (MODULE*) m_Parent;
|
2007-06-05 12:10:51 +00:00
|
|
|
|
|
2007-08-04 20:05:54 +00:00
|
|
|
|
if( Module == NULL )
|
|
|
|
|
return;
|
2007-06-05 12:10:51 +00:00
|
|
|
|
|
2007-08-04 20:05:54 +00:00
|
|
|
|
m_Pos0.x = m_Pos.x - Module->m_Pos.x;
|
|
|
|
|
m_Pos0.y = m_Pos.y - Module->m_Pos.y;
|
2007-06-05 12:10:51 +00:00
|
|
|
|
|
2007-08-04 20:05:54 +00:00
|
|
|
|
int angle = Module->m_Orient;
|
|
|
|
|
NORMALIZE_ANGLE_POS( angle );
|
2007-06-05 12:10:51 +00:00
|
|
|
|
|
2007-08-04 20:05:54 +00:00
|
|
|
|
RotatePoint( &m_Pos0.x, &m_Pos0.y, -angle );
|
2007-06-05 12:10:51 +00:00
|
|
|
|
}
|
|
|
|
|
|
2007-08-04 20:05:54 +00:00
|
|
|
|
|
|
|
|
|
/* locate functions */
|
|
|
|
|
bool TEXTE_MODULE::HitTest( const wxPoint& posref )
|
2007-06-05 12:10:51 +00:00
|
|
|
|
{
|
2007-08-04 20:05:54 +00:00
|
|
|
|
int mX, mY, dx, dy;
|
|
|
|
|
MODULE* Module = (MODULE*) m_Parent;
|
|
|
|
|
int angle = m_Orient;
|
|
|
|
|
|
|
|
|
|
if( Module )
|
|
|
|
|
angle += Module->m_Orient;
|
|
|
|
|
|
|
|
|
|
dx = ( m_Size.x * GetLength() ) / 2;
|
|
|
|
|
dy = m_Size.y / 2;
|
|
|
|
|
dx = ( (dx * 10) / 9 ) + m_Width; /* Facteur de forme des lettres : 10/9 */
|
|
|
|
|
|
|
|
|
|
/* le point de reference est tourn<72>de - angle
|
|
|
|
|
* pour se ramener a un rectangle de reference horizontal */
|
|
|
|
|
mX = posref.x - m_Pos.x;
|
|
|
|
|
mY = posref.y - m_Pos.y;
|
|
|
|
|
|
|
|
|
|
RotatePoint( &mX, &mY, -angle );
|
|
|
|
|
|
|
|
|
|
/* le point de reference est-il dans ce rectangle */
|
|
|
|
|
if( ( abs( mX ) <= abs( dx ) ) && ( abs( mY ) <= abs( dy ) ) )
|
|
|
|
|
{
|
|
|
|
|
return true;
|
|
|
|
|
}
|
|
|
|
|
return false;
|
2007-06-05 12:10:51 +00:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/******************************************************************************************/
|
2007-08-04 20:05:54 +00:00
|
|
|
|
void TEXTE_MODULE::Draw( WinEDA_DrawPanel* panel, wxDC* DC, wxPoint offset, int draw_mode )
|
2007-06-05 12:10:51 +00:00
|
|
|
|
/******************************************************************************************/
|
2007-08-04 20:05:54 +00:00
|
|
|
|
|
2007-06-05 12:10:51 +00:00
|
|
|
|
/* trace 1 texte de module
|
2007-08-04 20:05:54 +00:00
|
|
|
|
* Utilise la police definie dans grfonte.h
|
|
|
|
|
* (Se reporter a ce fichier pour les explications complementaires)
|
|
|
|
|
* offset = offset de trace ( reference au centre du texte)
|
|
|
|
|
* draw_mode = GR_OR, GR_XOR..
|
|
|
|
|
*/
|
2007-06-05 12:10:51 +00:00
|
|
|
|
{
|
2007-08-04 20:05:54 +00:00
|
|
|
|
int zoom;
|
|
|
|
|
int width, color, orient, miroir;
|
|
|
|
|
wxSize size;
|
|
|
|
|
wxPoint pos; // Centre du texte
|
|
|
|
|
PCB_SCREEN* screen;
|
|
|
|
|
WinEDA_BasePcbFrame* frame;
|
|
|
|
|
MODULE* Module = (MODULE*) m_Parent;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if( panel == NULL )
|
|
|
|
|
return;
|
|
|
|
|
|
|
|
|
|
screen = (PCB_SCREEN*) panel->GetScreen();
|
|
|
|
|
frame = (WinEDA_BasePcbFrame*) panel->m_Parent;
|
|
|
|
|
zoom = screen->GetZoom();
|
|
|
|
|
|
|
|
|
|
pos.x = m_Pos.x - offset.x;
|
|
|
|
|
pos.y = m_Pos.y - offset.y;
|
|
|
|
|
|
|
|
|
|
size = m_Size;
|
|
|
|
|
orient = GetDrawRotation();
|
|
|
|
|
miroir = m_Miroir & 1; // = 0 si vu en miroir
|
|
|
|
|
width = m_Width;
|
2007-09-01 12:00:30 +00:00
|
|
|
|
|
2007-08-04 20:05:54 +00:00
|
|
|
|
if( (frame->m_DisplayModText == FILAIRE) || ( (width / zoom) < L_MIN_DESSIN ) )
|
|
|
|
|
width = 0;
|
|
|
|
|
else if( frame->m_DisplayModText == SKETCH )
|
|
|
|
|
width = -width;
|
|
|
|
|
|
|
|
|
|
GRSetDrawMode( DC, draw_mode );
|
|
|
|
|
|
|
|
|
|
/* trace du centre du texte */
|
|
|
|
|
if( (g_AnchorColor & ITEM_NOT_SHOW) == 0 )
|
|
|
|
|
{
|
|
|
|
|
int anchor_size = 2 * zoom;
|
|
|
|
|
GRLine( &panel->m_ClipBox, DC,
|
|
|
|
|
pos.x - anchor_size, pos.y,
|
|
|
|
|
pos.x + anchor_size, pos.y, 0, g_AnchorColor );
|
|
|
|
|
GRLine( &panel->m_ClipBox, DC,
|
|
|
|
|
pos.x, pos.y - anchor_size,
|
|
|
|
|
pos.x, pos.y + anchor_size, 0, g_AnchorColor );
|
|
|
|
|
}
|
|
|
|
|
|
2007-08-23 04:28:46 +00:00
|
|
|
|
color = g_DesignSettings.m_LayerColor[Module->GetLayer()];
|
2007-08-04 20:05:54 +00:00
|
|
|
|
|
2007-10-07 18:24:15 +00:00
|
|
|
|
if( Module && Module->GetLayer() == COPPER_LAYER_N )
|
2007-08-04 20:05:54 +00:00
|
|
|
|
color = g_ModuleTextCUColor;
|
2007-08-23 04:28:46 +00:00
|
|
|
|
|
|
|
|
|
else if( Module && Module->GetLayer() == CMP_N )
|
2007-08-04 20:05:54 +00:00
|
|
|
|
color = g_ModuleTextCMPColor;
|
|
|
|
|
|
|
|
|
|
if( (color & ITEM_NOT_SHOW) != 0 )
|
|
|
|
|
return;
|
|
|
|
|
|
|
|
|
|
if( m_NoShow )
|
|
|
|
|
color = g_ModuleTextNOVColor;
|
2007-09-01 12:00:30 +00:00
|
|
|
|
|
2007-08-04 20:05:54 +00:00
|
|
|
|
if( (color & ITEM_NOT_SHOW) != 0 )
|
|
|
|
|
return;
|
|
|
|
|
|
|
|
|
|
/* Si le texte doit etre mis en miroir: modif des parametres */
|
|
|
|
|
if( miroir == 0 )
|
|
|
|
|
size.x = -size.x;
|
|
|
|
|
|
|
|
|
|
/* Trace du texte */
|
|
|
|
|
DrawGraphicText( panel, DC, pos, color, m_Text,
|
|
|
|
|
orient, size, GR_TEXT_HJUSTIFY_CENTER, GR_TEXT_VJUSTIFY_CENTER, width );
|
2007-06-05 12:10:51 +00:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/******************************************/
|
2007-09-01 12:00:30 +00:00
|
|
|
|
int TEXTE_MODULE::GetDrawRotation()
|
2007-06-05 12:10:51 +00:00
|
|
|
|
/******************************************/
|
2007-08-04 20:05:54 +00:00
|
|
|
|
|
2007-06-05 12:10:51 +00:00
|
|
|
|
/* Return text rotation for drawings and plotting
|
2007-08-04 20:05:54 +00:00
|
|
|
|
*/
|
2007-06-05 12:10:51 +00:00
|
|
|
|
{
|
2007-08-04 20:05:54 +00:00
|
|
|
|
int rotation;
|
|
|
|
|
MODULE* Module = (MODULE*) m_Parent;
|
|
|
|
|
|
|
|
|
|
rotation = m_Orient;
|
|
|
|
|
if( Module )
|
|
|
|
|
rotation += Module->m_Orient;
|
|
|
|
|
|
|
|
|
|
NORMALIZE_ANGLE_POS( rotation );
|
2007-06-05 12:10:51 +00:00
|
|
|
|
|
|
|
|
|
// if( (rotation > 900 ) && (rotation < 2700 ) ) rotation -= 1800; // For angle = 0 .. 180 deg
|
2007-08-04 20:05:54 +00:00
|
|
|
|
while( rotation > 900 )
|
|
|
|
|
rotation -= 1800;
|
|
|
|
|
|
|
|
|
|
// For angle = -90 .. 90 deg
|
2007-06-05 12:10:51 +00:00
|
|
|
|
|
2007-08-04 20:05:54 +00:00
|
|
|
|
return rotation;
|
|
|
|
|
}
|
2007-08-06 20:26:59 +00:00
|
|
|
|
|
2007-08-20 19:33:15 +00:00
|
|
|
|
|
|
|
|
|
// see class_text_mod.h
|
|
|
|
|
void TEXTE_MODULE::Display_Infos( WinEDA_DrawFrame* frame )
|
|
|
|
|
{
|
|
|
|
|
wxString msg, Line;
|
|
|
|
|
int ii;
|
|
|
|
|
|
|
|
|
|
MODULE* module = (MODULE*) m_Parent;
|
|
|
|
|
|
|
|
|
|
if( !module )
|
|
|
|
|
return;
|
|
|
|
|
|
|
|
|
|
static const wxString text_type_msg[3] = {
|
|
|
|
|
_( "Ref." ), _( "Value" ), _( "Text" ) };
|
|
|
|
|
|
|
|
|
|
frame->MsgPanel->EraseMsgBox();
|
|
|
|
|
|
|
|
|
|
Line = module->m_Reference->m_Text;
|
|
|
|
|
Affiche_1_Parametre( frame, 1, _( "Module" ), Line, DARKCYAN );
|
|
|
|
|
|
|
|
|
|
Line = m_Text;
|
|
|
|
|
Affiche_1_Parametre( frame, 10, _( "Text" ), Line, YELLOW );
|
|
|
|
|
|
|
|
|
|
ii = m_Type;
|
|
|
|
|
if( ii > 2 )
|
|
|
|
|
ii = 2;
|
|
|
|
|
|
|
|
|
|
Affiche_1_Parametre( frame, 20, _( "Type" ), text_type_msg[ii], DARKGREEN );
|
|
|
|
|
|
|
|
|
|
Affiche_1_Parametre( frame, 25, _( "Display" ), wxEmptyString, DARKGREEN );
|
|
|
|
|
if( m_NoShow )
|
|
|
|
|
Affiche_1_Parametre( frame, -1, wxEmptyString, _( "No" ), DARKGREEN );
|
|
|
|
|
else
|
|
|
|
|
Affiche_1_Parametre( frame, -1, wxEmptyString, _( "Yes" ), DARKGREEN );
|
|
|
|
|
|
|
|
|
|
ii = m_Layer;
|
2007-10-07 03:08:24 +00:00
|
|
|
|
if( ii < NB_LAYERS )
|
2007-08-20 19:33:15 +00:00
|
|
|
|
Affiche_1_Parametre( frame, 28, _( "Layer" ), ReturnPcbLayerName( ii ), DARKGREEN );
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
msg.Printf( wxT( "%d" ), ii );
|
|
|
|
|
Affiche_1_Parametre( frame, 28, _( "Layer" ), msg, DARKGREEN );
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
msg = wxT( " Yes" );
|
|
|
|
|
if( m_Miroir & 1 )
|
|
|
|
|
msg = wxT( " No" );
|
|
|
|
|
|
|
|
|
|
Affiche_1_Parametre( frame, 36, _( "Mirror" ), msg, DARKGREEN );
|
|
|
|
|
|
|
|
|
|
msg.Printf( wxT( "%.1f" ), (float) m_Orient / 10 );
|
|
|
|
|
Affiche_1_Parametre( frame, 42, _( "Orient" ), msg, DARKGREEN );
|
|
|
|
|
|
|
|
|
|
valeur_param( m_Width, msg );
|
|
|
|
|
Affiche_1_Parametre( frame, 48, _( "Width" ), msg, DARKGREEN );
|
|
|
|
|
|
|
|
|
|
valeur_param( m_Size.x, msg );
|
|
|
|
|
Affiche_1_Parametre( frame, 56, _( "H Size" ), msg, RED );
|
|
|
|
|
|
|
|
|
|
valeur_param( m_Size.y, msg );
|
|
|
|
|
Affiche_1_Parametre( frame, 64, _( "V Size" ), msg, RED );
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
2007-08-24 03:40:04 +00:00
|
|
|
|
// see class_text_mod.h
|
|
|
|
|
bool TEXTE_MODULE::IsOnLayer( int aLayer ) const
|
|
|
|
|
{
|
|
|
|
|
if( m_Layer == aLayer )
|
|
|
|
|
return true;
|
|
|
|
|
|
|
|
|
|
/* test the parent, which is a MODULE */
|
|
|
|
|
if( aLayer == GetParent()->GetLayer() )
|
|
|
|
|
return true;
|
|
|
|
|
|
2007-10-07 18:24:15 +00:00
|
|
|
|
if( aLayer == COPPER_LAYER_N )
|
2007-08-24 03:40:04 +00:00
|
|
|
|
{
|
|
|
|
|
if( m_Layer==ADHESIVE_N_CU || m_Layer==SILKSCREEN_N_CU )
|
|
|
|
|
return true;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
else if( aLayer == CMP_N )
|
|
|
|
|
{
|
|
|
|
|
if( m_Layer==ADHESIVE_N_CMP || m_Layer==SILKSCREEN_N_CMP )
|
|
|
|
|
return true;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return false;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/* see class_text_mod.h
|
|
|
|
|
bool TEXTE_MODULE::IsOnOneOfTheseLayers( int aLayerMask ) const
|
|
|
|
|
{
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
|
2007-08-06 20:26:59 +00:00
|
|
|
|
#if defined(DEBUG)
|
|
|
|
|
/**
|
|
|
|
|
* Function Show
|
|
|
|
|
* is used to output the object tree, currently for debugging only.
|
|
|
|
|
* @param nestLevel An aid to prettier tree indenting, and is the level
|
|
|
|
|
* of nesting of this object within the overall tree.
|
|
|
|
|
* @param os The ostream& to output to.
|
|
|
|
|
*/
|
|
|
|
|
void TEXTE_MODULE::Show( int nestLevel, std::ostream& os )
|
|
|
|
|
{
|
2007-08-08 03:50:44 +00:00
|
|
|
|
// for now, make it look like XML:
|
|
|
|
|
NestedSpace( nestLevel, os ) << '<' << GetClass().Lower().mb_str() <<
|
|
|
|
|
" string=\"" << m_Text.mb_str() << "\"/>\n";
|
2007-08-06 20:26:59 +00:00
|
|
|
|
|
2007-08-08 03:50:44 +00:00
|
|
|
|
// NestedSpace( nestLevel, os ) << "</" << GetClass().Lower().mb_str() << ">\n";
|
2007-08-06 20:26:59 +00:00
|
|
|
|
}
|
|
|
|
|
#endif
|