kicad/gerbview/affiche.cpp

115 lines
3.5 KiB
C++
Raw Normal View History

2007-08-23 04:28:46 +00:00
/**********************************************************/
/* Routines d'affichage de parametres et caracteristiques */
/**********************************************************/
#include "fctsys.h"
#include "gr_basic.h"
#include "common.h"
#include "gerbview.h"
#include "pcbplot.h"
#include "protos.h"
/* Routines locales */
/****************************************************************************/
2007-08-23 04:28:46 +00:00
void Affiche_Infos_PCB_Texte( WinEDA_BasePcbFrame* frame, TEXTE_PCB* pt_texte )
/****************************************************************************/
2007-08-23 04:28:46 +00:00
/* Affiche en bas d'ecran les caract du texte sur PCB
2007-08-23 04:28:46 +00:00
* Entree :
* pointeur de la description du texte
*/
{
2007-08-23 04:28:46 +00:00
wxString Line;
2007-08-23 04:28:46 +00:00
frame->MsgPanel->EraseMsgBox();
2007-09-01 12:00:30 +00:00
if( pt_texte->Type() == TYPECOTATION )
2007-08-23 04:28:46 +00:00
Affiche_1_Parametre( frame, 1, _( "COTATION" ), pt_texte->m_Text, DARKGREEN );
2007-08-23 04:28:46 +00:00
else
Affiche_1_Parametre( frame, 1, _( "PCB Text" ), pt_texte->m_Text, DARKGREEN );
2007-08-23 04:28:46 +00:00
Line = _( "Layer " );
Line << pt_texte->GetLayer() + 1;
Affiche_1_Parametre( frame, 28, _( "Layer:" ), Line,
g_DesignSettings.m_LayerColor[pt_texte->GetLayer()] );
2007-08-23 04:28:46 +00:00
Affiche_1_Parametre( frame, 36, _( "Mirror" ), wxEmptyString, GREEN );
if( (pt_texte->m_Miroir & 1) )
Affiche_1_Parametre( frame, -1, wxEmptyString, _( "No" ), DARKGREEN );
else
Affiche_1_Parametre( frame, -1, wxEmptyString, _( "Yes" ), DARKGREEN );
2007-08-23 04:28:46 +00:00
Line.Printf( wxT( "%.1f" ), (float) pt_texte->m_Orient / 10 );
Affiche_1_Parametre( frame, 43, _( "Orient" ), Line, DARKGREEN );
2007-08-23 04:28:46 +00:00
valeur_param( pt_texte->m_Width, Line );
Affiche_1_Parametre( frame, 50, _( "Width" ), Line, MAGENTA );
2007-08-23 04:28:46 +00:00
valeur_param( pt_texte->m_Size.x, Line );
Affiche_1_Parametre( frame, 60, _( "H Size" ), Line, RED );
2007-08-23 04:28:46 +00:00
valeur_param( pt_texte->m_Size.y, Line );
Affiche_1_Parametre( frame, 70, _( "V Size" ), Line, RED );
}
/*********************************************************************/
2007-08-23 04:28:46 +00:00
void Affiche_Infos_Piste( WinEDA_BasePcbFrame* frame, TRACK* pt_piste )
/*********************************************************************/
/* Affiche les caract principales d'un segment de piste en bas d'ecran */
{
2007-08-23 04:28:46 +00:00
int d_index, ii = -1;
D_CODE* pt_D_code;
int layer = frame->GetScreen()->m_Active_Layer;
wxString msg;
frame->MsgPanel->EraseMsgBox();
2007-10-13 06:18:44 +00:00
d_index = pt_piste->GetNet();
2007-08-23 04:28:46 +00:00
pt_D_code = ReturnToolDescr( layer, d_index, &ii );
2007-09-01 12:00:30 +00:00
switch( pt_piste->Type() )
2007-08-23 04:28:46 +00:00
{
case TYPETRACK:
if( pt_piste->m_Shape < S_SPOT_CIRCLE )
msg = wxT( "LINE" );
else
msg = wxT( "FLASH" );
break;
case TYPEZONE:
msg = wxT( "ZONE" ); break;
2007-08-23 04:28:46 +00:00
default:
msg = wxT( "????" ); break;
}
Affiche_1_Parametre( frame, 1, _( "Type" ), msg, DARKCYAN );
msg.Printf( wxT( "%d" ), ii + 1 );
Affiche_1_Parametre( frame, 10, _( "Tool" ), msg, RED );
if( pt_D_code )
{
msg.Printf( wxT( "D%d" ), d_index );
Affiche_1_Parametre( frame, 20, _( "D CODE" ), msg, BLUE );
Affiche_1_Parametre( frame, 30, _( "D type" ),
pt_D_code ? g_GERBER_Tool_Type[pt_D_code->m_Shape] : _( "????" ),
BLUE );
}
msg.Printf( wxT( "%d" ), pt_piste->GetLayer() + 1 );
Affiche_1_Parametre( frame, 40, _( "Layer" ), msg, BROWN );
/* Affiche Epaisseur */
valeur_param( (unsigned) (pt_piste->m_Width), msg );
Affiche_1_Parametre( frame, 50, _( "Width" ), msg, DARKCYAN );
}