2007-08-20 01:20:48 +00:00
|
|
|
/******************************************/
|
|
|
|
/* Track editing: attribute flags edition */
|
|
|
|
/******************************************/
|
2007-06-05 12:10:51 +00:00
|
|
|
|
|
|
|
#include "fctsys.h"
|
|
|
|
|
|
|
|
#include "common.h"
|
|
|
|
#include "pcbnew.h"
|
|
|
|
#include "autorout.h"
|
|
|
|
|
|
|
|
#include "protos.h"
|
|
|
|
|
|
|
|
|
|
|
|
/*****************************************************************************/
|
2007-08-20 01:20:48 +00:00
|
|
|
void WinEDA_PcbFrame::Attribut_Segment( TRACK* track, wxDC* DC, bool Flag_On )
|
2007-06-05 12:10:51 +00:00
|
|
|
/*****************************************************************************/
|
2007-08-20 01:20:48 +00:00
|
|
|
|
2007-06-05 12:10:51 +00:00
|
|
|
/* Attribute change for 1 track segment.
|
2007-08-20 01:20:48 +00:00
|
|
|
* Attributes are
|
|
|
|
* SEGM_FIXE protection against global delete
|
|
|
|
* SEGM_AR AutoRouted segment
|
|
|
|
*/
|
2007-06-05 12:10:51 +00:00
|
|
|
{
|
2007-08-20 01:20:48 +00:00
|
|
|
if( track == NULL )
|
|
|
|
return;
|
|
|
|
|
|
|
|
GetScreen()->SetModify();
|
|
|
|
DrawPanel->CursorOff( DC ); // Erase cursor shape
|
|
|
|
track->SetState( SEGM_FIXE, Flag_On );
|
|
|
|
track->Draw( DrawPanel, DC, GR_OR | GR_SURBRILL );
|
|
|
|
DrawPanel->CursorOn( DC ); // Display cursor shape
|
2007-08-20 19:33:15 +00:00
|
|
|
track->Display_Infos( this );
|
2007-06-05 12:10:51 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/***************************************************************************/
|
2007-08-20 01:20:48 +00:00
|
|
|
void WinEDA_PcbFrame::Attribut_Track( TRACK* track, wxDC* DC, bool Flag_On )
|
2007-06-05 12:10:51 +00:00
|
|
|
/***************************************************************************/
|
|
|
|
/* Attribute change for an entire track */
|
|
|
|
{
|
2007-08-20 01:20:48 +00:00
|
|
|
TRACK* Track;
|
|
|
|
int nb_segm;
|
|
|
|
|
|
|
|
if( (track == NULL ) || (track->m_StructType == TYPEZONE) )
|
|
|
|
return;
|
2007-06-05 12:10:51 +00:00
|
|
|
|
2007-08-20 01:20:48 +00:00
|
|
|
DrawPanel->CursorOff( DC ); // Erase cursor shape
|
|
|
|
Track = Marque_Une_Piste( this, DC, track, &nb_segm, GR_OR | GR_SURBRILL );
|
2007-06-05 12:10:51 +00:00
|
|
|
|
2007-08-20 01:20:48 +00:00
|
|
|
for( ; (Track != NULL) && (nb_segm > 0); nb_segm-- )
|
|
|
|
{
|
|
|
|
Track->SetState( SEGM_FIXE, Flag_On );
|
|
|
|
Track->SetState( BUSY, OFF );
|
|
|
|
Track = (TRACK*) Track->Pnext;
|
|
|
|
}
|
2007-06-05 12:10:51 +00:00
|
|
|
|
2007-08-20 01:20:48 +00:00
|
|
|
DrawPanel->CursorOn( DC ); // Display cursor shape
|
2007-06-05 12:10:51 +00:00
|
|
|
|
2007-08-20 01:20:48 +00:00
|
|
|
GetScreen()->SetModify();
|
2007-06-05 12:10:51 +00:00
|
|
|
}
|
|
|
|
|
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 WinEDA_PcbFrame::Attribut_net( wxDC* DC, int net_code, bool Flag_On )
|
2007-06-05 12:10:51 +00:00
|
|
|
/***********************************************************************/
|
2007-08-20 01:20:48 +00:00
|
|
|
|
2007-06-05 12:10:51 +00:00
|
|
|
/* Modify the flag SEGM_FIXE according to Flag_On value,
|
2007-08-20 01:20:48 +00:00
|
|
|
* for all the segments related to net_code.
|
|
|
|
* if net_code < 0 all the segments are modified.
|
|
|
|
*/
|
2007-06-05 12:10:51 +00:00
|
|
|
{
|
2007-08-20 01:20:48 +00:00
|
|
|
TRACK* Track = m_Pcb->m_Track;
|
|
|
|
|
|
|
|
/* search the first segment for the selected net_code */
|
|
|
|
if( net_code >= 0 )
|
|
|
|
{
|
|
|
|
for( ; Track != NULL; Track = (TRACK*) Track->Pnext )
|
|
|
|
{
|
|
|
|
if( net_code == Track->m_NetCode )
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
DrawPanel->CursorOff( DC ); // Erase cursor shape
|
|
|
|
while( Track ) /* Flag change */
|
|
|
|
{
|
|
|
|
if( (net_code >= 0 ) && (net_code != Track->m_NetCode) )
|
|
|
|
break;
|
|
|
|
GetScreen()->SetModify();
|
|
|
|
Track->SetState( SEGM_FIXE, Flag_On );
|
|
|
|
Track->Draw( DrawPanel, DC, GR_OR | GR_SURBRILL );
|
|
|
|
Track = Track->Next();
|
|
|
|
}
|
|
|
|
|
|
|
|
DrawPanel->CursorOn( DC ); // Display cursor shape
|
|
|
|
GetScreen()->SetModify();
|
2007-06-05 12:10:51 +00:00
|
|
|
}
|