Commit 89535a13 authored by charras's avatar charras

some enhancements and cleanup. Fixed problem when deleting Netclasses in Design rules dialog window

parent ae12e698
...@@ -150,8 +150,9 @@ public: ...@@ -150,8 +150,9 @@ public:
* of "selecting" an item more formal, and to indivisibly tie the operation * of "selecting" an item more formal, and to indivisibly tie the operation
* of selecting an item to displaying it using BOARD_ITEM::Display_Infos(). * of selecting an item to displaying it using BOARD_ITEM::Display_Infos().
* @param aItem The BOARD_ITEM to make the selected item or NULL if none. * @param aItem The BOARD_ITEM to make the selected item or NULL if none.
* @param aDisplayInfo = true to display item info, false if not (default = true)
*/ */
void SetCurItem( BOARD_ITEM* aItem ); void SetCurItem( BOARD_ITEM* aItem, bool aDisplayInfo = true );
BOARD_ITEM* GetCurItem(); BOARD_ITEM* GetCurItem();
/** /**
......
...@@ -126,7 +126,6 @@ set(PCBNEW_SRCS ...@@ -126,7 +126,6 @@ set(PCBNEW_SRCS
plot_rtn.cpp plot_rtn.cpp
queue.cpp queue.cpp
ratsnest.cpp ratsnest.cpp
router.cpp
set_color.cpp set_color.cpp
set_grid.cpp set_grid.cpp
solve.cpp solve.cpp
......
...@@ -245,13 +245,14 @@ void WinEDA_BasePcbFrame::ProcessItemSelection( wxCommandEvent& event ) ...@@ -245,13 +245,14 @@ void WinEDA_BasePcbFrame::ProcessItemSelection( wxCommandEvent& event )
/*****************************************************************/ /*****************************************************************/
void WinEDA_BasePcbFrame::SetCurItem( BOARD_ITEM* aItem ) void WinEDA_BasePcbFrame::SetCurItem( BOARD_ITEM* aItem, bool aDisplayInfo )
/*****************************************************************/ /*****************************************************************/
{ {
GetScreen()->SetCurItem( aItem ); GetScreen()->SetCurItem( aItem );
if( aItem ) if( aItem )
{ {
if( aDisplayInfo )
aItem->DisplayInfo( this ); aItem->DisplayInfo( this );
#if 0 && defined(DEBUG) #if 0 && defined(DEBUG)
......
...@@ -133,7 +133,7 @@ int TRACK::GetDrillValue() const ...@@ -133,7 +133,7 @@ int TRACK::GetDrillValue() const
double TRACK::GetLength() double TRACK::GetLength()
{ {
wxPoint delta = m_End - m_Start; wxPoint delta = m_End - m_Start;
return sqrt( (double)delta.x*delta.x + (double)delta.y*delta.y ); return sqrt( ((double)delta.x*delta.x) + ((double)delta.y*delta.y ) );
} }
/***********************/ /***********************/
...@@ -906,6 +906,31 @@ void TRACK::DisplayInfo( WinEDA_DrawFrame* frame ) ...@@ -906,6 +906,31 @@ void TRACK::DisplayInfo( WinEDA_DrawFrame* frame )
wxString msg; wxString msg;
BOARD* board = ( (WinEDA_BasePcbFrame*) frame )->GetBoard(); BOARD* board = ( (WinEDA_BasePcbFrame*) frame )->GetBoard();
// Display basic infos
DisplayInfoBase( frame );
// Display full track length (in pcbnew)
if( frame->m_Ident == PCB_FRAME )
{
int trackLen = 0;
Marque_Une_Piste( board, this, NULL, &trackLen, false );
valeur_param( trackLen, msg );
frame->MsgPanel->AppendMessage( _( "Track Len" ), msg, DARKCYAN );
}
}
/*
* Function DisplayInfoBase
* has knowledge about the frame and how and where to put status information
* about this object into the frame's message panel.
* Display info about the track segment only, and does not calculate the full track length
* @param frame A WinEDA_DrawFrame in which to print status information.
*/
void TRACK::DisplayInfoBase( WinEDA_DrawFrame* frame )
{
wxString msg;
BOARD* board = ( (WinEDA_BasePcbFrame*) frame )->GetBoard();
frame->MsgPanel->EraseMsgBox(); frame->MsgPanel->EraseMsgBox();
switch( Type() ) switch( Type() )
...@@ -1018,15 +1043,6 @@ void TRACK::DisplayInfo( WinEDA_DrawFrame* frame ) ...@@ -1018,15 +1043,6 @@ void TRACK::DisplayInfo( WinEDA_DrawFrame* frame )
valeur_param( wxRound( GetLength() ), msg ); valeur_param( wxRound( GetLength() ), msg );
frame->MsgPanel->AppendMessage( _( "Seg Len" ), msg, DARKCYAN ); frame->MsgPanel->AppendMessage( _( "Seg Len" ), msg, DARKCYAN );
} }
// Display full track length (in pcbnew)
if( frame->m_Ident == PCB_FRAME )
{
int trackLen;
Marque_Une_Piste( board, this, NULL, &trackLen, false );
valeur_param( trackLen, msg );
frame->MsgPanel->AppendMessage( _( "Track Len" ), msg, DARKCYAN );
}
} }
......
...@@ -201,10 +201,19 @@ public: ...@@ -201,10 +201,19 @@ public:
* has knowledge about the frame and how and where to put status information * has knowledge about the frame and how and where to put status information
* about this object into the frame's message panel. * about this object into the frame's message panel.
* Is virtual from EDA_BaseStruct. * Is virtual from EDA_BaseStruct.
* Display info about the track segment and the full track length
* @param frame A WinEDA_DrawFrame in which to print status information. * @param frame A WinEDA_DrawFrame in which to print status information.
*/ */
void DisplayInfo( WinEDA_DrawFrame* frame ); void DisplayInfo( WinEDA_DrawFrame* frame );
/**
* Function DisplayInfoBase
* has knowledge about the frame and how and where to put status information
* about this object into the frame's message panel.
* Display info about the track segment only, and does not calculate the full track length
* @param frame A WinEDA_DrawFrame in which to print status information.
*/
void DisplayInfoBase( WinEDA_DrawFrame* frame );
/** /**
* Function ShowWidth * Function ShowWidth
......
...@@ -57,9 +57,9 @@ void RemoteCommand( const char* cmdline ) ...@@ -57,9 +57,9 @@ void RemoteCommand( const char* cmdline )
module = frame->GetBoard()->FindModuleByReference( modName ); module = frame->GetBoard()->FindModuleByReference( modName );
if( module ) if( module )
msg.Printf( _( "%s found" ), modName.GetData() ); msg.Printf( _( "%s found" ), GetChars( modName ) );
else else
msg.Printf( _( "%s not found" ), modName.GetData() ); msg.Printf( _( "%s not found" ), GetChars( modName ) );
frame->Affiche_Message( msg ); frame->Affiche_Message( msg );
if( module ) if( module )
...@@ -103,17 +103,17 @@ void RemoteCommand( const char* cmdline ) ...@@ -103,17 +103,17 @@ void RemoteCommand( const char* cmdline )
} }
if( module == NULL ) if( module == NULL )
msg.Printf( _( "%s not found" ), modName.GetData() ); msg.Printf( _( "%s not found" ), GetChars( modName ) );
else if( pad == NULL ) else if( pad == NULL )
{ {
msg.Printf( _( "%s pin %s not found" ), msg.Printf( _( "%s pin %s not found" ),
modName.GetData(), pinName.GetData() ); GetChars( modName ), GetChars( pinName ) );
frame->SetCurItem( module ); frame->SetCurItem( module );
} }
else else
{ {
msg.Printf( _( "%s pin %s found" ), msg.Printf( _( "%s pin %s found" ),
modName.GetData(), pinName.GetData() ); GetChars( modName ), GetChars( pinName ) );
frame->SetCurItem( pad ); frame->SetCurItem( pad );
} }
......
...@@ -205,7 +205,7 @@ bool DIALOG_COPPER_LAYERS_SETUP::TestDataValidity() ...@@ -205,7 +205,7 @@ bool DIALOG_COPPER_LAYERS_SETUP::TestDataValidity()
wxString text; wxString text;
text.Printf( _( text.Printf( _(
"<small>This layer name <b>%s</b> is already existing<br>" ), "<small>This layer name <b>%s</b> is already existing<br>" ),
value.GetData() ); GetChars( value ) );
m_MessagesList->AppendToPage( text ); m_MessagesList->AppendToPage( text );
success = false; success = false;
} }
......
...@@ -119,9 +119,9 @@ void DIALOG_DESIGN_RULES::PrintCurrentSettings( ) ...@@ -119,9 +119,9 @@ void DIALOG_DESIGN_RULES::PrintCurrentSettings( )
} }
/**************************************/ /******************************************/
void DIALOG_DESIGN_RULES::InitDialogRules() void DIALOG_DESIGN_RULES::InitDialogRules()
/**************************************/ /******************************************/
{ {
SetFocus(); SetFocus();
SetReturnCode( 0 ); SetReturnCode( 0 );
...@@ -470,28 +470,51 @@ void DIALOG_DESIGN_RULES::OnAddNetclassClick( wxCommandEvent& event ) ...@@ -470,28 +470,51 @@ void DIALOG_DESIGN_RULES::OnAddNetclassClick( wxCommandEvent& event )
InitializeRulesSelectionBoxes(); InitializeRulesSelectionBoxes();
} }
// Sort function for wxArrayInt. Itelms (ints) are sorted by decreasing value
// used in DIALOG_DESIGN_RULES::OnRemoveNetclassClick
int sort_int(int *first, int *second)
{
return * second - *first;
}
/**************************************************************************/ /**************************************************************************/
void DIALOG_DESIGN_RULES::OnRemoveNetclassClick( wxCommandEvent& event ) void DIALOG_DESIGN_RULES::OnRemoveNetclassClick( wxCommandEvent& event )
/**************************************************************************/ /**************************************************************************/
{ {
wxArrayInt select = m_grid->GetSelectedRows(); wxArrayInt select = m_grid->GetSelectedRows();
// Sort selection by decreasing index order:
for( int ii = select.GetCount() - 1; ii >= 0; ii-- ) select.Sort(sort_int);
bool reinit = false;
// rows labels seem have problems when deleting rows: they are not deleted properly.
// Workaround: store them, delete rows and reinit row labels (wxWidgets <= 2.9 )
wxArrayString labels;
for( int ii = 0; ii < m_grid->GetNumberRows(); ii++ )
labels.Add(m_grid->GetRowLabelValue(ii));
// Delete rows from last to first (this is the order wxArrayInt select after sorting) )
// This order is Ok when removing rows
for( unsigned ii = 0; ii < select.GetCount(); ii++ )
{ {
int grid_row = select[ii]; int grid_row = select[ii];
if( grid_row != 0 ) // Do not remove the default class if( grid_row != 0 ) // Do not remove the default class
{ {
wxString classname = m_grid->GetRowLabelValue( grid_row ); wxString classname = m_grid->GetRowLabelValue( grid_row );
m_grid->DeleteRows( grid_row ); m_grid->DeleteRows( grid_row );
labels.RemoveAt(grid_row);
reinit = true;
// reset the net class to default for members of the removed class // reset the net class to default for members of the removed class
swapNetClass( classname, NETCLASS::Default ); swapNetClass( classname, NETCLASS::Default );
} }
else
wxMessageBox(_("The defaut Netclass cannot be removed") );
} }
if( reinit )
{
// Workaround: reinit labels (wxWidgets <= 2.9 )
for( unsigned ii = 1; ii < labels.GetCount(); ii++ )
m_grid->SetRowLabelValue(ii, labels[ii]);
InitializeRulesSelectionBoxes(); InitializeRulesSelectionBoxes();
}
} }
/* /*
......
...@@ -84,8 +84,8 @@ void DialogEditModuleText::Init( ) ...@@ -84,8 +84,8 @@ void DialogEditModuleText::Init( )
{ {
wxString format = m_ModuleInfoText->GetLabel(); wxString format = m_ModuleInfoText->GetLabel();
msg.Printf( format, msg.Printf( format,
m_Module->m_Reference->m_Text.GetData(), GetChars( m_Module->m_Reference->m_Text ),
m_Module->m_Value->m_Text.GetData(), GetChars( m_Module->m_Value->m_Text ),
(float) m_Module->m_Orient / 10 ); (float) m_Module->m_Orient / 10 );
} }
......
...@@ -598,7 +598,7 @@ void WinEDA_PcbFrame::Process_Special_Functions( wxCommandEvent& event ) ...@@ -598,7 +598,7 @@ void WinEDA_PcbFrame::Process_Special_Functions( wxCommandEvent& event )
case ID_POPUP_PCB_MOVE_MODULE_REQUEST: case ID_POPUP_PCB_MOVE_MODULE_REQUEST:
// If the current Item is a pad, text module ...: Get the parent // If the current Item is a pad, text module ...: Get its parent
if( GetCurItem()->Type() != TYPE_MODULE ) if( GetCurItem()->Type() != TYPE_MODULE )
SetCurItem( GetCurItem()->GetParent() ); SetCurItem( GetCurItem()->GetParent() );
if( !GetCurItem() || GetCurItem()->Type() != TYPE_MODULE ) if( !GetCurItem() || GetCurItem()->Type() != TYPE_MODULE )
...@@ -622,7 +622,7 @@ void WinEDA_PcbFrame::Process_Special_Functions( wxCommandEvent& event ) ...@@ -622,7 +622,7 @@ void WinEDA_PcbFrame::Process_Special_Functions( wxCommandEvent& event )
case ID_POPUP_PCB_DELETE_MODULE: case ID_POPUP_PCB_DELETE_MODULE:
DrawPanel->MouseToCursorSchema(); DrawPanel->MouseToCursorSchema();
// If the current Item is a pad, text module ...: Get the parent // If the current Item is a pad, text module ...: Get its parent
if( GetCurItem()->Type() != TYPE_MODULE ) if( GetCurItem()->Type() != TYPE_MODULE )
SetCurItem( GetCurItem()->GetParent() ); SetCurItem( GetCurItem()->GetParent() );
...@@ -637,7 +637,7 @@ void WinEDA_PcbFrame::Process_Special_Functions( wxCommandEvent& event ) ...@@ -637,7 +637,7 @@ void WinEDA_PcbFrame::Process_Special_Functions( wxCommandEvent& event )
case ID_POPUP_PCB_ROTATE_MODULE_COUNTERCLOCKWISE: case ID_POPUP_PCB_ROTATE_MODULE_COUNTERCLOCKWISE:
DrawPanel->MouseToCursorSchema(); DrawPanel->MouseToCursorSchema();
// If the current Item is a pad, text module ...: Get the parent // If the current Item is a pad, text module ...: Get its parent
if( GetCurItem()->Type() != TYPE_MODULE ) if( GetCurItem()->Type() != TYPE_MODULE )
SetCurItem( GetCurItem()->GetParent() ); SetCurItem( GetCurItem()->GetParent() );
...@@ -652,7 +652,7 @@ void WinEDA_PcbFrame::Process_Special_Functions( wxCommandEvent& event ) ...@@ -652,7 +652,7 @@ void WinEDA_PcbFrame::Process_Special_Functions( wxCommandEvent& event )
case ID_POPUP_PCB_ROTATE_MODULE_CLOCKWISE: case ID_POPUP_PCB_ROTATE_MODULE_CLOCKWISE:
DrawPanel->MouseToCursorSchema(); DrawPanel->MouseToCursorSchema();
// If the current Item is a pad, text module ...: Get the parent // If the current Item is a pad, text module ...: Get its parent
if( GetCurItem()->Type() != TYPE_MODULE ) if( GetCurItem()->Type() != TYPE_MODULE )
SetCurItem( GetCurItem()->GetParent() ); SetCurItem( GetCurItem()->GetParent() );
...@@ -666,7 +666,7 @@ void WinEDA_PcbFrame::Process_Special_Functions( wxCommandEvent& event ) ...@@ -666,7 +666,7 @@ void WinEDA_PcbFrame::Process_Special_Functions( wxCommandEvent& event )
case ID_POPUP_PCB_CHANGE_SIDE_MODULE: case ID_POPUP_PCB_CHANGE_SIDE_MODULE:
DrawPanel->MouseToCursorSchema(); DrawPanel->MouseToCursorSchema();
// If the current Item is a pad, text module ...: Get the parent // If the current Item is a pad, text module ...: Get its parent
if( GetCurItem()->Type() != TYPE_MODULE ) if( GetCurItem()->Type() != TYPE_MODULE )
SetCurItem( GetCurItem()->GetParent() ); SetCurItem( GetCurItem()->GetParent() );
if( !GetCurItem() || GetCurItem()->Type() != TYPE_MODULE ) if( !GetCurItem() || GetCurItem()->Type() != TYPE_MODULE )
...@@ -680,7 +680,7 @@ void WinEDA_PcbFrame::Process_Special_Functions( wxCommandEvent& event ) ...@@ -680,7 +680,7 @@ void WinEDA_PcbFrame::Process_Special_Functions( wxCommandEvent& event )
case ID_POPUP_PCB_EDIT_MODULE: case ID_POPUP_PCB_EDIT_MODULE:
// If the current Item is a pad, text module ...: Get the parent // If the current Item is a pad, text module ...: Get its parent
if( GetCurItem()->Type() != TYPE_MODULE ) if( GetCurItem()->Type() != TYPE_MODULE )
SetCurItem( GetCurItem()->GetParent() ); SetCurItem( GetCurItem()->GetParent() );
if( !GetCurItem() || GetCurItem()->Type() != TYPE_MODULE ) if( !GetCurItem() || GetCurItem()->Type() != TYPE_MODULE )
...@@ -941,14 +941,6 @@ void WinEDA_PcbFrame::Process_Special_Functions( wxCommandEvent& event ) ...@@ -941,14 +941,6 @@ void WinEDA_PcbFrame::Process_Special_Functions( wxCommandEvent& event )
Swap_Layers( event ); Swap_Layers( event );
break; break;
case ID_POPUP_PCB_AUTOROUTE_GET_AUTOROUTER:
GlobalRoute( &dc );
break;
case ID_POPUP_PCB_AUTOROUTE_GET_AUTOROUTER_DATA:
ReadAutoroutedTracks( &dc );
break;
case ID_PCB_USER_GRID_SETUP: case ID_PCB_USER_GRID_SETUP:
InstallGridFrame( pos ); InstallGridFrame( pos );
break; break;
......
...@@ -55,7 +55,7 @@ static void Exit_Editrack( WinEDA_DrawPanel* Panel, wxDC* DC ) ...@@ -55,7 +55,7 @@ static void Exit_Editrack( WinEDA_DrawPanel* Panel, wxDC* DC )
frame->MsgPanel->EraseMsgBox(); frame->MsgPanel->EraseMsgBox();
// Undo pending changes (mainly a lock point cretion) and clear the undo picker list: // Undo pending changes (mainly a lock point cretion) and clear the undo picker list:
frame->PutDataInPreviousState(&s_ItemsListPicker, false, false); frame->PutDataInPreviousState( &s_ItemsListPicker, false, false );
s_ItemsListPicker.ClearListAndDeleteItems(); s_ItemsListPicker.ClearListAndDeleteItems();
// Delete current (new) track // Delete current (new) track
...@@ -135,7 +135,8 @@ TRACK* WinEDA_PcbFrame::Begin_Route( TRACK* aTrack, wxDC* DC ) ...@@ -135,7 +135,8 @@ TRACK* WinEDA_PcbFrame::Begin_Route( TRACK* aTrack, wxDC* DC )
else // no starting point, but a filled zone area can exist. This is also a good starting point. else // no starting point, but a filled zone area can exist. This is also a good starting point.
{ {
ZONE_CONTAINER* zone = GetBoard()->HitTestForAnyFilledArea( pos, ZONE_CONTAINER* zone = GetBoard()->HitTestForAnyFilledArea( pos,
GetScreen()->m_Active_Layer ); GetScreen()->
m_Active_Layer );
if( zone ) if( zone )
g_HightLigth_NetCode = zone->GetNet(); g_HightLigth_NetCode = zone->GetNet();
} }
...@@ -188,8 +189,8 @@ TRACK* WinEDA_PcbFrame::Begin_Route( TRACK* aTrack, wxDC* DC ) ...@@ -188,8 +189,8 @@ TRACK* WinEDA_PcbFrame::Begin_Route( TRACK* aTrack, wxDC* DC )
D( g_CurrentTrackList.VerifyListIntegrity(); ); D( g_CurrentTrackList.VerifyListIntegrity(); );
g_CurrentTrackSegment->DisplayInfo( this ); g_CurrentTrackSegment->DisplayInfoBase( this );
SetCurItem( g_CurrentTrackSegment ); SetCurItem( g_CurrentTrackSegment, false );
DrawPanel->ManageCurseur( DrawPanel, DC, false ); DrawPanel->ManageCurseur( DrawPanel, DC, false );
if( Drc_On ) if( Drc_On )
...@@ -272,10 +273,9 @@ TRACK* WinEDA_PcbFrame::Begin_Route( TRACK* aTrack, wxDC* DC ) ...@@ -272,10 +273,9 @@ TRACK* WinEDA_PcbFrame::Begin_Route( TRACK* aTrack, wxDC* DC )
/* Show the new position */ /* Show the new position */
ShowNewTrackWhenMovingCursor( DrawPanel, DC, false ); ShowNewTrackWhenMovingCursor( DrawPanel, DC, false );
} }
g_CurrentTrackSegment->DisplayInfo( this );
} }
SetCurItem( g_CurrentTrackSegment ); SetCurItem( g_CurrentTrackSegment, false );
return g_CurrentTrackSegment; return g_CurrentTrackSegment;
} }
...@@ -476,7 +476,7 @@ void WinEDA_PcbFrame::End_Route( TRACK* aTrack, wxDC* DC ) ...@@ -476,7 +476,7 @@ void WinEDA_PcbFrame::End_Route( TRACK* aTrack, wxDC* DC )
LockPoint = CreateLockPoint( g_CurrentTrackSegment->m_End, LockPoint = CreateLockPoint( g_CurrentTrackSegment->m_End,
adr_buf, adr_buf,
g_CurrentTrackSegment, g_CurrentTrackSegment,
&s_ItemsListPicker); &s_ItemsListPicker );
} }
} }
...@@ -514,9 +514,9 @@ void WinEDA_PcbFrame::End_Route( TRACK* aTrack, wxDC* DC ) ...@@ -514,9 +514,9 @@ void WinEDA_PcbFrame::End_Route( TRACK* aTrack, wxDC* DC )
// erase the old track, if exists // erase the old track, if exists
if( g_AutoDeleteOldTrack ) if( g_AutoDeleteOldTrack )
{ {
EraseRedundantTrack( DC, firstTrack, newCount, & s_ItemsListPicker ); EraseRedundantTrack( DC, firstTrack, newCount, &s_ItemsListPicker );
} }
SaveCopyInUndoList(s_ItemsListPicker, UR_UNSPECIFIED); SaveCopyInUndoList( s_ItemsListPicker, UR_UNSPECIFIED );
s_ItemsListPicker.ClearItemsList(); // s_ItemsListPicker is no more owner of picked items s_ItemsListPicker.ClearItemsList(); // s_ItemsListPicker is no more owner of picked items
/* compute the new rastnest : */ /* compute the new rastnest : */
...@@ -670,6 +670,7 @@ void ShowNewTrackWhenMovingCursor( WinEDA_DrawPanel* panel, wxDC* DC, bool erase ...@@ -670,6 +670,7 @@ void ShowNewTrackWhenMovingCursor( WinEDA_DrawPanel* panel, wxDC* DC, bool erase
D( g_CurrentTrackList.VerifyListIntegrity(); ); D( g_CurrentTrackList.VerifyListIntegrity(); );
PCB_SCREEN* screen = (PCB_SCREEN*) panel->GetScreen(); PCB_SCREEN* screen = (PCB_SCREEN*) panel->GetScreen();
WinEDA_BasePcbFrame* frame = (WinEDA_BasePcbFrame*) panel->m_Parent;
bool Track_fill_copy = DisplayOpt.DisplayPcbTrackFill; bool Track_fill_copy = DisplayOpt.DisplayPcbTrackFill;
DisplayOpt.DisplayPcbTrackFill = true; DisplayOpt.DisplayPcbTrackFill = true;
...@@ -685,7 +686,7 @@ void ShowNewTrackWhenMovingCursor( WinEDA_DrawPanel* panel, wxDC* DC, bool erase ...@@ -685,7 +686,7 @@ void ShowNewTrackWhenMovingCursor( WinEDA_DrawPanel* panel, wxDC* DC, bool erase
{ {
Trace_Une_Piste( panel, DC, g_FirstTrackSegment, g_CurrentTrackList.GetCount(), GR_XOR ); Trace_Une_Piste( panel, DC, g_FirstTrackSegment, g_CurrentTrackList.GetCount(), GR_XOR );
( (WinEDA_BasePcbFrame*)(panel->m_Parent) )->trace_ratsnest_pad( DC ); frame->trace_ratsnest_pad( DC );
if( showTrackClearanceMode >= SHOW_CLEARANCE_NEW_TRACKS_AND_VIA_AREAS ) // Show the via area if( showTrackClearanceMode >= SHOW_CLEARANCE_NEW_TRACKS_AND_VIA_AREAS ) // Show the via area
{ {
...@@ -760,13 +761,35 @@ void ShowNewTrackWhenMovingCursor( WinEDA_DrawPanel* panel, wxDC* DC, bool erase ...@@ -760,13 +761,35 @@ void ShowNewTrackWhenMovingCursor( WinEDA_DrawPanel* panel, wxDC* DC, bool erase
color ); color );
} }
/* Display info about currrent segment and the full new track:
* Choose the interesting segment: because we are using a 2 segments step,
* the last segment can be null, and the previous segment can be the interesting segment.
*/
TRACK* isegm = g_CurrentTrackSegment;
if( isegm->GetLength() == 0 && g_CurrentTrackSegment->Back() )
isegm = g_CurrentTrackSegment->Back();
// display interesting segment info only:
isegm->DisplayInfoBase( frame );
// Add current track length
int trackLen = 0;
wxString msg;
for( TRACK* track = g_FirstTrackSegment; track; track = track->Next() )
trackLen += track->GetLength();
valeur_param( trackLen, msg );
frame->MsgPanel->AppendMessage( _( "Track Len" ), msg, DARKCYAN );
// Add current segments count (number of segments in this new track):
msg.Printf( wxT( "%d" ), g_CurrentTrackList.GetCount() );
frame->MsgPanel->AppendMessage( _( "Segs Count" ), msg, DARKCYAN );
DisplayOpt.ShowTrackClearanceMode = showTrackClearanceMode; DisplayOpt.ShowTrackClearanceMode = showTrackClearanceMode;
DisplayOpt.DisplayPcbTrackFill = Track_fill_copy; DisplayOpt.DisplayPcbTrackFill = Track_fill_copy;
( (WinEDA_BasePcbFrame*)(panel->m_Parent) )-> frame->build_ratsnest_pad( NULL, g_CurrentTrackSegment->m_End, false );
build_ratsnest_pad( NULL, g_CurrentTrackSegment->m_End, false ); frame->trace_ratsnest_pad( DC );
( (WinEDA_BasePcbFrame*)(panel->m_Parent) )->trace_ratsnest_pad( DC );
} }
......
...@@ -464,7 +464,8 @@ void CreateSignalsSection( FILE* file, BOARD* pcb ) ...@@ -464,7 +464,8 @@ void CreateSignalsSection( FILE* file, BOARD* pcb )
pad->ReturnStringPadName( padname ); pad->ReturnStringPadName( padname );
msg.Printf( wxT( "NODE %s %.4s" ), msg.Printf( wxT( "NODE %s %.4s" ),
module->m_Reference->m_Text.GetData(), padname.GetData() ); GetChars( module->m_Reference->m_Text ),
GetChars( padname ) );
fputs( CONV_TO_UTF8( msg ), file ); fputs( CONV_TO_UTF8( msg ), file );
fputs( "\n", file ); fputs( "\n", file );
......
...@@ -108,8 +108,8 @@ void WinEDA_PcbFrame::Files_io( wxCommandEvent& event ) ...@@ -108,8 +108,8 @@ void WinEDA_PcbFrame::Files_io( wxCommandEvent& event )
case ID_NEW_BOARD: case ID_NEW_BOARD:
Clear_Pcb( true ); Clear_Pcb( true );
GetScreen()->m_FileName.Printf( wxT( "%s%cnoname%s" ), GetScreen()->m_FileName.Printf( wxT( "%s%cnoname%s" ),
wxGetCwd().GetData(), DIR_SEP, GetChars( wxGetCwd() ), DIR_SEP,
PcbExtBuffer.GetData() ); GetChars( PcbExtBuffer ) );
SetTitle( GetScreen()->m_FileName ); SetTitle( GetScreen()->m_FileName );
ReCreateLayerBox( NULL ); ReCreateLayerBox( NULL );
break; break;
...@@ -187,7 +187,7 @@ bool WinEDA_PcbFrame::LoadOnePcbFile( const wxString& FullFileName, bool Append ...@@ -187,7 +187,7 @@ bool WinEDA_PcbFrame::LoadOnePcbFile( const wxString& FullFileName, bool Append
if( source == NULL ) if( source == NULL )
{ {
msg.Printf( _( "File <%s> not found" ), msg.Printf( _( "File <%s> not found" ),
GetScreen()->m_FileName.GetData() ); GetChars( GetScreen()->m_FileName ) );
DisplayError( this, msg ); DisplayError( this, msg );
return false; return false;
} }
......
...@@ -116,7 +116,7 @@ void WinEDA_PcbFindFrame::FindItem( wxCommandEvent& event ) ...@@ -116,7 +116,7 @@ void WinEDA_PcbFindFrame::FindItem( wxCommandEvent& event )
if( FindMarker ) if( FindMarker )
msg = _( "Marker found" ); msg = _( "Marker found" );
else else
msg.Printf( _( "<%s> Found" ), s_OldStringFound.GetData() ); msg.Printf( _( "<%s> Found" ), GetChars( s_OldStringFound ) );
m_Parent->Affiche_Message( msg ); m_Parent->Affiche_Message( msg );
...@@ -131,7 +131,7 @@ void WinEDA_PcbFindFrame::FindItem( wxCommandEvent& event ) ...@@ -131,7 +131,7 @@ void WinEDA_PcbFindFrame::FindItem( wxCommandEvent& event )
if( FindMarker ) if( FindMarker )
msg = _( "Marker not found" ); msg = _( "Marker not found" );
else else
msg.Printf( _( "<%s> Not Found" ), s_OldStringFound.GetData() ); msg.Printf( _( "<%s> Not Found" ), GetChars( s_OldStringFound ) );
DisplayError( this, msg, 10 ); DisplayError( this, msg, 10 );
EndModal( 0 ); EndModal( 0 );
......
...@@ -448,7 +448,7 @@ void WinEDA_PcbFrame::GenModuleReport( wxCommandEvent& event ) ...@@ -448,7 +448,7 @@ void WinEDA_PcbFrame::GenModuleReport( wxCommandEvent& event )
} }
fprintf( rptfile, "$EndMODULE %s\n\n", fprintf( rptfile, "$EndMODULE %s\n\n",
(const char*) Module->m_Reference->m_Text.GetData() ); CONV_TO_UTF8(Module->m_Reference->m_Text ) );
} }
/* Write board Edges */ /* Write board Edges */
......
...@@ -208,7 +208,7 @@ void WinEDA_BasePcbFrame::AddPad( MODULE* Module, bool draw ) ...@@ -208,7 +208,7 @@ void WinEDA_BasePcbFrame::AddPad( MODULE* Module, bool draw )
/* Mise a jour des caract de la pastille : */ /* Mise a jour des caract de la pastille : */
Import_Pad_Settings( Pad, false ); Import_Pad_Settings( Pad, false );
Pad->SetNetname(wxEmptyString); Pad->SetNetname( wxEmptyString );
Pad->m_Pos = GetScreen()->m_Curseur; Pad->m_Pos = GetScreen()->m_Curseur;
...@@ -222,8 +222,8 @@ void WinEDA_BasePcbFrame::AddPad( MODULE* Module, bool draw ) ...@@ -222,8 +222,8 @@ void WinEDA_BasePcbFrame::AddPad( MODULE* Module, bool draw )
/* Increment automatique de la reference courante Current_PadName */ /* Increment automatique de la reference courante Current_PadName */
long num = 0; int ponder = 1; long num = 0; int ponder = 1;
while( g_Current_PadName.Len() && g_Current_PadName.Last() >= '0' && while( g_Current_PadName.Len() && g_Current_PadName.Last() >= '0'
g_Current_PadName.Last() <= '9' ) && g_Current_PadName.Last() <= '9' )
{ {
num += (g_Current_PadName.Last() - '0') * ponder; num += (g_Current_PadName.Last() - '0') * ponder;
g_Current_PadName.RemoveLast(); g_Current_PadName.RemoveLast();
...@@ -237,7 +237,7 @@ void WinEDA_BasePcbFrame::AddPad( MODULE* Module, bool draw ) ...@@ -237,7 +237,7 @@ void WinEDA_BasePcbFrame::AddPad( MODULE* Module, bool draw )
/* Redessin du module */ /* Redessin du module */
Module->Set_Rectangle_Encadrement(); Module->Set_Rectangle_Encadrement();
Pad->DisplayInfo( this ); Pad->DisplayInfo( this );
if ( draw ) if( draw )
DrawPanel->PostDirtyRect( Module->GetBoundingBox() ); DrawPanel->PostDirtyRect( Module->GetBoundingBox() );
} }
...@@ -257,7 +257,8 @@ void WinEDA_BasePcbFrame::DeletePad( D_PAD* Pad ) ...@@ -257,7 +257,8 @@ void WinEDA_BasePcbFrame::DeletePad( D_PAD* Pad )
Module->m_LastEdit_Time = time( NULL ); Module->m_LastEdit_Time = time( NULL );
line.Printf( _( "Delete Pad (module %s %s) " ), line.Printf( _( "Delete Pad (module %s %s) " ),
Module->m_Reference->m_Text.GetData(), Module->m_Value->m_Text.GetData() ); GetChars( Module->m_Reference->m_Text ),
GetChars( Module->m_Value->m_Text ) );
if( !IsOK( this, line ) ) if( !IsOK( this, line ) )
return; return;
...@@ -318,13 +319,14 @@ void WinEDA_BasePcbFrame::PlacePad( D_PAD* Pad, wxDC* DC ) ...@@ -318,13 +319,14 @@ void WinEDA_BasePcbFrame::PlacePad( D_PAD* Pad, wxDC* DC )
Module = (MODULE*) Pad->GetParent(); Module = (MODULE*) Pad->GetParent();
ITEM_PICKER picker(NULL, UR_CHANGED); ITEM_PICKER picker( NULL, UR_CHANGED );
PICKED_ITEMS_LIST pickList; PICKED_ITEMS_LIST pickList;
/* Save dragged track segments in undo list */ /* Save dragged track segments in undo list */
for( DRAG_SEGM* pt_drag = g_DragSegmentList; pt_drag; pt_drag = pt_drag->Pnext ) for( DRAG_SEGM* pt_drag = g_DragSegmentList; pt_drag; pt_drag = pt_drag->Pnext )
{ {
Track = pt_drag->m_Segm; Track = pt_drag->m_Segm;
// Set the old state // Set the old state
wxPoint t_start = Track->m_Start; wxPoint t_start = Track->m_Start;
wxPoint t_end = Track->m_End; wxPoint t_end = Track->m_End;
...@@ -334,23 +336,23 @@ void WinEDA_BasePcbFrame::PlacePad( D_PAD* Pad, wxDC* DC ) ...@@ -334,23 +336,23 @@ void WinEDA_BasePcbFrame::PlacePad( D_PAD* Pad, wxDC* DC )
Track->m_End = Pad_OldPos; Track->m_End = Pad_OldPos;
picker.m_PickedItem = Track; picker.m_PickedItem = Track;
pickList.PushItem(picker); pickList.PushItem( picker );
} }
/* Save old module and old items values */ /* Save old module and old items values */
wxPoint pad_curr_position = Pad->m_Pos; wxPoint pad_curr_position = Pad->m_Pos;
Pad->m_Pos = Pad_OldPos; Pad->m_Pos = Pad_OldPos;
if ( g_DragSegmentList == NULL ) if( g_DragSegmentList == NULL )
SaveCopyInUndoList( Module, UR_CHANGED ); SaveCopyInUndoList( Module, UR_CHANGED );
else else
{ {
picker.m_PickedItem = Module; picker.m_PickedItem = Module;
pickList.PushItem(picker); pickList.PushItem( picker );
} }
if ( g_DragSegmentList ) if( g_DragSegmentList )
SaveCopyInUndoList( pickList, UR_CHANGED ); SaveCopyInUndoList( pickList, UR_CHANGED );
/* Placement du pad */ /* Placement du pad */
...@@ -362,6 +364,7 @@ void WinEDA_BasePcbFrame::PlacePad( D_PAD* Pad, wxDC* DC ) ...@@ -362,6 +364,7 @@ void WinEDA_BasePcbFrame::PlacePad( D_PAD* Pad, wxDC* DC )
for( DRAG_SEGM* pt_drag = g_DragSegmentList; pt_drag; pt_drag = pt_drag->Pnext ) for( DRAG_SEGM* pt_drag = g_DragSegmentList; pt_drag; pt_drag = pt_drag->Pnext )
{ {
Track = pt_drag->m_Segm; Track = pt_drag->m_Segm;
// Set the new state // Set the new state
if( pt_drag->m_Pad_Start ) if( pt_drag->m_Pad_Start )
Track->m_Start = Pad->m_Pos; Track->m_Start = Pad->m_Pos;
...@@ -369,7 +372,7 @@ void WinEDA_BasePcbFrame::PlacePad( D_PAD* Pad, wxDC* DC ) ...@@ -369,7 +372,7 @@ void WinEDA_BasePcbFrame::PlacePad( D_PAD* Pad, wxDC* DC )
Track->m_End = Pad->m_Pos; Track->m_End = Pad->m_Pos;
Track->SetState( EDIT, OFF ); Track->SetState( EDIT, OFF );
if ( DC ) if( DC )
Track->Draw( DrawPanel, DC, GR_OR ); Track->Draw( DrawPanel, DC, GR_OR );
} }
...@@ -383,7 +386,7 @@ void WinEDA_BasePcbFrame::PlacePad( D_PAD* Pad, wxDC* DC ) ...@@ -383,7 +386,7 @@ void WinEDA_BasePcbFrame::PlacePad( D_PAD* Pad, wxDC* DC )
Pad->m_Flags = 0; Pad->m_Flags = 0;
if ( DC ) if( DC )
Pad->Draw( DrawPanel, DC, GR_OR ); Pad->Draw( DrawPanel, DC, GR_OR );
Module->Set_Rectangle_Encadrement(); Module->Set_Rectangle_Encadrement();
...@@ -417,7 +420,7 @@ void WinEDA_BasePcbFrame::RotatePad( D_PAD* Pad, wxDC* DC ) ...@@ -417,7 +420,7 @@ void WinEDA_BasePcbFrame::RotatePad( D_PAD* Pad, wxDC* DC )
GetScreen()->SetModify(); GetScreen()->SetModify();
if ( DC ) if( DC )
Module->Draw( DrawPanel, DC, GR_XOR ); Module->Draw( DrawPanel, DC, GR_XOR );
EXCHG( Pad->m_Size.x, Pad->m_Size.y ); EXCHG( Pad->m_Size.x, Pad->m_Size.y );
...@@ -432,6 +435,6 @@ void WinEDA_BasePcbFrame::RotatePad( D_PAD* Pad, wxDC* DC ) ...@@ -432,6 +435,6 @@ void WinEDA_BasePcbFrame::RotatePad( D_PAD* Pad, wxDC* DC )
Module->Set_Rectangle_Encadrement(); Module->Set_Rectangle_Encadrement();
Pad->DisplayInfo( this ); Pad->DisplayInfo( this );
if ( DC ) if( DC )
Module->Draw( DrawPanel, DC, GR_OR ); Module->Draw( DrawPanel, DC, GR_OR );
} }
...@@ -190,6 +190,9 @@ static void Show_MoveNode( WinEDA_DrawPanel* panel, wxDC* DC, bool erase ) ...@@ -190,6 +190,9 @@ static void Show_MoveNode( WinEDA_DrawPanel* panel, wxDC* DC, bool erase )
} }
DisplayOpt.DisplayPcbTrackFill = track_fill_copy; DisplayOpt.DisplayPcbTrackFill = track_fill_copy;
// Display track length
WinEDA_BasePcbFrame* frame = (WinEDA_BasePcbFrame*) panel->m_Parent;
Track->DisplayInfo( frame );
} }
...@@ -439,6 +442,9 @@ static void Show_Drag_Track_Segment_With_Cte_Slope( WinEDA_DrawPanel* panel, ...@@ -439,6 +442,9 @@ static void Show_Drag_Track_Segment_With_Cte_Slope( WinEDA_DrawPanel* panel,
tSegmentToStart->Draw( panel, DC, draw_mode ); tSegmentToStart->Draw( panel, DC, draw_mode );
if( tSegmentToEnd ) if( tSegmentToEnd )
tSegmentToEnd->Draw( panel, DC, draw_mode ); tSegmentToEnd->Draw( panel, DC, draw_mode );
// Display track length
WinEDA_BasePcbFrame* frame = (WinEDA_BasePcbFrame*) panel->m_Parent;
Track->DisplayInfo( frame );
} }
......
...@@ -114,7 +114,7 @@ bool OpenNetlistFile( const wxString& aFullFileName ) ...@@ -114,7 +114,7 @@ bool OpenNetlistFile( const wxString& aFullFileName )
if( source == 0 ) if( source == 0 )
{ {
wxString msg; wxString msg;
msg.Printf( _( "Netlist file %s not found" ), aFullFileName.GetData() ); msg.Printf( _( "Netlist file %s not found" ), GetChars( aFullFileName ) );
DisplayError( NULL, msg ); DisplayError( NULL, msg );
return FALSE; return FALSE;
} }
...@@ -486,8 +486,9 @@ MODULE* ReadNetModule( WinEDA_PcbFrame* aFrame, ...@@ -486,8 +486,9 @@ MODULE* ReadNetModule( WinEDA_PcbFrame* aFrame,
msg.Printf( msg.Printf(
_( _(
"Component \"%s\": Mismatch! module is [%s] and netlist said [%s]\n" ), "Component \"%s\": Mismatch! module is [%s] and netlist said [%s]\n" ),
TextCmpName.GetData(), Module->m_LibRef.GetData(), GetChars( TextCmpName ),
NameLibCmp.GetData() ); GetChars( Module->m_LibRef ),
GetChars( NameLibCmp ) );
if( aMessageWindow ) if( aMessageWindow )
aMessageWindow->AppendText( msg ); aMessageWindow->AppendText( msg );
...@@ -520,7 +521,7 @@ MODULE* ReadNetModule( WinEDA_PcbFrame* aFrame, ...@@ -520,7 +521,7 @@ MODULE* ReadNetModule( WinEDA_PcbFrame* aFrame,
if( aMessageWindow ) if( aMessageWindow )
{ {
wxString msg; wxString msg;
msg.Printf( _( "Component [%s] not found" ), TextCmpName.GetData() ); msg.Printf( _( "Component [%s] not found" ), GetChars( TextCmpName ) );
aMessageWindow->AppendText( msg + wxT( "\n" ) ); aMessageWindow->AppendText( msg + wxT( "\n" ) );
} }
} }
...@@ -586,7 +587,8 @@ int SetPadNetName( wxWindow* frame, char* Text, MODULE* Module, wxTextCtrl* aMes ...@@ -586,7 +587,8 @@ int SetPadNetName( wxWindow* frame, char* Text, MODULE* Module, wxTextCtrl* aMes
{ {
wxString pin_name = CONV_FROM_UTF8( TextPinName ); wxString pin_name = CONV_FROM_UTF8( TextPinName );
Msg.Printf( _( "Module [%s]: Pad [%s] not found" ), Msg.Printf( _( "Module [%s]: Pad [%s] not found" ),
Module->m_Reference->m_Text.GetData(), pin_name.GetData() ); GetChars( Module->m_Reference->m_Text ),
GetChars( pin_name ) );
aMessageWindow->AppendText( Msg + wxT( "\n" ) ); aMessageWindow->AppendText( Msg + wxT( "\n" ) );
} }
} }
...@@ -870,7 +872,7 @@ int ReadListeModules( const wxString& CmpFullFileName, const wxString* RefCmp, ...@@ -870,7 +872,7 @@ int ReadListeModules( const wxString& CmpFullFileName, const wxString* RefCmp,
{ {
wxString msg; wxString msg;
msg.Printf( _( "File <%s> not found, use Netlist for lib module selection" ), msg.Printf( _( "File <%s> not found, use Netlist for lib module selection" ),
CmpFullFileName.GetData() ); GetChars( CmpFullFileName ) );
DisplayError( NULL, msg, 20 ); DisplayError( NULL, msg, 20 );
return 0; return 0;
} }
...@@ -1001,7 +1003,8 @@ void LoadListeModules( WinEDA_PcbFrame* aPcbFrame ) ...@@ -1001,7 +1003,8 @@ void LoadListeModules( WinEDA_PcbFrame* aPcbFrame )
{ {
wxString msg; wxString msg;
msg.Printf( _( "Component [%s]: footprint <%s> not found" ), msg.Printf( _( "Component [%s]: footprint <%s> not found" ),
cmp->m_CmpName.GetData(), cmp->m_LibName.GetData() ); GetChars( cmp->m_CmpName ),
GetChars( cmp->m_LibName ) );
DisplayError( NULL, msg ); DisplayError( NULL, msg );
continue; continue;
} }
......
...@@ -215,8 +215,10 @@ void WinEDA_PcbFrame::OnLeftClick( wxDC* DC, const wxPoint& MousePos ) ...@@ -215,8 +215,10 @@ void WinEDA_PcbFrame::OnLeftClick( wxDC* DC, const wxPoint& MousePos )
else if( DrawStruct && (DrawStruct->m_Flags & IS_NEW) ) else if( DrawStruct && (DrawStruct->m_Flags & IS_NEW) )
{ {
TRACK* track = Begin_Route( (TRACK*) DrawStruct, DC ); TRACK* track = Begin_Route( (TRACK*) DrawStruct, DC );
if( track ) // c'est a dire si OK // SetCurItem() must not write to the msg panel
SetCurItem( DrawStruct = track ); // because a track info is displayed while moving the mouse cursor
if( track ) // A new segment was created
SetCurItem( DrawStruct = track, false );
DrawPanel->m_AutoPAN_Request = true; DrawPanel->m_AutoPAN_Request = true;
} }
break; break;
......
...@@ -153,7 +153,7 @@ bool WinEDA_PcbFrame::OnRightClick( const wxPoint& aMousePos, wxMenu* aPopMenu ) ...@@ -153,7 +153,7 @@ bool WinEDA_PcbFrame::OnRightClick( const wxPoint& aMousePos, wxMenu* aPopMenu )
if( m_HTOOL_current_state == ID_TOOLBARH_PCB_AUTOROUTE ) if( m_HTOOL_current_state == ID_TOOLBARH_PCB_AUTOROUTE )
{ {
if( !flags ) if( !flags )
aPopMenu->Append( ID_POPUP_PCB_AUTOROUTE_MODULE, _( "Autoroute" ) ); aPopMenu->Append( ID_POPUP_PCB_AUTOROUTE_MODULE, _( "Autoroute Module" ) );
} }
break; break;
...@@ -345,21 +345,13 @@ bool WinEDA_PcbFrame::OnRightClick( const wxPoint& aMousePos, wxMenu* aPopMenu ) ...@@ -345,21 +345,13 @@ bool WinEDA_PcbFrame::OnRightClick( const wxPoint& aMousePos, wxMenu* aPopMenu )
if( m_HTOOL_current_state == ID_TOOLBARH_PCB_AUTOROUTE ) if( m_HTOOL_current_state == ID_TOOLBARH_PCB_AUTOROUTE )
{ {
wxMenu* commands = new wxMenu; wxMenu* commands = new wxMenu;
aPopMenu->Append( ID_POPUP_PCB_AUTOROUTE_COMMANDS, _( "Global Autoroute" ), commands ); aPopMenu->Append( ID_POPUP_PCB_AUTOROUTE_COMMANDS, _( "Autoroute" ), commands );
ADD_MENUITEM( commands, ID_POPUP_PCB_SELECT_LAYER_PAIR, ADD_MENUITEM( commands, ID_POPUP_PCB_SELECT_LAYER_PAIR,
_( "Select Layer Pair" ), select_layer_pair_xpm ); _( "Select Layer Pair" ), select_layer_pair_xpm );
commands->AppendSeparator(); commands->AppendSeparator();
commands->Append( ID_POPUP_PCB_AUTOROUTE_ALL_MODULES, _( "Autoroute All Modules" ) ); commands->Append( ID_POPUP_PCB_AUTOROUTE_ALL_MODULES, _( "Autoroute All Modules" ) );
commands->AppendSeparator(); commands->AppendSeparator();
commands->Append( ID_POPUP_PCB_AUTOROUTE_RESET_UNROUTED, _( "Reset Unrouted" ) ); commands->Append( ID_POPUP_PCB_AUTOROUTE_RESET_UNROUTED, _( "Reset Unrouted" ) );
if( GetBoard()->m_Modules )
{
commands->AppendSeparator();
commands->Append( ID_POPUP_PCB_AUTOROUTE_GET_AUTOROUTER,
_( "Global AutoRouter" ) );
commands->Append( ID_POPUP_PCB_AUTOROUTE_GET_AUTOROUTER_DATA,
_( "Read Global AutoRouter Data" ) );
}
aPopMenu->AppendSeparator(); aPopMenu->AppendSeparator();
} }
......
...@@ -125,8 +125,6 @@ enum pcbnew_ids ...@@ -125,8 +125,6 @@ enum pcbnew_ids
ID_POPUP_PCB_LOCK_OFF_NET, ID_POPUP_PCB_LOCK_OFF_NET,
ID_POPUP_PCB_SETFLAGS_TRACK_MNU, ID_POPUP_PCB_SETFLAGS_TRACK_MNU,
ID_POPUP_PCB_AUTOROUTE_GET_AUTOROUTER,
ID_POPUP_PCB_AUTOROUTE_GET_AUTOROUTER_DATA,
ID_POPUP_PCB_EDIT_WIDTH_CURRENT_EDGE, ID_POPUP_PCB_EDIT_WIDTH_CURRENT_EDGE,
ID_POPUP_PCB_EDIT_WIDTH_ALL_EDGE, ID_POPUP_PCB_EDIT_WIDTH_ALL_EDGE,
ID_POPUP_PCB_EDIT_LAYER_CURRENT_EDGE, ID_POPUP_PCB_EDIT_LAYER_CURRENT_EDGE,
......
...@@ -143,7 +143,7 @@ void WinEDA_BasePcbFrame::Plot_Serigraphie( PLOTTER* plotter, ...@@ -143,7 +143,7 @@ void WinEDA_BasePcbFrame::Plot_Serigraphie( PLOTTER* plotter,
errMsg.Printf( errMsg.Printf(
_( "Your BOARD has a bad layer number of %u for module\n %s's \"reference\" text." ), _( "Your BOARD has a bad layer number of %u for module\n %s's \"reference\" text." ),
textLayer, Module->GetReference().GetData() ); textLayer, GetChars( Module->GetReference() ) );
DisplayError( this, errMsg ); DisplayError( this, errMsg );
return; return;
} }
...@@ -163,7 +163,7 @@ void WinEDA_BasePcbFrame::Plot_Serigraphie( PLOTTER* plotter, ...@@ -163,7 +163,7 @@ void WinEDA_BasePcbFrame::Plot_Serigraphie( PLOTTER* plotter,
errMsg.Printf( errMsg.Printf(
_( "Your BOARD has a bad layer number of %u for module\n %s's \"value\" text." ), _( "Your BOARD has a bad layer number of %u for module\n %s's \"value\" text." ),
textLayer, Module->GetReference().GetData() ); textLayer, GetChars( Module->GetReference() ) );
DisplayError( this, errMsg ); DisplayError( this, errMsg );
return; return;
} }
...@@ -201,7 +201,8 @@ void WinEDA_BasePcbFrame::Plot_Serigraphie( PLOTTER* plotter, ...@@ -201,7 +201,8 @@ void WinEDA_BasePcbFrame::Plot_Serigraphie( PLOTTER* plotter,
errMsg.Printf( errMsg.Printf(
_( _(
"Your BOARD has a bad layer number of %u for module\n %s's \"module text\" text of %s." ), "Your BOARD has a bad layer number of %u for module\n %s's \"module text\" text of %s." ),
textLayer, Module->GetReference().GetData(), pt_texte->m_Text.GetData() ); textLayer, GetChars( Module->GetReference() ),
GetChars( pt_texte->m_Text ) );
DisplayError( this, errMsg ); DisplayError( this, errMsg );
return; return;
} }
...@@ -582,8 +583,8 @@ void PlotFilledAreas( PLOTTER* plotter, ZONE_CONTAINER* aZone, ...@@ -582,8 +583,8 @@ void PlotFilledAreas( PLOTTER* plotter, ZONE_CONTAINER* aZone,
for( unsigned iseg = 0; iseg < aZone->m_FillSegmList.size(); iseg++ ) for( unsigned iseg = 0; iseg < aZone->m_FillSegmList.size(); iseg++ )
{ {
wxPoint start = aZone->m_FillSegmList[iseg].m_Start; wxPoint start = aZone->m_FillSegmList[iseg].m_Start;
wxPoint end = aZone->m_FillSegmList[iseg].m_End ; wxPoint end = aZone->m_FillSegmList[iseg].m_End;
plotter->thick_segment(start, end, aZone->m_ZoneMinThickness, trace_mode ); plotter->thick_segment( start, end, aZone->m_ZoneMinThickness, trace_mode );
} }
} }
......
This diff is collapsed.
...@@ -251,7 +251,7 @@ int WinEDA_PcbFrame::Solve( wxDC* DC, int two_sides ) ...@@ -251,7 +251,7 @@ int WinEDA_PcbFrame::Solve( wxDC* DC, int two_sides )
net = GetBoard()->FindNet( current_net_code ); net = GetBoard()->FindNet( current_net_code );
if( net ) if( net )
{ {
msg.Printf( wxT( "[%8.8s]" ), net->GetNetname().GetData() ); msg.Printf( wxT( "[%8.8s]" ), GetChars( net->GetNetname() ) );
Affiche_1_Parametre( this, 1, wxT( "Net route" ), msg, BROWN ); Affiche_1_Parametre( this, 1, wxT( "Net route" ), msg, BROWN );
msg.Printf( wxT( "%d / %d" ), Ncurrent, Ntotal ); msg.Printf( wxT( "%d / %d" ), Ncurrent, Ntotal );
Affiche_1_Parametre( this, 12, wxT( "Activity" ), msg, BROWN ); Affiche_1_Parametre( this, 12, wxT( "Activity" ), msg, BROWN );
......
...@@ -45,7 +45,7 @@ void WinEDA_PcbFrame::ListNetsAndSelect( wxCommandEvent& event ) ...@@ -45,7 +45,7 @@ void WinEDA_PcbFrame::ListNetsAndSelect( wxCommandEvent& event )
continue; continue;
Line.Printf( wxT( "net_code = %3.3d [%.16s] " ), net->GetNet(), Line.Printf( wxT( "net_code = %3.3d [%.16s] " ), net->GetNet(),
net->GetNetname().GetData() ); GetChars( net->GetNetname() ) );
List.Append( Line ); List.Append( Line );
} }
......
...@@ -53,6 +53,9 @@ TRACK* Marque_Une_Piste( BOARD* aPcb, ...@@ -53,6 +53,9 @@ TRACK* Marque_Une_Piste( BOARD* aPcb,
if( aSegmCount ) if( aSegmCount )
*aSegmCount = 0; *aSegmCount = 0;
if( aTrackLen )
*aTrackLen = 0;
if( aStartSegm == NULL ) if( aStartSegm == NULL )
return NULL; return NULL;
...@@ -259,7 +262,6 @@ static void Marque_Chaine_segments( BOARD* aPcb, wxPoint aRef_pos, int aLayerMas ...@@ -259,7 +262,6 @@ static void Marque_Chaine_segments( BOARD* aPcb, wxPoint aRef_pos, int aLayerMas
/* Set the BUSY flag of all connected segments, first search starting at aRef_pos /* Set the BUSY flag of all connected segments, first search starting at aRef_pos
* Search ends when: * Search ends when:
* - a pad is found (end of a track) * - a pad is found (end of a track)
* - a segment found is flagged "EDIT"
* - a segment end has more than one other segment end connected * - a segment end has more than one other segment end connected
* - and obviously when no connected item found * - and obviously when no connected item found
* Vias are a special case, because we must see others segment connected on others layers * Vias are a special case, because we must see others segment connected on others layers
...@@ -284,9 +286,6 @@ static void Marque_Chaine_segments( BOARD* aPcb, wxPoint aRef_pos, int aLayerMas ...@@ -284,9 +286,6 @@ static void Marque_Chaine_segments( BOARD* aPcb, wxPoint aRef_pos, int aLayerMas
pt_via = Fast_Locate_Via( aPcb->m_Track, NULL, aRef_pos, aLayerMask ); pt_via = Fast_Locate_Via( aPcb->m_Track, NULL, aRef_pos, aLayerMask );
if( pt_via ) if( pt_via )
{ {
if( pt_via->GetState( EDIT ) )
return;
aLayerMask = pt_via->ReturnMaskLayer(); aLayerMask = pt_via->ReturnMaskLayer();
aList->push_back( pt_via ); aList->push_back( pt_via );
...@@ -302,9 +301,6 @@ static void Marque_Chaine_segments( BOARD* aPcb, wxPoint aRef_pos, int aLayerMas ...@@ -302,9 +301,6 @@ static void Marque_Chaine_segments( BOARD* aPcb, wxPoint aRef_pos, int aLayerMas
while( ( pt_segm = Fast_Locate_Piste( pt_segm, NULL, while( ( pt_segm = Fast_Locate_Piste( pt_segm, NULL,
aRef_pos, aLayerMask ) ) != NULL ) aRef_pos, aLayerMask ) ) != NULL )
{ {
if( pt_segm->GetState( EDIT ) ) // End of track
return;
if( pt_segm->GetState( BUSY ) ) // already found and selected: skip it if( pt_segm->GetState( BUSY ) ) // already found and selected: skip it
{ {
pt_segm = pt_segm->Next(); pt_segm = pt_segm->Next();
......
...@@ -296,14 +296,14 @@ void DIALOG_EXCHANGE_MODULE::Change_ModuleId( bool aUseValue ) ...@@ -296,14 +296,14 @@ void DIALOG_EXCHANGE_MODULE::Change_ModuleId( bool aUseValue )
check_module_value = true; check_module_value = true;
value = m_CurrentModule->m_Value->m_Text; value = m_CurrentModule->m_Value->m_Text;
msg.Printf( _( "Change modules <%s> -> <%s> (val = %s)?" ), msg.Printf( _( "Change modules <%s> -> <%s> (val = %s)?" ),
m_CurrentModule->m_LibRef.GetData(), GetChars( m_CurrentModule->m_LibRef ),
newmodulename.GetData(), GetChars( newmodulename ),
m_CurrentModule->m_Value->m_Text.GetData() ); GetChars( m_CurrentModule->m_Value->m_Text ) );
} }
else else
{ {
msg.Printf( _( "Change modules <%s> -> <%s> ?" ), msg.Printf( _( "Change modules <%s> -> <%s> ?" ),
lib_reference.GetData(), newmodulename.GetData() ); GetChars( lib_reference ), GetChars( newmodulename ) );
} }
if( !IsOK( this, msg ) ) if( !IsOK( this, msg ) )
...@@ -327,7 +327,7 @@ void DIALOG_EXCHANGE_MODULE::Change_ModuleId( bool aUseValue ) ...@@ -327,7 +327,7 @@ void DIALOG_EXCHANGE_MODULE::Change_ModuleId( bool aUseValue )
if( value.CmpNoCase( Module->m_Value->m_Text ) != 0 ) if( value.CmpNoCase( Module->m_Value->m_Text ) != 0 )
continue; continue;
} }
if( Change_1_Module( Module, newmodulename.GetData(), &pickList, ShowErr ) ) if( Change_1_Module( Module, newmodulename, &pickList, ShowErr ) )
change = true; change = true;
else if( ShowErr ) else if( ShowErr )
ShowErr--; ShowErr--;
...@@ -376,7 +376,7 @@ void DIALOG_EXCHANGE_MODULE::Change_ModuleAll() ...@@ -376,7 +376,7 @@ void DIALOG_EXCHANGE_MODULE::Change_ModuleAll()
for( ; Module && ( Module->Type() == TYPE_MODULE ); Module = PtBack ) for( ; Module && ( Module->Type() == TYPE_MODULE ); Module = PtBack )
{ {
PtBack = Module->Back(); PtBack = Module->Back();
if( Change_1_Module( Module, Module->m_LibRef.GetData(), &pickList, ShowErr ) ) if( Change_1_Module( Module, Module->m_LibRef, &pickList, ShowErr ) )
change = true; change = true;
else if( ShowErr ) else if( ShowErr )
ShowErr--; ShowErr--;
...@@ -424,7 +424,7 @@ bool DIALOG_EXCHANGE_MODULE::Change_1_Module( MODULE* Module, ...@@ -424,7 +424,7 @@ bool DIALOG_EXCHANGE_MODULE::Change_1_Module( MODULE* Module,
/* Chargement du module */ /* Chargement du module */
Line.Printf( _( "Change module %s (%s) " ), Line.Printf( _( "Change module %s (%s) " ),
Module->m_Reference->m_Text.GetData(), oldnamecmp.GetData() ); GetChars( Module->m_Reference->m_Text ), GetChars( oldnamecmp ) );
m_WinMessages->AppendText( Line ); m_WinMessages->AppendText( Line );
namecmp.Trim( true ); namecmp.Trim( true );
......
...@@ -256,7 +256,7 @@ int BOARD::ClipAreaPolygon( PICKED_ITEMS_LIST * aNewZonesList, ...@@ -256,7 +256,7 @@ int BOARD::ClipAreaPolygon( PICKED_ITEMS_LIST * aNewZonesList,
{ {
wxString str; wxString str;
str.Printf( wxT( "Area %8.8X of net \"%s\" has arcs intersecting other sides.\n" ), str.Printf( wxT( "Area %8.8X of net \"%s\" has arcs intersecting other sides.\n" ),
aCurrArea->m_TimeStamp, aCurrArea->m_Netname.GetData() ); aCurrArea->m_TimeStamp, GetChars( aCurrArea->m_Netname ) );
str += wxT( "This may cause problems with other editing operations,\n" ); str += wxT( "This may cause problems with other editing operations,\n" );
str += wxT( "such as adding cutouts. It can't be fixed automatically.\n" ); str += wxT( "such as adding cutouts. It can't be fixed automatically.\n" );
str += wxT( "Manual correction is recommended." ); str += wxT( "Manual correction is recommended." );
...@@ -279,7 +279,7 @@ int BOARD::ClipAreaPolygon( PICKED_ITEMS_LIST * aNewZonesList, ...@@ -279,7 +279,7 @@ int BOARD::ClipAreaPolygon( PICKED_ITEMS_LIST * aNewZonesList,
wxString str; wxString str;
str.Printf( wxT( str.Printf( wxT(
"Area %8.8X of net \"%s\" is self-intersecting and will be clipped.\n" ), "Area %8.8X of net \"%s\" is self-intersecting and will be clipped.\n" ),
aCurrArea->m_TimeStamp, aCurrArea->m_Netname.GetData() ); aCurrArea->m_TimeStamp, GetChars( aCurrArea->m_Netname ) );
str += wxT( "This may result in splitting the area.\n" ); str += wxT( "This may result in splitting the area.\n" );
str += wxT( "If the area is complex, this may take a few seconds." ); str += wxT( "If the area is complex, this may take a few seconds." );
wxMessageBox( str ); wxMessageBox( str );
...@@ -445,7 +445,7 @@ int BOARD::CombineAllAreasInNet( PICKED_ITEMS_LIST* aDeletedList, int aNetCode, ...@@ -445,7 +445,7 @@ int BOARD::CombineAllAreasInNet( PICKED_ITEMS_LIST* aDeletedList, int aNetCode,
"Areas %d and %d of net \"%s\" intersect, but some of the intersecting sides are arcs.\n" ), "Areas %d and %d of net \"%s\" intersect, but some of the intersecting sides are arcs.\n" ),
ia1 + 1, ia1 + 1,
ia2 + 1, ia2 + 1,
curr_area->m_Netname.GetData() ); GetChars( curr_area->m_Netname ) );
str += wxT( "Therefore, these areas can't be combined." ); str += wxT( "Therefore, these areas can't be combined." );
wxMessageBox( str ); wxMessageBox( str );
} }
......
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