2007-08-20 01:20:48 +00:00
|
|
|
/**********************************************************/
|
|
|
|
/* Routines d'affichage de parametres et caracteristiques */
|
|
|
|
/**********************************************************/
|
2007-06-05 12:10:51 +00:00
|
|
|
|
|
|
|
#include "fctsys.h"
|
|
|
|
#include "gr_basic.h"
|
|
|
|
#include "common.h"
|
|
|
|
#include "pcbnew.h"
|
|
|
|
#include "autorout.h"
|
|
|
|
|
|
|
|
#include "3d_struct.h"
|
|
|
|
|
|
|
|
#include "protos.h"
|
|
|
|
|
|
|
|
/* Routines locales */
|
|
|
|
|
2007-08-20 01:20:48 +00:00
|
|
|
|
2007-06-05 12:10:51 +00:00
|
|
|
/*******************************************************************/
|
2007-08-20 01:20:48 +00:00
|
|
|
void Affiche_Infos_Equipot( int netcode, WinEDA_BasePcbFrame* frame )
|
2007-06-05 12:10:51 +00:00
|
|
|
/*******************************************************************/
|
|
|
|
/* Affiche les infos relatives a une equipot: nb de pads, nets , connexions.. */
|
|
|
|
{
|
2007-08-20 01:20:48 +00:00
|
|
|
int nb_vias = 0, ii;
|
|
|
|
EDA_BaseStruct* Struct;
|
|
|
|
wxString txt;
|
|
|
|
MODULE* module;
|
|
|
|
D_PAD* pad;
|
|
|
|
EQUIPOT* equipot;
|
2008-07-08 12:48:20 +00:00
|
|
|
double lengthnet = 0;
|
2007-08-20 01:20:48 +00:00
|
|
|
|
|
|
|
frame->MsgPanel->EraseMsgBox();
|
|
|
|
|
2009-01-05 05:21:35 +00:00
|
|
|
equipot = frame->GetBoard()->FindNet( netcode );
|
2007-08-20 01:20:48 +00:00
|
|
|
if( equipot )
|
2008-12-14 19:45:05 +00:00
|
|
|
Affiche_1_Parametre( frame, 1, _( "Net Name" ), equipot->GetNetname(), RED );
|
2007-08-20 01:20:48 +00:00
|
|
|
else
|
|
|
|
Affiche_1_Parametre( frame, 1, _( "No Net (not connected)" ), wxEmptyString, RED );
|
|
|
|
|
|
|
|
txt.Printf( wxT( "%d" ), netcode );
|
|
|
|
Affiche_1_Parametre( frame, 30, _( "Net Code" ), txt, RED );
|
|
|
|
|
2009-01-05 05:21:35 +00:00
|
|
|
for( ii = 0, module = frame->GetBoard()->m_Modules; module != 0;
|
2008-11-24 06:53:43 +00:00
|
|
|
module = module->Next() )
|
2007-08-20 01:20:48 +00:00
|
|
|
{
|
2008-11-24 06:53:43 +00:00
|
|
|
for( pad = module->m_Pads; pad != 0; pad = pad->Next() )
|
2007-08-20 01:20:48 +00:00
|
|
|
{
|
2007-10-13 06:18:44 +00:00
|
|
|
if( pad->GetNet() == netcode )
|
2007-08-20 01:20:48 +00:00
|
|
|
ii++;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
txt.Printf( wxT( "%d" ), ii );
|
|
|
|
Affiche_1_Parametre( frame, 40, _( "Pads" ), txt, DARKGREEN );
|
|
|
|
|
2009-01-05 05:21:35 +00:00
|
|
|
for( ii = 0, Struct = frame->GetBoard()->m_Track; Struct != NULL; Struct = Struct->Next() )
|
2007-08-20 01:20:48 +00:00
|
|
|
{
|
|
|
|
ii++;
|
2008-12-04 04:28:11 +00:00
|
|
|
if( Struct->Type() == TYPE_VIA )
|
2007-10-13 06:18:44 +00:00
|
|
|
if( ( (SEGVIA*) Struct )->GetNet() == netcode )
|
2007-08-20 01:20:48 +00:00
|
|
|
nb_vias++;
|
2008-12-04 04:28:11 +00:00
|
|
|
if( Struct->Type() == TYPE_TRACK )
|
2008-07-08 12:48:20 +00:00
|
|
|
if( ( (TRACK*) Struct )->GetNet() == netcode )
|
2008-11-24 06:53:43 +00:00
|
|
|
lengthnet += ( (TRACK*) Struct )->GetLength();
|
2007-08-20 01:20:48 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
txt.Printf( wxT( "%d" ), nb_vias );
|
|
|
|
Affiche_1_Parametre( frame, 50, _( "Vias" ), txt, BLUE );
|
2008-07-08 12:48:20 +00:00
|
|
|
|
|
|
|
valeur_param( (int) lengthnet, txt );
|
|
|
|
Affiche_1_Parametre( frame, 60, _( "Net Length" ), txt, RED );
|
2007-06-05 12:10:51 +00:00
|
|
|
}
|